linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: fix early early_iounmap()
@ 2021-11-04  0:37 Michał Mirosław
  2021-11-04  9:07 ` Ard Biesheuvel
  2021-11-04 12:16 ` Russell King (Oracle)
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Mirosław @ 2021-11-04  0:37 UTC (permalink / raw)
  To: Jon Medhurst, Ard Biesheuvel, Russell King; +Cc: linux-arm-kernel, linux-kernel

Currently __set_fixmap() bails out with a warning when called in early boot
from early_iounmap(). Fix it, and while at it, make the comment a bit easier
to understand.

Cc: <stable@vger.kernel.org>
Fixes: b089c31c519c ("ARM: 8667/3: Fix memory attribute inconsistencies when using fixmap")
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 arch/arm/mm/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index a4e006005107..274e4f73fd33 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -390,9 +390,9 @@ void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot)
 	BUILD_BUG_ON(__fix_to_virt(__end_of_fixed_addresses) < FIXADDR_START);
 	BUG_ON(idx >= __end_of_fixed_addresses);
 
-	/* we only support device mappings until pgprot_kernel has been set */
+	/* We support only device mappings before pgprot_kernel is set. */
 	if (WARN_ON(pgprot_val(prot) != pgprot_val(FIXMAP_PAGE_IO) &&
-		    pgprot_val(pgprot_kernel) == 0))
+		    pgprot_val(prot) && pgprot_val(pgprot_kernel) == 0))
 		return;
 
 	if (pgprot_val(prot))
-- 
2.30.2


_______________________________________________
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] 3+ messages in thread

* Re: [PATCH] ARM: fix early early_iounmap()
  2021-11-04  0:37 [PATCH] ARM: fix early early_iounmap() Michał Mirosław
@ 2021-11-04  9:07 ` Ard Biesheuvel
  2021-11-04 12:16 ` Russell King (Oracle)
  1 sibling, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2021-11-04  9:07 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Jon Medhurst, Russell King, Linux ARM, Linux Kernel Mailing List

On Thu, 4 Nov 2021 at 01:46, Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
>
> Currently __set_fixmap() bails out with a warning when called in early boot
> from early_iounmap(). Fix it, and while at it, make the comment a bit easier
> to understand.
>
> Cc: <stable@vger.kernel.org>
> Fixes: b089c31c519c ("ARM: 8667/3: Fix memory attribute inconsistencies when using fixmap")
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

> ---
>  arch/arm/mm/mmu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index a4e006005107..274e4f73fd33 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -390,9 +390,9 @@ void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot)
>         BUILD_BUG_ON(__fix_to_virt(__end_of_fixed_addresses) < FIXADDR_START);
>         BUG_ON(idx >= __end_of_fixed_addresses);
>
> -       /* we only support device mappings until pgprot_kernel has been set */
> +       /* We support only device mappings before pgprot_kernel is set. */
>         if (WARN_ON(pgprot_val(prot) != pgprot_val(FIXMAP_PAGE_IO) &&
> -                   pgprot_val(pgprot_kernel) == 0))
> +                   pgprot_val(prot) && pgprot_val(pgprot_kernel) == 0))
>                 return;
>
>         if (pgprot_val(prot))
> --
> 2.30.2
>

_______________________________________________
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] 3+ messages in thread

* Re: [PATCH] ARM: fix early early_iounmap()
  2021-11-04  0:37 [PATCH] ARM: fix early early_iounmap() Michał Mirosław
  2021-11-04  9:07 ` Ard Biesheuvel
@ 2021-11-04 12:16 ` Russell King (Oracle)
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2021-11-04 12:16 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Jon Medhurst, Ard Biesheuvel, linux-arm-kernel, linux-kernel

On Thu, Nov 04, 2021 at 01:37:15AM +0100, Michał Mirosław wrote:
> Currently __set_fixmap() bails out with a warning when called in early boot
> from early_iounmap(). Fix it, and while at it, make the comment a bit easier
> to understand.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: b089c31c519c ("ARM: 8667/3: Fix memory attribute inconsistencies when using fixmap")
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

LGTM. Please drop it into the patch system, thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2021-11-04 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04  0:37 [PATCH] ARM: fix early early_iounmap() Michał Mirosław
2021-11-04  9:07 ` Ard Biesheuvel
2021-11-04 12:16 ` Russell King (Oracle)

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 NNTP newsgroup(s).