From patchwork Wed Dec 7 10:31:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 87005 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp241543qgi; Wed, 7 Dec 2016 02:32:11 -0800 (PST) X-Received: by 10.84.193.129 with SMTP id f1mr145770900pld.129.1481106731388; Wed, 07 Dec 2016 02:32:11 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k129si23462194pgk.90.2016.12.07.02.32.11; Wed, 07 Dec 2016 02:32:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbcLGKcK (ORCPT + 13 others); Wed, 7 Dec 2016 05:32:10 -0500 Received: from mail-pg0-f47.google.com ([74.125.83.47]:36651 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbcLGKcJ (ORCPT ); Wed, 7 Dec 2016 05:32:09 -0500 Received: by mail-pg0-f47.google.com with SMTP id f188so160204119pgc.3 for ; Wed, 07 Dec 2016 02:32:09 -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; bh=3tmpXT+mexWQiXHXphvJxeSKgG3IxXPhVOJHiWso0yw=; b=TPpQiE3/AEzkqazxCJVC/lDaCENboqdyMBcV66kfZv8CBC/BsiGKZqoCq+6mrpyUbK 0YdBxWKwhjf4OWjX5GGo9iGz9tLkjEmqIdoTrOvK2xF1q2jsz2Smhao/bX/HEkfYpV2E IT07OBX49veJISifRrs6TcIcZ0CjQq6oZgEGk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3tmpXT+mexWQiXHXphvJxeSKgG3IxXPhVOJHiWso0yw=; b=I7Ksi0gdBkmi2yjqxQHVRnvgrUVy0UL/7FZIAYlVuz7j/TyABESkLfKhLZO8BHyf7A /xvpPVZJJ8q5f2C2unC+LrdGrviZmTIDE9iT/k4Cdnubblle/6QpMTJehtmvdLmCJjmz LXYG2YjHEjEU011AwZQKkyYyIkck2Jy9vdThBtN/JAU+wWEFO+PAB0t0ntWOpUHyfDdY wGewj5rX08IEXizDqUxdnvdKQ2gSpY+v7KdifzRiaBmHNlS/ZMHcjZM+T1RZjZubldzB tx28Ze5tdhpDuFbcz1IuIa2Fl7y2zMt80/0xui79nyRSYwH/8ChIjBFe4nxwdne7KGEq Xm9Q== X-Gm-Message-State: AKaTC01cwUoJWjBxF3mpvXExDO6CECz6Gb75aQwWTNSSQ+psCSX1zkt/vIiAxGaajRk1+S5t X-Received: by 10.99.50.67 with SMTP id y64mr120353860pgy.146.1481106728493; Wed, 07 Dec 2016 02:32:08 -0800 (PST) Received: from localhost ([122.172.43.83]) by smtp.gmail.com with ESMTPSA id u3sm11466064pfk.3.2016.12.07.02.32.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 02:32:07 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , jonathanh@nvidia.com, swarren@nvidia.com, treding@nvidia.com, Viresh Kumar Subject: [PATCH] Revert "PM / OPP: Don't assume platform doesn't have regulators" Date: Wed, 7 Dec 2016 16:01:52 +0530 Message-Id: <1560e022c1584376cf5a55ed048e0b60485adf2b.1481106666.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This reverts commit ef3caabee9691386e6801ea92150e37277db9c7a. The commit was based on the assumption that a platform with voltages specified with individual OPPs, would have registered a regulator as well in order to do full DVFS. That assumption is broken by the Tegra124 platform. For Tegra124, the voltage is not scaled via a direct call to the regulator subsystem because the DFLL directly controls the I2C interface that controls the voltage. The DFLL essentially figures out the max frequency for a given voltage. So to run at a particular frequency, the DFLL continuously adjusts the voltage in a control loop fashion to get the desired frequency. Following are the logs from: NVIDIA Tegra124 Jetson TK1 cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 696000 KHz cpu cpu0: dev_pm_opp_set_rate: Regulator not registered with OPP core cpufreq: __target_index: Failed to change cpu frequency: -22 ------------[ cut here ]------------ kernel BUG at drivers/cpufreq/cpufreq.c:1235! Fix these by reverting the offending commit. Signed-off-by: Viresh Kumar --- Rafael, you can simply drop the patch if that is easier for you. --- drivers/base/power/opp/core.c | 13 ------------- 1 file changed, 13 deletions(-) -- 2.7.1.410.g6faf27b -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index 7db672f632d9..6af371a55062 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -747,20 +747,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) /* Only frequency scaling */ if (!regulators) { - unsigned long u_volt = opp->supplies[0].u_volt; - rcu_read_unlock(); - - /* - * DT contained supply ratings? Consider platform failed to set - * regulators. - */ - if (unlikely(u_volt)) { - dev_err(dev, "%s: Regulator not registered with OPP core\n", - __func__); - return -EINVAL; - } - return _generic_set_opp_clk_only(dev, clk, old_freq, freq); }