irq: sg2042-msi: add missed chip flags
PATCH 1/1 irq: sg2042-msi: add missed chip flags
sg2042-msi driver used fallback set by msi_lib_init_dev_msi_info() As commit 1c000dcaad2b ("irqchip/irq-msi-lib: Optionally set default irq_eoi()/irq_ack()") changes the behavior of the default fallback, which break the driver and causes NULL pointer dereference.
Add necessary chip flags of msi_parent_ops in this driver to fix it.
--- drivers/irqchip/irq-sg2042-msi.c | 1 + 1 file changed, 1 insertion(+)
drivers/irqchip/irq-sg2042-msi.c +1 -0
@@ -151,6 +151,7 @@ static const struct irq_domain_ops sg2042_msi_middle_domain_ops = {static const struct msi_parent_ops sg2042_msi_parent_ops = { .required_flags =SG2042_MSI_FLAGS_REQUIRED , .supported_flags =SG2042_MSI_FLAGS_SUPPORTED , + .chip_flags =MSI_CHIP_FLAG_SET_ACK , .bus_select_mask =MATCH_PCI_MSI , .bus_select_token =DOMAIN_BUS_NEXUS , .prefix ="SG2042-" ,
Signature · 1 line
2.49.0
[tip: irq/urgent] irqchip/sg2042-msi: Add missing chip flags
The following commit has been merged into the irq/urgent branch of tip:
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: 305825d09b15586d2e4311e0c12f10f2a0c18ac5 Gitweb: https://git.kernel.org/tip/305825d09b15586d2e4311e0c12f10f2a0c18ac5 Author: Inochi Amaoto <[email protected]> AuthorDate: Sat, 05 Apr 2025 13:56:24 +08:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Mon, 07 Apr 2025 09:23:55 +02:00
irqchip/sg2042-msi: Add missing chip flags
The sg2042-msi driver uses the fallback callbacks set by msi_lib_init_dev_msi_info(). commit 1c000dcaad2b ("irqchip/irq-msi-lib:
Optionally set default irq_eoi()/irq_ack()") changed the behavior of the fallback mechanism by making it opt-in.
The sg2042-msi was not fixed up for this, which causes a NULL pointer dereference due to the missing irq_ack() callback.
Add the missing chip flag to msi_parent_ops.
--- drivers/irqchip/irq-sg2042-msi.c | 1 + 1 file changed, 1 insertion(+)
drivers/irqchip/irq-sg2042-msi.c +1 -0
@@ -151,6 +151,7 @@ static const struct irq_domain_ops sg2042_msi_middle_domain_ops = {static const struct msi_parent_ops sg2042_msi_parent_ops = { .required_flags =SG2042_MSI_FLAGS_REQUIRED , .supported_flags =SG2042_MSI_FLAGS_SUPPORTED , + .chip_flags =MSI_CHIP_FLAG_SET_ACK , .bus_select_mask =MATCH_PCI_MSI , .bus_select_token =DOMAIN_BUS_NEXUS , .prefix ="SG2042-" ,
Quoted 10 lines · Inochi Amaoto
sg2042-msi driver used fallback set by
msi_lib_init_dev_msi_info()As commit1c000dcaad2b("irqchip/irq-msi-lib: Optionally set default irq_eoi()/irq_ack()") changes the behavior of the default fallback, which break the driver and causes NULL pointer dereference.Add necessary chip flags of
msi_parent_opsin this driver to fix it.Fixes c66741549424 ("irqchip: Add the Sophgo SG2042 MSI interrupt controller")Signed-off-by Inochi Amaoto <[email protected]>
Thanks,
Chen
Quoted 16 lines
--- drivers/irqchip/irq-sg2042-msi.c | 1 + 1 file changed, 1 insertion(+)drivers/irqchip/irq-sg2042-msi.c +1
-0@@ -151,6 +151,7 @@ static const struct irq_domain_ops sg2042_msi_middle_domain_ops = {static const struct msi_parent_ops sg2042_msi_parent_ops = { .required_flags =SG2042_MSI_FLAGS_REQUIRED , .supported_flags =SG2042_MSI_FLAGS_SUPPORTED , + .chip_flags =MSI_CHIP_FLAG_SET_ACK , .bus_select_mask =MATCH_PCI_MSI , .bus_select_token =DOMAIN_BUS_NEXUS , .prefix ="SG2042-" ,