Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: andrea.merello@gmail.com
Cc: linux-hwmon@vger.kernel.org,
	LABBE Corentin <clabbe.montjoie@gmail.com>,
	Jean Delvare <jdelvare@suse.com>
Subject: Re: [PATCH v5 1/2] hwmon: new driver for ST stts751 thermal sensor
Date: Wed, 1 Feb 2017 06:11:16 -0800	[thread overview]
Message-ID: <294659da-c500-36e7-e2e1-8fd6382ca98f@roeck-us.net> (raw)
In-Reply-To: <CAN8YU5Ma_1c9xw==w5FL5WiPwA=C5ozLoBDWJ+c0Rcmb=_x-bA@mail.gmail.com>

On 01/31/2017 11:31 PM, Andrea Merello wrote:
> On Tue, Jan 31, 2017 at 12:47 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>> On 01/30/2017 11:11 PM, Andrea Merello wrote:
>>>
>>> On Mon, Jan 30, 2017 at 3:24 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>>>>
>>>> On 01/30/2017 01:40 AM, Andrea Merello wrote:
>>>>>
>>>>>
>>>>> This patch adds a HWMON driver for ST Microelectronics STTS751
>>>>> temperature sensors.
>>>>>
>>>>
>>>> Overall looks good. One thing I noticed, though: In the log function
>>>> calls,
>>>> you use a mix of priv->dev and &client->dev as log device. Also, you
>>>> sometimes
>>>> use &priv->client->dev even when a local client variable is available.
>>>> I can fix up the latter (no need to resend for that), but please have a
>>>> look at the overall use and either send a fixed up version or let me know
>>>> if the log devices are all intentional as-is.
>>>
>>>
>>> Hmm, you are right: there is a bit of mess here. It's not intentional
>>> indeed..
>>>
>>> I gave a look to lm90.c and lm63.c; it seems no one uses the hwmon
>>> device for this purpose. We can probably stick to &client->dev or
>>> &priv->client->dev when a local client variable is not already
>>> available.
>>
>>
>> It is really your call as the driver's author to make if you want to use
>> the hwmon device or &client->dev.
>
> I've decided to stick with &client->dev for all dev_dbg(), while I
> would use the hwmon device for dev_notice() and dev_warn(), that are
> supposed to be eventually read by the user.
>
> However, while keeping an eye on the log messages I've realized that
> if the temperature remains out-of-limit for a lot of time, especially
> if the conversion rate is set fast, we tend to spam the log with alert
> messages.. I learned that you are usually concerned by noisy drivers,
> so I guess you might want to mitigate this..
>
> I could use dev_notice_once(), but it seems inappropriate here, or I
> can silence the message at least until one reads the chip. Lm90 does
> even disable the alarm until that happen, but it has only one alarm;
> here we have two, so it seems not correct here.
>
> Any suggestion?
>

Use a flag that shows if the attribute in question was read ?

Guenter

>
>>>
>>>
>>> Also, it looks like we can change some &priv->client->dev in
>>> &client->dev in probe function when calling i2c read/write functions.
>>>
>>> If you ACK, I'll fix and resend.
>>>
>> SGTM.
>>
>> Thanks,
>> Guenter
>>
>


      reply	other threads:[~2017-02-01 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30  9:40 [PATCH v5 1/2] hwmon: new driver for ST stts751 thermal sensor Andrea Merello
2017-01-30  9:40 ` [PATCH v5 2/2] DT: add binding documentation for STTS751 Andrea Merello
2017-01-30 14:24 ` [PATCH v5 1/2] hwmon: new driver for ST stts751 thermal sensor Guenter Roeck
2017-01-31  7:11   ` Andrea Merello
2017-01-31 11:47     ` Guenter Roeck
2017-02-01  7:31       ` Andrea Merello
2017-02-01 14:11         ` Guenter Roeck [this message]

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=294659da-c500-36e7-e2e1-8fd6382ca98f@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andrea.merello@gmail.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    /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