Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp102268rwe; Fri, 26 Aug 2022 01:16:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR5kdnXIMKcqDZDEkMPFpNj8cPGLoFHnWzh5pne6LiOMzXO3oMMq+7VNi1UCWfMoWMQjBNKQ X-Received: by 2002:a17:907:270a:b0:73d:721e:d057 with SMTP id w10-20020a170907270a00b0073d721ed057mr4793497ejk.501.1661501802896; Fri, 26 Aug 2022 01:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661501802; cv=none; d=google.com; s=arc-20160816; b=pj2YmokemHgvqoBEAB/S4dmyAVtZcMIuoeBMAebsXZP0xwRsMrX+M86dZyyrN3UrQQ 5tRhBt7IDmAZr0xWYz6bA0YcYS2XAMCbWtWA6bKneiPxWnCCzjqnKN2WO3RjpWyL5Qhr oCN8UWaq1+xGgHvCZjZM9lwl7PKY7xbUqmP9nhPDh56K3iBeFixAARq7at+bNG+FjLfH PYM2epmjskxMWsO+VdTnQQ06+idSnoCYMyhkaTBhxowRSFIE2zLJruxQztox6dJozZd+ etQQmbDi0euOJAhoshGOs4zW8W91bDtOOIT1JDu+OPasa4ZFZcjdh7k2aSGt8CXjWKos 8ivg== 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=Bf02zfmyqfRj61Xy78DAXKbSgruonrFqVJgijqCyOSo=; b=ZXDY2Sqzle8UestgmgeZcFPplc4lRRpC27UBnRxElTYrRlRpgNJFefZGak1w15mFdY tupLodU6xmAcPt8kOJWWaW+WpBWFtg7b1R4MmSzF0JHgAh1qWc8NF1ymEVxPoAu8+ItW szijgbB36QT5t4AIwpza8FOMDE1E30uSks1lpq4ySXpXKFJ3oBxXOPrAURiXTQQNv3Li R40BxVz+0qnJ5JzMfW3vF/DjQJToOy7nOXb8HWlEqtJFxBndtWNuh9TRwK8plOTOBfqw RV203PFbPwl8qnX2eTuFblbB4zrtKx8aKpNyILqWVSCIXTgnvYZp+Iz4nma5Q6eTRgDc r4LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WOIyLxoT; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt15-20020a170907728f00b0073db353cb25si844286ejc.869.2022.08.26.01.16.17; Fri, 26 Aug 2022 01:16:42 -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=@kernel.org header.s=k20201202 header.b=WOIyLxoT; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245084AbiHZHMI (ORCPT + 99 others); Fri, 26 Aug 2022 03:12:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbiHZHMH (ORCPT ); Fri, 26 Aug 2022 03:12:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8598DC04CA; Fri, 26 Aug 2022 00:12:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1C5C8B82F0D; Fri, 26 Aug 2022 07:12:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF99BC433D6; Fri, 26 Aug 2022 07:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661497923; bh=kt9JPLC7CCExSXRZP3B3Wuc6p/ol2wlUIiF6Mx920cY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WOIyLxoTBtPfoPkZ1fEpC8lLHH9HEQ45oxTFNAyrOCgvvgM4Pk3sFb4O/DehvstRX NQNc5d9w1thudV4z3KkGq5qz79AYwOv4oF0ubvUZOq2BWmSe4Yrt+WeVZvi6g9e6Yy r6kez22pAFvaQAv5P8Im+vG8fWXCsGBZh+2n1V8j3yakNicCLBzLR+L2PrXNm0PTjm 5sAOnlnv7haOjBHnZJFw5T6DhAZAVCxaOmBUVz1riv7VlBNKoo1FlxZPiFDmS4HpYX YkaJ1TZG6jfrlFgLzl7xkMWWC4jci8hXX11ltNvVQAH+XOvsNxWUTvNOiFJLpAuEg+ Di2cKANXXGtKw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oRTVj-0000oJ-J0; Fri, 26 Aug 2022 09:12:11 +0200 Date: Fri, 26 Aug 2022 09:12:11 +0200 From: Johan Hovold To: Matthias Kaehlcke 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=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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. Yes, GENPD_FLAG_ALWAYS_ON needs to be set via the gdsc ALWAYS_ON flag as genpd expects the PD to be on when registered or else it silently errors out... https://lore.kernel.org/all/20220805121250.10347-3-johan+linaro@kernel.org/ > > > > 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. Thanks for confirming. > 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. Yes, this is likely needed on other platforms as well. Johan