From patchwork Fri Dec 8 09:42:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 10102039 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 B24AA60360 for ; Fri, 8 Dec 2017 09:47:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9B5628B45 for ; Fri, 8 Dec 2017 09:47:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E9BB28B8C; Fri, 8 Dec 2017 09:47:41 +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=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 23F1128B45 for ; Fri, 8 Dec 2017 09:47:41 +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=gUIsJaQNYZUeo8+5y+ccxYCX1y b0bmyFu3g2F3M9/MCSS10MXktSR1ipvQFBDyUCvUbZ4InJKeWu80BzuhftSpQ9fQpRyx0TkuA//DP +N8EjMgWGCsPWL5Q3X0JPRvZ4DJvhVnKRlRc3M5yZiLmHecPDjXlHkTUZb7pc6IH+mqsKOmxAKxK2 Ry7aghyhm/6Kd46emgr6Dar8UJduWFdNqMgG5nbZ++4SOQaatYmiXuEJHpbg6k+xfU/NAgGjLqLnp CUicTAhDtJL7xbtWL7jmcmaJ55RWzYZ27AhISPS+Z3PLZQVRntooY50Tf5VzSkKG5ZSTtUggGLVpi iYxAFknA==; 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 1eNFFr-0007mj-V5; Fri, 08 Dec 2017 09:47:39 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eNFCQ-0003Tb-3U for linux-arm-kernel@lists.infradead.org; Fri, 08 Dec 2017 09:44:48 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7E8B160D60; Fri, 8 Dec 2017 09:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1512726228; bh=cl+ePOdI0PvmQgdQneALUX5drhxjNSVY7KX6Enb516w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ihzHZ+QMlZnyaPhFWJIkBCQmvIWwTll6XGangU5nAgYj2U941dD61AJpR1qKsvDNY kPxOhS01dnNnUyXmSBby9+wcWg4VJ1gWQkU1xLp56AKR/rpLqcJLslNlHt6+LSH1JZ OjUB5eKKTu98wGqlIt5CpGn/pMqZkg8M6qofvvvM= 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 A72E660FEC; Fri, 8 Dec 2017 09:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1512726226; bh=cl+ePOdI0PvmQgdQneALUX5drhxjNSVY7KX6Enb516w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYNLNYoc/viyrR7MAKa1p4jxJHXm4fOccdo/wSNEv31e+MMAy0yMv1dYjMwAqrQjG /GfVUUDl2m+cnuypvmBtgizxNmq4zGwt2hioax95y17OEY8Ldz5d3g9cGUrz6MTGZ0 YelaH/DxGkWwnvF5sUVmxdc3Qh02pv/T8C2meBjc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A72E660FEC 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@baylibre.com, 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:12:30 +0530 Message-Id: <1512726150-7204-13-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1512726150-7204-1-git-send-email-sricharan@codeaurora.org> References: <1512726150-7204-1-git-send-email-sricharan@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171208_014406_823438_49242F5F 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; };