Page MenuHomeFreeBSD

lm75: Refactor code to fix io error
ClosedPublic

Authored by jkol_semihalf.com on Thu, Nov 24, 2:22 PM.
Tags
None
Referenced Files
F52596836: D37497.diff
Mon, Dec 5, 1:46 AM
Unknown Object (File)
Thu, Dec 1, 8:01 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.Wed, Nov 30, 10:01 AM
This revision was automatically updated to reflect the committed changes.