Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp609182rwb; Wed, 28 Sep 2022 07:02:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63lLS3fVI3j/4dlM4IeM4lepDrcbsAmh810GT8UKFZu4YtDq2TSFzL2NpnALkQ1Z+aoDbI X-Received: by 2002:a63:e211:0:b0:43b:f03e:3cc5 with SMTP id q17-20020a63e211000000b0043bf03e3cc5mr29720766pgh.256.1664373736764; Wed, 28 Sep 2022 07:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664373736; cv=none; d=google.com; s=arc-20160816; b=gtWxUCQKKMw11M3dQrWTzqCZn5oEZcAxvOMtn+rlZaeIb3Jc+jJIzO2G95LlP0TC3W h6+4ZkbUhEbxv9+/xTQtbCBQZGzi73SXNXn37ASFBguaI1rh1A2vxeEx9I6bTiJJTjIN 4kjVCapqAr6+ikhHKWLCMS4fBMUqKzCDj+YDKwp2MNSp6hAM6TzdDVMouh8JTpcRYbXI u4YRmySi1oPYLqAnSwOgCl02DL4jGbMqpwIWrnGww7nfFQCMqJUulCD/vPX2GfUThm+H oRHq23fc99pwkL3+u9WiFNv407uaPNqroY7hw3RcLPvPNJDRemmPqeGaVGv9uIE2Dlk1 x2XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=n3qQR+aqK3MBkpPhhE7yG0JzICbbOFyRcGevTT/H8DY=; b=d5Ftd6Vw7exYPlUBFbkOmByWCjx3YrKmj1exj5llCMkcJ5TdOSpySqNsnkEmQKvbo9 IYV47annLtVinzScP0+z7ZHaASAoMzUmy77tprUl2rnkx3XTS+YXwFXUwkh20WsSZpll K8t0aeHNvQwvGHpuM5alxkFnrMdqeGChL5lym6jOAAHCFzfQbRntTxO2/chkaC2yxmiE b527tZYWW3u1RwFdhES2xYxQSALek77GbaHaDOQEyTzuSS35Zp2ddSA/YhnFQV1ttqYH i2Q75+FLAO4fK38Uj2Nj83RblOM4fCS/b8J5+7e0wcv6WE02+yVbtBa+i59IZ1yHjuBx dQ1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=MVeVzTtA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a63a301000000b00434c18fdd78si6033189pge.765.2022.09.28.07.02.01; Wed, 28 Sep 2022 07:02:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=MVeVzTtA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233350AbiI1NbY (ORCPT + 99 others); Wed, 28 Sep 2022 09:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233333AbiI1NbV (ORCPT ); Wed, 28 Sep 2022 09:31:21 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7405A1D73 for ; Wed, 28 Sep 2022 06:31:19 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id l14so27151982eja.7 for ; Wed, 28 Sep 2022 06:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=n3qQR+aqK3MBkpPhhE7yG0JzICbbOFyRcGevTT/H8DY=; b=MVeVzTtAnaZhe+EoVGaEnkpifnw/hFsnyVLN58MUI492PeZ58ECotTixHYDryoIQys 22MSjzFXpNbc1k11Kg2gvhhGDfJTw09+oD5vaM+h2mlpSm1vvGTKIKlid4s5jqhKWGQp v3miQP7Cbf5oXutuuQBo27dxTIL7HWjlw5KvBMeyt+qsEoS9hICqhvxxR/RBc7VPIFlA Igo27gSvRFshssr2bdp0DMbJ1hS8V3R7XLYGvSusgCyH6EVoWi5A+nF8mavYal9YT3SB VjlSj/P8u7x45vl4S3k659wLSvFqYg2bSMEW5ne6pT7LHP+wH+RB1aQWh91EsH92B7Oc N4lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=n3qQR+aqK3MBkpPhhE7yG0JzICbbOFyRcGevTT/H8DY=; b=X+r0ZWLR+1cC12YcvEjfRpdHxrFiCPXnTrcZkPbQygFDOtd5BdPv+g8hgSVahY1VuG UFzmF0IH24NDXFcKHo3VL59PXXl8sq/fORlLYyf9PUoh8GUHjMDAkm3pOCuvTJhpGLgj Tbtn+0R37HdRrwc3agW/A/c4G6YvLDkyAjP/ZYt5QORec/P2WxQn/Sw3PJOntodwhN9n 58AGaNDhr8oL6FTX8dop6Wes4UPZ0NQazv1GdzMf5HaW2fJnppZuofC5vQwUl0FqOl+Y F6ZTv9EpH2Ezbyu3MltEzNpu6w3QRLkev+OIM6G/0HOHnCHGNPfIIfmkndjHy0JaFJW1 hkEw== X-Gm-Message-State: ACrzQf1NSQqO+eA5iAGnKcuzYDQGb7evDwaxeQGZy/L7NBGTiD+SqK/7 pyGVDH2Ldum29VZ/2gl3od3vtWb9+hgKeg== X-Received: by 2002:a17:907:72c4:b0:783:4fe0:daca with SMTP id du4-20020a17090772c400b007834fe0dacamr14835994ejc.455.1664371878293; Wed, 28 Sep 2022 06:31:18 -0700 (PDT) Received: from otso.. (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id q1-20020a50cc81000000b00457618d3409sm3366096edi.68.2022.09.28.06.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 06:31:17 -0700 (PDT) From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Luca Weiss , Rajendra Nayak , Bjorn Andersson , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: qcom: gcc-sm6350: Update the .pwrsts for usb gdscs Date: Wed, 28 Sep 2022 15:28:54 +0200 Message-Id: <20220928132853.179425-1-luca.weiss@fairphone.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The USB controllers on sm6350 do not retain the 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. Cc: Rajendra Nayak Signed-off-by: Luca Weiss --- Similar to sc7180 & sc7280 patches that have been applied recently: https://lore.kernel.org/linux-arm-msm/20220927170516.zrkzn3xl7oedzi4l@builder.lan/T/ @Rajendra Nayak: Maybe you know a bit more about the internals of sm6350&sm7225. As described in the commit message USB just stops working after suspend, with this it comes back after wakeup from suspend and continues working. If any details in the commit message are somehow wrong or I can add something, please let me know! Thanks for fixing this on sc7180&sc7280! drivers/clk/qcom/gcc-sm6350.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gcc-sm6350.c b/drivers/clk/qcom/gcc-sm6350.c index 69412400efa4..9b4e4bb05963 100644 --- a/drivers/clk/qcom/gcc-sm6350.c +++ b/drivers/clk/qcom/gcc-sm6350.c @@ -2316,7 +2316,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 = { -- 2.37.3