Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp439780lqt; Thu, 6 Jun 2024 08:02:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVD8W0ePeKR0oKnmM29NyNceMzKGakiDSx5Z9k6dG/zskURviSQ6SeqIDUq04wz65r09Om8EEzMIYrKJv8o3BQwI+v6Vj2yBiiGMqjhAA== X-Google-Smtp-Source: AGHT+IE2Ui9l8tetPNYftTEl/pSwgE+CnacSBEtdwwNgSHmRCxp58GenhZj+ZH5kkU1pe3koCIVH X-Received: by 2002:ac2:47ef:0:b0:521:92f6:3d34 with SMTP id 2adb3069b0e04-52bab4db7efmr4492194e87.22.1717686149758; Thu, 06 Jun 2024 08:02:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717686149; cv=pass; d=google.com; s=arc-20160816; b=ucPyZiT43hKLhuP5XFStOUQiKkr2TMVF/9erA197Wf7HmA9jAo1N03bckEKvt4vOS1 uSXe3lOWvt6AGlHpiSNspiKVwZrS1clDwmLP/v/V4Rp9TpE9GMFh/jL8Ud9w+Z1hXBZZ +BGfjm8QydkJr/xHnMn1p/vwyvqBzwL0WJkzzCi6T9aX6wgXmNvJEQ9BIQe7LzgNLp1/ D2+pDt2q9AvAN/BgsWLOWEOsa2fuRIZGyFt0e3UFKY13n94QtiiZFIdTu4A0HHxvTD5Q R56PNGqNAttSGtjXPpUGpiueTt/TVXvG69WJbnrFlDZkmK3qrAEKKpfF117GRdH3+rjf l25Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CgF6Sof+Y1Ev5oKjgG0jVV/Fr9zOO4ATIOKaW/zZl1I=; fh=ykitFQJaCUTfd9QoWAsos0pkO5q26/dx0gIcTSFvRfk=; b=XcJ8L2C7hw4VDg5CUSWnGpOMoEqgjI3gHWzqcqWUsIA5uPG271064x4+owDwi5Wa3u 9SnL0jSxkzIqrin5FZYlzeXjHks3wGMwaYG98Beo6yX8NAHxxXwHiPlyt65mdpzWU7FK LXbCbxChCjhwo2Jy1JoACKns49RKsUVdLIBbhFX6U1ZfCgvf+l1CVFGYfd+vq9m6bAJe xbmvEkJPxZI/26oAknmK0zsCP1uzA18fzmGLyyXmOn+bhra4cORMlBOrvT42XHZiGqW8 z5tiLkeMFR7+qJyqv7W5oLUN5K6+Xczzfj+LjfPpbm7QXsOu316YN46Qv4ZX/Tol+SwC 7Yug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WDPRnO+p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c805cc1f1si81194366b.223.2024.06.06.08.02.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 08:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WDPRnO+p; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-204495-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204495-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 76C471F24689 for ; Thu, 6 Jun 2024 15:02:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7524E19E7C3; Thu, 6 Jun 2024 14:38:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WDPRnO+p" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B3E01EB3A; Thu, 6 Jun 2024 14:38:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684724; cv=none; b=TMc95ghLtNK1qNUkfjY7wxG9oWweYVasOfVDuZ/g1PT8QntyxdfSiPNblIVNK48w//iV/4ZXahDwWKwoza0oOvkc0pVXjE0M7IGrPZwvx0uqGCLuGDG+TFOBKdWlf7Z6EoYP3LwRCl64R+atFUlnrfIGsNsCymY0HfMevhst0a0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684724; c=relaxed/simple; bh=PRwLGYovMSOZLOdr9ird43QgRk/4eRVu/yuyjg0HH2E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ipy8vNiqtNoq4uvzz5jTdlucAiUaNMTMdhmI9l6g1BHZvxqD2NfFxNEkRVs+BtqbFkJP4R8iyIavwA8pdW8rabnIxS8ri+zD1ImUeQj4/Pn2KqdCEGE1Fmgj/frfQrAHUVnzL0YEpoO6O8b07swLAeFJ3rny5IuLl+0UKpay6J8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WDPRnO+p; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E45ADC2BD10; Thu, 6 Jun 2024 14:38:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717684724; bh=PRwLGYovMSOZLOdr9ird43QgRk/4eRVu/yuyjg0HH2E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WDPRnO+puB64OOwO9azNiTjt7xJDjsraLNB6eonI4q58Kxy+F39fyzG1QGlUKwlAL jhR0iweie4sNriDWV6e4VDvtPuMoR6o+AytaUqPlJd37IesoRKtGu8AjmnuiUSZchU t/Ph3tNieVMPPjw+Hr3Zytbz33npRrSUlNX4h8U8bOeZapr1hEf1UUujQSKg/mUsAj 4INvJHigvrIJ+SY0oCBcZideXGVF+pd/z+O2gm+pz0aFdnKVP8bKS7rz+GmOUBCJr9 WSz1f/GM3RNbEUQFJk7TXqhGdFwLOecChJyJNiolXxH6xo2lcQNJoTExs3vYV1lL7b 4qY5Tz7NJOzYQ== Date: Thu, 6 Jun 2024 15:38:37 +0100 From: Mark Brown To: "Lad, Prabhakar" Cc: Ulf Hansson , Wolfram Sang , Geert Uytterhoeven , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Magnus Damm , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Fabrizio Castro , Biju Das , Lad Prabhakar Subject: Re: [RFC PATCH 1/4] regulator: core: Ensure the cached state matches the hardware state in regulator_set_voltage_unlocked() Message-ID: References: <20240605074936.578687-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20240605074936.578687-2-prabhakar.mahadev-lad.rj@bp.renesas.com> <22664e29-4c7a-4544-ad32-25c3d7e342e9@sirena.org.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k+c8wgxJKe7M4G9M" Content-Disposition: inline In-Reply-To: X-Cookie: Simulated picture. --k+c8wgxJKe7M4G9M Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 06, 2024 at 03:12:42PM +0100, Lad, Prabhakar wrote: > On Thu, Jun 6, 2024 at 1:05=E2=80=AFPM Mark Brown wr= ote: > > On Wed, Jun 05, 2024 at 08:49:33AM +0100, Prabhakar wrote: > > > Driver code flow: > > > 1> set regulator to 1.8V (BIT0 =3D 1) > > > 2> Regulator cached state now will be 1.8V > > > 3> Now for some reason driver issues a reset to the IP block > > > which resets the registers to default value. In this process > > > the regulator is set to 3.3V (BIT0 =3D 0) > > > 4> Now the driver requests the regulator core to set 1.8V > > If something is resetting the regulator like this that's a problem in > > general, we need to either have the driver notify the core when that > > happens so it can reconfigure the regulator or have it reapply > > configuration directly. Obviously it's not great to have that happen at > > all... > Currently I am seeing this problem with SDHI driver. For the voltage > switch operation the MMC core requests the driver to do the change and > similarly the MMC core requests the reset operation. > > Having the core driver notify the core when that happens so it can reco= nfigure the regulator or have it reapply configuration directly. > Again doing this would be a problem as MMC core also maintains the IOS > states, reconfiguring the regulator would cause conflicts between the > states. If the device can't cope with the requested configuration being applied why is this going through the regulator API at all? This just seems quite confused, putting a bodge in the core like this clearly isn't the right solution. --k+c8wgxJKe7M4G9M Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZhye0ACgkQJNaLcl1U h9BLqAf/UG65PeifE6tHyWrpslKd/R60qY5DdOnrVWie0kqlq5nDZHQH/T+YBOLN ZnHdOfBmTHARgPc08z9ronRWn0YzjG3TwzclbJE6q7/sW793wynrKhhbSZCQRemS aG1s81H6ARFCrIp1esBflxwaeVtsaYFYTKtLiF46dYQjRjiOgeFj5C9ECwe47Ndn 3zbm7Fn9MMWfjqyK3kOKLrnNoNxLjjeKtCvNhYNKRNogVxPBcFlz8JhY0fP8qhsa aEftWbjuIUYATdQG6rvJqrvfYXdeZZN3SWm6UAuMLWwz2r0DnL9fw6RIfryfdhq1 EXlOvf1ya0E3D7poZG/K//OMoerQbA== =AZYv -----END PGP SIGNATURE----- --k+c8wgxJKe7M4G9M--