Opened 20 months ago
Last modified 6 months 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)
Change History (4)
by , 20 months ago
comment:1 by , 20 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:3 by , 6 months ago
Milestone: | 0.14.1 → 0.14.2 |
---|
uspace/drv/char/i8042/i8042.c