From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B46202C80 for ; Tue, 28 Dec 2021 10:59:25 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BSA7EKX001769; Tue, 28 Dec 2021 10:59:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=+zyW5i6OI8A0c4K6evToxyfQjjczj9uw2pn4yk+SR7k=; b=pcw/uW8v/HV23WBgD8ZjRm9IrGz2p+VZ7eZ+u7riAv1sjlkh+h/fLfwWDBmcM8Bo5Fmd vn06o8uNPnUykpdvcIzJGCUcxbVusEFVGbGJCxOI2w3cVP8BgXdd+7rXgMWhLHd9tk4B qaX3iPy47QzD/AksgaeEKLCOm5B0Od2H3vZiYm4Da/wXXuKa0wHf6VtFo3jZJ9tHo9bz 4QM0w3Rfhwmg0FxtU5PvhecdlEqtQChCQN16voLmPq6XcU13mmExhXEotMvedJkJF+Ec BhezmLDMTIJnFjaOZoFLVJ8+zBpMGhyEygXU3bI3M2yzXFyCgrPaoeiU4DHSP2gn+gHY /Q== Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7xdu3bv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:05 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BSAw4e4032318; Tue, 28 Dec 2021 10:59:02 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04fra.de.ibm.com with ESMTP id 3d5tx9xvnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:02 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BSAwxP843974984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Dec 2021 10:58:59 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 907CC42041; Tue, 28 Dec 2021 10:58:59 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8FF542042; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Received: from sig-9-145-12-118.uk.ibm.com (unknown [9.145.12.118]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Message-ID: Subject: Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI From: Niklas Schnelle To: Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Arnd Bergmann , Bjorn Helgaas , John Garry , 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 , Hans Verkuil , 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 , GR-QLogic-Storage-Upstream@marvell.com, Mark Brown , Sudip Mukherjee , Teddy Wang , Forest Bond , Jiri Slaby , Wim Van Sebroeck , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-ide@vger.kernel.org, linux-gpio@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-media@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-wireless@vger.kernel.org, megaraidlinux.pdl@broadcom.com, linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-watchdog@vger.kernel.org, alsa-devel@alsa-project.org Date: Tue, 28 Dec 2021 11:58:55 +0100 In-Reply-To: <20211228101435.3a55b983@coco.lan> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-2-schnelle@linux.ibm.com> <20211228101435.3a55b983@coco.lan> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HQH4aOLZAlr26uyO-kejW0wN9QQ_LAGG X-Proofpoint-ORIG-GUID: HQH4aOLZAlr26uyO-kejW0wN9QQ_LAGG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-28_06,2021-12-28_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112280048 On Tue, 2021-12-28 at 10:15 +0100, Mauro Carvalho Chehab wrote: > Em Tue, 28 Dec 2021 09:21:23 +0100 > Greg Kroah-Hartman escreveu: > > > On Mon, Dec 27, 2021 at 05:42:46PM +0100, Niklas Schnelle wrote: > > > --- a/drivers/pci/Kconfig > > > +++ b/drivers/pci/Kconfig > > > @@ -23,6 +23,17 @@ menuconfig PCI > > > > > > if PCI > > > > > > +config LEGACY_PCI > > > + bool "Enable support for legacy PCI devices" > > > + depends on HAVE_PCI > > > + help > > > + This option enables support for legacy PCI devices. This includes > > > + PCI devices attached directly or via a bridge on a PCI Express bus. > > > + It also includes compatibility features on PCI Express devices which > > > + make use of legacy I/O spaces. > > This Kconfig doesn't seem what it is needed there, as this should be an > arch-dependent feature, and not something that the poor user should be > aware if a given architecture supports it or not. Also, the above will keep > causing warnings or errors with randconfigs. > > Also, the "depends on HAVE_CPI" is bogus, as PCI already depends on > HAVE_PCI: Ah yes you're right. > > menuconfig PCI > bool "PCI support" > depends on HAVE_PCI > help > This option enables support for the PCI local bus, including > support for PCI-X and the foundations for PCI Express support. > Say 'Y' here unless you know what you are doing. > > So, instead, I would expect that a new HAVE_xxx option would be > added at arch/*/Kconfig, like: > > config X86 > ... > select HAVE_PCI_DIRECT_IO > > It would also make sense to document it at Documentation/features/. I'll look into that, thanks. > > > All you really care about is the "legacy" I/O spaces here, this isn't > > tied to PCI specifically at all, right? > > > > So why not just have a OLD_STYLE_IO config option or something like > > that, to show that it's the i/o functions we care about here, not PCI at > > all? > > > > And maybe not call it "old" or "legacy" as time constantly goes forward, > > just describe it as it is, "DIRECT_IO"? > > Agreed. HAVE_PCI_DIRECT_IO (or something similar) seems a more appropriate > name for it. > > Thanks, > Mauro Hmm, I might be missing something here but that sounds a lot like the HAS_IOPORT option added in patch 02. We add both LEGACY_PCI and HAS_IOPORT to differentiate between two cases. HAS_IOPORT is for PC-style devices that are not on a PCI card while LEGACY_PCI is for PCI drivers that require port I/O. This includes pre-PCIe devices as well as PCIe devices which require features like I/O spaces. The "legacy" naming is comes from the PCIe spec which in section 2.1.1.2 says "PCI Express supports I/O Space for compatibility with legacy devices which require their use. Future revisions of this specification may deprecate the use of I/O Space." These two separate config options allow us to compile without support for these legacy PCI devices even on a system where inb()/outb() and friends are required for some PC style devices and for example ACPI. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3753BC433EF for ; Tue, 28 Dec 2021 10:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=80DOAI9d+iFJIu8tk9C0JapUTFmCjkQ3M/fOIsR2Se8=; b=3GJ3fK/vU3hvnW 3wMZ764OW8hP1U/E3OG7T2wh+u4FtLAU2ojGLNCZzBTQcDNol+CVrqG1emJnK6lQStErqVvngBQ2i SyGFRMRRs657D4wFQAvYh9/uK5alK6ERPqodk9sQMnJeRBatK502SBoXZpBSkak4CulJs7ul4PUXJ DpJeU//UK+HyhxxizHM90BiyS+Xwqf4cp032yZanpLf0cc83CuMnpK3XyOQFUWJNf6v60TYJZ2/x3 WuKIT7exOn0K8l45JByJNmk5G7IfiS+6rRxlI1eIuMOhQfU82W8PWBEMG0bbqMr2snhAAqrcq1W0+ Ukh8U8EQTuOprTd2gLtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2ACO-000kUd-1t; Tue, 28 Dec 2021 10:59:20 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2ACL-000kUC-BU for linux-riscv@lists.infradead.org; Tue, 28 Dec 2021 10:59:18 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BSA7EKX001769; Tue, 28 Dec 2021 10:59:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=+zyW5i6OI8A0c4K6evToxyfQjjczj9uw2pn4yk+SR7k=; b=pcw/uW8v/HV23WBgD8ZjRm9IrGz2p+VZ7eZ+u7riAv1sjlkh+h/fLfwWDBmcM8Bo5Fmd vn06o8uNPnUykpdvcIzJGCUcxbVusEFVGbGJCxOI2w3cVP8BgXdd+7rXgMWhLHd9tk4B qaX3iPy47QzD/AksgaeEKLCOm5B0Od2H3vZiYm4Da/wXXuKa0wHf6VtFo3jZJ9tHo9bz 4QM0w3Rfhwmg0FxtU5PvhecdlEqtQChCQN16voLmPq6XcU13mmExhXEotMvedJkJF+Ec BhezmLDMTIJnFjaOZoFLVJ8+zBpMGhyEygXU3bI3M2yzXFyCgrPaoeiU4DHSP2gn+gHY /Q== Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7xdu3bv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:05 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BSAw4e4032318; Tue, 28 Dec 2021 10:59:02 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04fra.de.ibm.com with ESMTP id 3d5tx9xvnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:02 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BSAwxP843974984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Dec 2021 10:58:59 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 907CC42041; Tue, 28 Dec 2021 10:58:59 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8FF542042; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Received: from sig-9-145-12-118.uk.ibm.com (unknown [9.145.12.118]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Message-ID: Subject: Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI From: Niklas Schnelle To: Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Arnd Bergmann , Bjorn Helgaas , John Garry , 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 , Hans Verkuil , 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 , GR-QLogic-Storage-Upstream@marvell.com, Mark Brown , Sudip Mukherjee , Teddy Wang , Forest Bond , Jiri Slaby , Wim Van Sebroeck , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-ide@vger.kernel.org, linux-gpio@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-media@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-wireless@vger.kernel.org, megaraidlinux.pdl@broadcom.com, linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-watchdog@vger.kernel.org, alsa-devel@alsa-project.org Date: Tue, 28 Dec 2021 11:58:55 +0100 In-Reply-To: <20211228101435.3a55b983@coco.lan> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-2-schnelle@linux.ibm.com> <20211228101435.3a55b983@coco.lan> X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HQH4aOLZAlr26uyO-kejW0wN9QQ_LAGG X-Proofpoint-ORIG-GUID: HQH4aOLZAlr26uyO-kejW0wN9QQ_LAGG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-28_06,2021-12-28_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112280048 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_025917_431949_C66D1C1B X-CRM114-Status: GOOD ( 39.47 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, 2021-12-28 at 10:15 +0100, Mauro Carvalho Chehab wrote: > Em Tue, 28 Dec 2021 09:21:23 +0100 > Greg Kroah-Hartman escreveu: > > > On Mon, Dec 27, 2021 at 05:42:46PM +0100, Niklas Schnelle wrote: > > > --- a/drivers/pci/Kconfig > > > +++ b/drivers/pci/Kconfig > > > @@ -23,6 +23,17 @@ menuconfig PCI > > > > > > if PCI > > > > > > +config LEGACY_PCI > > > + bool "Enable support for legacy PCI devices" > > > + depends on HAVE_PCI > > > + help > > > + This option enables support for legacy PCI devices. This includes > > > + PCI devices attached directly or via a bridge on a PCI Express bus. > > > + It also includes compatibility features on PCI Express devices which > > > + make use of legacy I/O spaces. > > This Kconfig doesn't seem what it is needed there, as this should be an > arch-dependent feature, and not something that the poor user should be > aware if a given architecture supports it or not. Also, the above will keep > causing warnings or errors with randconfigs. > > Also, the "depends on HAVE_CPI" is bogus, as PCI already depends on > HAVE_PCI: Ah yes you're right. > > menuconfig PCI > bool "PCI support" > depends on HAVE_PCI > help > This option enables support for the PCI local bus, including > support for PCI-X and the foundations for PCI Express support. > Say 'Y' here unless you know what you are doing. > > So, instead, I would expect that a new HAVE_xxx option would be > added at arch/*/Kconfig, like: > > config X86 > ... > select HAVE_PCI_DIRECT_IO > > It would also make sense to document it at Documentation/features/. I'll look into that, thanks. > > > All you really care about is the "legacy" I/O spaces here, this isn't > > tied to PCI specifically at all, right? > > > > So why not just have a OLD_STYLE_IO config option or something like > > that, to show that it's the i/o functions we care about here, not PCI at > > all? > > > > And maybe not call it "old" or "legacy" as time constantly goes forward, > > just describe it as it is, "DIRECT_IO"? > > Agreed. HAVE_PCI_DIRECT_IO (or something similar) seems a more appropriate > name for it. > > Thanks, > Mauro Hmm, I might be missing something here but that sounds a lot like the HAS_IOPORT option added in patch 02. We add both LEGACY_PCI and HAS_IOPORT to differentiate between two cases. HAS_IOPORT is for PC-style devices that are not on a PCI card while LEGACY_PCI is for PCI drivers that require port I/O. This includes pre-PCIe devices as well as PCIe devices which require features like I/O spaces. The "legacy" naming is comes from the PCIe spec which in section 2.1.1.2 says "PCI Express supports I/O Space for compatibility with legacy devices which require their use. Future revisions of this specification may deprecate the use of I/O Space." These two separate config options allow us to compile without support for these legacy PCI devices even on a system where inb()/outb() and friends are required for some PC style devices and for example ACPI. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC3C5C433F5 for ; Wed, 29 Dec 2021 14:23:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9F75017D0; Wed, 29 Dec 2021 15:22:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F75017D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640787810; bh=vTPr7817B8CAzoSTy3itnKp9iRKtmILChIPoq5ObCGM=; h=Subject:From:To:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cIYZO57mNtMgg5OYwBH9EB7cZvzqci32SfXknWQYcqxs1SS1M35Aff8iJ/rcyckJ/ s+y+PiJiunQm8VvkWsneC66qiU72yo9el6o1eSEMGZX4VHAd5i3mvDuLz5Z8zvBbp9 zntJ7h1Zp3HFVlqdWE8tPPVH5DH8y6SA/fquVYvM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7CBEFF80518; Wed, 29 Dec 2021 15:20:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 33749F80224; Tue, 28 Dec 2021 11:59:16 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 092AFF800D3 for ; Tue, 28 Dec 2021 11:59:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 092AFF800D3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="pcw/uW8v" Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BS9XJpr026060; Tue, 28 Dec 2021 10:59:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=+zyW5i6OI8A0c4K6evToxyfQjjczj9uw2pn4yk+SR7k=; b=pcw/uW8v/HV23WBgD8ZjRm9IrGz2p+VZ7eZ+u7riAv1sjlkh+h/fLfwWDBmcM8Bo5Fmd vn06o8uNPnUykpdvcIzJGCUcxbVusEFVGbGJCxOI2w3cVP8BgXdd+7rXgMWhLHd9tk4B qaX3iPy47QzD/AksgaeEKLCOm5B0Od2H3vZiYm4Da/wXXuKa0wHf6VtFo3jZJ9tHo9bz 4QM0w3Rfhwmg0FxtU5PvhecdlEqtQChCQN16voLmPq6XcU13mmExhXEotMvedJkJF+Ec BhezmLDMTIJnFjaOZoFLVJ8+zBpMGhyEygXU3bI3M2yzXFyCgrPaoeiU4DHSP2gn+gHY /Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7vne5pd8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:05 +0000 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BSAuPwx008476; Tue, 28 Dec 2021 10:59:05 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7vne5pce-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:04 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BSAw4e4032318; Tue, 28 Dec 2021 10:59:02 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04fra.de.ibm.com with ESMTP id 3d5tx9xvnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:02 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BSAwxP843974984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Dec 2021 10:58:59 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 907CC42041; Tue, 28 Dec 2021 10:58:59 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8FF542042; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Received: from sig-9-145-12-118.uk.ibm.com (unknown [9.145.12.118]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Message-ID: Subject: Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI From: Niklas Schnelle To: Mauro Carvalho Chehab , Greg Kroah-Hartman Date: Tue, 28 Dec 2021 11:58:55 +0100 In-Reply-To: <20211228101435.3a55b983@coco.lan> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-2-schnelle@linux.ibm.com> <20211228101435.3a55b983@coco.lan> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: R70v1mEB0V660ZMlvB4IimQ97GCEzNCV X-Proofpoint-GUID: Si4Rqx6a-2tyPXLsq3NIbMv_73pq54I8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-28_06,2021-12-28_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112280048 X-Mailman-Approved-At: Wed, 29 Dec 2021 15:20:41 +0100 Cc: linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-pci@vger.kernel.org, Linus Walleij , alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Jean Delvare , Guo Ren , linux-i2c@vger.kernel.org, linux-riscv@lists.infradead.org, Vincent Chen , Jiri Slaby , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Hannes Reinecke , Michael Grzeschik , linux-scsi@vger.kernel.org, Sumit Saxena , Damien Le Moal , Sathya Prakash , Jesse Brandeburg , linux-csky@vger.kernel.org, Kashyap Desai , Nilesh Javali , intel-wired-lan@lists.osuosl.org, linux-serial@vger.kernel.org, GR-QLogic-Storage-Upstream@marvell.com, Jakub Kicinski , MPT-FusionLinux.pdl@broadcom.com, "James E.J. Bottomley" , Guenter Roeck , linux-media@vger.kernel.org, linux-input@vger.kernel.org, Albert Ou , linux-watchdog@vger.kernel.org, Jouni Malinen , Suganath Prabu Subramani , Kalle Valo , John Garry , linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, Ian Abbott , Mark Brown , Greentime Hu , Paul Walmsley , Bjorn Helgaas , Wim Van Sebroeck , megaraidlinux.pdl@broadcom.com, Teddy Wang , linux-hwmon@vger.kernel.org, Arnd Bergmann , Karsten Keil , Sreekanth Reddy , "Martin K. Petersen" , Nick Hu , Sudip Mukherjee , Shivasharan S , netdev@vger.kernel.org, Dmitry Torokhov , linux-wireless@vger.kernel.org, Takashi Iwai , "David S. Miller" , H Hartley Sweeten , Palmer Dabbelt , Forest Bond , Hans Verkuil , Tony Nguyen , Bartosz Golaszewski X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 2021-12-28 at 10:15 +0100, Mauro Carvalho Chehab wrote: > Em Tue, 28 Dec 2021 09:21:23 +0100 > Greg Kroah-Hartman escreveu: > > > On Mon, Dec 27, 2021 at 05:42:46PM +0100, Niklas Schnelle wrote: > > > --- a/drivers/pci/Kconfig > > > +++ b/drivers/pci/Kconfig > > > @@ -23,6 +23,17 @@ menuconfig PCI > > > > > > if PCI > > > > > > +config LEGACY_PCI > > > + bool "Enable support for legacy PCI devices" > > > + depends on HAVE_PCI > > > + help > > > + This option enables support for legacy PCI devices. This includes > > > + PCI devices attached directly or via a bridge on a PCI Express bus. > > > + It also includes compatibility features on PCI Express devices which > > > + make use of legacy I/O spaces. > > This Kconfig doesn't seem what it is needed there, as this should be an > arch-dependent feature, and not something that the poor user should be > aware if a given architecture supports it or not. Also, the above will keep > causing warnings or errors with randconfigs. > > Also, the "depends on HAVE_CPI" is bogus, as PCI already depends on > HAVE_PCI: Ah yes you're right. > > menuconfig PCI > bool "PCI support" > depends on HAVE_PCI > help > This option enables support for the PCI local bus, including > support for PCI-X and the foundations for PCI Express support. > Say 'Y' here unless you know what you are doing. > > So, instead, I would expect that a new HAVE_xxx option would be > added at arch/*/Kconfig, like: > > config X86 > ... > select HAVE_PCI_DIRECT_IO > > It would also make sense to document it at Documentation/features/. I'll look into that, thanks. > > > All you really care about is the "legacy" I/O spaces here, this isn't > > tied to PCI specifically at all, right? > > > > So why not just have a OLD_STYLE_IO config option or something like > > that, to show that it's the i/o functions we care about here, not PCI at > > all? > > > > And maybe not call it "old" or "legacy" as time constantly goes forward, > > just describe it as it is, "DIRECT_IO"? > > Agreed. HAVE_PCI_DIRECT_IO (or something similar) seems a more appropriate > name for it. > > Thanks, > Mauro Hmm, I might be missing something here but that sounds a lot like the HAS_IOPORT option added in patch 02. We add both LEGACY_PCI and HAS_IOPORT to differentiate between two cases. HAS_IOPORT is for PC-style devices that are not on a PCI card while LEGACY_PCI is for PCI drivers that require port I/O. This includes pre-PCIe devices as well as PCIe devices which require features like I/O spaces. The "legacy" naming is comes from the PCIe spec which in section 2.1.1.2 says "PCI Express supports I/O Space for compatibility with legacy devices which require their use. Future revisions of this specification may deprecate the use of I/O Space." These two separate config options allow us to compile without support for these legacy PCI devices even on a system where inb()/outb() and friends are required for some PC style devices and for example ACPI. 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C89F3C433F5 for ; Thu, 30 Dec 2021 17:17:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B719810E225; Thu, 30 Dec 2021 17:17:03 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by gabe.freedesktop.org (Postfix) with ESMTPS id E395210E195 for ; Tue, 28 Dec 2021 10:59:15 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BSA7EKX001769; Tue, 28 Dec 2021 10:59:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=+zyW5i6OI8A0c4K6evToxyfQjjczj9uw2pn4yk+SR7k=; b=pcw/uW8v/HV23WBgD8ZjRm9IrGz2p+VZ7eZ+u7riAv1sjlkh+h/fLfwWDBmcM8Bo5Fmd vn06o8uNPnUykpdvcIzJGCUcxbVusEFVGbGJCxOI2w3cVP8BgXdd+7rXgMWhLHd9tk4B qaX3iPy47QzD/AksgaeEKLCOm5B0Od2H3vZiYm4Da/wXXuKa0wHf6VtFo3jZJ9tHo9bz 4QM0w3Rfhwmg0FxtU5PvhecdlEqtQChCQN16voLmPq6XcU13mmExhXEotMvedJkJF+Ec BhezmLDMTIJnFjaOZoFLVJ8+zBpMGhyEygXU3bI3M2yzXFyCgrPaoeiU4DHSP2gn+gHY /Q== Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3d7xdu3bv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:05 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BSAw4e4032318; Tue, 28 Dec 2021 10:59:02 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04fra.de.ibm.com with ESMTP id 3d5tx9xvnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Dec 2021 10:59:02 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BSAwxP843974984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Dec 2021 10:58:59 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 907CC42041; Tue, 28 Dec 2021 10:58:59 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8FF542042; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Received: from sig-9-145-12-118.uk.ibm.com (unknown [9.145.12.118]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 28 Dec 2021 10:58:55 +0000 (GMT) Message-ID: Subject: Re: [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI From: Niklas Schnelle To: Mauro Carvalho Chehab , Greg Kroah-Hartman Date: Tue, 28 Dec 2021 11:58:55 +0100 In-Reply-To: <20211228101435.3a55b983@coco.lan> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-2-schnelle@linux.ibm.com> <20211228101435.3a55b983@coco.lan> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HQH4aOLZAlr26uyO-kejW0wN9QQ_LAGG X-Proofpoint-ORIG-GUID: HQH4aOLZAlr26uyO-kejW0wN9QQ_LAGG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-28_06,2021-12-28_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112280048 X-Mailman-Approved-At: Thu, 30 Dec 2021 17:17:01 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-pci@vger.kernel.org, alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, Jaroslav Kysela , linux-ide@vger.kernel.org, Jean Delvare , Guo Ren , linux-i2c@vger.kernel.org, linux-riscv@lists.infradead.org, Vincent Chen , Jiri Slaby , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Hannes Reinecke , Michael Grzeschik , linux-scsi@vger.kernel.org, Sumit Saxena , Damien Le Moal , Sathya Prakash , Jesse Brandeburg , linux-csky@vger.kernel.org, Kashyap Desai , Nilesh Javali , intel-wired-lan@lists.osuosl.org, linux-serial@vger.kernel.org, GR-QLogic-Storage-Upstream@marvell.com, Jakub Kicinski , MPT-FusionLinux.pdl@broadcom.com, "James E.J. Bottomley" , Guenter Roeck , linux-media@vger.kernel.org, linux-input@vger.kernel.org, Albert Ou , linux-watchdog@vger.kernel.org, Jouni Malinen , Suganath Prabu Subramani , Kalle Valo , John Garry , linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, Ian Abbott , Mark Brown , Greentime Hu , Paul Walmsley , Bjorn Helgaas , Wim Van Sebroeck , megaraidlinux.pdl@broadcom.com, Teddy Wang , linux-hwmon@vger.kernel.org, Arnd Bergmann , Karsten Keil , Sreekanth Reddy , "Martin K. Petersen" , Nick Hu , Sudip Mukherjee , Shivasharan S , netdev@vger.kernel.org, Dmitry Torokhov , linux-wireless@vger.kernel.org, Takashi Iwai , "David S. Miller" , H Hartley Sweeten , Palmer Dabbelt , Forest Bond , Hans Verkuil , Tony Nguyen , Bartosz Golaszewski Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 2021-12-28 at 10:15 +0100, Mauro Carvalho Chehab wrote: > Em Tue, 28 Dec 2021 09:21:23 +0100 > Greg Kroah-Hartman escreveu: > > > On Mon, Dec 27, 2021 at 05:42:46PM +0100, Niklas Schnelle wrote: > > > --- a/drivers/pci/Kconfig > > > +++ b/drivers/pci/Kconfig > > > @@ -23,6 +23,17 @@ menuconfig PCI > > > > > > if PCI > > > > > > +config LEGACY_PCI > > > + bool "Enable support for legacy PCI devices" > > > + depends on HAVE_PCI > > > + help > > > + This option enables support for legacy PCI devices. This includes > > > + PCI devices attached directly or via a bridge on a PCI Express bus. > > > + It also includes compatibility features on PCI Express devices which > > > + make use of legacy I/O spaces. > > This Kconfig doesn't seem what it is needed there, as this should be an > arch-dependent feature, and not something that the poor user should be > aware if a given architecture supports it or not. Also, the above will keep > causing warnings or errors with randconfigs. > > Also, the "depends on HAVE_CPI" is bogus, as PCI already depends on > HAVE_PCI: Ah yes you're right. > > menuconfig PCI > bool "PCI support" > depends on HAVE_PCI > help > This option enables support for the PCI local bus, including > support for PCI-X and the foundations for PCI Express support. > Say 'Y' here unless you know what you are doing. > > So, instead, I would expect that a new HAVE_xxx option would be > added at arch/*/Kconfig, like: > > config X86 > ... > select HAVE_PCI_DIRECT_IO > > It would also make sense to document it at Documentation/features/. I'll look into that, thanks. > > > All you really care about is the "legacy" I/O spaces here, this isn't > > tied to PCI specifically at all, right? > > > > So why not just have a OLD_STYLE_IO config option or something like > > that, to show that it's the i/o functions we care about here, not PCI at > > all? > > > > And maybe not call it "old" or "legacy" as time constantly goes forward, > > just describe it as it is, "DIRECT_IO"? > > Agreed. HAVE_PCI_DIRECT_IO (or something similar) seems a more appropriate > name for it. > > Thanks, > Mauro Hmm, I might be missing something here but that sounds a lot like the HAS_IOPORT option added in patch 02. We add both LEGACY_PCI and HAS_IOPORT to differentiate between two cases. HAS_IOPORT is for PC-style devices that are not on a PCI card while LEGACY_PCI is for PCI drivers that require port I/O. This includes pre-PCIe devices as well as PCIe devices which require features like I/O spaces. The "legacy" naming is comes from the PCIe spec which in section 2.1.1.2 says "PCI Express supports I/O Space for compatibility with legacy devices which require their use. Future revisions of this specification may deprecate the use of I/O Space." These two separate config options allow us to compile without support for these legacy PCI devices even on a system where inb()/outb() and friends are required for some PC style devices and for example ACPI. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Niklas Schnelle Date: Tue, 28 Dec 2021 11:58:55 +0100 Subject: [Intel-wired-lan] [RFC 01/32] Kconfig: introduce and depend on LEGACY_PCI In-Reply-To: <20211228101435.3a55b983@coco.lan> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-2-schnelle@linux.ibm.com> <20211228101435.3a55b983@coco.lan> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: On Tue, 2021-12-28 at 10:15 +0100, Mauro Carvalho Chehab wrote: > Em Tue, 28 Dec 2021 09:21:23 +0100 > Greg Kroah-Hartman escreveu: > > > On Mon, Dec 27, 2021 at 05:42:46PM +0100, Niklas Schnelle wrote: > > > --- a/drivers/pci/Kconfig > > > +++ b/drivers/pci/Kconfig > > > @@ -23,6 +23,17 @@ menuconfig PCI > > > > > > if PCI > > > > > > +config LEGACY_PCI > > > + bool "Enable support for legacy PCI devices" > > > + depends on HAVE_PCI > > > + help > > > + This option enables support for legacy PCI devices. This includes > > > + PCI devices attached directly or via a bridge on a PCI Express bus. > > > + It also includes compatibility features on PCI Express devices which > > > + make use of legacy I/O spaces. > > This Kconfig doesn't seem what it is needed there, as this should be an > arch-dependent feature, and not something that the poor user should be > aware if a given architecture supports it or not. Also, the above will keep > causing warnings or errors with randconfigs. > > Also, the "depends on HAVE_CPI" is bogus, as PCI already depends on > HAVE_PCI: Ah yes you're right. > > menuconfig PCI > bool "PCI support" > depends on HAVE_PCI > help > This option enables support for the PCI local bus, including > support for PCI-X and the foundations for PCI Express support. > Say 'Y' here unless you know what you are doing. > > So, instead, I would expect that a new HAVE_xxx option would be > added at arch/*/Kconfig, like: > > config X86 > ... > select HAVE_PCI_DIRECT_IO > > It would also make sense to document it at Documentation/features/. I'll look into that, thanks. > > > All you really care about is the "legacy" I/O spaces here, this isn't > > tied to PCI specifically at all, right? > > > > So why not just have a OLD_STYLE_IO config option or something like > > that, to show that it's the i/o functions we care about here, not PCI at > > all? > > > > And maybe not call it "old" or "legacy" as time constantly goes forward, > > just describe it as it is, "DIRECT_IO"? > > Agreed. HAVE_PCI_DIRECT_IO (or something similar) seems a more appropriate > name for it. > > Thanks, > Mauro Hmm, I might be missing something here but that sounds a lot like the HAS_IOPORT option added in patch 02. We add both LEGACY_PCI and HAS_IOPORT to differentiate between two cases. HAS_IOPORT is for PC-style devices that are not on a PCI card while LEGACY_PCI is for PCI drivers that require port I/O. This includes pre-PCIe devices as well as PCIe devices which require features like I/O spaces. The "legacy" naming is comes from the PCIe spec which in section 2.1.1.2 says "PCI Express supports I/O Space for compatibility with legacy devices which require their use. Future revisions of this specification may deprecate the use of I/O Space." These two separate config options allow us to compile without support for these legacy PCI devices even on a system where inb()/outb() and friends are required for some PC style devices and for example ACPI.