stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Tony Lindgren" <tony@atomide.com>,
	"Adam Ford" <aford173@gmail.com>,
	"André Roth" <neolynx@gmail.com>,
	"H. Nikolaus Schaller" <hns@goldelico.com>,
	"Nishanth Menon" <nm@ti.com>, "Tero Kristo" <t-kristo@ti.com>,
	"Sasha Levin" <sashal@kernel.org>,
	linux-omap@vger.kernel.org
Subject: [PATCH AUTOSEL 5.3 17/68] ARM: OMAP2+: Fix warnings with broken omap2_set_init_voltage()
Date: Wed,  9 Oct 2019 13:04:56 -0400	[thread overview]
Message-ID: <20191009170547.32204-17-sashal@kernel.org> (raw)
In-Reply-To: <20191009170547.32204-1-sashal@kernel.org>

From: Tony Lindgren <tony@atomide.com>

[ Upstream commit cf395f7ddb9ebc6b2d28d83b53d18aa4e7c19701 ]

This code is currently unable to find the dts opp tables as ti-cpufreq
needs to set them up first based on speed binning.

We stopped initializing the opp tables with platform code years ago for
device tree based booting with commit 92d51856d740 ("ARM: OMAP3+: do not
register non-dt OPP tables for device tree boot"), and all of mach-omap2
is now booting using device tree.

We currently get the following errors on init:

omap2_set_init_voltage: unable to find boot up OPP for vdd_mpu
omap2_set_init_voltage: unable to set vdd_mpu
omap2_set_init_voltage: unable to find boot up OPP for vdd_core
omap2_set_init_voltage: unable to set vdd_core
omap2_set_init_voltage: unable to find boot up OPP for vdd_iva
omap2_set_init_voltage: unable to set vdd_iva

Let's just drop the unused code. Nowadays ti-cpufreq should be used to
to initialize things properly.

Cc: Adam Ford <aford173@gmail.com>
Cc: André Roth <neolynx@gmail.com>
Cc: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Tested-by: Adam Ford <aford173@gmail.com> #logicpd-torpedo-37xx-devkit
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/mach-omap2/pm.c | 100 ---------------------------------------
 1 file changed, 100 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 1fde1bf53fb65..7ac9af56762df 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -74,83 +74,6 @@ int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 	return 0;
 }
 
