Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3020440imd; Sun, 28 Oct 2018 23:54:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5eOWV2SH8gegnNOjwT1fjIJm0KZ93k6SWt7MAHGqtD48j3Rsm1eQaW/y/w7b3WI9aYCstqM X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr667242pla.91.1540796050370; Sun, 28 Oct 2018 23:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540796050; cv=none; d=google.com; s=arc-20160816; b=gyHg/Q7Cmmj7V4+xVyOBzO60efY6rRWjqwRwnqaTVmxjg9jaBIV7m3EibCWjyJWed7 d2DA545NQ2fsn/bsy6Y/FStPWxWqxcnZ0OoDVWYPVm+8lrP2ZAJ0FJcjvH3S+hOsggm9 CH3P9aLiHOtpukagrD1LiA0CZFP2lFsxeI9IEBpnIrx2z22N8FQL1SQ5lJHki7ERHOO4 q1HyAsvExlH8IaYUcvaC99+6YCgUCn7eblCSBVH0MtW5cTlrGTPolhk0eKkz3MKQAlWD wMV/np5qYAiEaY9GsdaqLLQBbZR9u8OxY3y1gI7qN5CWAGVwPYxX+FJAZ38DFm3aVsoU RajQ== 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=B/ZylJSVuUpgOcweumoLkbeQjDOc4GfwGjte7r8U6EM=; b=sLm3qt7kYAtfC6OgIeH+6l6ghJhjsQi482wL41pc302HcWfJ8YNssZRy+Meouf8gdM a8JYerEioWdKflckQrJMRIZ1eQD4n/yEikUS61k4zHimnWIyVfq9UNGf46ioRFw7ybjg 3ueK2Xv7//H9pc9NOkcKUpKceTjBEWYJ/P57uzcruqbSIgimuT3sPkRxlV8uO+o35Pv2 mxqvTzchqR0Ww0i8QY8U9y0ykQwA0uwByYlVUCLEFamdgSIl0Of8Sf+VlLcSrAUsqiKq luXYNZVwcdH1x4UL//A5OWda9Y+rBs9yGFpfL+WH9TWKux9vFT3MR53gXzixrJU/A+jt XsYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jsHcmiq1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id t11-v6si19208465pgm.572.2018.10.28.23.53.54; Sun, 28 Oct 2018 23:54:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jsHcmiq1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729331AbeJ2Pkv (ORCPT + 99 others); Mon, 29 Oct 2018 11:40:51 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38472 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729323AbeJ2Pkv (ORCPT ); Mon, 29 Oct 2018 11:40:51 -0400 Received: by mail-pl1-f193.google.com with SMTP id p7-v6so3332544plk.5 for ; Sun, 28 Oct 2018 23:53:31 -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=B/ZylJSVuUpgOcweumoLkbeQjDOc4GfwGjte7r8U6EM=; b=jsHcmiq1aYWIXnwApUxQO3QDSYc/7ol2ufmxfGxOMf4gxSeQCzTEH8rqBKfvRcb2mY T5f7DoYIwfWLWvNyT/rAuxkw1DHzhiTN7xa7EwEOhwe49ZNRAzScMnni/2ElA6wBRU/k /YvR/IWvldLkrQu+lQc9SJ6XtchD8Nkr3IV7Q= 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=B/ZylJSVuUpgOcweumoLkbeQjDOc4GfwGjte7r8U6EM=; b=CWA+e0gRtX3oHZleR2mPbZUiO2PuIT3Ky61c1mQPWTmfOk5Qa9gyKBzY6ZRd/dp9aP eid7KmXol4uoZLOZkkEWM4dfLXH7Ze+adAf6Lxq9DeuQ/DHUnPwVPMQGig4dVRobLD7T 6kpgyohoVSavTbEtdwDS/Z8O8qUGJbvFilAh48z8a2oJkDlZ+pu2S3E7yPJv4H8ajJ3L 6i11Yriz1GPPT2Pvh47qJbn1gwixc0zskrO1rstLcwQVyru+s/uudLkg27oFaymcy4Uj V6McQ+fdo4iuiufxIumCCr1k6gtrMxzBVHhMFCRYPcFK40koHyCg4YkYNd2co7Xuyzlk ytdA== X-Gm-Message-State: AGRZ1gIra/IsrBvKtREQgYDSKw7q/7BhrMAJ+maiGEN0GnJE5LaVFAgB CzteFTAAkCn7tyWpHXCj2hI2Sw== X-Received: by 2002:a17:902:b692:: with SMTP id c18-v6mr13135737pls.191.1540796011019; Sun, 28 Oct 2018 23:53:31 -0700 (PDT) Received: from localhost ([122.172.56.94]) by smtp.gmail.com with ESMTPSA id u2-v6sm3625534pfn.50.2018.10.28.23.53.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 23:53:30 -0700 (PDT) Date: Mon, 29 Oct 2018 12:23:28 +0530 From: Viresh Kumar To: Dmitry Osipenko Cc: "Rafael J. Wysocki" , Rob Herring , Thierry Reding , Jonathan Hunter , Nishanth Menon , Stephen Boyd , Marcel Ziswiler , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 01/17] OPP: Allow to request stub voltage regulators Message-ID: <20181029065328.6vkbwjnq2zzwxric@vireshk-i7> References: <20181021205501.23943-1-digetx@gmail.com> <20181021205501.23943-2-digetx@gmail.com> <20181022053636.ag62j3rj3vovbz53@vireshk-i7> <20181022113224.b5fiebgy2aap66nd@vireshk-i7> <29f893be-feed-c4c5-8468-51f7228dd468@gmail.com> <20181024064123.lbpbeervghp35fe7@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26-10-18, 15:03, Dmitry Osipenko wrote: > On 10/24/18 9:41 AM, Viresh Kumar wrote: > > On 22-10-18, 15:12, Dmitry Osipenko wrote: > >> Because there is one Tegra20 board (tegra20-trimslice) that doesn't declare > >> necessary regulators, but we want to have CPU frequency scaling. I couldn't > >> find board schematics and so don't know if CPU / CORE voltages are fixed on > >> Trim-Slice or it is just preferable not to have DVFS for that board, it is an > >> outlet-powered device [0]. Hence tegra20-cpufreq driver will request a dummy > >> regulators when appropriate. > > > > We have been using the regulator_get_optional() variant until now in the OPP > > core to make sure that we don't do DVFS for the CPU without the mandatory > > regulators being present, as that may make things unstable and cause harm to the > > SoC if we try to take CPU to frequency range over the currently programmed > > regulator can support. > > > > Now coming back to tegra-20 SoC, which actually requires a regulator normally by > > design. On one of the boards (which is outlet powered), you aren't sure if there > > is a programmable regulator or not, or if DVFS should really be done or not. > > Isn't it worth checking the same from Tegra maintainers, or whomsoever has > > information on that board ? > > I'll try to find out more detailed information for the next revision of the patchset. Thanks Dmitry. > What would happen if there actually was a regulator Please preserve the '>' from previous replies at the beginning of the lines. Otherwise it looks as if you have written the above line. :) > > and its default settings aren't good enough for high end frequencies ? > > Usually this causes kernel/applications crashes and/or machine hang. Sure. I also do remember from some guys (maybe TI), where they mentioned that such scenarios can harm the hardware as well sometimes. Don't remember the details though. > And because you are moving to regulator_get() API for > > the entire SoC (i.e. its cpufreq driver), people will never find the missing > > regulator. > > Regulators core prints info message when dummy regulator is being used. Sure, but they are easy to miss and they are only seen by developers not regular users of a machine. > > If we can do it safely for all tegra20 boards, why not migrate to using > > regulator_get() instead of regulator_get_optional() in the OPP core API itself > > for everyone ? > > > > This should be a platform-specific decision. For Tegra we know that regulators should be in a good state at kernel boot time, I don't think that this applies to other platforms. Based on the other discussion with Lucas on this thread, I don't think this is correct any more ? Don't get me wrong, I am all good for changes and another API change doesn't matter much to me. I am just wondering if it would be the right approach to fix the issue. Why not rather call dev_pm_opp_set_regulators() conditionally and avoid calling it for the specific tegra20 board. -- viresh