linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
@ 2013-10-08  6:09 Wei Ni
  2013-10-08  9:09 ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Ni @ 2013-10-08  6:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel@vger.kernel.org

Hi, Mark
In the latest regulator framework, it default to provide dummy
regulators with full constraints by your patch "regulator: core: Provide
a dummy regulator with full constraints".
I tried to use regulator_get() on lm90.c. If not set vcc-supply property
in the dts file to assume the regulator is physically present and
enabled, but it still can't get dummy regulator, just return -ENODEV.
I traced it, the regulator_dev_lookup() will return -ENODEV, and at that
time the has_full_constraints is still false, didn't be initialized in
regulator_init_complete() yet, so it will not return dummy regulator,
and will not return -EPROBE_DEFER either. This will cause the
lm90_probe() failed.

Could you take a look ?

Thanks.
Wei.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-08  6:09 About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints Wei Ni
@ 2013-10-08  9:09 ` Mark Brown
  2013-10-08  9:46   ` Wei Ni
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2013-10-08  9:09 UTC (permalink / raw)
  To: Wei Ni; +Cc: linux-kernel@vger.kernel.org

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

On Tue, Oct 08, 2013 at 02:09:02PM +0800, Wei Ni wrote:

> In the latest regulator framework, it default to provide dummy
> regulators with full constraints by your patch "regulator: core: Provide
> a dummy regulator with full constraints".

> I tried to use regulator_get() on lm90.c. If not set vcc-supply property
> in the dts file to assume the regulator is physically present and
> enabled, but it still can't get dummy regulator, just return -ENODEV.
> I traced it, the regulator_dev_lookup() will return -ENODEV, and at that
> time the has_full_constraints is still false, didn't be initialized in
> regulator_init_complete() yet, so it will not return dummy regulator,
> and will not return -EPROBE_DEFER either. This will cause the
> lm90_probe() failed.

> Could you take a look ?

Could you take a look at why we're getting -ENODEV please - this
indicates a problem with the device tree code since it should be what's
requesting probe deferral when it sees a link is present.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-08  9:09 ` Mark Brown
@ 2013-10-08  9:46   ` Wei Ni
  2013-10-12 12:14     ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Ni @ 2013-10-08  9:46 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel@vger.kernel.org

On 10/08/2013 05:09 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
> 
> On Tue, Oct 08, 2013 at 02:09:02PM +0800, Wei Ni wrote:
> 
>> In the latest regulator framework, it default to provide dummy
>> regulators with full constraints by your patch "regulator: core: Provide
>> a dummy regulator with full constraints".
> 
>> I tried to use regulator_get() on lm90.c. If not set vcc-supply property
>> in the dts file to assume the regulator is physically present and
>> enabled, but it still can't get dummy regulator, just return -ENODEV.
>> I traced it, the regulator_dev_lookup() will return -ENODEV, and at that
>> time the has_full_constraints is still false, didn't be initialized in
>> regulator_init_complete() yet, so it will not return dummy regulator,
>> and will not return -EPROBE_DEFER either. This will cause the
>> lm90_probe() failed.
> 
>> Could you take a look ?
> 
> Could you take a look at why we're getting -ENODEV please - this
> indicates a problem with the device tree code since it should be what's
> requesting probe deferral when it sees a link is present.

In the regulator_dev_lookup(), it will try to read the "xx-supply" to
get the regnode, but I didn't set the vcc-supply in dts file for lm90,
so the of_get_regulator() will return NULL, then the
regulator_dev_lookup() will set the ret to -ENODEV, and return the rdev
as NULL.

Thanks.
Wei.

> 
> * Unknown Key
> * 0x7EA229BD
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-08  9:46   ` Wei Ni
@ 2013-10-12 12:14     ` Mark Brown
  2013-10-16  4:36       ` Wei Ni
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2013-10-12 12:14 UTC (permalink / raw)
  To: Wei Ni; +Cc: linux-kernel@vger.kernel.org

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

On Tue, Oct 08, 2013 at 05:46:49PM +0800, Wei Ni wrote:

> In the regulator_dev_lookup(), it will try to read the "xx-supply" to
> get the regnode, but I didn't set the vcc-supply in dts file for lm90,
> so the of_get_regulator() will return NULL, then the
> regulator_dev_lookup() will set the ret to -ENODEV, and return the rdev
> as NULL.

OK, I think the device tree board code just needs to set full
constraints during machine initialisation.  We can't have multiple
initcalls in the regulator code and doing it there is really a bit of a
workaround anyway.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-12 12:14     ` Mark Brown
@ 2013-10-16  4:36       ` Wei Ni
  2013-10-16 10:39         ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Ni @ 2013-10-16  4:36 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel@vger.kernel.org

On 10/12/2013 08:14 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
> 
> On Tue, Oct 08, 2013 at 05:46:49PM +0800, Wei Ni wrote:
> 
>> In the regulator_dev_lookup(), it will try to read the "xx-supply" to
>> get the regnode, but I didn't set the vcc-supply in dts file for lm90,
>> so the of_get_regulator() will return NULL, then the
>> regulator_dev_lookup() will set the ret to -ENODEV, and return the rdev
>> as NULL.
> 
> OK, I think the device tree board code just needs to set full
> constraints during machine initialisation.  We can't have multiple

Hi, Mark, do you mean we can call regulator_has_full_constraints(), but
some platforms doesn't have board file now, they only have dts file, how
to call this functions?

Wei.

> initcalls in the regulator code and doing it there is really a bit of a
> workaround anyway.
> 
> * Unknown Key
> * 0x7EA229BD
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-16  4:36       ` Wei Ni
@ 2013-10-16 10:39         ` Mark Brown
  2013-10-17  4:39           ` Wei Ni
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2013-10-16 10:39 UTC (permalink / raw)
  To: Wei Ni; +Cc: linux-kernel@vger.kernel.org

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