-/*
- * This API is to be called during init to set the various voltage
- * domains to the voltage as per the opp table. Typically we boot up
- * at the nominal voltage. So this function finds out the rate of
- * the clock associated with the voltage domain, finds out the correct
- * opp entry and sets the voltage domain to the voltage specified
- * in the opp entry
- */
-static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
-					 const char *oh_name)
-{
-	struct voltagedomain *voltdm;
-	struct clk *clk;
-	struct dev_pm_opp *opp;
-	unsigned long freq, bootup_volt;
-	struct device *dev;
-
-	if (!vdd_name || !clk_name || !oh_name) {
-		pr_err("%s: invalid parameters\n", __func__);
-		goto exit;
-	}
-
-	if (!strncmp(oh_name, "mpu", 3))
-		/* 
-		 * All current OMAPs share voltage rail and clock
-		 * source, so CPU0 is used to represent the MPU-SS.
-		 */
-		dev = get_cpu_device(0);
-	else
-		dev = omap_device_get_by_hwmod_name(oh_name);
-
-	if (IS_ERR(dev)) {
-		pr_err("%s: Unable to get dev pointer for hwmod %s\n",
-			__func__, oh_name);
-		goto exit;
-	}
-
-	voltdm = voltdm_lookup(vdd_name);
-	if (!voltdm) {
-		pr_err("%s: unable to get vdd pointer for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	clk =  clk_get(NULL, clk_name);
-	if (IS_ERR(clk)) {
-		pr_err("%s: unable to get clk %s\n", __func__, clk_name);
-		goto exit;
-	}
-
-	freq = clk_get_rate(clk);
-	clk_put(clk);
-
-	opp = dev_pm_opp_find_freq_ceil(dev, &freq);
-	if (IS_ERR(opp)) {
-		pr_err("%s: unable to find boot up OPP for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	bootup_volt = dev_pm_opp_get_voltage(opp);
-	dev_pm_opp_put(opp);
-
-	if (!bootup_volt) {
-		pr_err("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n",
-		       __func__, vdd_name);
-		goto exit;
-	}
-
-	voltdm_scale(voltdm, bootup_volt);
-	return 0;
-
-exit:
-	pr_err("%s: unable to set vdd_%s\n", __func__, vdd_name);
-	return -EINVAL;
-}
-
 #ifdef CONFIG_SUSPEND
 static int omap_pm_enter(suspend_state_t suspend_state)
 {
@@ -208,25 +131,6 @@ void omap_common_suspend_init(void *pm_suspend)
 }
 #endif /* CONFIG_SUSPEND */
 
-static void __init omap3_init_voltages(void)
-{
-	if (!soc_is_omap34xx())
-		return;
-
-	omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_ick", "l3_main");
-}
-
-static void __init omap4_init_voltages(void)
-{
-	if (!soc_is_omap44xx())
-		return;
-
-	omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1");
-	omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
-}
-
 int __maybe_unused omap_pm_nop_init(void)
 {
 	return 0;
@@ -246,10 +150,6 @@ int __init omap2_common_pm_late_init(void)
 	omap4_twl_init();
 	omap_voltage_late_init();
 
-	/* Initialize the voltages */
-	omap3_init_voltages();
-	omap4_init_voltages();
-
 	/* Smartreflex device init */
 	omap_devinit_smartreflex();
 
-- 
2.20.1


  parent reply	other threads:[~2019-10-09 17:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 17:04 [PATCH AUTOSEL 5.3 01/68] KVM: arm/arm64: vgic: Use the appropriate TRACE_INCLUDE_PATH Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 02/68] drm: Free the writeback_job when it with an empty fb Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 03/68] drm: Clear the fence pointer when writeback job signaled Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 04/68] clk: ti: dra7: Fix mcasp8 clock bits Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 05/68] ARM: dts: Fix wrong clocks for dra7 mcasp Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 06/68] nvme-pci: Fix a race in controller removal Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 07/68] scsi: ufs: skip shutdown if hba is not powered Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 08/68] scsi: megaraid: disable device when probe failed after enabled device Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 09/68] scsi: qla2xxx: Silence fwdump template message Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 10/68] scsi: qla2xxx: Fix unbound sleep in fcport delete path Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 11/68] scsi: qla2xxx: Fix stale mem access on driver unload Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 12/68] scsi: qla2xxx: Fix N2N link reset Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 13/68] scsi: qla2xxx: Fix N2N link up fail Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 14/68] ARM: dts: Fix gpio0 flags for am335x-icev2 Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 15/68] ARM: OMAP2+: Fix missing reset done flag for am3 and am43 Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 16/68] ARM: OMAP2+: Add missing LCDC midlemode for am335x Sasha Levin
2019-10-09 17:04 ` Sasha Levin [this message]
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 18/68] nvme-tcp: fix wrong stop condition in io_work Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 19/68] nvme-pci: Save PCI state before putting drive into deepest state Sasha Levin
2019-10-09 17:04 ` [PATCH AUTOSEL 5.3 20/68] nvme: fix an error code in nvme_init_subsystem() Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 21/68] nvme-rdma: Fix max_hw_sectors calculation Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 22/68] Added QUIRKs for ADATA XPG SX8200 Pro 512GB Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 23/68] nvme: Add quirk for Kingston NVME SSD running FW E8FK11.T Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 24/68] nvme: allow 64-bit results in passthru commands Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 25/68] kvm: x86: Fix a spurious -E2BIG in __do_cpuid_func Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 26/68] kvm: x86: Improve emulation of CPUID leaves 0BH and 1FH Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 27/68] kvm: x86: Use AMD CPUID semantics for AMD vCPUs Sasha Levin
2019-10-09 17:05 ` [PATCH AUTOSEL 5.3 28/68] KVM: x86: Expose XSAVEERPTR to the guest Sasha Levin
2019-10-09 21:15   ` Paolo Bonzini
2019-10-09 21:40     ` Sebastian Andrzej Siewior
2019-10-09 22:50       ` Paolo Bonzini
2019-10-10  7:35         ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191009170547.32204-17-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=aford173@gmail.com \
    --cc=hns@goldelico.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=neolynx@gmail.com \
    --cc=nm@ti.com \
    --cc=stable@vger.kernel.org \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).