Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1089430rwe; Thu, 25 Aug 2022 15:25:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR7H/vr7R2ipq/IGfEIcoDckJ5hQeEZgroQug0qxsmP2dXK0zUs//Yt/xRSv7JkZMwVd3k1X X-Received: by 2002:a17:907:7388:b0:73d:64fc:a735 with SMTP id er8-20020a170907738800b0073d64fca735mr3581886ejc.213.1661466313860; Thu, 25 Aug 2022 15:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661466313; cv=none; d=google.com; s=arc-20160816; b=GnEhQKvlsHT+m/wUovPTTgLvEcrr2hM7IU160Obk2ctXWXcs4E83CPkRxPXpCQFquy E2donoYgrmTj8DqWxdl//R6EKauvzYDPCpibmD0sEf0HYLhVaw5FsWcCQ60mTURtbGnR v9A5lZbnNUUAocoRlgdrHNoSGEMQmIySLB4WUaIvFiihXHXJQpY7S7dL5DCIj0zdsGjn GJwBNObMZqP19Zr3eZjzYt6Wsxinc9maVRXZ+f2t1RBJuXi3dcIL3BLZVpftemHlLOmc 3po00+/v5IWtw1+obh0DCnJ93okAfYFgVlwhJ1nbK141mj8zT/UmMNusAJMeJyZKNtDo 4rgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vBeKGRK+cVut8bnT/6A/lBEbRGscI4sDYwtvLgwZl6U=; b=yVeUDDSVqbDspUr7A4gPZQfJZbBTokFIzR/jWdcqYeHd8HHAhD9fgh+MMYrk0JMDyy 3BDTDL41c0uN9se0SaEmheiyDNjh1NwVPXVSfgPhQXQvqGD+BV5w4FmsA7vZ8pWnC35z DIH+ZuAAZzHydZfJ/WNWmww7TignTx6RPfJLIA5MP3GZeCZFsOlj2u9z8T3I6DqENoUL rTImyVwR0rQTqhnYu8ptkKgrYlxLnVPlIXD9o9rrFXwz5b4jNKWONXz4jB/ltpT3fDP5 0Cj1Z12I7viC8SN4UrDgqnEobymrO2WLj8ee843e0rgK9l5aLzrAl5DGhLZYNYTsbNny AeOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=F2p4W6Op; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a056402195500b004438278b0bbsi357070edz.317.2022.08.25.15.24.48; Thu, 25 Aug 2022 15:25:13 -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=@chromium.org header.s=google header.b=F2p4W6Op; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239106AbiHYWRE (ORCPT + 99 others); Thu, 25 Aug 2022 18:17:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbiHYWRC (ORCPT ); Thu, 25 Aug 2022 18:17:02 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FBFB2F004 for ; Thu, 25 Aug 2022 15:17:01 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id u22so2289plq.12 for ; Thu, 25 Aug 2022 15:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=vBeKGRK+cVut8bnT/6A/lBEbRGscI4sDYwtvLgwZl6U=; b=F2p4W6OpYD0wiVHVa4HW9N6SRDY4WeCbz0KXJ48rzzY498kDUBYTVxhaII6smH2bl7 pcIcQkWepEKfD5Kjjj3kYSawEceO4eGv+SGFZjIZ0JOoAIjgbJoaiiiekqXOFQ71QRRK uHY1EooZ5DsTIyZdDCXnakFYtopCAu+rSEDVg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=vBeKGRK+cVut8bnT/6A/lBEbRGscI4sDYwtvLgwZl6U=; b=sjgGVDl5NBHwgYF9bN9bVbx5XJr4Sg5Xtme5+Gu7xO2Hlk8Z3ebhtLgAeJ5YWMAdLS g6RFL+9gJEnaOIXUgxvgnbnCEyzlqhhwuK406h5MtT19TMLjfVq91Iu4oT5PBEb5F28o Z5UQXLCO3OO0SVwEW4Gmr9F0zGwf8HZvLLx7E+NrCEmG6bgfO6alpmvu54phMvopH75p hMi4mBFwSphZw2NZHBmt2Vx3KVVfKNle5wz+Mu+TxHJihsopdwzVc7vTg0XrEdqQNpoz D+g3YTrrzUCAa7Jr6JcYV4epWeOMPWBAKlOHpUVof7MJ62VrIT0gL20d8gMoGuTOjViC m4bg== X-Gm-Message-State: ACgBeo3mc/4td6xrZbUv068ncvCRYITwb2tGu78zCQAq9cNp9p0vX2yJ +NSY+mRiu5IwG3qpkK3Xs6DDWg== X-Received: by 2002:a17:90a:7805:b0:1fa:bdab:7d59 with SMTP id w5-20020a17090a780500b001fabdab7d59mr1141849pjk.37.1661465820535; Thu, 25 Aug 2022 15:17:00 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:d529:f79d:2a1a:4e61]) by smtp.gmail.com with UTF8SMTPSA id w9-20020a17090a15c900b001fa9f86f20csm213319pjd.49.2022.08.25.15.16.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 15:17:00 -0700 (PDT) Date: Thu, 25 Aug 2022 15:16:58 -0700 From: Matthias Kaehlcke To: Johan Hovold Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, Johan Hovold , Douglas Anderson , Krishna Kurapati , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Bjorn Andersson Subject: Re: [PATCH 2/2] clk: qcom: gcc-sc7280: Keep USB GDSC power domains on when USB wakeup is enabled Message-ID: References: <20220822115246.1.I45235b7c40997bc2abf813e4722b4dcdd6aecf6b@changeid> <20220822115246.2.If09027f73daa6e1ed95f5eab02326b543c67132e@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, Aug 24, 2022 at 10:47:44AM +0200, Johan Hovold wrote: > On Tue, Aug 23, 2022 at 09:42:53AM -0700, Matthias Kaehlcke wrote: > > On Tue, Aug 23, 2022 at 01:16:36PM +0200, Johan Hovold wrote: > > > On Mon, Aug 22, 2022 at 11:53:11AM -0700, Matthias Kaehlcke wrote: > > > > Set GENPD_FLAG_ACTIVE_WAKEUP for the USB GDSC power domains of SC7280. > > > > > > > > Suggested-by: Johan Hovold > > > > Signed-off-by: Matthias Kaehlcke > > > > --- > > > > > > > > drivers/clk/qcom/gcc-sc7280.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/drivers/clk/qcom/gcc-sc7280.c b/drivers/clk/qcom/gcc-sc7280.c > > > > index 7ff64d4d5920..4ff855269467 100644 > > > > --- a/drivers/clk/qcom/gcc-sc7280.c > > > > +++ b/drivers/clk/qcom/gcc-sc7280.c > > > > @@ -3125,6 +3125,7 @@ static struct gdsc gcc_usb30_prim_gdsc = { > > > > .gdscr = 0xf004, > > > > .pd = { > > > > .name = "gcc_usb30_prim_gdsc", > > > > + .flags = GENPD_FLAG_ACTIVE_WAKEUP, > > > > > > Have you verified that the power-domain doesn't need to remain on also > > > when USB isn't used for wakeup? > > > > So far I haven't observed issues with this on sc7180 and sc7280 when USB > > wakeup is disabled. > > Ok, good. > > I would have assumed that it needed to stay always-on before the > s/device_can_wakeup/device_may_wakeup/ change as before that the PHYs > would be left on regardless of the (sysfs) wakeup setting. That make sense, not sure why GENPD_FLAG_ACTIVE_WAKEUP works with wakeup disabled. In any case setting the genpd flags directly in the gdsc descriptor doesn't seem to be the right thing to do. With GENPD_FLAG_ALWAYS_ON my sc7280 system stalls at boot. It boots when ALWAYS_ON is set in the gdsc flags, which ends up setting GENPD_FLAG_ALWAYS_ON of the genpd. I'll send a new version of this series which sets the correct flag. > > > This is the case for sc8280xp and indicates that there are further > > > missing pieces here (at least for that platform). > > > > What are you observing on sc8280xp when wakeup is disabled? > > The wakeup setting doesn't seem to have anything to do with the genpd > issues on sc8280xp and the controller doesn't resume properly regardless > of whether the PHYs have been disabled or not during suspend unless the > PD is left on. I'm essentially seeing the same. USB is hosed after resume unless the PD is left on. On Chrome OS we currently work around that with a version of commit d9be8d5c5b03 ("usb: dwc3: qcom: Keep power domain on to retain controller status") which was reverted upstream. I'm not sure whether USB worked after resume before we enabled wakeup support. I would have sworn it did, but we landed an old version of the wakeup patches a long time ago, so my memory might be failing me. I wonder what the status on other QC platforms is, from a quick grep it seems only msm8953 sets the USB gdsc to ALWAYS_ON.