Skip to content

Commit 5c4b7ea

Browse files
inochisaRevySR
authored andcommitted
FROMLIST: irqchip/sg2042-msi: Fix broken affinity setting
When using NVME on SG2044, the NVME always complains "I/O tag XXX (XXX) QID XX timeout, completion polled", which is caused by the broken handler of the sg2042-msi driver. As PLIC driver can only setting affinity when enabling, the sg2042-msi does not properly handled affinity setting previously and enable irq in an unexpected executing path. Since the PCI template domain supports irq_startup/irq_shutdown, set irq_chip_[startup/shutdown]_parent for irq_startup/irq_shutdown. So the irq can be started properly. Fixes: e96b93a ("irqchip/sg2042-msi: Add the Sophgo SG2044 MSI interrupt controller") Reported-by: Han Gao <[email protected]> Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Inochi Amaoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Han Gao <[email protected]>
1 parent b37a8d3 commit 5c4b7ea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/irqchip/irq-sg2042-msi.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ static void sg2042_msi_irq_compose_msi_msg(struct irq_data *d, struct msi_msg *m
8585

8686
static const struct irq_chip sg2042_msi_middle_irq_chip = {
8787
.name = "SG2042 MSI",
88+
.irq_startup = irq_chip_startup_parent,
89+
.irq_shutdown = irq_chip_shutdown_parent,
8890
.irq_ack = sg2042_msi_irq_ack,
8991
.irq_mask = irq_chip_mask_parent,
9092
.irq_unmask = irq_chip_unmask_parent,
@@ -114,6 +116,8 @@ static void sg2044_msi_irq_compose_msi_msg(struct irq_data *d, struct msi_msg *m
114116

115117
static struct irq_chip sg2044_msi_middle_irq_chip = {
116118
.name = "SG2044 MSI",
119+
.irq_startup = irq_chip_startup_parent,
120+
.irq_shutdown = irq_chip_shutdown_parent,
117121
.irq_ack = sg2044_msi_irq_ack,
118122
.irq_mask = irq_chip_mask_parent,
119123
.irq_unmask = irq_chip_unmask_parent,
@@ -186,7 +190,9 @@ static const struct irq_domain_ops sg204x_msi_middle_domain_ops = {
186190
};
187191

188192
#define SG2042_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
189-
MSI_FLAG_USE_DEF_CHIP_OPS)
193+
MSI_FLAG_USE_DEF_CHIP_OPS | \
194+
MSI_FLAG_PCI_MSI_MASK_PARENT |\
195+
MSI_FLAG_PCI_MSI_STARTUP_PARENT)
190196

191197
#define SG2042_MSI_FLAGS_SUPPORTED MSI_GENERIC_FLAGS_MASK
192198

@@ -201,7 +207,9 @@ static const struct msi_parent_ops sg2042_msi_parent_ops = {
201207
};
202208

203209
#define SG2044_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
204-
MSI_FLAG_USE_DEF_CHIP_OPS)
210+
MSI_FLAG_USE_DEF_CHIP_OPS | \
211+
MSI_FLAG_PCI_MSI_MASK_PARENT |\
212+
MSI_FLAG_PCI_MSI_STARTUP_PARENT)
205213

206214
#define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
207215
MSI_FLAG_PCI_MSIX)

0 commit comments

Comments
 (0)