Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp639013rdb; Fri, 26 Jan 2024 06:31:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLmfmEz6hZuDJj+d014wIoiXujoVwLOyrbD77UqkygIJUbl/cSGlnRvXgKMzbUovwDk8NR X-Received: by 2002:ad4:5c62:0:b0:681:76d9:52b5 with SMTP id i2-20020ad45c62000000b0068176d952b5mr1813254qvh.130.1706279493993; Fri, 26 Jan 2024 06:31:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706279493; cv=pass; d=google.com; s=arc-20160816; b=CIIWFVIQhBoMhtcw1dCdwLAZ3tIuf86bR4yOq0+wTwLkCdEq0B+Yc2G82CbQ9owiYe TIoP649i2dvLuo7c8KmfGMGDiwC3XpK3qHYpP2yWXzNMW22XBULQQD4WkMw2uvYL7FPz S+vhQUYN7wHA0nx1AK9ZY/FFi/EMn9sQfROb1SnnUVYQFyG43+tJhU7OGEy0xbEK8htd jOoAJis0Yarbq+tRrsYITE7vEfH8zW237tuEYqMYxjETJ+D8arsieVBMz/UYi52D5Hev bVle6DQMSY7e3xjvSCcESXjAreTBSqk7wlp5ehCj/e9bqi1xglSgeGRgM9A2+tGYlfEH 1GOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=TF+Ka+GXK+ztTGKn5RdSG0DNk91ZmYKf5EL+gc74hng=; fh=98GVFCW6KlbFWDFgjJGoSxXonWpPZ00TUJ9xWJE8H+g=; b=nCo7BRvU5be806kyxjlUcXuoYbpG85M0jzHpA0LyQ2nFc4DamepleCFUbcs0nxr4PE 68eorZr3quiFY95+lpU9k8W1r6KaA08tje5lKkvMvY1pHwFwAAPHJXn31ph14/8BNIWn 3Z6oRcRVcbEZa6E+ASnYiWG5xUdJ4QR1yJYlbVgjNsdIbzC/MwjUKX/rBKFN14jv/JDD Vg8xtIvXAWl+os4ornMra5wIkLLnGJydAQ9gdLuMSay55U32yI4vcGizC0NOYvftabLm ObDuD1FQ4QKR9XsKrVp6lO/SfmsgxADEon8ox14kOoIgnPKW54MkNWW4vPLtrVEwJ5su ixPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=HqyE4prg; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=pGkLV9Sp; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-40174-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40174-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t12-20020ad45bcc000000b0067f662df032si1426592qvt.271.2024.01.26.06.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 06:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40174-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=HqyE4prg; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=pGkLV9Sp; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-40174-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40174-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9ACED1C20752 for ; Fri, 26 Jan 2024 14:31:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD1FF1CD32; Fri, 26 Jan 2024 14:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="HqyE4prg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="pGkLV9Sp" Received: from wnew4-smtp.messagingengine.com (wnew4-smtp.messagingengine.com [64.147.123.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 294A81C695; Fri, 26 Jan 2024 14:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279055; cv=none; b=UVSLvv3x6jNEpQITdv/Y9GBoQX7c9FVE/TOjqb+iPY+41MF+AT0h8SlYMee9ltQHqACnwVoq1Q4TgCG56HevFVG3Qg1fZ7uqjErdKu5+tyyYnRALvRc3Wb1wj1V2aXgHu2Ka1V2mVqrQkgIWZJrDzgwGAvrmCkPA/kmqmNv3Dl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279055; c=relaxed/simple; bh=hKIfs47ddSkIptRXRENQTpOASHv1OOHXf/8ceRFn0/k=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=TjjzkOhzEGawZ2GqHCits+UttT3I0o6R3iCDr0Hl686f6iUZyOEmRnCUJhMHHr2G0WqutrqaFJi2+IIPMk84nGvXv41XYneKuPiRcHrYTBVseUsFwHni9olUjx6euZZHrmloURm7FYgP8T5B4eLUfSoPkugkXwWFKk93H36A3Yg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=HqyE4prg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=pGkLV9Sp; arc=none smtp.client-ip=64.147.123.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 96C8F2B004D0; Fri, 26 Jan 2024 09:24:09 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Fri, 26 Jan 2024 09:24:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1706279049; x=1706286249; bh=TF+Ka+GXK+ztTGKn5RdSG0DNk91ZmYKf5EL+gc74hng=; b= HqyE4prgfd8Ba0Bmvq/8hIZN547wH19SUJZbqUpbMCd9JpXwBct8mBDqhraHb6+T mbEoF+BMPvsLE5Z6tS5/47kjcZTno7n4oyeu5Nvyg2oRBQNuOMTMFsI70KjowdOa WWkkaRlFFmgtM9fD8rzxvdoU53s1ecmYxb2NeqwEltV2IzbJUxJqbOCK0c5HTCfJ OuoQDl5Z6Nte2EOdaf12WHv9aBi5cBdWmr4UuK9N6YyNUqzWsLCAmBnpytyaR8gd CfJUI/PNAEQu2q0rdgXsnulMtUvqDMeMRA36m21aK+OsMhzO352cjVje325yedg3 oVbHxxlz+MLgoISc0YNFkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1706279049; x= 1706286249; bh=TF+Ka+GXK+ztTGKn5RdSG0DNk91ZmYKf5EL+gc74hng=; b=p GkLV9SpgJfadZtrnSQJaU54TnuTjuQAOSG7J4wwGwen4oY9YDdsI2Q4vTsi7bkkI qukYU5RWgE3Jl+MbDh5Kgt6V9dS0chTDsV8ow0UreRfs9EJLa5zRpXU/DNf+l8Jt YwaH4yJy/cDQ+NTxm+LNLwqKT/CClboWq+iYWnzPRthNjvmMeSL+uks6YTKckt5A eOyXg7QcQliOomfqnDF7BVa6NB9QfNto5Yvxg02IhQ6tgn3N8icCXsnRGnBV15dH FnYE4/Iwef6aw+Vk0cgGiZ1JeW8EYwiANDxPywQN/tlrwJPo4sTKIDqZXa4rEHFA e3SiE4Vmf2TmUwZs3MTkA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeljedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 60C02B6008D; Fri, 26 Jan 2024 09:24:08 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-119-ga8b98d1bd8-fm-20240108.001-ga8b98d1b Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: <70b8db3ec0f8730fdd23dae21edc1a93d274b048.camel@redhat.com> References: <20240123210553.GA326783@bhelgaas> <70b8db3ec0f8730fdd23dae21edc1a93d274b048.camel@redhat.com> Date: Fri, 26 Jan 2024 15:23:47 +0100 From: "Arnd Bergmann" To: "Philipp Stanner" , "Bjorn Helgaas" Cc: "Bjorn Helgaas" , "Johannes Berg" , "Randy Dunlap" , "Neil Brown" , "John Sanpe" , "Kent Overstreet" , "Niklas Schnelle" , "Dave Jiang" , "Uladzislau Koshchanka" , "Masami Hiramatsu" , "David Gow" , "Kees Cook" , "Rae Moar" , "Geert Uytterhoeven" , "wuqiang.matt" , "Yury Norov" , "Jason Baron" , "Thomas Gleixner" , "Marco Elver" , "Andrew Morton" , "Ben Dooks" , "Danilo Krummrich" , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Linux-Arch , stable@vger.kernel.org, "Arnd Bergmann" Subject: Re: [PATCH v5 RESEND 5/5] lib, pci: unify generic pci_iounmap() Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, Jan 26, 2024, at 14:59, Philipp Stanner wrote: > On Tue, 2024-01-23 at 15:05 -0600, Bjorn Helgaas wrote: >> On Thu, Jan 11, 2024 at 09:55:40AM +0100, Philipp Stanner wrote: >>=20 >> The kernel-doc addition could possibly also move there since it isn't >> related to the unification. > > You mean the one from my devres-patch-series? Or documentation > specifically about pci_iounmap()? > >>=20 >> > =C2=A0{ >> > -#ifdef ARCH_HAS_GENERIC_IOPORT_MAP >> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uintptr_t start =3D (uin= tptr_t) PCI_IOBASE; >> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uintptr_t addr =3D (uint= ptr_t) p; >> > - >> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (addr >=3D start && a= ddr < start + IO_SPACE_LIMIT) { >> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0ioport_unmap(p); >> > +#ifdef CONFIG_HAS_IOPORT_MAP >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (iomem_is_ioport(addr= )) { >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0ioport_unmap(addr); >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0return; >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} >> > =C2=A0#endif >> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0iounmap(p); >> > + >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0iounmap(addr); >> > =C2=A0} >>=20 >> > + * If CONFIG_GENERIC_IOMAP is selected and the architecture does >> > NOT provide its >> > + * own version, ARCH_WANTS_GENERIC_IOMEM_IS_IOPORT makes sure that >> > the generic >> > + * version from asm-generic/io.h is NOT used and instead the >> > second "generic" >> > + * version from this file here is used. >> > + * >> > + * There are currently two generic versions because of a difficult >> > cleanup >> > + * process. Namely, the version in lib/iomap.c once was really >> > generic when IA64 >> > + * still existed. Today, it's only really used by x86. >> > + * >> > + * TODO: Move this function to x86-specific code. >>=20 >> Some of these TODOs look fairly simple.=C2=A0 Are they actually hard,= or >> could they just be done now? > > If they were simple from my humble POV I would have implemented them. > The information about the x86-specficity is from Arnd Bergmann, the > header-maintainer. > > I myself am not that sure how much work it would be to move the entire > lib/iomap.c file to x86. At least some (possibley "dead") hooks to it > still exist, for example here: > arch/powerpc/platforms/Kconfig # L.189 This one definitely takes some work to untangle, it's selected by two powerpc platforms, but one doesn't actually need it any more, and the other one uses it only for non-PCI devices. I think the other architectures are easier to change and do fix real bugs, but it's probably best done one at a time. Arnd