From patchwork Wed Mar 22 16:53:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 9639411 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 BE6126020B for ; Wed, 22 Mar 2017 16:54:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB97E277D9 for ; Wed, 22 Mar 2017 16:54:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A02FD28456; Wed, 22 Mar 2017 16:54:39 +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.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham 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 227AA277D9 for ; Wed, 22 Mar 2017 16:54:39 +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:References:In-Reply-To: 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: List-Owner; bh=mH/LrUz/lhSXFT5xegF4ePxVgCd61POpgSl/+Qob+SI=; b=vET3OjlzpDt3Vr B+RIC/o3xXaoOULHZ+exdEd2kSDsYTqxCuDOSBowXM8Z3aLKoSjUkUXtW8H6qiFmZ3dNi2jPG4Fra 402W8CqBBGRYNzuZh1k7WuPtWg0gQvyxYQ//S1u/8ihG6Z3gI6rK0FGGpBndpAkBJ9MQ32RmyauxI 4B5M0ndefiRCmxM/aYXIhIZwjILf+JB8KuX8YPG0j8RphVQHg1WZS3MHv+DaUJ/R9nGJ+MdJitVV4 TTh0bPxhNqfRegi4GB+fs+7XVg/yxn/0QWUXA2wP05BXbxm3G+q0r2d3hAkjCln06UfhUP77HHM5H ZBh2qXbW8qlSefrRnZVw==; 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 1cqjWt-0003Xj-VL; Wed, 22 Mar 2017 16:54:36 +0000 Received: from mail-sn1nam01on0626.outbound.protection.outlook.com ([2a01:111:f400:fe40::626] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqjWM-0002tt-El for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2017 16:54:06 +0000 Received: from BN3PR03CA0105.namprd03.prod.outlook.com (10.174.66.23) by CY1PR03MB2267.namprd03.prod.outlook.com (10.166.207.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Wed, 22 Mar 2017 16:53:39 +0000 Received: from BN1AFFO11FD047.protection.gbl (2a01:111:f400:7c10::191) by BN3PR03CA0105.outlook.office365.com (2603:10b6:400:4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.977.11 via Frontend Transport; Wed, 22 Mar 2017 16:53:38 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.977.7 via Frontend Transport; Wed, 22 Mar 2017 16:53:38 +0000 Received: from fsr-ub1664-115.ea.freescale.net (fsr-ub1664-115.ea.freescale.net [10.171.73.212]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2MGrKXb024800; Wed, 22 Mar 2017 09:53:34 -0700 From: Leonard Crestez To: Mark Brown , Liam Girdwood , Viresh Kumar , "Rafael J. Wysocki" , Shawn Guo , Sascha Hauer Subject: [RFC 3/8] cpufreq: imx6q: Set max suspend_freq to avoid changes during suspend Date: Wed, 22 Mar 2017 18:53:05 +0200 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Matching-Connectors: 131346752188957741; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39410400002)(39840400002)(39400400002)(39380400002)(39450400003)(39860400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(54906002)(8936002)(6666003)(50226002)(50986999)(48376002)(76176999)(189998001)(15650500001)(50466002)(77096006)(104016004)(105606002)(53936002)(33646002)(39060400002)(4326008)(5660300001)(118296001)(8656002)(5003940100001)(2950100002)(305945005)(38730400002)(81166006)(7416002)(356003)(86362001)(2906002)(106466001)(85426001)(36756003)(47776003)(8676002)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2267; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD047; 1:fKFMZjr28xEFN/3Zk3opetPrnZjBDz/wG5pTX/kL2YHvmAMu+SDouzTR6dh88efG2Bnrpub87xggkibaftkvPZMI52y0d54vfIsPnoiiyIpsse/3xi8XcbyV+0lw6HDMDuK2xfNlJndD05fVktSR0QBbPSGYKVuTBd09k9JVwJAUK1yOsh08PmMVykw5mPD1cA29EDGnFWxqxUyEdNuKtMjJ1254b8qTIO23rCZpR1HDcz0uVt6vkUAvpo/wOolUYMCT/BO3Cxc/5y+uV1ujs/cjKBllHfAaRjPruSfAwwwOSbmGKXl4BAUohVkPPaYCUNnqIW/Rg8FHU7IIqPINHt1mF7W+utEc2XNQdrx7PP8xO9psK7MwThFfEsepsEPLvwctU1mFaTEc6Rokr1QJgInhiCJpBfOZcKyoIfsB8WN8FFgtU7Dt10zLXtUTVA9cpgNqV54MVtcEo0UaEBPcBBKU+Hk0Kl25/rR/YS9sxfLMLysmIWg0RCKKfDZbyeh0osUtqkPB3ZnkvF2GjSQws/sbkyY6cL0QYFcWLjDGZey+6ZbbQ8HX+qhW9UOod+EgXJgJyUie4TkiN0SFY7vYrQhdttrhCvZM0P/JSn+Y0Ehec7JHzNa6QoxSO0MDdbjT MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b517b71e-09eb-4996-62ce-08d47143fd14 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR03MB2267; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 3:/kwTg/XrITRdx6+0nEt6V/hzW5a41EfbX0ioTuCU6r66ieh05PAbov7UihSB95N/SbGjDBGWXPHVCKOwFf1oHHfbA/Cfn2NK+HUmeWVQIOiuRMl5RRYAcQr16OTlOtiSiQIpskIZK69Nlycbu7OU9nD4LexRCrxAUjy3B2ciu/t94T5uOnBBvNYs1VDBjNtAIbnVJeBcVykUVR3fZC7eBYQlJHxc5D+IgwvPfIZ6pHXyjMYv6QhpM2eYekPlsYcLhFA2CmaLVP+ObPLzX7zVrnVlPEiVrIUgQ03sflGBOIX8ROdV8jW7kcPIKxeYhwcWdBM9RzLPDoFXh1/Yj/lsKRU7QDoxxThaTRuwWujnMWrey9O8Zw4NqPw2dFhCnOp7; 25:+KrOxt6MDifh7K9MwGO5PgF9ouQu0A4TCfeIIQ/IIzed8kYLik78cYdEB7go3Ua0Jj5xXs7+ZQMDG/iC8ruRIXuY3ObosNyuTvSa8X87K/H1zuaoD7cp26/ssSb4hw/s9nRMnNJu4Y66OCzqoIpc5dEEnr0U/52SRmP/eX6PEoj+ST5TBSH4cjrqY3Po4F4RXRP1QYRAOFMRH7Xci3ziZEqL0fO/4010U2IsGuggqB89U/aOaPwClVOSS3za6Gg+HWbczFKaQ6c2pwNBnxB31ReLlwCxsTgGGBQ9Qs1jTN/glrCllf2fgN5gWEypdUZQY2MCgMZ9cl4tjtLS7agXsD/FrfUPqeQ1O3ON2G1dQh/Qrx/x8n24tuiFDU941OjGp2IQyg0SzVQPUYrZqnz9MxKi8fMB2glK6BYcGPc81VLSeK6vNzEXpf7sWb1LlZXe1ew/yhq98gC152x9fdZDKA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 31:T5A/EYljF334TLExjA6KoNqU1uQOWH6sDP9FEBYx9V5Qjfrb76KhAcFyjuapMHlplRtIrde9q77xSxv/kY2raX0dQOT0sYdKPeZi4gxBrFAgbLIG2w5z2W4IDJyxqbAJdoW0ZtHlCjSl1u5QKWWJq/IjyGiZ+HBZ+FyFeOIxBioF1tYiSaknxzaP3BLBay0WVD4xSvgVYAnIZYLs+KEI4QOnl6oKRuOdn87QSCmAlBCzRBanUhTKw5RGLbM/tzUiNADlgdANzmpOqy7g+JkSQOpu9Ro0dzpPeWFEHaqD4Tk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(13017025)(13015025)(13023025)(13024025)(8121501046)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123565025)(20161123563025)(20161123561025)(20161123559025); SRVR:CY1PR03MB2267; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR03MB2267; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 4:Qy51JdXIKqgvJptZy7275xksG2CfdrzQwFlN34qNDC7hR/cQAwg8lqZz2H53bUfKWZ5Eiq7RPpu7ab8jp9lUruCR99nSMi77NdhCmMWo25ZPA3wp/LfhFLrMk7pqiTt0BdjHrlest475jKhx51g7y+3FtwBLRBnL86Wqs0VD6MHnztJjMH5x4xQl58nD92TCH9WUPWPYOmNjwvL8d5OtzOM8zPZK+TVEZlrY1RUElEc+za2rq1May2dKh2XJVoCZD3muw+ew47nR4lPS20iJF4fBqgoqPE2hQ3Q900f/kl4Nhlaix/YuFQSTve1pQ3b8/NMNH1vWl2zqoFOUeb3lxJuXFX2/BuxIUfJXhGdPExT/yI2iUnpNL4ek/8+OHr9ZKF7qfQo4ZDeIZRycDqmjCgTGBTTg5KNCT+HJLrGE9YjdiJDrtkVx/4R//6AsIfLoXh5PWO10EvSepeKFpV9uh3zNpt7JgLLkg4v/c9zSWH2SzYj47VXGw72t3MrTCtYqWWnSQadivzb5WdOjr695Sn0Gue4WvwklCXdWscPwi925nFzX53SPY7FW5DhS0ejWVwkBDEtyNoHdx41upQa2oildpyHe/ekp9I+ZjsHid9V3ClJ4O4EtC6mu1TNRtiPCH0Bg+KbyR0onDFoXarEpv4Pr+oG+IuDS3lV/fXgsiPylEw8xgZDLq0P/quKYWdd0yqPkyDeL1+7gdKTGFevVP4l9vKbmbsh6LGay69iQxmXdhJV22N7M6xz0zq3m+mlF X-Forefront-PRVS: 02543CD7CD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2267; 23:pb/WgdCVwUO3OdCUoHWNzj50i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+3/I/TVB+pMzaDSmbrE7CsqCQoxLxy9bOKmjI5tO?= =?us-ascii?Q?I90Ib0z7Va/1k6l0bl8ksnEXupdnhwC15ikT+PthkYDNWcEZ/aOtKa71H2fT?= =?us-ascii?Q?RedGHH7yv7H0E22lsz5aboUdfazDrge19wXphasBET1t3UYVjNrOfSd+Rmht?= =?us-ascii?Q?RqCt7uHmDnG9GBlINBcgG+ghaMChOhUsRdaxmW8JXC+W7qtxIAI3WkGZBJyM?= =?us-ascii?Q?qlcsIPX99TuMU1xPHkuRZH+jc3vBzN3F0zcJEoWJnvdCRFoGM/piHXYO04I0?= =?us-ascii?Q?Ec/+XcZ5kuvYu+e7kmBxO2jBNXMGgnqWl9IvGH2luUF8ihKbSvANI04BT23I?= =?us-ascii?Q?MuHDiVIV119gYlXbEsaxpE9jddzxEDExwVCfumA?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 6:Ex22n1NCyW59wHw4Kih5l2/TYLAfw0rRoJ0DhVR1INsyg2YrVUHpNzHAn1SMHPjMLHm2escl7zawnR9NddJ68oSZchvvPD3+JHs1qH20tPs385aeD7rbWjXNgLP4XYldCgtEzwD5jY4NynBoLfLFFvTNwcGE57NgjPk2/tcISGcz4vbxGTHr8SdpYjLG85Xd96NWOy/jyAukqxM++E1h6u77SkjPZM7qhsqTH5BYf3pVGAs3jRifvYEuh1tiSqlQWfh1FELRnoUh5KtQd54Nry9B3zuySwCq3yiNoia+HbikgDn2FOoWKAgbzszgQEP/Ai/2tfYCJkLGLHJBWRE9Jt2IIM4+NHSR2F5Y2wTVcliSp63fhTJ0+fj2JevHvwP/fNAPbGT2bex/vz4KwTt4rJVTEmsQ3SyNACHRcel/dNw=; 5:WGjXZvxC3ri8191+0odcbVOykugzs5ZALTF63KzicMpOMdz8oNZMh4yeKioDkFg00zQsTur/zIj8bc49slFher/iJLBT+izNtce1GGvaDIRqeMwiLSfytnspastX950jakpYaDUL2Iw5pfl5bUxyrawduIfoDIXx+4esqvSzI+JifuH6Ifb3if18olTYWG/f; 24:8MSVqFCJLpMH6RZPXPVVKoO/B9fSBwWTWCCbxeHcNlNY094hswt+Lor+uf1FTlCg/o+VHP6UFb9F0ylthMmWxWVWiFul0UwRKRqQf1qh3rM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 7:5FwC+jxKaVGGlR+fTrdECaJfxJ6c1PsapjyDGG8W2OKzhpo8eiMXA7ugjAC7onGeFr11snfFvlM76JShPWj5I5A8tFXkgC9DPL0o0lqer7G63U08mhLsHk2UQQzZpixkD1YSZrPajfW2hJXqTqIMqeCZhgAXVSr2Bkr2R35XvKgs5jFgyy35z+EWuo9z7XViUVhMcILy2k8sgJeeXOMdeEYMg97QW2QZf/c2XiWa2WHmyJtVXR9L0LTbWPWMO/LebD7fZB/joF1HyEhokiS6qjZwC2QbuQ+4xc8Czo2RF+n5qmyzi7V4bNegXdDtc+VvGMW904Hz9z/x8Q9qeomesA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2017 16:53:38.6617 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2267 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_095403_041461_C0EF44B3 X-CRM114-Status: GOOD ( 14.24 ) 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: Mark Rutland , devicetree@vger.kernel.org, Leonard Crestez , Anson Huang , Irina Tirdea , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Octavian Purdila , 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 If the cpufreq driver tries to modify voltage/freq during suspend/resume it might need to control an external PMIC via I2C or SPI but those devices might be already suspended. To avoid this scenario we just increase cpufreq to highest setpoint before suspend. This issue can easily be triggered by ldo-bypass but in theory any regulator set_voltage call can end up having to modify external supply voltages. Signed-off-by: Leonard Crestez Acked-by: Viresh Kumar --- drivers/cpufreq/imx6q-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index be90ee3..e2c1fbf 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -162,6 +162,7 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) static int imx6q_cpufreq_init(struct cpufreq_policy *policy) { policy->clk = arm_clk; + policy->suspend_freq = freq_table[soc_opp_count - 1].frequency; return cpufreq_generic_init(policy, freq_table, transition_latency); } @@ -173,6 +174,7 @@ static struct cpufreq_driver imx6q_cpufreq_driver = { .init = imx6q_cpufreq_init, .name = "imx6q-cpufreq", .attr = cpufreq_generic_attr, + .suspend = cpufreq_generic_suspend, }; static int imx6q_cpufreq_probe(struct platform_device *pdev)