Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1838905rdh; Sat, 28 Oct 2023 09:04:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEj6oEgBuM+rpaqIhwhh9fMQooZZpDyekRVV1ynoe9WDLKT5lvHJtwj6yokaBDvz9b2sgj7 X-Received: by 2002:a05:6a00:1410:b0:6ba:bd35:9efd with SMTP id l16-20020a056a00141000b006babd359efdmr4979311pfu.5.1698509062858; Sat, 28 Oct 2023 09:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698509062; cv=none; d=google.com; s=arc-20160816; b=FhRxs8bSWz07KHmWodHQ14iolkt6pBmCR8EkRqqbVABqQwPbbm2SrVgCf5RS0smBuX FjFc+F93ymQSQGhN+Q9cQByzPbclffaReges/v0geV0HK8VsCqs9O02tJJ0ReCFQ5nTU J6sYppaUhx2M3madgrqtn+Q/vz+8CUyNBHWOs2v3PXkmzup18atk9JKSmZeeIdhwg13Z t4OhIJh3Fkyk6Lwq3HWTjA0+ZckON3mQDpox0yWMMx1fU6/yxy09mKd1rOYIPktAz/j4 SG+cMu+UeFtCyOUsbaqjVmHV2jBcLLPEUs1HoBXFDMOWWkNmXj8HoC4Xk0j05zhC3/jZ X3jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=eSKhnAArEdJ0K2lY6fWY7BVlQz2sRRzxT30U8f6o7W4=; fh=im91bCoowEyp+PK2bTdRf7agunmgj1to2mzO3AoGJPQ=; b=n1XHarIh7lhl82oZIZNBYaEGfmQj0e+NTTvgWcPAyjYVte1PXyPhDnPY52prvgkZlM axDBfqDSHMVyDgf63rLuxL+sv7d/OWXnFpW0hEbRvsj4ZgnajmZxYkkGJAEoTmIcJoks 6E2OBnC9V71kbUzM5cpBOi9rXkLj5UKYOBXbBMck9prbpTIO9saXt2HJibksWjh0GWGU CNeKkaGCPOp7T0PrMt8zvjXt7UqtMYPifJycQFc+1gvOaIhQ3djEZGTS5RY92op/9Z3i q+bYlQB7gVXJkYUGVGg85/KCaFHV+GQGOp2rpxBbeGPD99/VusJ5QYyt4XoB55SF+RrS kiow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="YjV4h4/k"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 135-20020a63008d000000b0056a1a149034si2608472pga.650.2023.10.28.09.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 09:04:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="YjV4h4/k"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 14E8F8098FC0; Sat, 28 Oct 2023 09:04:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbjJ1QEJ (ORCPT + 99 others); Sat, 28 Oct 2023 12:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjJ1QEI (ORCPT ); Sat, 28 Oct 2023 12:04:08 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A39E1; Sat, 28 Oct 2023 09:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=eSKhnAArEdJ0K2lY6fWY7BVlQz2sRRzxT30U8f6o7W4=; b=YjV4h4/kQ81uUu8OE7ZkPEDJq+ 6ooH46Hz62+KmbbnRO78qSEL/ogehoEiyM8mf/tFt5TDe/sdYSM6qjn7FdIFgK9gRz96uGyCKnebv vUiqIL2EEgDcWXGpx2FnOXnl3iqYNHWNoltpD0YNMVzKyrBI7YQtB3Ry2GmU+62XuB6p4KIYwqCxJ OBtnPk9v2fDlEYYGqIn8RPRSqB11G1l3tui8ing4gcZidvogpUt9N++e3mtpkafFcHW0Woa2+K2S8 wPyKAvWTrvCF8gUce3YIle4dKFtzxJAriKL/+J5xAD6AqFLTP1/2vN0piZ2CKathWO/5noAtISVa1 uRmh1pvg==; Received: from [50.53.46.231] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qwln8-000dFK-2i; Sat, 28 Oct 2023 16:04:03 +0000 Message-ID: <36e87cdb-9341-4e86-a1ad-dc2d1d105fa8@infradead.org> Date: Sat, 28 Oct 2023 09:04:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] regulator: core: Add option to prevent disabling unused regulators Content-Language: en-US To: Javier Martinez Canillas , linux-kernel@vger.kernel.org Cc: Manivannan Sadhasivam , Jonathan Corbet , Liam Girdwood , Mark Brown , "Paul E. McKenney" , "Rafael J. Wysocki" , "Steven Rostedt (Google)" , Tejun Heo , linux-doc@vger.kernel.org References: <20231028102423.179400-1-javierm@redhat.com> From: Randy Dunlap In-Reply-To: <20231028102423.179400-1-javierm@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 28 Oct 2023 09:04:20 -0700 (PDT) Hi, On 10/28/23 03:24, Javier Martinez Canillas wrote: > This may be useful for debugging and develompent purposes, when there are > drivers that depend on regulators to be enabled but do not request them. > > It is inspired from the clk_ignore_unused and pd_ignore_unused parameters, > that are used to keep firmware-enabled clocks and power domains on even if > these are not used by drivers. > > The parameter is not expected to be used in normal cases and should not be > needed on a platform with proper driver support. > > Signed-off-by: Javier Martinez Canillas > --- > > Documentation/admin-guide/kernel-parameters.txt | 7 +++++++ > drivers/regulator/core.c | 17 +++++++++++++++++ > 2 files changed, 24 insertions(+) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 0a1731a0f0ef..91b58d767c2c 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -5461,6 +5461,13 @@ > print every Nth verbose statement, where N is the value > specified. > > + regulator_ignore_unused > + [REGULATOR] > + Prevents the regulator framework to disable regulators from disabling regulators > + that are unused due not driver claiming them. This may no driver claiming them. > + be useful for debug and development, but should not be > + needed on a platform with proper driver support. > + > relax_domain_level= > [KNL, SMP] Set scheduler's default relax_domain_level. > See Documentation/admin-guide/cgroup-v1/cpusets.rst. > diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c > index 3137e40fcd3e..220034ff0273 100644 > --- a/drivers/regulator/core.c > +++ b/drivers/regulator/core.c > @@ -6234,6 +6234,14 @@ static int regulator_late_cleanup(struct device *dev, void *data) > return 0; > } > > +static bool regulator_ignore_unused; > +static int __init regulator_ignore_unused_setup(char *__unused) > +{ > + regulator_ignore_unused = true; > + return 1; > +} > +__setup("regulator_ignore_unused", regulator_ignore_unused_setup); > + > static void regulator_init_complete_work_function(struct work_struct *work) > { > /* > @@ -6246,6 +6254,15 @@ static void regulator_init_complete_work_function(struct work_struct *work) > class_for_each_device(®ulator_class, NULL, NULL, > regulator_register_resolve_supply); > > + /* > + * For debugging purposes, it may be useful to prevent unused > + * regulators to be disabled. from being disabled. > + */ > + if (regulator_ignore_unused) { > + pr_warn("regulator: Not disabling unused regulators\n"); > + return; > + } > + > /* If we have a full configuration then disable any regulators > * we have permission to change the status for and which are > * not in use or always_on. This is effectively the default HTH. -- ~Randy