ACPI/irq: Apply ACPI_IRQCHIP_FWSPEC_ARG0 only for GSI domain
RFC 1/1 ACPI/irq: Apply ACPI_IRQCHIP_FWSPEC_ARG0 only for GSI domain
The implementation of the updated GICv3 parameter parsing code in pack_fwspec() is not compatible for the non-GSI drivers. It uses the offset 1 for hardware IRQ, but the unmodified GPIO driver expects the offset value to be 0, leading to a regression.
This patch applies new mapping to the GSI driver only to fix the issue.
---
drivers/acpi/irq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/irq.c +3 -2
@@ -53,7 +53,8 @@ static void pack_fwspec(struct irq_fwspec *fwspec, u32 gsi, int trigger, {unsigned int offset =0 ; -if (IS_ENABLED (CONFIG_ACPI_IRQCHIP_FWSPEC_ARG0 )) { +if (IS_ENABLED (CONFIG_ACPI_IRQCHIP_FWSPEC_ARG0 ) && + (fwspec->fwnode ==acpi_get_gsi_domain_id (gsi))) { fwspec->param[0 ] =ACPI_IRQCHIP_FWSPEC_ARG0 ; offset =1 ; }
@@ -216,8 +217,8 @@ static inline void acpi_irq_parse_one_match(struct fwnode_handle *fwnode, ctx->rc =0 ; *ctx->res_flags =acpi_dev_irq_flags (triggering, polarity, shareable, wake_capable); -pack_fwspec (ctx->fwspec, hwirq, triggering, polarity); ctx->fwspec->fwnode = fwnode; +pack_fwspec (ctx->fwspec, hwirq, triggering, polarity); }/**
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi James
When the IRQ combining feature is enabled, the following modification becomes necessary. Without implementing this change. The MPAM feature is not working on NVIDIA platforms.
Please review the code and provide feedback.
Quoted 29 lines · Shanker Donthineni
The implementation of the updated GICv3 parameter parsing code in
pack_fwspec()is not compatible for the non-GSI drivers. It uses the offset 1 for hardware IRQ, but the unmodified GPIO driver expects the offset value to be 0, leading to a regression.This patch applies new mapping to the GSI driver only to fix the issue.
Signed-off-by Shanker Donthineni <[email protected]>---
drivers/acpi/irq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/acpi/irq.c +2
-1@@ -53,7 +53,8 @@ static void pack_fwspec(struct irq_fwspec *fwspec, u32 gsi, int trigger, {unsigned int offset =0 ; -if (IS_ENABLED (CONFIG_ACPI_IRQCHIP_FWSPEC_ARG0 )) { +if (IS_ENABLED (CONFIG_ACPI_IRQCHIP_FWSPEC_ARG0 ) && + (fwspec->fwnode ==acpi_get_gsi_domain_id (gsi))) { fwspec->param[0 ] =ACPI_IRQCHIP_FWSPEC_ARG0 ; offset =1 ; }
drivers/acpi/irq.c static inline void acpi_irq_parse_one_match(struct fwnode_handle *fwnode, · line 224
Quoted 9 lines
drivers/acpi/irq.c +1
-1@@ -216,8 +217,8 @@ static inline void acpi_irq_parse_one_match(struct fwnode_handle *fwnode, ctx->rc =0 ; *ctx->res_flags =acpi_dev_irq_flags (triggering, polarity, shareable, wake_capable); -pack_fwspec (ctx->fwspec, hwirq, triggering, polarity); ctx->fwspec->fwnode = fwnode; +pack_fwspec (ctx->fwspec, hwirq, triggering, polarity); }/**
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi James,
The usage of an uninitialized variable in the PPTT code has resulted in another problem. The MPAM driver probe fails when the variable "num_levels" contains a random value. The code modification provided below resolves the issue. Please review it.
$ git diff drivers/acpi/pptt.c
drivers/acpi/pptt.c +4 -0
@@ -1003,6 +1003,8 @@ int find_acpi_cache_level_from_id(u32 cache_id) cpu_node =acpi_find_processor_node (table, acpi_cpu_id);if (!cpu_node)break ; + + num_levels =0 ;acpi_count_levels (table, cpu_node, &num_levels,NULL );for (level =0 ; level <= num_levels; level++) {
@@ -1073,6 +1075,8 @@ int acpi_pptt_get_cpumask_from_cache_id(u32 cache_id, cpumask_t *cpus) cpu_node =acpi_find_processor_node (table, acpi_cpu_id);if (!cpu_node)break ; + + num_levels =0 ;acpi_count_levels (table, cpu_node, &num_levels,NULL );for (level =0 ; level <= num_levels; level++) {
-Shanker
Quoted 37 lines · Shanker Donthineni
Hi James
When the IRQ combining feature is enabled, the following modification becomes necessary. Without implementing this change. The MPAM feature is not working on NVIDIA platforms.
Please review the code and provide feedback.
Quoted 27 lines · Shanker Donthineni
The implementation of the updated GICv3 parameter parsing code in
pack_fwspec()is not compatible for the non-GSI drivers. It uses the offset 1 for hardware IRQ, but the unmodified GPIO driver expects the offset value to be 0, leading to a regression.This patch applies new mapping to the GSI driver only to fix the issue.
Signed-off-by Shanker Donthineni <[email protected]>---
drivers/acpi/irq.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)drivers/acpi/irq.c +2
-1@@ -53,7 +53,8 @@ static void pack_fwspec(struct irq_fwspec *fwspec, u32 gsi, int trigger, { unsigned int offset = 0; - if (IS_ENABLED(CONFIG_ACPI_IRQCHIP_FWSPEC_ARG0)) { + if (IS_ENABLED(CONFIG_ACPI_IRQCHIP_FWSPEC_ARG0) && + (fwspec->fwnode == acpi_get_gsi_domain_id(gsi))) { fwspec->param[0] = ACPI_IRQCHIP_FWSPEC_ARG0; offset = 1; }
Quoted 8 lines
drivers/acpi/irq.c static inline void acpi_irq_parse_one_match(struct fwnode_handle *fwnode, · line 222
Quoted 8 lines
drivers/acpi/irq.c +1
-1@@ -216,8 +217,8 @@ static inline void acpi_irq_parse_one_match(struct fwnode_handle *fwnode, ctx->rc = 0; *ctx->res_flags = acpi_dev_irq_flags(triggering, polarity, shareable, wake_capable); - pack_fwspec(ctx->fwspec, hwirq, triggering, polarity); ctx->fwspec->fwnode = fwnode; + pack_fwspec(ctx->fwspec, hwirq, triggering, polarity); } /**
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel