linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity()
@ 2022-01-31 22:29 Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2022-01-31 22:29 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Nishanth Menon, Mark Rutland, Stuart Yoder,
	Benjamin Herrenschmidt, Will Deacon, Ashok Raj, Michael Ellerman,
	Jassi Brar, Sinan Kaya, iommu, Peter Ujfalusi, Bjorn Helgaas,
	linux-arm-kernel, Jason Gunthorpe, linux-pci, xen-devel,
	Kevin Tian, Arnd Bergmann, Robin Murphy, Alex Williamson,
	Cedric Le Goater, Santosh Shilimkar, Bjorn Helgaas, Megha Dey,
	Juergen Gross, Tero Kristo, Greg Kroah-Hartman, Vinod Koul,
	Marc Zygnier, dmaengine, linuxppc-dev

On Mon, Jan 31, 2022 at 10:16:41PM +0100, Thomas Gleixner wrote:
> Guenter,
> 
> On Mon, Jan 31 2022 at 07:21, Guenter Roeck wrote:
> > Sure. Please see http://server.roeck-us.net/qemu/x86/.
> > The logs are generated with with v5.16.4.
> 
> thanks for providing the data. It definitely helped me to leave the
> state of not seeing the wood for the trees. Fix below.
> 
> Thanks,
> 
>         tglx
> ---
> Subject: PCI/MSI: Remove bogus warning in pci_irq_get_affinity()
> From: Thomas Gleixner <tglx@linutronix.de>
> Date: Mon, 31 Jan 2022 22:02:46 +0100
> 
> The recent overhaul of pci_irq_get_affinity() introduced a regression when
> pci_irq_get_affinity() is called for an MSI-X interrupt which was not
> allocated with affinity descriptor information.
> 
> The original code just returned a NULL pointer in that case, but the rework
> added a WARN_ON() under the assumption that the corresponding WARN_ON() in
> the MSI case can be applied to MSI-X as well.
> 
> In fact the MSI warning in the original code does not make sense either
> because it's legitimate to invoke pci_irq_get_affinity() for a MSI
> interrupt which was not allocated with affinity descriptor information.
> 
> Remove it and just return NULL as the original code did.
> 
> Fixes: f48235900182 ("PCI/MSI: Simplify pci_irq_get_affinity()")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Tested-by: Guenter Roeck <linux@roeck-us.net>

Guenter

