From patchwork Thu Oct 14 01:16:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Gilling X-Patchwork-Id: 251721 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9E1H6gl000563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Oct 2010 01:17:28 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.69) (envelope-from ) id 1P6CRC-0003BR-2e; Thu, 14 Oct 2010 01:16:54 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1P6CRB-0003BM-0y for spi-devel-general@lists.sourceforge.net; Thu, 14 Oct 2010 01:16:53 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of google.com designates 216.239.44.51 as permitted sender) client-ip=216.239.44.51; envelope-from=konkers@google.com; helo=smtp-out.google.com; Received: from smtp-out.google.com ([216.239.44.51]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1P6CR9-00027Q-VE for spi-devel-general@lists.sourceforge.net; Thu, 14 Oct 2010 01:16:52 +0000 Received: from kpbe15.cbf.corp.google.com (kpbe15.cbf.corp.google.com [172.25.105.79]) by smtp-out.google.com with ESMTP id o9E1GjZ8022994; Wed, 13 Oct 2010 18:16:45 -0700 Received: from dirtysouth.mtv.corp.google.com (dirtysouth.mtv.corp.google.com [172.18.103.169]) by kpbe15.cbf.corp.google.com with ESMTP id o9E1GeSq009800; Wed, 13 Oct 2010 18:16:42 -0700 Received: by dirtysouth.mtv.corp.google.com (Postfix, from userid 94083) id 1FC722E771; Wed, 13 Oct 2010 18:16:40 -0700 (PDT) From: Erik Gilling To: linux-tegra@vger.kernel.org Subject: [PATCH] spi: tegra: fix error setting on timeout Date: Wed, 13 Oct 2010 18:16:38 -0700 Message-Id: <1287018998-14931-1-git-send-email-konkers@android.com> X-Mailer: git-send-email 1.7.3.1.1.g1cf9a4 X-System-Of-Record: true X-Spam-Score: -1.1 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 0.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1P6CR9-00027Q-VE Cc: spi-devel-general@lists.sourceforge.net, Erik Gilling 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: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 14 Oct 2010 01:17:29 +0000 (UTC) diff --git a/drivers/spi/spi_tegra.c b/drivers/spi/spi_tegra.c index 0385fde..bb7df02 100644 --- a/drivers/spi/spi_tegra.c +++ b/drivers/spi/spi_tegra.c @@ -338,15 +338,15 @@ static void tegra_spi_rx_dma_complete(struct tegra_dma_req *req) spin_lock_irqsave(&tspi->lock, flags); - if (timeout >= 1000) - m->status = -EIO; - val = spi_tegra_readl(tspi, SLINK_STATUS); val |= SLINK_RDY; spi_tegra_writel(tspi, val, SLINK_STATUS); - m = list_first_entry(&tspi->queue, struct spi_message, queue); + + if (timeout >= 1000) + m->status = -EIO; + spi = m->state; tspi->cur_pos += spi_tegra_drain_rx_fifo(tspi, tspi->cur);