Re: [patch 16/16] PCI/MSI: Enhance core to support hierarchy irqdomain

From: Marc Zyngier
Date: Wed Nov 12 2014 - 10:29:27 EST


Hi Thomas,

On 12/11/14 13:43, Thomas Gleixner wrote:
> From: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>
>
> Enhance PCI MSI core to support hierarchy irqdomain, so the common
> code can be shared across architectures.
>
> [ tglx: Extracted and combined from several patches ]
>
> Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>
> Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> Cc: Grant Likely <grant.likely@xxxxxxxxxx>
> Cc: Marc Zyngier <marc.zyngier@xxxxxxx>
> Cc: Yingjoe Chen <yingjoe.chen@xxxxxxxxxxxx>
> Cc: Yijing Wang <wangyijing@xxxxxxxxxx>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> drivers/pci/Kconfig | 5 ++++
> drivers/pci/msi.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/msi.h | 8 ++++++
> 3 files changed, 75 insertions(+)
>
> Index: tip/drivers/pci/Kconfig
> ===================================================================
> --- tip.orig/drivers/pci/Kconfig
> +++ tip/drivers/pci/Kconfig
> @@ -17,6 +17,11 @@ config PCI_MSI
>
> If you don't know what to do here, say Y.
>
> +config PCI_MSI_IRQ_DOMAIN
> + bool
> + depends on PCI_MSI
> + select GENERIC_MSI_IRQ_DOMAIN
> +
> config PCI_DEBUG
> bool "PCI Debugging"
> depends on PCI && DEBUG_KERNEL
> Index: tip/drivers/pci/msi.c
> ===================================================================
> --- tip.orig/drivers/pci/msi.c
> +++ tip/drivers/pci/msi.c
> @@ -19,6 +19,7 @@
> #include <linux/errno.h>
> #include <linux/io.h>
> #include <linux/slab.h>
> +#include <linux/irqdomain.h>
>
> #include "pci.h"
>
> @@ -1072,3 +1073,64 @@ int pci_enable_msix_range(struct pci_dev
> return nvec;
> }
> EXPORT_SYMBOL(pci_enable_msix_range);
> +
> +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
> +void pci_msi_domain_write_msg(struct irq_data *irq_data, struct msi_msg *msg)
> +{
> + struct msi_desc *desc = irq_data->msi_desc;
> +
> + /*
> + * MSI-X message is written per-IRQ.
> + * MSI message denotes a contiguous group of IRQs, written for 0th IRQ.
> + */
> + if (desc->irq == irq_data->irq)
> + pci_write_msi_msg(desc, msg);

My compiler barks at this. Shouldn't that be either:
pci_write_msi_msg(desc->irq, msg);
or
__pci_write_msi_msg(desc, msg);
?

Thanks,

M.
--
Jazz is not dead. It just smells funny...

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/