From patchwork Thu Mar 20 11:11:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 26675 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EA1A620143 for ; Thu, 20 Mar 2014 11:12:19 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id lx4sf2487757iec.7 for ; Thu, 20 Mar 2014 04:12:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=oRqsvmwiUzkKs/bOVT7UoIihIAf7IHqfTEoqVcGLfRc=; b=kG9iKOlYQbMZ97LyrNJp4ItqBbqqFqxJIFhIJ9Xx3X12PTmotORB7n8fCMT55+iALo f3mkt1+26SSMl8WJkp1DgpKsOMThMQYaPkVFt8Lnsa8dgeSccNsZ5pkf4vMj3pXNjCCa ogidM7N8BR+NjexyejV8HpSDjQ8dLy8jga65H313Vy7Q2BsnkDZmA6MTACGMNlLjC+pI EaRG5gaZdL2wp/FAqmdnvFAmmA/u0bG/25FdP2AmPgEsqEywpe+6eMdmWVuWH556ik5W Vjj2th32zWu39Jzuy74DPNVwiV0sZkRpGYf9O+dqy9w9RuU2CDlxEVssCZWlQEUZXRfu hbUQ== X-Gm-Message-State: ALoCoQk0OrAQH0+5abtfMYgDdWLLZn093eQKUUw0d6sYcuIQK5r9cTwGX5dOb2Jy++TveJsnF6af X-Received: by 10.182.133.6 with SMTP id oy6mr3441666obb.31.1395313939339; Thu, 20 Mar 2014 04:12:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.167 with SMTP id 36ls202413qgn.55.gmail; Thu, 20 Mar 2014 04:12:19 -0700 (PDT) X-Received: by 10.220.104.210 with SMTP id q18mr24313437vco.9.1395313939217; Thu, 20 Mar 2014 04:12:19 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id tx7si339854vcb.116.2014.03.20.04.12.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 04:12:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so741189veb.12 for ; Thu, 20 Mar 2014 04:12:19 -0700 (PDT) X-Received: by 10.220.139.198 with SMTP id f6mr162515vcu.47.1395313939111; Thu, 20 Mar 2014 04:12:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp379090vck; Thu, 20 Mar 2014 04:12:18 -0700 (PDT) X-Received: by 10.66.163.164 with SMTP id yj4mr45306101pab.91.1395313937818; Thu, 20 Mar 2014 04:12:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wp10si1233811pbc.103.2014.03.20.04.12.16; Thu, 20 Mar 2014 04:12:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757828AbaCTLMM (ORCPT + 26 others); Thu, 20 Mar 2014 07:12:12 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:41704 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757544AbaCTLMJ (ORCPT ); Thu, 20 Mar 2014 07:12:09 -0400 Received: by mail-we0-f175.google.com with SMTP id q58so468477wes.34 for ; Thu, 20 Mar 2014 04:12:08 -0700 (PDT) X-Received: by 10.194.238.231 with SMTP id vn7mr1562621wjc.76.1395313928429; Thu, 20 Mar 2014 04:12:08 -0700 (PDT) Received: from lee--X1.home (host109-148-116-196.range109-148.btcentralplus.com. [109.148.116.196]) by mx.google.com with ESMTPSA id jd2sm5535554wic.9.2014.03.20.04.12.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 04:12:07 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, computersforpeace@gmail.com Cc: lee.jones@linaro.org, kernel@stlinux.com, linux-mtd@lists.infradead.org, dwmw2@infradead.org, angus.clark@st.com Subject: [PATCH 4/5] mtd: st_spi_fsm: Allow loop to run at least once before giving up CPU Date: Thu, 20 Mar 2014 11:11:46 +0000 Message-Id: <1395313907-25318-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395313907-25318-1-git-send-email-lee.jones@linaro.org> References: <1395313907-25318-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Reported-by: Brian Norris Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 9de753d..921b44a 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -860,8 +860,6 @@ static uint8_t stfsm_wait_busy(struct stfsm *fsm) */ deadline = jiffies + FLASH_MAX_BUSY_WAIT; while (!timeout) { - cond_resched(); - if (time_after_eq(jiffies, deadline)) timeout = 1; @@ -880,6 +878,8 @@ static uint8_t stfsm_wait_busy(struct stfsm *fsm) if (!timeout) /* Restart */ writel(seq->seq_cfg, fsm->base + SPI_FAST_SEQ_CFG); + + cond_resched(); } dev_err(fsm->dev, "timeout on wait_busy\n");