Re: [PATCH 2/2] PCI/MSI: Update MSI-X irq domain hwsize
From: Thomas Gleixner
Date: Wed Mar 25 2026 - 03:45:37 EST
On Wed, Mar 25 2026 at 09:34, Guixin Liu wrote:
> 在 2026/3/24 21:59, Thomas Gleixner 写道:
>> On Tue, Mar 24 2026 at 09:47, Guixin Liu wrote:
>>> After the upper-layer driver removes the device and before the next
>>> probe, events such as firmware updates may increase the number of
>>> interrupts supported by the device. However, the irq_domain still
>>> retains the old hwsize, which causes subsequent interrupt allocation
>>> failures. Update hwsize during MSI-X device domain setup to fix this
>>> issue.
>> When a device is removed then the corresponding struct device is torn
>> down, which implies that the device domain is freed as well. So how can
>> this end up with the old state on the next probe?
>
> Hi, My description was a bit ambiguous. The msi_device_data_release()
> path to remove the irq_domain is only triggered when the device is
> removed at the PCI layer. If only the upper-layer driver unbinds,
> this path will not be reached.
What's an upper-layer driver? Please be precise.
I assume you are talking about the device driver itself. Right, the
unbind of the driver won't remove the domain. But there is no real good
reason for keeping it around at that point.
So the straight forward solution is to free the MSI domain when the
driver shuts down and tears the MSI interrupts down.
Thanks,
tglx