From patchwork Tue Dec 16 14:10:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?David_Lanzend=C3=B6rfer?= X-Patchwork-Id: 421938 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2D284140081 for ; Wed, 17 Dec 2014 01:14:33 +1100 (AEDT) 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 1Y0sqi-0001sb-Bv; Tue, 16 Dec 2014 14:11:40 +0000 Received: from c-82-192-226-27.customer.ggaweb.ch ([82.192.226.27] helo=dizzy-6.o2s.ch) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y0sqP-0001iu-HD for linux-arm-kernel@lists.infradead.org; Tue, 16 Dec 2014 14:11:26 +0000 Received: from dizzy-6.o2s.ch (localhost [IPv6:::1]) by dizzy-6.o2s.ch (Postfix) with ESMTP id C669A72108E; Tue, 16 Dec 2014 15:10:59 +0100 (CET) Subject: [PATCH 1/4] mmc: sunxi: Fix setup of last descriptor of dma transfer From: David =?utf-8?q?Lanzend=C3=B6rfer?= To: Ulf Hansson , Tomeu Vizoso , Arnd Bergmann , linux-mmc@vger.kernel.org, Chris Ball , linux-kernel@vger.kernel.org, Peter Griffin , Hans de Goede , Chen-Yu Tsai , David =?utf-8?q?Lanzend=C3=B6rfer?= , =?utf-8?b?5p2O5oOz?= , Maxime Ripard , linux-arm-kernel@lists.infradead.org Date: Tue, 16 Dec 2014 15:10:59 +0100 Message-ID: <20141216141059.3036.53205.stgit@dizzy-6.o2s.ch> In-Reply-To: <20141216140921.3036.14668.stgit@dizzy-6.o2s.ch> References: <20141216140921.3036.14668.stgit@dizzy-6.o2s.ch> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141216_061121_759425_852FA406 X-CRM114-Status: UNSURE ( 8.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Hans de Goede The last descriptor might be the first descriptor as well, so use masking to add the LD (last descriptor) bit and drop the DIC (disable interrupt on completion) bit rather then hard assignment as hard assigment will override the FD (first descriptor) bit if there is only 1 descriptor. Also set the ER (end of ring) bit and clear buf_addr_ptr2 on the last descriptor, like the android kernel code does. Signed-off-by: Hans de Goede Signed-off-by: David Lanzendörfer Reported-by: 李想 --- drivers/mmc/host/sunxi-mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 15cb8b7..1fe54a8 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -310,7 +310,9 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host, } pdes[0].config |= SDXC_IDMAC_DES0_FD; - pdes[i - 1].config = SDXC_IDMAC_DES0_OWN | SDXC_IDMAC_DES0_LD; + pdes[i - 1].config |= SDXC_IDMAC_DES0_LD | SDXC_IDMAC_DES0_ER; + pdes[i - 1].config &= ~SDXC_IDMAC_DES0_DIC; + pdes[i - 1].buf_addr_ptr2 = 0; /* * Avoid the io-store starting the idmac hitting io-mem before the