Patchwork [1/3] PCI: Refactor restore_msi_irqs - code movement

login
register
mail settings
Submitter Zhenzhong Duan
Date Oct. 16, 2013, 6:32 a.m.
Message ID <525E32FC.3010604@oracle.com>
Download mbox | patch
Permalink /patch/283850/
State Not Applicable
Headers show

Comments

Zhenzhong Duan - Oct. 16, 2013, 6:32 a.m.
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@qlogic.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/pci/msi.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)
Jingoo Han - Oct. 18, 2013, 5:31 a.m.
On Wednesday, October 16, 2013 3:32 PM, Zhenzhong Duan wrote:
> 
> 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@qlogic.com>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

It looks good. Also, I tested this patch on Exynos5440.

Best regards,
Jingoo Han

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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);