1. 28 11月, 2017 1 次提交
  2. 18 10月, 2017 1 次提交
  3. 05 10月, 2017 2 次提交
    • R
      PM: i2c-designware-platdrv: Suspend/resume at the late/early stages · 54152772
      Rafael J. Wysocki 提交于
      As reported by Rajat Jain, there are problems when ACPI operation
      region handlers or similar, called at the ->resume_early() time, for
      I2C client devices try to access an I2C controller that has already
      been suspended at that point.  To avoid that, move the suspend/resume
      of i2c-designware-platdrv to the late/early stages, respectively.
      
      While at it, avoid resuming the device from runtime suspend in the
      driver's ->suspend callback which isn't particularly nice.  [A better
      approach would be to make the driver track the PM state of the device
      so that it doesn't need to resume it in ->suspend, so implement it.]
      
      First, drop dw_i2c_plat_suspend() added by commit a23318fe (i2c:
      designware: Fix system suspend) and rename dw_i2c_plat_runtime_suspend()
      back to dw_i2c_plat_suspend().
      
      Second, point the driver's ->late_suspend and ->early_resume
      callbacks, rather than its ->suspend and ->resume callbacks,
      to dw_i2c_plat_suspend() and dw_i2c_plat_resume(), respectively,
      so that they are not executed in parallel with each other, for
      example if runtime resume of the device takes place during system
      suspend.
      
      Finally, add "suspended" and "skip_resume" flags to struct dw_i2c_dev
      and make dw_i2c_plat_suspend() and dw_i2c_plat_resume() use them to
      avoid suspending or resuming the device twice in a row and to avoid
      resuming a previously runtime-suspended device during system resume.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Tested-by: NJohannes Stezenbach <js@sig21.net>
      Tested-by: NRajat Jain <rajatja@google.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      54152772
    • R
      PM: i2c-designware-platdrv: Clean up PM handling in probe · 126dbc6b
      Rafael J. Wysocki 提交于
      The power management handling in dw_i2c_plat_probe() is somewhat
      messy and it is rather hard to figure out the code intention for
      the case when pm_disabled is set.  In that case, the driver doesn't
      enable runtime PM at all, but in addition to that it calls
      pm_runtime_forbid() as though it wasn't sure if runtime PM might
      be enabled for the device later by someone else.
      
      Although that concern doesn't seem to be actually valid, the
      device is clearly still expected to be PM-capable even in the
      pm_disabled set case, so a better approach would be to enable
      runtime PM for it unconditionally and prevent it from being
      runtime-suspended by using pm_runtime_get_noresume().
      
      Make the driver do that.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      126dbc6b
  4. 01 9月, 2017 1 次提交
  5. 15 8月, 2017 2 次提交
    • J
      i2c: designware: Fix standard mode speed when configuring the slave mode · 4e2d93de
      Jarkko Nikula 提交于
      Code sets bit DW_IC_CON_SPEED_FAST (0x4) always when configuring the slave
      mode. This results incorrect register value DW_IC_CON_SPEED_HIGH (0x6)
      when OR'ed together with DW_IC_CON_SPEED_STD (0x2).
      
      Remove this and let the code set the speed mode bits according to clock
      frequency or default to fast mode.
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      4e2d93de
    • U
      i2c: designware: Fix system suspend · a23318fe
      Ulf Hansson 提交于
      The commit 8503ff16 ("i2c: designware: Avoid unnecessary resuming
      during system suspend"), may suggest to the PM core to try out the so
      called direct_complete path for system sleep. In this path, the PM core
      treats a runtime suspended device as it's already in a proper low power
      state for system sleep, which makes it skip calling the system sleep
      callbacks for the device, except for the ->prepare() and the ->complete()
      callbacks.
      
      However, the PM core may unset the direct_complete flag for a parent
      device, in case its child device are being system suspended before. In this
      scenario, the PM core invokes the system sleep callbacks, no matter if the
      device is runtime suspended or not.
      
      Particularly in cases of an existing i2c slave device, the above path is
      triggered, which breaks the assumption that the i2c device is always
      runtime resumed whenever the dw_i2c_plat_suspend() is being called.
      
      More precisely, dw_i2c_plat_suspend() calls clk_core_disable() and
      clk_core_unprepare(), for an already disabled/unprepared clock, leading to
      a splat in the log about clocks calls being wrongly balanced and breaking
      system sleep.
      
      To still allow the direct_complete path in cases when it's possible, but
      also to keep the fix simple, let's runtime resume the i2c device in the
      ->suspend() callback, before continuing to put the device into low power
      state.
      
      Note, in cases when the i2c device is attached to the ACPI PM domain, this
      problem doesn't occur, because ACPI's ->suspend() callback, assigned to
      acpi_subsys_suspend(), already calls pm_runtime_resume() for the device.
      
      It should also be noted that this change does not fix commit 8503ff16
      ("i2c: designware: Avoid unnecessary resuming during system suspend").
      Because for the non-ACPI case, the system sleep support was already broken
      prior that point.
      
      Cc: <stable@vger.kernel.org> # v4.4+
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NJohn Stultz <john.stultz@linaro.org>
      Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      a23318fe
  6. 31 7月, 2017 3 次提交
  7. 28 6月, 2017 1 次提交
  8. 20 6月, 2017 3 次提交
  9. 23 5月, 2017 1 次提交
  10. 22 5月, 2017 1 次提交
  11. 19 5月, 2017 1 次提交
  12. 27 4月, 2017 1 次提交
  13. 20 4月, 2017 1 次提交
  14. 22 3月, 2017 2 次提交
    • H
      i2c: designware: Disable pm for PMIC i2c-bus even if there is no _SEM method · a3d411fb
      Hans de Goede 提交于
      Cherrytrail devices use the dw i2c-bus with uid 7 to access their PMIC.
      Even if the i2c-bus to the PMIC is not shared with the SoC's P-Unit
      and i2c-designware-baytrail.c thus does not set the pm_disabled flag,
      we still need to disable pm so that ACPI PMIC opregions can access the
      PMIC during late-suspend and early-resume.
      
      This fixes errors like these blocking suspend:
      
        i2c_designware 808622C1:06: timeout waiting for bus ready
        ACPI Exception: AE_ERROR, Returned by Handler for [UserDefinedRegion]
        acpi 80860F14:02: Failed to change power state to D3hot
        PM: late suspend of devices failed
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      a3d411fb
    • H
      i2c: designware: Never suspend i2c-busses used for accessing the system PMIC · 41c80b8a
      Hans de Goede 提交于
      Currently we are already setting a pm_runtime_disabled flag and disabling
      runtime-pm for i2c-busses used for accessing the system PMIC on x86.
      But this is not enough, there are ACPI opregions which may want to access
      the PMIC during late-suspend and early-resume, so we need to completely
      disable pm to be safe.
      
      This commit renames the flag from pm_runtime_disabled to pm_disabled and
      adds the following new behavior if the flag is set:
      
      1) Call dev_pm_syscore_device(dev, true) which disables normal suspend /
         resume and remove the pm_runtime_disabled check from dw_i2c_plat_resume
         since that will now never get called. This fixes suspend_late handlers
         which use ACPI PMIC opregions causing errors like these:
      
        PM: Suspending system (freeze)
        PM: suspend of devices complete after 1127.751 msecs
        i2c_designware 808622C1:06: timeout waiting for bus ready
        ACPI Exception: AE_ERROR, Returned by Handler for [UserDefinedRegion]
        acpi 80860F14:02: Failed to change power state to D3hot
        PM: late suspend of devices failed
      
      2) Set IRQF_NO_SUSPEND irq flag. This fixes resume_early handlers which
         handlers which use ACPI PMIC opregions causing errors like these:
      
        PM: resume from suspend-to-idle
        i2c_designware 808622C1:06: controller timed out
        ACPI Exception: AE_ERROR, Returned by Handler for [UserDefinedRegion]
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      41c80b8a
  15. 09 3月, 2017 1 次提交
  16. 02 3月, 2017 3 次提交
  17. 18 12月, 2016 1 次提交
  18. 30 11月, 2016 1 次提交
  19. 18 11月, 2016 2 次提交
  20. 26 8月, 2016 6 次提交
  21. 11 3月, 2016 1 次提交
  22. 10 1月, 2016 1 次提交
  23. 07 1月, 2016 1 次提交
  24. 05 1月, 2016 1 次提交
  25. 13 12月, 2015 1 次提交