Skip to content

Commit 310f465

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 set affinity when enabling, the sg2042-msi does not properly handled affinity setting previously and enables 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() and 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 8a380ed commit 310f465

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

drivers/irqchip/irq-sg2042-msi.c

Lines changed: 13 additions & 5 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,
@@ -185,8 +189,10 @@ static const struct irq_domain_ops sg204x_msi_middle_domain_ops = {
185189
.select = msi_lib_irq_domain_select,
186190
};
187191

188-
#define SG2042_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
189-
MSI_FLAG_USE_DEF_CHIP_OPS)
192+
#define SG2042_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_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

@@ -200,10 +206,12 @@ static const struct msi_parent_ops sg2042_msi_parent_ops = {
200206
.init_dev_msi_info = msi_lib_init_dev_msi_info,
201207
};
202208

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

206-
#define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
214+
#define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
207215
MSI_FLAG_PCI_MSIX)
208216

209217
static const struct msi_parent_ops sg2044_msi_parent_ops = {

0 commit comments

Comments
 (0)