From patchwork Wed Mar 22 19:23:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 9638061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 51B02602D6 for ; Wed, 22 Mar 2017 03:27:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 381C728304 for ; Wed, 22 Mar 2017 03:27:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BDBC2830A; Wed, 22 Mar 2017 03:27:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_12_24, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C970A28304 for ; Wed, 22 Mar 2017 03:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c3QNQWTisNTYWBjkISgLZL0EgLc0d7g4cs+cOl7A4ZE=; b=Q5I+nLasWt8Cag Vn5HRp9vpX1SaQeefn0du9YBZCHqsXEA5oVkDnNCiw8iKBX9b7Irkp5xCqJlD3a2ime+45NeXFpZY tHugyCSqMno/+rmKh89ByIoQSZyNspvUiaobYPVFbdYiyUKnz3a6lHRQQmX5tIffD+GHBOvX0cBf9 fu5BlcsmVdC2ReeQPgCfk/3JvqWhAkWu0o6MGs4IwM+ALCUTBFwqj0bUAfVS9vdc3/vsONQuolYfx x1dEeZJDoMPE8sduXPRBVaBfskFQkM8dIOrMaj7Gt2kIWh8mgH14EztDVMvw76AruohhireJwt3+x PI08ntRl/MUHM87JU3aw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqWw4-0005iI-TC; Wed, 22 Mar 2017 03:27:44 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqWw0-0005gC-VD for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2017 03:27:42 +0000 Received: by mail-pf0-x242.google.com with SMTP id o126so24723685pfb.1 for ; Tue, 21 Mar 2017 20:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=l2llM6WDk3xrS5UkCazrbOwvmMk3HkNCF6/dSzYEOqc=; b=TYpp/2PTZwpOENwB7Yl0pLjGvO5dxSJ8DUdq1FzypPyHHAxyN+66e98qntdAHq9IPM 4LZEGcdjqJoCUojWf4SFDktJlLYQ6AI3C77FtreV0Ep3QBFMOQSpsxDUwe3Fyt7qNHAL O1XvKL0UMmiyuGZvO64xo0bWBF0kMr/ynjHUYh5N6oZ0yAllrZSgw6jx0pYEAFHtw/7M lRF6A/LiLkTsvagfasjYmCs8bphpFxpUYb2hi72Sx11qvs1BplzlizJvuuR0Pbgps+XG Pi6oD9LMA4uaMUd2feQThaALktVrWanNMjO6/TRJOI2wf6m5b/HUofOltxaoBN7zUuFP DLfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=l2llM6WDk3xrS5UkCazrbOwvmMk3HkNCF6/dSzYEOqc=; b=OxwjFQtkecr4Wyh5Jc3ouzLEAbVzSXOLE8kC+PP6otXHIQ6mM2ws1CJKbXCJNxoGaN YcpfPk4aAUWmtRtYqAd8QSbIlc1xBzZ3JLiq8NA9fqYqYSb8PurXG82p3CLqOB6LGTn5 1XyF4Zq57JviqCqoYl4W8eGFZxj+WjYQc9sQBqiGKlICIW2KPGQ7beKEufqthNDHV2Ue YrkCnuwKjZ28/OxJKBRB3uxRdUhfrtMDHuupiUl/k/97LC4WXQVqUeBRijSH4siU8PYQ mmAzgGZWYg2pprT1X/vRvMGuRGi3c74R27NgnZ/9U7eatMRChSKDUJrG4eTG41trfNMy GkrQ== X-Gm-Message-State: AFeK/H0KpmHdtC3gHtfQTFBnFl90SfMVsLBWAG78hvxd6k1RXPPb/Ttax/oMbWH9c9NR8w== X-Received: by 10.98.147.10 with SMTP id b10mr43841080pfe.177.1490153239955; Tue, 21 Mar 2017 20:27:19 -0700 (PDT) Received: from b29396-OptiPlex-7040 (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id u29sm131054pfa.123.2017.03.21.20.27.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Mar 2017 20:27:19 -0700 (PDT) Date: Thu, 23 Mar 2017 03:23:56 +0800 From: Dong Aisheng To: Lucas Stach Subject: Re: [PATCH 4/8] soc: imx: gpc: fix imx6sl gpc power domain regression Message-ID: <20170322192356.GC16264@b29396-OptiPlex-7040> References: <1489990547-1510-1-git-send-email-aisheng.dong@nxp.com> <1489990547-1510-5-git-send-email-aisheng.dong@nxp.com> <1490001974.2895.11.camel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1490001974.2895.11.camel@pengutronix.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170321_202741_058208_C0DF080F X-CRM114-Status: GOOD ( 21.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , fabio.estevam@nxp.com, andrew.smirnov@gmail.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Mar 20, 2017 at 10:26:14AM +0100, Lucas Stach wrote: > Am Montag, den 20.03.2017, 14:15 +0800 schrieb Dong Aisheng: > > Commit 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver") > > broke the MX6SL GPC power domain support. > > It always got the following error: > > [ 1.248364] imx-gpc 20dc000.gpc: could not find pgc DT node > > This patch adds back the legecy support. > > This patch removes a safeguard against abusing the old binding for new > SoCs. Please leave this check in place and instead loosen the check to > also allow the old i.MX6SL binding. > Thanks for the reminder. I found beside the checking, we probably also need some extra fix that the current imx_gpc_old_dt_init() only supports two domains while the driver formerly supports three for MX6SL. And because the num_domains is defined by driver itself, no need check in imx_gpc_old_dt_init() anymore. The patch would be as follows: Do you think it's ok? Regards Dong Aisheng > > > > Cc: Lucas Stach > > Cc: Shawn Guo > > Fixes: 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver") > > Signed-off-by: Dong Aisheng > > --- > > drivers/soc/imx/gpc.c | 6 ------ > > 1 file changed, 6 deletions(-) > > > > diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c > > index ba6e7ab..c1d0e67 100644 > > --- a/drivers/soc/imx/gpc.c > > +++ b/drivers/soc/imx/gpc.c > > @@ -385,12 +385,6 @@ static int imx_gpc_probe(struct platform_device *pdev) > > } > > > > if (!pgc_node) { > > - /* old DT layout is only supported for mx6q aka 2 domains */ > > - if (of_id_data->num_domains != 2) { > > - dev_err(&pdev->dev, "could not find pgc DT node\n"); > > - return -ENODEV; > > - } > > - > > ret = imx_gpc_old_dt_init(&pdev->dev, regmap); > > if (ret) > > return ret; > > diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c index 4885ec2..6a806a1 100644 --- a/drivers/soc/imx/gpc.c +++ b/drivers/soc/imx/gpc.c @@ -303,10 +303,13 @@ static struct genpd_onecell_data imx_gpc_onecell_data = { static int imx_gpc_old_dt_init(struct device *dev, struct regmap *regmap) { + const struct of_device_id *of_id = + of_match_device(imx_gpc_dt_ids, dev); + const struct imx_gpc_dt_data *of_id_data = of_id->data; struct imx_pm_domain *domain; int i, ret; - for (i = 0; i < 2; i++) { + for (i = 0; i < of_id_data->num_domains; i++) { domain = &imx_gpc_domains[i]; domain->regmap = regmap; domain->ipg_rate_mhz = 66; @@ -324,7 +327,7 @@ static int imx_gpc_old_dt_init(struct device *dev, struct regmap *regmap) } } - for (i = 0; i < 2; i++) + for (i = 0; i < of_id_data->num_domains; i++) pm_genpd_init(&imx_gpc_domains[i].base, NULL, false); if (IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS)) { @@ -337,7 +340,7 @@ static int imx_gpc_old_dt_init(struct device *dev, struct regmap *regmap) return 0; genpd_err: - for (i = 0; i < 2; i++) + for (i = 0; i < of_id_data->num_domains; i++) pm_genpd_remove(&imx_gpc_domains[i].base); imx_pgc_put_clocks(&imx_gpc_domains[1]); clk_err: