Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp385739rwe; Fri, 26 Aug 2022 06:55:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR7w/dTXY2kpSfBOvJY6AxrcDj+j8XoVkuiaMcXCiSDRi+SAQgBY/slBxUHR9mbq9I+NTZ+x X-Received: by 2002:aa7:da4c:0:b0:447:fb78:7dd8 with SMTP id w12-20020aa7da4c000000b00447fb787dd8mr1578801eds.341.1661522144800; Fri, 26 Aug 2022 06:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661522144; cv=none; d=google.com; s=arc-20160816; b=YkoHIlR24z6BuP4A2Nd3NrY8rAVHafbrD1KXnuIxiNHtKKlPFkmA0fna4TvEc9KpPt +yocYwk+/g68E30AA+fdfMxr30/INbgD/kkIe5tw30b0hP9Q4KtmTv5yEmsFwH2wv7Ik xI50JSU5PMXneZmikvQi02Hy1blwMiy5qZozQjJ703vfcF4QVS2Pn91Bb/ldYcOINwSH XGkRZwGJMWyoXy6gOnuY49E8cpXsIflTe2WuWmfzmjcCBd/bRgVjIgS0VSZJ0Pl5GtYP rwK3z9z9YXIj0uVhAt+ut6ocNLEpcp4legnL9bPHtk7L4qprBd/IMbwRx98bFddRYwF7 2ugQ== 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=CHTCunlpvy9js5sdVWAAlZTqUYUZ7Iaa0wqOedrNwHI=; b=OfgIyAba8ZKc7tcWYyH7mDrlGkuiw30UD66bjU8VSBErSXQ/fiH+kg8l+23Hd4NRpf NdGsqZt8HPb4aF7jfBK4+2S7osL0kzSOo5Y+9B5hWnp0upcsJNnppvehMoN/dQ0L9Dol 7OkdTGKL1V6/BHNn/LMgA+vryDB790wSSnyI3o5OdyYdCkny8OF0L6QkutYTyfnQ/lFy sW2uJ3QpKzM1bQ/Ryb+ZeLV20NZTn3PNMSFPk6HEVJ1wSGsMaKuWUWRS6/riwdKICfF9 2BJmR/jRAjf5vTmyRRRQk66MEo/FVbao3XdMZ/sjiwzF+ep3GENeBoajUVp/XskVrWUX ++Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=h3HcFtjP; 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 qf31-20020a1709077f1f00b0070795e99fe3si1369133ejc.984.2022.08.26.06.55.18; Fri, 26 Aug 2022 06:55:44 -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=h3HcFtjP; 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 S1343887AbiHZNFl (ORCPT + 99 others); Fri, 26 Aug 2022 09:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343953AbiHZNFY (ORCPT ); Fri, 26 Aug 2022 09:05:24 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B0621F623 for ; Fri, 26 Aug 2022 06:05:22 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 202so1350302pgc.8 for ; Fri, 26 Aug 2022 06:05:22 -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=CHTCunlpvy9js5sdVWAAlZTqUYUZ7Iaa0wqOedrNwHI=; b=h3HcFtjP7/AnVHUZVv1r9YFQtSPge8mn4LlAXrSafWS5Ym1Y0N0FWtnK715/Ty5FNp pQquKsGavtHhFQQEOpmxzZHkFlDUxkZBI63wz71Nb/uGvSzDZk/fGsPSv7krJWyXzV27 fpUOmVpwZTUZayOZ1dez3L0at8LJzcHKOPyd4= 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=CHTCunlpvy9js5sdVWAAlZTqUYUZ7Iaa0wqOedrNwHI=; b=emoGe4pJdVFm0qS+S08z5zFFcf3Hq49ykViOn1FQDCQuYYHVJlTG8ZbGVWYCNjy+Fj 16GpJlI4KhHQ/uMgnGacNj1zJiNKb5jl8+vaYlfh07mjofJrqgczB5TooJEeZ14tgi+N eEJ0SK3rPQQV1HaBwOfNz5OVqpJEGZbDXlERovoBm5OyXArtKNnqPGvICu49dyEn4zxj OE6sEVKScaqvU01Mjz1bjblRReoyje5NBDUV2pGFJ0bYJETQA7zark+Cs7gVIYS6AxZN ri0Iip4wpfOgoa2Z61T7FvAX6HDnvwLcH3N1pCffta2j03mbieXyh494LQrkN+3n6p2K E9dw== X-Gm-Message-State: ACgBeo3YJwSYgKzWLL4jipkimZIuSbU+o3N9q4lhan/DgAoHoN1dnNFX gWpoUZRMVqq8xgCbuaYAGQbm0Q== X-Received: by 2002:a63:6b05:0:b0:41c:2216:d2b2 with SMTP id g5-20020a636b05000000b0041c2216d2b2mr3300925pgc.118.1661519121548; Fri, 26 Aug 2022 06:05:21 -0700 (PDT) Received: from localhost ([2620:15c:11a:202:2a3c:773f:ac25:a127]) by smtp.gmail.com with UTF8SMTPSA id o9-20020a17090a4b4900b001fbb0f0b00fsm1570275pjl.35.2022.08.26.06.05.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Aug 2022 06:05:21 -0700 (PDT) Date: Fri, 26 Aug 2022 06:05:19 -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 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 Thu, Aug 25, 2022 at 03:16:58PM -0700, Matthias Kaehlcke wrote: > 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 need to remind myself that keeping the GDSC on is only needed when the PHYs are kept on. The PHYs were always off before wakeup support was added, which is why USB wasn't broken after suspend in the pre-wakeup days. > 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.