Skip to content

Commit 03d84bd

Browse files
committed
Merge tag 'msi-fixes-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms
Pull MSI fixes from Marc Zyngier: "Thomas tasked me with sending out a few urgent fixes after the giant MSI rework that landed in 6.2, as both s390 and powerpc ended-up suffering from it (they do not use the full core code infrastructure, leading to these previously undetected issues): - Return MSI_XA_DOMAIN_SIZE as the maximum MSI index when the architecture does not make use of irq domains instead of returning 0, which is pretty limiting. - Check for the presence of an irq domain when validating the MSI iterator, as s390/powerpc won't have one. - Fix powerpc's MSI backends which fail to clear the descriptor's IRQ field on teardown, leading to a splat and leaked descriptors" * tag 'msi-fixes-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms: powerpc/msi: Fix deassociation of MSI descriptors genirq/msi: Return MSI_XA_DOMAIN_SIZE as the maximum MSI index when no domain is present genirq/msi: Check for the presence of an irq domain when validating msi_ctrl
2 parents f9ff564 + 4545c6a commit 03d84bd

File tree

6 files changed

+9
-3
lines changed

6 files changed

+9
-3
lines changed

arch/powerpc/platforms/4xx/hsta_msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev)
115115
msi_bitmap_free_hwirqs(&ppc4xx_hsta_msi.bmp, irq, 1);
116116
pr_debug("%s: Teardown IRQ %u (index %u)\n", __func__,
117117
entry->irq, irq);
118+
entry->irq = 0;
118119
}
119120
}
120121

arch/powerpc/platforms/cell/axon_msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ static void axon_msi_teardown_msi_irqs(struct pci_dev *dev)
289289
msi_for_each_desc(entry, &dev->dev, MSI_DESC_ASSOCIATED) {
290290
irq_set_msi_desc(entry->irq, NULL);
291291
irq_dispose_mapping(entry->irq);
292+
entry->irq = 0;
292293
}
293294
}
294295

arch/powerpc/platforms/pasemi/msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
6666
hwirq = virq_to_hw(entry->irq);
6767
irq_set_msi_desc(entry->irq, NULL);
6868
irq_dispose_mapping(entry->irq);
69+
entry->irq = 0;
6970
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, ALLOC_CHUNK);
7071
}
7172
}

arch/powerpc/sysdev/fsl_msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev)
132132
msi_data = irq_get_chip_data(entry->irq);
133133
irq_set_msi_desc(entry->irq, NULL);
134134
irq_dispose_mapping(entry->irq);
135+
entry->irq = 0;
135136
msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
136137
}
137138
}

arch/powerpc/sysdev/mpic_u3msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
108108
hwirq = virq_to_hw(entry->irq);
109109
irq_set_msi_desc(entry->irq, NULL);
110110
irq_dispose_mapping(entry->irq);
111+
entry->irq = 0;
111112
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1);
112113
}
113114
}

kernel/irq/msi.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ static bool msi_ctrl_valid(struct device *dev, struct msi_ctrl *ctrl)
165165
unsigned int hwsize;
166166

167167
if (WARN_ON_ONCE(ctrl->domid >= MSI_MAX_DEVICE_IRQDOMAINS ||
168-
!dev->msi.data->__domains[ctrl->domid].domain))
168+
(dev->msi.domain &&
169+
!dev->msi.data->__domains[ctrl->domid].domain)))
169170
return false;
170171

171172
hwsize = msi_domain_get_hwsize(dev, ctrl->domid);
@@ -609,8 +610,8 @@ static unsigned int msi_domain_get_hwsize(struct device *dev, unsigned int domid
609610
info = domain->host_data;
610611
return info->hwsize;
611612
}
612-
/* No domain, no size... */
613-
return 0;
613+
/* No domain, default to MSI_XA_DOMAIN_SIZE */
614+
return MSI_XA_DOMAIN_SIZE;
614615
}
615616

616617
static inline void irq_chip_write_msi_msg(struct irq_data *data,

0 commit comments

Comments
 (0)