Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2869500rdb; Mon, 4 Dec 2023 09:35:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFECw9kPTxScUIdMk8kmFg4VaAm4YXkITMBeMG9O2xvsQgW6Lq6og45fXh8VyAbUdFxR/hC X-Received: by 2002:a05:6a00:8ca:b0:6c4:d12c:adf0 with SMTP id s10-20020a056a0008ca00b006c4d12cadf0mr2564354pfu.33.1701711323667; Mon, 04 Dec 2023 09:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701711323; cv=none; d=google.com; s=arc-20160816; b=X1kqQylzJOwVpufT7JaE9jWrw7iSK+zq1WCaj4Vn71dtaAsEXcboTH1YV753YbcTpw 0zh18D4Ob3ty0W7MnV8kI2FeBIzsiIUs0FeMyQr4j/+7bqE0TD+SWzVtVVQW42AwTjxc v+9p4Fv0zzNBs0BxON+C6eLHs3E+WunqDV11xqqhd+0cNJ5fiWO73rz0nRlMXlk+WM/g mdtxdzk4cS2ykwm3SVL5xru/gzA23Q/IGkz+UsHX3mmgNXfmLC/J127Ijivmi+Ii58KH 21fgVbeDSMg7xXc1m7Xvp+L2a+XpnnLuvasUJgix6qezL1pCG646lGPocdboA2NfQJU5 Mimw== 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=826yxGHLvKOrBxd7Hd1e9g5EjsLv6zmYuM80wh46KKE=; fh=glSl0KQRcmU0CwmOJcxT3pP2RubBZqUMb4tj5MCTTAg=; b=Wl0BS8NUK4sd8boB+U5TxfYMDGzzNKO+Hy1X9PCyUyxVYG8k5jECQCt5wlv+FODVKW gtaQMhWZgf4rK520dW6vsiN6sDehch3TMEZhDlAoRIAgfGdli9GlE60owcQNNbePq6Sv Adxx/LFxG26y+89o7/XqyQXlCSPRLreXQOYozvX9DFTzSrMYCM93ALH8Pk0rdds5NsZy s1UasRKlZQg82uYtSYehar9VzsfUAVByf6ruh3UtU4kU9kQ+Ho9EKbvUC52s0YGBmzWn H6kHW4B3MldxFRrwvAQ9s5mPxqgCsm2e/sjokxPBbOMIvr5mrejdh6xZEO9hnEgVPDS1 fvnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (expired) header.i=@arndb.de header.s=fm3 header.b=Lj4ikQMV; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1 header.b=JQufUQL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id q7-20020a634307000000b0056952b496efsi8170553pga.366.2023.12.04.09.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 09:35:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=neutral (expired) header.i=@arndb.de header.s=fm3 header.b=Lj4ikQMV; dkim=neutral (expired) header.i=@messagingengine.com header.s=fm1 header.b=JQufUQL0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 B0B93805ADE3; Mon, 4 Dec 2023 06:31:32 -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 S1345347AbjLDObO (ORCPT + 99 others); Mon, 4 Dec 2023 09:31:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346172AbjLDOat (ORCPT ); Mon, 4 Dec 2023 09:30:49 -0500 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAA34186; Mon, 4 Dec 2023 06:29:31 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id C86B9580948; Mon, 4 Dec 2023 09:29:30 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 04 Dec 2023 09:29:30 -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=1701700170; x=1701707370; bh=82 6yxGHLvKOrBxd7Hd1e9g5EjsLv6zmYuM80wh46KKE=; b=Lj4ikQMVRMBDHagNlC YQgSteBDqhRnfrm9Ku5aNywOXhuxNsGpUO4m/FGo3vtgsjEa32I6R17NJRI86sZ5 TAjD8dPSR3MgK7OFOvOIbii1I8ReyreBT/6qlji0tM780e3jtGv0H/LihldZ4ZSQ 0sb7ZTAfPUJc3WI+E7J59sT4w4rARxKE65A+4F9zD0vVJZRw28uy/ZfyPY/gh8fC rnWbAKLcbjoNismGWm+8p5asoD7lOJka+6GDKrDiS01EbTEc3QDkI+OB2xEv9RQl rjIvpFX6MM+IlE5EfDr47OQvpOyk0aZ39O4PuUlfAQoAve7fxD6OOVLhxI2uk/za ATaA== 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=1701700170; x=1701707370; bh=826yxGHLvKOrB xd7Hd1e9g5EjsLv6zmYuM80wh46KKE=; b=JQufUQL0mUFBQJBOptInpLuw3oJFa 33wfnoqHFWL41QNU8kPtG7B9OPz5rgEqTlRC2MxQJqu4xEH5HHjfM64DFzhS/Z0V hpY0znEyMQPMg+WWP+B6MreZ5A5V9G2RH2P1uj4MKwpfk2k9jocjCXTVbBhdS1ow Ue4x6f3ilk0N0JZP+JEHSmZM0WM3njLSSjgpr8aO8VgMuqj/ecnIarz08VsR087t cm4uGSri2sMmasOw7Gcd5G1pvW60nZMOkb4Im33h7ApY8yCKM8uRrVYNgs4eFm/w bglpTSdi1eTY2wwfuaWGSz7UzkuTb9b+bVwh/Dt3izR1rJcBXDf9q098Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejiedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 47AEAB60089; Mon, 4 Dec 2023 09:29:29 -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: <6d6918ac-a310-45d2-b5fe-c70595918b80@app.fastmail.com> In-Reply-To: References: <20231204123834.29247-1-pstanner@redhat.com> <20231204123834.29247-6-pstanner@redhat.com> <2648aef32cd5a2272cd3ce8cd7ed5b29b2d21cad.camel@redhat.com> <05173886-444c-4bae-b1a5-d2b068e9c4a5@app.fastmail.com> Date: Mon, 04 Dec 2023 15:29:07 +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 06:31:32 -0800 (PST) On Mon, Dec 4, 2023, at 15:09, Philipp Stanner wrote: > On Mon, 2023-12-04 at 14:50 +0100, Arnd Bergmann wrote: >> On Mon, Dec 4, 2023, at 14:39, Philipp Stanner wrote: >> > On Mon, 2023-12-04 at 13:38 +0100, Philipp Stanner wrote: > > Ok, makes sense. > > But should we then adjust iomem_is_ioport() in asm-generic/io.h, as > well, so that it matches IO_COND()'s behavior? > > It currently does this: > > uintptr_t start = (uintptr_t)PCI_IOBASE; > uintptr_t addr = (uintptr_t)addr_raw; > > if (addr >= start && addr < start + IO_SPACE_LIMIT) > return true; > > and if the architecture does not set PCI_IOBASE, then it's set per > default to 0, as well. > > So we have two inconsistent definitons No, I would also keep the logic here, since it makes more sense and the inconsistency is only for the corner case that doesn't hit in practice. The PCI_IOBASE==0 case should never happen here, as that doesn't work with the generic inb(). I think the only target left that has I/O ports but doesn't set PCI_IOBASE at all is sparc, but that is special in a number of ways. Arnd