[v1,-next,1/2] RISC-V: ACPI : Fix for usage of pointers in different address space

Message ID 20230605143512.707533-2-sunilvl@ventanamicro.com
State New
Headers
Series RISC-V ACPI: Assorted fixes |

Commit Message

Sunil V L June 5, 2023, 2:35 p.m. UTC
  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(-)
  

Comments

Conor Dooley June 6, 2023, 3:35 p.m. UTC | #1
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
>
  
Sunil V L June 7, 2023, 4:55 a.m. UTC | #2
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
  

Patch

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)