From patchwork Thu Oct 16 09:26:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: addy ke X-Patchwork-Id: 5089451 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 007F7C11AC for ; Thu, 16 Oct 2014 09:27:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D74720176 for ; Thu, 16 Oct 2014 09:27:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6DF420154 for ; Thu, 16 Oct 2014 09:27:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XehKx-0007TC-Hy; Thu, 16 Oct 2014 09:27:11 +0000 Received: from regular1.263xmail.com ([211.150.99.134]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XehKV-0007CM-A4; Thu, 16 Oct 2014 09:26:44 +0000 Received: from addy.ke?rock-chips.com (unknown [192.168.167.227]) by regular1.263xmail.com (Postfix) with SMTP id 6EDBD5053; Thu, 16 Oct 2014 17:26:11 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from [172.16.7.74] (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 7C2A43DE; Thu, 16 Oct 2014 17:26:07 +0800 (CST) X-RL-SENDER: addy.ke@rock-chips.com X-FST-TO: broonie@kernel.org X-SENDER-IP: 127.0.0.1 X-LOGIN-NAME: addy.ke@rock-chips.com X-UNIQUE-TAG: <2364c55f44b2dc9518b7f3908b103143> X-ATTACHMENT-NUM: 0 X-SENDER: kfx@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.7.74] (unknown [127.0.0.1]) by smtp.263.net (Postfix) whith ESMTP id 182927AD0EV; Thu, 16 Oct 2014 17:26:10 +0800 (CST) Message-ID: <543F8F2A.9040904@rock-chips.com> Date: Thu, 16 Oct 2014 17:26:02 +0800 From: addy ke User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: broonie@kernel.org Subject: Re: [PATCH 2/2] spi/rockchip: fix bug that cause spi transfer timed out in DMA duplex mode References: <1413372311-4203-1-git-send-email-addy.ke@rock-chips.com> <1413372378-4309-1-git-send-email-addy.ke@rock-chips.com> <20141015130547.GE27755@sirena.org.uk> In-Reply-To: <20141015130547.GE27755@sirena.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141016_022644_078854_0A9F1397 X-CRM114-Status: UNSURE ( 7.59 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: heiko@sntech.de, kever.yang@rock-chips.com, linux-kernel@vger.kernel.org, xjq@rock-chips.com, zyw@rock-chips.com, linux-rockchip@lists.infradead.org, grant.likely@linaro.org, hj@rock-chips.com, huangtao@rock-chips.com, devicetree@vger.kernel.org, amstan@google.com, yzq@rock-chips.com, zhangqing@rock-chips.com, cf@rock-chips.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, hl@rock-chips.com, dianders@chromium.org, linux-spi@vger.kernel.org, wei.luo@rock-chips.com, sonnyrao@google.com, olof@lixom.net, zhenfu.fang@rock-chips.com X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, Mark The following changes is nessarry:(if tx complete, spi must be disabled too) Sorry for my mistake, I have not put these changes to this patch. Do I need send patch v2 or a new patch to fix this issure? On 2014/10/15 21:05, Mark Brown wrote: > On Wed, Oct 15, 2014 at 07:26:18PM +0800, Addy Ke wrote: >> In rx mode, dma must be prepared before spi is enabled. >> But in tx and tr mode, spi must be enabled first. > > Applied, thanks. > diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 153269b..87bc16f 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -418,8 +418,10 @@ static void rockchip_spi_dma_txcb(void *data) spin_lock_irqsave(&rs->lock, flags); rs->state &= ~TXBUSY; - if (!(rs->state & RXBUSY)) + if (!(rs->state & RXBUSY)) { + spi_enable_chip(rs, 0); spi_finalize_current_transfer(rs->master); + } spin_unlock_irqrestore(&rs->lock, flags); }