Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753277AbcDXXXT (ORCPT ); Sun, 24 Apr 2016 19:23:19 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:40032 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbcDXXXS (ORCPT ); Sun, 24 Apr 2016 19:23:18 -0400 Date: Mon, 25 Apr 2016 00:23:05 +0100 From: Mark Brown To: Richard Fitzgerald Cc: lgirdwood@gmail.com, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Message-ID: <20160424232305.GK3217@sirena.org.uk> References: <1461332608-14760-1-git-send-email-rf@opensource.wolfsonmicro.com> <20160422150446.GF3217@sirena.org.uk> <571A536A.9000509@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XXzK2Xfuky388NdO" Content-Disposition: inline In-Reply-To: <571A536A.9000509@opensource.wolfsonmicro.com> X-Cookie: Tomorrow, you can be anywhere. User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regulator: arizona-ldo1: Only enable status change if we have LDOENA X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3232 Lines: 74 --XXzK2Xfuky388NdO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 22, 2016 at 05:38:02PM +0100, Richard Fitzgerald wrote: Please fix your mailer to leave blank lines between paragraphs (and not delete them in quotes), it makes your mails harder to read. > On 22/04/16 16:04, Mark Brown wrote: > >On Fri, Apr 22, 2016 at 02:43:28PM +0100, Richard Fitzgerald wrote: > >What's the difference between this and the previous version of the patch > >and what problem is this aiming to solve? If we want to disable the > >regulator why would we not be happy to do that by removing the supply? > The background to all this is that runtime suspend and resume needs to know > whether the DCVDD turned off. If it definitely turned off a regmap cache > sync is safe - if not or I can't be sure then I need the overhead of a > forced reset to restore register defaults before the sync. This is what regulator status change notifiers are for, register and then you'll get a callback when the power is actually pulled (there's a few other CODEC drivers that use them). > What I'm trying to achieve here is to stop the regulator core sending false > notifications that LDO1 has been turned off. The way that the regulator core If you've found a problem with spurious notifications then fix the spurious notifications, don't pile bodges into consumer drivers! Every single other driver that relies on these notifications is going to want the same hack for the same reason though most of them aren't their own supply so won't be able to do it. The advantage of being able to change the source code for the entire kernel is that we don't need to have workarounds for the core in drivers, we can make the core do the right thing. > code handles the disable notifier has no dependency on what happens to the > parent supply. The REGULATOR_CHANGE_STATUS flag is used to indicate whether > the status of _this_ regulator can be changed (it doesn't affect whether the > parent is disabled). If the child can't change status then the disable can't propagate up the tree and the child regulator needs to hold the parent enabled. > I think it's a bug that LDO1 claimed to be able to turn off when it couldn't, > and fixing that prevents bogus disable notifications. How does the driver know it couldn't turn off the parent, it knows nothing about the supply for LDO1? If that's switchable you've just removed the ability to switch it off since the rail will now never power down. Regulators with no enable control of their own need to not do their own notifications but instead get notifications based on parent status changes. --XXzK2Xfuky388NdO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXHVVXAAoJECTWi3JdVIfQOTQH/2MUFeaOizfzhsWsliJOHySi kIW1LrhfRTa38aqShdUxnDDY+UqnqEof1zTCNYIEEUHO6lvY+t8SkDZhNr+t8MPv 1QdegK2fI5QRzW0Vte+dJTD0dsuno1DzyvClPGbzMxCHU7oeFN8z9Q5DjCe+wTfD kr6YT0h/OKKIe4OACBwSN91uIv8gG4fO58+8iWMJy0UbU6hyMA0dN9CaRaZ0S44U Ftl0k5Ic3I0RIG9t/kPfnZFLh2C2SqbzU5gQElwKmolXV1XW/hEZH9mumWlzjDnV D+S2oBCk5QT5dTUw2dNedPKNms1cfBs1/zSvs9gKndWZIZ0fNrSq+02CpMZDpw8= =Juay -----END PGP SIGNATURE----- --XXzK2Xfuky388NdO--