[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181024175701.GB6374@Asurada-Nvidia.nvidia.com>
Date: Wed, 24 Oct 2018 10:57:02 -0700
From: Nicolin Chen <nicoleotsuka@...il.com>
To: linux@...ck-us.net
Cc: jdelvare@...e.com, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/5] hwmon: (ina3221) Add PM runtime support
On Wed, Oct 24, 2018 at 09:24:18AM +0000, linux@...ck-us.net wrote:
> > +fail:
> > + if (enable) {
> > + dev_err(dev, "Reverting channel%d enabling: %d\n",
> > + channel, ret);
>
> This message is confusing. Something like "Failed to enable channel %d:
> error %d" would be much better.
Will fix in v3.
> > +fail_pm:
> > + pm_runtime_disable(ina->hdev);
> > + pm_runtime_set_suspended(ina->hdev);
> > + for (i = 0; i < INA3221_NUM_CHANNELS; i++)
> > + pm_runtime_put_noidle(ina->hdev);
>
> The count here doesn't match the count above if some channels
> are disabled, or if the enable loop above aborted.
>
> > + /* Decrease the PM refcount */
> > + for (i = 0; i < INA3221_NUM_CHANNELS; i++)
> > + pm_runtime_put_noidle(ina->hdev);
> >
> As above, this doesn't take disabled channels into account. Maybe that
> doesn't matter; if so, there needs to be a comment indicating that
> negative use counts don't matter. If that is the case, make sure that
> this is acceptable use of the pm API (if it works but is not documented,
> the PM core may change and complain about it at a later time).
The API will stop decrease at 0. But I will see if I can explicitly
loop a matched number, or at lest will mention this in comments.
Thanks
Nicolin
Powered by blists - more mailing lists