]> asedeno.scripts.mit.edu Git - linux.git/commit
ACPI / PMIC: xpower: Block P-Unit I2C access during read-modify-write
authorHans de Goede <hdegoede@redhat.com>
Thu, 11 Oct 2018 14:29:10 +0000 (16:29 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 25 Oct 2018 15:00:05 +0000 (17:00 +0200)
commit3c670dba864d9ab0a23612a93b7d98700734bd44
tree1718fbc1c3f426f3da42d27abd5abfd7738bd7ac
parente09db3d241f8d594381b6e5f2ca0f72ffcce478a
ACPI / PMIC: xpower: Block P-Unit I2C access during read-modify-write

intel_xpower_pmic_update_power() does a read-modify-write of the output
control register. The i2c-designware code blocks the P-Unit I2C access
during the read and write by taking the P-Unit's PMIC bus semaphore.
But between the read and the write that semaphore is released and the
P-Unit could make changes to the register which we then end up overwriting.

This commit makes intel_xpower_pmic_update_power() take the semaphore
itself so that it is held over the entire read-modify-write, avoiding this
race.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/pmic/intel_pmic_xpower.c