Re: [PATCH] efi/capsule: Replace kmap_atomic() with kmap_local_page()

From: Ard Biesheuvel

Date: Thu Sep 03 2026 - 05:51:02 EST




On Wed, 2 Sep 2026, at 22:13, Danish Khateeb wrote:
> kmap_atomic() is deprecated in favour of kmap_local_page(), as described
> in Documentation/mm/highmem.rst.
>
> The conversion is safe here: the mapping is created and torn down within a
> single iteration of the sg_count loop, preserving the strict stack-based
> ordering that kmap_local_page() requires, and the mapped region is only
> written to, so neither pagefault_disable() nor preempt_disable() is needed.
> The surrounding code already sleeps (it allocates the pages with
> alloc_page(GFP_KERNEL) and later takes capsule_mutex), so there is no
> atomic context to preserve.
>
> Build-tested only.
>
> Assisted-by: LLM sparse
> Signed-off-by: Danish Khateeb <danishkhateeb03@xxxxxxxxx>
> ---
> drivers/firmware/efi/capsule.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Queued up in efi/next - thanks