1. 05 Apr, 2019 1 commit
    • Charles Keepax's avatar
      regulator: core: Avoid potential deadlock on regulator_unregister · 06377301
      Charles Keepax authored
      Lockdep reports the following issue on my setup:
      
      Possible unsafe locking scenario:
      
      CPU0                    CPU1
      ----                    ----
      lock((work_completion)(&(&rdev->disable_work)->work));
                              lock(regulator_list_mutex);
                              lock((work_completion)(&(&rdev->disable_work)->work));
      lock(regulator_list_mutex);
      
      The problem is that regulator_unregister takes the
      regulator_list_mutex and then calls flush_work on disable_work. But
      regulator_disable_work calls regulator_lock_dependent which will
      also take the regulator_list_mutex. Resulting in a deadlock if the
      flush_work call actually needs to flush the work.
      
      Fix this issue by moving the flush_work outside of the
      regulator_list_mutex. The list mutex is not used to guard the point at
      which the delayed work is queued, so its use adds no additional safety.
      
      Fixes: f8702f9e ("regulator: core: Use ww_mutex for regulators locking")
      Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      06377301
  2. 26 Mar, 2019 1 commit
  3. 19 Mar, 2019 1 commit
    • Steve Twiss's avatar
      regulator: core: fix error path for regulator_set_voltage_unlocked · 70b46491
      Steve Twiss authored
      During several error paths in the function
      regulator_set_voltage_unlocked() the value of 'ret' can take on negative
      error values. However, in calls that go through the 'goto out' statement,
      this return value is lost and return 0 is used instead, indicating a
      'pass'.
      
      There are several cases where this function should legitimately return a
      fail instead of a pass: one such case includes constraints check during
      voltage selection in the call to regulator_check_voltage(), which can
      have -EINVAL for the case when an unsupported voltage is incorrectly
      requested. In that case, -22 is expected as the return value, not 0.
      
      Fixes: 9243a195 ("regulator: core: Change voltage setting path")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarSteve Twiss <stwiss.opensource@diasemi.com>
      Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      70b46491
  4. 04 Mar, 2019 4 commits
  5. 03 Mar, 2019 10 commits
  6. 28 Feb, 2019 1 commit
  7. 26 Feb, 2019 11 commits
  8. 22 Feb, 2019 4 commits
  9. 21 Feb, 2019 6 commits
  10. 20 Feb, 2019 1 commit