From patchwork Tue Mar 7 12:31:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 65435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2407499wrd; Tue, 7 Mar 2023 04:46:15 -0800 (PST) X-Google-Smtp-Source: AK7set8q9vZZLxLjeR2/mWNE9akSekMJUuQ8sdYMyg2jqAabgLXCR9vhLp0DzlkMPKWcMudAXCwZ X-Received: by 2002:a05:6a21:3385:b0:cd:238f:4f4b with SMTP id yy5-20020a056a21338500b000cd238f4f4bmr15858757pzb.23.1678193174837; Tue, 07 Mar 2023 04:46:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678193174; cv=none; d=google.com; s=arc-20160816; b=f9S8O00+XWa08rlKAWx289Bp7D88NNx4cb0sF/5VY5jUzQbgm8KC6J7y6F2+RtpfXC GSqnP7D7QwIJWkjqvhQbwbJxxu7psUemYKAOx1oe8kuOyBNsKBQ4aub5G+XjzsWW+Vzj 906HtUBcjY0QxahwJw5BOFfe/2H7gS0hibn+EsNGGUo28qZkYdoS/Q+fq81xZDMJ51gv ppKaeCscG7nu73rVm/tqXQMQiFcTW7wsvKiHfc4viZ4sgPUALm7pott9ZQmonbhOx1UP v+pgH1xNIhLuTkJULU7KsiTfIJl0DaKMsTpfPZcbs75auzb2gHuX1ArKxrYhiAotLlTc /9oQ== 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=aPs2AsYZOYaw55T4/U7uB6HluDp2jLmqFur5Lgl7Udk=; b=s10tNdRUY3u+GNcIK3eUcxFN9o+WIsYA2RVS2i4/9hSIrXvs3M4AkGDFGvLs1Ad0tb JU7A0e5E9IAJMFEkYRh6GvDQXEu5C2V5WbFaMDVce1TQzCLy3lOTRXoepXIvUqd0L8P0 bADBzN4diZLu4xRvjjxTAeyyCe9RD0VzZ7SAvddFl0rmZMOV2SExDvgdq9voIH3S+1bz jsNNNOKQK/uLgch6+zU9UmcjdUmGCRCogHQVXAsFSFb0n84pZjgcjO6i5OOUaM3Xq8uA IxUsfPT4GPo60EuA/f0gl5wA4Ocqs1G2ixn7RFC8ofh1LRljZIiWO7MCyMAuBO+A8zhI DCLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lK7Eu/N/"; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020aa794a2000000b0058c800a75f6si11554390pfl.335.2023.03.07.04.46.02; Tue, 07 Mar 2023 04:46:14 -0800 (PST) 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=@linaro.org header.s=google header.b="lK7Eu/N/"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbjCGMcI (ORCPT + 99 others); Tue, 7 Mar 2023 07:32:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjCGMcG (ORCPT ); Tue, 7 Mar 2023 07:32:06 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 878B9769E3 for ; Tue, 7 Mar 2023 04:32:04 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id t11so16863348lfr.1 for ; Tue, 07 Mar 2023 04:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678192323; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aPs2AsYZOYaw55T4/U7uB6HluDp2jLmqFur5Lgl7Udk=; b=lK7Eu/N/ysN2wh72dor8CsgesQs98RJOZna5u/ukEz1oLX8YRdNbNDRGc4jcyEMRKM 4TfTARbnX6WoV0YH69UfNrmSwElbwyZrSqKbNwZ1V8MwedHXNeMdGIm7h/QQlLz9fV9l yTawG25BE1AjrcycBPi60mgp838z4VmStZpC1dR/+9lWjJ/p85l2lyDpIoTiQ0oHSmXu vIOuWX9mg+iiMBUN7N5fVDcfBLFMFbUM42f7sSzXxa11YrsSoLrT+Jj5Rnr7HnUr/+5R qdtk4y8K/I63delBF3PAs61PurOwHiYTHMW/BkVRn108GPWOeH4eh5XB+R7SMVDSu1Mk Nf7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678192323; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aPs2AsYZOYaw55T4/U7uB6HluDp2jLmqFur5Lgl7Udk=; b=xjGpBH3sJucitffOxvPhfV+VjA6QDkbyhO2e9OYx+JGrBP5/mWNorrlrzAON5W819m Tto136pj/lXsv/Mre6vEHWqXhfRG8Yabej2TZH6RrPINQgbAffbxRuxurZoA9AG04vgR A1B7x2SMrwaP9epsApVZNUT4EpTuDxH1NhtYKEmdZIpzT/WobOb4orn/YdcMbkQzBESb q0YA7eWbsUjAfbUUJQzR9+jJj9ZNjvUBf4U+UsBc4vNyBhsKUhnD8kqYmhQbnUYjb6bR 5LTaSWskA4dFE8U85is5HVE05peBaCyHbGZk8cqKLByKCTTnxjlUkMwMEGqjXlqivHlI vjUw== X-Gm-Message-State: AO0yUKW+qV/win/xH38x/vVp7+B7BFpBQqW94EnfDXX+4Nh/WfMzPLZS 8cp+s9zb0rPkeivh6zycppDPYQ== X-Received: by 2002:ac2:560b:0:b0:4db:2c28:8974 with SMTP id v11-20020ac2560b000000b004db2c288974mr3923462lfd.12.1678192322765; Tue, 07 Mar 2023 04:32:02 -0800 (PST) Received: from localhost.localdomain (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id t20-20020a2e7814000000b0029462e98c07sm2156501ljc.35.2023.03.07.04.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 04:32:02 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] clk: qcom: gcc-sm6375: Update the .pwrsts for usb gdsc Date: Tue, 7 Mar 2023 13:31:57 +0100 Message-Id: <20230307123159.3797551-1-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759713086345842902?= X-GMAIL-MSGID: =?utf-8?q?1759713086345842902?= 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. Work around this by updating the .pwrsts for the USB GDSCs so they only transition to retention state in low power. This change should be reverted when a proper suspend sequence is implemented in the USB drivers. Signed-off-by: Konrad Dybcio --- v1 -> v2: - Reword "fix" to "work around", mention it should be temporary - Add TODO: drivers/clk/qcom/gcc-sm6375.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c index ad3c4833990d..417a0fd242ec 100644 --- a/drivers/clk/qcom/gcc-sm6375.c +++ b/drivers/clk/qcom/gcc-sm6375.c @@ -3534,7 +3534,8 @@ static struct gdsc usb30_prim_gdsc = { .pd = { .name = "usb30_prim_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + /* TODO: Change to OFF_ON when USB drivers get proper suspend support */ + .pwrsts = PWRSTS_RET_ON, }; static struct gdsc ufs_phy_gdsc = { From patchwork Tue Mar 7 12:31:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 65434 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2407485wrd; Tue, 7 Mar 2023 04:46:11 -0800 (PST) X-Google-Smtp-Source: AK7set9c6l3JGjdw0hrkZmZPhrUy2xUHoy8PFNB+OswMgwCKVyNiQht11yYIZMy30jY2+MID91KG X-Received: by 2002:a05:6a20:1582:b0:cb:c266:3f6b with SMTP id h2-20020a056a20158200b000cbc2663f6bmr14889756pzj.12.1678193171136; Tue, 07 Mar 2023 04:46:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678193171; cv=none; d=google.com; s=arc-20160816; b=vwB7EOknYQrG+DkJA8NrIwzPd0hW/avAMrHwA0sAa1FZEH+PVwk5Fd+LhdCGBeMnm/ nHtXuF8u+8qpgs9EvRYvorEmyNe1uR8rybfIXgyi30ETZedFGYd2wm2UzJLFBR0ItHLR M3aAx6yft7sJUptb1vbI6HA125fHaPcLpo11bB3RyfRpRFI4m2F9QjvEGA64qYA1PfSc /8BoZyD/6fOeie8ks2h4Qz/qnOvD+uQ4j4tkZO+W77+S9yLl0M8vNkt97YkIv/SJRFzV isiG+dd5vOejKp9A5Bis4SbKGuOZumO+Vb5JT9amCYU291U9BCpL7PUGlYjM041dKGci zxFw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vcymAsSfgo0T3+vs1DGeeROeS5a7cMEN49XDIkMpxfg=; b=QPz9+4aDGIv30ZDo7Y+YEfNyEyFDMytPMohypOhTYvfobj0mtEE+hIE98sDIwL/sfz NFeAu3JGBKM+xqODtIn1/Kih+u1pN5pPldQ+584AlX6rqjv8BWeSOQs0/M3svpzXWLlo xLaHte/EoyeHvhzTfVf2SNe/a7HRb7U539ARrk3Fi/1mjzS5xpujjHrtxZHzwYIIvTtf 1h7jg2yOMikgGRwZkzfBHBZl3dM0p8mhQjaAA/SF6aOH+EeiaFAEbs7voJsHvgqAsOeb fJdJ7a/o61YvJ0HHcBKrDvu5Ieq2xc4qQq/ORqpIENDxOhS6LgHmFoNdqTD4bWO++uuX CRVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MpcYncKv; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p27-20020aa79e9b000000b005a911b0a4e0si12087435pfq.240.2023.03.07.04.45.55; Tue, 07 Mar 2023 04:46:11 -0800 (PST) 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=@linaro.org header.s=google header.b=MpcYncKv; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230264AbjCGMcK (ORCPT + 99 others); Tue, 7 Mar 2023 07:32:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjCGMcI (ORCPT ); Tue, 7 Mar 2023 07:32:08 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62E477C97 for ; Tue, 7 Mar 2023 04:32:05 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id z42so12916779ljq.13 for ; Tue, 07 Mar 2023 04:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678192324; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vcymAsSfgo0T3+vs1DGeeROeS5a7cMEN49XDIkMpxfg=; b=MpcYncKvmfwJI9vzqRxHDqSv5X7Je8evTDWTOx5wvFHZcXomu1VweUaiPNyzlsduEm 4P1Q1jBSFlnB+gItEhtlEcregtrwdezxyGMZV5GgWfiFA1y4Ij2C+LIIG7hv9BxSRh// wlIPD93XE4CKqzxO8zcZ40MEEoXqE2prYPonzjp2277dKoIqCxhxuqec+20N++G/XI8E CvnJaEqWl5WYsdozc12OfHWvO/FD6ydGxLe/ZZ8LQ3tBUi5emx9nic8MuwyJB0iJKhmi 7J+f//sZon4XMK6izt1ffXgPicd6ZR+8xRnOJWEvsjpzgQttiWAULtI8lgkl5CDWsIoD OytQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678192324; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vcymAsSfgo0T3+vs1DGeeROeS5a7cMEN49XDIkMpxfg=; b=drfMyBPbQPK/y+xdAMwW1kHamRYxj/rAnowEbxtItQNVeNutdYQs49SweZnGCSbrPT RsL35FWSwq2Rpw1wfNF04ddhmmgss7Ge1GKrkxS7motEmoElLXJps6rRUY7z7Jg3fT4d 82Qu76VgdfTJ3paJIr5V84pTFMrtqvpaJl2ee38bcESAOQdLhVjtKyqoG7PFS/R7KR+L EPK0AHoQZfGxOFhVdLrox9Aslx0+mo97brYXm2ITHdNejbrdcXXRl7v6gAVFMkV2zkNA GmBCG858PTkp/t378lisgCsQl6aM3/yeejbRqRQ0OYWRde4unyTpiAtSLcArbZx+pXWZ IYrA== X-Gm-Message-State: AO0yUKW2c8GItLNRoa+I5YnH1gtegXV/CDFXd7lR1S03ABrKqYYBw/Nn PbOV5CjtWoup+Vj5JfYIxTw7+A== X-Received: by 2002:a05:651c:1682:b0:293:2bf4:d939 with SMTP id bd2-20020a05651c168200b002932bf4d939mr4188139ljb.12.1678192323932; Tue, 07 Mar 2023 04:32:03 -0800 (PST) Received: from localhost.localdomain (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id t20-20020a2e7814000000b0029462e98c07sm2156501ljc.35.2023.03.07.04.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 04:32:03 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] clk: qcom: gcc-msm8996: Update the .pwrsts for usb gdsc Date: Tue, 7 Mar 2023 13:31:58 +0100 Message-Id: <20230307123159.3797551-2-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307123159.3797551-1-konrad.dybcio@linaro.org> References: <20230307123159.3797551-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759713082872704771?= X-GMAIL-MSGID: =?utf-8?q?1759713082872704771?= The USB controller on MSM8996 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. Work around this by updating the .pwrsts for the USB GDSCs so they only transition to retention state in low power. This change should be reverted when a proper suspend sequence is implemented in the USB drivers. Signed-off-by: Konrad Dybcio --- v1 -> v2: - Reword "fix" to "work around", mention it should be temporary - Add TODO: drivers/clk/qcom/gcc-msm8996.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gcc-msm8996.c b/drivers/clk/qcom/gcc-msm8996.c index e16163706735..5e44d1bcca9e 100644 --- a/drivers/clk/qcom/gcc-msm8996.c +++ b/drivers/clk/qcom/gcc-msm8996.c @@ -3455,7 +3455,8 @@ static struct gdsc usb30_gdsc = { .pd = { .name = "usb30", }, - .pwrsts = PWRSTS_OFF_ON, + /* TODO: Change to OFF_ON when USB drivers get proper suspend support */ + .pwrsts = PWRSTS_RET_ON, }; static struct gdsc pcie0_gdsc = { From patchwork Tue Mar 7 12:31:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 65433 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2404980wrd; Tue, 7 Mar 2023 04:39:27 -0800 (PST) X-Google-Smtp-Source: AK7set+l6f+QRQ50TLvoIhUPfssTlg44xe5BOcrpy+UzZHmKgvAAFRKQelJUxx0Tw/QOoZIaxq1f X-Received: by 2002:aa7:968e:0:b0:5a9:bba9:f25b with SMTP id f14-20020aa7968e000000b005a9bba9f25bmr14177036pfk.17.1678192766888; Tue, 07 Mar 2023 04:39:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678192766; cv=none; d=google.com; s=arc-20160816; b=TJfukiTi9jY7CEIDjnbFJLJoTgoamOh7HVBqHbcgduGXTvCvUsgkHgYpwR6IYjCXB6 l7FkzYAdOtVgGCZuR6LOGABNvdsQsueXnUpEi883lfaLQhzf2laRQ+RIEFluZOI0F5Gj NmsHuW0TLPLwhmDsJQD6+bdx6w2m9JcAoLmDSQaFkhW7nGSCHUS94EG8xbSA9E5ykY5/ MelWyBhmd4c/niJBYBtPHeRVnh5vXPlV4a3bi2EqvIYQIFjpsVfT38eDTql+WQzlNMRK aolfje8NSUfiDAuQkf3OZmwEvJimhO0lQt+B1m7f55j2vQOUf9ncuDFOcaNXNYch2pwL c1ww== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xoKKJZFHs/8MSrXZ3Q3rY87HaTCz1bnlS/tCHR2CSg8=; b=C7ZK6Ao5uask0sTax6p2sivMqru7ccTWXiBD5GJ0MtX0MY4zJlCHDUBbN9NpuLjPxG o6lScDKN1w9+7mF9vvrYEpGt5qnpaOV7J7R/CMvXLukADAFYk6XND0k9WsIcNs5Ym4rv I6uScxK8G5ogAF6iuDM/DaChYstW2hv9/hWYC6obB0qu/s8igwM1eD91PAzqhQjbBnYU NSLJLfr8YJvLbbRyiY4+v8WVjTfLR6ECynsHaGPjjsWdSNrFdEH4avhJIbKqTSn5RFmp MyxvgQtEwGgOw8vlJbF5XKYtNsSc5EfzWx3Es38eGpn20kjGsuPtyL1eegEyvucT3QNX Xqqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="iukR/+gr"; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020aa79d8d000000b00593ac87bbadsi11471478pfq.202.2023.03.07.04.39.13; Tue, 07 Mar 2023 04:39:26 -0800 (PST) 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=@linaro.org header.s=google header.b="iukR/+gr"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230224AbjCGMcN (ORCPT + 99 others); Tue, 7 Mar 2023 07:32:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjCGMcJ (ORCPT ); Tue, 7 Mar 2023 07:32:09 -0500 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B875E77CAB for ; Tue, 7 Mar 2023 04:32:06 -0800 (PST) Received: by mail-lj1-x231.google.com with SMTP id t14so12957463ljd.5 for ; Tue, 07 Mar 2023 04:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678192325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xoKKJZFHs/8MSrXZ3Q3rY87HaTCz1bnlS/tCHR2CSg8=; b=iukR/+gr8EDtbfyWkLTmOTMQnMAsxA/0IeNzNwgq/dhuq9kO6YGSJosg68f368zs15 YstaY/Co/MOS3Qp3JiWxIWMuC21LDZWh03BFpQKUDWfdx3935xpOSs8fPXDwYAIkHcAg CH/HQ3F8DMCCNRdR4VFlCJhmbLftuEpuioYs28eaX9BzZHmtDgl/8B9vuHe527AMUNrp rt/fT+PhZJbUQKKPYrfjuhZ8oStjiQSkHtyRuHmK/f5NiuCQL9phOn70TJwUaZE5cG4z HbdZHc35xbDUnRBrad5Rm5jt3Xau35GnjeMdzmSjIfJ4WjfD8OlEgUt1DqwTCfaFa6a9 P7ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678192325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xoKKJZFHs/8MSrXZ3Q3rY87HaTCz1bnlS/tCHR2CSg8=; b=w2iW2IPprHmu9tN4TKNYb133Rw2fFzWQ1z5pX8LogkcS7blhBpVSk13C/hsfgn/ycP gms9k4eNo3O0PW5P0+C+VALY0tv78zHa7Zla8o6MUqZ9VsQ0P47wva2NLBb1O8hzSHlK NRwD0Nx0bY1oUzvE0vHYQQPbOjmVMj2WBmQEzKL0Z9xc9+su6FxcLExhq9Y+9LXZTSnY 8Dyjd+rzH4Jqja++LyyA+ejiIGPEeHI1l+SyhtXuTtAt8Xnj4hCmUUzGe8/X7EPOeq1J MOfIa7/WmGyjcvNEQjGfiVKkcaPWdCresNDGCmRcafWALlc8n6TH/uHiwhnGL8UbfssN fBUw== X-Gm-Message-State: AO0yUKXZvXY5cKRmv7o1ZMuNf1bI+Vx+AHsR3ABRN9HRAouGG7U2mt7G len+LQsggxyaoIFH7tpPbAENsA== X-Received: by 2002:a2e:808e:0:b0:295:9ba2:8a78 with SMTP id i14-20020a2e808e000000b002959ba28a78mr4869643ljg.17.1678192325107; Tue, 07 Mar 2023 04:32:05 -0800 (PST) Received: from localhost.localdomain (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id t20-20020a2e7814000000b0029462e98c07sm2156501ljc.35.2023.03.07.04.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 04:32:04 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] clk: qcom: gcc-msm8998: Update the .pwrsts for usb gdsc Date: Tue, 7 Mar 2023 13:31:59 +0100 Message-Id: <20230307123159.3797551-3-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307123159.3797551-1-konrad.dybcio@linaro.org> References: <20230307123159.3797551-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759712658325725981?= X-GMAIL-MSGID: =?utf-8?q?1759712658325725981?= The USB controller on msm8998 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. Work around this by updating the .pwrsts for the USB GDSCs so they only transition to retention state in low power. This change should be reverted when a proper suspend sequence is implemented in the USB drivers. Signed-off-by: Konrad Dybcio --- v1 -> v2: New patch drivers/clk/qcom/gcc-msm8998.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gcc-msm8998.c b/drivers/clk/qcom/gcc-msm8998.c index f1aacbfe6bb4..8790bbdcd2e2 100644 --- a/drivers/clk/qcom/gcc-msm8998.c +++ b/drivers/clk/qcom/gcc-msm8998.c @@ -2901,7 +2901,8 @@ static struct gdsc usb_30_gdsc = { .pd = { .name = "usb_30_gdsc", }, - .pwrsts = PWRSTS_OFF_ON, + /* TODO: Change to OFF_ON when USB drivers get proper suspend support */ + .pwrsts = PWRSTS_RET_ON, .flags = VOTABLE, };