Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3647180lfb; Mon, 9 May 2022 00:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO8CsgKyfqfZodxRlT4mrlF8scPo48bxpk4wkLrapJWQuJSCU6Vj3P5p+s5NZTBmVZ2h+d X-Received: by 2002:a17:903:18b:b0:15e:92b9:783 with SMTP id z11-20020a170903018b00b0015e92b90783mr15472062plg.30.1652082250597; Mon, 09 May 2022 00:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652082250; cv=none; d=google.com; s=arc-20160816; b=rk3BrhoCNITevMUx10dj4F1Xy2wMiBfXiBwcbr6jNpt2a5Tp/jt1WtgBywrX7LcfZ+ IBKhnPA2rLW14Ee47ggVRLyDWw8E6ieqYCzVJbhpBBK2caHTg6/aaeICVxqrMsN/FtrA X7+WrCS3BtZPopApDlogEmvO8aetiCCkp9NT1jP28Uz6XGOmljM3F6bhqSs9yALqVQ6X AE4tYCzV/VU8dYSr1wTS9sdQUshnOnwomAKljubjqvt3FN2reeJhieMCZIjWvvWCSKaw bcCB8/J8ro0UayTf8+Tie/CkYMK4EGUIQlDdNktQ/ZdUhs9zy9pqhAaCR+k/yFW7p7cg wzaA== 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; bh=lzCg2Bsi/uSp5a8weLn006iGoAzzKioC6Ok0BKqgd7g=; b=tJgGBX/6Yf/N+HwFNl8qWGfjX6daueQF5BJelXpbMRpAIhHjGXXPMyMskNo1H8Zdjs E13C5kaSI7xjtuGZd/G00iH5L3mloq1ijIMEYmRPxCZBcZPWp0fO+upuNaUQZ3TAPF3i 4iZdBEgv6gqS9tJViYM+MYIqySPuBHXEu21Ouv88j+KUP+Z3vWTIU3OSk1nxkuNFw2Id cCKtlJK3aggITgaMRRuydnQYC0TqDdsbli4tU1802Wz8Ak9wWlV5eRbXZfeSfeQNcWaw beERamAa/Vc0hcoM29a2ihQ8vAJPhtzo93TTv9CCQYUJ4eHj8PxsLjRWK/OXLetpBCxn I27A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y13-20020a17090322cd00b0015838c0eedbsi12432051plg.506.2022.05.09.00.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:44:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 20D601A3592; Mon, 9 May 2022 00:38:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234575AbiEHPLJ convert rfc822-to-8bit (ORCPT + 99 others); Sun, 8 May 2022 11:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234437AbiEHPLG (ORCPT ); Sun, 8 May 2022 11:11:06 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5062ADF76; Sun, 8 May 2022 08:07:14 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nniV4-0000vT-EH; Sun, 08 May 2022 17:07:10 +0200 From: Heiko Stuebner To: Brian Norris , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Chanwoo Choi Cc: linux-kernel@vger.kernel.org, Elaine Zhang , linux-pm@vger.kernel.org, Doug Anderson , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [RFC PATCH 2/2] PM / devfreq: rk3399_dmc: Block PMU during transitions Date: Sun, 08 May 2022 17:07:09 +0200 Message-ID: <44651538.fMDQidcC6G@phil> In-Reply-To: <6c6ec0db-111c-e48f-57ce-0e444a0d168e@gmail.com> References: <20220406014842.2771799-1-briannorris@chromium.org> <582e3645-b24e-356e-7f0f-0d37bb1e32e6@gmail.com> <6c6ec0db-111c-e48f-57ce-0e444a0d168e@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Am Samstag, 7. Mai 2022, 16:21:59 CEST schrieb Chanwoo Choi: > On 22. 4. 14. 08:13, Chanwoo Choi wrote: > > On 22. 4. 14. 07:45, Heiko St?bner wrote: > >> Hi, > >> > >> Am Donnerstag, 14. April 2022, 00:14:40 CEST schrieb Chanwoo Choi: > >>> On 22. 4. 6. 10:48, Brian Norris wrote: > >>>> See the previous patch ("soc: rockchip: power-domain: Manage resource > >>>> conflicts with firmware") for a thorough explanation of the conflicts. > >>>> While ARM Trusted Firmware may be modifying memory controller and > >>>> power-domain states, we need to block the kernel's power-domain driver. > >>>> > >>>> If the power-domain driver is disabled, there is no resource conflict > >>>> and this becomes a no-op. > >>>> > >>>> Signed-off-by: Brian Norris > >>>> --- > >>>> > >>>> drivers/devfreq/rk3399_dmc.c | 13 +++++++++++++ > >>>> 1 file changed, 13 insertions(+) > >>>> > >>>> diff --git a/drivers/devfreq/rk3399_dmc.c > >>>> b/drivers/devfreq/rk3399_dmc.c > >>>> index e494d1497d60..daff40702615 100644 > >>>> --- a/drivers/devfreq/rk3399_dmc.c > >>>> +++ b/drivers/devfreq/rk3399_dmc.c > >>>> @@ -21,6 +21,7 @@ > >>>> #include > >>>> #include > >>>> +#include > >>>> #include > >>>> #include > >>>> @@ -93,6 +94,16 @@ static int rk3399_dmcfreq_target(struct device > >>>> *dev, unsigned long *freq, > >>>> mutex_lock(&dmcfreq->lock); > >>>> + /* > >>>> + * Ensure power-domain transitions don't interfere with ARM > >>>> Trusted > >>>> + * Firmware power-domain idling. > >>>> + */ > >>>> + err = rockchip_pmu_block(); > >>>> + if (err) { > >>>> + dev_err(dev, "Failed to block PMU: %d\n", err); > >>>> + goto out_unlock; > >>>> + } > >>>> + > >>>> /* > >>>> * Some idle parameters may be based on the DDR controller > >>>> clock, which > >>>> * is half of the DDR frequency. > >>>> @@ -198,6 +209,8 @@ static int rk3399_dmcfreq_target(struct device > >>>> *dev, unsigned long *freq, > >>>> dmcfreq->volt = target_volt; > >>>> out: > >>>> + rockchip_pmu_unblock(); > >>>> +out_unlock: > >>>> mutex_unlock(&dmcfreq->lock); > >>>> return err; > >>>> } > >>> > >>> Acked-by: Chanwoo Choi > >> > >> so I guess you're ok with me picking up both patches, right? > >> [Just making sure :-) ] > > > > This patch have the dependency of latest devfreq-next branch. > > So that need to make the immutable branch between rockchip and devfreq. > > > > Hi Heiko and Brian, > > Is there any other progress? > > IMHO, if rockchip maintainer reply the acked-by from patch1 > and then agree these patches to be applied to devfreq.git, > I can take them. sounds good to me. Patch1 looks good and correct to me, so I've added a Reviewed-by for it and it defintily makes sense for both to go through the devfreq tree then, so we don't need additional stable-branches :-) Thanks Heiko