From patchwork Fri Dec 8 09:30:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 10101933 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 D4124602A0 for ; Fri, 8 Dec 2017 09:35:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF10C28B88 for ; Fri, 8 Dec 2017 09:35:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C36EE28B8C; Fri, 8 Dec 2017 09:35:59 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable 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 7756428B88 for ; Fri, 8 Dec 2017 09:35:59 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=jK/drzCWSmCnGHwwW4k2f+/kR8wCi3Vrz6ZII54xWXI=; b=mSxVmq3qoD8JxPs0dUIfgvdf7A o6qBRtHMERu/h7F2oXlRhYSnKRRWvgPsYcKMpHY8Ircym67b09x9h5OseRMLywG/u/ibIXGG/YFmn erOE8VKa1/zl+J2huArtD0qGWJynj/McutI50dCLz9rEsXYbykjDKJLUZBJPwBlKR/n4nKnds6JGO r2Hri+fWAlE0Keodbf/dX+bSEq3qisCwTmQomsxV2De6bNNvEIlhxuOviFO27kz/mODgczAI1e17l a5FJ6fOz/HO+bPou0yZCrp2aAes/4rm8TQtkBNKgACuTybrco8bYugOa8E3ql4oFnVmyYRWEqttvy E1OJ6+Wg==; 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 1eNF4V-0005GR-Pt; Fri, 08 Dec 2017 09:35:55 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eNF0S-0000TU-LU for linux-arm-kernel@lists.infradead.org; Fri, 08 Dec 2017 09:31:58 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2463B6081E; Fri, 8 Dec 2017 09:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1512725479; bh=cl+ePOdI0PvmQgdQneALUX5drhxjNSVY7KX6Enb516w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RjyCiCPOojYc+LXCVJVNIZnZLokovY8Q3/o7DWexW5Oqf/II0279y7PnNJ91uo7Ne 6hhrDG2uJSONJxM36/WNsGjISnPRv1r0FW84YAlMCUIc7opJELOgO6bTn0dE0YLc23 IWCrREMzswV3SreHT/N4HWlylj8Fub/VhHA3nAnQ= Received: from srichara-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sricharan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3AE146083D; Fri, 8 Dec 2017 09:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1512725476; bh=cl+ePOdI0PvmQgdQneALUX5drhxjNSVY7KX6Enb516w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MR4vj8V3Ia+jhGwmo4s7SW8fBbGvXCbXWU0euF8Ga4yNIpsljkHMe1srLosSP+eNR n9cAJp/CCT9OyiBOXCqp0LiZJgC2FwnezC3dr5T8ndJ0DmZKbCDvh0ZXUt3Q4XDUdk LZAVcIhNYRyBcE5zst8lLv6epx2IuXjEyYCSAHY8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3AE146083D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sricharan@codeaurora.org From: Sricharan R To: mturquette@linaro.org, sboyd@codeaurora.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, viresh.kumar@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 12/12] cpufreq: dt: Reintroduce independent_clocks platform data Date: Fri, 8 Dec 2017 15:00:01 +0530 Message-Id: <1512725401-4944-13-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1512725401-4944-1-git-send-email-sricharan@codeaurora.org> References: <1512725401-4944-1-git-send-email-sricharan@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171208_013145_534445_C420A0A0 X-CRM114-Status: GOOD ( 13.88 ) 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: sricharan@codeaurora.org MIME-Version: 1.0 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 The Platform data was removed earlier by, 'commit eb96924acddc ("cpufreq: dt: Kill platform-data")' since there were no users at that time. Now this is required when the each of the cpu clocks can be scaled independently, which is the case for krait cores. So reintroduce it. Signed-off-by: Sricharan R --- drivers/cpufreq/cpufreq-dt.c | 7 ++++++- drivers/cpufreq/cpufreq-dt.h | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 545946a..8f0e881 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -228,7 +228,10 @@ static int cpufreq_init(struct cpufreq_policy *policy) } if (fallback) { - cpumask_setall(policy->cpus); + struct cpufreq_dt_platform_data *pd = cpufreq_get_driver_data(); + + if (!pd || !pd->independent_clocks) + cpumask_setall(policy->cpus); /* * OPP tables are initialized only for policy->cpu, do it for @@ -380,6 +383,8 @@ static int dt_cpufreq_probe(struct platform_device *pdev) if (data && data->have_governor_per_policy) dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY; + dt_cpufreq_driver.driver_data = data; + ret = cpufreq_register_driver(&dt_cpufreq_driver); if (ret) dev_err(&pdev->dev, "failed register driver: %d\n", ret); diff --git a/drivers/cpufreq/cpufreq-dt.h b/drivers/cpufreq/cpufreq-dt.h index 54d774e..dcc03c6 100644 --- a/drivers/cpufreq/cpufreq-dt.h +++ b/drivers/cpufreq/cpufreq-dt.h @@ -13,6 +13,12 @@ #include struct cpufreq_dt_platform_data { + /* + * True when each CPU has its own clock to control its + * frequency, false when all CPUs are controlled by a single + * clock. + */ + bool independent_clocks; bool have_governor_per_policy; };