Skip to contentSkip to conversation

PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()

PATCH Applied Inochi Amaoto 7 participants 9 messages Aug 27, 2025 – Sep 2, 2025 PCI

lore
Share & tools
lore
#0 lore raw

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
index e0a800f918e8..b11b7f63f0d6 100644
@@ -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

Tested-by on v2 1/1
#1 lore raw
Quoted 6 lines

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.

Quoted 6 lines

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.

Fixes 54f45a30c0d0 ("PCI/MSI: Add startup/shutdown for per device

domains")

Thanks for fixing this issue.

Tested-by on v2 1/1
#2 lore raw
In reply to Inochi Amaoto
Quoted 10 lines · Inochi Amaoto

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.

Quoted 12 lines

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
index e0a800f918e8..b11b7f63f0d6 100644
@@ -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

#3 lore raw
In reply to Inochi Amaoto
Quoted 11 lines · Inochi Amaoto

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.

Quoted 12 lines

Any updates on this? It pretty much breaks testing on linux-next for ARM.

Cheers,
Anders

#4 lore raw
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 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.

Quoted 12 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.

Jon

Signature · 1 line
nvpublic
#5 lore raw
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 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.

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

#6 lore raw
In reply to Inochi Amaoto
Quoted 57 lines · Inochi Amaoto

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 -1
index e0a800f918e8..b11b7f63f0d6 100644
@@ -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

#7 lore raw
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.

merge bot Applied
#8 lore raw
In reply to Inochi Amaoto
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
index e0a800f..b11b7f6 100644
@@ -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;
 }