Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255279
b: refs/heads/master
c: c288b67
h: refs/heads/master
i:
  255277: bf0bb6f
  255275: b7c2e56
  255271: 01bbbc0
  255263: 2f28d8e
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed Jul 20, 2011
1 parent 5fbf9be commit 45f8dcb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e17ab35f05cb8b3d19c70454a41ea67207caf484
refs/heads/master: c288b67b9b4d65790e1a1a1fd982330730b68f46
31 changes: 31 additions & 0 deletions trunk/drivers/xen/xen-pciback/conf_space_capability_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ int pciback_enable_msi(struct pciback_device *pdev,
int otherend = pdev->xdev->otherend_id;
int status;

if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: enable MSI\n", pci_name(dev));

status = pci_enable_msi(dev);

if (status) {
Expand All @@ -29,19 +32,31 @@ int pciback_enable_msi(struct pciback_device *pdev,
* the local domain's IRQ number. */

op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: MSI: %d\n", pci_name(dev),
op->value);

dev_data = pci_get_drvdata(dev);
if (dev_data)
dev_data->ack_intr = 0;

return 0;
}

int pciback_disable_msi(struct pciback_device *pdev,
struct pci_dev *dev, struct xen_pci_op *op)
{
struct pciback_dev_data *dev_data;

if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: disable MSI\n", pci_name(dev));

pci_disable_msi(dev);

op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: MSI: %d\n", pci_name(dev),
op->value);
dev_data = pci_get_drvdata(dev);
if (dev_data)
dev_data->ack_intr = 1;
Expand All @@ -55,6 +70,10 @@ int pciback_enable_msix(struct pciback_device *pdev,
int i, result;
struct msix_entry *entries;

if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: enable MSI-X\n",
pci_name(dev));

if (op->value > SH_INFO_MAX_VEC)
return -EINVAL;

Expand All @@ -75,6 +94,11 @@ int pciback_enable_msix(struct pciback_device *pdev,
if (entries[i].vector)
op->msix_entries[i].vector =
xen_pirq_from_irq(entries[i].vector);
if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: " \
"MSI-X[%d]: %d\n",
pci_name(dev), i,
op->msix_entries[i].vector);
}
} else {
printk(KERN_WARNING "pciback: %s: failed to enable MSI-X: err %d!\n",
Expand All @@ -95,13 +119,20 @@ int pciback_disable_msix(struct pciback_device *pdev,
{
struct pciback_dev_data *dev_data;

if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: disable MSI-X\n",
pci_name(dev));

pci_disable_msix(dev);

/*
* SR-IOV devices (which don't have any legacy IRQ) have
* an undefined IRQ value of zero.
*/
op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
if (unlikely(verbose_request))
printk(KERN_DEBUG "pciback: %s: MSI-X: %d\n", pci_name(dev),
op->value);
dev_data = pci_get_drvdata(dev);
if (dev_data)
dev_data->ack_intr = 1;
Expand Down

0 comments on commit 45f8dcb

Please sign in to comment.