]> www.infradead.org Git - users/jedix/linux-maple.git/commit
firmware: arm_ffa: Move memory allocation outside the mutex locking
authorSudeep Holla <sudeep.holla@arm.com>
Wed, 28 May 2025 08:49:42 +0000 (09:49 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 9 Jun 2025 10:24:43 +0000 (11:24 +0100)
commit27e850c88df0e25474a8caeb2903e2e90b62c1dc
treee74812e2773dc773dcf0aeb95b688d0e22964412
parenta833d31ad867103ba72a0b73f3606f4ab8601719
firmware: arm_ffa: Move memory allocation outside the mutex locking

The notifier callback node allocation is currently done while holding
the notify_lock mutex. While this is safe even if memory allocation may
sleep, we need to move the allocation outside the locked region in
preparation to move from using muxtes to rwlocks.

Move the memory allocation to avoid potential sleeping in atomic context
once the locks are moved from mutex to rwlocks.

Fixes: e0573444edbf ("firmware: arm_ffa: Add interfaces to request notification callbacks")
Message-Id: <20250528-ffa_notif_fix-v1-2-5ed7bc7f8437@arm.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_ffa/driver.c