Probing of regulators can be a slow operation and can contribute to
slower boot times. This is especially true if a regulator is turned on
at probe time (with regulator-boot-on or regulator-always-on) and the
regulator requires delays (off-on-time, ramp time, etc).
While the overall kernel is not ready to switch to async probe by
default, as per the discussion on the mailing lists [1] it is believed
that the regulator subsystem is in good shape and we can move
regulator drivers over wholesale. There is no way to just magically
opt in all regulators (regulators are just normal drivers like
platform_driver), so we set PROBE_PREFER_ASYNCHRONOUS for all
regulators found in 'drivers/regulator' individually.
Given the number of drivers touched and the impossibility to test this
ahead of time, it wouldn't be shocking at all if this caused a
regression for someone. If there is a regression caused by this patch,
it's likely to be one of the cases talked about in [1]. As a "quick
fix", drivers involved in the regression could be fixed by changing
them to PROBE_FORCE_SYNCHRONOUS. That being said, the correct fix
would be to directly fix the problem that caused the issue with async
probe.
The approach here follows a similar approach that was used for the mmc
subsystem several years ago [2]. In fact, I ran nearly the same python
script to auto-generate the changes. The only thing I changed was to
search for "i2c_driver", "spmi_driver", and "spi_driver" in addition
to "platform_driver".
[1] https://lore.kernel.org/r/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk
[2] https://lore.kernel.org/r/20200903232441.2694866-1-dianders@chromium.org/
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230316125351.1.I2a4677392a38db5758dee0788b2cea5872562a82@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>
A small set of fixes for mostly minor issues here, the only real code
ones are Wen Yang's fixes for error handling in the core and Christian
Marussi's list_voltage() change which is a fix for disruptively bad
performance for regulators with continuous voltage control (which are
rare).
-----BEGIN PGP SIGNATURE-----
iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl34yr4THGJyb29uaWVA
a2VybmVsLm9yZwAKCRAk1otyXVSH0KJyB/97dTSIk+gJxwFSc9tTPbMvSGvGqoEL
AUE8JSHVNqav9IdFKwtzxa6dnjVy1U23ySemeOAvabmLmyJjoIRMJAeA10+OwcMl
2dq3j/3z6Vl305QSVNu3yMcxp2XtQ8nhKOpNz+rDGwRAvr08YBjdrCPv4dbiv/ei
G7z7sOwcNNACE7CNGat3kOh9cOJm3wVzls1bF5Ix+kDlWH6v591GSY1MMXdhx6Tj
RS9HCjj8Gp4O+vnJH4r/AVkOyZp8SOSOje/+81pF68wc2g+S7XV8hE4kDipRlHS3
4aKpBbfyA4twjZ4AOCVGTwJrGXh6W7GhDlrbWCYyQ3y2hOfwgbh8sKzo
=Lx6m
-----END PGP SIGNATURE-----
Merge tag 'regulator-fix-v5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown:
"A small set of fixes for mostly minor issues here, the only real code
ones are Wen Yang's fixes for error handling in the core and Christian
Marussi's list_voltage() change which is a fix for disruptively bad
performance for regulators with continuous voltage control (which are
rare)"
* tag 'regulator-fix-v5.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: rn5t618: fix module aliases
regulator: max77650: add of_match table
regulator: core: avoid unneeded .list_voltage calls
regulator: s5m8767: Fix a warning message
regulator: core: fix regulator_register() error paths to properly release rdev
regulator: fix use after free issue
platform device aliases were missing, preventing
autoloading of module.
Fixes: 811b700630 ("regulator: rn5t618: add driver for Ricoh RN5T618 regulators")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://lore.kernel.org/r/20191211221600.29438-1-andreas@kemnade.info
Signed-off-by: Mark Brown <broonie@kernel.org>
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation you should have received a
copy of the gnu general public license along with this program if
not see http www gnu org licenses
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 30 file(s).
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190531190115.962665879@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The regulator_desc never need to be modified, so define them as const as a
hint to the compiler that they can go into .rodata.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The regulator_desc arrays in this driver are indexed by RN5T618_*
constants and some elements can be missing. This causes probe failures
on older models:
rn5t618-regulator rn5t618-regulator: failed to register (null) regulator
rn5t618-regulator: probe of rn5t618-regulator failed with error -22
Fix this by making the arrays flat. This also saves a little memory
because the regulator_desc arrays become smaller.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Fixes: 83b2a3c2ab ("regulator: rn5t618: add RC5T619 PMIC support")
Signed-off-by: Mark Brown <broonie@kernel.org>
Extend the driver to support Ricoh RC5T619.
Support the additional regulators and slightly different voltage ranges.
Signed-off-by: Pierre-Hugues Husson <phh@phh.me>
Signed-off-by: Mark Brown <broonie@kernel.org>
Declare regulator_ops structure as const as it is only stored in the ops
field of a regulator_desc structure. This field is of type const, so
regulator_ops structures having this property can be made const too.
File size before: drivers/regulator/rn5t618-regulator.o
text data bss dec hex filename
375 5392 0 5767 1687 regulator/rn5t618-regulator.o
File size after: drivers/regulator/rn5t618-regulator.o
text data bss dec hex filename
631 5136 0 5767 1687 regulator/rn5t618-regulator.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Extend the driver to support Ricoh RN5T567. Support the additional
DCDC and slightly different voltage range of LDORTC1.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Use the simplified DT parsing method to remove some duplicated
code.
Since this is a MFD subdevice and its device object doesn't have an
associated DT node, the configuration instance used to register the
regulators has been changed to point to the parent device.
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This driver supports the 3 DCDC and 7 LDO regulators available on
Ricoh RN5T618 PMIC.
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>