From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723AbbCHTi1 (ORCPT ); Sun, 8 Mar 2015 15:38:27 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:59034 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbbCHTiZ (ORCPT ); Sun, 8 Mar 2015 15:38:25 -0400 Date: Sun, 8 Mar 2015 19:38:12 +0000 From: Mark Brown To: Javier Martinez Canillas Cc: Doug Anderson , Liam Girdwood , "linux-kernel@vger.kernel.org" Message-ID: <20150308193812.GW28806@sirena.org.uk> References: <1425328839-28330-1-git-send-email-javier.martinez@collabora.co.uk> <54F60602.3030505@collabora.co.uk> <54F70C5C.4080201@collabora.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="S5Rg6oz6PtEXgjQf" Content-Disposition: inline In-Reply-To: <54F70C5C.4080201@collabora.co.uk> X-Cookie: Editing is a rewording activity. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 1/1] regulator: Only enable disabled regulators on resume 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 --S5Rg6oz6PtEXgjQf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 04, 2015 at 02:45:00PM +0100, Javier Martinez Canillas wrote: > The thing is that _regulator_is_enabled() used to return -EINVAL if > the rdev didn't have an .is_enabled callback but that changed in > commit 9a7f6a4c6edc8 ("regulator: Assume regulators are enabled if > they don't report anything") and now returns 1 in that case. But > _regulator_enable() was not changed and is still checking for -EINVAL > which seems to me like a left over after the mentioned commit. You mean _do_enable(), not _enable() here. It's not really a leftover as the two operations are doing somewhat different things and the changes are a bit separate, _is_enabled() is reporting the current state while _do_enable() is making a change so it should fail if it can't do that. =20 A better way of writing it in the _do_enable() case is that it possibly ought to be checking if the regulator is enabled before it does anything, though for uncached regulator operations that then means an extra I/O which isn't great. Given that I think rather than ignoring the missing op it should instead fall back to checking _is_enabled() - that way if we can read the state but not change it the right thing will happen. I'll do a patch, probably tomorrow. --S5Rg6oz6PtEXgjQf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU/KUjAAoJECTWi3JdVIfQXNEH/Autr+EWxMGfn3rPMFEoXX1x onKS1BB71f8kDp1fNLP2CxgEP4SXqxq28jjWTRaqxn9f5eI5pjEXnFBnG/8XEpmP Uc944tnu218tDLU/JAqQ5t0vvpcD3Gcw3Jinby5SH8+VFnlMWmyPwyWW5l4X5g1L Oc4EB9JkTvMQnPyk/HdjvLi6IJYcTuU29Vr+LBQuwUR5tzfhlW23Uib466WG9hIa MkFlgqtn26j1s15pA2QMpsXU/Z4oSDjJhUAD0clV6k+YdjFFCOfHoSiT3xefLQBy UAxMHZsAIpal5T0nG9r0ofzWjYbbu055cUeGhqbrhgSpiFYakdN9PpAEbQLGSsE= =c1E2 -----END PGP SIGNATURE----- --S5Rg6oz6PtEXgjQf--