* [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes
@ 2023-06-07 11:24 Sunil V L
2023-06-07 11:24 ` [PATCH v2 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space Sunil V L
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Sunil V L @ 2023-06-07 11:24 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.
Changes since v1:
1) Added "Fixes:" tag
2) Added RB tag from Conor
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] 7+ messages in thread
* [PATCH v2 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
2023-06-07 11:24 [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Sunil V L
@ 2023-06-07 11:24 ` Sunil V L
2023-06-07 11:24 ` [PATCH v2 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Sunil V L
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Sunil V L @ 2023-06-07 11:24 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,
Conor Dooley
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.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305201427.I7QhPjNW-lkp@intel.com/
Fixes: a91a9ffbd3a5 ("RISC-V: Add support to build the ACPI core")
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.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] 7+ messages in thread
* [PATCH v2 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
2023-06-07 11:24 [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Sunil V L
2023-06-07 11:24 ` [PATCH v2 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space Sunil V L
@ 2023-06-07 11:24 ` Sunil V L
2023-06-07 23:19 ` Atish Patra
2023-06-07 18:20 ` [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Conor Dooley
` (2 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Sunil V L @ 2023-06-07 11:24 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, Conor Dooley
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>
Reviewed-by: Conor Dooley <conor.dooley@microchip.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] 7+ messages in thread
* Re: [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes
2023-06-07 11:24 [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Sunil V L
2023-06-07 11:24 ` [PATCH v2 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space Sunil V L
2023-06-07 11:24 ` [PATCH v2 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Sunil V L
@ 2023-06-07 18:20 ` Conor Dooley
2023-06-19 22:07 ` Palmer Dabbelt
2023-06-20 1:00 ` patchwork-bot+linux-riscv
4 siblings, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2023-06-07 18:20 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: 222 bytes --]
On Wed, Jun 07, 2023 at 04:54:15PM +0530, Sunil V L wrote:
> Changes since v1:
> 1) Added "Fixes:" tag
> 2) Added RB tag from Conor
b4 is usually capable of picking up Fixes: tags without having to resend
the series!
[-- 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] 7+ messages in thread
* Re: [PATCH v2 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain
2023-06-07 11:24 ` [PATCH v2 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Sunil V L
@ 2023-06-07 23:19 ` Atish Patra
0 siblings, 0 replies; 7+ messages in thread
From: Atish Patra @ 2023-06-07 23:19 UTC (permalink / raw
To: Sunil V L
Cc: linux-riscv, linux-kernel, linux-arm-kernel, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Anup Patel, Will Deacon, Mark Rutland,
Conor Dooley
On Wed, Jun 7, 2023 at 4:24 AM Sunil V L <sunilvl@ventanamicro.com> 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>
> Reviewed-by: Conor Dooley <conor.dooley@microchip.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
>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
--
Regards,
Atish
_______________________________________________
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] 7+ messages in thread
* Re: [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes
2023-06-07 11:24 [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Sunil V L
` (2 preceding siblings ...)
2023-06-07 18:20 ` [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Conor Dooley
@ 2023-06-19 22:07 ` Palmer Dabbelt
2023-06-20 1:00 ` patchwork-bot+linux-riscv
4 siblings, 0 replies; 7+ messages in thread
From: Palmer Dabbelt @ 2023-06-19 22:07 UTC (permalink / raw
To: linux-riscv, linux-kernel, linux-arm-kernel, Sunil V L
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra, Anup Patel,
Will Deacon, Mark Rutland
On Wed, 07 Jun 2023 16:54:15 +0530, Sunil V L wrote:
> 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.
>
> [...]
Applied, thanks!
[1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
https://git.kernel.org/palmer/c/3b426d4b5b14
[2/2] RISC-V/perf: Use standard interface to get INTC domain
https://git.kernel.org/palmer/c/ca7473cb8312
Best regards,
--
Palmer Dabbelt <palmer@rivosinc.com>
_______________________________________________
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] 7+ messages in thread
* Re: [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes
2023-06-07 11:24 [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Sunil V L
` (3 preceding siblings ...)
2023-06-19 22:07 ` Palmer Dabbelt
@ 2023-06-20 1:00 ` patchwork-bot+linux-riscv
4 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+linux-riscv @ 2023-06-20 1:00 UTC (permalink / raw
To: Sunil V L
Cc: linux-riscv, linux-kernel, linux-arm-kernel, mark.rutland, aou,
anup, paul.walmsley, palmer, atishp, will
Hello:
This series was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Wed, 7 Jun 2023 16:54:15 +0530 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [v2,-next,1/2] RISC-V: ACPI : Fix for usage of pointers in different address space
https://git.kernel.org/riscv/c/3b426d4b5b14
- [v2,-next,2/2] RISC-V/perf: Use standard interface to get INTC domain
https://git.kernel.org/riscv/c/ca7473cb8312
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
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] 7+ messages in thread
end of thread, other threads:[~2023-06-20 1:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 11:24 [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Sunil V L
2023-06-07 11:24 ` [PATCH v2 -next 1/2] RISC-V: ACPI : Fix for usage of pointers in different address space Sunil V L
2023-06-07 11:24 ` [PATCH v2 -next 2/2] RISC-V/perf: Use standard interface to get INTC domain Sunil V L
2023-06-07 23:19 ` Atish Patra
2023-06-07 18:20 ` [PATCH v2 -next 0/2] RISC-V ACPI: Assorted fixes Conor Dooley
2023-06-19 22:07 ` Palmer Dabbelt
2023-06-20 1:00 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).