]> git.baikalelectronics.ru Git - kernel.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)
commit8d06951fff4d78202705e8f7fa75efca44b856cf
tree1718fbc1c3f426f3da42d27abd5abfd7738bd7ac
parent967a806a2bc780067ddc41e3e0e39a7983dd496f
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