Skip to content

Commit a105acd

Browse files
committed
ACPI: EC: Simplify locking in acpi_ec_event_handler()
Because acpi_ec_event_handler() is a work function, it always runs in process context with interrupts enabled, so it can use spin_lock_irq() and spin_unlock_irq() for the locking. Make it do so and adjust white space around those calls. No expected functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 388fb77 commit a105acd

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/acpi/ec.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,18 +1217,18 @@ static int acpi_ec_query(struct acpi_ec *ec)
12171217

12181218
static void acpi_ec_event_handler(struct work_struct *work)
12191219
{
1220-
unsigned long flags;
12211220
struct acpi_ec *ec = container_of(work, struct acpi_ec, work);
12221221

12231222
ec_dbg_evt("Event started");
12241223

1225-
spin_lock_irqsave(&ec->lock, flags);
1224+
spin_lock_irq(&ec->lock);
1225+
12261226
while (ec->nr_pending_queries) {
1227-
spin_unlock_irqrestore(&ec->lock, flags);
1227+
spin_unlock_irq(&ec->lock);
12281228

12291229
acpi_ec_query(ec);
12301230

1231-
spin_lock_irqsave(&ec->lock, flags);
1231+
spin_lock_irq(&ec->lock);
12321232
ec->nr_pending_queries--;
12331233
}
12341234

@@ -1241,23 +1241,23 @@ static void acpi_ec_event_handler(struct work_struct *work)
12411241
ec_event_clearing == ACPI_EC_EVT_TIMING_QUERY)
12421242
acpi_ec_complete_query(ec);
12431243

1244-
spin_unlock_irqrestore(&ec->lock, flags);
1244+
spin_unlock_irq(&ec->lock);
12451245

12461246
ec_dbg_evt("Event stopped");
12471247

12481248
if (ec_event_clearing == ACPI_EC_EVT_TIMING_EVENT && ec_guard(ec)) {
1249-
spin_lock_irqsave(&ec->lock, flags);
1249+
spin_lock_irq(&ec->lock);
12501250

12511251
/* Take care of SCI_EVT unless someone else is doing that. */
12521252
if (!ec->curr)
12531253
advance_transaction(ec, false);
12541254

1255-
spin_unlock_irqrestore(&ec->lock, flags);
1255+
spin_unlock_irq(&ec->lock);
12561256
}
12571257

1258-
spin_lock_irqsave(&ec->lock, flags);
1258+
spin_lock_irq(&ec->lock);
12591259
ec->events_in_progress--;
1260-
spin_unlock_irqrestore(&ec->lock, flags);
1260+
spin_unlock_irq(&ec->lock);
12611261
}
12621262

12631263
static void acpi_ec_handle_interrupt(struct acpi_ec *ec)

0 commit comments

Comments
 (0)