* Re: [PATCH] sh: mm: Re-add lost __ref to ioremap_prot() to fix modpost warning
2023-09-11 9:38 [PATCH] sh: mm: Re-add lost __ref to ioremap_prot() to fix modpost warning Geert Uytterhoeven
@ 2023-09-11 10:16 ` Baoquan He
2023-09-11 10:29 ` John Paul Adrian Glaubitz
2023-09-21 9:34 ` John Paul Adrian Glaubitz
2 siblings, 0 replies; 4+ messages in thread
From: Baoquan He @ 2023-09-11 10:16 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
Andrew Morton, linux-sh, linux-kernel
On 09/11/23 at 11:38am, Geert Uytterhoeven wrote:
> When __ioremap_caller() was replaced by ioremap_prot(), the __ref
> annotation added in commit af1415314a4190b8 ("sh: Flag
> __ioremap_caller() __init_refok.") was removed, causing a modpost
> warning:
>
> WARNING: modpost: vmlinux: section mismatch in reference: ioremap_prot+0x88 (section: .text) -> ioremap_fixed (section: .init.text)
>
> ioremap_prot() calls ioremap_fixed() (which is marked __init), but only
> before mem_init_done becomes true, so this is safe. Hence fix this by
> re-adding the lost __ref.
>
> Fixes: 0453c9a78015cb22 ("sh: mm: convert to GENERIC_IOREMAP")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> arch/sh/mm/ioremap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c
> index c33b3daa4ad1a3e6..33d20f34560fd5cb 100644
> --- a/arch/sh/mm/ioremap.c
> +++ b/arch/sh/mm/ioremap.c
> @@ -72,8 +72,8 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot)
> #define __ioremap_29bit(offset, size, prot) NULL
> #endif /* CONFIG_29BIT */
>
> -void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
> - unsigned long prot)
> +void __iomem __ref *ioremap_prot(phys_addr_t phys_addr, size_t size,
> + unsigned long prot)
Sorry for the mistake, and I possibly missed the warning when building.
Reviewed-by: Baoquan He <bhe@redhat.com>
> {
> void __iomem *mapped;
> pgprot_t pgprot = __pgprot(prot);
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] sh: mm: Re-add lost __ref to ioremap_prot() to fix modpost warning
2023-09-11 9:38 [PATCH] sh: mm: Re-add lost __ref to ioremap_prot() to fix modpost warning Geert Uytterhoeven
2023-09-11 10:16 ` Baoquan He
@ 2023-09-11 10:29 ` John Paul Adrian Glaubitz
2023-09-21 9:34 ` John Paul Adrian Glaubitz
2 siblings, 0 replies; 4+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-09-11 10:29 UTC (permalink / raw)
To: Geert Uytterhoeven, Yoshinori Sato, Rich Felker, Andrew Morton,
Baoquan He
Cc: linux-sh, linux-kernel
Hi Geert!
On Mon, 2023-09-11 at 11:38 +0200, Geert Uytterhoeven wrote:
> When __ioremap_caller() was replaced by ioremap_prot(), the __ref
> annotation added in commit af1415314a4190b8 ("sh: Flag
> __ioremap_caller() __init_refok.") was removed, causing a modpost
> warning:
>
> WARNING: modpost: vmlinux: section mismatch in reference: ioremap_prot+0x88 (section: .text) -> ioremap_fixed (section: .init.text)
>
> ioremap_prot() calls ioremap_fixed() (which is marked __init), but only
> before mem_init_done becomes true, so this is safe. Hence fix this by
> re-adding the lost __ref.
>
> Fixes: 0453c9a78015cb22 ("sh: mm: convert to GENERIC_IOREMAP")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> arch/sh/mm/ioremap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c
> index c33b3daa4ad1a3e6..33d20f34560fd5cb 100644
> --- a/arch/sh/mm/ioremap.c
> +++ b/arch/sh/mm/ioremap.c
> @@ -72,8 +72,8 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot)
> #define __ioremap_29bit(offset, size, prot) NULL
> #endif /* CONFIG_29BIT */
>
> -void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
> - unsigned long prot)
> +void __iomem __ref *ioremap_prot(phys_addr_t phys_addr, size_t size,
> + unsigned long prot)
> {
> void __iomem *mapped;
> pgprot_t pgprot = __pgprot(prot);
Thanks for catching this!
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] sh: mm: Re-add lost __ref to ioremap_prot() to fix modpost warning
2023-09-11 9:38 [PATCH] sh: mm: Re-add lost __ref to ioremap_prot() to fix modpost warning Geert Uytterhoeven
2023-09-11 10:16 ` Baoquan He
2023-09-11 10:29 ` John Paul Adrian Glaubitz
@ 2023-09-21 9:34 ` John Paul Adrian Glaubitz
2 siblings, 0 replies; 4+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-09-21 9:34 UTC (permalink / raw)
To: Geert Uytterhoeven, Yoshinori Sato, Rich Felker, Andrew Morton,
Baoquan He
Cc: linux-sh, linux-kernel
On Mon, 2023-09-11 at 11:38 +0200, Geert Uytterhoeven wrote:
> When __ioremap_caller() was replaced by ioremap_prot(), the __ref
> annotation added in commit af1415314a4190b8 ("sh: Flag
> __ioremap_caller() __init_refok.") was removed, causing a modpost
> warning:
>
> WARNING: modpost: vmlinux: section mismatch in reference: ioremap_prot+0x88 (section: .text) -> ioremap_fixed (section: .init.text)
>
> ioremap_prot() calls ioremap_fixed() (which is marked __init), but only
> before mem_init_done becomes true, so this is safe. Hence fix this by
> re-adding the lost __ref.
>
> Fixes: 0453c9a78015cb22 ("sh: mm: convert to GENERIC_IOREMAP")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> arch/sh/mm/ioremap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c
> index c33b3daa4ad1a3e6..33d20f34560fd5cb 100644
> --- a/arch/sh/mm/ioremap.c
> +++ b/arch/sh/mm/ioremap.c
> @@ -72,8 +72,8 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot)
> #define __ioremap_29bit(offset, size, prot) NULL
> #endif /* CONFIG_29BIT */
>
> -void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
> - unsigned long prot)
> +void __iomem __ref *ioremap_prot(phys_addr_t phys_addr, size_t size,
> + unsigned long prot)
> {
> void __iomem *mapped;
> pgprot_t pgprot = __pgprot(prot);
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
^ permalink raw reply [flat|nested] 4+ messages in thread