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: 5500871 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4B2629F30B for ; Tue, 16 Dec 2014 14:12:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BBE420A22 for ; Tue, 16 Dec 2014 14:12:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6014320A21 for ; Tue, 16 Dec 2014 14:12:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbaLPOLF (ORCPT ); Tue, 16 Dec 2014 09:11:05 -0500 Received: from c-82-192-226-27.customer.ggaweb.ch ([82.192.226.27]:35233 "EHLO dizzy-6.o2s.ch" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751055AbaLPOLB (ORCPT ); Tue, 16 Dec 2014 09:11:01 -0500 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 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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