2021-12-06 22:27:49

by Thomas Gleixner

[permalink] [raw]
Subject: [patch V2 08/23] PCI/sysfs: Use pci_irq_vector()

instead of fiddling with msi descriptors.

Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Juergen Gross <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
---
drivers/pci/pci-sysfs.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -62,11 +62,8 @@ static ssize_t irq_show(struct device *d
* For MSI, show the first MSI IRQ; for all other cases including
* MSI-X, show the legacy INTx IRQ.
*/
- if (pdev->msi_enabled) {
- struct msi_desc *desc = first_pci_msi_entry(pdev);
-
- return sysfs_emit(buf, "%u\n", desc->irq);
- }
+ if (pdev->msi_enabled)
+ return sysfs_emit(buf, "%u\n", pci_irq_vector(pdev, 0));
#endif

return sysfs_emit(buf, "%u\n", pdev->irq);



2021-12-07 07:43:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [patch V2 08/23] PCI/sysfs: Use pci_irq_vector()

On Mon, Dec 06, 2021 at 11:27:36PM +0100, Thomas Gleixner wrote:
> instead of fiddling with msi descriptors.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> Tested-by: Juergen Gross <[email protected]>
> Reviewed-by: Jason Gunthorpe <[email protected]>

Reviewed-by: Greg Kroah-Hartman <[email protected]>

2021-12-07 20:56:29

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [patch V2 08/23] PCI/sysfs: Use pci_irq_vector()

On Mon, Dec 06, 2021 at 11:27:36PM +0100, Thomas Gleixner wrote:
> instead of fiddling with msi descriptors.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> Tested-by: Juergen Gross <[email protected]>
> Reviewed-by: Jason Gunthorpe <[email protected]>

Acked-by: Bjorn Helgaas <[email protected]>

s/msi/MSI/ above if you have a chance. Nice cleanup, thanks!

> ---
> drivers/pci/pci-sysfs.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> --- a/drivers/pci/pci-sysfs.c
> +++ b/drivers/pci/pci-sysfs.c
> @@ -62,11 +62,8 @@ static ssize_t irq_show(struct device *d
> * For MSI, show the first MSI IRQ; for all other cases including
> * MSI-X, show the legacy INTx IRQ.
> */
> - if (pdev->msi_enabled) {
> - struct msi_desc *desc = first_pci_msi_entry(pdev);
> -
> - return sysfs_emit(buf, "%u\n", desc->irq);
> - }
> + if (pdev->msi_enabled)
> + return sysfs_emit(buf, "%u\n", pci_irq_vector(pdev, 0));
> #endif
>
> return sysfs_emit(buf, "%u\n", pdev->irq);
>

Subject: [tip: irq/msi] PCI/sysfs: Use pci_irq_vector()

The following commit has been merged into the irq/msi branch of tip:

Commit-ID: 793c5006769d77b8148236bc124b75e391110531
Gitweb: https://git.kernel.org/tip/793c5006769d77b8148236bc124b75e391110531
Author: Thomas Gleixner <[email protected]>
AuthorDate: Mon, 06 Dec 2021 23:27:36 +01:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Thu, 09 Dec 2021 11:52:21 +01:00

PCI/sysfs: Use pci_irq_vector()

instead of fiddling with MSI descriptors.

Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Juergen Gross <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

---
drivers/pci/pci-sysfs.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index cfe2f85..602f0fb 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -62,11 +62,8 @@ static ssize_t irq_show(struct device *dev,
* For MSI, show the first MSI IRQ; for all other cases including
* MSI-X, show the legacy INTx IRQ.
*/
- if (pdev->msi_enabled) {
- struct msi_desc *desc = first_pci_msi_entry(pdev);
-
- return sysfs_emit(buf, "%u\n", desc->irq);
- }
+ if (pdev->msi_enabled)
+ return sysfs_emit(buf, "%u\n", pci_irq_vector(pdev, 0));
#endif

return sysfs_emit(buf, "%u\n", pdev->irq);