From patchwork Fri Aug 12 02:48:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sonic zhang X-Patchwork-Id: 1059522 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7C3ANeN014466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 12 Aug 2011 03:10:45 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Qri8a-0004hc-6p; Fri, 12 Aug 2011 03:10:20 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Qri8Z-0004hW-4C for spi-devel-general@lists.sourceforge.net; Fri, 12 Aug 2011 03:10:19 +0000 Received-SPF: neutral (sog-mx-4.v43.ch3.sourceforge.com: 216.32.180.31 is neither permitted nor denied by domain of gmail.com) client-ip=216.32.180.31; envelope-from=sonic.adi@gmail.com; helo=VA3EHSOBE005.bigfish.com; Received: from va3ehsobe005.messaging.microsoft.com ([216.32.180.31] helo=VA3EHSOBE005.bigfish.com) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1Qri8Y-0002cu-FP for spi-devel-general@lists.sourceforge.net; Fri, 12 Aug 2011 03:10:19 +0000 Received: from mail138-va3-R.bigfish.com (10.7.14.250) by VA3EHSOBE005.bigfish.com (10.7.40.25) with Microsoft SMTP Server id 14.1.225.22; Fri, 12 Aug 2011 02:55:06 +0000 Received: from mail138-va3 (localhost.localdomain [127.0.0.1]) by mail138-va3-R.bigfish.com (Postfix) with ESMTP id BE49EA50354; Fri, 12 Aug 2011 02:55:05 +0000 (UTC) X-SpamScore: 1 X-BigFish: VS1(zzzz1202hzz8275bhz2ei87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:137.71.25.55; KIP:(null); UIP:(null); IPVD:NLI; H:nwd2mta1.analog.com; RD:nwd2mail10.analog.com; EFVD:NLI Received-SPF: neutral (mail138-va3: 137.71.25.55 is neither permitted nor denied by domain of gmail.com) client-ip=137.71.25.55; envelope-from=sonic.adi@gmail.com; helo=nwd2mta1.analog.com ; 1.analog.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail138-va3 (localhost.localdomain [127.0.0.1]) by mail138-va3 (MessageSwitch) id 1313117705579259_2632; Fri, 12 Aug 2011 02:55:05 +0000 (UTC) Received: from VA3EHSMHS031.bigfish.com (unknown [10.7.14.237]) by mail138-va3.bigfish.com (Postfix) with ESMTP id 59BBA117804D; Fri, 12 Aug 2011 02:55:05 +0000 (UTC) Received: from nwd2mta1.analog.com (137.71.25.55) by VA3EHSMHS031.bigfish.com (10.7.99.41) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 12 Aug 2011 02:54:59 +0000 Received: from NWD2HUBCAS1.ad.analog.com (nwd2hubcas1.ad.analog.com [10.64.73.29]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id p7C2qUSI001042 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 11 Aug 2011 22:52:30 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS1.ad.analog.com (10.64.73.29) with Microsoft SMTP Server id 8.3.83.0; Thu, 11 Aug 2011 22:54:58 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.1/8.14.1) with ESMTP id p7C2svhA021660; Thu, 11 Aug 2011 22:54:58 -0400 (EDT) Received: from localhost.localdomain (unknown [10.99.22.103]) by linux.site (Postfix) with ESMTP id BD3E842953F5; Thu, 11 Aug 2011 13:10:03 -0600 (MDT) From: Sonic Zhang To: Grant Likely Subject: [PATCH v2] spi:spi_bfin5xx: SPI SSEL deasserted too early in soft irq mode. Date: Fri, 12 Aug 2011 10:48:53 +0800 Message-ID: <1313117333-26763-1-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-Spam-Score: 1.9 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sonic.adi[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list 0.0 TVD_SUBJ_NUM_OBFU_MINFP TVD_SUBJ_NUM_OBFU_MINFP X-Headers-End: 1Qri8Y-0002cu-FP Cc: spi-devel-general@lists.sourceforge.net, Sonic Zhang , LKML , uclinux-dist-devel@blackfin.uclinux.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Aug 2011 03:10:45 +0000 (UTC) From: Sonic Zhang Poll the FIFO till it is empty before deassert SSEL in pump_transfers in soft irq mode. No polling is necessary in interrupt mode and error handling. Signed-off-by: Sonic Zhang Acked-by: Barry Song <21cnbao@gmail.com> --- drivers/spi/spi-bfin5xx.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c index b8d25f2..7e03e7d 100644 --- a/drivers/spi/spi-bfin5xx.c +++ b/drivers/spi/spi-bfin5xx.c @@ -587,6 +587,7 @@ static void bfin_spi_pump_transfers(unsigned long data) if (message->state == DONE_STATE) { dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n"); message->status = 0; + bfin_spi_flush(drv_data); bfin_spi_giveback(drv_data); return; } @@ -870,8 +871,10 @@ static void bfin_spi_pump_transfers(unsigned long data) message->actual_length += drv_data->len_in_bytes; /* Move to next transfer of this msg */ message->state = bfin_spi_next_transfer(drv_data); - if (drv_data->cs_change) + if (drv_data->cs_change) { + bfin_spi_flush(drv_data); bfin_spi_cs_deactive(drv_data, chip); + } } /* Schedule next transfer tasklet */