[PATCH 0/7] regulator: Set PROBE_PREFER_ASYNCHRONOUS for everything in drivers/regulator

From: Douglas Anderson
Date: Thu Mar 16 2023 - 15:55:21 EST


This series directly follows from the discussion when I tried to turn
on PROBE_PREFER_ASYNCHRONOUS just for the fixed-regulator [1] and
attempts to switch everything in drivers/regulator over to async
probe.

Like the similar patch series I did for the MMC subsystem a few years
ago [2], I've split this patch series into batches corresponding to
drivers corresponding to actively maintained stable kernel trees with
the idea to break the patch series up somewhat.

Most of the description of this series is contained in the first patch
of the series and then the further patches simply refer back to the
first one. The logic and reasoning behind all the patches is exactly
the same.

As talked about in the first patch, it wouldn't be at all shocking if
this broke someone. Hopefully this doesn't cause too much of a
problem. Most of the problems expected would be real underlying bugs
that already existed and were just tickled by this change. If you're
facing a problem, it's fairly easy to force individual drivers back to
"synchronous" probing while the problem is tracked down and fixed.

I am opting _not_ to CC every single person involved in each of these
regulators on this patch series because I suspect that the mailing
lists couldn't handle CCing that many people. This should be on LKML
so hopefully people can find it there and respond to it that
way. Anyone who responds will get CCed on future versions, if there
are any.

For reference, the ugly script I used is here:
import os
import re

for filename in os.listdir("."):
found_subsys = False
found_driver = False
output = []
for line in open(filename, "r").readlines():
if "struct platform_driver" in line or \
"struct i2c_driver" in line or \
"struct spmi_driver" in line or \
"struct spi_driver" in line:
found_subsys = True
if found_subsys and re.search(r"\t\.driver\s*=\s*{", line):
found_driver = True
found_subsys = False
mo = re.search(r"(\s*)\.name(\s*)=", line)
if found_driver and mo:
if not line.endswith(",\n"):
line = line[:-1] + ",\n"
output.append(line)

if mo.group(2) == " ":
space = " "
elif mo.group(2) == "\t":
# Best we can do
space = " "
elif mo.group(2).startswith("\t"):
# Guess that removing one tab is right
space = mo.group(2)[1:]
else:
# Guess it's all spaces
space = mo.group(2)[7:] + " "

output.append("%s.probe_type%s= PROBE_PREFER_ASYNCHRONOUS,\n" % (mo.group(1), space))
found_driver = False
else:
output.append(line)

open(filename, "w").write("".join(output))

I manually split drivers up into groups based on the kernel they were
introduced in.

I've run a compile test against "allyesconfig" on amd64, arm32, and
arm64 with this and confirmed it compiled. I've booted this on a
sc7180-trogdor-lazor board and confirmed it booted OK and got the boot
speed improvements I expected and that dmesg was as expected.

[1] https://lore.kernel.org/r/06db017f-e985-4434-8d1d-02ca2100cca0@xxxxxxxxxxxxx
[2] https://lore.kernel.org/r/20200903232441.2694866-1-dianders@xxxxxxxxxxxx/


Douglas Anderson (7):
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in
4.14
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 4.14 and
4.19
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 4.19 and
5.4
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 5.4 and
5.10
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 5.10 and
5.15
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 5.15 and
6.1
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that are newer
than 6.1

drivers/regulator/88pg86x.c | 1 +
drivers/regulator/88pm800-regulator.c | 1 +
drivers/regulator/88pm8607.c | 1 +
drivers/regulator/aat2870-regulator.c | 1 +
drivers/regulator/ab8500-ext.c | 1 +
drivers/regulator/ab8500.c | 1 +
drivers/regulator/act8865-regulator.c | 1 +
drivers/regulator/act8945a-regulator.c | 1 +
drivers/regulator/ad5398.c | 1 +
drivers/regulator/anatop-regulator.c | 1 +
drivers/regulator/arizona-ldo1.c | 2 ++
drivers/regulator/arizona-micsupp.c | 2 ++
drivers/regulator/as3711-regulator.c | 1 +
drivers/regulator/as3722-regulator.c | 1 +
drivers/regulator/atc260x-regulator.c | 1 +
drivers/regulator/axp20x-regulator.c | 1 +
drivers/regulator/bcm590xx-regulator.c | 1 +
drivers/regulator/bd71815-regulator.c | 1 +
drivers/regulator/bd71828-regulator.c | 3 ++-
drivers/regulator/bd718x7-regulator.c | 1 +
drivers/regulator/bd9571mwv-regulator.c | 1 +
drivers/regulator/bd9576-regulator.c | 1 +
drivers/regulator/cpcap-regulator.c | 1 +
drivers/regulator/cros-ec-regulator.c | 1 +
drivers/regulator/da903x-regulator.c | 1 +
drivers/regulator/da9052-regulator.c | 1 +
drivers/regulator/da9055-regulator.c | 1 +
drivers/regulator/da9062-regulator.c | 1 +
drivers/regulator/da9063-regulator.c | 1 +
drivers/regulator/da9121-regulator.c | 1 +
drivers/regulator/da9210-regulator.c | 1 +
drivers/regulator/da9211-regulator.c | 1 +
drivers/regulator/db8500-prcmu.c | 1 +
drivers/regulator/dummy.c | 1 +
drivers/regulator/fan53555.c | 1 +
drivers/regulator/fan53880.c | 1 +
drivers/regulator/fixed.c | 1 +
drivers/regulator/gpio-regulator.c | 1 +
drivers/regulator/hi6421-regulator.c | 1 +
drivers/regulator/hi6421v530-regulator.c | 1 +
drivers/regulator/hi6421v600-regulator.c | 1 +
drivers/regulator/hi655x-regulator.c | 1 +
drivers/regulator/isl6271a-regulator.c | 1 +
drivers/regulator/isl9305.c | 1 +
drivers/regulator/lm363x-regulator.c | 1 +
drivers/regulator/lochnagar-regulator.c | 1 +
drivers/regulator/lp3971.c | 1 +
drivers/regulator/lp3972.c | 1 +
drivers/regulator/lp872x.c | 1 +
drivers/regulator/lp873x-regulator.c | 1 +
drivers/regulator/lp8755.c | 1 +
drivers/regulator/lp87565-regulator.c | 1 +
drivers/regulator/lp8788-buck.c | 1 +
drivers/regulator/lp8788-ldo.c | 2 ++
drivers/regulator/ltc3589.c | 1 +
drivers/regulator/ltc3676.c | 1 +
drivers/regulator/max14577-regulator.c | 1 +
drivers/regulator/max1586.c | 1 +
drivers/regulator/max20086-regulator.c | 1 +
drivers/regulator/max20411-regulator.c | 1 +
drivers/regulator/max597x-regulator.c | 1 +
drivers/regulator/max77620-regulator.c | 1 +
drivers/regulator/max77650-regulator.c | 1 +
drivers/regulator/max77686-regulator.c | 1 +
drivers/regulator/max77693-regulator.c | 1 +
drivers/regulator/max77802-regulator.c | 1 +
drivers/regulator/max77826-regulator.c | 1 +
drivers/regulator/max8649.c | 1 +
drivers/regulator/max8660.c | 1 +
drivers/regulator/max8893.c | 1 +
drivers/regulator/max8907-regulator.c | 1 +
drivers/regulator/max8925-regulator.c | 1 +
drivers/regulator/max8952.c | 1 +
drivers/regulator/max8973-regulator.c | 1 +
drivers/regulator/max8997-regulator.c | 1 +
drivers/regulator/max8998.c | 1 +
drivers/regulator/mc13783-regulator.c | 1 +
drivers/regulator/mc13892-regulator.c | 1 +
drivers/regulator/mcp16502.c | 1 +
drivers/regulator/mp5416.c | 1 +
drivers/regulator/mp8859.c | 1 +
drivers/regulator/mp886x.c | 1 +
drivers/regulator/mpq7920.c | 1 +
drivers/regulator/mt6311-regulator.c | 1 +
drivers/regulator/mt6315-regulator.c | 1 +
drivers/regulator/mt6323-regulator.c | 1 +
drivers/regulator/mt6331-regulator.c | 1 +
drivers/regulator/mt6332-regulator.c | 1 +
drivers/regulator/mt6357-regulator.c | 1 +
drivers/regulator/mt6358-regulator.c | 1 +
drivers/regulator/mt6359-regulator.c | 1 +
drivers/regulator/mt6360-regulator.c | 1 +
drivers/regulator/mt6370-regulator.c | 1 +
drivers/regulator/mt6380-regulator.c | 1 +
drivers/regulator/mt6397-regulator.c | 1 +
drivers/regulator/mtk-dvfsrc-regulator.c | 1 +
drivers/regulator/palmas-regulator.c | 1 +
drivers/regulator/pbias-regulator.c | 1 +
drivers/regulator/pca9450-regulator.c | 1 +
drivers/regulator/pcap-regulator.c | 1 +
drivers/regulator/pcf50633-regulator.c | 1 +
drivers/regulator/pf8x00-regulator.c | 1 +
drivers/regulator/pfuze100-regulator.c | 1 +
drivers/regulator/pv88060-regulator.c | 1 +
drivers/regulator/pv88080-regulator.c | 1 +
drivers/regulator/pv88090-regulator.c | 1 +
drivers/regulator/pwm-regulator.c | 1 +
drivers/regulator/qcom-labibb-regulator.c | 1 +
drivers/regulator/qcom-rpmh-regulator.c | 1 +
drivers/regulator/qcom_rpm-regulator.c | 1 +
drivers/regulator/qcom_smd-regulator.c | 1 +
drivers/regulator/qcom_spmi-regulator.c | 1 +
drivers/regulator/qcom_usb_vbus-regulator.c | 1 +
drivers/regulator/rc5t583-regulator.c | 1 +
drivers/regulator/rk808-regulator.c | 3 ++-
drivers/regulator/rn5t618-regulator.c | 1 +
drivers/regulator/rpi-panel-attiny-regulator.c | 1 +
drivers/regulator/rt4801-regulator.c | 1 +
drivers/regulator/rt4831-regulator.c | 1 +
drivers/regulator/rt5033-regulator.c | 1 +
drivers/regulator/rt5120-regulator.c | 1 +
drivers/regulator/rt5190a-regulator.c | 1 +
drivers/regulator/rt5739.c | 1 +
drivers/regulator/rt5759-regulator.c | 1 +
drivers/regulator/rt6160-regulator.c | 1 +
drivers/regulator/rt6190-regulator.c | 1 +
drivers/regulator/rt6245-regulator.c | 1 +
drivers/regulator/rtmv20-regulator.c | 1 +
drivers/regulator/rtq2134-regulator.c | 1 +
drivers/regulator/rtq6752-regulator.c | 1 +
drivers/regulator/s2mpa01.c | 1 +
drivers/regulator/s2mps11.c | 1 +
drivers/regulator/s5m8767.c | 1 +
drivers/regulator/sc2731-regulator.c | 1 +
drivers/regulator/sky81452-regulator.c | 1 +
drivers/regulator/slg51000-regulator.c | 1 +
drivers/regulator/sm5703-regulator.c | 1 +
drivers/regulator/stm32-booster.c | 1 +
drivers/regulator/stm32-pwr.c | 1 +
drivers/regulator/stm32-vrefbuf.c | 1 +
drivers/regulator/stpmic1_regulator.c | 1 +
drivers/regulator/stw481x-vmmc.c | 1 +
drivers/regulator/sy7636a-regulator.c | 1 +
drivers/regulator/sy8106a-regulator.c | 1 +
drivers/regulator/sy8824x.c | 1 +
drivers/regulator/sy8827n.c | 1 +
drivers/regulator/ti-abb-regulator.c | 1 +
drivers/regulator/tps51632-regulator.c | 1 +
drivers/regulator/tps6105x-regulator.c | 1 +
drivers/regulator/tps62360-regulator.c | 1 +
drivers/regulator/tps6286x-regulator.c | 1 +
drivers/regulator/tps65023-regulator.c | 1 +
drivers/regulator/tps6507x-regulator.c | 1 +
drivers/regulator/tps65086-regulator.c | 1 +
drivers/regulator/tps65090-regulator.c | 1 +
drivers/regulator/tps65132-regulator.c | 1 +
drivers/regulator/tps65217-regulator.c | 1 +
drivers/regulator/tps65218-regulator.c | 1 +
drivers/regulator/tps65219-regulator.c | 1 +
drivers/regulator/tps6524x-regulator.c | 1 +
drivers/regulator/tps6586x-regulator.c | 1 +
drivers/regulator/tps65910-regulator.c | 1 +
drivers/regulator/tps65912-regulator.c | 1 +
drivers/regulator/tps68470-regulator.c | 1 +
drivers/regulator/twl-regulator.c | 1 +
drivers/regulator/twl6030-regulator.c | 1 +
drivers/regulator/uniphier-regulator.c | 1 +
drivers/regulator/userspace-consumer.c | 1 +
drivers/regulator/vctrl-regulator.c | 1 +
drivers/regulator/vexpress-regulator.c | 1 +
drivers/regulator/virtual.c | 1 +
drivers/regulator/vqmmc-ipq4019-regulator.c | 1 +
drivers/regulator/wm831x-dcdc.c | 4 ++++
drivers/regulator/wm831x-isink.c | 1 +
drivers/regulator/wm831x-ldo.c | 3 +++
drivers/regulator/wm8350-regulator.c | 1 +
drivers/regulator/wm8400-regulator.c | 1 +
drivers/regulator/wm8994-regulator.c | 1 +
178 files changed, 188 insertions(+), 2 deletions(-)

--
2.40.0.rc1.284.g88254d51c5-goog