usb: typec: hd3ss3220: Fix VBUS regulator reference handling - #972
usb: typec: hd3ss3220: Fix VBUS regulator reference handling#972Chang Wu (kunjinkao-os) wants to merge 2 commits into
Conversation
|
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. |
1 similar comment
|
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. |
|
Dmitry Baryshkov (@lumag) yijiyang jingyiwang42 The VBUS regulator warning was observed in the log attached to #472, but it is This PR only fixes the independent Could you please advise the appropriate CR to reference for this fix, or the |
3a1bdcc to
1186be0
Compare
|
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. |
2 similar comments
|
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. |
|
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. |
1186be0 to
12aa1d7
Compare
|
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. |
1 similar comment
|
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. |
12aa1d7 to
c6512aa
Compare
|
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 #972 — validate-patchPR: #972
Final Summary
|
PR #972 — checker-log-analyzerPR: #972
Detailed report: Full report
|
c6512aa to
4aeb258
Compare
|
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. |
|
Note: the qlijarvis reports above were generated before the latest force-push and refer to the old commits. The current PR head is |
PR #972 — validate-patchPR: #972
Final Summary
|
PR #972 — checker-log-analyzerPR: #972
Detailed report: Full report
|
PR #972 — validate-patchPR: #972
Final Summary
|
PR #972 — checker-log-analyzerPR: #972
Detailed report: Full report
|
PR #972 — validate-patchPR: #972
Final Summary
|
PR #972 — checker-log-analyzerPR: #972
Detailed report: Full report
|
4aeb258 to
c9fd758
Compare
|
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. |
|
Upstream status update: The second patch has been accepted into Greg Kroah-Hartman's I updated its prefix from The remaining CR-number check requires maintainer guidance because I am an |
|
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. |
c9fd758 to
661cbcc
Compare
|
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. |
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: 09fa276 ("FROMLIST: 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://lore.kernel.org/r/7A42A287B2B588D0+20260812094632.348581-1-raoxu@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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: 09fa276 ("FROMLIST: usb: typec: hd3ss3220: Enable VBUS based on role state") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20260819152027.90994-1-kunjinkao.jp@gmail.com 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
661cbcc to
217c696
Compare
|
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. |
|
Updated the commits and retriggered CI. |
|
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. |
1 similar comment
|
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. |
The HD3SS3220 driver uses regulator_is_enabled() to determine whether VBUS
needs to be enabled or disabled. However, regulator_is_enabled() reports the
aggregate regulator state and does not indicate whether this consumer holds
an enable reference.
If another consumer enables VBUS first, the driver may skip its own
regulator_enable() call and later issue an unbalanced regulator_disable()
call.
Track the VBUS enable state locally so that regulator enable and disable
references remain balanced for this consumer. Update the state only after a
successful regulator operation.
This PR contains two upstream commits:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?id=c9a48db776d7184981630ecc01a3ad30a8f7dc24
https://lore.kernel.org/r/20260819152027.90994-1-kunjinkao.jp@gmail.com
Fixes: 09fa276 ("FROMLIST: usb: typec: hd3ss3220: Enable VBUS based on role state")
Testing:
I am an external contributor and do not have access to Qualcomm's internal
CR system. Maintainer guidance on the appropriate CR association would be
appreciated.