Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4420632ybc; Fri, 15 Nov 2019 04:29:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxGDy3EjsVhHXyJDxuyb4IfFK2MMrb30fuNcW1s3J1ZRjFEA8xpAsUHLgPwme+XWw4+ri1w X-Received: by 2002:a17:906:4d91:: with SMTP id s17mr597697eju.156.1573820945440; Fri, 15 Nov 2019 04:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573820945; cv=none; d=google.com; s=arc-20160816; b=yH7AT2tnUX9FWpK8/fD4YTcdq575TjGbnkQgkBobPsxn1OR1mfxibrB4Kn1sWuJxSU nWwrdb2UaXlbVF5gpjYBZ0PV6acsAsMlfF5s/utqSL+1vHX51FsCNhOHqBcPlhSIVr8u h/rGYBIS9Fg21H6+f6JVPuCwvqyAU1uU1LHhBVtJSTQqArngG9v0QqFE0Do7h/IGX8VK E4nynrJnvAY4TH53jfGTQL4+RUFhHVu1WATfE75PIfp0WpV48AQpDDJwWRsNhLdjS3Vq OcB6hPGpKvo0LeE2t2MGj01EmpPTR6FoNQ7oRmjWsHzsWA4hZzfsVU4IODhGgfmhkYB1 q45w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=daHt2+8Hmvwc3q4oviLYlwCDGGFI8F6MVXhLSm92SYw=; b=z8b5aiiwN2VqRqRdQWTuPdra2fbwgeyQt5qZx1JzopUCx6wlxZpe5jy6CBjgW71BCP vaW7cXs6kW2GXXJJZA4U7af54v4mwdD5pzLanInVg3Y9Fgmlsdtisyv5TOlchd2r+FdA SA4uB41GJXW/WHLry6WNbr7dw5AQALzha4evNtAz7e3Kg+GXltnTSo6LGBbmaogT1Rtn i6sG58LJu8BMo2/SdHGGFVX9cKrTl08JLiruT/Sr0395E6DRrRnnlQFrv1SCwyr+bBcF 6jCZMBb0VEm/9cs5ZmvsS7E+8/r5vAAMqhAzLF4a89Yxn96rsXZQIdGHAuA98/qM6mMG xigg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=N37Zirmf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si6037932edz.130.2019.11.15.04.28.41; Fri, 15 Nov 2019 04:29:05 -0800 (PST) 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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=N37Zirmf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727954AbfKOM0c (ORCPT + 99 others); Fri, 15 Nov 2019 07:26:32 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:32830 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727641AbfKOMZM (ORCPT ); Fri, 15 Nov 2019 07:25:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=daHt2+8Hmvwc3q4oviLYlwCDGGFI8F6MVXhLSm92SYw=; b=N37ZirmfJhdE DgQuJBJ4gLC61qwuo3BGP1xiwQkaWamyFAVmkdIjZxA9mpEGb3CZnOaWqRWPs3sW5EWRcmdglRsva nINkULePgpdGc8gadnhT4H7jsmr5RmSnffRbAQE4t54q67cZBVqEAAWi5crLbryK4Gqs2misrV6a2 VxGlo=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVaey-0000Ku-O8; Fri, 15 Nov 2019 12:25:08 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 3BD982741609; Fri, 15 Nov 2019 12:25:08 +0000 (GMT) From: Mark Brown To: Pascal Paillet Cc: broonie@kernel.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Mark Brown , p.paillet@st.com Subject: Applied "regulator: core: Let boot-on regulators be powered off" to the regulator tree In-Reply-To: <20191113102737.27831-1-p.paillet@st.com> X-Patchwork-Hint: ignore Message-Id: <20191115122508.3BD982741609@ypsilon.sirena.org.uk> Date: Fri, 15 Nov 2019 12:25:08 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: core: Let boot-on regulators be powered off has been applied to the regulator tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.5 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 089b3f61ecfc43ca4ea26d595e1d31ead6de3f7b Mon Sep 17 00:00:00 2001 From: Pascal Paillet Date: Wed, 13 Nov 2019 11:27:37 +0100 Subject: [PATCH] regulator: core: Let boot-on regulators be powered off Boot-on regulators are always kept on because their use_count value is now incremented at boot time and never cleaned. Only increment count value for alway-on regulators. regulator_late_cleanup() is now able to power off boot-on regulators when unused. Fixes: 05f224ca6693 ("regulator: core: Clean enabling always-on regulators + their supplies") Signed-off-by: Pascal Paillet Link: https://lore.kernel.org/r/20191113102737.27831-1-p.paillet@st.com Signed-off-by: Mark Brown --- drivers/regulator/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index a5b2a9b02108..5e6c629806e4 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1403,7 +1403,9 @@ static int set_machine_constraints(struct regulator_dev *rdev, rdev_err(rdev, "failed to enable\n"); return ret; } - rdev->use_count++; + + if (rdev->constraints->always_on) + rdev->use_count++; } print_constraints(rdev); -- 2.20.1