Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp69641pxk; Fri, 11 Sep 2020 00:07:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw14lOSaLeIdqEEY3CPCmxfDYxBK2f9u2vQIEU1SUNbI30sAkPkyUDprtZxPwEk+1A/rDer X-Received: by 2002:a17:907:2506:: with SMTP id y6mr645970ejl.265.1599808024323; Fri, 11 Sep 2020 00:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599808024; cv=none; d=google.com; s=arc-20160816; b=qnE8zWZ82cb8VvCmkiVmCesAgIYMpbXIBdl/0hUMZKTbyIsBuyWBm9hZbxnCdPZS1f Ld+HBOhVAEoZoU1EKIgjNL3JwQ3PMwhSt3C8RimAl8KxLVX16yPC51W83NzkNgzkyehV y7i5X4xA6+/jc5Lv1td3Z3fbUx+g8gaecP/6ZBsuy9fWu8o2WHdy+skKYmg+clVZDTaR Wc4kNLUuUHkb3fi/3IgxwrQI/2ON/XYKXy6siSEjrDQs994wCER5xfLE3ckWaGSFBQU+ ZFhAMpawH0Rctycl6/X0VrEv5oGh/SyNV8pOuZR7yfvI8MDwP3ZJs2/5thSnlxKBEmnc 1j3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ccFFbA9B/80814O047PWW9IYr+YcSRpx5Jz4CVkD9V0=; b=bKglFdUwc0CBBzogI/WRsOVuHn6G9vKJPFSnbVRDUw0PEURvd+p5BDmQ1R2pHjPfFB IxM5uUVpSGvXC6B4Gxqojjgb5M8rMQFKdGgMrmqSmjxQUk/gpzYlDdPLrQBFTO9joYjl KWrJ95ZVCrbP6xegyX29cGtAsspLNFspAYutmA5j7I228IudSKoYKEezJW94xkddjE3Z /x3nhyulT1OOTd+oei0Lb5UBQIOlXqkVfoeyl7C/d422/IQrSRHEAhsWdtgM4qAq97K9 DEMhNuJYIACTGWmZ7cMYnpGHPpOoG8BnXHxmV7nFpONunmTkqCcpnBke7L7YdFtXcGmx 86vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FNRrNT1v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si793946ejr.202.2020.09.11.00.06.41; Fri, 11 Sep 2020 00:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FNRrNT1v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1725866AbgIKHFF (ORCPT + 99 others); Fri, 11 Sep 2020 03:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbgIKHFE (ORCPT ); Fri, 11 Sep 2020 03:05:04 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B18B0C061573 for ; Fri, 11 Sep 2020 00:05:03 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id a15so11427899ljk.2 for ; Fri, 11 Sep 2020 00:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ccFFbA9B/80814O047PWW9IYr+YcSRpx5Jz4CVkD9V0=; b=FNRrNT1viu436RH4fQuWLx7CxRGHkp9KJGRLQAfP58OGhvAUHAqPH70pcezhd4bbJn pt/z0CTcG1EOVjs03KytRaGjTljrUdlRSZReupBDG0eNoCAHEnMVZRQqayw9Luu9UbH+ KtqKGi4SxcfZIJ/++LwOclntQXmdDZjw8iVrI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ccFFbA9B/80814O047PWW9IYr+YcSRpx5Jz4CVkD9V0=; b=lBf2CZd2IjWSV1mG+VNh0z3jIaCt3h9mTl8A7m1EWaMNDaeqjRybLxTslM7nBs1l14 9Ycuerx4f6RGS6GxZluQMDLaPXR/SxoId0DvqkFXq33euq++2eac07DRH1EeFJkyUv9l LWl1+yvlepzpe2YtdXFdoe6vmHEygdKgs0ehg5nAqdWpDUA503eRpdGLhS25qlZ4de2a KVwhtha27j2E4LEQ+8OeqenJCJ4wBfX62jyPEQTOhgwJ1rFGTJr6s0fpbth/c2NhI8rQ FG2VPPtA04SuEJ9yhN3jaT3H+IbwRHwa8sALs7wcys+V+zjfWOngKgPTgXUQEYY2XW9n OF8w== X-Gm-Message-State: AOAM533VJNEVWPFXhdkQHKjGe8+KymYweK6eFU1SkaoqujONgq4GRDrl dQzeaM6sONot41HyxTvbXy4uum84spcOPAmum6sa6Q== X-Received: by 2002:a2e:6c03:: with SMTP id h3mr245615ljc.212.1599807901466; Fri, 11 Sep 2020 00:05:01 -0700 (PDT) MIME-Version: 1.0 References: <20200730120054.1.I5e6f8c262031d0451fe7241b744f4f3111c1ce71@changeid> In-Reply-To: <20200730120054.1.I5e6f8c262031d0451fe7241b744f4f3111c1ce71@changeid> From: Nicolas Boichat Date: Fri, 11 Sep 2020 15:04:50 +0800 Message-ID: Subject: Re: [PATCH] soc: mediatek: Check if power domains can be powered on at boot time To: Matthias Brugger Cc: Daniel Kurtz , Sascha Hauer , linux-arm Mailing List , lkml , "moderated list:ARM/Mediatek SoC support" , Enric Balletbo i Serra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matthias, gentle ping on the patch below >>> Thanks! On Thu, Jul 30, 2020 at 12:01 PM Nicolas Boichat wrote: > > In the error case, where a power domain cannot be powered on > successfully at boot time (in mtk_register_power_domains), > pm_genpd_init would still be called with is_off=false, and the > system would later try to disable the power domain again, triggering > warnings as disabled clocks are disabled again (and other potential > issues). > > Fixes: c84e358718a66f7 ("soc: Mediatek: Add SCPSYS power domain driver") > Signed-off-by: Nicolas Boichat > > --- > > drivers/soc/mediatek/mtk-scpsys.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c > index f669d3754627dad..0055a52a49733d5 100644 > --- a/drivers/soc/mediatek/mtk-scpsys.c > +++ b/drivers/soc/mediatek/mtk-scpsys.c > @@ -524,6 +524,7 @@ static void mtk_register_power_domains(struct platform_device *pdev, > for (i = 0; i < num; i++) { > struct scp_domain *scpd = &scp->domains[i]; > struct generic_pm_domain *genpd = &scpd->genpd; > + bool on; > > /* > * Initially turn on all domains to make the domains usable > @@ -531,9 +532,9 @@ static void mtk_register_power_domains(struct platform_device *pdev, > * software. The unused domains will be switched off during > * late_init time. > */ > - genpd->power_on(genpd); > + on = genpd->power_on(genpd) >= 0; > > - pm_genpd_init(genpd, NULL, false); > + pm_genpd_init(genpd, NULL, !on); > } > > /* > -- > 2.28.0.rc0.142.g3c755180ce-goog >