Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2819667rdb; Mon, 4 Dec 2023 08:20:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/fd6LB5WwkSUUQwt0CMrJFFgJrqKJN4vEaAu0+wmD+iuQZmwb8SQhZvjSOiXeLkylQxby X-Received: by 2002:a17:903:1c5:b0:1cf:7666:4dd0 with SMTP id e5-20020a17090301c500b001cf76664dd0mr5782617plh.39.1701706816325; Mon, 04 Dec 2023 08:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701706816; cv=none; d=google.com; s=arc-20160816; b=UwsyC0K/ySyTzVPcEDfBQKmKPFv1gKZZDeSlUsXQqmS2O7lkJVSwmd0BO9Cf8fLZdG 83sBk7KaxVVSnGXiGSGPxHXdvCVC0d3E49oSTmCpVn/Tf/lfZy6Rt+XGmt2+Os3zH7Ol B/43dejYamN8yCX99sWQqnVssysLae91M8qtas6e53NR3wQkkqkepKXzjnRRjmsNZHzg R5CsYWvRdgqUYjfDM+QE4EfViAoPoX6ghfu3TkGRO4Z6RXCHIEHZHpar/S4rotRvKFuO HTD6Zmjpc00hew3ob1AHZb5xIy0cKKPEEPBMmLOh59qhTrC+sA/GdkrmGWQp6gVfnK/B gzMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=Cl4o1FU4NGqJM5T9UpnZFt1yxCty62LHdz2C3rL1jgU=; fh=glSl0KQRcmU0CwmOJcxT3pP2RubBZqUMb4tj5MCTTAg=; b=HiIhRgFaWWKIQiHz4pt5V9JzBF8gFFs/v+N9d/7aRpFt5nawj4RMnyFxNF/VE/HkP4 XOWS95mY3tLf4oYHPaJdXNUvBHeHzd//sSIXR03iexNAMQ4ysz9NUJHC3HPsSTHv3+/h r3n2vh3f+qsTFDv31SNssYlr0YXxSVUxAiugv7TXgsC21Z3/8EnOCrfgeUOl60y/PTHy Vn8br4IlnvoLPUcCHTTL1eFyuX3vOy/cYz0SrtGCuzd7o0IwO+iBDnof7Wtf28wGknFx oM9crG8Py81bQYgLDI8GFru/Mc7i6NR8Xr/EZ/4ilkzzUJspWNl9fYFAWuMrO4mp2lPB O64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (expired) header.i=@arndb.de header.s=fm3 header.b="DeguT/wr"; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1 header.b="lMqsGnY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id iw3-20020a170903044300b001d0b42fa984si1039488plb.159.2023.12.04.08.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 08:20:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=neutral (expired) header.i=@arndb.de header.s=fm3 header.b="DeguT/wr"; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1 header.b="lMqsGnY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 29DBA805B9E9; Mon, 4 Dec 2023 05:54:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344599AbjLDNxv (ORCPT + 99 others); Mon, 4 Dec 2023 08:53:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbjLDNxu (ORCPT ); Mon, 4 Dec 2023 08:53:50 -0500 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C7F090; Mon, 4 Dec 2023 05:53:56 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 62C805809CB; Mon, 4 Dec 2023 08:53:55 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 04 Dec 2023 08:53:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1701698035; x=1701705235; bh=Cl 4o1FU4NGqJM5T9UpnZFt1yxCty62LHdz2C3rL1jgU=; b=DeguT/wrfrIyi2gOFg +UKkbYLPEVKcpJo6S6ZSrUgxaK9qlFLEPJxXgN0EpI09QYhmowtWba0WCm8Ky3/Q 7DXrSR9d7U1XTjPMTvGPWYnAGehs+EHl6TtESHET38j0xvuzU5b3FUX1d8dqjiUJ r/KdBItet01TpaKzCnS82ZLJmAWERJXkZ0tqAzS3J8IB6GupAzmjUAkIZKLPhcbd pVSdMUhO0eHLax9YAlLfoKwMpLNR1GTWKlascOJwqP6dzYQKtLu4CiGjKjjNYjeo KyKbrrG5OGPQYLZ1qK/b2THx945DhH3AmtfHH1IEUn5IT/VF35I8lfn6vcNhF/Sd Nh5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701698035; x=1701705235; bh=Cl4o1FU4NGqJM 5T9UpnZFt1yxCty62LHdz2C3rL1jgU=; b=lMqsGnY/xBg8KEro3ysGpxsSGEv2y 4FZpQvBFaLTIS/ZU5BeHFo0xlzkJSz+6NFr+JAaEbYfHiryJPA35Obg9o+SRR8qC u+7rriapGR3vmC1o0YbLNSCeKZecQu0b7GlLmSW3YLDPTLqzpklBEi1dCL0eToS+ gAoyefrnXk7pva8qmy0smTgTgeob4fF85QVINccq/OJCyQGlOUIqoWyXi4o6m4+4 yuIPU8hnr3ia2i9az4ktoguuWHIimDYNUKsSCP0UDUUE3kW+ITpnU3U5Dpg+SDLm evfAtd0odQhdD9twMmjNT+5bYJrty+xwvKxrc3v+2zsiy1AOs7/fsSKAw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejiedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0FC68B60089; Mon, 4 Dec 2023 08:53:55 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1178-geeaf0069a7-fm-20231114.001-geeaf0069 MIME-Version: 1.0 Message-Id: In-Reply-To: <20231204123834.29247-6-pstanner@redhat.com> References: <20231204123834.29247-1-pstanner@redhat.com> <20231204123834.29247-6-pstanner@redhat.com> Date: Mon, 04 Dec 2023 14:53:29 +0100 From: "Arnd Bergmann" To: "Philipp Stanner" , "Bjorn Helgaas" , "Hanjun Guo" , "Neil Brown" , "Kent Overstreet" , "Jakub Kicinski" , "Niklas Schnelle" , "Uladzislau Koshchanka" , "John Sanpe" , "Dave Jiang" , "Masami Hiramatsu" , "Kees Cook" , "David Gow" , "Herbert Xu" , "Shuah Khan" , "wuqiang.matt" , "Yury Norov" , "Jason Baron" , "Andrew Morton" , "Ben Dooks" , "Danilo Krummrich" Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Linux-Arch , stable@vger.kernel.org, "Arnd Bergmann" Subject: Re: [PATCH v3 5/5] lib, pci: unify generic pci_iounmap() Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 04 Dec 2023 05:54:04 -0800 (PST) On Mon, Dec 4, 2023, at 13:38, Philipp Stanner wrote: > The implementation of pci_iounmap() is currently scattered over two > files, drivers/pci/iomap.c and lib/iomap.c. Additionally, > architectures can define their own version. > > To have only one version, it's necessary to create a helper function, > iomem_is_ioport(), that tells pci_iounmap() whether the passed address > points to an ioport or normal memory. > > iomem_is_ioport() can be provided through two different ways: > 1. The architecture itself provides it. As of today, the version > coming from lib/iomap.c de facto is the x86-specific version and > comes into play when CONFIG_GENERIC_IOMAP is selected. This rather > confusing naming is an artifact left by the removal of IA64. > 2. As a default version in include/asm-generic/io.h for those > architectures that don't use CONFIG_GENERIC_IOMAP, but also don't > provide their own version of iomem_is_ioport(). > > Once all architectures that support ports provide iomem_is_ioport(), the > arch-specific definitions for pci_iounmap() can be removed and the archs > can use the generic implementation, instead. > > Create a unified version of pci_iounmap() in drivers/pci/iomap.c. > Provide the function iomem_is_ioport() in include/asm-generic/io.h > (generic) and lib/iomap.c ("pseudo-generic" for x86). > > Remove the CONFIG_GENERIC_IOMAP guard around > ARCH_WANTS_GENERIC_PCI_IOUNMAP so that configs that set > CONFIG_GENERIC_PCI_IOMAP without CONFIG_GENERIC_IOMAP still get the > function. > > Add TODOs for follow-up work on the "generic is not generic but > x86-spcific"-Problem. > > Suggested-by: Arnd Bergmann > Signed-off-by: Philipp Stanner Reviewed-by: Arnd Bergmann