From patchwork Tue Feb 12 07:06:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10807407 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41DDF922 for ; Tue, 12 Feb 2019 07:07:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E8B82AB0E for ; Tue, 12 Feb 2019 07:07:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2058E2AB1E; Tue, 12 Feb 2019 07:07:07 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4C992AB0E for ; Tue, 12 Feb 2019 07:07:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727750AbfBLHHB (ORCPT ); Tue, 12 Feb 2019 02:07:01 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33456 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725916AbfBLHHA (ORCPT ); Tue, 12 Feb 2019 02:07:00 -0500 Received: by mail-pl1-f193.google.com with SMTP id y10so875006plp.0 for ; Mon, 11 Feb 2019 23:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bl67EUE/XY/6X5G+dYl3utZYVkMZx8TlxGZKFfW5yh8=; b=Y4HZ6tlhiVMul1p4bXQfywgRLmphH1w3FXiaYP7OuYI9IiNUy0KC4Azirsq/dLEPBU 9Bkgi94cwcVIyJXh1y9+r7FTWLH2G7XmS8JnfQoAsoK+5JneSTVDzJS7DE4w/TLLQ/dz /loClwAiQP7aP+8zh4qnhFgVd4lmLDDDgp0wY/bYiPU7OObxEHei+WjKwYXJtmw2ru61 PNSzkWkB9eLGIs1We9Qs4Y0DwhZyb3vwwnCM5bOsbk0IhTFTEqmVwrX+5QgqCZg5kPMj UfrJS7HZYrtOfL4EcpVm2YaXIx7L6ci2y9tngggX0EFtwUehIMiyXMToCVcmZaI5WeE9 2Nlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bl67EUE/XY/6X5G+dYl3utZYVkMZx8TlxGZKFfW5yh8=; b=pbS5eyw4mqik7SZ5d9MX99B/aeSmErF/60EitD5/YOIKeCrZqTXQQT8DtQl4kpOMH4 MFfU1NsUZtws19efQmU5ZS2llB8LMcSVRMgOirkEYB6Bci3uAtknaTK1wQ6z7qpTRE6V xwSn5rUlrVy4dkYL+Qg65YBJpdw9dMUseR9j1UrPpHt++xs5ggbnJBlqTrMRoH5cCejx t2+hl+vqh0hkawpXe/yY3cCAVpUB6OcQRKdQCJ9EwZ6G/seMMETp6/mJel8SZPFIbLPU +kKeUyV1cdcMTRGwsDUSD+KCNswSum/Pey8IY5TgNTW/tH5X7NpesLeG/qbEmif8YvFj E1ig== X-Gm-Message-State: AHQUAuafz8TFn0Gv8QuuDJ7CAn+5GDRDlp8zhLfN19jjM1q+c+YTyg9i njJWxeySKVWHVhDdy5U7YSfeIg== X-Google-Smtp-Source: AHgI3IZRItGHq7KeOyt8RacrgJij9HH+qOWMCu1cMeQjt/wAzEH5OutpK/W4lBTNBjyF7gfsioUnFg== X-Received: by 2002:a17:902:2a69:: with SMTP id i96mr2562023plb.58.1549955219631; Mon, 11 Feb 2019 23:06:59 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id v13sm16233278pff.20.2019.02.11.23.06.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 23:06:58 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Sudeep Holla , Marek Szyprowski , linux-kernel@vger.kernel.org Subject: [PATCH V2 2/2] cpufreq: dt: Implement online/offline() callbacks Date: Tue, 12 Feb 2019 12:36:47 +0530 Message-Id: <8030961ef762018fc286e4d3d3a010638e900e53.1549955027.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.20.1.321.g9e740568ce00 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Implement the light-weight tear down and bring up helpers to reduce the amount of work to do on CPU offline/online operation. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 7ba392911cd0..1aefaa1b0ca2 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -295,6 +295,21 @@ static int cpufreq_init(struct cpufreq_policy *policy) return ret; } +static int cpufreq_online(struct cpufreq_policy *policy) +{ + /* We did light-weight tear down earlier, nothing to do here */ + return 0; +} + +static int cpufreq_offline(struct cpufreq_policy *policy) +{ + /* + * Preserve policy->driver_data and don't free resources on light-weight + * tear down. + */ + return 0; +} + static int cpufreq_exit(struct cpufreq_policy *policy) { struct private_data *priv = policy->driver_data; @@ -319,6 +334,8 @@ static struct cpufreq_driver dt_cpufreq_driver = { .get = cpufreq_generic_get, .init = cpufreq_init, .exit = cpufreq_exit, + .online = cpufreq_online, + .offline = cpufreq_offline, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend,