linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: "Pali Rohár" <pali@kernel.org>
Cc: jdelvare@suse.com, linux@roeck-us.net,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] hwmon: (dell-smm) Fail probing when cooling device registration fails
Date: Sun, 21 Aug 2022 21:11:24 +0200	[thread overview]
Message-ID: <ea06f15d-cb22-1d5d-9437-59d595e24e43@gmx.de> (raw)
In-Reply-To: <20220821154145.v7da76besv2qzqhj@pali>

Am 21.08.22 um 17:41 schrieb Pali Rohár:

> On Sunday 21 August 2022 17:17:11 Armin Wolf wrote:
>> Previously, it was thought that failing to register a cooling device
>> would not be critical, so the probing was not aborted in such a case.
>> This however would lead to userspace being unable to rely on those
>> cooling devices, since they might not represent all fans being present.
>> Fix that by failing probing when cooling device registration fails.
> This patch does not fix address this issue fully. CONFIG_THERMAL can be
> disabled during compile time and then cooling device would not be
> registered too.

I though of the cooling device feature as being optional "as a whole".
So when CONFIG_THERMAL is disabled during compile time, the driver does
not create any cooling devices. If however CONFIG_THERMAL was enabled
during compile time, the driver should fail probing if it cannot register
all cooling devices.

Armin Wolf

>> Tested on a Dell Inspiron 3505.
>>
>> Fixes: e0d3f7cb2606 ("hwmon: (dell-smm) Add cooling device support")
>> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
>> ---
>>   drivers/hwmon/dell-smm-hwmon.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
>> index 7f8d95dd2717..1dab7591576a 100644
>> --- a/drivers/hwmon/dell-smm-hwmon.c
>> +++ b/drivers/hwmon/dell-smm-hwmon.c
>> @@ -1013,12 +1013,10 @@ static int __init dell_smm_init_hwmon(struct device *dev)
>>
>>   		data->fan[i] = true;
>>
>> -		/* the cooling device is not critical, ignore failures */
>>   		if (IS_REACHABLE(CONFIG_THERMAL)) {
>>   			err = dell_smm_init_cdev(dev, i);
>>   			if (err < 0)
>> -				dev_warn(dev, "Failed to register cooling device for fan %u\n",
>> -					 i + 1);
>> +				return err;
>>   		}
>>
>>   		data->fan_nominal_speed[i] = devm_kmalloc_array(dev, data->i8k_fan_max + 1,
>> --
>> 2.30.2
>>

  reply	other threads:[~2022-08-21 19:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-21 15:17 [PATCH 0/3] hwmon: (dell-smm) Minor fixes Armin Wolf
2022-08-21 15:17 ` [PATCH 1/3] hwmon: (dell-smm) Fail probing when cooling device registration fails Armin Wolf
2022-08-21 15:41   ` Pali Rohár
2022-08-21 19:11     ` Armin Wolf [this message]
2022-08-22 16:17       ` Guenter Roeck
2022-08-21 15:17 ` [PATCH 2/3] hwmon: (dell-smm) Add FW_BUG to SMM warning message Armin Wolf
2022-08-21 15:43   ` Pali Rohár
2022-08-21 15:17 ` [PATCH 3/3] hwmon: (dell-smm) Improve warning messages Armin Wolf
2022-08-21 15:46   ` Pali Rohár
2022-08-21 19:17     ` Armin Wolf
2022-08-22 16:21   ` 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=ea06f15d-cb22-1d5d-9437-59d595e24e43@gmx.de \
    --to=w_armin@gmx.de \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pali@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;
as well as URLs for NNTP newsgroup(s).