Page MenuHomeFreeBSD

lm75: Refactor code to fix io error
ClosedPublic

Authored by jkol_semihalf.com on Nov 24 2022, 2:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 2:25 PM
Unknown Object (File)
Mon, Apr 22, 1:31 PM
Unknown Object (File)
Mon, Apr 22, 8:02 AM
Unknown Object (File)
Thu, Apr 11, 5:58 PM
Unknown Object (File)
Sat, Apr 6, 4:01 AM
Unknown Object (File)
Sat, Apr 6, 12:47 AM
Unknown Object (File)
Feb 25 2024, 3:51 AM
Unknown Object (File)
Dec 29 2023, 2:34 AM
Subscribers

Details

Summary

Use correct resolution by compat table. If dtb is not defined use default 9 bit mode.
11 bit detection is called if 9 bit mode is used.
Sysctl resolution variable is added to change resolution in case.
Some sensors didn't pull ACK while reading from nonexistent registers and it caused I2C read error and detect failure, so now detect failure does not cause driver break.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jkol_semihalf.com created this revision.
sys/dev/iicbus/lm75.c
272

blank line, remove

315–322

I would invert logic here. If lm75_type_detect fails, use width guessed by fdt compat - that method is the one which we trust the least. If there is no fdt then fail immediately.

318

Anyway, I think it would be much more meaningful to always print number of bits detected. Right now we've got two ways of resolving that number (plus sysctl to change it) so the user should always know what had been set automatically.

This revision is now accepted and ready to land.Nov 30 2022, 10:01 AM
This revision was automatically updated to reflect the committed changes.