ahci: rework init workflow & fix timeout handling
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 14 Jul 2011 14:24:04 +0000 (16:24 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 25 Jul 2011 03:28:57 +0000 (23:28 -0400)
commite104119d4c0ba53fb08fd72489e7577e3ec6d1c8
tree4d6f3406ec1e44759cf7bea43957f11a8db04892
parentcbda795db4bbfe689a35082ea71cfbab48677a28
ahci: rework init workflow & fix timeout handling

Rework init workflow to match suggestions in the ahci specs better,
especially remove the shortcut which tries to detect drives without
enabling FIS receiving.  This makes memory allocation a bit complicated
as we are using malloc_tmp() allocated memory now to probe the devices
so we can free it when no drive is present.  In case we detect a drive
we have to free and realloc the memory with malloc_low() so it is
available after POST when the boot loader wants read stuff via int13.

Also use TSC to calculate timeout instead of delays and loop counts.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/ahci.c