Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1161088rdb; Fri, 1 Dec 2023 08:28:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkxzQRXAce55iKwgTrFvJXJi+G4eR6Lgy/MmHtvl8hAfw567+cWwZdcb4kx1PKil8TJqCH X-Received: by 2002:a17:902:efd4:b0:1ce:5dd8:2f31 with SMTP id ja20-20020a170902efd400b001ce5dd82f31mr1527817plb.39.1701448100495; Fri, 01 Dec 2023 08:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701448100; cv=none; d=google.com; s=arc-20160816; b=CdsdEyQ39mYAbz4hK9ySb6RBkAhgpZYNiq6ryObddKOLDfwCzRm0XIkrgoFxWGWwgA gM4eUZeNGkgMTgdbZVs9D7DQ2KgiGsRxz3B7qbjjsemfjSBrrI/jutisJQVTVhtOTwMZ FvpKhp/6jbHGNuqfTA2+c+QrGM5d84v+AWt8D7DDaPF1rponSnKJFwx/kURCowvhySOJ iZaCCQRBZDjkRgrPDahcv59WmHur4tN8s0XzxPTOv3BkHrmGiUUNOH+2NNhDZaameTpv gPmeAoRlINsRDVaa+AugwU4dR0vX2cLTUuC2RnQAWuKQhxPkOB182F4Ec3CBtMNusDvD +lgg== 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=eYYJBcIdkLd72F1/I/hnCobiC3d8I4lgiTDbsW05Rfk=; fh=dTtrAcGs2K0uRyVUqjRkO1Is4PnzkiHWJaMmpc6Zsfo=; b=J2WjxkQA8W2yJu0PemhD8R7rphe8ai8vStTCqG5BJZ1stvbqHx/SX6UF+SRf5cGZhD Zai6/18ST4qSM7sX6ybQADkrYmxxyD+4jcm4jLn4U3Jiov0Q4N6oCOpDN6dOAlsXTs15 9HYtt8ASa7CTb2+REbUpZjgiVEn+dIRz3cfUyxldheDX3ORLh3gCoeYBSxTewBrGPrFY NRrBzpc3ZzZh4wJAyWIi44fgKz0G6GmyORpd1bh2dHA1q0YvkE9mQEDpRpDfRfufiTzr YbQjKBVfQ41xWAzslF27Z6QU1YI/xfVfR6dBgVHI2/W/0B7APUJ9UEqv762ELzQ/+XqX FIOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=FewMsGRG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=A6OuCdxi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b3-20020a170903228300b001cfd5af29ccsi3544392plh.326.2023.12.01.08.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 08:28:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=FewMsGRG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=A6OuCdxi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 2B2B384E217C; Fri, 1 Dec 2023 08:28:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbjLAQ2C (ORCPT + 99 others); Fri, 1 Dec 2023 11:28:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLAQ2A (ORCPT ); Fri, 1 Dec 2023 11:28:00 -0500 Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17BBA83; Fri, 1 Dec 2023 08:28:07 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id AAE28580A4F; Fri, 1 Dec 2023 11:28:03 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Fri, 01 Dec 2023 11:28:03 -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=1701448083; x=1701455283; bh=eY YJBcIdkLd72F1/I/hnCobiC3d8I4lgiTDbsW05Rfk=; b=FewMsGRG2mUxUBSpWO M/0S1myc7hSRL3FvSrwVGHeQGumuLJ4RvB4EGSTNC83CaKyGC1+bFU5Hb33Yf1tY VO4XFT8d/i/Y+dJYjdSDrW/8zqFVcu/2daQX8puPuiveYcVXPGRJH+KQsmRUMjPR NwFZMOCSRsa8S1Ey4IpHbePMk5LTSf60L1Ofqcd9VJQkd/WyYvCNWDGa1gDReibG b/T0TFNxpueSxIzhQhxPzzflpDZv/CtDYmCMGC+o+tsi6PNHCikhWOUPSeIqtY2q iaIMCgLJunahTFwQ7hNYdKEfmK8wz/WAyfaafbTVANnSiri5Qz+V/3uRN2DIrKWG z+xw== 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=1701448083; x=1701455283; bh=eYYJBcIdkLd72 F1/I/hnCobiC3d8I4lgiTDbsW05Rfk=; b=A6OuCdxivjbAP5VbfQsErA89IkZzt z5fbjEpYzWg/ItEGqilefFlgi4GX08/yh9jdVCf/SREg/aq70rvhcSq44BckYCkc DSjl9E1eTCLZ5N/sJ1CvoNy1LS6yN1B7ILVTMABRc31B1yU4IzRVNVxs82czDOdk nC/H7Ks4QsPk67HzdQAnS7GpYqCXEuCQ8LXJFYe3/NChoyv8FkMjdScJVEn0TWe8 OzHIkGVmihZaABAzrdsxutC3XIc7748UcqyQpX4Js56w1k0caCPxH+6Lxf99GoJI m8P8YdvI+1xJS1J6AM3J94+0H0erqV0jmx+Oxt+OQchX9BLoDLmfMhVyQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeiledgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1E96DB60089; Fri, 1 Dec 2023 11:28:02 -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: <3871b83a-0e80-402e-bbe6-359c17127842@app.fastmail.com> In-Reply-To: <20231201121622.16343-1-pstanner@redhat.com> References: <20231201121622.16343-1-pstanner@redhat.com> Date: Fri, 01 Dec 2023 17:27:40 +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 Subject: Re: [PATCH v2 0/4] Regather scattered PCI-Code 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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 08:28:17 -0800 (PST) On Fri, Dec 1, 2023, at 13:16, Philipp Stanner wrote: > > Arnd has suggested that architectures defining a custom inb() need their > own iomem_is_ioport(), as well. I've grepped for inb() and found the > following list of archs that define their own: > - alpha > - arm > - m68k <-- > - parisc > - powerpc > - sh > - sparc > - x86 <-- > > All of those have their own definitons of pci_iounmap(). Therefore, they > don't need our generic version in the first place and, thus, also need > no iomem_is_ioport(). What I meant of course is that they should define iomem_is_ioport() in order to drop the custom pci_iounmap() and have only one remaining definition of that function left. The one special case that I missed the last time is s390, which does not use GENERIC_PCI_IOMAP and will just require a separate copy of pci_iounmap() to go along with the is custom pci_iomap(). > The two exceptions are x86 and m68k. The former uses lib/iomap.c through > CONFIG_GENERIC_IOMAP, as Arnd pointed out in the previous discussion > (thus, CONFIG_GENERIC_IOMAP is not really generic in this regard). > > So as I see it, only m68k WOULD need its own custom definition of > iomem_is_ioport(). But as I understand it it doesn't because it uses the > one from asm-generic/pci_iomap.h ?? At the moment, m68k gets the pci_iounmap() from lib/iomap.c if PCI is enabled for coldfire, but that incorrectly calls iounmap() on PCI_IO_PA if it gets passed a PIO address. The version from asm-generic/io.h should fix this. For classic m68k, there is no PCI, so nothing calls pci_iounmap(). > I wasn't entirely sure how to deal with the address ranges for the > generic implementation in asm-generic/io.h. It's marked with a TODO. > Input appreciated. I commented on the function directly. To clarify, I think we should be able to directly turn each pci_iounmap() definition into a iomem_is_ioport() definition by keeping the logic unchanged and just return 'true' for the PIO variant or 'false' for the MMIO version. > I removed the guard around define pci_iounmap in asm-generic/io.h. An > alternative would be to have it be guarded by CONFIG_GENERIC_IOMAP and > CONFIG_GENERIC_PCI_IOMAP, both. Without such a guard, there is no > collision however, because generic pci_iounmap() from > drivers/pci/iomap.c will only get pulled in when > CONFIG_GENERIC_PCI_IOMAP is actually set. The "#define pci_iomap" can be removed entirely I think. Arnd