From: Giovanni Mascellani <gio@debian.org>
To: "Guenter Roeck" <linux@roeck-us.net>,
"Pali Rohár" <pali.rohar@gmail.com>,
"Jean Delvare" <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] dell-smm-hwmon: Add support for disabling automatic BIOS fan control
Date: Sun, 17 Nov 2019 09:02:08 +0100 [thread overview]
Message-ID: <371da137-6073-00f4-7520-c990da6be40e@debian.org> (raw)
In-Reply-To: <3a10f96a-06e1-39f4-74a6-908d25b1f496@roeck-us.net>
[-- Attachment #1.1: Type: text/plain, Size: 3302 bytes --]
Hi,
Il 16/11/19 23:08, Guenter Roeck ha scritto:
>> + mutex_lock(&i8k_mutex);
>> + err = i8k_enable_fan_auto_mode(enable);
>> + mutex_unlock(&i8k_mutex);
>> +
>> + return err ? -EIO : count;
>
> Why override the error code ? i8k_enable_fan_auto_mode()
> can return -EINVAL.
>
> I can see that the rest of the driver has the same bad habit,
> but that is not a reason to continue it.
Ok, I thought it was the appropriate thing to do just because it was
done elsewhere. If it's not a good idea, do you think a patch removing
the other instances of this construct would be appropriate?
>> +}
>> +
>> static SENSOR_DEVICE_ATTR_RO(temp1_input, i8k_hwmon_temp, 0);
>> static SENSOR_DEVICE_ATTR_RO(temp1_label, i8k_hwmon_temp_label, 0);
>> static SENSOR_DEVICE_ATTR_RO(temp2_input, i8k_hwmon_temp, 1);
>> @@ -749,12 +794,15 @@ static SENSOR_DEVICE_ATTR_RO(temp10_label,
>> i8k_hwmon_temp_label, 9);
>> static SENSOR_DEVICE_ATTR_RO(fan1_input, i8k_hwmon_fan, 0);
>> static SENSOR_DEVICE_ATTR_RO(fan1_label, i8k_hwmon_fan_label, 0);
>> static SENSOR_DEVICE_ATTR_RW(pwm1, i8k_hwmon_pwm, 0);
>> +static SENSOR_DEVICE_ATTR_WO(pwm1_enable, i8k_hwmon_pwm_enable, 0);
>> static SENSOR_DEVICE_ATTR_RO(fan2_input, i8k_hwmon_fan, 1);
>> static SENSOR_DEVICE_ATTR_RO(fan2_label, i8k_hwmon_fan_label, 1);
>> static SENSOR_DEVICE_ATTR_RW(pwm2, i8k_hwmon_pwm, 1);
>> +static SENSOR_DEVICE_ATTR_WO(pwm2_enable, i8k_hwmon_pwm_enable, 0);
>> static SENSOR_DEVICE_ATTR_RO(fan3_input, i8k_hwmon_fan, 2);
>> static SENSOR_DEVICE_ATTR_RO(fan3_label, i8k_hwmon_fan_label, 2);
>> static SENSOR_DEVICE_ATTR_RW(pwm3, i8k_hwmon_pwm, 2);
>> +static SENSOR_DEVICE_ATTR_WO(pwm3_enable, i8k_hwmon_pwm_enable, 0);
>
> Having three attributes do all the same is not very valuable.
> I would suggest to stick with pwm1_enable and document that it applies
> to all pwm channels.
I had no idea what is the convention here. No problem changing this thing.
>> @@ -1200,6 +1291,14 @@ static int __init i8k_probe(void)
>> i8k_fan_max = fan_max ? : I8K_FAN_HIGH; /* Must not be 0 */
>> i8k_pwm_mult = DIV_ROUND_UP(255, i8k_fan_max);
>> + fan_control = dmi_first_match(i8k_whitelist_fan_control);
>> + if (fan_control && fan_control->driver_data) {
>> + const struct i8k_fan_control_data *fan_control_data =
>> fan_control->driver_data;
>> + manual_fan = fan_control_data->manual_fan;
>> + auto_fan = fan_control_data->auto_fan;
>> + pr_info("enabling experimental BIOS fan control support\n");
>
> That isn't entirely accurate. What this enables is the ability
> to select automatic or manual fan control.
Hmm, it sounds right to me: there is a feature which is "BIOS fan
control" and this driver can "support" it or not, i.e., be aware of it
and interact with it or not. And all of this is "experimental". The
wording seems to capture this to me. However, no problem with changing
it. How would "enabling support for setting automatic/manual fan
control" work? Can you suggest a wording?
Thanks, Giovanni.
--
Giovanni Mascellani <g.mascellani@gmail.com>
Postdoc researcher - Université Libre de Bruxelles
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2019-11-17 8:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-16 17:36 Giovanni Mascellani
2019-11-16 22:08 ` Guenter Roeck
2019-11-17 8:02 ` Giovanni Mascellani [this message]
2019-11-17 15:14 ` 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=371da137-6073-00f4-7520-c990da6be40e@debian.org \
--to=gio@debian.org \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=pali.rohar@gmail.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®