From patchwork Wed Nov 21 07:42:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JABLONSKY Jan X-Patchwork-Id: 10692065 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 E132A13AD for ; Wed, 21 Nov 2018 07:50:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCEC52B80C for ; Wed, 21 Nov 2018 07:50:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0FCD2B854; Wed, 21 Nov 2018 07:50:20 +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,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 1BEB12B850 for ; Wed, 21 Nov 2018 07:50:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728163AbeKUSXp (ORCPT ); Wed, 21 Nov 2018 13:23:45 -0500 Received: from thsbbfxrt01p.thalesgroup.com ([192.54.144.131]:37334 "EHLO thsbbfxrt01p.thalesgroup.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728144AbeKUSXp (ORCPT ); Wed, 21 Nov 2018 13:23:45 -0500 X-Greylist: delayed 501 seconds by postgrey-1.27 at vger.kernel.org; Wed, 21 Nov 2018 13:23:43 EST Received: from thsbbfxrt01p.thalesgroup.com (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 430Dzm6b7Mz8Tc; Wed, 21 Nov 2018 08:41:56 +0100 (CET) From: JABLONSKY Jan To: Jaehoon Chung CC: Ulf Hansson , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: dw_mmc: IDMAC Invalidate cache after read Thread-Topic: dw_mmc: IDMAC Invalidate cache after read Thread-Index: AQHUgW3NJS3s6fdIZ0u0s1IZXxrnfg== Date: Wed, 21 Nov 2018 07:42:49 +0000 Message-ID: <1542786115.18775.83.camel@atviedlbe741.rss.d3s.at.thales> Accept-Language: en-US, fr-FR Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.10.4-0ubuntu2 x-originating-ip: [10.177.70.241] x-pmwin-version: 4.0.3, Antivirus-Engine: 3.73.0, Antivirus-Data: 5.57 Content-ID: <447A5C5E3632EB419ED9A2822D0C5505@iris.infra.thales> MIME-Version: 1.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 CPU may not see most up-to-date and correct copy of DMA buffer, when internal DMA controller is in use. Problem appears on The Altera SoC FPGA (uses integrated DMA controller), during higher CPU and system memory load Signed-off-by: Jan Jablonsky --- drivers/mmc/host/dw_mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 80dc2fd..63873d9 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -499,8 +499,7 @@ static void dw_mci_dmac_complete_dma(void *arg) dev_vdbg(host->dev, "DMA complete\n"); - if ((host->use_dma == TRANS_MODE_EDMAC) && - data && (data->flags & MMC_DATA_READ)) + if (data && (data->flags & MMC_DATA_READ)) /* Invalidate cache after read */ dma_sync_sg_for_cpu(mmc_dev(host->slot->mmc), data->sg,