From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0546FC433EF for ; Wed, 5 Jan 2022 17:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242443AbiAERmk (ORCPT ); Wed, 5 Jan 2022 12:42:40 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4352 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242412AbiAERmi (ORCPT ); Wed, 5 Jan 2022 12:42:38 -0500 Received: from fraeml707-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JTcDP1FRwz67w73; Thu, 6 Jan 2022 01:39:17 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml707-chm.china.huawei.com (10.206.15.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 5 Jan 2022 18:42:31 +0100 Received: from [10.47.27.56] (10.47.27.56) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 5 Jan 2022 17:42:28 +0000 From: John Garry Subject: Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI To: Niklas Schnelle , Bjorn Helgaas , Mauro Carvalho Chehab , "Arnd Bergmann" CC: Hans Verkuil , Ettore Chimenti , Greg Kroah-Hartman , Arnd Bergmann , Bjorn Helgaas , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , Guo Ren , Damien Le Moal , "Ian Abbott" , H Hartley Sweeten , Linus Walleij , Bartosz Golaszewski , Jean Delvare , Guenter Roeck , Dmitry Torokhov , "Karsten Keil" , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , Michael Grzeschik , "David S. Miller" , "Jakub Kicinski" , Jesse Brandeburg , Tony Nguyen , Kalle Valo , Jouni Malinen , "James E.J. Bottomley" , "Martin K. Petersen" , Hannes Reinecke , Kashyap Desai , Sumit Saxena , Shivasharan S , Nilesh Javali , , Mark Brown , Sudip Mukherjee , "Teddy Wang" , Forest Bond , Jiri Slaby , "Wim Van Sebroeck" , Jaroslav Kysela , "Takashi Iwai" , , , , , , , , , , , , , , , , , , , , , , References: <20211229160317.GA1681139@bhelgaas> Message-ID: <3f39d8a2-2e57-a671-2926-eb4f2bf20c76@huawei.com> Date: Wed, 5 Jan 2022 17:42:16 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.27.56] X-ClientProxiedBy: lhreml736-chm.china.huawei.com (10.201.108.87) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On 29/12/2021 16:55, Niklas Schnelle wrote: > On Wed, 2021-12-29 at 10:03 -0600, Bjorn Helgaas wrote: >> On Wed, Dec 29, 2021 at 01:12:07PM +0100, Mauro Carvalho Chehab wrote: >>> Em Wed, 29 Dec 2021 12:45:38 +0100 >>> Niklas Schnelle escreveu: >>>> ... >>>> I do think we agree that once done correctly there is value in >>>> such an option independent of HAS_IOPORT only gating inb() etc uses. >> I'm not sure I'm convinced about this. For s390, you could do this >> patch series, where you don't define inb() at all, and you add new >> dependencies to prevent compile errors. Or you could define inb() to >> return ~0, which is what happens on other platforms when the device is >> not present. >> >>> Personally, I don't see much value on a Kconfig var for legacy PCI I/O >>> space. From maintenance PoV, bots won't be triggered if someone use >>> HAS_IOPORT instead of the PCI specific one - or vice-versa. So, we >>> could end having a mix of both at the wrong places, in long term. >>> >>> Also, assuming that PCIe hardware will some day abandon support for >>> "legacy" PCI I/O space, I guess some runtime logic would be needed, >>> in order to work with both kinds of PCIe controllers. So, having a >>> Kconfig option won't help much, IMO. >>> >>> So, my personal preference would be to have just one Kconfig var, but >>> I'm ok if the PCI maintainers decide otherwise. >> I don't really like the "LEGACY_PCI" Kconfig option. "Legacy" just >> means something old and out of favor; it doesn't say*what* that >> something is. >> >> I think you're specifically interested in I/O port space usage, and it >> seems that you want all PCI drivers that*only* use I/O port space to >> depend on LEGACY_PCI? Drivers that can use either I/O or memory >> space or both would not depend on LEGACY_PCI? This seems a little >> murky and error-prone. > I'd like to hear Arnd's opinion on this but you're the PCI maintainer > so of course your buy-in would be quite important for such an option. > Hi Niklas, I can't see the value in the LEGACY_PCI config - however I don't really understand Arnd's original intention. It was written that it would allow us to control "whether we have any pre-PCIe devices or those PCIe drivers that need PIO accessors other than ioport_map()/pci_iomap()". However I just don't see why CONFIG_PCI=y and CONFIG_HAS_IOPORT=y aren't always the gating factor here. Arnd? Thanks, John