PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()
PATCH v2 1/1 PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()
For msi controller that only supports MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callback irq_startup() and irq_shutdown() for pci_msi[x]_template will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.
Add the missing check for MSI_FLAG_PCI_MSI_MASK_PARENT in the cond_[startup|shutdown]_parent(). So the interrupt can be normally unmasked/masked if it does not support MSI_FLAG_PCI_MSI_MASK_PARENT.
---
Change from v1:
- https://lore.kernel.org/all/[email protected]/
1. Apply Tested-by, Reported-by and Tested-by from original post [1].
2. update mistake in the comments.
[1] https://lore.kernel.org/regressions/aK4O7Hl8NCVEMznB@monster/
--- drivers/pci/msi/irqdomain.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/pci/msi/irqdomain.c +5 -0
@@ -154,6 +154,8 @@ static void cond_shutdown_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))irq_chip_shutdown_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_mask_parent (data); }static unsigned int cond_startup_parent (struct irq_data *data)
@@ -162,6 +164,9 @@ static unsigned int cond_startup_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))return irq_chip_startup_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_unmask_parent (data); +return 0 ; }
--
2.51.0
Quoted 6 lines
For msi controller that only supports
MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callbackirq_startup()andirq_shutdown()for pci_msi[x]_template will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.
Quoted 6 lines
Add the missing check for
MSI_FLAG_PCI_MSI_MASK_PARENTin the cond_[startup|shutdown]_parent(). So the interrupt can be normally unmasked/masked if it does not supportMSI_FLAG_PCI_MSI_MASK_PARENT.Fixes 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per devicedomains")
Thanks for fixing this issue.
Quoted 10 lines · Inochi Amaoto
For msi controller that only supports
MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callbackirq_startup()andirq_shutdown()for pci_msi[x]_template will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.Add the missing check for
MSI_FLAG_PCI_MSI_MASK_PARENTin the cond_[startup|shutdown]_parent(). So the interrupt can be normally unmasked/masked if it does not supportMSI_FLAG_PCI_MSI_MASK_PARENT.
Quoted 12 lines
Fixes 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device domains")Reported-by Nathan Chancellor <[email protected]>Reported-by Wei Fang <[email protected]>Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>Tested-by Jon Hunter <[email protected]>Acked-by Bjorn Helgaas <[email protected]>
Thanks,
Chen
Quoted 37 lines
---
Change from v1:
- https://lore.kernel.org/all/[email protected]/
1. Apply Tested-by, Reported-by and Tested-by from original post [1].
2. update mistake in the comments.[1] https://lore.kernel.org/regressions/aK4O7Hl8NCVEMznB@monster/
--- drivers/pci/msi/irqdomain.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/pci/msi/irqdomain.c +5
-1@@ -154,6 +154,8 @@ static void cond_shutdown_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))irq_chip_shutdown_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_mask_parent (data); }static unsigned int cond_startup_parent (struct irq_data *data)@@ -162,6 +164,9 @@ static unsigned int cond_startup_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))return irq_chip_startup_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_unmask_parent (data); +return 0 ; } --2.51.0
Quoted 11 lines · Inochi Amaoto
For msi controller that only supports
MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callbackirq_startup()andirq_shutdown()for pci_msi[x]_template will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.Add the missing check for
MSI_FLAG_PCI_MSI_MASK_PARENTin the cond_[startup|shutdown]_parent(). So the interrupt can be normally unmasked/masked if it does not supportMSI_FLAG_PCI_MSI_MASK_PARENT.
Quoted 12 lines
Fixes 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device domains")Reported-by Nathan Chancellor <[email protected]>Reported-by Wei Fang <[email protected]>Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>Tested-by Jon Hunter <[email protected]>Acked-by Bjorn Helgaas <[email protected]>
Any updates on this? It pretty much breaks testing on linux-next for ARM.
Cheers,
Anders
Quoted 25 lines · Anders Roxell
Quoted 11 lines · Inochi Amaoto
For msi controller that only supports
MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callbackirq_startup()andirq_shutdown()for pci_msi[x]_template will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.Add the missing check for
MSI_FLAG_PCI_MSI_MASK_PARENTin the cond_[startup|shutdown]_parent(). So the interrupt can be normally unmasked/masked if it does not supportMSI_FLAG_PCI_MSI_MASK_PARENT.Quoted 12 lines
Fixes 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device domains")Reported-by Nathan Chancellor <[email protected]>Reported-by Wei Fang <[email protected]>Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>Tested-by Jon Hunter <[email protected]>Acked-by Bjorn Helgaas <[email protected]>
Quoted 1 line
Any updates on this? It pretty much breaks testing on linux-next for ARM.
Also does it make sense to squash this fix with the original patch? It caused boot failures on at least 3 of our boards and so could impact the ability to bisect other issues.
Jon
Signature · 1 line
nvpublic
Quoted 27 lines · Jon Hunter
Quoted 25 lines · Anders Roxell
Quoted 23 lines · Inochi Amaoto
For msi controller that only supports
MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callbackirq_startup()andirq_shutdown()for pci_msi[x]_template will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.Add the missing check for
MSI_FLAG_PCI_MSI_MASK_PARENTin the cond_[startup|shutdown]_parent(). So the interrupt can be normally unmasked/masked if it does not supportMSI_FLAG_PCI_MSI_MASK_PARENT.Fixes 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device domains")Reported-by Nathan Chancellor <[email protected]>Reported-by Wei Fang <[email protected]>Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>Tested-by Jon Hunter <[email protected]>Acked-by Bjorn Helgaas <[email protected]>
Quoted 6 lines
Quoted 1 line
Any updates on this? It pretty much breaks testing on linux-next for ARM.
Also does it make sense to squash this fix with the original patch? It caused boot failures on at least 3 of our boards and so could impact the ability to bisect other issues.
As Thomas has taken the original series, I think it is hard to do a squash. I will ping Thomas to see if he can take it.
Regards,
Inochi
Quoted 57 lines · Inochi Amaoto
For msi controller that only supports
MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callbackirq_startup()andirq_shutdown()for pci_msi[x]_template will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.Add the missing check for
MSI_FLAG_PCI_MSI_MASK_PARENTin the cond_[startup|shutdown]_parent(). So the interrupt can be normally unmasked/masked if it does not supportMSI_FLAG_PCI_MSI_MASK_PARENT.Fixes 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device domains")Reported-by Nathan Chancellor <[email protected]>Reported-by Wei Fang <[email protected]>Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>Tested-by Jon Hunter <[email protected]>Acked-by Bjorn Helgaas <[email protected]>---
Change from v1:
- https://lore.kernel.org/all/[email protected]/
1. Apply Tested-by, Reported-by and Tested-by from original post [1].
2. update mistake in the comments.[1] https://lore.kernel.org/regressions/aK4O7Hl8NCVEMznB@monster/
--- drivers/pci/msi/irqdomain.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/pci/msi/irqdomain.c +5
-1@@ -154,6 +154,8 @@ static void cond_shutdown_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))irq_chip_shutdown_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_mask_parent (data); }static unsigned int cond_startup_parent (struct irq_data *data)@@ -162,6 +164,9 @@ static unsigned int cond_startup_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))return irq_chip_startup_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_unmask_parent (data); +return 0 ; } --
Quoted 2 lines
2.51.0
Hi Thomas,
Could you take this patch? I think this fix is good to go now.
Regards,
Inochi
Quoted 1 line · Inochi Amaoto
Could you take this patch? I think this fix is good to go now.
I was AFK last week. Looking at it now.
The following commit has been merged into the irq/drivers branch of tip:
The following commit has been merged into the irq/drivers branch of tip:
Commit-ID: 727e914bbfbbda9e6efa5cb1abe4e96a949d576f Gitweb: https://git.kernel.org/tip/727e914bbfbbda9e6efa5cb1abe4e96a949d576f Author: Inochi Amaoto <[email protected]> AuthorDate: Thu, 28 Aug 2025 07:09:42 +08:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 02 Sep 2025 14:42:09 +02:00
PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()
For MSI controllers which only support MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callback irq_startup() and irq_shutdown() for pci_msi[x]_template will not unmask or mask the interrupt when startup() resp. shutdown() is invoked. This prevents the interrupt from being enabled resp. disabled.
Invoke irq_[un]mask_parent() in cond_[startup|shutdown]_parent(), when the interrupt has the MSI_FLAG_PCI_MSI_MASK_PARENT flag set.
--- drivers/pci/msi/irqdomain.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/pci/msi/irqdomain.c +5 -0
@@ -154,6 +154,8 @@ static void cond_shutdown_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))irq_chip_shutdown_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_mask_parent (data); }static unsigned int cond_startup_parent (struct irq_data *data)
@@ -162,6 +164,9 @@ static unsigned int cond_startup_parent(struct irq_data *data)if (unlikely (info->flags &MSI_FLAG_PCI_MSI_STARTUP_PARENT ))return irq_chip_startup_parent (data); +else if (unlikely (info->flags &MSI_FLAG_PCI_MSI_MASK_PARENT )) +irq_chip_unmask_parent (data); +return 0 ; }