[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/3] PCI: Refactor restore_msi_irqs - code movement



Move default_restore_msi_irqs down to reference msi_mask_irq and msix_mask_irq.

This patch lays the groundwork for patch titled:
'PCI: Refactor MSI/MSIX mask restore code to fix interrupt lost issue'

Tested-by: Sucheta Chakraborty <sucheta.chakraborty@xxxxxxxxxx>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxxx>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/pci/msi.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d5f90d6..ecd4cdf 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -116,24 +116,6 @@ void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
        return default_teardown_msi_irqs(dev);
 }
 
-void default_restore_msi_irqs(struct pci_dev *dev, int irq)
-{
-       struct msi_desc *entry;
-
-       entry = NULL;
-       if (dev->msix_enabled) {
-               list_for_each_entry(entry, &dev->msi_list, list) {
-                       if (irq == entry->irq)
-                               break;
-               }
-       } else if (dev->msi_enabled)  {
-               entry = irq_get_msi_desc(irq);
-       }
-
-       if (entry)
-               write_msi_msg(irq, &entry->msg);
-}
-
 void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq)
 {
        return default_restore_msi_irqs(dev, irq);
@@ -252,6 +234,24 @@ void unmask_msi_irq(struct irq_data *data)
        msi_set_mask_bit(data, 0);
 }
 
+void default_restore_msi_irqs(struct pci_dev *dev, int irq)
+{
+       struct msi_desc *entry;
+
+       entry = NULL;
+       if (dev->msix_enabled) {
+               list_for_each_entry(entry, &dev->msi_list, list) {
+                       if (irq == entry->irq)
+                               break;
+               }
+       } else if (dev->msi_enabled)  {
+               entry = irq_get_msi_desc(irq);
+       }
+
+       if (entry)
+               write_msi_msg(irq, &entry->msg);
+}
+
 void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
        BUG_ON(entry->dev->current_state != PCI_D0);
-- 
1.7.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.