Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp781182ybp; Fri, 4 Oct 2019 05:01:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo2PRtVkHzv8x9wv1og8RnogEBTlj9aPmAStFFaynOqbT6nk5TIPcfEdhHKN2cUfUB64C0 X-Received: by 2002:a17:906:eda1:: with SMTP id sa1mr11892639ejb.293.1570190460158; Fri, 04 Oct 2019 05:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570190460; cv=none; d=google.com; s=arc-20160816; b=ZXtLmn/WcywOF9lh4nWThOEIvkIw+haJ21CaywEmhSe/3WhMgELEsfhp2y8omwbVOL pOKCPOziG8Wtn57KMRdP3RsGdWzlrvujpiuVjUsMmTpx8Ab0Hc39QDKO5K7lhikR1RDn bhci0j1p6kiLseQj18tGTHTYI8GziqmXAaGFj7Du9ivlTqZAMqXuyiTupYuQxjbD74yZ WTBhFy8dhkf2WbZrxlKcee4EStoKr3BLuYG4hvDKXEyFHQt0IXKy9fpVnZUpJKlT/QEo iEtkHWtU7kz3/wVwq0fWxow/IXmpcrdwfk/5kPI4id0vp7r3EWuXF4t9AZNGeZlj2qsn A0vw== 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=EibQ8tD/9wgxAWvxS0B7FIca/N/JJVXRnv1WMqemY7I=; b=QCzozKLGuF8WGenBt4ErmXVyQtky22hBEDT1BngrwkmzAjNZbga3+FRs6Dlssqe6oD cemaT+faAdhMVFyHD8GrzN8ek85akCCSsoDcwCRRprIQEJrX5JZI+yenc/fW+ObbUird xmkeST4/rn1pkpdjpDPV88tRuSSBrrifjFPbN8A7VEr9q16woYOTM72O8Rv+Enc1Pq4e kyOwZF2IDlraEzwU1YWOZ66pqTgWrJymUbVdbPSqKaiJDRqA+EYgDPPF5SDdugaHL1rB fEXKdX6KJRrZnOZysA6fUChmHJCwWwAsZgZChNMT7h8kbkEZFv++KkTUyOFV1ANsm+qT 8FDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=imLlfLAh; 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 sb7si2880589ejb.321.2019.10.04.05.00.34; Fri, 04 Oct 2019 05:01:00 -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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=imLlfLAh; 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 S1730588AbfJDLcl (ORCPT + 99 others); Fri, 4 Oct 2019 07:32:41 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:32782 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727254AbfJDLck (ORCPT ); Fri, 4 Oct 2019 07:32:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EibQ8tD/9wgxAWvxS0B7FIca/N/JJVXRnv1WMqemY7I=; b=imLlfLAh1WLMbRkrplm9Q9h3e AEPtD9ovg21kDzc4PLf/tQF0oW2kLNM8CPZ26354FKVq+zYQ0RZbSlGCeD0oI9LLLw0PKGwaGHnir 9TMoLBfx8aT7Fd0krcq6SPoyXbfxYlsADhPU9d0LK17R/6n91Md271EQkMouvsJ8wse4E=; 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 1iGLp5-0001t9-RH; Fri, 04 Oct 2019 11:32:35 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 9EC5A2741EF0; Fri, 4 Oct 2019 12:32:34 +0100 (BST) Date: Fri, 4 Oct 2019 12:32:34 +0100 From: Mark Brown To: Matti Vaittinen Cc: Doug Anderson , Marco Felsch , Chunyan Zhang , Liam Girdwood , ckeepax@opensource.cirrus.com, LKML , Sascha Hauer Subject: Re: [PATCH 1/3] regulator: core: fix boot-on regulators use_count usage Message-ID: <20191004113234.GA4866@sirena.co.uk> References: <20190923181431.GU2036@sirena.org.uk> <20190923184907.GY2036@sirena.org.uk> <20190924182758.GC2036@sirena.org.uk> <20190927084710.mt42454vsrjm3yh3@pengutronix.de> <20191004063443.GA26028@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <20191004063443.GA26028@localhost.localdomain> X-Cookie: core error - bus dumped User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 04, 2019 at 09:34:43AM +0300, Matti Vaittinen wrote: > On Tue, Oct 01, 2019 at 12:57:31PM -0700, Doug Anderson wrote: > > I don't think your fix is correct. It sounds as if the intention of > > "regulator-boot-on" is to have the OS turn the regulator on at bootup > > and it keep an implicit reference until someone explicitly tells the > > OS to drop the reference. > Hmm.. What is the intended way to explicitly tell the OS to drop the > reference? I would assume we should still use same logic as with other > regulators - if last user calls regulator_disable() we should disable > the regulator? (I may not understand all this well enough though) Yes. > > It's a fixed regulator controlled by a GPIO? Presumably the GPIO can > > be read. That would mean it ideally shouldn't be using > > "regulator-boot-on" since this is _not_ a regulator whose software > > state can't be read. Just remove the property. > How should we handle cases where we want OS to enable regulator at > boot-up - possibly before consumer drivers can be load? If you want the regulator to be on without any driver present then mark it always-on. If you want the regulator to be enabled prior to the driver being loaded then the expectation is that the bootloader will do that, it's difficult to see what the benefit there is from having the kernel enable things when it starts prior to having a driver unless the intent is to keep the regulator always on. --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl2XLc8ACgkQJNaLcl1U h9CKbAf+MomEnF8qsWJhH9+YKxaRKOYjSkI7/venKgKu1CmyONAjtLnoMzTKLz+4 KvoSnUFict+yFSnQFQNoqsVU5mRGrW9PPWorWWrwGE+mRZwMCEXVVOWz4BwDt2mQ xS93SntDUZ+QEONQnCHFAKJV5aO3VW4BQ6uncrEjh1cGiy5x1Ktt1PX68rBWCuf+ bNuqDH+M0zjjtQ/dfvYHeb1vehVm5ngE4Qnam8z+DC586cWoRnbzoIBA6wKRchin MOBa6n8zo1ZnffK56v5Ym7fkiWFqIE/R3GoO5DnORNj8JXwgz5DBiKC+d6X8b4Pv ufQqiKHY+2apWrQcpfi3PPkHodczJQ== =j7+o -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--