[PATCH 1/4] firewire: cdev: remove unnecessary client locking for fw_device members
From: Takashi Sakamoto
Date: Sat Sep 26 2026 - 23:44:08 EST
Some accesses to fw_device members unnecessarily use the client-level
lock. Remove the locking from these accesses.
Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/core-cdev.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index a626468b4b0f..5020895c42a0 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1350,17 +1350,17 @@ static void iso_resource_auto_work(struct work_struct *work)
struct iso_resource_auto *r = from_work(r, work, work.work);
struct client *client = r->client;
unsigned long index = r->resource.handle;
- int current_generation, resource_generation, channel, bandwidth, todo;
- u64 reset_jiffies;
+ int channel, bandwidth, todo;
bool free;
- scoped_guard(spinlock_irq, &client->lock) {
- reset_jiffies = client->device->card->reset_jiffies;
- current_generation = client->device->generation;
- resource_generation = r->generation;
- r->generation = current_generation;
+ u64 reset_jiffies = client->device->card->reset_jiffies;
+ int current_generation = client->device->generation;
+
+ int resource_generation = r->generation;
+ r->generation = current_generation;
+
+ scoped_guard(spinlock_irq, &client->lock)
todo = r->todo;
- }
switch (todo) {
case ISO_RES_AUTO_ALLOC:
@@ -1514,12 +1514,10 @@ static void iso_resource_once_work(struct work_struct *work)
struct iso_resource_once *r = from_work(r, work, work);
struct client *client = r->client;
struct iso_resource_event *e = r->event;
- int generation, channel, bandwidth;
-
- scoped_guard(spinlock_irq, &client->lock)
- generation = client->device->generation;
+ int channel;
- bandwidth = r->params.bandwidth;
+ int generation = client->device->generation;
+ int bandwidth = r->params.bandwidth;
fw_iso_resource_manage(client->device->card, generation, r->params.channels_mask, &channel,
&bandwidth, r->todo == ISO_RES_ONCE_ALLOC);
--
2.53.0