public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Mark Brown <broonie@kernel.org>
Cc: Wei Ni <wni@nvidia.com>,
	swarren@wwwdotorg.org, linux-kernel@vger.kernel.org,
	lm-sensors@lm-sensors.org, linux-tegra@vger.kernel.org,
	MLongnecker@nvidia.com, khali@linux-fr.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/3] hwmon: (lm90) Add power control
Date: Thu, 08 Aug 2013 08:21:48 -0700	[thread overview]
Message-ID: <5203B78C.7010101@roeck-us.net> (raw)
In-Reply-To: <20130808130840.GC6427@sirena.org.uk>

On 08/08/2013 06:08 AM, Mark Brown wrote:
> On Thu, Aug 08, 2013 at 04:25:41AM -0700, Guenter Roeck wrote:
>> On 08/08/2013 04:01 AM, Mark Brown wrote:
>
>>> That said if you *are* going to do this you should request the
>>> regulator using devm_regulator_get_optional(), this is intended to
>>> support things that don't need regulators (though that's not the case
>>> here).
>
>> The lm90 driver works perfectly fine without regulator.
>
> I'd be most surprised if the device worked without power, if the driver
> fails to get and enable a regulator for it then that's not great
> (especially if it does so silently).
>
Correct, but it appears that the driver magically worked for a long time
without it.

Is it guaranteed that the driver keeps working for all cases where
regulator support is enabled in the kernel, and where it used to work
so far without mandating the existence of this specific regulator ?
My main concern is having to deal with complaints that the driver stopped
working for no good reason.

In this context, is it common practice to name such regulators "vdd"
or similar ? What if there are multiple LM90 or compatible chips
in a system, connected to different power rails ? Who determines
if the regulator is supposed to be named "vdd" or "vcc" or anything
else, and to which power rails it is actually connected ? How can
and does one guarantee that "vdd" is the correct regulator to use
for all systems ? What if some other driver requests "vdd", but the chip
it supports happens to be connected to a different power rail ?

Sorry for my ignorance in that matter. I did browse through Documentation/power,
but did not find a clear answer.

> Note that the regulator API is written to stub itself out if not
> enabled, the code should be able to assume that it's there.
>
I am aware of that; this is why the driver should not dump an error message
if the function returns NULL and bail out, as it did originally.

Guenter

  reply	other threads:[~2013-08-08 15:21 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08  6:56 [PATCH v2 0/3] Add power control for lm90 Wei Ni
2013-08-08  6:56 ` [PATCH v2 1/3] hwmon: (lm90) Add power control Wei Ni
2013-08-08  7:13   ` Alexander Shiyan
     [not found]     ` <1375946022.222322391-uDhCb/4LxRRsdVUOrk1QfQ@public.gmane.org>
2013-08-08  9:26       ` Wei Ni
     [not found]   ` <1375944991-29182-2-git-send-email-wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-08  8:42     ` Guenter Roeck
     [not found]       ` <520359E9.1000600-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-08-08  9:47         ` Wei Ni
2013-08-08  9:57           ` Alexander Shiyan
     [not found]             ` <1375955834.368114617-VbvbiqT9YuJsdVUOrk1QfQ@public.gmane.org>
2013-08-08  9:59               ` Wei Ni
2013-08-08 10:07               ` Wei Ni
     [not found]           ` <52036920.4050808-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-08 11:23             ` Guenter Roeck
     [not found]               ` <52037F9A.7070802-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-08-08 17:33                 ` Stephen Warren
     [not found]                   ` <5203D659.4050907-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-08 17:59                     ` Guenter Roeck
     [not found]                       ` <20130808175918.GA15013-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-08-08 18:45                         ` Stephen Warren
2013-08-08 17:30         ` Stephen Warren
     [not found]           ` <5203D5B6.3060806-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-08-08 17:59             ` Guenter Roeck
2013-08-08 19:27             ` Mark Brown
2013-08-08 11:01     ` Mark Brown
     [not found]       ` <20130808110136.GA6427-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-08-08 11:25         ` Guenter Roeck
     [not found]           ` <52038035.7030803-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-08-08 13:08             ` Mark Brown
2013-08-08 15:21               ` Guenter Roeck [this message]
     [not found]                 ` <5203B78C.7010101-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-08-08 17:15                   ` Mark Brown
     [not found]                     ` <20130808171554.GI6427-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-08-08 20:00                       ` Guenter Roeck
     [not found]                         ` <20130808200026.GA18226-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-08-08 21:18                           ` Mark Brown
     [not found]                             ` <20130808211825.GN6427-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-08-08 21:30                               ` Guenter Roeck
     [not found]                                 ` <52040DE2.50201-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-08-09  5:57                                   ` Proposal: I2C device power (Was: hwmon: (lm90) Add power control) Alexander Shiyan
2013-08-09 10:27                                     ` Mark Brown
2013-08-09 10:50                                       ` Alexander Shiyan
     [not found]                                         ` <1376045411.585130456-gOtJ1i61JehsdVUOrk1QfQ@public.gmane.org>
2013-08-09 11:09                                           ` Mark Brown
2013-08-09  7:23         ` [PATCH v2 1/3] hwmon: (lm90) Add power control Wei Ni
     [not found]           ` <520498F3.8030101-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-09 10:56             ` Mark Brown
2013-08-08  6:56 ` [PATCH v2 2/3] ARM: dt: t114 dalmore: add dt entry for nct1008 Wei Ni
     [not found]   ` <1375944991-29182-3-git-send-email-wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-08 17:35     ` Stephen Warren
2013-08-09  6:06       ` Wei Ni
2013-08-08 20:36   ` Sergei Shtylyov
     [not found]     ` <52040146.7060703-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2013-08-08 20:40       ` Stephen Warren
2013-08-08 21:33         ` Guenter Roeck
2013-08-09  6:16           ` Wei Ni
2013-08-08  6:56 ` [PATCH v2 3/3] Documentation: dt: hwmon: add OF document for lm90 Wei Ni
     [not found]   ` <1375944991-29182-4-git-send-email-wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-08 17:37     ` Stephen Warren
2013-08-09  6:10       ` Wei Ni
     [not found]         ` <520487C7.5080901-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-08-09 16:35           ` Stephen Warren

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=5203B78C.7010101@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=MLongnecker@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=khali@linux-fr.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=swarren@wwwdotorg.org \
    --cc=wni@nvidia.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