Skip to content

phy: qcom: qmp-combo: fix forced com_init() error handling

Oleg Keri linux-arm-msm linux-phy lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2phy: qcom: qmp-combo: do not decrement init_count on a forced init failuredrivers/phy/qualcomm/phy-qcom-qmp-combo.c+2 -11 reply
2/2phy: qcom: qmp-combo: check qmp_combo_com_init() in the typec callbacksdrivers/phy/qualcomm/phy-qcom-qmp-combo.c+11 -31 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] phy: qcom: qmp-combo: fix forced com_init() error handling

Two pre-existing problems in the typec_switch and typec_mux callbacks, both on the force=true path that tears the common block down and brings it back up. Found while looking at that code for

https://lore.kernel.org/all/[email protected]/

which is an unrelated fix to the same two functions and does not depend on these; they can be applied in either order.

Patch 1 stops a forced qmp_combo_com_init() failure from dropping an init_count reference it never took, which drives the counter negative and makes qmp_combo_com_exit() return early for the rest of the boot.

Patch 2 stops both callbacks from carrying on to write PHY registers after the bringup has failed and left the clocks disabled.

Neither is easy to trigger deliberately - both need qmp_combo_com_init() to fail - so they are found by inspection rather than reproduced. The tree they were written against is exercised daily on a Lenovo Yoga Slim 7x Gen 11 (Snapdragon X2 Elite), where the typec callbacks run on every USB-C orientation and altmode change.

Oleg Keri (2):
phy: qcom: qmp-combo: do not decrement init_count on a forced init
failure
phy: qcom: qmp-combo: check qmp_combo_com_init() in the typec
callbacks

 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
Signature · 4 lines
2.55.0


base-commit: df2908090cda368b01ff43709f51890076c56157