Merge tag 'acpi-4.20-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Oct 2018 16:15:31 +0000 (09:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Oct 2018 16:15:31 +0000 (09:15 -0700)
Pull more ACPI updates from Rafael Wysocki:
 "Rework the handling of the P-unit semaphore on Intel Baytrail and
  Cherrytrail systems to avoid race conditions and excessive overhead
  related to it (Hans de Goede)"

* tag 'acpi-4.20-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / PMIC: xpower: Add depends on IOSF_MBI to Kconfig entry
  i2c: designware: Cleanup bus lock handling
  ACPI / PMIC: xpower: Block P-Unit I2C access during read-modify-write
  x86: baytrail/cherrytrail: Rework and move P-Unit PMIC bus semaphore code

1  2 
drivers/i2c/busses/i2c-designware-baytrail.c
drivers/i2c/busses/i2c-designware-common.c
drivers/i2c/busses/i2c-designware-core.h
drivers/i2c/busses/i2c-designware-platdrv.c

index 9ca1feaba98f8afa0ee9fc4e9eb3bc85caab5357,971b5cde7a93a1d42caf579878548a08c030c9e7..33da07d6449475317385bcc3b72eede8fd52d561
@@@ -162,18 -36,9 +36,9 @@@ int i2c_dw_probe_lock_support(struct dw
                return -EPROBE_DEFER;
  
        dev_info(dev->dev, "I2C bus managed by PUNIT\n");
-       dev->acquire_lock = baytrail_i2c_acquire;
-       dev->release_lock = baytrail_i2c_release;
+       dev->acquire_lock = iosf_mbi_block_punit_i2c_access;
+       dev->release_lock = iosf_mbi_unblock_punit_i2c_access;
 -      dev->pm_disabled = true;
 +      dev->shared_with_punit = true;
  
-       pm_qos_add_request(&dev->pm_qos, PM_QOS_CPU_DMA_LATENCY,
-                          PM_QOS_DEFAULT_VALUE);
        return 0;
  }
- void i2c_dw_remove_lock_support(struct dw_i2c_dev *dev)
- {
-       if (dev->acquire_lock)
-               pm_qos_remove_request(&dev->pm_qos);
- }
index 9ec8394f47878e9058dc7b467ba0e044baef6394,152bf56d84044d4e4b28c8ca66a43c6ff18db6fe..b4a0b2b99a7821da40a21c396442436a41fedc07
   * @fp_lcnt: fast plus LCNT value
   * @hs_hcnt: high speed HCNT value
   * @hs_lcnt: high speed LCNT value
-  * @pm_qos: pm_qos_request used while holding a hardware lock on the bus
   * @acquire_lock: function to acquire a hardware lock on the bus
   * @release_lock: function to release a hardware lock on the bus
 - * @pm_disabled: true if power-management should be disabled for this i2c-bus
 + * @shared_with_punit: true if this bus is shared with the SoCs PUNIT
   * @disable: function to disable the controller
   * @disable_int: function to disable all interrupts
   * @init: function to initialize the I2C hardware
@@@ -263,10 -260,9 +261,9 @@@ struct dw_i2c_dev 
        u16                     fp_lcnt;
        u16                     hs_hcnt;
        u16                     hs_lcnt;
-       struct pm_qos_request   pm_qos;
-       int                     (*acquire_lock)(struct dw_i2c_dev *dev);
-       void                    (*release_lock)(struct dw_i2c_dev *dev);
+       int                     (*acquire_lock)(void);
+       void                    (*release_lock)(void);
 -      bool                    pm_disabled;
 +      bool                    shared_with_punit;
        void                    (*disable)(struct dw_i2c_dev *dev);
        void                    (*disable_int)(struct dw_i2c_dev *dev);
        int                     (*init)(struct dw_i2c_dev *dev);