From patchwork Mon Apr 18 07:59:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia Hongtao X-Patchwork-Id: 8868591 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 608FC9F36E for ; Mon, 18 Apr 2016 08:08:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAD7D20259 for ; Mon, 18 Apr 2016 08:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9ABF20221 for ; Mon, 18 Apr 2016 08:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402AbcDRIIw (ORCPT ); Mon, 18 Apr 2016 04:08:52 -0400 Received: from mail-by2on0084.outbound.protection.outlook.com ([207.46.100.84]:26215 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751075AbcDRIIt (ORCPT ); Mon, 18 Apr 2016 04:08:49 -0400 Received: from BN3PR0301CA0063.namprd03.prod.outlook.com (10.160.152.159) by DM2PR0301MB0717.namprd03.prod.outlook.com (10.160.97.13) with Microsoft SMTP Server (TLS) id 15.1.466.19; Mon, 18 Apr 2016 08:08:46 +0000 Received: from BN1BFFO11OLC002.protection.gbl (2a01:111:f400:7c10::1:157) by BN3PR0301CA0063.outlook.office365.com (2a01:111:e400:401e::31) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Mon, 18 Apr 2016 08:08:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none 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 BN1BFFO11OLC002.mail.protection.outlook.com (10.58.145.13) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Mon, 18 Apr 2016 08:08:45 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u3I88fJ2025868; Mon, 18 Apr 2016 01:08:42 -0700 From: Jia Hongtao To: , CC: , , , Subject: [PATCH 1/2] cpufreq: qoriq: Fix cooling device registration issue during suspend Date: Mon, 18 Apr 2016 15:59:31 +0800 Message-ID: <1460966372-4877-1-git-send-email-hongtao.jia@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131054405260627841; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(86362001)(104016004)(5008740100001)(50466002)(6806005)(5001770100001)(106466001)(48376002)(5003940100001)(81156013)(81166005)(87936001)(1220700001)(1096002)(586003)(36756003)(4326007)(15650500001)(47776003)(105606002)(189998001)(33646002)(77096005)(92566002)(85426001)(50226001)(11100500001)(2906002)(229853001)(19580405001)(19580395003)(50986999)(7059030)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0717; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC002; 1:btIMIKLDbVTH2Fz2pClLpHxVVrYbWjYcdBMZ0V7zX9OeRv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44Rh8b7poUYRJwxiaJDNF6GIObEcS56vLjdu/7ANQxFCzMcU+1aIe9A7qN4qAklGRo8YcRN8HoB5oDWwTb9QqJzcw5pt3ixUlhAGldXpK9HPf9LkVRfzaCZ11uI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0717; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0717; 25:FCpNHdFtu+/n6i4CyewhKA1lvXIOczxHs0oBdr8GW4L7Kk84xO9hNX7o3YSRcoj3gW/ZduNy2MKL/80MOeqp4cdm/ro4ompDNLWhVmnFlXtfXuVO4+s170nQjVSfkYkIOdmXVJBwNQadGm59nR5J0gFhRkLnQTp1iImBjJ+57guVMaYULGfzaP2QnSHZRIVZEZ1SZUF5daXXZCuNTC5owgXjau26oaoMbd5Il1BnCvqEBRKFdU1vrashI39+zOvXEqf1mT0VwhVocQ1Ji4v2A7B90EKxzMFj2ktVUE8kyvqVoFI8rj7X0zqM8tEQU4QI6wsqf6MXH4vb5KGeNQTmCLuKGdKmZylDaN2MdvrdJUIfROdERhtZFaA1WJ/B3CbjoVMfTmkDQFtHFPw8O6HZTGC6eQTfsD/yuOKH/wQF63+U4COByAmIbrewDfFMR/Ry0/cA4DuZgErcU+OW3rC6LKvmIHzN2hrA73iP6bs+qkodnYgSMCm5kqXGqquONJlCWjlvWYA53B4CEODLYt0KL805W0banr8qpVU3ObxWM1oDGPPTXR9QGw+MCgk/qTOkLH7ULSgl1au0yYlz4pGgWPXEB39Ukui1CZ3FfWLulTZ12t7M4SfPe0D3XQsg3PGIKW1RlZ0sQqDiPsL5HsNjN6NtFygpybMHRVt5wza7+bad9Lr3Nu99nAyGtLwBcysc+3rEebrfosllfV5r+QRS5w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13015025)(13017025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:DM2PR0301MB0717; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0717; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0717; 4:3ZGBaVjdNPdXFQv9C6VZrqa0XTzfBWTPQUJa7bAx3Yp9qLzk1TkcDfrJCWJsjxwibSaSX4DcVAoJz0jVraBzghGv8Kb2tFpgl8vR75WEyun2WU/IOWGv2fWcgDyqZOGmkzlt0hAKBjuFbOHD6BO4OrEL2oCe2KDAmfjYOHcrrc6T3uf/owKdqGS1IoUdnB1VTFFowRA7aUeCoJf5M6+UxXX0sOcxIkWty90Wgzd8m7MzZw7IXvXeld18r1zNhWe8RwE821kCmwyPeduwuNsv1zExT+QE85qKS7BbrGuBZFVwDCWkI8x8K1msLNTpOGBg6uSxZbuj79Ljj7sk3pVzqaZKEbE2ABb/00u/V1wMy9qXr5jXqwy+xUwrIuiFWUSQt8nq67DpEDyDcJIDig8ZxNqd4VDL86XwZU6wHkKlPXADw98YQWFITiCktUP4XjPGMSoufrwB0vi0zNIs85ueLaE5hPMiVtj+J7K6iiRXVZ4= X-Forefront-PRVS: 0916FC3A18 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0717; 23:nwlBm42ge4p0ADRpp2qv12FSvj8wFBB9oIbsAgb?= =?us-ascii?Q?Z5LIRVPgDIZRSI1+r/w2hLw0MHTSwUHpk4DYccPqdrdfeN9lyxDplJTW6E7r?= =?us-ascii?Q?17UjoQZufSbiLfLbn22L8dMMu0F8CNuv2aCAZSFfUKi+EGYtzewUAgUCqVAG?= =?us-ascii?Q?d+oz6ik8vIMq3rzx9Xs9aHnrMhUWxJ+97fMkEQMxQkdmuIL6ItKZzSKFQXit?= =?us-ascii?Q?nWZklBy4StgN60mxJuqFzmqZgZUwwRWA3TNvmkE+PGNFE0xXfZDWERJhbV3n?= =?us-ascii?Q?9aKnj6hKFAw7k/C8H1Uaojhff0JI+mVaxg2CoHrDHzGgqStRRqGzEID5y9+t?= =?us-ascii?Q?xgj38lOutFM3wA+d+79HpxCf3yKzttj8F+yEmowYlcuu+W1ULuHS4Z+ACSl8?= =?us-ascii?Q?iO+D0gHwIQTUwB1x3AhIrmuhHT0ZssKo5ObrGKleAjmG3Hwmf0E2M3z0LsKO?= =?us-ascii?Q?phvCRo/OXfRnp159EeSi6wXTp/xO6J6T2lyuWMgZRiKeLfECjkj6fuIPOfZK?= =?us-ascii?Q?s7454Q4qjuBxrvIdOPFNkdEa8v8soK4K/4TDvat+ZmayyceJgz13KkF6H9En?= =?us-ascii?Q?fBpAkc5O+ywJuIO7IY+sB7j+y7DUFJkw1WRW9V7N4d80TWRryH64mAVmWNFl?= =?us-ascii?Q?HK2N1h8UOZWnu3jNtCFiMR+tI4ae56Qa65MsSznTjB2tQaMBlhSzG+Yi5+TR?= =?us-ascii?Q?8FjI38/E8kgJRsQzPS7ksEbzekVbh6DRzzxtUekqb1e12c9HwmGxuI/h/8To?= =?us-ascii?Q?04Qd7yaMTkQSLH+mDf4KMTFo6A/dikaaSjqBdNnOOjUq8x/71ZBkNdDA2fnQ?= =?us-ascii?Q?R0b0ZYSnHDLoM2SPW0kWvQtMADorHWowgKNByFuuaN/m/2qohvJXVRTNz419?= =?us-ascii?Q?2n+AqWMf/3pc/LLfKI+UrsJhGP28xBfEen2qR2ZHp6fazD01N7gcRnR3rz93?= =?us-ascii?Q?Kzhp4gN5g8vs2tI/V1TtHCqjMYzQHZB+aJ++S53womyYH5z7f8qH6YNtIjv8?= =?us-ascii?Q?VHC8RRffU0/hd3UPPC+gcAetNWnAnK9zAdGGBQZex8iA8RgM6a50LTx2zsG7?= =?us-ascii?Q?RGKZZlNcMzrqTTd0ZfcBkhRcXT8HfflXpYKbFR2LJKFrgUKbAluckG6q68MA?= =?us-ascii?Q?IIj49bxlS8uBH1PKlwtUccyVmzvN9/v76NvrDVIgXmNwELYZQBdlZtw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0717; 5:v8vl6ya/IJNf/zMIfsT9TooxiYbDEflvJep5CMIQDfOA/CP7MRRDoWOZIKMy58ZpwbQtsGiSqIhLy5Ae+vsovLk3EbfOo/xSm1819RqymzwkXJmx1ybUClnhfjLO4TVr7Yr761EXQO4HZoxzLO+TsQQQ4Uiop7mFcchjoXOyJTQPxZTGaNzKS6Q769LKuEy19iYj/lsqv6ibGRN07tPUqw==; 24:vtWPD7IvMPbGJchN7e+pewysSXqFic+eE/Xly2cJmhOD9bMBmP+scS3asBKXqfML7VGZOdEd8jQY5iqrPqzqmm9gk5YDaYIDUt8veh64yYE=; 7:xi6+GmucWBvGjzK6OfyB9iWbbFF5g6XIQaGmUsWBxLNuFz4qE7IrxU4DBoiH3QL96bYBophBLdBLyLafrNbYuFN751UF8aJrpS8mwnuWZfdmNZDExfZsVF1sJHt0CDiabX9VspztJ4dyQERUTR8X7QZFQ4KhNIb+2L/fRAhGgguTMaKjfa8f245XPvYPVfXqqd/AiQeHU6CO4GmA3YJYOELfxJhStgcA6RooKjtjTN0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2016 08:08:45.8599 (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: DM2PR0301MB0717 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cooling device is registered by ready callback. It's also invoked while system resuming from sleep (Enabling non-boot cpus). Thus cooling device may be multiple registered. Stop_cpu callback is invoked during suspend (Disabling non-boot cpus). So matchable unregistration is added to fix this issue. Signed-off-by: Jia Hongtao --- drivers/cpufreq/qoriq-cpufreq.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index b23e525..1c2fdc1 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -305,6 +305,7 @@ static int __exit qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy) { struct cpu_data *data = policy->driver_data; + cpufreq_cooling_unregister(data->cdev); kfree(data->pclk); kfree(data->table); kfree(data); @@ -323,6 +324,12 @@ static int qoriq_cpufreq_target(struct cpufreq_policy *policy, return clk_set_parent(policy->clk, parent); } +static void qoriq_cpufreq_stop_cpu(struct cpufreq_policy *policy) +{ + struct cpu_data *cpud = policy->driver_data; + + cpufreq_cooling_unregister(cpud->cdev); +} static void qoriq_cpufreq_ready(struct cpufreq_policy *policy) { @@ -352,6 +359,7 @@ static struct cpufreq_driver qoriq_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = qoriq_cpufreq_target, .get = cpufreq_generic_get, + .stop_cpu = qoriq_cpufreq_stop_cpu, .ready = qoriq_cpufreq_ready, .attr = cpufreq_generic_attr, };