From patchwork Thu Sep 21 11:04:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13393857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C57DE70719 for ; Thu, 21 Sep 2023 11:04:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB9B96B018D; Thu, 21 Sep 2023 07:04:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6A066B01A3; Thu, 21 Sep 2023 07:04:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B596E6B0200; Thu, 21 Sep 2023 07:04:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A628A6B018D for ; Thu, 21 Sep 2023 07:04:40 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8390CA08D0 for ; Thu, 21 Sep 2023 11:04:40 +0000 (UTC) X-FDA: 81260321520.19.18012B2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id C93F840027 for ; Thu, 21 Sep 2023 11:04:38 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ddvmxIrv; spf=pass (imf12.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695294278; a=rsa-sha256; cv=none; b=bg7bLr7P354Ee9uNlmFkk51CrIWp0/0IC8Fg262+NyZUR29UgjpBsf/uToXGdv80zmiInp yXJigIBhC6E9MokqjR44h9X0Nzrtz2vCpCqQmRyOhmbIUFrDnl+I06NTy2ezq7NZNXooBy IxrFs2LNaP4HpBWLs/ayzOe4rF2+d9g= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ddvmxIrv; spf=pass (imf12.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695294278; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=J82jcaw/+kiBJ2FfMU0engZd+GV+Xpg+5yRwfEtk5KM=; b=SJxZ1Xfw2S6Jrv/B8uM4XJXaysrty5zc+NThIGPVXIfy3zW7NK4dShTxhJHcTAhOzZBbJM GG5oZxBldOfjOSaC0CDMSxQInmlLytS1QcsXovZ6GvhKn8zFPTPQYLsH5poknBUqPaD5Oe /ruaIZbTyomJUAK4c+qk1u3wAuh0Pxg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695294278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J82jcaw/+kiBJ2FfMU0engZd+GV+Xpg+5yRwfEtk5KM=; b=ddvmxIrvgZvQNuCaWEbgoYRtTpQM88IkR0XqzlFra8Yj0hcPyY4n8sqPTl8tEgI7SiUDbo 7y0WsGeYhR36ThQ7eIkiHx74HZg3pRxeeOEqgf+ysx46PEy5v+AhlVV8eDdZZ9Ea19O7kt PbHpQkVqaxWgloZXARn1GjCqoPiXKxA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-KY3ntw-DNRuE8xoylOxPWA-1; Thu, 21 Sep 2023 07:04:34 -0400 X-MC-Unique: KY3ntw-DNRuE8xoylOxPWA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0DF13803B5D; Thu, 21 Sep 2023 11:04:34 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91D9A2156702; Thu, 21 Sep 2023 11:04:27 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, arnd@arndb.de, jiaxun.yang@flygoat.com, mpe@ellerman.id.au, geert@linux-m68k.org, mcgrof@kernel.org, hch@infradead.org, tsbogend@alpha.franken.de, f.fainelli@gmail.com, deller@gmx.de, Baoquan He Subject: [PATCH v5 0/4] arch/*/io.h: remove ioremap_uc in some architectures Date: Thu, 21 Sep 2023 19:04:20 +0800 Message-ID: <20230921110424.215592-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C93F840027 X-Stat-Signature: yce1esoxwgp1eh5cymjaujb6n9gdwtmo X-Rspam-User: X-HE-Tag: 1695294278-71730 X-HE-Meta: U2FsdGVkX19nrtmxW21SgbIGvouKuRMdtzMSbsvwTlPzXvYxNosybOH9gkL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mMPJqptjqCOQClOqmwidBPioEXkXTG39f6bpmNXVuuvphthMHy3AZg1EEhOZiVLc+PH4LVGk/pMfQ1//i0zVJJmYKxyB8Yodir8gFd2CU28jGnOpHERvMQPm8= 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: This patchset tries to remove ioremap_uc() in the current architectures except of x86 and ia64. They will use the default ioremap_uc version in which returns NULL. Anyone who wants to add new invocation of ioremap_uc(), please consider using ioremap() instead or adding a new ARCH specific ioremap_uc(), or refer to the callsite in drivers/video/fbdev/aty/atyfb_base.c. This change won't cuase breakage to the current kernel because in the only ioremap_uc callsite, an adjustment is made to eliminate impact in patch 1 of this series. To get rid of all of them other than x86 and ia64, add asm-generic/io.h to asm/io.h of mips ARCH. With this adding, we can get rid of the ioremap_uc() in mips too. This is done in patch 2. And a followup patch 4 is added to remove duplicated code according to Arnd's suggestion. Test: ===== Except of Jiaxun's efficient testing on patch 2/4, I also did cross compiling of this series on mips64, building passed. History: ======= v4->v5: - In v4, Thomas reported that adding including into mips always cause crash on his malta qemu. Finally, Jiaxun stood up to take over the patch 2/4 and make it work. This patchset collects Jiaxun's patch v5 and add Arnd's tag. Thanks to Jiaxun. - Meanwhile, the old patch 4/4 need be adjusted because Jiaxun has done some removal of duplicated codes in . - Add reviewers' tags from v4. v3->v4: - Add patch 1 to adjust code in the only ioremap_uc() callsite so that later removing ioremap_uc() won't cause breakage. - Update log and document writing in patch 3. - Add followup patch 4 to clean up duplicated code in asm/io.h of MIPS. v2->v3: - In patch 1, move those macro definition of functio near its function declaration according to Arnd's suggestion. And remove the unneeded change in asm/mmiowb.h introduced in old version. - In patch 2, clean up and rewrite the messy document related to ioremap_uc() in Documentation/driver-api/device-io.rst. v1->v2: - Update log of patch 2, and document related to ioremap_uc() according to Geert's comment. - Add Geert's Acked-by. Arnd Bergmann (1): video: fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Baoquan He (2): arch/*/io.h: remove ioremap_uc in some architectures mips: io: remove duplicated codes Jiaxun Yang (1): mips: add including Documentation/driver-api/device-io.rst | 9 +- arch/alpha/include/asm/io.h | 1 - arch/hexagon/include/asm/io.h | 3 - arch/m68k/include/asm/kmap.h | 1 - arch/mips/include/asm/io.h | 123 +++++++++++++++---------- arch/mips/include/asm/mmiowb.h | 4 +- arch/mips/include/asm/smp-ops.h | 2 - arch/mips/include/asm/smp.h | 4 +- arch/mips/kernel/setup.c | 1 + arch/mips/pci/pci-ip27.c | 3 + arch/parisc/include/asm/io.h | 2 - arch/powerpc/include/asm/io.h | 1 - arch/sh/include/asm/io.h | 2 - arch/sparc/include/asm/io_64.h | 1 - drivers/video/fbdev/aty/atyfb_base.c | 4 + 15 files changed, 88 insertions(+), 73 deletions(-) Tested-by: Jiaxun Yang