- Fixed timeouts while waiting for an IRQ. The daemon stopped ticking
commit50d0379078fc80efac2127466805b477cd784a07
authorneil <neil@fb15a70f-31f2-0310-bbcc-cdcc74a49acc>
Wed, 26 Feb 2014 04:22:45 +0000 (26 04:22 +0000)
committerneil <neil@fb15a70f-31f2-0310-bbcc-cdcc74a49acc>
Wed, 26 Feb 2014 04:22:45 +0000 (26 04:22 +0000)
tree869a01a6adb77d2be86ecd01dc98d88b8bc96f8c
parent7c60ffb9bb0a6a150a5dbf318bf09f22677dc03c
 - Fixed timeouts while waiting for an IRQ. The daemon stopped ticking
   as soon as any bus task was waiting during a tick. This was because
   the daemon sent the internal medium-change-check command
   (HD_SCSICMD+1) to every bus task on every tick, and waited for each
   to finish. When this command was sent to the bus task that was
   already waiting, a deadlock resulted. The deadlock could only be
   resolved by the arrival of the IRQ that the bus task was waiting for.
   But if the IRQ did not arrive, the driver locked up permanently; i.e.
   there was no effective timeout mechanism. There were also no checks
   for media changes while the daemon was deadlocked. To solve these
   problems, timeouts are now implemented by the bus tasks themselves
   rather than the daemon.

 - Instead of using polling for Identify commands, use an IRQ as
   normal but with a short timeout (1 second). This appears to be more
   reliable (bearing in mind that Identify commands may be sent to
   either real or phantom drives).

 - Call interrupt handler "manually" if we timeout while waiting for it
   (for real drives that don't produce an IRQ when their Identify
   command is complete).

 - Set an error if we were expecting to transfer data using PIO as a
   result of an interrupt but none is available (ATAF_DATAREQ is unset).

 - Removed check for empty Identify data (obsoleted by previous
   change in this list: Identify command will now fail instead).

 - Replaced a 100ns delay with the standard 400ns delay in the first
   device selection.

 - Set two obsolete bits in the DevHead register that may be needed for
   very old drives.

 - Added unit number to more interrupt handler debug messages.

 - Changed confusing/misleading comments.

git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@48823 fb15a70f-31f2-0310-bbcc-cdcc74a49acc
rom/devs/ata/ata.c
rom/devs/ata/ata.conf
rom/devs/ata/ata.h
rom/devs/ata/bus_class.c
rom/devs/ata/lowlevel.c
rom/devs/ata/waitto.c