From patchwork Mon Feb 11 08:41:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 157979 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2346390jaa; Mon, 11 Feb 2019 00:41:59 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia/XkQUodoie+9kQ2HJDt6aOTGrhSv1pU2beIx5ey8AsqvRV0DSCJZH+HIQo57fnKr14d7m X-Received: by 2002:a63:4342:: with SMTP id q63mr32852427pga.63.1549874519033; Mon, 11 Feb 2019 00:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549874519; cv=none; d=google.com; s=arc-20160816; b=ukshAZz9F5iTak8i9WFtadZj+pfo0FYPTWbc6/wZsoNTBL+RiBrZpIxq1+5j3WhLuH 2JwfPizPppmiVnzbJItdyNrz3+v7TxxWHuHB0EthutylD287+2F2MlUhzJSJZSvwL+wD dbZaxH3xLUCzi7703u5AIvyWcmr2U44Fb7VcbsLQIZRv0gX9f0b2r5mbNkLUaLhIF0Dh iwCG9XV1bCtw2U1BOZj7id7ClJXzYXSXMqqND51rwrhFbIsrZm0pZeBfHysj/utHxsE/ UEaP4F2CiHa0BniChFG1udvksUT+arEwWjFPV47XNpwjpXz330+pT+d7MUmraZDwncyk HzLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y3+EyDegbUZpN+/R1MgR55TgRo8j8NBTJTSndSQPWD0=; b=1LQVKzw6pFu5vJISFpj0FKRl7o/ewq/sM66MkL0rDlVoDYkPJyGbBH/WdOz9toPyb+ gPTHvnNb8iC3G7Gpx2veidWzQ49ZGfRZvCfrk4dXSB4x46AluZg6sjYTjap5KGcL18c3 XuhHmDPPS87XA53Y5f5bMEb+e8Khi7f6Skb+JNU+jORIaR24yNFWCjIgXS8gZtKrBnB8 3veoUPHkxYqGI99eU5VMv8McyAdrDmJnYJ3DrfjuWFbCOjLgcsILEENqha2YfZq9PXF+ OSl0HyT18Asl5NqlJC4+8ooA60/Pc/ztVaAveQzGUct3xMf3D4HMYSPH88KcMtMbkU+N 6R+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQPLUdQ8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si8722220pgv.252.2019.02.11.00.41.58; Mon, 11 Feb 2019 00:41:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQPLUdQ8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727194AbfBKIl5 (ORCPT + 31 others); Mon, 11 Feb 2019 03:41:57 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39418 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727153AbfBKIlx (ORCPT ); Mon, 11 Feb 2019 03:41:53 -0500 Received: by mail-pl1-f194.google.com with SMTP id 101so4985780pld.6 for ; Mon, 11 Feb 2019 00:41:52 -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=y3+EyDegbUZpN+/R1MgR55TgRo8j8NBTJTSndSQPWD0=; b=nQPLUdQ88SR8I618ybEF8PhcK/8OnkEyxsMH/TdZxs7qW3iSyHn7lUcaTr8GQ07QWH iP8FXv5dSYeLNQ0lCSXM/MvC73lxeaWP0nVpsNe3lQNpbsuhWzrSMT7pBof4smocsBTv 0EFbGSxTAYh11BQc9kFDi2RgQXbMy4FK2V1k7PvPEiFEh9PV9h55in5F+Ec/wZdcarzQ Dui1JyeqHyKrv6xU5PtT/ztO0z6rR6lLmaqtwCuVhLjcuih/x62+TvrlRHYvUQX9umqp nIdG9qsZC5arJT66/GjlQcog2UhnNUaFYYKg3f6EU+PnezQFBUdn23SvQVqRdUHOxYt0 fcSw== 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=y3+EyDegbUZpN+/R1MgR55TgRo8j8NBTJTSndSQPWD0=; b=Fen8zVYvkETPPPFfGrfcAxsuL/PpIpFHUMFlAtU8UtZ+bI4SScbvrX6xknsktRbKqD kfD6mk8AVk3qfGdXigfCw/cSjr1fOw+GbafbPxim4ggajOxAlPceU1lSr1XshleBWPP/ Ofh21ExRV9Qq0/gNBSQypPHNA0f40zJUPzqlvaTRfupRthBRoR5ztRK4mEl7hE5SoPPH x5rcpNPR60BsERHTNh3sznDdTgHAOAnvagP1dczx7XhIF35mtuNSHoZvGHG8WcUq3hN3 1yh4BKE4U4NQXvRZ1wXZmtDzJcttv3USzbzCMJGz6GWh9UVmJ0zSQH1u2fE8q6TXD/4x LneQ== X-Gm-Message-State: AHQUAuZVkvNH6r0pjxL+fukkA1buIDe+a8/eOwrCWCfSo2hRDiOYtaX2 30InHYQgp3AdJGh7Q6vsbNA1xw== X-Received: by 2002:a17:902:a411:: with SMTP id p17mr36083302plq.292.1549874512588; Mon, 11 Feb 2019 00:41:52 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id m68sm3134173pfj.89.2019.02.11.00.41.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 00:41:51 -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 2/2] cpufreq: dt: Implement light_weight_exit() callback Date: Mon, 11 Feb 2019 14:11:36 +0530 Message-Id: <742f4f42ae944a3ad13216f96fb0d03d394c395e.1549874368.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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement the light-weight tear down helper to reduce the amount of work to do on CPU offline/online operation. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.20.1.321.g9e740568ce00 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 7ba392911cd0..69309a8121f0 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -160,6 +160,15 @@ static int cpufreq_init(struct cpufreq_policy *policy) const char *name; int ret; + /* + * We did light-weight shutdown earlier, nothing else to initialize here + * apart from policy->cpus. + */ + if (policy->driver_data) { + cpumask_copy(policy->cpus, policy->related_cpus); + return 0; + } + cpu_dev = get_cpu_device(policy->cpu); if (!cpu_dev) { pr_err("failed to get cpu%d device\n", policy->cpu); @@ -295,6 +304,15 @@ static int cpufreq_init(struct cpufreq_policy *policy) return ret; } +static int cpufreq_light_weight_exit(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 +337,7 @@ static struct cpufreq_driver dt_cpufreq_driver = { .get = cpufreq_generic_get, .init = cpufreq_init, .exit = cpufreq_exit, + .light_weight_exit = cpufreq_light_weight_exit, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend,