[PATCH 5/6] firewire: core: use sparse annotations and lockdep checks for split timeout lock
From: Takashi Sakamoto
Date: Thu Oct 08 2026 - 19:45:56 EST
The spinlock protects parameters related to split transaction timeouts.
Add sparse annotations and lockdep checks for this lock.
Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/core-transaction.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 4dec03340ae6..7d512defdeb3 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -200,11 +200,13 @@ static u32 compute_split_timeout_timestamp(struct fw_card *card, u32 request_tim
static void transmit_complete_callback(struct fw_packet *packet,
struct fw_card *card, int status)
+__must_not_hold(&card->split_timeout.lock)
__must_not_hold(&card->transactions.lock)
{
struct fw_transaction *t =
container_of(packet, struct fw_transaction, packet);
+ lockdep_assert_not_held(&card->split_timeout.lock);
lockdep_assert_not_held(&card->transactions.lock);
trace_async_request_outbound_complete((uintptr_t)t, card->index, packet->generation,
@@ -878,11 +880,14 @@ __must_hold(&card->split_timeout.lock)
static struct fw_request *allocate_request(struct fw_card *card,
struct fw_packet *p)
+__must_not_hold(&card->split_timeout.lock)
{
struct fw_request *request;
u32 *data, length;
int request_tcode;
+ lockdep_assert_not_held(&card->split_timeout.lock);
+
request_tcode = async_header_get_tcode(p->header);
switch (request_tcode) {
case TCODE_WRITE_QUADLET_REQUEST:
@@ -1301,6 +1306,8 @@ __must_hold(&card->split_timeout.lock)
{
unsigned int cycles;
+ lockdep_assert_held(&card->split_timeout.lock);
+
cycles = card->split_timeout.hi * 8000 + (card->split_timeout.lo >> 19);
/* minimum per IEEE 1394, maximum which doesn't overflow OHCI */
--
2.53.0