Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1450462pxu; Thu, 17 Dec 2020 10:11:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJaeNnDhxax2dR0KW/cdtyqEhQiFXWbxRMLZrvNMFV9yU1tU2f7eyl8rSZiExJqNhbJA4m X-Received: by 2002:a17:906:2d42:: with SMTP id e2mr253624eji.292.1608228677374; Thu, 17 Dec 2020 10:11:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608228677; cv=none; d=google.com; s=arc-20160816; b=HhaaA2QCp+flqRU4qMLstf6I1QN483DOrXo0gwPL45mVjOjr8FmMUXiS6J0DrMYDCP 6XqXRNTmgMPiQeC5I5SpCwSQDnqRgLgFNmDl8Vd1n4YKXlq09NW6wUWUsXZWZYXYUGCq ER21kxJRW2542QaACF0AitLXDAHbdQmZBD7ZgYihEbsuXLPxrtxOoYPvZIjvRrQwl/3h cv7UJXNIPCKyV9pN60wOCx+j8qxtavRNjkMln4YS4U8oWs5TDy/pRz+gPnbf4Oq36ScI OleDBDyXWZ+9B9l7gW4UoQkpKpZXFDOKI4l+ISmUwfTh7SBwIwaK1+2wiZh+HAoS+W4z KXeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G4bkjkogJjxhucwk91y1cMW03U1PPlta2j9gVHq9Ll8=; b=PiIieY+l2bXZks73/JP0ImumX/i0o79ED1XLZ4UAeP7yeEU623TtZD9irSXgpjJ2zq cM42BqMYDbTGHr2g/Xk62pbhfIiRZBvXsW0U15zZHW1QNIwWwZYnU7oubXGIBXgYyMyX 57KuotzQqPiAZkpOoKr7okwXM6JJ9KVrwnvE0hbafySf4oEGm3vvwjeH2sez58j3R9f5 XMWptu3jPZUEtjJEbuaka/Umj+e0IKMYKBtYvUj3KaSZZ6F3FQT8yfYRcJo/I6ZzVPow 1/9n88DxOn3gjyhR1xIUet35PsVdWtAbBqv56fpyx+cUSTAaqZsKmFzUz6p9o+1P1YSV qpYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rCQoU2/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si3094999eja.462.2020.12.17.10.10.54; Thu, 17 Dec 2020 10:11:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="rCQoU2/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730837AbgLQSJF (ORCPT + 99 others); Thu, 17 Dec 2020 13:09:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730728AbgLQSJA (ORCPT ); Thu, 17 Dec 2020 13:09:00 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 177EAC0619E0; Thu, 17 Dec 2020 10:07:56 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id a12so59838968lfl.6; Thu, 17 Dec 2020 10:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G4bkjkogJjxhucwk91y1cMW03U1PPlta2j9gVHq9Ll8=; b=rCQoU2/mmvaocNvlxnid7FO29LSc024mSugBl0tdXdcytFbXH2gOlnpwvt8N+30PAg yb7ttQI7FzhzKZR924B0d/3R9LNPoRgpBoGk0IOcVJPsgsWCQsxmEeE2TiSNUf6U2zEk UAcyUD0vHfvlRRaoHCc/jZeM8FZ6u+jxT5WvXS4q07C3L49UI1+T4YyeAM47/km2IUMY +h1CezyjEzhVg+SazrlVF4o2uUgbBVRUzc6A6H4zBIs3ZtIXUR4lCvTjP1X8Ma8ljpX9 s1nx5sADEfu0hG1dR8Px9QD2KFwkR1jqfRP1a8gQc0nLBI4Jl41CHBYNpt0S5HTVpgKO Zxqw== 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=G4bkjkogJjxhucwk91y1cMW03U1PPlta2j9gVHq9Ll8=; b=D8mfas+qbdsqplY0WMy08me3O0uooIHO6iiB1FkvJlAfES8mUOi9NvOk0RkAf5xMpz oE3zwYm7A0FX0pe26tweC/WYXQaDJ4jHFYD+n67WQjb9Aj1PuXHM0BLO2zm1gok8RroD bpBhuPUI8Zx4rpxgfDeRrmxJrSoiOypJ136acS4jLLmawr/anCzl7sVxYxhoccLY4frf 92Jwglv0zRD5sIvD4RhRhSyZB08hyp77mgpaFSnyeUU8g9u/oDDwtEOB9q0zFMkWTDxo g0FUB8OH9X9l91irRJsolz92RrLFGHY+AfvgJffd3cJ+HaE2hZk6IbagyQb5pAjTGFEN gQrA== X-Gm-Message-State: AOAM5303lGJv+QknzbRmuwWLXWxTMe8BGXykk5fznRQqkvKpsg9Q4yKJ rUW1E1CftrZKbnKIbvbWnqfL/dc/Tn8= X-Received: by 2002:a2e:9b4d:: with SMTP id o13mr200509ljj.163.1608228474656; Thu, 17 Dec 2020 10:07:54 -0800 (PST) Received: from localhost.localdomain (109-252-192-57.dynamic.spd-mgts.ru. [109.252.192.57]) by smtp.gmail.com with ESMTPSA id u5sm655596lff.78.2020.12.17.10.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 10:07:54 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Mark Brown , Liam Girdwood , Ulf Hansson , Mauro Carvalho Chehab , Rob Herring , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Michael Turquette Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v2 30/48] soc/tegra: regulators: Fix locking up when voltage-spread is out of range Date: Thu, 17 Dec 2020 21:06:20 +0300 Message-Id: <20201217180638.22748-31-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201217180638.22748-1-digetx@gmail.com> References: <20201217180638.22748-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix voltage coupler lockup which happens when voltage-spread is out of range due to a bug in the code. The max-spread requirement shall be accounted when CPU regulator doesn't have consumers. This problem is observed on Tegra30 Ouya game console once system-wide DVFS is enabled in a device-tree. Fixes: 783807436f36 ("soc/tegra: regulators: Add regulators coupler for Tegra30") Cc: stable@vger.kernel.org Tested-by: Peter Geis Reported-by: Peter Geis Signed-off-by: Dmitry Osipenko --- drivers/soc/tegra/regulators-tegra30.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/tegra/regulators-tegra30.c b/drivers/soc/tegra/regulators-tegra30.c index 7f21f31de09d..0e776b20f625 100644 --- a/drivers/soc/tegra/regulators-tegra30.c +++ b/drivers/soc/tegra/regulators-tegra30.c @@ -178,7 +178,7 @@ static int tegra30_voltage_update(struct tegra_regulator_coupler *tegra, * survive the voltage drop if it's running on a higher frequency. */ if (!cpu_min_uV_consumers) - cpu_min_uV = cpu_uV; + cpu_min_uV = max(cpu_uV, cpu_min_uV); /* * Bootloader shall set up voltages correctly, but if it -- 2.29.2