Skip to content

Commit 12d0dd8

Browse files
andrea-parriliuw
authored andcommitted
Drivers: hv: vmbus: Remove unnecessary channel->lock critical sections (sc_list readers)
Additions/deletions to/from sc_list (as well as modifications of target_cpu(s)) are protected by channel_mutex, which hv_synic_cleanup() and vmbus_bus_suspend() own for the duration of the channel->lock critical section in question. Signed-off-by: Andrea Parri (Microsoft) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Michael Kelley <[email protected]> Signed-off-by: Wei Liu <[email protected]>
1 parent 0a96820 commit 12d0dd8

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

drivers/hv/hv.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ int hv_synic_cleanup(unsigned int cpu)
241241
{
242242
struct vmbus_channel *channel, *sc;
243243
bool channel_found = false;
244-
unsigned long flags;
245244

246245
/*
247246
* Hyper-V does not provide a way to change the connect CPU once
@@ -263,14 +262,12 @@ int hv_synic_cleanup(unsigned int cpu)
263262
channel_found = true;
264263
break;
265264
}
266-
spin_lock_irqsave(&channel->lock, flags);
267265
list_for_each_entry(sc, &channel->sc_list, sc_list) {
268266
if (sc->target_cpu == cpu) {
269267
channel_found = true;
270268
break;
271269
}
272270
}
273-
spin_unlock_irqrestore(&channel->lock, flags);
274271
if (channel_found)
275272
break;
276273
}

drivers/hv/vmbus_drv.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,6 @@ static int vmbus_acpi_add(struct acpi_device *device)
23442344
static int vmbus_bus_suspend(struct device *dev)
23452345
{
23462346
struct vmbus_channel *channel, *sc;
2347-
unsigned long flags;
23482347

23492348
while (atomic_read(&vmbus_connection.offer_in_progress) != 0) {
23502349
/*
@@ -2402,12 +2401,10 @@ static int vmbus_bus_suspend(struct device *dev)
24022401
continue;
24032402
}
24042403

2405-
spin_lock_irqsave(&channel->lock, flags);
24062404
list_for_each_entry(sc, &channel->sc_list, sc_list) {
24072405
pr_err("Sub-channel not deleted!\n");
24082406
WARN_ON_ONCE(1);
24092407
}
2410-
spin_unlock_irqrestore(&channel->lock, flags);
24112408

24122409
atomic_inc(&vmbus_connection.nr_chan_fixup_on_resume);
24132410
}

0 commit comments

Comments
 (0)