[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 13/13] PCI: Deprecate pci_intx(), pcim_intx()
- To: Philipp Stanner <pstanner@xxxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxxxxxx>
- From: Heiner Kallweit <hkallweit1@xxxxxxxxx>
- Date: Wed, 16 Oct 2024 10:43:27 +0200
- Autocrypt: addr=hkallweit1@xxxxxxxxx; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8Gm89g92/YkHji4jIWlp2fwzCcx5+lZCQ1XdqAiHQARAQABzSZIZWluZXIgS2Fs bHdlaXQgPGhrYWxsd2VpdDFAZ21haWwuY29tPsLBjgQTAQgAOBYhBGxfqY/yOyXjyjJehXLe ig9U8DoMBQJf9GRVAhsDBQsJCAcCBhUKCQgLAg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1U54ykM2W4DnHb1UiEf5xDkFd4=
- Cc: Damien Le Moal <dlemoal@xxxxxxxxxx>, Niklas Cassel <cassel@xxxxxxxxxx>, Sergey Shtylyov <s.shtylyov@xxxxxx>, Basavaraj Natikar <basavaraj.natikar@xxxxxxx>, Jiri Kosina <jikos@xxxxxxxxxx>, Benjamin Tissoires <bentiss@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Alex Dubov <oakad@xxxxxxxxx>, Sudarsana Kalluru <skalluru@xxxxxxxxxxx>, Manish Chopra <manishc@xxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>, Rasesh Mody <rmody@xxxxxxxxxxx>, GR-Linux-NIC-Dev@xxxxxxxxxxx, Igor Mitsyanko <imitsyanko@xxxxxxxxxxxxx>, Sergey Matyukevich <geomatsi@xxxxxxxxx>, Kalle Valo <kvalo@xxxxxxxxxx>, Sanjay R Mehta <sanju.mehta@xxxxxxx>, Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx>, Jon Mason <jdmason@xxxxxxxx>, Dave Jiang <dave.jiang@xxxxxxxxx>, Allen Hubbe <allenbh@xxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Jaroslav Kysela <perex@xxxxxxxx>, Takashi Iwai <tiwai@xxxxxxxx>, Chen Ni <nichen@xxxxxxxxxxx>, Mario Limonciello <mario.limonciello@xxxxxxx>, Ricky Wu <ricky_wu@xxxxxxxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Breno Leitao <leitao@xxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Mostafa Saleh <smostafa@xxxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, Yi Liu <yi.l.liu@xxxxxxxxx>, Christian Brauner <brauner@xxxxxxxxxx>, Ankit Agrawal <ankita@xxxxxxxxxx>, Eric Auger <eric.auger@xxxxxxxxxx>, Reinette Chatre <reinette.chatre@xxxxxxxxx>, Ye Bin <yebin10@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxx>, Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, Kai Vehmanen <kai.vehmanen@xxxxxxxxxxxxxxx>, Rui Salvaterra <rsalvaterra@xxxxxxxxx>, linux-ide@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-input@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-wireless@xxxxxxxxxxxxxxx, ntb@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-sound@xxxxxxxxxxxxxxx
- Delivery-date: Wed, 16 Oct 2024 08:43:37 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 16.10.2024 08:57, Philipp Stanner wrote:
> On Tue, 2024-10-15 at 13:53 -0600, Alex Williamson wrote:
>> On Tue, 15 Oct 2024 20:51:23 +0200
>> Philipp Stanner <pstanner@xxxxxxxxxx> wrote:
>>
>>> pci_intx() and its managed counterpart pcim_intx() only exist for
>>> older
>>> drivers which have not been ported yet for various reasons. Future
>>> drivers should preferably use pci_alloc_irq_vectors().
>>>
>>> Mark pci_intx() and pcim_intx() as deprecated and encourage usage
>>> of
>>> pci_alloc_irq_vectors() in its place.
>>
>> I don't really understand this. As we've discussed previously
>> pci_alloc_irq_vectors() is, unsurprisingly, for allocating PCI IRQ
>> vectors while pci_intx() is for manipulating the INTx disable bit on
>> PCI devices. The latter is a generic mechanism for preventing PCI
>> devices from generating INTx, regardless of whether there's a vector
>> allocated for it. How does the former replace the latter and why do
>> we
>> feel the need to deprecate the latter?
>>
>> It feels like this fits some narrow narrative and makes all users of
>> these now deprecated functions second class citizens. Why? At it's
>> root these are simply providing mask and set or mask and clear
>> register
>> bit operations. Thanks,
>
> I got the feeling from the RFC discussion that that was basically the
> consensus: people should use pci_alloc_irq_vectors(). Or did I
> misunderstand Andy and Heiner?
>
I think there are two different use cases for pci_intx().
At first there are several drivers where the direct usage of pci_intx()
can be eliminated by switching to the pci_alloc_irq_vectors() API.
And then there's usage of pci_intx() in
drivers/vfio/pci/vfio_pci_intrs.c
drivers/xen/xen-pciback/conf_space_header.c
There we have to keep the (AFAICS unmanaged) pci_intx() calls.
> I'm perfectly happy with dropping this patch and continue offering
> pci{m}_intx() to users, since after removing that hybrid hazzard I
> don't see any harm in them anymore.
>
>
> P.
>
>>
>> Alex
>>
>>> Signed-off-by: Philipp Stanner <pstanner@xxxxxxxxxx>
>>> ---
>>> drivers/pci/devres.c | 5 ++++-
>>> drivers/pci/pci.c | 5 ++++-
>>> 2 files changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
>>> index 6f8f712fe34e..4c76fc063104 100644
>>> --- a/drivers/pci/devres.c
>>> +++ b/drivers/pci/devres.c
>>> @@ -435,7 +435,7 @@ static struct pcim_intx_devres
>>> *get_or_create_intx_devres(struct device *dev)
>>> }
>>>
>>> /**
>>> - * pcim_intx - managed pci_intx()
>>> + * pcim_intx - managed pci_intx() (DEPRECATED)
>>> * @pdev: the PCI device to operate on
>>> * @enable: boolean: whether to enable or disable PCI INTx
>>> *
>>> @@ -443,6 +443,9 @@ static struct pcim_intx_devres
>>> *get_or_create_intx_devres(struct device *dev)
>>> *
>>> * Enable/disable PCI INTx for device @pdev.
>>> * Restore the original state on driver detach.
>>> + *
>>> + * This function is DEPRECATED. Do not use it in new code.
>>> + * Use pci_alloc_irq_vectors() instead (there is no managed
>>> version, currently).
>>> */
>>> int pcim_intx(struct pci_dev *pdev, int enable)
>>> {
>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>> index 7ce1d0e3a1d5..dc69e23b8982 100644
>>> --- a/drivers/pci/pci.c
>>> +++ b/drivers/pci/pci.c
>>> @@ -4477,11 +4477,14 @@ void pci_disable_parity(struct pci_dev
>>> *dev)
>>> }
>>>
>>> /**
>>> - * pci_intx - enables/disables PCI INTx for device dev
>>> + * pci_intx - enables/disables PCI INTx for device dev
>>> (DEPRECATED)
>>> * @pdev: the PCI device to operate on
>>> * @enable: boolean: whether to enable or disable PCI INTx
>>> *
>>> * Enables/disables PCI INTx for device @pdev
>>> + *
>>> + * This function is DEPRECATED. Do not use it in new code.
>>> + * Use pci_alloc_irq_vectors() instead.
>>> */
>>> void pci_intx(struct pci_dev *pdev, int enable)
>>> {
>>
>
>
|