[PATCH]

From: Jiang Liu
Date: Wed Nov 05 2014 - 04:25:04 EST



Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>
---
arch/x86/kernel/apic/msi.c | 1 +
drivers/ata/ahci.c | 2 ++
drivers/ata/libahci.c | 1 +
drivers/pci/msi.c | 7 ++++++-
4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index cc70fc659121..a2dffe3c30ce 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -110,6 +110,7 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
if (type == PCI_CAP_ID_MSI) {
info.type = X86_IRQ_ALLOC_TYPE_MSI;
info.flags |= X86_IRQ_ALLOC_CONTIGOUS_VECTORS;
+ dev_warn(&dev->dev, "irqdomain: try allocate %d MSI IRQs\n", nvec);
} else {
info.type = X86_IRQ_ALLOC_TYPE_MSIX;
}
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 5f039f191067..13985ba61b18 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1200,6 +1200,7 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
if (nvec < 0)
goto intx;

+ pr_warn("irqdomain: AHCI %d ports, %d MSI\n", n_ports, nvec);
/*
* If number of MSIs is less than number of ports then Sharing Last
* Message mode could be enforced. In this case assume that advantage
@@ -1214,6 +1215,7 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
else if (rc < 0)
goto intx;

+ pr_warn("irqdomain: AHCI allocated IRQ%d to IRQ%d\n", dev->irq, dev->irq + nvec - 1);
/* fallback to single MSI mode if the controller enforced MRSM mode */
if (readl(hpriv->mmio + HOST_CTL) & HOST_MRSM) {
pci_disable_msi(pdev);
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 5eb61c9e63da..d90b623eab35 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -2456,6 +2456,7 @@ static int ahci_host_activate_multi_irqs(struct ata_host *host, int irq,
continue;
}

+ pr_warn("irqdomain: request IRQ%d\n", irq + i);
rc = devm_request_threaded_irq(host->dev, irq + i,
ahci_multi_irqs_intr,
ahci_port_thread_fn, IRQF_SHARED,
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 7423ee16972f..4d8fef065e2c 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -216,6 +216,8 @@ static void msi_set_mask_bit(struct irq_data *data, u32 flag)
{
struct msi_desc *desc = irq_data_get_msi(data);

+ if (desc == NULL)
+ pr_warn("no msi_desc for IRQ%d\n", data->irq);
if (desc->msi_attrib.is_msix) {
msix_mask_irq(desc, flag);
readl(desc->mask_base); /* Flush write to device */
@@ -1202,6 +1204,8 @@ int msi_irq_domain_alloc_irqs(struct irq_domain *domain, int type,
int node = dev_to_node(&dev->dev);

list_for_each_entry(msidesc, &dev->msi_list, list) {
+ if (type == PCI_CAP_ID_MSI && msidesc->nvec_used > 1)
+ dev_warn(&dev->dev, "try to alloc nvec %d\n", msidesc->nvec_used);
arch_msi_irq_domain_set_hwirq(arg, msi_get_hwirq(dev, msidesc));
virq = irq_domain_alloc_irqs(domain, msidesc->nvec_used,
node, arg);
@@ -1210,8 +1214,9 @@ int msi_irq_domain_alloc_irqs(struct irq_domain *domain, int type,
return (type == PCI_CAP_ID_MSI &&
msidesc->nvec_used > 1) ? 1 : -ENOSPC;
}
+ dev_warn(&dev->dev, "allocated IRQ%d for MSI\n", virq);
for (i = 0; i < msidesc->nvec_used; i++)
- irq_set_msi_desc_off(virq + i, i, msidesc);
+ BUG_ON(irq_set_msi_desc_off(virq + i, i, msidesc));
}

list_for_each_entry(msidesc, &dev->msi_list, list)
--
1.7.10.4


--------------060906020808040102030602--
--
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/