RISC-V ACPI: Assorted fixes
Subsystems (3)
cover RISC-V ACPI: Assorted fixes
This series fixes couple of issues required to complete the previously merged basic ACPI support series.
1) Kernel test bot has found a new warning using the sparse tool. Though I believe this warning exists for other architectures also, I don't see an issue fixing this for RISC-V.
2) When sscofpmf extension is enabled, the perf driver tries to find out the root INTC domain to register the over flow interrupt handler. However, this function is DT based and needs to be enhanced to work on ACPI based systems.
Sunil V L (2):
RISC-V: ACPI : Fix for usage of pointers in different address space RISC-V/perf: Use standard interface to get INTC domain
arch/riscv/kernel/acpi.c | 4 ++-- drivers/perf/riscv_pmu_sbi.c | 17 ++--------------- 2 files changed, 4 insertions(+), 17 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/2 RISC-V: ACPI : Fix for usage of pointers in different address space
The arch specific __acpi_map_table can be wrapper around either early_memremap or early_ioremap. But early_memremap routine works with normal pointers whereas __acpi_map_table expects pointers in iomem address space. This causes kernel test bot to fail while using the sparse tool. Fix the issue by using early_ioremap and similar fix done for __acpi_unmap_table.
--- arch/riscv/kernel/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kernel/acpi.c +2 -2
@@ -204,7 +204,7 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size)if (!size)return NULL ; -return early_memremap (phys, size); +return early_ioremap (phys, size); }void __init __acpi_unmap_table (void __iomem *map,unsigned long size)
@@ -212,7 +212,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)if (!map || !size)return ; -early_memunmap (map, size); +early_iounmap (map, size); }void *acpi_os_ioremap (acpi_physical_address phys,acpi_size size)
Signature · 1 line
2.34.1
Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
Hey Sunil,
Quoted 10 lines · Sunil V L
The arch specific
__acpi_map_tablecan be wrapper around eitherearly_memremaporearly_ioremap. Butearly_memremaproutine works with normal pointers whereas__acpi_map_tableexpects pointers in iomem address space. This causes kernel test bot to fail while using the sparse tool. Fix the issue by usingearly_ioremapand similar fix done for__acpi_unmap_table.Signed-off-by Sunil V L <[email protected]>Reported-by kernel test robot <[email protected]>
Is this
?
Otherwise,
Thanks,
Conor.
Quoted 29 lines
--- arch/riscv/kernel/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/riscv/kernel/acpi.c +2
-2@@ -204,7 +204,7 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size)if (!size)return NULL ; -return early_memremap (phys, size); +return early_ioremap (phys, size); }void __init __acpi_unmap_table (void __iomem *map,unsigned long size)@@ -212,7 +212,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)if (!map || !size)return ; -early_memunmap (map, size); +early_iounmap (map, size); }void *acpi_os_ioremap (acpi_physical_address phys,acpi_size size)Signature · 1 line
2.34.1
Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
Hi Conor,
Quoted 10 lines · Conor Dooley
Hey Sunil,
Quoted 7 lines · Sunil V L
The arch specific
__acpi_map_tablecan be wrapper around eitherearly_memremaporearly_ioremap. Butearly_memremaproutine works with normal pointers whereas__acpi_map_tableexpects pointers in iomem address space. This causes kernel test bot to fail while using the sparse tool. Fix the issue by usingearly_ioremapand similar fix done for__acpi_unmap_table.
Quoted 7 lines
Quoted 3 lines
Signed-off-by Sunil V L <[email protected]>Reported-by kernel test robot <[email protected]>Is this
Fixes a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")?
Yes, I missed it. Will add.
Thanks!
Sunil
PATCH 2/2 RISC-V/perf: Use standard interface to get INTC domain
In reply to Sunil V LCurrently the PMU driver is using DT based lookup to find the INTC node for sscofpmf extension. This will not work for ACPI based systems causing the driver to fail to register the PMU overflow interrupt handler.
Hence, change the code to use the standard interface to find the INTC node which works irrespective of DT or ACPI.
--- drivers/perf/riscv_pmu_sbi.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)
drivers/perf/riscv_pmu_sbi.c +2 -15
@@ -739,7 +739,6 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde {int ret;struct cpu_hw_events __percpu *hw_events = pmu->hw_events; -struct device_node *cpu, *child;struct irq_domain *domain =NULL ;if (riscv_isa_extension_available (NULL ,SSCOFPMF )) {
@@ -756,20 +755,8 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pdeif (!riscv_pmu_use_irq)return -EOPNOTSUPP ; -for_each_of_cpu_node (cpu) { - child =of_get_compatible_child (cpu,"riscv,cpu-intc" ); -if (!child) { -pr_err ("Failed to find INTC node\n" ); -of_node_put (cpu); -return -ENODEV ; - } - domain =irq_find_host (child); -of_node_put (child); -if (domain) { -of_node_put (cpu); -break ; - } - } + domain =irq_find_matching_fwnode (riscv_get_intc_hwnode (), +DOMAIN_BUS_ANY );if (!domain) {pr_err ("Failed to find INTC IRQ root domain\n" );return -ENODEV ;
Signature · 1 line
2.34.1
Re: [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
Quoted 35 lines · Sunil V L
Currently the PMU driver is using DT based lookup to find the INTC node for sscofpmf extension. This will not work for ACPI based systems causing the driver to fail to register the PMU overflow interrupt handler.
Hence, change the code to use the standard interface to find the INTC node which works irrespective of DT or ACPI.
Signed-off-by Sunil V L <[email protected]>--- drivers/perf/riscv_pmu_sbi.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)drivers/perf/riscv_pmu_sbi.c +0
-7@@ -739,7 +739,6 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde {int ret;struct cpu_hw_events __percpu *hw_events = pmu->hw_events; -struct device_node *cpu, *child;struct irq_domain *domain =NULL ;if (riscv_isa_extension_available (NULL ,SSCOFPMF )) {@@ -756,20 +755,8 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pdeif (!riscv_pmu_use_irq)return -EOPNOTSUPP ; -for_each_of_cpu_node (cpu) { - child =of_get_compatible_child (cpu,"riscv,cpu-intc" ); -if (!child) { -pr_err ("Failed to find INTC node\n" ); -of_node_put (cpu); -return -ENODEV ;
drivers/perf/riscv_pmu_sbi.c static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde · line 759
Quoted 10 lines
drivers/perf/riscv_pmu_sbi.c +2
-8- } - domain =irq_find_host (child); -of_node_put (child); -if (domain) { -of_node_put (cpu); -break ; - } - } + domain =irq_find_matching_fwnode (riscv_get_intc_hwnode (), +DOMAIN_BUS_ANY );
This riscv_get_intc_hwnode stuff is horrific, but that's besides the point.
Cheers,
Conor.
Quoted 6 lines
drivers/perf/riscv_pmu_sbi.c +0
-0if (!domain) {pr_err ("Failed to find INTC IRQ root domain\n" );return -ENODEV ;Signature · 1 line
2.34.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv