1. 23 10月, 2021 1 次提交
  2. 30 9月, 2021 1 次提交
  3. 13 9月, 2021 1 次提交
  4. 21 6月, 2021 3 次提交
  5. 02 6月, 2021 1 次提交
  6. 01 6月, 2021 1 次提交
  7. 21 5月, 2021 1 次提交
  8. 23 4月, 2021 1 次提交
    • V
      regulator: core: Fix off_on_delay handling · a8ce7bd8
      Vincent Whitchurch 提交于
      The jiffies-based off_on_delay implementation has a couple of problems
      that cause it to sometimes not actually delay for the required time:
      
       (1) If, for example, the off_on_delay time is equivalent to one jiffy,
           and the ->last_off_jiffy is set just before a new jiffy starts,
           then _regulator_do_enable() does not wait at all since it checks
           using time_before().
      
       (2) When jiffies overflows, the value of "remaining" becomes higher
           than "max_delay" and the code simply proceeds without waiting.
      
      Fix these problems by changing it to use ktime_t instead.
      
      [Note that since jiffies doesn't start at zero but at INITIAL_JIFFIES
       ("-5 minutes"), (2) above also led to the code not delaying if
       the first regulator_enable() is called when the ->last_off_jiffy is not
       initialised, such as for regulators with ->constraints->boot_on set.
       It's not clear to me if this was intended or not, but I've preserved
       this behaviour explicitly with the check for a non-zero ->last_off.]
      Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com>
      Link: https://lore.kernel.org/r/20210423114524.26414-1-vincent.whitchurch@axis.comSigned-off-by: NMark Brown <broonie@kernel.org>
      a8ce7bd8
  9. 22 4月, 2021 1 次提交
  10. 21 4月, 2021 2 次提交
  11. 25 1月, 2021 1 次提交
    • H
      regulator: core: Avoid debugfs: Directory ... already present! error · dbe954d8
      Hans de Goede 提交于
      Sometimes regulator_get() gets called twice for the same supply on the
      same device. This may happen e.g. when a framework / library is used
      which uses the regulator; and the driver itself also needs to enable
      the regulator in some cases where the framework will not enable it.
      
      Commit ff268b56 ("regulator: core: Don't spew backtraces on
      duplicate sysfs") already takes care of the backtrace which would
      trigger when creating a duplicate consumer symlink under
      /sys/class/regulator/regulator.%d in this scenario.
      
      Commit c33d4423 ("debugfs: make error message a bit more verbose")
      causes a new error to get logged in this scenario:
      
      [   26.938425] debugfs: Directory 'wm5102-codec-MICVDD' with parent 'spi-WM510204:00-MICVDD' already present!
      
      There is no _nowarn variant of debugfs_create_dir(), but we can detect
      and avoid this problem by checking the return value of the earlier
      sysfs_create_link_nowarn() call.
      
      Add a check for the earlier sysfs_create_link_nowarn() failing with
      -EEXIST and skip the debugfs_create_dir() call in that case, avoiding
      this error getting logged.
      
      Fixes: c33d4423 ("debugfs: make error message a bit more verbose")
      Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NCharles Keepax <ckeepax@opensource.cirrus.com>
      Link: https://lore.kernel.org/r/20210122183250.370571-1-hdegoede@redhat.comSigned-off-by: NMark Brown <broonie@kernel.org>
      dbe954d8
  12. 23 1月, 2021 1 次提交
  13. 22 1月, 2021 1 次提交
  14. 09 1月, 2021 1 次提交
    • D
      regulator: core: avoid regulator_resolve_supply() race condition · eaa7995c
      David Collins 提交于
      The final step in regulator_register() is to call
      regulator_resolve_supply() for each registered regulator
      (including the one in the process of being registered).  The
      regulator_resolve_supply() function first checks if rdev->supply
      is NULL, then it performs various steps to try to find the supply.
      If successful, rdev->supply is set inside of set_supply().
      
      This procedure can encounter a race condition if two concurrent
      tasks call regulator_register() near to each other on separate CPUs
      and one of the regulators has rdev->supply_name specified.  There
      is currently nothing guaranteeing atomicity between the rdev->supply
      check and set steps.  Thus, both tasks can observe rdev->supply==NULL
      in their regulator_resolve_supply() calls.  This then results in
      both creating a struct regulator for the supply.  One ends up
      actually stored in rdev->supply and the other is lost (though still
      present in the supply's consumer_list).
      
      Here is a kernel log snippet showing the issue:
      
      [   12.421768] gpu_cc_gx_gdsc: supplied by pm8350_s5_level
      [   12.425854] gpu_cc_gx_gdsc: supplied by pm8350_s5_level
      [   12.429064] debugfs: Directory 'regulator.4-SUPPLY' with parent
                     '17a00000.rsc:rpmh-regulator-gfxlvl-pm8350_s5_level'
                     already present!
      
      Avoid this race condition by holding the rdev->mutex lock inside
      of regulator_resolve_supply() while checking and setting
      rdev->supply.
      Signed-off-by: NDavid Collins <collinsd@codeaurora.org>
      Link: https://lore.kernel.org/r/1610068562-4410-1-git-send-email-collinsd@codeaurora.orgSigned-off-by: NMark Brown <broonie@kernel.org>
      eaa7995c
  15. 04 1月, 2021 1 次提交
  16. 26 11月, 2020 1 次提交
  17. 14 11月, 2020 3 次提交
  18. 13 11月, 2020 3 次提交
  19. 11 11月, 2020 1 次提交
  20. 03 11月, 2020 1 次提交
  21. 29 10月, 2020 1 次提交
  22. 05 10月, 2020 1 次提交
  23. 02 10月, 2020 1 次提交
    • A
      regulator: core: Enlarge max OF property name length to 64 chars · e9bb4a06
      AngeloGioacchino Del Regno 提交于
      Some regulator drivers may be defining very long names: this is the
      case with the qcom_smd and qcom_spmi regulators, where we need to
      parse the regulator parents from DT.
      
      For clarity, this is an example:
      { "l13a", QCOM_SMD_RPM_LDOA, 13, &pm660_ht_lvpldo,
        "vdd_l8_l9_l10_l11_l12_l13_l14" },
      pm660-regulators {
      	...
      	vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>
      	...
      };
      Now, with a 32 characters limit, the function is trying to parse,
      exactly, "vdd_l8_l9_l10_l11_l12_l13_l14-s" (32 chars) instead of
      the right one, which is 37 chars long in this specific case.
      
      ... And this is not only the case with PM660/PM660L, but also with
      PMA8084, PM8916, PM8950 and others that are not implemented yet.
      
      The length of 64 chars was chosen based on the longest parsed property
      name that I could find, which is in PM8916, and would be 53 characters
      long.
      At that point, rounding that to 64 looked like being the best idea.
      Signed-off-by: NAngeloGioacchino Del Regno <kholk11@gmail.com>
      Link: https://lore.kernel.org/r/20200926125549.13191-2-kholk11@gmail.comSigned-off-by: NMark Brown <broonie@kernel.org>
      e9bb4a06
  24. 29 9月, 2020 3 次提交
  25. 22 9月, 2020 2 次提交
  26. 08 9月, 2020 1 次提交
  27. 01 9月, 2020 1 次提交
  28. 24 8月, 2020 1 次提交
  29. 19 8月, 2020 2 次提交