From patchwork Fri Oct 12 14:57:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10638755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50F0E157A for ; Fri, 12 Oct 2018 14:58:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40F162BEC5 for ; Fri, 12 Oct 2018 14:58:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34D782BECA; Fri, 12 Oct 2018 14:58:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D01BA2BEC5 for ; Fri, 12 Oct 2018 14:58:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728786AbeJLWbg (ORCPT ); Fri, 12 Oct 2018 18:31:36 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:52675 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728720AbeJLWbg (ORCPT ); Fri, 12 Oct 2018 18:31:36 -0400 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-07.nifty.com with ESMTP id w9CEvjPA016823; Fri, 12 Oct 2018 23:57:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w9CEvjPA016823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1539356267; bh=gNE/DT+c7dmomudF11g+hbkGUuoIwZPmrwl+ytK2nn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=19e1xXVy8/mZhAhIGINGf7jhjKSgnirV57Kay2CQIN49iN8xYxj7b6KqdeBnQMizR I9MudRozbmuTMUz5RaXQ9oibBq4OChrxPvaVTQdeJKCFOk9P4ylR8HpqJDtr9ypF9w HvErPicdOkz1r010+6Tx8wNU2mVxTy5FSMppPthJndBHfRJZYFa5/p0ik1boGHjwMl rQmCMSUt+effQEsU9+m31dXRzdTfx2CWmNsw4+VXbGKy7+eFigyey56JkJD2BmjoxE K5dCmVdtThyIMALPOu0Av9Xhgq8ArejxfkrDts29j3Xpy3n6Z4kznGCWapuAfUYvyp hxkaNBtWIiZjQ== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Wolfram Sang , Masahiro Yamada , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mmc: uniphier-sd: fix DMA disabling Date: Fri, 12 Oct 2018 23:57:37 +0900 Message-Id: <1539356258-12374-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539356258-12374-1-git-send-email-yamada.masahiro@socionext.com> References: <1539356258-12374-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Once DMA is enabled, it is not possible to disable it because uniphier_sd_dma_endisable() always sets the DMA_ENABLE_DMASDRW bit regardless of the argument 'enable'. It should disable DMA when 'enable' is false. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang --- drivers/mmc/host/uniphier-sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index 10e7b30..10d49aa 100644 --- a/drivers/mmc/host/uniphier-sd.c +++ b/drivers/mmc/host/uniphier-sd.c @@ -78,7 +78,7 @@ static void *uniphier_sd_priv(struct tmio_mmc_host *host) static void uniphier_sd_dma_endisable(struct tmio_mmc_host *host, int enable) { - sd_ctrl_write16(host, CTL_DMA_ENABLE, DMA_ENABLE_DMASDRW); + sd_ctrl_write16(host, CTL_DMA_ENABLE, enable ? DMA_ENABLE_DMASDRW : 0); } /* external DMA engine */ From patchwork Fri Oct 12 14:57:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10638759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBD2E157A for ; Fri, 12 Oct 2018 14:59:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB90B2BECE for ; Fri, 12 Oct 2018 14:59:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F5782BED2; Fri, 12 Oct 2018 14:59:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AE752BEC6 for ; Fri, 12 Oct 2018 14:59:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729047AbeJLWbj (ORCPT ); Fri, 12 Oct 2018 18:31:39 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:52724 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728720AbeJLWbi (ORCPT ); Fri, 12 Oct 2018 18:31:38 -0400 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-07.nifty.com with ESMTP id w9CEvjPB016823; Fri, 12 Oct 2018 23:57:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w9CEvjPB016823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1539356268; bh=mddxV7i40K2p+WcuchNOgFO0VNs4dZslkYzPME553/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0AOSn2MzD4asqNCffRzt1nQ899BrgC9wWwChcteE0U+W/5nFlHMWzT/0c9RZRfqrt 5Bzb6NAN0Lz4p+bmtZPISZ+DXKzaY/go8UGbbpB3AfJOotJnjyQW1GtorumArDUDO7 lbX108BqsS/3tEYHAC9ZLdmd+uU144QthekduJbbIHy1Ho1p4TFDuiAvy4PLBbjmMg 5DVMf8oUepMaLwxwr9im0syvMFTRuoCSABzDZlfzC8YW0q16Uxg2DXwWrMTqy2KEm+ pwfZ77SLvCiLVyoVv/oz+PIN0TbNvH6gBCucygV5vlXyuTWAEteEaRXBjku+/RQQMh 2jL8FABwfSqXA== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Wolfram Sang , Masahiro Yamada , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] mmc: uniphier-sd: avoid using broken DMA RX channel Date: Fri, 12 Oct 2018 23:57:38 +0900 Message-Id: <1539356258-12374-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539356258-12374-1-git-send-email-yamada.masahiro@socionext.com> References: <1539356258-12374-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP host->chan_rx is NULL when UNIPHIER_SD_CAP_BROKEN_DMA_RX quirk flag is set. In this case, it should not set up DMA. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang --- drivers/mmc/host/uniphier-sd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index 10d49aa..1ee9fd0 100644 --- a/drivers/mmc/host/uniphier-sd.c +++ b/drivers/mmc/host/uniphier-sd.c @@ -251,6 +251,9 @@ static void uniphier_sd_internal_dma_start(struct tmio_mmc_host *host, u32 dma_mode; int sg_len; + if ((data->flags & MMC_DATA_READ) && !host->chan_rx) + goto force_pio; + if (WARN_ON(host->sg_len != 1)) goto force_pio;