Page MenuHomeFreeBSD

it8613hwm(4): Add new driver for ITE IT8613 hardware monitor
Needs ReviewPublic

Authored by jo_bruelltuete.com on May 5 2023, 12:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 13, 6:15 PM
Unknown Object (File)
Mon, Jul 8, 4:15 AM
Unknown Object (File)
Sat, Jul 6, 2:10 PM
Unknown Object (File)
Fri, Jul 5, 2:40 PM
Unknown Object (File)
Wed, Jul 3, 2:37 PM
Unknown Object (File)
Mon, Jul 1, 8:12 PM
Unknown Object (File)
Thu, Jun 20, 3:54 AM
Unknown Object (File)
Jun 9 2024, 10:19 PM
Subscribers
Restricted Owners Package

Details

Reviewers
None
Group Reviewers
Contributor Reviews (src)
Summary

Adds a driver for the hardware monitor bits in the ITE 8613 super io chip.
Right now this supports temperature and fan speed reading.

This is a refresh for D36424.

Test Plan

I've been using this driver for a while now, works fine (but not perfectly... dodgy BIOS).

From /var/log/messages:

May  1 19:16:06 fred kernel: it8613hwm0: <Hardware monitor on ITE SuperIO> at HWM ldn 0x04 on superio0

I'm running stable/13 on this machine but the patch is against current (and thus compile-time tested only).

$ devinfo -r
[...]
        isab0
          isa0
            superio0
                ACPI I/O ports:
                    0x2e-0x2f
              it8613hwm0
                  ACPI I/O ports:
                      0xa35-0xa36
[...]

$ sysctl dev.it8613hwm
dev.it8613hwm.0.fan2: 1480
dev.it8613hwm.0.fan1: 598
dev.it8613hwm.0.fan0: 0
dev.it8613hwm.0.temperature2: 26C
dev.it8613hwm.0.temperature1: 34C
dev.it8613hwm.0.temperature0: 40C
dev.it8613hwm.0.%parent: superio0
dev.it8613hwm.0.%pnpinfo: type=HWM
dev.it8613hwm.0.%location: ldn=0x04
dev.it8613hwm.0.%driver: it8613hwm
dev.it8613hwm.0.%desc: Hardware monitor on ITE SuperIO
dev.it8613hwm.%parent:

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jo_bruelltuete.com edited the test plan for this revision. (Show Details)
jo_bruelltuete.com edited the test plan for this revision. (Show Details)
jo_bruelltuete.com edited the test plan for this revision. (Show Details)
jo_bruelltuete.com added subscribers: Restricted Owners Package, avg.
jo_bruelltuete.com retitled this revision from Add driver for ITE 8613 hardware monitor to it8613hwm(4): Add new driver for ITE IT8613 hardware monitor.May 8 2023, 3:09 PM

style?

tools/build/checkstyle9.pl ~/D39970.diff

WARNING: This code is highly experimental ... likely isn't a great style(9) match yet

Use of uninitialized value $root in concatenation (.) or string at tools/build/checkstyle9.pl line 1415.
Use of uninitialized value $root in concatenation (.) or string at tools/build/checkstyle9.pl line 1415.
Use of uninitialized value $root in concatenation (.) or string at tools/build/checkstyle9.pl line 1415.
ERROR: "foo*	bar" should be "foo *bar"
#47: FILE: sys/dev/it8613hwm/it8613hwm.c:42:
+	struct resource*	ioport_res;

ERROR: "foo* bar" should be "foo *bar"
#57: FILE: sys/dev/it8613hwm/it8613hwm.c:52:
+	struct it8613hwm_softc* sc = device_get_softc(dev);

ERROR: that open brace { should be on the previous line
#63: FILE: sys/dev/it8613hwm/it8613hwm.c:58:
+	if (tempindex >= 0 && tempindex < 3)
+	{

ERROR: parentheses required on return
#83: FILE: sys/dev/it8613hwm/it8613hwm.c:78:
+	return sysctl_handle_int(oidp, &tempkelvin, 0, req);

ERROR: "foo* bar" should be "foo *bar"
#90: FILE: sys/dev/it8613hwm/it8613hwm.c:85:
+	struct it8613hwm_softc* sc = device_get_softc(dev);

ERROR: that open brace { should be on the previous line
#94: FILE: sys/dev/it8613hwm/it8613hwm.c:89:
+	if (fanindex >= 0 && fanindex < 3)
+	{

ERROR: parentheses required on return
#115: FILE: sys/dev/it8613hwm/it8613hwm.c:110:
+	return sysctl_handle_int(oidp, &fanspeedrpm, 0, req);

ERROR: "foo* bar" should be "foo *bar"
#135: FILE: sys/dev/it8613hwm/it8613hwm.c:130:
+	struct it8613hwm_softc* sc = device_get_softc(dev);

ERROR: "foo* bar" should be "foo *bar"
#136: FILE: sys/dev/it8613hwm/it8613hwm.c:131:
+	struct sysctl_ctx_list* ctx;

ERROR: that open brace { should be on the previous line
#149: FILE: sys/dev/it8613hwm/it8613hwm.c:144:
+	if (error != 0)
+	{

ERROR: that open brace { should be on the previous line
#156: FILE: sys/dev/it8613hwm/it8613hwm.c:151:
+	if (sc->ioport_res == NULL)
+	{

ERROR: that open brace { should be on the previous line
#168: FILE: sys/dev/it8613hwm/it8613hwm.c:163:
+	if (chipid != 0x90)
+	{

ERROR: "foo* bar" should be "foo *bar"
#208: FILE: sys/dev/it8613hwm/it8613hwm.c:203:
+	struct it8613hwm_softc* sc = device_get_softc(dev);

total: 13 errors, 0 warnings, 251 lines checked

Is what my script picks up.

Overall it looks good, though. Just some silly style preferences of the project. I'd like to commit it and the man page companion commit D39971. You might want to run 'igor' on the man page (you'll need to install it as a package) as well as mandoc -T lint. Once those are clean, I'll commit it.