Commit 3ba92e3
Desnes Nunes
phy: tegra: xusb: Fix unbalanced regulator disable in UTMI PHY mode
JIRA: https://issues.redhat.com/browse/RHEL-116016
CVE: CVE-2025-38535
commit cefc1ca
Author: Wayne Chang <[email protected]>
Date: Fri, 2 May 2025 17:26:06 +0800
When transitioning from USB_ROLE_DEVICE to USB_ROLE_NONE, the code
assumed that the regulator should be disabled. However, if the regulator
is marked as always-on, regulator_is_enabled() continues to return true,
leading to an incorrect attempt to disable a regulator which is not
enabled.
This can result in warnings such as:
[ 250.155624] WARNING: CPU: 1 PID: 7326 at drivers/regulator/core.c:3004
_regulator_disable+0xe4/0x1a0
[ 250.155652] unbalanced disables for VIN_SYS_5V0
To fix this, we move the regulator control logic into
tegra186_xusb_padctl_id_override() function since it's directly related
to the ID override state. The regulator is now only disabled when the role
transitions from USB_ROLE_HOST to USB_ROLE_NONE, by checking the VBUS_ID
register. This ensures that regulator enable/disable operations are
properly balanced and only occur when actually transitioning to/from host
mode.
Fixes: 49d46e3 ("phy: tegra: xusb: Add set_mode support for UTMI phy on Tegra186")
Cc: [email protected]
Signed-off-by: Wayne Chang <[email protected]>
Reviewed-by: Jon Hunter <[email protected]>
Tested-by: Jon Hunter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Desnes Nunes <[email protected]>1 parent f675941 commit 3ba92e3
1 file changed
+37
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
786 | | - | |
| 786 | + | |
787 | 787 | | |
788 | | - | |
| 788 | + | |
| 789 | + | |
789 | 790 | | |
790 | 791 | | |
791 | 792 | | |
792 | 793 | | |
| 794 | + | |
793 | 795 | | |
794 | 796 | | |
795 | 797 | | |
| |||
800 | 802 | | |
801 | 803 | | |
802 | 804 | | |
803 | | - | |
804 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
805 | 816 | | |
806 | | - | |
807 | | - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
808 | 832 | | |
809 | 833 | | |
810 | | - | |
811 | | - | |
812 | 834 | | |
813 | 835 | | |
814 | 836 | | |
| |||
827 | 849 | | |
828 | 850 | | |
829 | 851 | | |
830 | | - | |
831 | | - | |
832 | | - | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
833 | 855 | | |
834 | 856 | | |
835 | 857 | | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
845 | 861 | | |
846 | 862 | | |
847 | 863 | | |
848 | | - | |
| 864 | + | |
849 | 865 | | |
850 | | - | |
851 | 866 | | |
852 | 867 | | |
853 | 868 | | |
| |||
0 commit comments