Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1351018rdb; Fri, 1 Dec 2023 14:00:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYAHzAeenqmpIUHClggEY4VG668xG7jFNmlt1ZeMNKJXIhiuq2CWevJPZPAu/nModT7M4y X-Received: by 2002:a05:6358:786:b0:168:e697:ce0d with SMTP id n6-20020a056358078600b00168e697ce0dmr254064rwj.31.1701468000181; Fri, 01 Dec 2023 14:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701468000; cv=none; d=google.com; s=arc-20160816; b=huJ1RhZzd4LAfcpdm9IEwka69bzjyUMpJbHQvoSW5JPlobjIVFyZjbZpVheiZcTPY6 fB6wRNgaV3ZAlHMcDTv3EkHUnfgSWPEa8C6FBZPJ/fz6K3xxAa8iayr98GeXuEG4s83W roaPCpKzAYfKfNcK1MDbRUgq70/OTy2vy6aZY0ISzzjvNR5AOYF5sjjm3cuwWxywph8M e74avnzzsnPHspr+GJEIDvi0BHxj69KrzKfR33q0T387J5zuQYj/7cnSL8oV6kNDXsr/ 582ianAQLobgCtgXsg8+UGYEC8aIYcwL7MykFmyrvYfTgACn4y0nq/RDcV8+c9QKElTN KoeQ== 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=9RUywHy5pRnc9jdI4T7duTy4HQrezKiKqmZajvx6reU=; fh=jJNHcyh/luO/l9b0Qb1EfMnLcysECFK10xGDf8JFCdo=; b=zgYD772TOQ5OdGcU0SMVdDUUQCYruwTzV4mquC2TkEqK/V6Efom3lQ4WOD7PdC2a6D SuP3i1Ge+REcNi+yAfZ4Mw10eX1YQKMziavSxl9RbxHQ1amYes+qy6ZPhDPCjYkBhFQt dd7cifJlYEzd71nV5O2C3ziNIRZy9J4ZVx0ZbFvsdfZaUGD22ZMLGrTrxsCxkxOvDJuC TF8bsaOSFKncLSHwqwYkJSKqcP6c4ccfgeU6SAk3YENXJSrpPR511RvKMQURtIhE/JZw cR9YQKoUnFpfdjbG8pIANMBVgDDuGPrg0tOOjN/WxFLPpguuXynM08LDBBZlKH3v3Vu0 9bVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=jIU4MqrA; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=zIVGbocn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id x4-20020a17090a970400b00285ca5d2636si4051562pjo.123.2023.12.01.13.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 14:00:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=jIU4MqrA; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=zIVGbocn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id BCF7882696D7; Fri, 1 Dec 2023 13:59:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbjLAV7n (ORCPT + 99 others); Fri, 1 Dec 2023 16:59:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjLAV7m (ORCPT ); Fri, 1 Dec 2023 16:59:42 -0500 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 876AD10FF; Fri, 1 Dec 2023 13:59:48 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id B415A2B005E2; Fri, 1 Dec 2023 16:59:45 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Fri, 01 Dec 2023 16:59:47 -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=1701467985; x=1701475185; bh=9R UywHy5pRnc9jdI4T7duTy4HQrezKiKqmZajvx6reU=; b=jIU4MqrAF5Hs0q5K98 M9thslGVc3kVtc6S4O3wNX05MTrDRwXqLVAMa4JsD1pg6ph/7avYySJm+Ct1ckdh l3jvN8iwLzqY8XR+BxQf3GZoldRTAc7P4B6ZCAV5UHUpdnewrnxAbYfQZG6SgQkP h3cvU/7n8Tgitp5wxFzbYQr+f3YFH3Dvs8sZRcxzAIzsI7ikX6CreYtvD2CF13Jd pFX7Z2sledvBK0ErKUjTOYtG2VlPjljOKR7XWz+KN9o3o/0YLBSQDP9Qdb250YfG hVlqPXMLQ5wJHq312jSflf5X8JqXv4I91ZORcHn1w9sZfuOlEeuxj30FOXCQV712 R5fg== 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=1701467985; x=1701475185; bh=9RUywHy5pRnc9 jdI4T7duTy4HQrezKiKqmZajvx6reU=; b=zIVGbocni2KrrZV4Qf9ijkVktgXu7 5tcFdv7JeT+OF5ulDfigWgrSMm5EEvv5QUH08JoWyn1bk8BM1AZbWuW8YDZ3SQlp HpCX0YvnQbfj1RXqNa/ioZi//RiNCL7ED83FrzqInI8psP7IgaskeVVPvhv53Wdh pqQgexV5qqBAKbrw+uEwXnWR0CTEJXBHUDuNZSvFHm8aCn9mlpZXBwtEP8SMDcSv D7ahvIdMZ9KpVaPcn/pKIRWzICJnzPiTFVFTHVBRyaU44qLXhjHF1KQYbAmNATdX El4Xv/WqUm9yLqoyzit3u7xQwT71fOy8tpFOHKj3UCrHusrCzw9ntn90A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeiledgudehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedt keetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 182B2B60089; Fri, 1 Dec 2023 16:59:43 -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: <3627579b-66dd-42aa-92ab-3d561cdfb2f8@app.fastmail.com> In-Reply-To: References: <20231201121622.16343-1-pstanner@redhat.com> <20231201121622.16343-5-pstanner@redhat.com> <619ea619-29e4-42fb-9b27-1d1a32e0ee66@app.fastmail.com> <330df2f8-3796-4f74-8856-06ae1e46ec9b@app.fastmail.com> Date: Fri, 01 Dec 2023 22:59:23 +0100 From: "Arnd Bergmann" To: "Philipp Stanner" , "Bjorn Helgaas" , "Andrew Morton" , "Dan Williams" , "Jonathan Cameron" , "Jakub Kicinski" , "Dave Jiang" , "Uladzislau Koshchanka" , "Neil Brown" , "Niklas Schnelle" , "John Sanpe" , "Kent Overstreet" , "Masami Hiramatsu" , "Kees Cook" , "David Gow" , "Yury Norov" , "wuqiang.matt" , "Jason Baron" , "Kefeng Wang" , "Ben Dooks" , "Danilo Krummrich" Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Linux-Arch , "Arnd Bergmann" Subject: Re: [PATCH v2 4/4] 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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 01 Dec 2023 13:59:56 -0800 (PST) On Fri, Dec 1, 2023, at 22:56, Philipp Stanner wrote: > On Fri, 2023-12-01 at 22:32 +0100, Arnd Bergmann wrote: >> On Fri, Dec 1, 2023, at 20:37, Philipp Stanner wrote: >> The best I can think of is to move the lib/iomap.c version >> of iomem_is_ioport() to include/asm-generic/iomap.h with >> an #ifndef iomem_is_ioport / #define iomem_is_ioport >> check around it. This file is only included on parisc, alpha, >> sh and when CONFIG_GENERIC_IOMAP is set. > > My implementation from lib/iomap.c basically just throws away the > IO_COND macro and does the checks manually: > > #if defined(ARCH_WANTS_GENERIC_IOMEM_IS_IOPORT) > bool iomem_is_ioport(void __iomem *addr) > { > unsigned long port = (unsigned long __force)addr; > > if (port > PIO_OFFSET && port < PIO_RESERVED) > return true; > > return false; > } > #endif /* ARCH_WANTS_GENERIC_IOMEM_IS_IOPORT */ > > So we'd also need PIO_OFFSET and PIO_RESERVED, which are not present in > asm-generic/iomap.h. > > Sure, we could move them there or into a common header. But I'm not > sure if that is wise, meaning: is it really better than the ugly > WANTS_GENERIC_IOMEM... macro? > > Our entire goal in this series is, after all, to simplify the > implementation. Right, in that case it's probably better to leave it in lib/iomap.c, just keep the ARCH_WANTS_GENERIC_IOMEM_IS_IOPORT definition in include/asm-generic/iomap.h as well then and keep it out of the normal asm-generic/io.h path. Arnd