1. 14 4月, 2020 1 次提交
  2. 14 3月, 2020 1 次提交
  3. 05 3月, 2020 1 次提交
    • J
      regulator: Use driver_deferred_probe_timeout for regulator_init_complete_work · dca0b449
      John Stultz 提交于
      The regulator_init_complete_work logic defers the cleanup for an
      arbitrary 30 seconds of time to allow modules loaded by userland
      to start.
      
      This arbitrary timeout is similar to the
      driver_deferred_probe_timeout value, and its been suggested we
      align these so users have a method to extend the timeouts as
      needed.
      
      So this patch changes the logic to use the
      driver_deferred_probe_timeout value for the delay value if it
      is set (using a delay of 0 if it is not).
      
      Cc: linux-pm@vger.kernel.org
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Saravana Kannan <saravanak@google.com>
      Cc: Todd Kjos <tkjos@google.com>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Kevin Hilman <khilman@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Rob Herring <robh@kernel.org>
      Acked-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Link: https://lore.kernel.org/r/20200225050828.56458-7-john.stultz@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dca0b449
  4. 21 1月, 2020 1 次提交
  5. 17 1月, 2020 1 次提交
  6. 10 12月, 2019 1 次提交
    • C
      regulator: core: avoid unneeded .list_voltage calls · 6d30fc51
      Cristian Marussi 提交于
      Inside machine_constraints_voltage() a loop is in charge of verifying that
      each of the defined voltages are within the configured constraints and
      that those constraints are in fact compatible with the available voltages'
      list.
      
      When the registered regulator happens to be defined with a wide range of
      possible voltages the above O(n) loop can be costly.
      Moreover since this behaviour is triggered during the registration process,
      it means also that it can be easily triggered at probe time, slowing down
      considerably some module loading.
      
      On the other side if such wide range of voltage values happens to be also
      continuous and without discontinuity of any kind, the above potentially
      cumbersome operation is also useless.
      
      For these reasons, avoid such .list_voltage poll loop when regulator is
      described as 'continuous_voltage_range' as is, indeed, similarly already
      done inside regulator_is_supported_voltage().
      Signed-off-by: NCristian Marussi <cristian.marussi@arm.com>
      Link: https://lore.kernel.org/r/20191209125239.46054-1-cristian.marussi@arm.comSigned-off-by: NMark Brown <broonie@kernel.org>
      6d30fc51
  7. 03 12月, 2019 1 次提交
  8. 27 11月, 2019 1 次提交
  9. 15 11月, 2019 2 次提交
  10. 28 10月, 2019 2 次提交
  11. 17 9月, 2019 1 次提交
  12. 11 9月, 2019 1 次提交
  13. 04 9月, 2019 1 次提交
    • M
      regulator: Defer init completion for a while after late_initcall · 55576cf1
      Mark Brown 提交于
      The kernel has no way of knowing when we have finished instantiating
      drivers, between deferred probe and systems that build key drivers as
      modules we might be doing this long after userspace has booted. This has
      always been a bit of an issue with regulator_init_complete since it can
      power off hardware that's not had it's driver loaded which can result in
      user visible effects, the main case is powering off displays. Practically
      speaking it's not been an issue in real systems since most systems that
      use the regulator API are embedded and build in key drivers anyway but
      with Arm laptops coming on the market it's becoming more of an issue so
      let's do something about it.
      
      In the absence of any better idea just defer the powering off for 30s
      after late_initcall(), this is obviously a hack but it should mask the
      issue for now and it's no more arbitrary than late_initcall() itself.
      Ideally we'd have some heuristics to detect if we're on an affected
      system and tune or skip the delay appropriately, and there may be some
      need for a command line option to be added.
      
      Link: https://lore.kernel.org/r/20190904124250.25844-1-broonie@kernel.orgSigned-off-by: NMark Brown <broonie@kernel.org>
      Tested-by: NLee Jones <lee.jones@linaro.org>
      Cc: stable@vger.kernel.org
      55576cf1
  14. 16 8月, 2019 1 次提交
  15. 05 8月, 2019 1 次提交
  16. 05 7月, 2019 1 次提交
  17. 25 6月, 2019 2 次提交
  18. 19 6月, 2019 1 次提交
  19. 15 6月, 2019 1 次提交
  20. 31 5月, 2019 1 次提交
  21. 08 5月, 2019 1 次提交
  22. 03 5月, 2019 1 次提交
  23. 26 4月, 2019 2 次提交
  24. 05 4月, 2019 1 次提交
    • C
      regulator: core: Avoid potential deadlock on regulator_unregister · 06377301
      Charles Keepax 提交于
      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: NCharles Keepax <ckeepax@opensource.cirrus.com>
      Reviewed-by: NDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      06377301
  25. 19 3月, 2019 1 次提交
    • S
      regulator: core: fix error path for regulator_set_voltage_unlocked · 70b46491
      Steve Twiss 提交于
      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: NSteve Twiss <stwiss.opensource@diasemi.com>
      Reviewed-by: NDmitry Osipenko <digetx@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      70b46491
  26. 18 3月, 2019 1 次提交
    • M
      regulator: core: Fix application of "drop lockdep annotation in drms_uA_update()" · a48f1275
      Mark Brown 提交于
      [The original commit was sent against -next but needed to be sent as a
      bugfix, however -next had some additional changes which needed to be
      reverted.  Now everything is all in one branch applying the rest of the
      changes to fix up the merge issue -- broonie]
      
      commit e5e21f70 ("regulator: core: Take lock before applying system
      load") took the regulator lock before calling drms_uA_update() in order
      to silence a lockdep warning during regulator_register().
      
      However, we are not supposed to need locks at this point as the regulator
      is in the process of being registered, so there should be no possibility
      of concurrent access.
      
      Instead, remove the unnecessary locking and simply drop the lockdep
      annotation, since it is no longer valid.
      
      Fixes: e5e21f70 ("regulator: core: Take lock before applying system load")
      Signed-off-by: NNiklas Cassel <niklas.cassel@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      a48f1275
  27. 22 2月, 2019 1 次提交
  28. 19 2月, 2019 2 次提交
  29. 16 2月, 2019 1 次提交
    • N
      regulator: core: Take lock before applying system load · e5e21f70
      Niklas Cassel 提交于
      Take the regulator lock before applying system load.
      
      Fixes the following lockdep splat:
      
      [    5.583581] WARNING: CPU: 1 PID: 16 at drivers/regulator/core.c:925 drms_uA_update+0x114/0x360
      [    5.588467] Modules linked in:
      [    5.596833] CPU: 1 PID: 16 Comm: kworker/1:0 Not tainted 5.0.0-rc6-next-20190213-00002-g0fce66ab480f #18
      [    5.599933] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT)
      [    5.609544] Workqueue: events qcom_channel_state_worker
      [    5.616209] pstate: 60000005 (nZCv daif -PAN -UAO)
      [    5.621152] pc : drms_uA_update+0x114/0x360
      [    5.626006] lr : drms_uA_update+0x110/0x360
      [    5.630084] sp : ffff0000124b3490
      [    5.634242] x29: ffff0000124b3490 x28: ffff800005326e00
      [    5.637735] x27: ffff0000124b35f8 x26: 000000000032bc48
      [    5.643117] x25: ffff800004c7e800 x24: ffff800004c6d500
      [    5.648411] x23: ffff800004c38a80 x22: 00000000000000d1
      [    5.653706] x21: 00000000001ab3f0 x20: ffff800004c7e800
      [    5.659001] x19: ffff0000114c3000 x18: ffffffffffffffff
      [    5.664297] x17: 0000000000000000 x16: 0000000000000000
      [    5.669592] x15: ffff0000114c3808 x14: 0720072007200720
      [    5.674888] x13: 00000000199c9b28 x12: ffff80002bcccc40
      [    5.680183] x11: ffff000012286000 x10: ffff0000114c3808
      [    5.685477] x9 : 0720072007200720 x8 : ffff000010e9e808
      [    5.690772] x7 : ffff0000106da568 x6 : 0000000000000000
      [    5.696067] x5 : 0000000000000000 x4 : 0000000000000000
      [    5.701362] x3 : 0000000000000004 x2 : 0000000000000000
      [    5.706658] x1 : 0000000000000000 x0 : 0000000000000000
      [    5.711952] Call trace:
      [    5.717223]  drms_uA_update+0x114/0x360
      [    5.719405]  regulator_register+0xb30/0x1140
      [    5.723230]  devm_regulator_register+0x4c/0xa8
      [    5.727745]  rpm_reg_probe+0xfc/0x1b0
      [    5.731992]  platform_drv_probe+0x50/0xa0
      [    5.735727]  really_probe+0x20c/0x2b8
      [    5.739718]  driver_probe_device+0x58/0x100
      [    5.743368]  __device_attach_driver+0x90/0xd0
      [    5.747363]  bus_for_each_drv+0x64/0xc8
      [    5.751870]  __device_attach+0xd8/0x138
      [    5.755516]  device_initial_probe+0x10/0x18
      [    5.759341]  bus_probe_device+0x98/0xa0
      [    5.763502]  device_add+0x3d0/0x640
      [    5.767319]  of_device_add+0x48/0x58
      [    5.770793]  of_platform_device_create_pdata+0xb0/0x128
      [    5.774629]  of_platform_bus_create+0x174/0x370
      [    5.779569]  of_platform_populate+0x78/0xe0
      [    5.784082]  qcom_smd_rpm_probe+0x80/0xa0
      [    5.788245]  rpmsg_dev_probe+0x114/0x1a0
      [    5.792411]  really_probe+0x20c/0x2b8
      [    5.796401]  driver_probe_device+0x58/0x100
      [    5.799964]  __device_attach_driver+0x90/0xd0
      [    5.803960]  bus_for_each_drv+0x64/0xc8
      [    5.808468]  __device_attach+0xd8/0x138
      [    5.812115]  device_initial_probe+0x10/0x18
      [    5.815936]  bus_probe_device+0x98/0xa0
      [    5.820099]  device_add+0x3d0/0x640
      [    5.823916]  device_register+0x1c/0x28
      [    5.827391]  rpmsg_register_device+0x4c/0x90
      [    5.831216]  qcom_channel_state_worker+0x170/0x298
      [    5.835651]  process_one_work+0x294/0x6e8
      [    5.840241]  worker_thread+0x40/0x450
      [    5.844318]  kthread+0x11c/0x120
      [    5.847961]  ret_from_fork+0x10/0x18
      [    5.851260] irq event stamp: 9090
      [    5.854820] hardirqs last  enabled at (9089): [<ffff000010160798>] console_unlock+0x3e0/0x5b0
      [    5.858086] hardirqs last disabled at (9090): [<ffff0000100817cc>] do_debug_exception+0x104/0x140
      [    5.866596] softirqs last  enabled at (9086): [<ffff000010082024>] __do_softirq+0x474/0x574
      [    5.875446] softirqs last disabled at (9079): [<ffff0000100f2254>] irq_exit+0x13c/0x148
      [    5.883598] ---[ end trace 6984ef7f081afa21 ]---
      
      Fixes: fa94e48e ("regulator: core: Apply system load even if no consumer loads")
      Signed-off-by: NNiklas Cassel <niklas.cassel@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      e5e21f70
  30. 08 2月, 2019 1 次提交
  31. 07 2月, 2019 1 次提交
  32. 06 2月, 2019 1 次提交
    • L
      regulator: fixed/gpio: Pull inversion/OD into gpiolib · 01dc79cd
      Linus Walleij 提交于
      This pushes the handling of inversion semantics and open drain
      settings to the GPIO descriptor and gpiolib. All affected board
      files are also augmented.
      
      This is especially nice since we don't have to have any
      confusing flags passed around to the left and right littering
      the fixed and GPIO regulator drivers and the regulator core.
      It is all just very straight-forward: the core asks the GPIO
      line to be asserted or deasserted and gpiolib deals with the
      rest depending on how the platform is configured: if the line
      is active low, it deals with that, if the line is open drain,
      it deals with that too.
      
      Cc: Alexander Shiyan <shc_work@mail.ru> # i.MX boards user
      Cc: Haojian Zhuang <haojian.zhuang@gmail.com> # MMP2 maintainer
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi> # OMAP1 maintainer
      Cc: Tony Lindgren <tony@atomide.com> # OMAP1,2,3 maintainer
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> # EM-X270 maintainer
      Cc: Robert Jarzmik <robert.jarzmik@free.fr> # EZX maintainer
      Cc: Philipp Zabel <philipp.zabel@gmail.com> # Magician maintainer
      Cc: Petr Cvek <petr.cvek@tul.cz> # Magician
      Cc: Robert Jarzmik <robert.jarzmik@free.fr> # PXA
      Cc: Paul Parsons <lost.distance@yahoo.com> # hx4700
      Cc: Daniel Mack <zonque@gmail.com> # Raumfeld maintainer
      Cc: Marc Zyngier <marc.zyngier@arm.com> # Zeus maintainer
      Cc: Geert Uytterhoeven <geert+renesas@glider.be> # SuperH pinctrl/GPIO maintainer
      Cc: Russell King <rmk+kernel@armlinux.org.uk> # SA1100
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Tested-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> #OMAP1 Amstrad Delta
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      01dc79cd
  33. 10 1月, 2019 1 次提交
  34. 08 1月, 2019 1 次提交
  35. 20 12月, 2018 1 次提交