Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH] lm75: add lm75b detection
@ 2019-10-28 11:37 Rain Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Rain Wang @ 2019-10-28 11:37 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Guenter Roeck, linux-kernel, linux-hwmon

> Please send hwmon-related patches to the linux-hwmon list.

Sure, will do in future.

> I'm positively certain I don't want this. Ideally there should be no
> detection at all for device without ID registers. The only reason there
> are some occurrences of that is because there were no way to explicitly
> instantiate I2C devices back then, and we have left the detection in
> place to avoid perceived regressions. But today there are plenty of
> ways to explicitly instantiate your I2C devices so there are no excuses
> for more crappy detect functions. Ideally we would even get rid of
> existing ones at some point in the future.

I understand the concern, but there could be scenarios device tree doesn't
apply while some dynamic detection is still a valid requirement, not sure
maybe I'm wrong from beginning.

> This patch is bad anyway as it only changes the device name without
> implementing proper support for the LM75B.

This is only change we made just have our Intel C1516 board with LM75B sensor
working anyway, while majority common features of LM75 just work.

Regards
Rain

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lm75: add lm75b detection
  2019-10-29 14:02     ` Guenter Roeck
@ 2019-11-07  6:18       ` Rain Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Rain Wang @ 2019-11-07  6:18 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare; +Cc: linux-kernel, linux-hwmon

Sorry for my late reply, 

>FWIW, I don't think there is anything to implement; I don't see any
>differences in functionality.
Yes, no functional difference but the detection

>I am much more concerned about weakening the already weak detection even further:
>As written, each chip with register 0x07 != 0xa1 will be identified as LM75B.
>Even if that was strengthened to actually check if the register value is 0xff,
>we have no idea what other vendors might implement in those registers. it would
>most certainly mis-identify LM75C as LM75B. Not that it really matters if
>the chip _is_ a LM75C, but who knows if other chips fit that identification
>pattern.
Yes, that's also my concern on the code of detection. I don't have any other sensors as
LM75C to try, so thinking maybe some other guys can help extend it if needed in future.

>Overall, my suggestion is to add a small startup script to affected systems
>to instantiate the chip directly, and avoid weakening the detect function.
Understood, we can have the instantiating script but just don't want limit the detection.
Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lm75: add lm75b detection
  2019-10-28  9:46   ` Jean Delvare
@ 2019-10-29 14:02     ` Guenter Roeck
  2019-11-07  6:18       ` Rain Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2019-10-29 14:02 UTC (permalink / raw)
  To: Jean Delvare, Rain Wang; +Cc: linux-kernel, linux-hwmon

On 10/28/19 2:46 AM, Jean Delvare wrote:
> On Sun, 27 Oct 2019 16:03:39 -0700, Guenter Roeck wrote:
>> On 10/26/19 1:10 AM, Rain Wang wrote:
>>> The National Semiconductor LM75B is very similar as the
>>> LM75A, but it has no ID byte register 7, and unused registers
>>> return 0xff rather than the last read value like LM75A.
> 
> Please send hwmon-related patches to the linux-hwmon list.
> 
>>> Signed-off-by: Rain Wang <rain_wang@jabil.com>
>>
>> I am quite hesitant to touch the detect function for this chip.
>> Each addition increases the risk for false positives. What is the
>> use case ?
> 
> I'm positively certain I don't want this. Ideally there should be no
> detection at all for device without ID registers. The only reason there
> are some occurrences of that is because there were no way to explicitly
> instantiate I2C devices back then, and we have left the detection in
> place to avoid perceived regressions. But today there are plenty of
> ways to explicitly instantiate your I2C devices so there are no excuses
> for more crappy detect functions. Ideally we would even get rid of
> existing ones at some point in the future.
> 
> This patch is bad anyway as it only changes the device name without
> implementing proper support for the LM75B.
> 
FWIW, I don't think there is anything to implement; I don't see any
differences in functionality.

I am much more concerned about weakening the already weak detection even further:
As written, each chip with register 0x07 != 0xa1 will be identified as LM75B.
Even if that was strengthened to actually check if the register value is 0xff,
we have no idea what other vendors might implement in those registers. it would
most certainly mis-identify LM75C as LM75B. Not that it really matters if
the chip _is_ a LM75C, but who knows if other chips fit that identification
pattern.

Overall, my suggestion is to add a small startup script to affected systems
to instantiate the chip directly, and avoid weakening the detect function.

Guenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] lm75: add lm75b detection
       [not found] ` <7a2ddf42-8bbe-59e0-dae8-85b184ea0da0@roeck-us.net>
@ 2019-10-28  9:46   ` Jean Delvare
  2019-10-29 14:02     ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Delvare @ 2019-10-28  9:46 UTC (permalink / raw)
  To: Rain Wang; +Cc: Guenter Roeck, linux-kernel, linux-hwmon

On Sun, 27 Oct 2019 16:03:39 -0700, Guenter Roeck wrote:
> On 10/26/19 1:10 AM, Rain Wang wrote:
> > The National Semiconductor LM75B is very similar as the
> > LM75A, but it has no ID byte register 7, and unused registers
> > return 0xff rather than the last read value like LM75A.

Please send hwmon-related patches to the linux-hwmon list.

> > Signed-off-by: Rain Wang <rain_wang@jabil.com>
> 
> I am quite hesitant to touch the detect function for this chip.
> Each addition increases the risk for false positives. What is the
> use case ?

I'm positively certain I don't want this. Ideally there should be no
detection at all for device without ID registers. The only reason there
are some occurrences of that is because there were no way to explicitly
instantiate I2C devices back then, and we have left the detection in
place to avoid perceived regressions. But today there are plenty of
ways to explicitly instantiate your I2C devices so there are no excuses
for more crappy detect functions. Ideally we would even get rid of
existing ones at some point in the future.

This patch is bad anyway as it only changes the device name without
implementing proper support for the LM75B.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 11:37 [PATCH] lm75: add lm75b detection Rain Wang
     [not found] <20191026081049.GA16839@rainw-fedora28-jabil.corp.JABIL.ORG>
     [not found] ` <7a2ddf42-8bbe-59e0-dae8-85b184ea0da0@roeck-us.net>
2019-10-28  9:46   ` Jean Delvare
2019-10-29 14:02     ` Guenter Roeck
2019-11-07  6:18       ` Rain Wang

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org
	public-inbox-index linux-hwmon

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git