aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/sysdev/mpic_u3msi.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 255b2f53beda..1d5a40899b74 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -108,26 +108,17 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
108 return; 108 return;
109} 109}
110 110
111static void u3msi_compose_msi_msg(struct pci_dev *pdev, int virq,
112 struct msi_msg *msg)
113{
114 u64 addr;
115
116 addr = find_ht_magic_addr(pdev);
117 msg->address_lo = addr & 0xFFFFFFFF;
118 msg->address_hi = addr >> 32;
119 msg->data = virq_to_hw(virq);
120
121 pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) at address 0x%lx\n",
122 virq, virq_to_hw(virq), addr);
123}
124
125static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) 111static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
126{ 112{
127 irq_hw_number_t hwirq; 113 irq_hw_number_t hwirq;
128 unsigned int virq; 114 unsigned int virq;
129 struct msi_desc *entry; 115 struct msi_desc *entry;
130 struct msi_msg msg; 116 struct msi_msg msg;
117 u64 addr;
118
119 addr = find_ht_magic_addr(pdev);
120 msg.address_lo = addr & 0xFFFFFFFF;
121 msg.address_hi = addr >> 32;
131 122
132 list_for_each_entry(entry, &pdev->msi_list, list) { 123 list_for_each_entry(entry, &pdev->msi_list, list) {
133 hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1); 124 hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
@@ -147,7 +138,10 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
147 set_irq_chip(virq, &mpic_u3msi_chip); 138 set_irq_chip(virq, &mpic_u3msi_chip);
148 set_irq_type(virq, IRQ_TYPE_EDGE_RISING); 139 set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
149 140
150 u3msi_compose_msi_msg(pdev, virq, &msg); 141 pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) addr 0x%lx\n",
142 virq, hwirq, addr);
143
144 msg.data = hwirq;
151 write_msi_msg(virq, &msg); 145 write_msi_msg(virq, &msg);
152 146
153 hwirq++; 147 hwirq++;