1. 16 1月, 2020 8 次提交
  2. 15 11月, 2019 1 次提交
  3. 13 9月, 2019 1 次提交
    • J
      i2c: tegra: Move suspend handling to NOIRQ phase · 8ebf15e9
      Jon Hunter 提交于
      Commit acc8abcb ("i2c: tegra: Add suspend-resume support") added
      suspend support for the Tegra I2C driver and following this change on
      Tegra30 the following WARNING is seen on entering suspend ...
      
       WARNING: CPU: 2 PID: 689 at /dvs/git/dirty/git-master_l4t-upstream/kernel/drivers/i2c/i2c-core.h:54 __i2c_transfer+0x35c/0x70c
       i2c i2c-4: Transfer while suspended
       Modules linked in: brcmfmac brcmutil
       CPU: 2 PID: 689 Comm: rtcwake Not tainted 5.3.0-rc7-g089cf7f6 #1
       Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
       [<c0112264>] (unwind_backtrace) from [<c010ca94>] (show_stack+0x10/0x14)
       [<c010ca94>] (show_stack) from [<c0a77024>] (dump_stack+0xb4/0xc8)
       [<c0a77024>] (dump_stack) from [<c0124198>] (__warn+0xe0/0xf8)
       [<c0124198>] (__warn) from [<c01241f8>] (warn_slowpath_fmt+0x48/0x6c)
       [<c01241f8>] (warn_slowpath_fmt) from [<c06f6c40>] (__i2c_transfer+0x35c/0x70c)
       [<c06f6c40>] (__i2c_transfer) from [<c06f7048>] (i2c_transfer+0x58/0xf4)
       [<c06f7048>] (i2c_transfer) from [<c06f7130>] (i2c_transfer_buffer_flags+0x4c/0x70)
       [<c06f7130>] (i2c_transfer_buffer_flags) from [<c05bee78>] (regmap_i2c_write+0x14/0x30)
       [<c05bee78>] (regmap_i2c_write) from [<c05b9cac>] (_regmap_raw_write_impl+0x35c/0x868)
       [<c05b9cac>] (_regmap_raw_write_impl) from [<c05b984c>] (_regmap_update_bits+0xe4/0xec)
       [<c05b984c>] (_regmap_update_bits) from [<c05bad04>] (regmap_update_bits_base+0x50/0x74)
       [<c05bad04>] (regmap_update_bits_base) from [<c04d453c>] (regulator_disable_regmap+0x44/0x54)
       [<c04d453c>] (regulator_disable_regmap) from [<c04cf9d4>] (_regulator_do_disable+0xf8/0x268)
       [<c04cf9d4>] (_regulator_do_disable) from [<c04d1694>] (_regulator_disable+0xf4/0x19c)
       [<c04d1694>] (_regulator_disable) from [<c04d1770>] (regulator_disable+0x34/0x64)
       [<c04d1770>] (regulator_disable) from [<c04d2310>] (regulator_bulk_disable+0x28/0xb4)
       [<c04d2310>] (regulator_bulk_disable) from [<c0495cd4>] (tegra_pcie_power_off+0x64/0xa8)
       [<c0495cd4>] (tegra_pcie_power_off) from [<c0495f74>] (tegra_pcie_pm_suspend+0x25c/0x3f4)
       [<c0495f74>] (tegra_pcie_pm_suspend) from [<c05af48c>] (dpm_run_callback+0x38/0x1d4)
       [<c05af48c>] (dpm_run_callback) from [<c05afe30>] (__device_suspend_noirq+0xc0/0x2b8)
       [<c05afe30>] (__device_suspend_noirq) from [<c05b1c24>] (dpm_noirq_suspend_devices+0x100/0x37c)
       [<c05b1c24>] (dpm_noirq_suspend_devices) from [<c05b1ebc>] (dpm_suspend_noirq+0x1c/0x48)
       [<c05b1ebc>] (dpm_suspend_noirq) from [<c017d2c0>] (suspend_devices_and_enter+0x1d0/0xa00)
       [<c017d2c0>] (suspend_devices_and_enter) from [<c017dd10>] (pm_suspend+0x220/0x74c)
       [<c017dd10>] (pm_suspend) from [<c017c2c8>] (state_store+0x6c/0xc8)
       [<c017c2c8>] (state_store) from [<c02ef398>] (kernfs_fop_write+0xe8/0x1c4)
       [<c02ef398>] (kernfs_fop_write) from [<c0271e38>] (__vfs_write+0x2c/0x1c4)
       [<c0271e38>] (__vfs_write) from [<c02748dc>] (vfs_write+0xa4/0x184)
       [<c02748dc>] (vfs_write) from [<c0274b7c>] (ksys_write+0x9c/0xdc)
       [<c0274b7c>] (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
       Exception stack(0xe9f21fa8 to 0xe9f21ff0)
       1fa0:                   0000006c 004b2438 00000004 004b2438 00000004 00000000
       1fc0: 0000006c 004b2438 004b1228 00000004 00000004 00000004 0049e78c 004b1228
       1fe0: 00000004 be9809b8 b6f0bc0b b6e96206
      
      The problem is that the Tegra PCIe driver indirectly uses I2C for
      controlling some regulators and the I2C driver is now being suspended
      before the PCIe driver causing the PCIe suspend to fail. The Tegra PCIe
      driver is suspended during the NOIRQ phase and this cannot be changed
      due to other dependencies. Therefore, we also need to move the suspend
      handling for the Tegra I2C driver to the NOIRQ phase as well.
      
      In order to move the I2C suspend handling to the NOIRQ phase we also
      need to avoid calling pm_runtime_get/put() because per commit
      1e2ef05b ("PM: Limit race conditions between runtime PM and system
      sleep (v2)") these cannot be called early in resume. The function
      tegra_i2c_init(), called during resume, calls pm_runtime_get/put() and
      so move these calls outside of tegra_i2c_init(), so this function can
      be used during the NOIRQ resume phase.
      
      Fixes: acc8abcb ("i2c: tegra: Add suspend-resume support")
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      8ebf15e9
  4. 01 8月, 2019 1 次提交
  5. 22 6月, 2019 1 次提交
  6. 15 6月, 2019 2 次提交
    • B
      i2c: tegra: Add suspend-resume support · acc8abcb
      Bitan Biswas 提交于
      Post suspend I2C registers have power on reset values. Before any
      transfer initialize I2C registers to prevent I2C transfer timeout
      and implement suspend and resume callbacks needed. Fix below errors
      post suspend:
      
      1) Tegra I2C transfer timeout during jetson tx2 resume:
      
      [   27.520613] pca953x 1-0074: calling pca953x_resume+0x0/0x1b0 @ 2939, parent: i2c-1
      [   27.633623] tegra-i2c 3160000.i2c: i2c transfer timed out
      [   27.639162] pca953x 1-0074: Unable to sync registers 0x3-0x5. -110
      [   27.645336] pca953x 1-0074: Failed to sync GPIO dir registers: -110
      [   27.651596] PM: dpm_run_callback(): pca953x_resume+0x0/0x1b0 returns -110
      [   27.658375] pca953x 1-0074: pca953x_resume+0x0/0x1b0 returned -110 after 127152 usecs
      [   27.666194] PM: Device 1-0074 failed to resume: error -110
      
      2) Tegra I2C transfer timeout error on jetson Xavier post resume.
      
      Remove i2c bus lock-unlock calls in resume callback as i2c_mark_adapter_*
      (suspended-resumed) help ensure i2c core calls from client are not
      executed before i2c-tegra resume.
      Signed-off-by: NBitan Biswas <bbiswas@nvidia.com>
      Reviewed-by: NDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      acc8abcb
    • T
      i2c: tegra: Avoid error message on deferred probe · d680a50c
      Thierry Reding 提交于
      If the driver defers probe because of a missing clock, avoid outputting
      an error message. The clock will show up eventually.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Acked-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      d680a50c
  7. 12 6月, 2019 5 次提交
  8. 23 2月, 2019 3 次提交
  9. 16 2月, 2019 1 次提交
  10. 15 2月, 2019 7 次提交
  11. 11 1月, 2019 1 次提交
  12. 18 12月, 2018 3 次提交
  13. 12 12月, 2018 1 次提交
  14. 06 10月, 2018 1 次提交
  15. 10 7月, 2018 1 次提交
    • J
      i2c: tegra: Fix NACK error handling · 54836e2d
      Jon Hunter 提交于
      On Tegra30 Cardhu the PCA9546 I2C mux is not ACK'ing I2C commands on
      resume from suspend (which is caused by the reset signal for the I2C
      mux not being configured correctl). However, this NACK is causing the
      Tegra30 to hang on resuming from suspend which is not expected as we
      detect NACKs and handle them. The hang observed appears to occur when
      resetting the I2C controller to recover from the NACK.
      
      Commit 77821b46 ("i2c: tegra: proper handling of error cases") added
      additional error handling for some error cases including NACK, however,
      it appears that this change conflicts with an early fix by commit
      f70893d0 ("i2c: tegra: Add delay before resetting the controller
      after NACK"). After commit 77821b46 was made we now disable 'packet
      mode' before the delay from commit f70893d0 happens. Testing shows
      that moving the delay to before disabling 'packet mode' fixes the hang
      observed on Tegra30. The delay was added to give the I2C controller
      chance to send a stop condition and so it makes sense to move this to
      before we disable packet mode. Please note that packet mode is always
      enabled for Tegra.
      
      Fixes: 77821b46 ("i2c: tegra: proper handling of error cases")
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@vger.kernel.org
      54836e2d
  16. 04 7月, 2018 1 次提交
  17. 31 5月, 2018 1 次提交
    • D
      i2c: tegra: Remove suspend-resume · 535ba904
      Dmitry Osipenko 提交于
      Nothing prevents I2C clients to access I2C while Tegra's driver is being
      suspended, this results in -EBUSY error returned to the clients and that
      may have unfortunate consequences. In particular this causes problems
      for the TPS6586x MFD driver which emits hundreds of "failed to read
      interrupt status" error messages on resume from suspend. This happens if
      TPS6586X is used to wake system from suspend by the expired RTC alarm
      timer because TPS6586X is an I2C device driver and its IRQ handler reads
      the status register while Tegra's I2C driver is suspended, i.e. just after
      kernel enabled IRQ's during of resume-from-suspend process.
      
      Note that the removed tegra_i2c_resume() invoked tegra_i2c_init() which
      performs HW reset. That seems was also not entirely correct because moving
      tegra_i2c_resume to an earlier stage of resume-from-suspend process causes
      I2C transfer to fail in the case of TPS6586X. It is fine to remove the
      HW-reinitialization for now because it should be only needed in a case of
      using lowest power-mode during suspend, which upstream kernel doesn't
      support.
      Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
      Acked-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      535ba904
  18. 30 8月, 2017 1 次提交