From patchwork Thu Sep 2 21:56:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12473071 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1966C433EF for ; Thu, 2 Sep 2021 21:56:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7AB2960E8B for ; Thu, 2 Sep 2021 21:56:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7AB2960E8B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 20E296B0117; Thu, 2 Sep 2021 17:56:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BE506B0118; Thu, 2 Sep 2021 17:56:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0ACEB6B0119; Thu, 2 Sep 2021 17:56:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id F04136B0117 for ; Thu, 2 Sep 2021 17:56:28 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B524D2B37E for ; Thu, 2 Sep 2021 21:56:28 +0000 (UTC) X-FDA: 78543992856.24.C8D12CB Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP id 5EDA5D00009B for ; Thu, 2 Sep 2021 21:56:28 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id EDDF5603E9; Thu, 2 Sep 2021 21:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619787; bh=71JLXr1/MwNuL+BGYFCmVcS0u+kTqhsa6mapkMlasbs=; h=Date:From:To:Subject:In-Reply-To:From; b=WlyjoCrFbNyL7AU5Egj/m6WB++Zk/xzJmDOnsiSIcUMgH0sCfpQ0onX0uAobsS6Tg CniMBJUEff0Ck/SXw1wuqKPs6q7PTTko1PSNwasPBCP0Dg/DpAPi23WTIqp9rfD7d2 /u7pHAHr5Od9t/v7/w4+Q0TbXFsX88oTXipHJ/5Y= Date: Thu, 02 Sep 2021 14:56:26 -0700 From: Andrew Morton To: akpm@linux-foundation.org, alexs@kernel.org, dalias@libc.org, deanbo422@gmail.com, deller@gmx.de, geoff@infradead.org, green.hu@gmail.com, guoren@kernel.org, hch@lst.de, James.Bottomley@HansenPartnership.com, linux-mm@kvack.org, linux@armlinux.org.uk, mm-commits@vger.kernel.org, nickhu@andestech.com, paul@crapouillou.net, torvalds@linux-foundation.org, tsbogend@alpha.franken.de, ulf.hansson@linaro.org, ysato@users.osdn.me Subject: [patch 121/212] mmc: JZ4740: remove the flush_kernel_dcache_page call in jz4740_mmc_read_data Message-ID: <20210902215626.XuZ8S-pvO%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=WlyjoCrF; spf=pass (imf15.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: 9n7rq8oqts5d43wak7k8hag7eq9fa9bz X-Rspamd-Queue-Id: 5EDA5D00009B X-Rspamd-Server: rspam04 X-HE-Tag: 1630619788-41920 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Christoph Hellwig Subject: mmc: JZ4740: remove the flush_kernel_dcache_page call in jz4740_mmc_read_data Patch series "_kernel_dcache_page fixes and removal". While looking to convert the block layer away from kmap_atomic towards kmap_local_page and prefeably the helpers that abstract it away I noticed that a few block drivers directly or implicitly call flush_kernel_dcache_page before kunmapping a page that has been written to. flush_kernel_dcache_page is documented to to be used in such cases, but flush_dcache_page is actually required when the page could be in the page cache and mapped to userspace, which is pretty much always the case when kmapping an arbitrary page. Unfortunately the documentation doesn't exactly make that clear, which lead to this misused. And it turns out that only the copy_strings / copy_string_kernel in the exec code were actually correct users of flush_kernel_dcache_page, which is why I think we should just remove it and eat the very minor overhead in exec rather than confusing poor driver writers. This patch (of 6): MIPS now implements flush_kernel_dcache_page (as an alias to flush_dcache_page). Link: https://lkml.kernel.org/r/20210712060928.4161649-1-hch@lst.de Link: https://lkml.kernel.org/r/20210712060928.4161649-2-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Linus Torvalds Cc: "James E.J. Bottomley" Cc: Russell King Cc: Guo Ren Cc: Thomas Bogendoerfer Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Cc: Helge Deller Cc: Yoshinori Sato Cc: Rich Felker Cc: Geoff Levand Cc: Paul Cercueil Cc: Ulf Hansson Cc: Alex Shi Signed-off-by: Andrew Morton --- drivers/mmc/host/jz4740_mmc.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/mmc/host/jz4740_mmc.c~mmc-jz4740-remove-the-flush_kernel_dcache_page-call-in-jz4740_mmc_read_data +++ a/drivers/mmc/host/jz4740_mmc.c @@ -578,10 +578,6 @@ static bool jz4740_mmc_read_data(struct } } data->bytes_xfered += miter->length; - - /* This can go away once MIPS implements - * flush_kernel_dcache_page */ - flush_dcache_page(miter->page); } sg_miter_stop(miter);