From: Hans de Goede <hdegoede@redhat.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 3/3] hwmon/f71882fg: Make the decision
Date: Tue, 13 Sep 2011 07:19:32 +0000 [thread overview]
Message-ID: <4E6F0404.3080804@redhat.com> (raw)
In-Reply-To: <1315563155-15774-3-git-send-email-hdegoede@redhat.com>
Hi,
On 09/12/2011 08:47 PM, Guenter Roeck wrote:
> On Fri, 2011-09-09 at 06:12 -0400, Hans de Goede wrote:
>> Before this patch the f71882fg driver completely fails to initialize
>> on systems which have reserved settings in the pwm enable register, and
>> it disables all auto pwm sysfs attributes if any fan is controlled by
>> a digital sensor reading.
>>
>> This patch changes the fail to initialize into don't register any attributes
>> for the fan for which there are reserved settings in the pwm enable register
>> and also makes the not registering of auto pwm sysfs attributes a per fan
>> thing.
>>
>> Signed-off-by: Hans de Goede<hdegoede@redhat.com>
>
> Nice cleanup. One minor comment:
>
> [ ... ]
>>
>> static int __devinit f71882fg_create_fan_sysfs_files(
>> - struct platform_device *pdev, int idx, bool pwm_auto_point)
>> + struct platform_device *pdev, int idx)
>> {
>> struct f71882fg_data *data = platform_get_drvdata(pdev);
>> int err;
>>
>> + /* Sanity check the pwm setting */
>> + err = 0;
>> + switch (data->type) {
>> + case f71858fg:
>> + if (((data->pwm_enable>> (idx * 2))& 3) = 3)
>> + err = 1;
>> + break;
>> + case f71862fg:
>> + if (((data->pwm_enable>> (idx * 2))& 1) != 1)
>> + err = 1;
>> + break;
>> + case f8000:
>> + if (idx = 2)
>> + err = data->pwm_enable& 0x20;
>> + break;
>> + default:
>> + break;
>> + }
>> + if (err) {
>> + dev_err(&pdev->dev,
>> + "Invalid (reserved) pwm settings: 0x%02x, "
>> + "skipping fan %d\n",
>> + (data->pwm_enable>> (idx * 2))& 3, idx + 1);
>> + return 0; /* This is a non fatal condition */
>> + }
>
> Since this is no longer a fatal condition, it might make sense to use
> dev_warn instead.
Despite being non fatal, this is still very much an error. f71882fg has
been doing these checks for quite some time now, and Daniel's mobo is the
first one to actual trigger them. Who knows this error may even point out
to some BIOS developer that he is doing something wrong (yeah right BIOS
developers testing with Linux, well we can always hope).
iow I would prefer to keep this as is :)
Regards,
Hans
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2011-09-13 7:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 10:12 [lm-sensors] [PATCH 3/3] hwmon/f71882fg: Make the decision wether Hans de Goede
2011-09-12 17:23 ` [lm-sensors] [PATCH 3/3] hwmon/f71882fg: Make the decision Guenter Roeck
2011-09-12 17:26 ` Hans de Goede
2011-09-12 17:31 ` Guenter Roeck
2011-09-12 18:47 ` Guenter Roeck
2011-09-12 19:13 ` Jean Delvare
2011-09-13 7:19 ` Hans de Goede [this message]
2011-09-13 13:20 ` 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=4E6F0404.3080804@redhat.com \
--to=hdegoede@redhat.com \
--cc=lm-sensors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.