All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Frank Crawford <frank@crawford.emu.id.au>,
	Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2 3/4] hwmon (it87): Test for chipset before entering configuration mode
Date: Sat, 27 Apr 2024 10:00:18 -0700	[thread overview]
Message-ID: <8382458d-2208-41ad-a0e5-dce77c1fc286@roeck-us.net> (raw)
In-Reply-To: <0886c52480f15d3b9754d43642c722fcd9b6e722.camel@crawford.emu.id.au>

On 4/27/24 04:53, Frank Crawford wrote:
> On Sat, 2024-04-27 at 04:11 -0700, Guenter Roeck wrote:
>> On 4/27/24 01:33, Frank Crawford wrote:
> ...
>>> @@ -3144,7 +3186,7 @@ static int __init it87_find(int sioaddr,
>>> unsigned short *address,
>>>     }
>>>    
>>>    exit:
>>> - superio_exit(sioaddr, config ? has_noconf(config) : false);
>>> + superio_exit(sioaddr, opened && config && has_noconf(config));
>>
>> If 'opened' is false, this could be an affected chip. Are you sure
>> that it makes sense to pass 'false' as parameter here in that case ?
>> Doesn't that mean that the chip might be one of the affected chips,
>> but the superio exit sequence would be executed anyway ?
>> Am I missing something ?
> 
> Ohh, you may be right, I think I have got myself confused here with
> opened and how it is used in superio_exit.
> 

It took me a while to understand as well. The double negation of the
'noentry' parameter makes it difficult to understand.

> I think it should be !opened, but I will just check I still haven't
> messed it up.
> 

Maybe it should be something like
	!config && !opened ||		/* no or unknown chip, not enabled */
	config && has_noconf(config)	/* chip known to be affected */

which would translate "don't disable configuration mode for affected chips
and for unknown chips if configuration mode was not enabled".

Btw, I think "enabled" might be a better variable name.

Thanks,
Guenter


  reply	other threads:[~2024-04-27 17:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27  8:33 [PATCH v2 0/4] hwmon (it87): Correct handling for configuration mode Frank Crawford
2024-04-27  8:33 ` [PATCH v2 1/4] hwmon (it87): Rename FEAT_CONF_NOEXIT to FEAT_NOCONF as more descriptive of requirement Frank Crawford
2024-04-27  8:33 ` [PATCH v2 2/4] hwmon (it87): Do not enter configuration mode for some chiptypes Frank Crawford
2024-04-27  8:33 ` [PATCH v2 3/4] hwmon (it87): Test for chipset before entering configuration mode Frank Crawford
2024-04-27 11:11   ` Guenter Roeck
2024-04-27 11:53     ` Frank Crawford
2024-04-27 17:00       ` Guenter Roeck [this message]
2024-04-28  4:31         ` Frank Crawford
2024-04-28  7:03           ` Guenter Roeck
2024-04-28  7:35             ` Frank Crawford
2024-04-27  8:33 ` [PATCH v2 4/4] hwmon (it87): Remove tests nolonger required Frank Crawford
2024-04-27  9:58 ` [PATCH v2 0/4] hwmon (it87): Correct handling for configuration mode Frank Crawford

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=8382458d-2208-41ad-a0e5-dce77c1fc286@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=frank@crawford.emu.id.au \
    --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 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.