mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Naresh Solanki <naresh.solanki@9elements.com>
Cc: linux-hwmon@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: pm_bus: core: Implement regulator get_status
Date: Fri, 18 Nov 2022 14:07:11 -0800	[thread overview]
Message-ID: <20221118220711.GA685644@roeck-us.net> (raw)
In-Reply-To: <0fb5b5e4-ac23-01c9-a4c7-356db9ab0763@9elements.com>

On Fri, Nov 18, 2022 at 08:32:26PM +0530, Naresh Solanki wrote:
> > > +
> > > +	mutex_lock(&data->update_lock);
> > > +	status = pmbus_get_status(client, page, PMBUS_STATUS_WORD);
> > > +	mutex_unlock(&data->update_lock);
> > 
> > I do not see the point of this lock here and elsewhere in this function.
> > If you want to ensure that the status is consistent, you would need to
> > hold the lock over the entire function, not repeatedly acquire and release
> > it. Even then there would be no guarantee that the status is consistent
> > because it can change anytime on the chip side.
> Will hold the lock till end of function. Agree that chip side, status may
> change any moment.
> 
> With this I got a question i.e., what should regulator status be reported if
> regulator had previously encountered some fault but currently while reading
> the status found that pgood bit indicate output power is good.
> Should we continue to still report historical fault or instead report
> current regulator output status based on pgood ?
> 
> IMHO, it should report regulator status as ON if pgood bit is clear(i.e.,
> output is good) & leave previously encountered error reporting to
> get_error_flag function.
> 
> I need your Suggestion here.
> 
That is really a question for the regulator subsystem. Personally I think
the current status should be reported, but that is just me.

Guenter

  reply	other threads:[~2022-11-18 22:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  8:46 Naresh Solanki
2022-11-18 12:10 ` Guenter Roeck
2022-11-18 15:02   ` Naresh Solanki
2022-11-18 22:07     ` Guenter Roeck [this message]
2022-11-18 12:11 ` Guenter Roeck

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=20221118220711.GA685644@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naresh.solanki@9elements.com \
    --cc=patrick.rudolph@9elements.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®