Re: [PATCH v1] LoongArch/mm: Fix nr passing in set_direct_map_valid_noflush()
From: Huacai Chen
Date: Sun Jun 07 2026 - 00:40:05 EST
Applied, thanks.
Huacai
On Thu, Jun 4, 2026 at 5:02 PM Xuewen Wang <wangxuewen@xxxxxxxxxx> wrote:
>
> set_direct_map_valid_noflush() incorrectly passed 1 to __set_memory()
> instead of nr. This caused only the first page to be updated when nr > 1.
>
> Other architectures all pass nr correctly.
>
> Fixes: 0c6378a71574 ("arch: introduce set_direct_map_valid_noflush()")
> Signed-off-by: Xuewen Wang <wangxuewen@xxxxxxxxxx>
> ---
> arch/loongarch/mm/pageattr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/mm/pageattr.c b/arch/loongarch/mm/pageattr.c
> index f5e910b68229..614ccc7afccb 100644
> --- a/arch/loongarch/mm/pageattr.c
> +++ b/arch/loongarch/mm/pageattr.c
> @@ -234,5 +234,5 @@ int set_direct_map_valid_noflush(struct page *page, unsigned nr, bool valid)
> clear = __pgprot(_PAGE_PRESENT | _PAGE_VALID);
> }
>
> - return __set_memory(addr, 1, set, clear);
> + return __set_memory(addr, nr, set, clear);
> }
> --
> 2.25.1
>