• Tejun Heo's avatar
    libahci: fix result_tf handling after an ATA PIO data-in command · 6ad60195
    Tejun Heo authored
    ATA devices don't send D2H Reg FIS after an successful ATA PIO data-in
    command.  The host is supposed to take the TF and E_Status of the
    preceding PIO Setup FIS.  Update ahci_qc_fill_rtf() such that it takes
    TF + E_Status from PIO Setup FIS after a successful ATA PIO data-in
    command.
    
    Without this patch, result_tf for such a command is filled with the
    content of the previous D2H Reg FIS which belongs to a previous
    command, which can make the command incorrectly seen as failed.
    
    * Patch updated to grab the whole TF + E_Status from PIO Setup FIS
      instead of just E_Status as suggested by Robert Hancock.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Reported-by: default avatarMark Lord <kernel@teksavvy.com>
    Cc: Robert Hancock <hancockrwd@gmail.com>
    Cc: stable@kernel.org
    Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
    6ad60195
ahci.h 12.8 KB