Skip to contentSkip to conversation

PCIe msi bitmap issue by split nr_irqs for 1 by 1

DISCUSSION Michael Wu 2 participants 2 messages Nov 6, 2025 1 message not in the archive PCI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Michael Wu

author
#1 lore raw

Hi Dear linux-pci team,

I got some msi-irq bitmap issue when using PCIe NVMe SSD during resume/suspend.

First, we know now all the controller driver using "order_base_2()" to find the bitmap in alloc/free.

Then in my case, SSD request for 9 msi-irqs, and 16 bits is occupy in bitmap[31:16]. Eg. msi_bitmap from 00000001 to ffff0001.

When in suspend, msi-irqs will be free one by one, but not 9 in one time. This will cause bitmap cannot fully clear which was requested, bit[24:16] will be free, but bit[31:25] was residue. Eg. msi_bitmap from ffff0001 to fffe0001(1st) to fffc0001(2nd) to ... to fe000001(9th)

And I found that this "split" operation was push in below commit:
4615fbc3788d ("genirq/irqdomain: Don't try to free an interrupt that has no mapping")

After i revert it, everything goes normal.

So at last, is there any solution to fix it?

Signature · 2 lines
Regards,
Michael Wu
#2 lore raw

[+to Marc, author of 4615fbc3788d ("genirq/irqdomain: Don't try to free an interrupt that has no mapping");
+cc Thomas]

Quoted 18 lines · Michael Wu

Hi Dear linux-pci team,

I got some msi-irq bitmap issue when using PCIe NVMe SSD during resume/suspend.

First, we know now all the controller driver using "order_base_2()" to find the bitmap in alloc/free.

Then in my case, SSD request for 9 msi-irqs, and 16 bits is occupy in bitmap[31:16].
Eg. msi_bitmap from 00000001 to ffff0001.

When in suspend, msi-irqs will be free one by one, but not 9 in one time. This will cause bitmap cannot fully clear which was requested, bit[24:16] will be free, but bit[31:25] was residue.
Eg. msi_bitmap from ffff0001 to fffe0001(1st) to fffc0001(2nd) to ... to fe000001(9th)

Quoted 5 lines

And I found that this "split" operation was push in below commit:
4615fbc3788d ("genirq/irqdomain: Don't try to free an interrupt that has no mapping")

After i revert it, everything goes normal.

Thanks for the report, Michael. Looks like the same issue reported here:

https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

I see a workaround there, but it doesn't look like anything ever made it upstream.