PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()
Subsystems (2)
PATCH 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]_templete 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.
--- 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 33 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]_templete 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")Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>--- drivers/pci/msi/irqdomain.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/pci/msi/irqdomain.c +2
-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)
drivers/pci/msi/irqdomain.c static unsigned int cond_startup_parent(struct irq_data *data) · line 171
Quoted 8 lines
drivers/pci/msi/irqdomain.c +3
-0@@ -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 ; }
FWIW, this also fixes a boot regression for Tegra124 Jetson TK1.
Thanks!
Jon
Signature · 1 line
nvpublic
Quoted 5 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]_templete will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.
s/templete/template/
AFAICS cond_startup_parent() is used by pci_irq_startup_msi() and pci_irq_startup_msix() in pci_msi_template; cond_shutdown_parent() is used by pci_irq_shutdown_msi() and pci_irq_shutdown_msix() in pci_msix_template.
Quoted 7 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 device domains")
I guess there are several other reporters and reports that could be added here. Up to you whether to add them.
Quoted 2 lines
Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>
Quoted 30 lines
--- 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 7 lines · Bjorn Helgaas
Quoted 5 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]_templete will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.
Quoted 8 lines
s/templete/template/
AFAICS
cond_startup_parent()is used bypci_irq_startup_msi()andpci_irq_startup_msix()inpci_msi_template;cond_shutdown_parent()is used bypci_irq_shutdown_msi()andpci_irq_shutdown_msix()inpci_msix_template.
cond_startup_parent() is used by pci_irq_startup_msi() in pci_msi_template and pci_irq_startup_msix() in pci_msix_template; cond_shutdown_parent() is used by pci_irq_shutdown_msi() in pci_msi_template and pci_irq_shutdown_msix() in pci_msix_template.
Quoted 11 lines
Quoted 7 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 device domains")I guess there are several other reporters and reports that could be added here. Up to you whether to add them.
Yeah, there are some missing tag from the original post, as this patch is already submitted. I will add it in v2.
Quoted 35 lines
Quoted 2 lines
Signed-off-by Inochi Amaoto <[email protected]>Tested-by Nathan Chancellor <[email protected]>Acked-by Bjorn Helgaas <[email protected]>Quoted 30 lines
--- 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 15 lines · Inochi Amaoto
Quoted 7 lines · Bjorn Helgaas
Quoted 5 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]_templete will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.Quoted 6 lines
s/templete/template/
AFAICS
cond_startup_parent()is used bypci_irq_startup_msi()andpci_irq_startup_msix()inpci_msi_template;cond_shutdown_parent()is used bypci_irq_shutdown_msi()andpci_irq_shutdown_msix()inpci_msix_template.
Quoted 4 lines
cond_startup_parent()is used bypci_irq_startup_msi()inpci_msi_templateandpci_irq_startup_msix()inpci_msix_template;cond_shutdown_parent()is used bypci_irq_shutdown_msi()inpci_msi_templateandpci_irq_shutdown_msix()inpci_msix_template.
Right, I really screwed that up when I noticed the "*_template" structure names and added them to my description.
PATCH 1/1 PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()
In reply to Inochi AmaotoQuoted 9 lines · Nathan Chancellor
Quoted 4 lines · Inochi Amaoto
OK, I guess I know why: I have missed one condition for startup.
Could you test the following patch? If worked, I will send it as a fix.
Yes, that appears to resolve the issue on one system. I cannot test the other at the moment since it is under load.
I have built on top of Linux next-20250826 tag and the qemu-arm64 boot test pass and LTP smoke test also pass.
Quoted 2 lines
Tested-by Nathan Chancellor <[email protected]>
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 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]_templete 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.
This is causing multiple platforms to fail to boot in -next, it'd be great if we could get it merged to fix them.
[cc->to: Thomas]
Quoted 7 lines · Mark Brown
Quoted 6 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]_templete will not unmask/mask the interrupt when startup/ shutdown the interrupt. This will prevent the interrupt from being enabled/disabled normally.
Quoted 8 lines
Quoted 3 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.Tested-by Mark Brown <[email protected]>This is causing multiple platforms to fail to boot in -next, it'd be great if we could get it merged to fix them.
It looks like you merged 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device domains"), Thomas. I assume you'll merge this fix too?
Let me know if you'd prefer that I take it. Looks like a candidate for v6.17.
Bjorn
Quoted 16 lines · Bjorn Helgaas
[
cc->to: Thomas]Quoted 13 lines · Mark Brown
Quoted 9 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]_templete 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.Tested-by Mark Brown <[email protected]>
Quoted 8 lines
Quoted 2 lines
This is causing multiple platforms to fail to boot in -next, it'd be great if we could get it merged to fix them.
It looks like you merged
54f45a30c0d0("PCI/MSI: Add startup/shutdown for per device domains"), Thomas. I assume you'll merge this fix too?Let me know if you'd prefer that I take it. Looks like a candidate for v6.17.
Oops, looks like there's a v2: