From patchwork Fri Jul 13 10:01:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10522983 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 6020C60245 for ; Fri, 13 Jul 2018 10:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DA7729506 for ; Fri, 13 Jul 2018 10:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40481295ED; Fri, 13 Jul 2018 10:04:38 +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=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 E52DD29555 for ; Fri, 13 Jul 2018 10:04:37 +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:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=U3bn9VK38z8rSEOWrOGclaD/or7moYKw0+VQF7E+BHQ=; b=lPo1viyHQkCc4n sRJ8hVjMUs0Nl+ouXxzHFqYeU+rs5EjFnl5SYwLLoi2IDIDFWDELSpb33NcXi+7nEhHoo6BGhvtkX XbcLk0Sl805g2afcigqjBwkrd3PBiQj5VjJHIKM267mYlRcfx+uAM/A7tXmdgVd60o3yHfIrFd+py l5btrA1nA+J9sWIk2y78PM29R94RQ4OP1oRg6bpyvxWUEgwpH8+FM3KJpVKQFuYcvVmuw0F3w3AO8 Bn9FpO7i7RijZ7eoiQn+gm0AY6R2zfSaTQ7crkJmiEEzmmHbE2EfWSrhQLaYPQpQ58BIB518/qXig ptBte4EYiM3p7rHdaipw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fduwG-00076Z-2k; Fri, 13 Jul 2018 10:04:36 +0000 Received: from mail-eopbgr10046.outbound.protection.outlook.com ([40.107.1.46] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fduwC-00072R-MN for linux-arm-kernel@lists.infradead.org; Fri, 13 Jul 2018 10:04:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VyS4abmhw+0JAr1h7Y9DGhwo26JegBVNnOkd/EJlyik=; b=UmbASXhdzoYbLO42MDfI7Wg0bp5UAQq7KyY+GkhfCvyW3CNoFGs97K5HfzHttB+9GPYRNg0F3G/ieeWOTB/znXIE90zrjAXw+oExC9bJTxxi1Z8YmYlBVeNUUkd6n+rD6aWRYOdGH9Gnp/yuuQEY4jc0AIy8BA+zzqqlNJrPY/I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Fri, 13 Jul 2018 10:04:16 +0000 From: Leonard Crestez To: Shawn Guo , Lucas Stach , Ulf Hansson Subject: [PATCH] soc: imx6qp: Use GENPD_FLAG_ALWAYS_ON for PU errata Date: Fri, 13 Jul 2018 13:01:15 +0300 Message-Id: X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: AM3PR05CA0117.eurprd05.prod.outlook.com (2603:10a6:207:2::19) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74cc4448-14bc-44b4-51d2-08d5e8a7fead X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 3:odfMuy0H/p13YCQetrIQZA6/ook63p5mgeuSV4p08dXRUP1c2rTum+zHkHcQyScviCjaHgOWOETjb4cbXyN5Q2HZpIkUb4q8fV6/DU45Mf4e1fB1p2O9nR081MW/QQDaJWgx/NkZiaWZZF9u6klig1HOyFdQUFK2AobEZ5yq/1U/L/BoIihzAIh0FhmwvIey4CPZeXUbo1fRPZ9Y4GOV85WOdOWguJgvpue9VYiHhKQpXJeRBSd0fEDG2SZU6tRh; 25:1uy3sr+AFbnfQ0vgYLa2FH/YfFSTMlF71/xO11RESh7/g0d2N/3v+WymqAtB2bRDXBce+tG5A1j57TlZfp/UStqoqxH/c+LDFo9nSzNhjHnbDRw8MwOng12LtzAzWAmSpzneKqJ9nO0AOY6ycGtqPhNIfxjlgSX0bS2MC7NkHSGuEPubsIeaQqUKY9MsH8YkWQq8Gyl4sZ3nF32XnysDTz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A1VWvjpQmZVvksOU7ea7wv2z8BNN4wSD+GiXcmmW5DUGIqwUsT/zrfMd8PzP6+HuDp6CDpvo/ZS2spDg2nzWrrocm4DzuGdiuFHE0tf6bEVwQn5CF6Jb+r3njaXGtCN85uXhBDo9vqMWDsw2Lj3HAQ5EAHdZLfkz0Rv5tj4DXo8JeGXx/A6E X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB4301; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07326CFBC4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(136003)(39860400002)(346002)(376002)(366004)(396003)(199004)(189003)(14444005)(16586007)(110136005)(54906003)(36756003)(25786009)(97736004)(26005)(316002)(186003)(2906002)(50226002)(16526019)(106356001)(6506007)(386003)(50466002)(51416003)(48376002)(105586002)(5660300001)(47776003)(52116002)(476003)(2616005)(956004)(44832011)(486006)(4326008)(81156014)(81166006)(575784001)(86362001)(8676002)(966005)(66066001)(478600001)(68736007)(6306002)(6486002)(6512007)(7736002)(6116002)(1857600001)(118296001)(8936002)(3846002)(305945005)(53936002)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4301; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4301; 23:ltOkx2o9BWBdJ/oYwe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izhLhFWDbi+L/bKBYs93wQt1P3uQo1tvjjvSdVGrC5MaLj1ulWy7+iNt8ejbSqza/8gauyS8BIXIO4ktl9bnqEaVQZ8kkkKi5vls60aO1h7bHWHjo0WdrNyXfzlRe83PYkYLkcrA8mr1EkEuL0i6/wXwmjr47ZgDKP0ZJ7uTMsl0c92j3qIR5R2PHNGuxl5DfGpFLBk5p1Vx142yX8mA0RLOqdru9E0MMttPgLan7DjbiL1n5/dn/0xjlJSfQNpwHIVF2BAxryUdvl6+9a2T99+DzjOX3oROdszi5ZskEuUpcvnyyvNq/yTQE0DUXSfZbA==; 5:6yeF/lYQAx1q2OWsupirQ1soI3X9M11NJMVBWc79HQI9aJIFq9uihEFkNWsOI/IbtP5o1W1fQYNvnBQLdjeMEfDxtWKnJIIVcsqtKrAqrVbNJ82SczUYm5JhXp64m2jJlMyBWtlJLt4g3NlWJCPFS9PbDZriuq6gzgAbL9qFwDE=; 24:mCldDWHozYCEWQhs0Io8Nhel4w+/EbxhWltDlvJOn7eUGhH2aqfDmzTQVd0TIFaQ5kRWbI4opqocC4mnR9Wt2tAFXzUMtUaaCHM3QT7VAJI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 7:T9aoNDQZhCvuOk5dZj+GtlyqGf9KKHF+2Y6BpgIxtclorU8kAP4YPaAl1jrO2g16VjFpiSzP4egfuDLOjlUB7suKRWmjDZ+nD+MShh0BaXO+bTwJGyU7yt9xzVQXzMZRXfNDrCGhRhK9JzHdYIe8A4WuNvPQX4ehe7Qnwxm3tEo/5IvTWBeVURqsG2uTsKly3L39us91t4j0fwg6Ttguu5cC16c34NatjR454RWkDE6D91nv89x+rttNml7qYrC9 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2018 10:04:16.2329 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74cc4448-14bc-44b4-51d2-08d5e8a7fead X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180713_030432_910514_131AE944 X-CRM114-Status: GOOD ( 13.48 ) 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 , Anson Huang , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam , Robin Gong , 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 This is functionally identical but simpler and slightly faster. The PU domain is turned on at boot time and never turned off. In the current implementation the pm core will repeatedly call power_off when the domain is unused and get -EBUSY back. If the domain is marked as "always on" instead the pm core won't even attempt to turn it off. In theory on 6qp it is safe to turn PU off in suspend, however that is best accomplished with a new core flag. Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Reviewed-by: Ulf Hansson --- drivers/soc/imx/gpc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) Previous discussion: * https://lkml.org/lkml/2018/7/11/431 * https://lkml.org/lkml/2018/7/10/103 Attempt at turning PU off in suspend: * https://lkml.org/lkml/2018/7/6/698 diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c index faf13a0b85d6..f31978e5af20 100644 --- a/drivers/soc/imx/gpc.c +++ b/drivers/soc/imx/gpc.c @@ -45,11 +45,10 @@ struct imx_pm_domain { struct clk *clk[GPC_CLK_MAX]; int num_clks; unsigned int reg_offs; signed char cntr_pdn_bit; unsigned int ipg_rate_mhz; - unsigned int flags; }; static inline struct imx_pm_domain * to_imx_pm_domain(struct generic_pm_domain *genpd) { @@ -60,13 +59,10 @@ static int imx6_pm_domain_power_off(struct generic_pm_domain *genpd) { struct imx_pm_domain *pd = to_imx_pm_domain(genpd); int iso, iso2sw; u32 val; - if (pd->flags & PGC_DOMAIN_FLAG_NO_PD) - return -EBUSY; - /* Read ISO and ISO2SW power down delays */ regmap_read(pd->regmap, pd->reg_offs + GPC_PGC_PUPSCR_OFFS, &val); iso = val & 0x3f; iso2sw = (val >> 8) & 0x3f; @@ -419,12 +415,12 @@ static int imx_gpc_probe(struct platform_device *pdev) return ret; } /* Disable PU power down in normal operation if ERR009619 is present */ if (of_id_data->err009619_present) - imx_gpc_domains[GPC_PGC_DOMAIN_PU].flags |= - PGC_DOMAIN_FLAG_NO_PD; + imx_gpc_domains[GPC_PGC_DOMAIN_PU].base.flags |= + GENPD_FLAG_ALWAYS_ON; /* Keep DISP always on if ERR006287 is present */ if (of_id_data->err006287_present) imx_gpc_domains[GPC_PGC_DOMAIN_DISPLAY].base.flags |= GENPD_FLAG_ALWAYS_ON;