Skip to content

Commit 259b93b

Browse files
diandersbroonie
authored andcommitted
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14
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>
1 parent 691c1fc commit 259b93b

114 files changed

Lines changed: 121 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/regulator/88pm800-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
274274
static struct platform_driver pm800_regulator_driver = {
275275
.driver = {
276276
.name = "88pm80x-regulator",
277+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
277278
},
278279
.probe = pm800_regulator_probe,
279280
};

drivers/regulator/88pm8607.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ MODULE_DEVICE_TABLE(platform, pm8607_regulator_driver_ids);
383383
static struct platform_driver pm8607_regulator_driver = {
384384
.driver = {
385385
.name = "88pm860x-regulator",
386+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
386387
},
387388
.probe = pm8607_regulator_probe,
388389
.id_table = pm8607_regulator_driver_ids,

drivers/regulator/aat2870-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
178178
static struct platform_driver aat2870_regulator_driver = {
179179
.driver = {
180180
.name = "aat2870-regulator",
181+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
181182
},
182183
.probe = aat2870_regulator_probe,
183184
};

drivers/regulator/ab8500-ext.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ static struct platform_driver ab8500_ext_regulator_driver = {
446446
.probe = ab8500_ext_regulator_probe,
447447
.driver = {
448448
.name = "ab8500-ext-regulator",
449+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
449450
},
450451
};
451452

drivers/regulator/ab8500.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@ static struct platform_driver ab8500_regulator_driver = {
17371737
.probe = ab8500_regulator_probe,
17381738
.driver = {
17391739
.name = "ab8500-regulator",
1740+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
17401741
},
17411742
};
17421743

drivers/regulator/act8865-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ MODULE_DEVICE_TABLE(i2c, act8865_ids);
789789
static struct i2c_driver act8865_pmic_driver = {
790790
.driver = {
791791
.name = "act8865",
792+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
792793
},
793794
.probe_new = act8865_pmic_probe,
794795
.id_table = act8865_ids,

drivers/regulator/act8945a-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ static void act8945a_pmic_shutdown(struct platform_device *pdev)
348348
static struct platform_driver act8945a_pmic_driver = {
349349
.driver = {
350350
.name = "act8945a-regulator",
351+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
351352
.pm = &act8945a_pm,
352353
},
353354
.probe = act8945a_pmic_probe,

drivers/regulator/ad5398.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ static struct i2c_driver ad5398_driver = {
257257
.probe_new = ad5398_probe,
258258
.driver = {
259259
.name = "ad5398",
260+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
260261
},
261262
.id_table = ad5398_id,
262263
};

drivers/regulator/anatop-regulator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ MODULE_DEVICE_TABLE(of, of_anatop_regulator_match_tbl);
328328
static struct platform_driver anatop_regulator_driver = {
329329
.driver = {
330330
.name = "anatop_regulator",
331+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
331332
.of_match_table = of_anatop_regulator_match_tbl,
332333
},
333334
.probe = anatop_regulator_probe,

drivers/regulator/arizona-ldo1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ static struct platform_driver arizona_ldo1_driver = {
380380
.remove = arizona_ldo1_remove,
381381
.driver = {
382382
.name = "arizona-ldo1",
383+
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
383384
},
384385
};
385386

0 commit comments

Comments
 (0)