Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: linux@roeck-us.net
Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/5] hwmon: (ina3221) Make sure data is ready before reading
Date: Wed, 24 Oct 2018 10:54:00 -0700	[thread overview]
Message-ID: <20181024175400.GA6374@Asurada-Nvidia.nvidia.com> (raw)
In-Reply-To: <20181024091035.Horde.F-g3MefpEv95EQd6w9-rB3D@cp2.active-venture.com>

On Wed, Oct 24, 2018 at 09:10:35AM +0000, linux@roeck-us.net wrote:
> > @@ -150,6 +183,12 @@ static int ina3221_read_in(struct device *dev, u32
> > attr, int channel, long *val)
> >  		if (!ina3221_is_enabled(ina, channel))
> >  			return -ENODATA;
> > 
> > +		ret = ina3221_wait_for_data(ina);
> > +		if (ret) {
> > +			dev_err(dev, "Timed out at waiting for CVRF bit\n");
> > +			return ret;
> > +		}
> 
> Thanks for explaining why we can't just blindly wait.
> However, I am concerned about this log message: If something is wrong
> with the chip, this will spam the kernel log. Can you drop the message
> here and below ? After all, the error will be reported to userspace,
> and a kernel log message should not be necessary.

Will do that.

Thanks
Nicolin

> 
> Thanks,
> Guenter
> 
> > +
> >  		ret = ina3221_read_value(ina, reg, &regval);
> >  		if (ret)
> >  			return ret;
> > @@ -189,6 +228,13 @@ static int ina3221_read_curr(struct device *dev,
> > u32 attr,
> >  	case hwmon_curr_input:
> >  		if (!ina3221_is_enabled(ina, channel))
> >  			return -ENODATA;
> > +
> > +		ret = ina3221_wait_for_data(ina);
> > +		if (ret) {
> > +			dev_err(dev, "Timed out at waiting for CVRF bit\n");
> > +			return ret;
> > +		}
> > +
> >  		/* fall through */
> >  	case hwmon_curr_crit:
> >  	case hwmon_curr_max:
> > --
> > 2.17.1
> 
> 
> 

  reply	other threads:[~2018-10-25  2:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24  2:36 [PATCH v2 0/5] hwmon: (ina3221) Implement PM runtime to save power Nicolin Chen
2018-10-24  2:36 ` [PATCH v2 1/5] hwmon: (core) Inherit power properties to hdev Nicolin Chen
2018-10-24  2:36 ` [PATCH v2 2/5] hwmon: (ina3221) Check channel status for alarms attribute read Nicolin Chen
2018-10-24  2:36 ` [PATCH v2 3/5] hwmon: (ina3221) Serialize sysfs ABI accesses Nicolin Chen
2018-10-24  2:36 ` [PATCH v2 4/5] hwmon: (ina3221) Make sure data is ready before reading Nicolin Chen
2018-10-24  9:10   ` linux
2018-10-24 17:54     ` Nicolin Chen [this message]
2018-10-24  2:36 ` [PATCH v2 5/5] hwmon: (ina3221) Add PM runtime support Nicolin Chen
2018-10-24  9:24   ` linux
2018-10-24 17:57     ` Nicolin Chen

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=20181024175400.GA6374@Asurada-Nvidia.nvidia.com \
    --to=nicoleotsuka@gmail.com \
    --cc=jdelvare@suse.com \
    --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