> ---
>  drivers/pci/msi/msi.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> --- a/drivers/pci/msi/msi.c
> +++ b/drivers/pci/msi/msi.c
> @@ -1111,7 +1111,8 @@ const struct cpumask *pci_irq_get_affini
>  	if (!desc)
>  		return cpu_possible_mask;
>  
> -	if (WARN_ON_ONCE(!desc->affinity))
> +	/* MSI[X] interrupts can be allocated without affinity descriptor */
> +	if (!desc->affinity)
>  		return NULL;
>  
>  	/*

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [patch V3 00/35] genirq/msi, PCI/MSI: Spring cleaning - Part 2
@ 2021-12-10 22:18 Thomas Gleixner
  2021-12-10 22:19 ` [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity() Thomas Gleixner
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Gleixner @ 2021-12-10 22:18 UTC (permalink / raw)
  To: LKML
  Cc: Bjorn Helgaas, Marc Zygnier, Alex Williamson, Kevin Tian,
	Jason Gunthorpe, Megha Dey, Ashok Raj, linux-pci,
	Cedric Le Goater, Juergen Gross, xen-devel, Arnd Bergmann,
	Michael Ellerman, Benjamin Herrenschmidt, linuxppc-dev,
	Greg Kroah-Hartman, Bjorn Helgaas, Stuart Yoder, Laurentiu Tudor,
	Nishanth Menon, Tero Kristo, Santosh Shilimkar, linux-arm-kernel,
	Vinod Koul, dmaengine, Mark Rutland, Will Deacon, Robin Murphy,
	Joerg Roedel, iommu, Jassi Brar, Peter Ujfalusi, Sinan Kaya

This is the second part of [PCI]MSI refactoring which aims to provide the
ability of expanding MSI-X vectors after enabling MSI-X.

This is based on the first part of this work which can be found here:

    https://lore.kernel.org/r/20211206210147.872865823@linutronix.de

and has been applied to:

     git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/msi


This second part has the following important changes:

   1) Cleanup of the MSI related data in struct device

      struct device contains at the moment various MSI related parts. Some
      of them (the irq domain pointer) cannot be moved out, but the rest
      can be allocated on first use. This is in preparation of adding more
      per device MSI data later on.

   2) Consolidation of sysfs handling

      As a first step this moves the sysfs pointer from struct msi_desc
      into the new per device MSI data structure where it belongs.

      Later changes will cleanup this code further, but that's not possible
      at this point.

   3) Use PCI device properties instead of looking up MSI descriptors and
      analysing their data.

   4) Provide a function to retrieve the Linux interrupt number for a given
      MSI index similar to pci_irq_vector() and cleanup all open coded
      variants.

It's also available from git:

     git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v3-part-2

Part 3 of this effort is available on top

     git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v3-part-3

     Part 3 is not going to be reposted as there is no change vs. V2.

V2 of part 2 can be found here:

    https://lore.kernel.org/r/20211206210307.625116253@linutronix.de

Changes versus V2:

  - Use PCI device properties instead of creating a new set - Jason

  - Picked up Reviewed/Tested/Acked-by tags as appropriate

Thanks,

	tglx
---
 arch/powerpc/platforms/cell/axon_msi.c              |    5 
 arch/powerpc/platforms/pseries/msi.c                |   38 +---
 arch/x86/kernel/apic/msi.c                          |    5 
 arch/x86/pci/xen.c                                  |   11 -
 drivers/base/platform-msi.c                         |  152 ++++++++-----------
 drivers/bus/fsl-mc/dprc-driver.c                    |    8 -
 drivers/bus/fsl-mc/fsl-mc-allocator.c               |    9 -
 drivers/bus/fsl-mc/fsl-mc-msi.c                     |   26 +--
 drivers/dma/mv_xor_v2.c                             |   16 --
 drivers/dma/qcom/hidma.c                            |   44 ++---
 drivers/dma/ti/k3-udma-private.c                    |    6 
 drivers/dma/ti/k3-udma.c                            |   14 -
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c         |   23 --
 drivers/irqchip/irq-mbigen.c                        |    4 
 drivers/irqchip/irq-mvebu-icu.c                     |   12 -
 drivers/irqchip/irq-ti-sci-inta.c                   |    2 
 drivers/mailbox/bcm-flexrm-mailbox.c                |    9 -
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c    |    4 
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c    |    4 
 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c |    5 
 drivers/pci/msi/irqdomain.c                         |   20 ++
 drivers/pci/msi/legacy.c                            |    6 
 drivers/pci/msi/msi.c                               |  133 ++++++----------
 drivers/pci/xen-pcifront.c                          |    2 
 drivers/perf/arm_smmuv3_pmu.c                       |    5 
 drivers/soc/fsl/dpio/dpio-driver.c                  |    8 -
 drivers/soc/ti/k3-ringacc.c                         |    6 
 drivers/soc/ti/ti_sci_inta_msi.c                    |   22 --
 drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c              |    4 
 include/linux/device.h                              |   25 ++-
 include/linux/fsl/mc.h                              |    4 
 include/linux/msi.h                                 |   95 ++++--------
 include/linux/pci.h                                 |    1 
 include/linux/soc/ti/ti_sci_inta_msi.h              |    1 
 kernel/irq/msi.c                                    |  158 +++++++++++++++-----
 35 files changed, 429 insertions(+), 458 deletions(-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-31 22:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-31 22:29 [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity() Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2021-12-10 22:18 [patch V3 00/35] genirq/msi, PCI/MSI: Spring cleaning - Part 2 Thomas Gleixner
2021-12-10 22:19 ` [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity() Thomas Gleixner
2021-12-17 22:30   ` Nathan Chancellor
2021-12-18 10:25     ` Thomas Gleixner
2021-12-18 19:04       ` Nathan Chancellor
2021-12-18 20:25       ` Cédric Le Goater
2021-12-20 11:55         ` Thomas Gleixner
2022-01-30 17:12   ` Guenter Roeck
2022-01-31 11:27     ` Thomas Gleixner
2022-01-31 15:21       ` Guenter Roeck
2022-01-31 21:16         ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).