[PATCH 1/2] firewire: core: adjust context_unsafe() usage for lockdep checks
From: Takashi Sakamoto
Date: Mon Oct 19 2026 - 08:30:51 EST
schedule_error_callback() requires a lock to be held by the caller.
However, __fw_send_request() calls the function without holding any lock
when retrieving the transaction label fails, as no lock is needed in
this case. context_safe() is used to suppress the precondition check in
compiler-based context analysis, but it does not affect lockdep checks.
As a result, lockdep reports a violation of the precondition.
Acquire the lock before calling the function instead of using
context_unsafe().
Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/core-transaction.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index e24fb6b97770..0ebe70a4d440 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -438,7 +438,8 @@ __must_not_hold(&card->transactions.lock)
tstamp = cycle_time_to_ohci_tstamp(curr_cycle_time);
t->packet.timestamp = tstamp;
- context_unsafe(schedule_error_callback(card, t, RCODE_SEND_ERROR, tstamp));
+ scoped_guard(spinlock_irqsave, &card->transactions.lock)
+ schedule_error_callback(card, t, RCODE_SEND_ERROR, tstamp);
return;
}
--
2.53.0