From patchwork Wed Apr 4 17:00:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10322929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E13AB6032A for ; Wed, 4 Apr 2018 17:00:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2114286D9 for ; Wed, 4 Apr 2018 17:00:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA9A228B26; Wed, 4 Apr 2018 17:00:42 +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=-6.9 required=2.0 tests=BAYES_00,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 69C84286D9 for ; Wed, 4 Apr 2018 17:00:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752338AbeDDRAl (ORCPT ); Wed, 4 Apr 2018 13:00:41 -0400 Received: from sauhun.de ([88.99.104.3]:56846 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752591AbeDDRAk (ORCPT ); Wed, 4 Apr 2018 13:00:40 -0400 Received: from localhost (p54B33739.dip0.t-ipconnect.de [84.179.55.57]) by pokefinder.org (Postfix) with ESMTPSA id 3BF2D2E7604; Wed, 4 Apr 2018 19:00:39 +0200 (CEST) From: Wolfram Sang To: linux-mmc@vger.kernel.org, Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang Subject: [RFC PATCH] mmc: renesas_sdhi_internal_dmac: fall back to PIO if scatterlist doesn't match Date: Wed, 4 Apr 2018 19:00:35 +0200 Message-Id: <20180404170035.5507-1-wsa@the-dreams.de> X-Mailer: git-send-email 2.11.0 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 From: Wolfram Sang If we detect an incompatible scatterlist, we should fall back to PIO, too. Signed-off-by: Wolfram Sang --- I found this while working on the RX DMA issue. I don't see a reason why we shouldn't fall back in this case as well. But maybe I am missing something. Shimoda-san: what do you think? drivers/mmc/host/renesas_sdhi_internal_dmac.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index 380570a26a09..561e90755a3b 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -161,11 +161,7 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host, enum dma_data_direction dir; int ret; - /* This DMAC cannot handle if sg_len is not 1 */ - WARN_ON(host->sg_len > 1); - - /* This DMAC cannot handle if buffer is not 8-bytes alignment */ - if (!IS_ALIGNED(sg->offset, 8)) + if (WARN_ON(host->sg_len > 1) || !IS_ALIGNED(sg->offset, 8)) goto force_pio; if (data->flags & MMC_DATA_READ) {