aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-pciback
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-02-17 11:18:00 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-07-19 20:58:34 -0400
commitc288b67b9b4d65790e1a1a1fd982330730b68f46 (patch)
tree7ccfbb3337d45fbe48bb74174eec3a8fc12a5482 /drivers/xen/xen-pciback
parente17ab35f05cb8b3d19c70454a41ea67207caf484 (diff)
xen/pciback: Print out the MSI/MSI-X (PIRQ) values
If the verbose_request is set (and loglevel high enough), print out the MSI/MSI-X values that are sent to the guest. This should aid in debugging issues. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/xen-pciback')
-rw-r--r--drivers/xen/xen-pciback/conf_space_capability_msi.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/xen/xen-pciback/conf_space_capability_msi.c b/drivers/xen/xen-pciback/conf_space_capability_msi.c
index d0d2255b5da9..6e876b600e66 100644
--- a/drivers/xen/xen-pciback/conf_space_capability_msi.c
+++ b/drivers/xen/xen-pciback/conf_space_capability_msi.c
@@ -16,6 +16,9 @@ int pciback_enable_msi(struct pciback_device *pdev,
16 int otherend = pdev->xdev->otherend_id; 16 int otherend = pdev->xdev->otherend_id;
17 int status; 17 int status;
18 18
19 if (unlikely(verbose_request))
20 printk(KERN_DEBUG "pciback: %s: enable MSI\n", pci_name(dev));
21
19 status = pci_enable_msi(dev); 22 status = pci_enable_msi(dev);
20 23
21 if (status) { 24 if (status) {
@@ -29,9 +32,14 @@ int pciback_enable_msi(struct pciback_device *pdev,
29 * the local domain's IRQ number. */ 32 * the local domain's IRQ number. */
30 33
31 op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; 34 op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
35 if (unlikely(verbose_request))
36 printk(KERN_DEBUG "pciback: %s: MSI: %d\n", pci_name(dev),
37 op->value);
38
32 dev_data = pci_get_drvdata(dev); 39 dev_data = pci_get_drvdata(dev);
33 if (dev_data) 40 if (dev_data)
34 dev_data->ack_intr = 0; 41 dev_data->ack_intr = 0;
42
35 return 0; 43 return 0;
36} 44}
37 45
@@ -39,9 +47,16 @@ int pciback_disable_msi(struct pciback_device *pdev,
39 struct pci_dev *dev, struct xen_pci_op *op) 47 struct pci_dev *dev, struct xen_pci_op *op)
40{ 48{
41 struct pciback_dev_data *dev_data; 49 struct pciback_dev_data *dev_data;
50
51 if (unlikely(verbose_request))
52 printk(KERN_DEBUG "pciback: %s: disable MSI\n", pci_name(dev));
53
42 pci_disable_msi(dev); 54 pci_disable_msi(dev);
43 55
44 op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; 56 op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
57 if (unlikely(verbose_request))
58 printk(KERN_DEBUG "pciback: %s: MSI: %d\n", pci_name(dev),
59 op->value);
45 dev_data = pci_get_drvdata(dev); 60 dev_data = pci_get_drvdata(dev);
46 if (dev_data) 61 if (dev_data)
47 dev_data->ack_intr = 1; 62 dev_data->ack_intr = 1;
@@ -55,6 +70,10 @@ int pciback_enable_msix(struct pciback_device *pdev,
55 int i, result; 70 int i, result;
56 struct msix_entry *entries; 71 struct msix_entry *entries;
57 72
73 if (unlikely(verbose_request))
74 printk(KERN_DEBUG "pciback: %s: enable MSI-X\n",
75 pci_name(dev));
76
58 if (op->value > SH_INFO_MAX_VEC) 77 if (op->value > SH_INFO_MAX_VEC)
59 return -EINVAL; 78 return -EINVAL;
60 79
@@ -75,6 +94,11 @@ int pciback_enable_msix(struct pciback_device *pdev,
75 if (entries[i].vector) 94 if (entries[i].vector)
76 op->msix_entries[i].vector = 95 op->msix_entries[i].vector =
77 xen_pirq_from_irq(entries[i].vector); 96 xen_pirq_from_irq(entries[i].vector);
97 if (unlikely(verbose_request))
98 printk(KERN_DEBUG "pciback: %s: " \
99 "MSI-X[%d]: %d\n",
100 pci_name(dev), i,
101 op->msix_entries[i].vector);
78 } 102 }
79 } else { 103 } else {
80 printk(KERN_WARNING "pciback: %s: failed to enable MSI-X: err %d!\n", 104 printk(KERN_WARNING "pciback: %s: failed to enable MSI-X: err %d!\n",
@@ -95,6 +119,10 @@ int pciback_disable_msix(struct pciback_device *pdev,
95{ 119{
96 struct pciback_dev_data *dev_data; 120 struct pciback_dev_data *dev_data;
97 121
122 if (unlikely(verbose_request))
123 printk(KERN_DEBUG "pciback: %s: disable MSI-X\n",
124 pci_name(dev));
125
98 pci_disable_msix(dev); 126 pci_disable_msix(dev);
99 127
100 /* 128 /*
@@ -102,6 +130,9 @@ int pciback_disable_msix(struct pciback_device *pdev,
102 * an undefined IRQ value of zero. 130 * an undefined IRQ value of zero.
103 */ 131 */
104 op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0; 132 op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
133 if (unlikely(verbose_request))
134 printk(KERN_DEBUG "pciback: %s: MSI-X: %d\n", pci_name(dev),
135 op->value);
105 dev_data = pci_get_drvdata(dev); 136 dev_data = pci_get_drvdata(dev);
106 if (dev_data) 137 if (dev_data)
107 dev_data->ack_intr = 1; 138 dev_data->ack_intr = 1;