From patchwork Thu Aug 11 10:49:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sonic zhang X-Patchwork-Id: 1056512 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 p7BBAi99001930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Aug 2011 11:11:05 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QrT9v-0002UO-QE; Thu, 11 Aug 2011 11:10:43 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QrT9u-0002UH-8b for spi-devel-general@lists.sourceforge.net; Thu, 11 Aug 2011 11:10:42 +0000 Received-SPF: neutral (sog-mx-3.v43.ch3.sourceforge.com: 216.32.181.186 is neither permitted nor denied by domain of gmail.com) client-ip=216.32.181.186; envelope-from=sonic.adi@gmail.com; helo=ch1outboundpool.messaging.microsoft.com; Received: from ch1ehsobe006.messaging.microsoft.com ([216.32.181.186] helo=ch1outboundpool.messaging.microsoft.com) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1QrT9t-0006WA-Hr for spi-devel-general@lists.sourceforge.net; Thu, 11 Aug 2011 11:10:42 +0000 Received: from mail131-ch1-R.bigfish.com (216.32.181.172) by CH1EHSOBE013.bigfish.com (10.43.70.63) with Microsoft SMTP Server id 14.1.225.22; Thu, 11 Aug 2011 10:55:29 +0000 Received: from mail131-ch1 (localhost.localdomain [127.0.0.1]) by mail131-ch1-R.bigfish.com (Postfix) with ESMTP id 0B4E817E8115; Thu, 11 Aug 2011 10:55:30 +0000 (UTC) X-SpamScore: 1 X-BigFish: VS1(zzzz1202hzz8275bhz2ei87h2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:137.71.25.57; KIP:(null); UIP:(null); IPVD:NLI; H:nwd2mta2.analog.com; RD:nwd2mail11.analog.com; EFVD:NLI Received-SPF: neutral (mail131-ch1: 137.71.25.57 is neither permitted nor denied by domain of gmail.com) client-ip=137.71.25.57; envelope-from=sonic.adi@gmail.com; helo=nwd2mta2.analog.com ; 2.analog.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail131-ch1 (localhost.localdomain [127.0.0.1]) by mail131-ch1 (MessageSwitch) id 1313060129914214_1984; Thu, 11 Aug 2011 10:55:29 +0000 (UTC) Received: from CH1EHSMHS003.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.250]) by mail131-ch1.bigfish.com (Postfix) with ESMTP id DB7E3588053; Thu, 11 Aug 2011 10:55:29 +0000 (UTC) Received: from nwd2mta2.analog.com (137.71.25.57) by CH1EHSMHS003.bigfish.com (10.43.70.3) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 11 Aug 2011 10:55:27 +0000 Received: from NWD2HUBCAS2.ad.analog.com (nwd2hubcas2.ad.analog.com [10.64.73.30]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id p7BB6NSh027367 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 11 Aug 2011 07:06:23 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS2.ad.analog.com (10.64.73.30) with Microsoft SMTP Server id 8.3.83.0; Thu, 11 Aug 2011 06:55:26 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.1/8.14.1) with ESMTP id p7BAtOo1019453; Thu, 11 Aug 2011 06:55:25 -0400 (EDT) Received: from localhost.localdomain (unknown [10.99.22.103]) by linux.site (Postfix) with ESMTP id 08A0C4285EF3; Wed, 10 Aug 2011 21:10:29 -0600 (MDT) From: Sonic Zhang To: Grant Likely Subject: [PATCH] spi:spi_bfin5xx: SPI SSEL deasserted too early in soft irq mode. Date: Thu, 11 Aug 2011 18:49:21 +0800 Message-ID: <1313059761-24703-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: 1QrT9t-0006WA-Hr 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]); Thu, 11 Aug 2011 11:11:05 +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 --- drivers/spi/spi-bfin5xx.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c index b8d25f2..b9e7e4d 100644 --- a/drivers/spi/spi-bfin5xx.c +++ b/drivers/spi/spi-bfin5xx.c @@ -870,8 +870,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 */