Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irqchip/sg2042-msi: Fix broken affinity setting

When using NVME on SG2044, the NVME drvier always complains about "I/O tag
XXX (XXX) QID XX timeout, completion polled", which is caused by the broken
affinity setting mechanism of the sg2042-msi driver.

The PLIC driver can only the set the affinity when enabled, but the
sg2042-msi driver invokes the affinity setter in disabled state, which
causes the change to be lost.

Cure this by implementing the irq_startup()/shutdown() callbacks, which
allow to startup (enabled) the underlying PLIC first.

Fixes: e96b93a97c90 ("irqchip/sg2042-msi: Add the Sophgo SG2044 MSI interrupt controller")
Reported-by: Han Gao <rabenda.cn@gmail.com>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Chen Wang <unicorn_wang@outlook.com> # Pioneerbox
Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
Link: https://lore.kernel.org/all/20250813232835.43458-4-inochiama@gmail.com

authored by

Inochi Amaoto and committed by
Thomas Gleixner
9d8c4181 54f45a30

+13 -5
+13 -5
drivers/irqchip/irq-sg2042-msi.c
··· 85 85 86 86 static const struct irq_chip sg2042_msi_middle_irq_chip = { 87 87 .name = "SG2042 MSI", 88 + .irq_startup = irq_chip_startup_parent, 89 + .irq_shutdown = irq_chip_shutdown_parent, 88 90 .irq_ack = sg2042_msi_irq_ack, 89 91 .irq_mask = irq_chip_mask_parent, 90 92 .irq_unmask = irq_chip_unmask_parent, ··· 116 114 117 115 static struct irq_chip sg2044_msi_middle_irq_chip = { 118 116 .name = "SG2044 MSI", 117 + .irq_startup = irq_chip_startup_parent, 118 + .irq_shutdown = irq_chip_shutdown_parent, 119 119 .irq_ack = sg2044_msi_irq_ack, 120 120 .irq_mask = irq_chip_mask_parent, 121 121 .irq_unmask = irq_chip_unmask_parent, ··· 189 185 .select = msi_lib_irq_domain_select, 190 186 }; 191 187 192 - #define SG2042_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \ 193 - MSI_FLAG_USE_DEF_CHIP_OPS) 188 + #define SG2042_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \ 189 + MSI_FLAG_USE_DEF_CHIP_OPS | \ 190 + MSI_FLAG_PCI_MSI_MASK_PARENT | \ 191 + MSI_FLAG_PCI_MSI_STARTUP_PARENT) 194 192 195 193 #define SG2042_MSI_FLAGS_SUPPORTED MSI_GENERIC_FLAGS_MASK 196 194 ··· 206 200 .init_dev_msi_info = msi_lib_init_dev_msi_info, 207 201 }; 208 202 209 - #define SG2044_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \ 210 - MSI_FLAG_USE_DEF_CHIP_OPS) 203 + #define SG2044_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \ 204 + MSI_FLAG_USE_DEF_CHIP_OPS | \ 205 + MSI_FLAG_PCI_MSI_MASK_PARENT | \ 206 + MSI_FLAG_PCI_MSI_STARTUP_PARENT) 211 207 212 - #define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \ 208 + #define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \ 213 209 MSI_FLAG_PCI_MSIX) 214 210 215 211 static const struct msi_parent_ops sg2044_msi_parent_ops = {