Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5869824ybp; Tue, 8 Oct 2019 09:27:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8K3YPvlAqiZc5cnJHxV7W04Yem0oKbPBdUpeCkXJS1PdL0ltzUGXEcWCRHQAbuOS0uFpj X-Received: by 2002:a50:935d:: with SMTP id n29mr34856653eda.294.1570552064868; Tue, 08 Oct 2019 09:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570552064; cv=none; d=google.com; s=arc-20160816; b=aqrC8Hpeqg8xmOjLt9QxHZt91LhucT1TbcGpUPJCibE822xw/DknSEdDYbkJ6i+aCe iPLN0ghYBoqfFu1g1rljt5Cjz594jYybElmYLsPlxcVHau6teENSdBdm3W+6KGJMBrAm 1Ko5NvJZvmcooCPFAhoRIjfSzXhJOOUTpfzihHKzapZNDjwGcX0ED4w0Pq8wTtT4ofUs of0BsuT2yKXDPGeG4pQA5hFGE+d88QCyGfPnZlXcFf8ywQ8N12ubxbEucFFcK0tvz7c6 4ji3VPJtVcDW8X5OWCj2t17vM3PFAlTaLTZBNlGMKdvN4lPq8k2VNCttma2N7o2RWnJD +m+A== 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=Ii7hnic6xKdkLBwpZElFY044FUzKz7oXyF0dN3nO9SM=; b=SmRWGy7KOc2GFfIgMk6HVhHpnQ3rSVVQwAkWSj9bvTyNcpyGfchWTRSd+4i7m2vtP2 NsBtRu2l1lHh21J8bplCMn2YhHn27LcW4svp+vWAglMbisQmzjZD20ue+UPmK8cLkxVT Lhlh9wCbTijnRQynUS9I3C0omoNP+jUZDPuI/KXiAaNISfffSU/tVVtiHc4UUDtGMq5H XSPz/Xx8+pkaCVO1WImskjm0OmgFF8gjILYSvmd/calNU9zt+pwp4BpQWjlUq+6eLj2u jWisYQdh/t/iy8jPtcGwMxZLTmF9vvzPf99syjnBzhIIe8d1kCCzcH0+e2y6lTzbClJ/ 3QTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=MTZKPqsn; 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 i33si10795865eda.205.2019.10.08.09.27.21; Tue, 08 Oct 2019 09:27:44 -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=MTZKPqsn; 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 S1728297AbfJHQXk (ORCPT + 99 others); Tue, 8 Oct 2019 12:23:40 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:39156 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbfJHQXk (ORCPT ); Tue, 8 Oct 2019 12:23: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=Ii7hnic6xKdkLBwpZElFY044FUzKz7oXyF0dN3nO9SM=; b=MTZKPqsnxtWOHMIpMUPYFu5Vw wOxnm0fVU4p3m5h3f/rNDOyIoSObvw/GUtbQkeTb16pXVksMvyC1Y7BfYDXsNjAE8OXTx/yEGy9Lf XkfkK7fHfJM0gT5JG0kBpoZBe3WBdmKu+49HbeZAXMgF0MwvaMqJL3xSUstUEnodhlCRQ=; 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 1iHsGs-0000Sd-Fc; Tue, 08 Oct 2019 16:23:34 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id DEBA62740D4A; Tue, 8 Oct 2019 17:23:33 +0100 (BST) Date: Tue, 8 Oct 2019 17:23:33 +0100 From: Mark Brown To: Marco Felsch Cc: Doug Anderson , 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: <20191008162333.GP4382@sirena.co.uk> References: <20190927084710.mt42454vsrjm3yh3@pengutronix.de> <20191007093429.qekysnxufvkbirit@pengutronix.de> <20191007182907.GB5614@sirena.co.uk> <20191008060311.3ukim22vv7ywmlhs@pengutronix.de> <20191008125140.GK4382@sirena.co.uk> <20191008145605.5yf4hura7qu4fuyg@pengutronix.de> <20191008154213.GL4382@sirena.co.uk> <20191008161640.2fzqhrbc4ox6gjal@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OmL7C/BU0IhhC9Of" Content-Disposition: inline In-Reply-To: <20191008161640.2fzqhrbc4ox6gjal@pengutronix.de> X-Cookie: Do not disturb. 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 --OmL7C/BU0IhhC9Of Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 08, 2019 at 06:16:40PM +0200, Marco Felsch wrote: > On 19-10-08 16:42, Mark Brown wrote: > > If this is a GPIO regulator then the Linux APIs mean you can't read the > > status back so it's one of the regulators for which this property was > > invented. This is a real limitation of the Linux APIs, with most > > hardware you can actually read the status back so we shouldn't need > > this. > I know and I followed the discussion between you and Doug. But it > is a valid use-case to have a external gpio-enabled regualtor connected > to a panel. If I don't mark the regulator as 'regualtor-boot-on' and use > the fixed.c driver (IMHO this is correct), the regulator gets disabled > during probe. So I will have a panel off/ panel on sequence during boot. Right, this is why I am saying that this is one of the regulators for which this property was defined and where you should be using it. > To avoid this I set the 'regualtor-boot-on' property but then I can't > disable the panel during suspend.. As you'll have seen from the discussion that's a bug, nothing should be taking a reference to the regulator outside of explicit enable calls. --OmL7C/BU0IhhC9Of Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl2cuAUACgkQJNaLcl1U h9DJ8Af/d9MHeegO3mG0aWykYncA/Uz7MQ8AB1ExPlJrkChn+k1IhFInP0BUaEMf xR6K6jBZRAiFiehJJWMFY8b73OLLaWhqjVEz7VHSIyGotcFPykDF6ESj8w279FiZ wZEeXbW366ztz7GqWo0U60Hv+yp5wUVrdxtFTKHOzl+kSHDgpy+Fq4sTu5GEtlmb T8XI50JK1npkImJ4a+MutR4DQhZm9hoSR7Tq4FSiP6Wlex2jvMgLrDxexgUQhbkY iGFt5TAgSy4WSds2O9o9ujNU6evUhr8mzh0Ze7k4FAz4EhrsfibuJBHGoSl0oPdY 0vUrqwoqjuPTzftepnXUcghNVuhubg== =LEgR -----END PGP SIGNATURE----- --OmL7C/BU0IhhC9Of--