All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 -next 0/2] RISC-V ACPI: Assorted fixes
@ 2023-06-05 14:35 ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra,
	Anup Patel, Will Deacon, Mark Rutland, Sunil V L

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 0/2] RISC-V ACPI: Assorted fixes
@ 2023-06-05 14:35 ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Mark Rutland, Albert Ou, Anup Patel, Paul Walmsley,
	Palmer Dabbelt, Atish Patra, Will Deacon

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(-)

-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 0/2] RISC-V ACPI: Assorted fixes
@ 2023-06-05 14:35 ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra,
	Anup Patel, Will Deacon, Mark Rutland, Sunil V L

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(-)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
  2023-06-05 14:35 ` Sunil V L
  (?)
@ 2023-06-05 14:35   ` Sunil V L
  -1 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra,
	Anup Patel, Will Deacon, Mark Rutland, Sunil V L,
	kernel test robot

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.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/
---
 arch/riscv/kernel/acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
index df5a45a2eb93..5ee03ebab80e 100644
--- a/arch/riscv/kernel/acpi.c
+++ b/arch/riscv/kernel/acpi.c
@@ -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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
@ 2023-06-05 14:35   ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Mark Rutland, Albert Ou, kernel test robot, Anup Patel,
	Paul Walmsley, Palmer Dabbelt, Atish Patra, Will Deacon

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.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/
---
 arch/riscv/kernel/acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
index df5a45a2eb93..5ee03ebab80e 100644
--- a/arch/riscv/kernel/acpi.c
+++ b/arch/riscv/kernel/acpi.c
@@ -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)
-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
@ 2023-06-05 14:35   ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra,
	Anup Patel, Will Deacon, Mark Rutland, Sunil V L,
	kernel test robot

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.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/
---
 arch/riscv/kernel/acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
index df5a45a2eb93..5ee03ebab80e 100644
--- a/arch/riscv/kernel/acpi.c
+++ b/arch/riscv/kernel/acpi.c
@@ -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)
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
  2023-06-05 14:35 ` Sunil V L
  (?)
@ 2023-06-05 14:35   ` Sunil V L
  -1 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra,
	Anup Patel, Will Deacon, Mark Rutland, 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 <sunilvl@ventanamicro.com>
---
 drivers/perf/riscv_pmu_sbi.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
