clk: qcom: gdsc: treat optional supplies as optional
Subsystems (3)
PATCH 1/1 clk: qcom: gdsc: treat optional supplies as optional
Since commit deebc79b28d6 ("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like:
gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulator
on SC8280XP.
Fortunately, the driver is already prepared to handle this by checking that the regulator pointer is non-NULL before use.
This also avoids triggering a potential deadlock on SC8280XP even if the underlying issue still remains for the derivative platforms like SA8295P that actually use the supply.
--- drivers/clk/qcom/gdsc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/clk/qcom/gdsc.c +8 -3
@@ -487,9 +487,14 @@ int gdsc_register(struct gdsc_desc *desc,if (!scs[i] || !scs[i]->supply)continue ; - scs[i]->rsupply =devm_regulator_get (dev, scs[i]->supply); -if (IS_ERR (scs[i]->rsupply)) -return PTR_ERR (scs[i]->rsupply); + scs[i]->rsupply =devm_regulator_get_optional (dev, scs[i]->supply); +if (IS_ERR (scs[i]->rsupply)) { + ret =PTR_ERR (scs[i]->rsupply); +if (ret != -ENODEV ) +return ret; + + scs[i]->rsupply =NULL ; + } } data->num_domains = num;
Signature · 1 line
2.43.2
Quoted 7 lines · Johan Hovold
Since commit
deebc79b28d6("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like:gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulatoron SC8280XP.
Can this device actually run with the supply physically disconnected?
Quoted 11 lines · Mark Brown
Quoted 7 lines · Johan Hovold
Since commit
deebc79b28d6("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like:gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulatoron SC8280XP.
Can this device actually run with the supply physically disconnected?
On SC8280XP this is supplied via power-domain instead of the supply.
Signature · 2 lines
With best wishes Dmitry
Quoted 7 lines · Dmitry Baryshkov
Quoted 6 lines · Mark Brown
Quoted 4 lines · Johan Hovold
Since commit
deebc79b28d6("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like:
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulatoron SC8280XP.
Can this device actually run with the supply physically disconnected?
On SC8280XP this is supplied via power-domain instead of the supply.
I think Dmitry is asking about this bit:
if (ret != -ENODEV)
return ret;
which is basically repeating the difference that _optional makes
Konrad
Quoted 10 lines · Konrad Dybcio
Quoted 9 lines · Dmitry Baryshkov
Quoted 8 lines · Mark Brown
Quoted 6 lines · Johan Hovold
Since commit
deebc79b28d6("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like:gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulator
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
on SC8280XP.
Can this device actually run with the supply physically disconnected?
On SC8280XP this is supplied via power-domain instead of the supply.
I think Dmitry is asking about this bit:
AFAICT, Dmitry did not ask anything.
Quoted 4 lines
if (ret !=
-ENODEV)return ret;which is basically repeating the difference that
_optionalmakes
Not sure what you meant by this either. This is how the regulator subsystem works.
Johan
Quoted 10 lines · Mark Brown
Quoted 7 lines · Johan Hovold
Since commit
deebc79b28d6("clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc") the GDSC supply must be treated as optional to avoid warnings like:gpu_cc-sc8280xp 3d90000.clock-controller: supply vdd-gfx not found, using dummy regulatoron SC8280XP.
Can this device actually run with the supply physically disconnected?
The gpucc-sc8280xp driver is used for both sc8280xp and a couple of derivative platforms. AFAIU only the latter use this supply, but the driver unfortunately currently cannot tell which platform it runs on and requests the vdd-gfx unconditionally.
An alternative would have been to add new compatible strings for the derivate platforms and only request the regulator for those as I mentioned here:
https://lore.kernel.org/all/[email protected]/
Johan
Quoted 5 lines · Johan Hovold
An alternative would have been to add new compatible strings for the derivate platforms and only request the regulator for those as I mentioned here:
Ah, yes - that would be much better.