aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 202b7507a357..48723d6fa60f 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -137,6 +137,8 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask)
137 break; 137 break;
138 } 138 }
139} 139}
140#else
141#define set_msi_affinity NULL
140#endif /* CONFIG_SMP */ 142#endif /* CONFIG_SMP */
141 143
142static void mask_MSI_irq(unsigned int vector) 144static void mask_MSI_irq(unsigned int vector)
@@ -214,7 +216,7 @@ static struct hw_interrupt_type msix_irq_type = {
214 .disable = mask_MSI_irq, 216 .disable = mask_MSI_irq,
215 .ack = mask_MSI_irq, 217 .ack = mask_MSI_irq,
216 .end = end_msi_irq_w_maskbit, 218 .end = end_msi_irq_w_maskbit,
217 .set_affinity = set_msi_irq_affinity 219 .set_affinity = set_msi_affinity
218}; 220};
219 221
220/* 222/*
@@ -230,7 +232,7 @@ static struct hw_interrupt_type msi_irq_w_maskbit_type = {
230 .disable = mask_MSI_irq, 232 .disable = mask_MSI_irq,
231 .ack = mask_MSI_irq, 233 .ack = mask_MSI_irq,
232 .end = end_msi_irq_w_maskbit, 234 .end = end_msi_irq_w_maskbit,
233 .set_affinity = set_msi_irq_affinity 235 .set_affinity = set_msi_affinity
234}; 236};
235 237
236/* 238/*
@@ -246,7 +248,7 @@ static struct hw_interrupt_type msi_irq_wo_maskbit_type = {
246 .disable = do_nothing, 248 .disable = do_nothing,
247 .ack = do_nothing, 249 .ack = do_nothing,
248 .end = end_msi_irq_wo_maskbit, 250 .end = end_msi_irq_wo_maskbit,
249 .set_affinity = set_msi_irq_affinity 251 .set_affinity = set_msi_affinity
250}; 252};
251 253
252static void msi_data_init(struct msg_data *msi_data, 254static void msi_data_init(struct msg_data *msi_data,
@@ -416,7 +418,9 @@ static void attach_msi_entry(struct msi_desc *entry, int vector)
416 418
417static void irq_handler_init(int cap_id, int pos, int mask) 419static void irq_handler_init(int cap_id, int pos, int mask)
418{ 420{
419 spin_lock(&irq_desc[pos].lock); 421 unsigned long flags;
422
423 spin_lock_irqsave(&irq_desc[pos].lock, flags);
420 if (cap_id == PCI_CAP_ID_MSIX) 424 if (cap_id == PCI_CAP_ID_MSIX)
421 irq_desc[pos].handler = &msix_irq_type; 425 irq_desc[pos].handler = &msix_irq_type;
422 else { 426 else {
@@ -425,7 +429,7 @@ static void irq_handler_init(int cap_id, int pos, int mask)
425 else 429 else
426 irq_desc[pos].handler = &msi_irq_w_maskbit_type; 430 irq_desc[pos].handler = &msi_irq_w_maskbit_type;
427 } 431 }
428 spin_unlock(&irq_desc[pos].lock); 432 spin_unlock_irqrestore(&irq_desc[pos].lock, flags);
429} 433}
430 434
431static void enable_msi_mode(struct pci_dev *dev, int pos, int type) 435static void enable_msi_mode(struct pci_dev *dev, int pos, int type)