All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Zev Weiss <zev@bewilderbeest.net>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	openbmc@lists.ozlabs.org
Subject: Re: [PATCH 4/6] regulator: core: Add external-output support
Date: Wed, 4 May 2022 14:06:05 +0100	[thread overview]
Message-ID: <YnJ6Pbmv9G3cy62n@sirena.org.uk> (raw)
In-Reply-To: <20220504065252.6955-4-zev@bewilderbeest.net>

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

On Tue, May 03, 2022 at 11:52:50PM -0700, Zev Weiss wrote:
> Regulators feeding external outputs (i.e. supplying devices we don't
> control) can be switched on and off by userspace via the 'state' sysfs
> attribute, which is now (conditionally) writable.  They are also not
> automatically disabled in regulator_late_cleanup(), since we have no
> way of knowing that they're not actually in use.

No, this is an abstraction failure.  Enabling and disabling a regulator
is something that should be handled in consumer drivers, just as with
every other use case there's no reason why the regulator should be
offering direct control to userspace.  Putting this directly in the
regulator will cause problems as soon as you for example have multiple
outputs supplied from a single regulator and can't be integrated with
any other control mechanisms.

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

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: Zev Weiss <zev@bewilderbeest.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	openbmc@lists.ozlabs.org, Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/6] regulator: core: Add external-output support
Date: Wed, 4 May 2022 14:06:05 +0100	[thread overview]
Message-ID: <YnJ6Pbmv9G3cy62n@sirena.org.uk> (raw)
In-Reply-To: <20220504065252.6955-4-zev@bewilderbeest.net>

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

On Tue, May 03, 2022 at 11:52:50PM -0700, Zev Weiss wrote:
> Regulators feeding external outputs (i.e. supplying devices we don't
> control) can be switched on and off by userspace via the 'state' sysfs
> attribute, which is now (conditionally) writable.  They are also not
> automatically disabled in regulator_late_cleanup(), since we have no
> way of knowing that they're not actually in use.

No, this is an abstraction failure.  Enabling and disabling a regulator
is something that should be handled in consumer drivers, just as with
every other use case there's no reason why the regulator should be
offering direct control to userspace.  Putting this directly in the
regulator will cause problems as soon as you for example have multiple
outputs supplied from a single regulator and can't be integrated with
any other control mechanisms.

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

  reply	other threads:[~2022-05-04 13:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  6:52 [PATCH 1/6] dt-bindings: regulator: Add regulator-external-output property Zev Weiss
2022-05-04  6:52 ` Zev Weiss
2022-05-04  6:52 ` [PATCH 2/6] dt-bindings: regulator: Add reg-external-output binding Zev Weiss
2022-05-04  6:52   ` Zev Weiss
2022-05-04 12:55   ` Mark Brown
2022-05-04 12:55     ` Mark Brown
2022-05-04 20:33     ` Zev Weiss
2022-05-04 20:33       ` Zev Weiss
2022-05-04 20:49       ` Mark Brown
2022-05-04 20:49         ` Mark Brown
2022-05-04 21:35         ` Zev Weiss
2022-05-04 21:35           ` Zev Weiss
2022-05-05 12:05           ` Mark Brown
2022-05-05 12:05             ` Mark Brown
2022-05-05  8:33       ` Krzysztof Kozlowski
2022-05-04  6:52 ` [PATCH 3/6] regulator: core: Add error flags to sysfs attributes Zev Weiss
2022-05-04  6:52   ` Zev Weiss
2022-05-04  6:52 ` [PATCH 4/6] regulator: core: Add external-output support Zev Weiss
2022-05-04  6:52   ` Zev Weiss
2022-05-04 13:06   ` Mark Brown [this message]
2022-05-04 13:06     ` Mark Brown
2022-05-04  6:52 ` [PATCH 5/6] regulator: core: Add external get type Zev Weiss
2022-05-04  6:52   ` Zev Weiss
2022-05-04  6:52 ` [PATCH 6/6] regulator: core: Add external-consumer driver Zev Weiss
2022-05-04  6:52   ` Zev Weiss
2022-05-04 12:36 ` [PATCH 1/6] dt-bindings: regulator: Add regulator-external-output property Mark Brown
2022-05-04 12:36   ` Mark Brown
2022-05-04 20:54 ` (subset) " Mark Brown
2022-05-04 20:54   ` 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=YnJ6Pbmv9G3cy62n@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=zev@bewilderbeest.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.