mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Tony Lindgren <tony@atomide.com>,
	Liam Girdwood <lgirdwood@gmail.com>, Nishanth Menon <nm@ti.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Discussions about the Letux Kernel 
	<letux-kernel@openphoenux.org>,
	kernel@pyra-handheld.com,
	Peter Ujfalusi <peter.ujfalusi@gmail.com>
Subject: Re: [PATCH] regulator: palmas: set supply_name after registering the regulator
Date: Tue, 29 Jun 2021 19:56:38 +0100	[thread overview]
Message-ID: <20210629185638.GG4613@sirena.org.uk> (raw)
In-Reply-To: <2C7C3A47-4A5B-4052-98FC-7A96E2F138CA@goldelico.com>

[-- Attachment #1: Type: text/plain, Size: 2668 bytes --]

On Tue, Jun 29, 2021 at 08:34:55PM +0200, H. Nikolaus Schaller wrote:
> > Am 29.06.2021 um 17:59 schrieb Mark Brown <broonie@kernel.org>:

> > What is that rule and how is this patch intended to ensure that Palmas
> > meets it?
> >  As covered in submitting-patches.rst your changelog should
> > explain this so that in review we can verify that this is a good fix.

> I am very sorry, but I simply believed that it is not necessary to copy&paste or
> describe this because it appears not to be difficult to retrieve.

So, I did actually look at the commit but I couldn't figure out what the
change was supposed to do about it.

> This rule (rdev->supply_name && !rdev->supply) did not exist before 98e48cd9283d
> and it seems to return early with EPROBE_DEFER if there is a desc->supply_name defined,
> but no supply resolved.

> The Palmas driver is setting desc->supply_name to some string constant (i.e. not NULL)
> and is then calling devm_regulator_register().

Right, this is how a regualtor driver should specify the name of its
supply.

> So it was working fine without having the supplying regulator resolved. AFAIK they
> just serve as fixed regulators in the device tree and have no physical equivalent.

No, not at all - it's representing whatever provides input power to the
regulator.  There may be no physical control of it at runtime on your
system but that may not be true on other systems.  It's quite common for
there to be a chain of regulators (eg, DCDCs supplying LDOs) and then
they all need to get get power managed appropriately and you don't end
up thinking a regulator is enabled when the input regulator is disabled.  

> My proposal just moves setting the supply_name behind devm_regulator_register() and
> by that restores the old behaviour.

This means that we won't actually map the supply and any system that
relies on software handling the supply regulator will be broken.

> Well, unless...

> ... devm_regulator_register() does something differently if desc->supply_name
> is not set before and changed afterwards. It may miss that change.

We resolve supplies during regulator registration, this would
effectively just skip mapping of the supply.

> So I hope for guidance if my approach is good or needs a different solution.

What I would expect to happen here would be that once vsys_cobra is
registered the regulators supplied by it can register and then all their
consumers would in turn be able to register.  You should look into why
that supply regulator isn't appearing and resolve that, or if a consumer
isn't handling deferral then that would need to be addressed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-06-29 18:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 15:24 H. Nikolaus Schaller
2021-06-29 15:59 ` Mark Brown
2021-06-29 18:34   ` H. Nikolaus Schaller
2021-06-29 18:56     ` Mark Brown [this message]
2021-06-29 20:21       ` H. Nikolaus Schaller
2021-06-29 20:26         ` Graeme Gregory
2021-06-30 12:13         ` Mark Brown
2021-06-30 12:29           ` H. Nikolaus Schaller
2021-06-30 13:04             ` Mark Brown
2021-06-30 14:43               ` H. Nikolaus Schaller
2021-06-30 16:45                 ` Mark Brown
2021-06-30 17:17                   ` H. Nikolaus Schaller
2021-06-30 20:08                     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210629185638.GG4613@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=hns@goldelico.com \
    --cc=kernel@pyra-handheld.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=peter.ujfalusi@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®