mbox series

[v2,0/2] msi: extend msi_irqs sysfs entries to platform devices

Message ID 20210812105341.51657-1-21cnbao@gmail.com (mailing list archive)
Headers show
Series msi: extend msi_irqs sysfs entries to platform devices | expand

Message

Barry Song Aug. 12, 2021, 10:53 a.m. UTC
From: Barry Song <song.bao.hua@hisilicon.com>

Just like pci devices have msi_irqs which can be used by userspace irq affinity
tools or applications to bind irqs, platform devices also widely support msi
irqs.
For platform devices, for example ARM SMMU, userspaces also care about its msi
irqs as applications can know the mapping between devices and irqs and then
make smarter decision on handling irq affinity. For example, for SVA mode,
it is better to pin io page fault to the numa node applications are running
on. Otherwise, io page fault will get a remote page from the node iopf happens
rather than from the node applications are running on.

The first patch extracts the sysfs populate/destory code from PCI to
MSI core. The 2nd patch lets platform-msi export msi_irqs entry so that
userspace can know the mapping between devices and irqs for platform
devices.

-v2:
  extract common code for msi_irqs sysfs populate/destory from PCI to MSI core,
  platform_device can directly reuse common code;

-v1:
  https://lore.kernel.org/lkml/20210811105020.12980-1-song.bao.hua@hisilicon.com/

Barry Song (2):
  genirq/msi: extract common sysfs populate entries to msi core from pci
  platform-msi: Add ABI to show msi_irqs of platform devices

 Documentation/ABI/testing/sysfs-bus-platform |  14 +++
 drivers/base/platform-msi.c                  |  10 ++
 drivers/pci/msi.c                            | 124 ++-----------------------
 include/linux/msi.h                          |   4 +
 kernel/irq/msi.c                             | 134 +++++++++++++++++++++++++++
 5 files changed, 171 insertions(+), 115 deletions(-)

Comments

Greg KH Aug. 12, 2021, 11:02 a.m. UTC | #1
On Thu, Aug 12, 2021 at 10:53:39PM +1200, Barry Song wrote:
> From: Barry Song <song.bao.hua@hisilicon.com>
> 
> Just like pci devices have msi_irqs which can be used by userspace irq affinity
> tools or applications to bind irqs, platform devices also widely support msi
> irqs.
> For platform devices, for example ARM SMMU, userspaces also care about its msi
> irqs as applications can know the mapping between devices and irqs and then
> make smarter decision on handling irq affinity. For example, for SVA mode,
> it is better to pin io page fault to the numa node applications are running
> on. Otherwise, io page fault will get a remote page from the node iopf happens
> rather than from the node applications are running on.
> 
> The first patch extracts the sysfs populate/destory code from PCI to
> MSI core. The 2nd patch lets platform-msi export msi_irqs entry so that
> userspace can know the mapping between devices and irqs for platform
> devices.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bjorn Helgaas Aug. 12, 2021, 7:59 p.m. UTC | #2
On Thu, Aug 12, 2021 at 10:53:39PM +1200, Barry Song wrote:
> From: Barry Song <song.bao.hua@hisilicon.com>
> 
> Just like pci devices have msi_irqs which can be used by userspace irq affinity
> tools or applications to bind irqs, platform devices also widely support msi
> irqs.
> For platform devices, for example ARM SMMU, userspaces also care about its msi
> irqs as applications can know the mapping between devices and irqs and then
> make smarter decision on handling irq affinity. For example, for SVA mode,
> it is better to pin io page fault to the numa node applications are running
> on. Otherwise, io page fault will get a remote page from the node iopf happens
> rather than from the node applications are running on.
> 
> The first patch extracts the sysfs populate/destory code from PCI to
> MSI core. The 2nd patch lets platform-msi export msi_irqs entry so that
> userspace can know the mapping between devices and irqs for platform
> devices.
> 
> -v2:
>   extract common code for msi_irqs sysfs populate/destory from PCI to MSI core,
>   platform_device can directly reuse common code;
> 
> -v1:
>   https://lore.kernel.org/lkml/20210811105020.12980-1-song.bao.hua@hisilicon.com/
> 
> Barry Song (2):
>   genirq/msi: extract common sysfs populate entries to msi core from pci
>   platform-msi: Add ABI to show msi_irqs of platform devices
> 
>  Documentation/ABI/testing/sysfs-bus-platform |  14 +++
>  drivers/base/platform-msi.c                  |  10 ++
>  drivers/pci/msi.c                            | 124 ++-----------------------
>  include/linux/msi.h                          |   4 +
>  kernel/irq/msi.c                             | 134 +++++++++++++++++++++++++++
>  5 files changed, 171 insertions(+), 115 deletions(-)

I assume the IRQ guys will take care of this.

For the drivers/pci/ part:

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

But I would update the commit logs to consistently capitalize
initialisms.  Currently it's a mix of "PCI", "pci", "MSI", "msi",
"numa", "irq", "io", etc.

Also, if you rewrap the 2/2 commit log to fit in 75 columns, you won't
have a line that becomes 83 columns when "git log" indents it.  Maybe
also indent quoted things like the "ls" output by 2 spaces and add a
blank line before so the text doesn't run into them.