Linux Documentation
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Mark Brown <broonie@kernel.org>,
	 Liam Girdwood <lgirdwood@gmail.com>,
	Jean Delvare <jdelvare@suse.com>,
	 Jonathan Corbet <corbet@lwn.net>,
	linux-kernel@vger.kernel.org,  linux-hwmon@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH 4/5] hwmon: (pmbus/core) improve handling of write protected regulators
Date: Tue, 08 Oct 2024 14:44:35 +0200	[thread overview]
Message-ID: <1j5xq2sr0s.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <64c3f6c3-10b5-44c6-a1cd-c796b770c904@roeck-us.net> (Guenter Roeck's message of "Mon, 23 Sep 2024 09:44:11 -0700")

On Mon 23 Sep 2024 at 09:44, Guenter Roeck <linux@roeck-us.net> wrote:

> On 9/23/24 06:21, Mark Brown wrote:
>> On Fri, Sep 20, 2024 at 06:47:05PM +0200, Jerome Brunet wrote:
>> 
>>> +int pmbus_regulator_init_cb(struct regulator_dev *rdev,
>>> +			    struct regulator_config *config)
>>> +{
>>> +	struct pmbus_data *data = config->driver_data;
>>> +	struct regulation_constraints *constraints = rdev->constraints;
>>> +
>>> +	if (data->flags & PMBUS_OP_PROTECTED)
>>> +		constraints->valid_ops_mask &= ~REGULATOR_CHANGE_STATUS;
>>> +
>>> +	if (data->flags & PMBUS_VOUT_PROTECTED)
>>> +		constraints->valid_ops_mask &= ~REGULATOR_CHANGE_VOLTAGE;
>>> +
>>> +	return 0;
>>> +}
>>> +EXPORT_SYMBOL_NS_GPL(pmbus_regulator_init_cb, PMBUS);
>> I'm fairly comfortable with this from a regulator point of view, modulo
>> the suggestion I posted in the other message about registering separate
>> ops.  The fact that there's three combinations of ops is annoying but
>> doesn't feel too bad, though I didn't actually write it out so perhaps
>> it looks horrible.  In general removing permissions is safe, and without
>> separate steps to remove write protect (which I see in your patch 5) the
>> writes wouldn't actually work anyway.
>
>
> I still consider the callback to be unnecessary, but I don't really have time
> to implement a better solution myself. If you accept the regulator patches,
> I'll have another look at the series as-is.

I'll group the regulator patches and resend to Mark, adjusted as
requested.

Guenter, should I the resend the hwmon patches here grouped with the
tps25990 series ? Or is there something you'd like me change before ?

>
> Guenter

-- 
Jerome

  reply	other threads:[~2024-10-08 12:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20 16:47 [PATCH 0/5] hwmon: (pmbus/core) support write protected pmbus regulators Jerome Brunet
2024-09-20 16:47 ` [PATCH 1/5] regulator: core: add callback to perform runtime init Jerome Brunet
2024-09-20 16:47 ` [PATCH 2/5] regulator: core: remove machine init callback from config Jerome Brunet
2024-09-24  8:12   ` Mark Brown
2024-09-20 16:47 ` [PATCH 3/5] hwmon: (pmbus/core) allow drivers to override WRITE_PROTECT Jerome Brunet
2024-09-20 16:47 ` [PATCH 4/5] hwmon: (pmbus/core) improve handling of write protected regulators Jerome Brunet
2024-09-20 21:13   ` Guenter Roeck
2024-09-21 11:32     ` Jerome Brunet
2024-09-21 15:22       ` Guenter Roeck
2024-09-21 16:49         ` Jerome Brunet
2024-09-21 17:16           ` Guenter Roeck
2024-09-23 12:21           ` Mark Brown
2024-09-23 16:53             ` Jerome Brunet
2024-09-24  8:11               ` Mark Brown
2024-09-23 13:21   ` Mark Brown
2024-09-23 16:44     ` Guenter Roeck
2024-10-08 12:44       ` Jerome Brunet [this message]
2024-09-20 16:47 ` [PATCH 5/5] hwmon: (pmbus/core) add wp module param Jerome Brunet

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=1j5xq2sr0s.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=jdelvare@suse.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox