From patchwork Fri Jun 29 10:01:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10496079 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 22AB1601C7 for ; Fri, 29 Jun 2018 10:02:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 028E628A78 for ; Fri, 29 Jun 2018 10:02:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAB1629052; Fri, 29 Jun 2018 10:02:52 +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=-5.4 required=2.0 tests=AXB_X_OUTLOOKPROT_ENVSDR, BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 7995A292E5 for ; Fri, 29 Jun 2018 10:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754822AbeF2KCu (ORCPT ); Fri, 29 Jun 2018 06:02:50 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:46469 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752050AbeF2KCr (ORCPT ); Fri, 29 Jun 2018 06:02:47 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 29 Jun 2018 19:02:45 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id E11A771AD7; Fri, 29 Jun 2018 19:02:44 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.51,285,1526310000"; d="scan'208";a="283982115" Received: from mail-ty1jpn01lp0184.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([23.103.139.184]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 29 Jun 2018 19:02:44 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jm1HKe4IHDE2/4GBPm6t2padP3PHl5CJpBFA825NYBk=; b=i5LZH6C2M+/2zS9UZUqIz3BQR0OYDADfShfB3kkbbQ4czPj9sOpaaGg+M9g8lSyHa7XJcFwAxq6lF1BSybPF83xCHjEyVK99Q8gKt+Mve7KRyESMW5RcQw+nb7CdWxICXu0izGbEMYIoG5Rh5nblhxG0aF5TetmVskcn3L3lLRs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by OSAPR01MB2291.jpnprd01.prod.outlook.com (2603:1096:603:1c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Fri, 29 Jun 2018 10:02:42 +0000 From: Yoshihiro Shimoda To: wsa+renesas@sang-engineering.com, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, stable@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH v2 1/2] mmc: renesas_sdhi_internal_dmac: Fix missing unmap in error patch Date: Fri, 29 Jun 2018 19:01:44 +0900 Message-Id: <1530266505-19953-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530266505-19953-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1530266505-19953-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYAPR01CA0153.jpnprd01.prod.outlook.com (2603:1096:404:7e::21) To OSAPR01MB2291.jpnprd01.prod.outlook.com (2603:1096:603:1c::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bbf45712-b81b-43dd-0b29-08d5dda774aa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:OSAPR01MB2291; X-Microsoft-Exchange-Diagnostics: 1; OSAPR01MB2291; 3:DhaS6KzQEHRq3Y2tqb+bGayqmwLx/3FGJHocrubwmkRD5hnH44EUBiXiTlNVIAYnDDAP8EmfFMhlLF7eysjblGO+ZjUYWBABRB+PYRxuf/51yVW8Tkavc5z7/nDC/SpCes6lDFBS8z0ZkznqE8tjZFvthiYReA2L4v/UV/Pd7Ayfz6V3ojbqJE1ljH3DHkSn1Cgqd2OoAdFgkllkvxXpZnnAYv96E5kPcSt7Zr8rzauXOLGtlAMZQIp3UPRqUT9G; 25:PRDmCVkRIG4OkXWxtkfvVI6vQeup8VuTOheynGRfq56XhdMtgVbsHO5Ic44Ju4KgnQPhBarvvVFNyZ5DMDcbjIXBgD6acHYNBrPgHMOds9i2aMUjRna6Gl4Phl9fW371s9XeuVV0pLNkSSUQYZ2bN+8LcMY3lXais1wrt/EZfe7ocbVEJRbVuZdEUhgGr7ApprmAp4K515GrwpMqTHUVnCvvvUjXlBhW4iZECLzfWacyTX2xgkvZDWd28zjPAyAZMotxLKT3C6l0nNHczIoIx7q2KJoWUUlzZYD84jbrgpTpiE2dUk3UmtYXSyCZTGftgsfQnHnPaKIsZfSu77NdoQ==; 31:EcU4RqpkTna8RqrtD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mzF7SmbXdV2DfxXN4yJMvcn6US9PAyMdvkDaIh/u+Nrg4YIQ/MACyav268l8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(3002001)(93006095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:OSAPR01MB2291; BCL:0; PCL:0; RULEID:; SRVR:OSAPR01MB2291; X-Forefront-PRVS: 0718908305 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(376002)(366004)(396003)(136003)(346002)(39860400002)(199004)(189003)(105586002)(48376002)(8676002)(14444005)(81166006)(81156014)(78352004)(486006)(5660300001)(26005)(7736002)(16526019)(476003)(36756003)(97736004)(386003)(6506007)(106356001)(6512007)(305945005)(446003)(2616005)(316002)(11346002)(956004)(16586007)(53936002)(4326008)(107886003)(50226002)(6116002)(42882007)(66066001)(47776003)(3846002)(6486002)(76176011)(51416003)(50466002)(2906002)(8936002)(25786009)(498600001)(68736007)(52116002)(3720700003); DIR:OUT; SFP:1102; SCL:1; SRVR:OSAPR01MB2291; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:0; MX:0; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; OSAPR01MB2291; 23:JFtJGf7m5ln2KM/zAAo0qZTRMh3x46yAX+BalNB24?= =?us-ascii?Q?BHGQGLJOn2cZchylAMfr224BtzdtoUBsamvLsxpTGMPfV6HrtkhArind2HT6?= =?us-ascii?Q?gw4X18Muw10m5kh7wRclaRVqO6ViALz2xa3MYXj0Pf0y6MbHCiD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7WOSRsqYqdt/Zo7SDQET4MBpQkyn2cEVAoDtybssAkT+R531Q6l1bdNGqtno9zlwb9nU9D1DiCNzdw0+CbH8rnjJUOBbw==; 5:QNh/2IWkrL2sExl3lWu3SPBG9zgq2BRXUfk/T+qHFc47OAQjcW8yoJPZrF7CkiBsbTSYWvHtSKkF6GKOgEX4Mb1/eAZFXmlclWcAI9tWpRv8y7L76+Qh5KXDytvZ9XZLssAl6/c53+QEmcHvV8o+jPY4hPScngY9HmbjhVl5AWw=; 24:HfAnHRPXJQPrjGbPg9o/PFLa0JbKYCKqTcLcbnXIrmspbluBRKN7Rj3MEx8yzqwKC0H0eviwk5CM9KtEqDBgrrxpVjNpghLskL5zbbaq2TY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; OSAPR01MB2291; 7:voUSFHkooiX1t6+CZS+vOLcEf39KQo8GkMR1PELjxU/7tt0hvp8NzJ7h8P/G/pa35N74EXWeI59H323LWcTQ4ic/7Dwa3r3vXcBqaR+NH+zOth+REdw26/yp/gqW7l6y2sYCQUObJOF7OvnOYrr46JYI82IlEqVzTZY6kq8R3Vc/AAWUyCmGfiqk1UHYhbIegtU01vprQt/GeILv/2IZ9ASj1ZqYQysHXxawJ2CalCq1X4dPhf0RSLFrRXm/+Gb5; 20:zXIrQGadGqaS6imQKt0sJJrxDK9uoemSLL/W0/b3mvNppCsjMAnp2lrQ3tHwgCDnLw0gw3kO4dlZxql4IcDmG4wsiNpKkjAb4TMOPfocxOb2aBGo181Z+Y+hPV6pfarNCdFACnGjxDOLCziDbyllgTIGJ2zdqFWgfNwgIkav+Ak= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2018 10:02:42.7964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbf45712-b81b-43dd-0b29-08d5dda774aa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSAPR01MB2291 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 This patch fixes an issue that lacks the dma_unmap_sg() calling in the error patch of renesas_sdhi_internal_dmac_start_dma(). Fixes: 0cbc94daa554 ("mmc: renesas_sdhi_internal_dmac: limit DMA RX for old SoCs") Cc: # v4.17+ Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman --- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index f7f9773..d676a20 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -164,17 +164,14 @@ goto force_pio; /* This DMAC cannot handle if buffer is not 8-bytes alignment */ - if (!IS_ALIGNED(sg_dma_address(sg), 8)) { - dma_unmap_sg(&host->pdev->dev, sg, host->sg_len, - mmc_get_dma_dir(data)); - goto force_pio; - } + if (!IS_ALIGNED(sg_dma_address(sg), 8)) + goto force_pio_with_unmap; if (data->flags & MMC_DATA_READ) { dtran_mode |= DTRAN_MODE_CH_NUM_CH1; if (test_bit(SDHI_INTERNAL_DMAC_ONE_RX_ONLY, &global_flags) && test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags)) - goto force_pio; + goto force_pio_with_unmap; } else { dtran_mode |= DTRAN_MODE_CH_NUM_CH0; } @@ -189,6 +186,9 @@ return; +force_pio_with_unmap: + dma_unmap_sg(&host->pdev->dev, sg, host->sg_len, mmc_get_dma_dir(data)); + force_pio: host->force_pio = true; renesas_sdhi_internal_dmac_enable_dma(host, false);