Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1897885ybg; Thu, 4 Jun 2020 23:59:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRbIXj0edP+4c64wkW6eSOAW0pG4exJSyoDIrtTKOTn5uB/VqK2fHlkuU65l4L5/uJKnHg X-Received: by 2002:a17:906:16d3:: with SMTP id t19mr7086657ejd.297.1591340357977; Thu, 04 Jun 2020 23:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591340357; cv=none; d=google.com; s=arc-20160816; b=O+ceStODmDD0uLFsV86OkObDjjquPsUgFG2GR6KU4gyI6vXjlJQNAmGHsmmsvtUJ3L PeypzqQiNpVySXBHG9a4DowPXS87Pld2fPjxxVuOzKiTRwdEoY0HCtRUt/2S5Apk58bb Lw6n32TyozQxd3cs5qN81wlcx9fPjhADUJKcqeRdVXHA3Co5PO0wIYJNsN+XdD2JaA9D C7fzK2txzjBYPZYn0znc5IltrCkX+5H49lY4Lj1LJ2Te5QTrd30DITihrU5MGFvXAvyr RBWWxVn2VTxopK4nN/fWJk20m+A9qeK0k9UTl3uEqf4eN2DzFu5U1HNGEOWxViitZQHc HOEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ol/mCu/wq3XWSqVbrU0PUqg7TLmHc45H/V2FtkyiQoI=; b=Z2nHowleE4O2gaZC4Om7aANTekdizhBHY/oQJALwbOURnV3manbTtDsFkb+jBfiUqi KfThSMhIfRO4QQckuYk09YpczJudsdwRtF2JJ+vAOZ4fs82+lAXVgERsqBWVO0/Y4YbC UFeENG169zda/f3qdhQBvp0iG+ZCPvca+03nbZGLr7SiC5l1PLf/nw+WhA5GCS5SGL0E Mh/leS5wsOghD57oGN724beqLmG/A6lTNvsbBywFe3ByWf+X71/AN19B5A/XzJP+ystk /p5DWcXq3ABGionwLAGzYro7JHuaPsh3UyTHXnkxCGq3qstUnSnKCcL8JslficzcQC0y UYpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s0iUWCiu; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si3002334eji.721.2020.06.04.23.58.55; Thu, 04 Jun 2020 23:59:17 -0700 (PDT) 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=@linaro.org header.s=google header.b=s0iUWCiu; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726179AbgFEGyn (ORCPT + 99 others); Fri, 5 Jun 2020 02:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbgFEGyn (ORCPT ); Fri, 5 Jun 2020 02:54:43 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3542BC08C5C4 for ; Thu, 4 Jun 2020 23:54:43 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id a127so4465083pfa.12 for ; Thu, 04 Jun 2020 23:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ol/mCu/wq3XWSqVbrU0PUqg7TLmHc45H/V2FtkyiQoI=; b=s0iUWCiulnPEJ14VlJ3QPbOHJDtYlaxnZ91r3vHIWzkqTFRP2S2DaxZOjlbTO0nMc7 u/xcfCRQb+BxK+PCUZegWHub1d0/4yoybX0RRiksj5OCJGIgb7dnkFfJ8k8lMYWr6j1D YMtNpiXm0WIy7uK38y5bje5Uiayn0xVbpbxXSNH+1YTZ6if9sCDclc1xzurVjALDH/8A BntGvNMyb5B0DX5XNBT1JNBX+g8dW8K6cu4E47zTAUX2QTiS6Y+VlVJZluhruwf/7ZIW oV8Gx/zXNG0ojt3gCdJn4R1lhr8jWtCCCrhCBrLmXdArZWYtJlfjN6Tf9Wub1gqlLrhr 3X/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ol/mCu/wq3XWSqVbrU0PUqg7TLmHc45H/V2FtkyiQoI=; b=R2j8YHmYN5RKyzIzT6S0AfbkqLRVZ8qp3aRVaRlFWpnwIzbOm8I7WhbBMVsz0PYJkk TLCQiBEweCivoj9JhEf1SzU2FnsbNJz8pSL9+9SvdldYjpP0h6mPhHO+wpDmYRh2CA2Q kwuJgGsmQKYHOU8ePcon4O4ULFf1y22jXEidxgVFVZZYz/IcOdE+aVyK5CliGBTvWCj0 gTaLY0blUVKbvE41Xm5z0qnqOtezkV9mvCasXCi2nBUgznDGy1rPnknbAVgrKkufDjHM GJ5S4jx3aTIIQyIj2d/xkBzDiXiEWnZxS5VTX49jPpilfPpRJ72y41cDbkf6+20lSCDp Pdug== X-Gm-Message-State: AOAM531YY1ajv35FIILISkExCIzvRT9RXpi9XmkHnizeMOmIFYKFfp29 94OmyZHTWzCMSM7u03gTlenHOw== X-Received: by 2002:a63:b10b:: with SMTP id r11mr7798573pgf.27.1591340082464; Thu, 04 Jun 2020 23:54:42 -0700 (PDT) Received: from localhost ([122.172.62.209]) by smtp.gmail.com with ESMTPSA id nl8sm8184779pjb.13.2020.06.04.23.54.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2020 23:54:41 -0700 (PDT) Date: Fri, 5 Jun 2020 12:24:39 +0530 From: Viresh Kumar To: Marek Szyprowski , saravanak@google.com Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mark Brown , Dmitry Osipenko , Liam Girdwood , Lucas Stach , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , peron.clem@gmail.com, Nishanth Menon , Stephen Boyd , Vincent Guittot , Rafael Wysocki , linux-samsung-soc@vger.kernel.org, Chanwoo Choi Subject: Re: [PATCH] regulator: do not balance 'boot-on' coupled regulators without constraints Message-ID: <20200605065439.tzvlny6upxigqx42@vireshk-i7> References: <20200605063724.9030-1-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200605063724.9030-1-m.szyprowski@samsung.com> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Saravana, On 05-06-20, 08:37, Marek Szyprowski wrote: > Balancing of the 'boot-on' coupled regulators must wait until the clients > set their constraints, otherwise the balancing code might change the > voltage of the not-yet-constrained regulator to the value below the > bootloader-configured operation point, what might cause a system crash. > This is achieved by assuming that, the minimal voltage allowed for the > given 'boot-on' regulator is equal to it's current voltage until > consumers apply their constraints. > > Suggested-by: Dmitry Osipenko > Signed-off-by: Marek Szyprowski > --- > This is yet another approach to fix the regulator coupling on > Exynos5800/5422 SoCs in the regulator core. I agree with Dmitry that this > issue is generic and if possible it should be handled in the core. > > This patchset is another attempt to fix the regulator coupling on > Exynos5800/5422 SoCs. Here are links to the previous attempts and > discussions: > > https://lore.kernel.org/linux-samsung-soc/20191008101709.qVNy8eijBi0LynOteWFMnTg4GUwKG599n6OyYoX1Abs@z/ > https://lore.kernel.org/lkml/20191017102758.8104-1-m.szyprowski@samsung.com/ > https://lore.kernel.org/linux-pm/cover.1589528491.git.viresh.kumar@linaro.org/ > https://lore.kernel.org/linux-pm/20200528131130.17984-1-m.szyprowski@samsung.com/ > https://lore.kernel.org/linux-samsung-soc/57cf3a15-5d9b-7636-4c69-60742e8cfae6@samsung.com/ > > The problem is with "vdd_int" regulator coupled with "vdd_arm" on Odroid > XU3/XU4 boards family. "vdd_arm" is handled by CPUfreq. "vdd_int" is > handled by devfreq. CPUfreq initialized quite early during boot and it > starts changing OPPs and "vdd_arm" value. Sometimes CPU activity during > boot goes down and some low-frequency OPPs are selected, what in turn > causes lowering "vdd_arm". This happens before devfreq applies its > requirements on "vdd_int". Regulator balancing code reduces "vdd_arm" > voltage value, what in turn causes lowering "vdd_int" value to the lowest > possible value. This is much below the operation point of the wcore bus, > which still runs at the highest frequency. > > The issue was hard to notice because in the most cases the board managed > to boot properly, even when the regulator was set to lowest value allowed > by the regulator constraints. However, it caused some random issues, > which can be observed as "Unhandled prefetch abort" or low USB stability. > > Best regards > Marek Szyprowski > --- > drivers/regulator/core.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c > index 03154f5b939f..7e9af7ea4bdf 100644 > --- a/drivers/regulator/core.c > +++ b/drivers/regulator/core.c > @@ -3553,6 +3553,17 @@ static int regulator_get_optimal_voltage(struct regulator_dev *rdev, > if (ret < 0) > return ret; > > + /* > + * If no constraints set yet and regulator has boot-on flag, > + * keep its voltage unchanged > + */ > + if (tmp_min == 0 && c_rdevs[i]->constraints->boot_on) { > + ret = regulator_get_voltage_rdev(c_rdevs[i]); > + if (ret < 0) > + return ret; > + tmp_min = ret; > + } > + > ret = regulator_check_voltage(c_rdevs[i], &tmp_min, &tmp_max); > if (ret < 0) > return ret; This is exactly what Saravana tried to solve earlier AFAIR, lets see what he has to say here. -- viresh