[PATCH 4/5] firewire: core: use spinlock without irqsave for card split_timeout member

From: Takashi Sakamoto

Date: Sat Sep 19 2026 - 07:51:13 EST


Asynchronous packet callbacks are now always invoked in process context.
Therefore, the split_timeout member is not accessed from IRQ context.

Use spin_lock() for the split_timeout member since disabling local IRQs
is unnecessary.

Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/core-transaction.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 995c2001bee0..91ed85b7aa22 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -204,9 +204,7 @@ static void transmit_complete_callback(struct fw_packet *packet,
{
unsigned int delta;

- // NOTE: This can be without irqsave when we can guarantee that __fw_send_request() for
- // local destination never runs in any type of IRQ context.
- scoped_guard(spinlock_irqsave, &card->split_timeout.lock) {
+ scoped_guard(spinlock, &card->split_timeout.lock) {
t->split_timeout_cycle =
compute_split_timeout_timestamp(card, packet->timestamp) & 0xffff;
delta = card->split_timeout.jiffies;
@@ -900,9 +898,7 @@ static struct fw_request *allocate_request(struct fw_card *card,
return NULL;
kref_init(&request->kref);

- // NOTE: This can be without irqsave when we can guarantee that __fw_send_request() for
- // local destination never runs in any type of IRQ context.
- scoped_guard(spinlock_irqsave, &card->split_timeout.lock)
+ scoped_guard(spinlock, &card->split_timeout.lock)
request->response.timestamp = compute_split_timeout_timestamp(card, p->timestamp);

request->response.speed = p->speed;
@@ -1340,10 +1336,7 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
if (tcode == TCODE_READ_QUADLET_REQUEST) {
*data = cpu_to_be32(card->split_timeout.hi);
} else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
- // NOTE: This can be without irqsave when we can guarantee that
- // __fw_send_request() for local destination never runs in any type of IRQ
- // context.
- scoped_guard(spinlock_irqsave, &card->split_timeout.lock) {
+ scoped_guard(spinlock, &card->split_timeout.lock) {
card->split_timeout.hi = be32_to_cpu(*data) & 7;
update_split_timeout(card);
}
@@ -1356,10 +1349,7 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
if (tcode == TCODE_READ_QUADLET_REQUEST) {
*data = cpu_to_be32(card->split_timeout.lo);
} else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
- // NOTE: This can be without irqsave when we can guarantee that
- // __fw_send_request() for local destination never runs in any type of IRQ
- // context.
- scoped_guard(spinlock_irqsave, &card->split_timeout.lock) {
+ scoped_guard(spinlock, &card->split_timeout.lock) {
card->split_timeout.lo = be32_to_cpu(*data) & 0xfff80000;
update_split_timeout(card);
}
--
2.53.0