HD3SS3220 Upstream fixes backport - #1130
Kriskura176767 wants to merge 2 commits into
Conversation
hd3ss3220_regulator_control() enables the VBUS regulator when @on is true and disables it when @on is false. However, its error message uses the opposite operation name, so an enable failure is reported as a disable failure and vice versa. Print the operation that was actually attempted. Reporting the opposite regulator operation on failures can mislead debugging of VBUS problems. Fixes: 27fbc19 ("usb: typec: hd3ss3220: Enable VBUS based on role state") Cc: stable@vger.kernel.org Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Xu Rao <raoxu@uniontech.com> Link: https://patch.msgid.link/7A42A287B2B588D0+20260812094632.348581-1-raoxu@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
regulator_is_enabled() reports the aggregate regulator state, not whether this consumer holds an enable reference. If another consumer enables VBUS first, the driver can skip its own regulator_enable() call and later attempt to drop a reference it never acquired, triggering an unbalanced regulator disable warning. Track successful enable and disable calls locally. Keep the state unchanged when an operation fails so a later role or ID notification retries the operation while this consumer keeps balanced references. Fixes: b3f9d6e ("usb: typec: hd3ss3220: Check if regulator needs to be switched") Cc: stable <stable@kernel.org> Link: qualcomm-linux#472 Signed-off-by: Chang Wu <kunjinkao.jp@gmail.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Tested-by: Jan Remmet <j.remmet@phytec.de> Reviewed-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com> Link: https://patch.msgid.link/20260819152027.90994-1-kunjinkao.jp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
|
Merge Check Failed: No CR Numbers Found Error: No Change Request numbers were found. Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests. |
PR #1130 — validate-patchPR: #1130
Final Summary
|
PR #1130 — checker-log-analyzerPR: #1130
Detailed report: Full report
|
Test Matrix
|
LAVA Failed Case Triage SummaryPR: #1130 Job 228587 | SoC lemans-evkLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228587 Failed test cases in LAVA job 228587 (SoC: lemans-evk).
Job 228588 | SoC qcs8300-rideLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228588 Failed test cases in LAVA job 228588 (SoC: qcs8300-ride).
Job 228589 | SoC qcs6490-rb3gen2LAVA job: https://lava-oss.qualcomm.com/scheduler/job/228589 Failed test cases in LAVA job 228589 (SoC: qcs6490-rb3gen2).
Job 228590 | SoC hamoa-evkLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228590 Failed test cases in LAVA job 228590 (SoC: hamoa-evk).
Job 228591 | SoC qcs615-rideLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228591 Failed test cases in LAVA job 228591 (SoC: qcs615-ride).
Job 228592 | SoC qcs9100-rideLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228592 Failed test cases in LAVA job 228592 (SoC: qcs9100-ride).
Job 228593 | SoC shikra-iqs-evkLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228593 Failed test cases in LAVA job 228593 (SoC: shikra-iqs-evk).
Job 228594 | SoC monaco-evkLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228594 Failed test cases in LAVA job 228594 (SoC: monaco-evk).
Job 228595 | SoC purwa-evkLAVA job: https://lava-oss.qualcomm.com/scheduler/job/228595 Failed test cases in LAVA job 228595 (SoC: purwa-evk).
|
Two fixes being propagated here:
regulator_is_enabled() reports the aggregate regulator state, not whether this consumer holds an enable reference. If another consumer enables VBUS first, the driver can skip its own regulator_enable() call and later attempt to drop a reference it never acquired, triggering an unbalanced regulator disable warning. Track successful enable and disable calls locally. Keep the state unchanged when an operation fails so a later role or ID notification retries the operation while this consumer keeps balanced references.
hd3ss3220_regulator_control() enables the VBUS regulator when on is true and disables it when on is false. However, its error message uses the opposite operation name, so an enable failure is reported as a disable failure and vice versa. Print the operation that was actually attempted. Reporting the opposite regulator operation on failures can mislead debugging of VBUS problems.
0.0 PR: qualcomm-linux/kernel-topics#1848
CRs-Fixed: 4679849