On Wed, Oct 16, 2013 at 12:36:46PM +0800, Wei Ni wrote:
> On 10/12/2013 08:14 PM, Mark Brown wrote:

> > OK, I think the device tree board code just needs to set full
> > constraints during machine initialisation.  We can't have multiple

> Hi, Mark, do you mean we can call regulator_has_full_constraints(), but
> some platforms doesn't have board file now, they only have dts file, how
> to call this functions?

There is still a board file for DT machines, it's just shared between
all machines - it should be doing the call instead of the regulator
framework trying to retrofit it.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-16 10:39         ` Mark Brown
@ 2013-10-17  4:39           ` Wei Ni
  2013-10-17  9:37             ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Ni @ 2013-10-17  4:39 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel@vger.kernel.org, swarren@wwwdotorg.org,
	linux-tegra@vger.kernel.org

On 10/16/2013 06:39 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
> 
> On Wed, Oct 16, 2013 at 12:36:46PM +0800, Wei Ni wrote:
>> On 10/12/2013 08:14 PM, Mark Brown wrote:
> 
>>> OK, I think the device tree board code just needs to set full
>>> constraints during machine initialisation.  We can't have multiple
> 
>> Hi, Mark, do you mean we can call regulator_has_full_constraints(), but
>> some platforms doesn't have board file now, they only have dts file, how
>> to call this functions?
> 
> There is still a board file for DT machines, it's just shared between
> all machines - it should be doing the call instead of the regulator
> framework trying to retrofit it.

So do you mean it should call the regulator_has_full_constraints() in
the .init_machine for all machines? If so, this will affect all boards,
for example, in arch/arm/mach-tegra, if we set full constraints in the
shared board file tegra.c, all tegra boards will be set, is it right?

Thanks.
Wei.

> 
> * Unknown Key
> * 0x7EA229BD
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-17  4:39           ` Wei Ni
@ 2013-10-17  9:37             ` Mark Brown
  2013-10-17 10:39               ` Wei Ni
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2013-10-17  9:37 UTC (permalink / raw)
  To: Wei Ni
  Cc: linux-kernel@vger.kernel.org, swarren@wwwdotorg.org,
	linux-tegra@vger.kernel.org

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

On Thu, Oct 17, 2013 at 12:39:55PM +0800, Wei Ni wrote:

> So do you mean it should call the regulator_has_full_constraints() in
> the .init_machine for all machines? If so, this will affect all boards,
> for example, in arch/arm/mach-tegra, if we set full constraints in the
> shared board file tegra.c, all tegra boards will be set, is it right?

Yes, but this is currently the case anyway for every system using DT -
all we'd be doing is moving this call earlier in init.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints
  2013-10-17  9:37             ` Mark Brown
@ 2013-10-17 10:39               ` Wei Ni
  0 siblings, 0 replies; 9+ messages in thread
From: Wei Ni @ 2013-10-17 10:39 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel@vger.kernel.org, swarren@wwwdotorg.org,
	linux-tegra@vger.kernel.org

On 10/17/2013 05:37 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
> 
> On Thu, Oct 17, 2013 at 12:39:55PM +0800, Wei Ni wrote:
> 
>> So do you mean it should call the regulator_has_full_constraints() in
>> the .init_machine for all machines? If so, this will affect all boards,
>> for example, in arch/arm/mach-tegra, if we set full constraints in the
>> shared board file tegra.c, all tegra boards will be set, is it right?
> 
> Yes, but this is currently the case anyway for every system using DT -
> all we'd be doing is moving this call earlier in init.

Ok, I will send out patches for Tegra series.

> 
> * Unknown Key
> * 0x7EA229BD
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-10-17 10:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08  6:09 About [PATCH 1/2] regulator: core: Provide a dummy regulator with full constraints Wei Ni
2013-10-08  9:09 ` Mark Brown
2013-10-08  9:46   ` Wei Ni
2013-10-12 12:14     ` Mark Brown
2013-10-16  4:36       ` Wei Ni
2013-10-16 10:39         ` Mark Brown
2013-10-17  4:39           ` Wei Ni
2013-10-17  9:37             ` Mark Brown
2013-10-17 10:39               ` Wei Ni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).