[1/2] clk: qcom: gcc-sm6375: Update the .pwrsts for usb gdsc

Message ID 20230303022912.2171177-1-konrad.dybcio@linaro.org
State New
Headers
Series [1/2] clk: qcom: gcc-sm6375: Update the .pwrsts for usb gdsc |

Commit Message

Konrad Dybcio March 3, 2023, 2:29 a.m. UTC
  The USB controller on sm6375 doesn't retain its state when the system
goes into low power state and the GDSCs are turned off.

This can be observed by the USB connection not coming back alive after
putting the device into suspend, essentially breaking USB.

Fix this by updating the .pwrsts for the USB GDSCs so they only
transition to retention state in low power.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/clk/qcom/gcc-sm6375.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Stephen Boyd March 6, 2023, 7:35 p.m. UTC | #1
Quoting Konrad Dybcio (2023-03-02 18:29:11)
> The USB controller on sm6375 doesn't retain its state when the system
> goes into low power state and the GDSCs are turned off.
> 
> This can be observed by the USB connection not coming back alive after
> putting the device into suspend, essentially breaking USB.
> 
> Fix this by updating the .pwrsts for the USB GDSCs so they only
> transition to retention state in low power.

Is this a temporary fix? Is that why there isn't a Fixes tag? If it's a
workaround then please add a TODO comment indicating the USB driver
doesn't work properly.
  
Konrad Dybcio March 6, 2023, 10:36 p.m. UTC | #2
On 6.03.2023 20:35, Stephen Boyd wrote:
> Quoting Konrad Dybcio (2023-03-02 18:29:11)
>> The USB controller on sm6375 doesn't retain its state when the system
>> goes into low power state and the GDSCs are turned off.
>>
>> This can be observed by the USB connection not coming back alive after
>> putting the device into suspend, essentially breaking USB.
>>
>> Fix this by updating the .pwrsts for the USB GDSCs so they only
>> transition to retention state in low power.
> 
> Is this a temporary fix? Is that why there isn't a Fixes tag?
Yeah AFAIU the upstream dwc3-qcom driver is not fully implemented
on the suspend front.

If it's a
> workaround then please add a TODO comment indicating the USB driver
> doesn't work properly.
Will do!

Konrad
  

Patch

diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c
index ad3c4833990d..93164670fbe1 100644
--- a/drivers/clk/qcom/gcc-sm6375.c
+++ b/drivers/clk/qcom/gcc-sm6375.c
@@ -3534,7 +3534,7 @@  static struct gdsc usb30_prim_gdsc = {
 	.pd = {
 		.name = "usb30_prim_gdsc",
 	},
-	.pwrsts = PWRSTS_OFF_ON,
+	.pwrsts = PWRSTS_RET_ON,
 };
 
 static struct gdsc ufs_phy_gdsc = {