• Tejun Heo's avatar
    libata-eh: clear UNIT ATTENTION after reset · 11fc33da
    Tejun Heo authored
    Resets make ATAPI devices raise UNIT ATTENTION which fails the next
    command.  As resets can happen asynchronously for unrelated reasons,
    this sometimes disrupts innocent users.  For example, reading DVD
    fails after the system wakes up from suspend or the other device
    sharing the channel went through bus error.
    
    Clearing UA has some problems as it might clear UA which the userland
    needs to know about.  However, UA after resets can only be about the
    reset itself and benefits of clearing it overweights cons.  Missing UA
    can only delay failure to one of the following commands anyway.  For
    example, timeout while burning is in progress will trigger reset and
    reset the device state and probably corrupt the burning run.  Although
    the userland application won't get the UA, its pending writes will
    fail.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
    11fc33da
libata-eh.c 85.6 KB