index 4f3ac296b3e2..0bc491252a44 100644
--- a/drivers/perf/riscv_pmu_sbi.c
+++ b/drivers/perf/riscv_pmu_sbi.c
@@ -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 *pde
 	if (!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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
@ 2023-06-05 14:35   ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Mark Rutland, Albert Ou, Anup Patel, Paul Walmsley,
	Palmer Dabbelt, Atish Patra, Will Deacon

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 <sunilvl@ventanamicro.com>
---
 drivers/perf/riscv_pmu_sbi.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
index 4f3ac296b3e2..0bc491252a44 100644
--- a/drivers/perf/riscv_pmu_sbi.c
+++ b/drivers/perf/riscv_pmu_sbi.c
@@ -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 *pde
 	if (!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;
-- 
2.34.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
@ 2023-06-05 14:35   ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-05 14:35 UTC (permalink / raw)
  To: linux-riscv, linux-kernel, linux-arm-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra,
	Anup Patel, Will Deacon, Mark Rutland, 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 <sunilvl@ventanamicro.com>
---
 drivers/perf/riscv_pmu_sbi.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
index 4f3ac296b3e2..0bc491252a44 100644
--- a/drivers/perf/riscv_pmu_sbi.c
+++ b/drivers/perf/riscv_pmu_sbi.c
@@ -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 *pde
 	if (!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;
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
  2023-06-05 14:35   ` Sunil V L
  (?)
@ 2023-06-06 15:35     ` Conor Dooley
  -1 siblings, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-06-06 15:35 UTC (permalink / raw)
  To: Sunil V L
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland, kernel test robot

[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]

Hey Sunil,

On Mon, Jun 05, 2023 at 08:05:11PM +0530, Sunil V L wrote:
> 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.
> 
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/

Is this
Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
?
Otherwise,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  arch/riscv/kernel/acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
> index df5a45a2eb93..5ee03ebab80e 100644
> --- a/arch/riscv/kernel/acpi.c
> +++ b/arch/riscv/kernel/acpi.c
> @@ -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)
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
@ 2023-06-06 15:35     ` Conor Dooley
  0 siblings, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-06-06 15:35 UTC (permalink / raw)
  To: Sunil V L
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland, kernel test robot


[-- Attachment #1.1: Type: text/plain, Size: 1708 bytes --]

Hey Sunil,

On Mon, Jun 05, 2023 at 08:05:11PM +0530, Sunil V L wrote:
> 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.
> 
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/

Is this
Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
?
Otherwise,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  arch/riscv/kernel/acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
> index df5a45a2eb93..5ee03ebab80e 100644
> --- a/arch/riscv/kernel/acpi.c
> +++ b/arch/riscv/kernel/acpi.c
> @@ -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)
> -- 
> 2.34.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
@ 2023-06-06 15:35     ` Conor Dooley
  0 siblings, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-06-06 15:35 UTC (permalink / raw)
  To: Sunil V L
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland, kernel test robot


[-- Attachment #1.1: Type: text/plain, Size: 1708 bytes --]

Hey Sunil,

On Mon, Jun 05, 2023 at 08:05:11PM +0530, Sunil V L wrote:
> 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.
> 
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/

Is this
Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
?
Otherwise,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  arch/riscv/kernel/acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/riscv/kernel/acpi.c b/arch/riscv/kernel/acpi.c
> index df5a45a2eb93..5ee03ebab80e 100644
> --- a/arch/riscv/kernel/acpi.c
> +++ b/arch/riscv/kernel/acpi.c
> @@ -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)
> -- 
> 2.34.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
  2023-06-05 14:35   ` Sunil V L
  (?)
@ 2023-06-06 15:49     ` Conor Dooley
  -1 siblings, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-06-06 15:49 UTC (permalink / raw)
  To: Sunil V L
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland

[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]

On Mon, Jun 05, 2023 at 08:05:12PM +0530, Sunil V L wrote:
> 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 <sunilvl@ventanamicro.com>
> ---
>  drivers/perf/riscv_pmu_sbi.c | 17 ++---------------
>  1 file changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> index 4f3ac296b3e2..0bc491252a44 100644
> --- a/drivers/perf/riscv_pmu_sbi.c
> +++ b/drivers/perf/riscv_pmu_sbi.c
> @@ -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 *pde
>  	if (!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);

This riscv_get_intc_hwnode stuff is horrific, but that's besides the
point.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

>  	if (!domain) {
>  		pr_err("Failed to find INTC IRQ root domain\n");
>  		return -ENODEV;
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
@ 2023-06-06 15:49     ` Conor Dooley
  0 siblings, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-06-06 15:49 UTC (permalink / raw)
  To: Sunil V L
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland


[-- Attachment #1.1: Type: text/plain, Size: 1997 bytes --]

On Mon, Jun 05, 2023 at 08:05:12PM +0530, Sunil V L wrote:
> 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 <sunilvl@ventanamicro.com>
> ---
>  drivers/perf/riscv_pmu_sbi.c | 17 ++---------------
>  1 file changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> index 4f3ac296b3e2..0bc491252a44 100644
> --- a/drivers/perf/riscv_pmu_sbi.c
> +++ b/drivers/perf/riscv_pmu_sbi.c
> @@ -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 *pde
>  	if (!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);

This riscv_get_intc_hwnode stuff is horrific, but that's besides the
point.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

>  	if (!domain) {
>  		pr_err("Failed to find INTC IRQ root domain\n");
>  		return -ENODEV;
> -- 
> 2.34.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
@ 2023-06-06 15:49     ` Conor Dooley
  0 siblings, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-06-06 15:49 UTC (permalink / raw)
  To: Sunil V L
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland


[-- Attachment #1.1: Type: text/plain, Size: 1997 bytes --]

On Mon, Jun 05, 2023 at 08:05:12PM +0530, Sunil V L wrote:
> 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 <sunilvl@ventanamicro.com>
> ---
>  drivers/perf/riscv_pmu_sbi.c | 17 ++---------------
>  1 file changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> index 4f3ac296b3e2..0bc491252a44 100644
> --- a/drivers/perf/riscv_pmu_sbi.c
> +++ b/drivers/perf/riscv_pmu_sbi.c
> @@ -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 *pde
>  	if (!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);

This riscv_get_intc_hwnode stuff is horrific, but that's besides the
point.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

>  	if (!domain) {
>  		pr_err("Failed to find INTC IRQ root domain\n");
>  		return -ENODEV;
> -- 
> 2.34.1
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
  2023-06-06 15:35     ` Conor Dooley
  (?)
@ 2023-06-07  4:55       ` Sunil V L
  -1 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-07  4:55 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland, kernel test robot

Hi Conor,

On Tue, Jun 06, 2023 at 04:35:29PM +0100, Conor Dooley wrote:
> Hey Sunil,
> 
> On Mon, Jun 05, 2023 at 08:05:11PM +0530, Sunil V L wrote:
> > 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.
> > 
> > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/
> 
> Is this
> Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
> ?
Yes, I missed it. Will add.

Thanks!
Sunil

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
@ 2023-06-07  4:55       ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-07  4:55 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland, kernel test robot

Hi Conor,

On Tue, Jun 06, 2023 at 04:35:29PM +0100, Conor Dooley wrote:
> Hey Sunil,
> 
> On Mon, Jun 05, 2023 at 08:05:11PM +0530, Sunil V L wrote:
> > 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.
> > 
> > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/
> 
> Is this
> Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
> ?
Yes, I missed it. Will add.

Thanks!
Sunil

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
@ 2023-06-07  4:55       ` Sunil V L
  0 siblings, 0 replies; 18+ messages in thread
From: Sunil V L @ 2023-06-07  4:55 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel, Will Deacon,
	Mark Rutland, kernel test robot

Hi Conor,

On Tue, Jun 06, 2023 at 04:35:29PM +0100, Conor Dooley wrote:
> Hey Sunil,
> 
> On Mon, Jun 05, 2023 at 08:05:11PM +0530, Sunil V L wrote:
> > 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.
> > 
> > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/
> 
> Is this
> Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
> ?
Yes, I missed it. Will add.

Thanks!
Sunil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-06-07  5:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-05 14:35 [PATCH v1 -next 0/2] RISC-V ACPI: Assorted fixes Sunil V L
2023-06-05 14:35 ` Sunil V L
2023-06-05 14:35 ` Sunil V L
2023-06-05 14:35 ` [PATCH v1 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space Sunil V L
2023-06-05 14:35   ` Sunil V L
2023-06-05 14:35   ` Sunil V L
2023-06-06 15:35   ` Conor Dooley
2023-06-06 15:35     ` Conor Dooley
2023-06-06 15:35     ` Conor Dooley
2023-06-07  4:55     ` Sunil V L
2023-06-07  4:55       ` Sunil V L
2023-06-07  4:55       ` Sunil V L
2023-06-05 14:35 ` [PATCH v1 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Sunil V L
2023-06-05 14:35   ` Sunil V L
2023-06-05 14:35   ` Sunil V L
2023-06-06 15:49   ` Conor Dooley
2023-06-06 15:49     ` Conor Dooley
2023-06-06 15:49     ` Conor Dooley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.