Opened 15 months ago

Last modified 4 weeks ago

#858 new defect

i8042 driver loads the processor when HW not present

Reported by: Colin Parker Owned by:
Priority: minor Milestone: 0.14.2
Component: helenos/drv/other Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

Not all amd64-based PCs have functional i8042 HW (e.g. Apple products). Because the i8042 driver repeatedly polls the "ready" status, this results in severe performance reduction on these systems, as the device is never ready and 100% of available CPU cycles are used checking this over and over.

I have a proposed remedy, which times out and aborts the driver after 100 ms (attached i8042.c): https://github.com/cvparker/helenos/commit/2ef2f0ed5278613e58d96e85f1bec6d8070856ae

Attachments (1)

i8042.c (11.3 KB ) - added by Colin Parker 15 months ago.
uspace/drv/char/i8042/i8042.c

Download all attachments as: .zip

Change History (4)

by Colin Parker, 15 months ago

Attachment: i8042.c added

uspace/drv/char/i8042/i8042.c

comment:1 by Jiri Svoboda, 15 months ago

Thanks Colin for filing this ticket and for your proposed solution. I think this needs more work. A driver should not abort(). Static variables are a no-no. The driver should detect the presence of the device in i8042_init() and return an error code if it is not detected.

Also, your solution calls getuptime() every time in wait_ready(), even if the device is ready. I think some kind of backoff mechanism for the wait might be useful, but that needs to be given more thought and testing on different HW.

comment:2 by Jiri Svoboda, 4 weeks ago

Milestone: 0.13.10.14.1

Milestone renamed

comment:3 by Jiri Svoboda, 4 weeks ago

Milestone: 0.14.10.14.2
Note: See TracTickets for help on using tickets.