Opened 10 months ago

Last modified 10 months ago

#858 new defect

i8042 driver loads the processor when HW not present

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


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):

Attachments (1)

i8042.c (11.3 KB ) - added by Colin Parker 10 months ago.

Download all attachments as: .zip

Change History (2)

by Colin Parker, 10 months ago

Attachment: i8042.c added


comment:1 by Jiri Svoboda, 10 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.

Note: See TracTickets for help on using tickets.