Skip to content

Commit

Permalink
ACPI: remove locking from PM1x_STS register reads
Browse files Browse the repository at this point in the history
PM1a_STS and PM1b_STS are twins that get OR'd together
on reads, and all writes are repeated to both.

The fields in PM1x_STS are single bits only,
there are no multi-bit fields.

So it is not necessary to lock PM1x_STS reads against
writes because it is impossible to read an intermediate
value of a single bit.  It will either be 0 or 1,
even if a write is in progress during the read.
Reads are asynchronous to writes no matter if a lock
is used or not.

Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Len Brown committed Jan 28, 2009
1 parent 152a649 commit a2b7b01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static void acpi_processor_idle(void)

pr->power.bm_activity <<= diff;

acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
acpi_get_register_unlocked(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
if (bm_status) {
pr->power.bm_activity |= 0x1;
acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
Expand Down Expand Up @@ -1383,7 +1383,7 @@ static int acpi_idle_bm_check(void)
{
u32 bm_status = 0;

acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
acpi_get_register_unlocked(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
if (bm_status)
acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
/*
Expand Down

0 comments on commit a2b7b01

Please sign in to comment.