linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Seo <james@equiv.tech>
To: Armin Wolf <W_Armin@gmx.de>
Cc: James Seo <james@equiv.tech>, Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] hwmon: add HP WMI Sensors driver
Date: Wed, 26 Apr 2023 13:16:33 +0000 (UTC)	[thread overview]
Message-ID: <ZEkkLggFLCGlvq8f@equiv.tech> (raw)
In-Reply-To: <cd81a7d6-4b81-f074-1f28-6d1b5300b937@gmx.de>

On Mon, Apr 24, 2023 at 11:13:36PM +0200, Armin Wolf wrote:
> Am 24.04.23 um 12:05 schrieb James Seo:
> 
>> +	for (i = 0; i < HP_WMI_MAX_INSTANCES; i++, pevents++) {
> 
> Hi,
> 
> the WMI driver core already knows how many instances of a given WMI object are available.
> Unfortunately, this information is currently unavailable to drivers. Would it be convenient
> for you to access this information? I could try to implement such a function if needed.
> 
>> +	for (i = 0; i < HP_WMI_MAX_INSTANCES; i++, info++) {
> 
> Same as above.
> 

Hello,

Having the WMI object instance count wouldn't make much difference to
me for now. The driver has to iterate through all instances during
init anyway. If I were forced to accommodate 50+ sensors, I'd rewrite
some things and I think I'd want such a function then, but I picked
the current arbitrary limit of 32 because even that seems unlikely.

So, maybe don't worry about it unless you want to. Or am I missing
something?

>> +	err = wmi_install_notify_handler(HP_WMI_EVENT_GUID,
>> +					 hp_wmi_notify, state);
> 
> As a side note: the GUID-based interface for accessing WMI devices is deprecated.
> It has known problems handling WMI devices sharing GUIDs and/or notification IDs. However,
> the modern bus-based WMI interface (currently) does not support such aggregate devices well,
> so i think using wmi_install_notify_handler() is still the best thing you can currently do.
> 

Interesting. Of course I had no idea. Though, for some strange
reason, it does look like some documentation to that effect has
emerged on the topic since the last time I checked ;)

>> +	if (err) {
>> +		dev_info(dev, "Failed to subscribe to WMI event\n");
>> +		return false;
>> +	}
>> +
>> +	err = devm_add_action(dev, hp_wmi_devm_notify_remove, NULL);
>> +	if (err) {
>> +		wmi_remove_notify_handler(HP_WMI_EVENT_GUID);
>> +		return false;
>> +	}
> 
> Maybe use devm_add_action_or_reset() here?

Will do.

Thanks for reviewing/writing.

James

  reply	other threads:[~2023-04-26 13:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24 10:05 [PATCH v3] hwmon: add HP WMI Sensors driver James Seo
2023-04-24 21:13 ` Armin Wolf
2023-04-26 13:16   ` James Seo [this message]
2023-04-26 19:35     ` Armin Wolf
2023-04-27  7:37       ` James Seo
2023-04-27 16:39         ` Armin Wolf

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=ZEkkLggFLCGlvq8f@equiv.tech \
    --to=james@equiv.tech \
    --cc=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=platform-driver-x86@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;
as well as URLs for NNTP newsgroup(s).