Skip to contentSkip to conversation

power: regulator: tps62360_regulator: Convert ofdata_to_platdata to the missing probe

PATCH New Keerthy 3 participants 3 messages Jan 10, 2020 – Jan 30, 2020

lore
Share & tools
lore

Keerthy

author
#0 lore raw

PATCH 1/1 power: regulator: tps62360_regulator: Convert ofdata_to_platdata to the missing probe

commit 29f7d05a347a ("dm: core: Move ofdata_to_platdata() call earlier") introduces changes in the order of device_probe execution. ofdata_to_platdata now comes before the probe function which resulted in a deadlock and caused boot hang on AM6 devices.

Deadlock sequence: tps62360_regulator_ofdata_to_platdata --> i2c_get_chip --> device_probe(tps62360) --> tps62360_regulator_ofdata_to_platdata

Hence convert ofdata_to_platdata to the missing probe function to fix the hang.

Fixes 22e8f18980d6 ("power: regulator: tps6236x: add support for tps6236x regulators")
---
 drivers/power/regulator/tps62360_regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/regulator/tps62360_regulator.c +2 -2
index 3b123f503c..2c076c0db5 100644
@@ -77,7 +77,7 @@ static int tps62360_regulator_get_value(struct udevice *dev)
 	return (u32)regval * TPS62360_VSEL_STEPSIZE + pdata->config->vmin;
 }
 
-static int tps62360_regulator_ofdata_to_platdata(struct udevice *dev)
+static int tps62360_regulator_probe(struct udevice *dev)
 {
 	struct tps62360_regulator_pdata *pdata = dev_get_platdata(dev);
 	u8 vsel0;
@@ -119,5 +119,5 @@ U_BOOT_DRIVER(tps62360_regulator) = {
 	.ops = &tps62360_regulator_ops,
 	.of_match = tps62360_regulator_ids,
 	.platdata_auto_alloc_size = sizeof(struct tps62360_regulator_pdata),
-	.ofdata_to_platdata = tps62360_regulator_ofdata_to_platdata,
+	.probe = tps62360_regulator_probe,
 };
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 power: regulator: tps62360_regulator: Convert ofdata_to_platdata to the missing probe

Quoted 5 lines · Keerthy

commit 29f7d05a347a ("dm: core: Move ofdata_to_platdata() call earlier") introduces changes in the order of device_probe execution. ofdata_to_platdata now comes before the probe function which resulted in a deadlock and caused boot hang on AM6 devices.

Quoted 8 lines

Deadlock sequence: tps62360_regulator_ofdata_to_platdata --> i2c_get_chip --> device_probe(tps62360) --> tps62360_regulator_ofdata_to_platdata

Hence convert ofdata_to_platdata to the missing probe function to fix the hang.

Fixes 22e8f18980d6 ("power: regulator: tps6236x: add support for tps6236x regulators")

Thanks. This fixes boot on AM654 evm:

Thanks and regards,
Lokesh

Quoted 25 lines
---
 drivers/power/regulator/tps62360_regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/regulator/tps62360_regulator.c +2 -2
index 3b123f503c..2c076c0db5 100644
@@ -77,7 +77,7 @@ static int tps62360_regulator_get_value(struct udevice *dev)
 	return (u32)regval * TPS62360_VSEL_STEPSIZE + pdata->config->vmin;
 }
 
-static int tps62360_regulator_ofdata_to_platdata(struct udevice *dev)
+static int tps62360_regulator_probe(struct udevice *dev)
 {
 	struct tps62360_regulator_pdata *pdata = dev_get_platdata(dev);
 	u8 vsel0;
@@ -119,5 +119,5 @@ U_BOOT_DRIVER(tps62360_regulator) = {
 	.ops = &tps62360_regulator_ops,
 	.of_match = tps62360_regulator_ids,
 	.platdata_auto_alloc_size = sizeof(struct tps62360_regulator_pdata),
-	.ofdata_to_platdata = tps62360_regulator_ofdata_to_platdata,
+	.probe = tps62360_regulator_probe,
 };
#2 lore raw

PATCH 1/1 power: regulator: tps62360_regulator: Convert ofdata_to_platdata to the missing probe

In reply to Keerthy
Quoted 9 lines · Keerthy

commit 29f7d05a347a ("dm: core: Move ofdata_to_platdata() call earlier") introduces changes in the order of device_probe execution. ofdata_to_platdata now comes before the probe function which resulted in a deadlock and caused boot hang on AM6 devices.

Deadlock sequence: tps62360_regulator_ofdata_to_platdata --> i2c_get_chip --> device_probe(tps62360) --> tps62360_regulator_ofdata_to_platdata

Quoted 8 lines

Hence convert ofdata_to_platdata to the missing probe function to fix the hang.

Fixes 22e8f18980d6 ("power: regulator: tps6236x: add support for tps6236x regulators")
---
 drivers/power/regulator/tps62360_regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)