Skip to content
  • Niklas Cassel's avatar
    7e85cb0d
    hw/ide/ahci: fix ahci_write_fis_sdb() · 7e85cb0d
    Niklas Cassel authored
    
    
    When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1,
    5.3.13.1 SDB:Entry.
    
    If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise
    a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or
    not.
    
    Thus, we should never raise a normal IRQ after having sent an error IRQ.
    
    It is valid to signal successfully completed commands as finished in the
    same SDB FIS that generates the error IRQ. The important thing is that
    commands that did not complete successfully (e.g. commands that were
    aborted, do not get the finished bit set).
    
    Before this commit, there was never a TFES IRQ raised on NCQ error.
    
    Signed-off-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20230609140844.202795-8-nks@flawful.org
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
    7e85cb0d
    hw/ide/ahci: fix ahci_write_fis_sdb()
    Niklas Cassel authored
    
    
    When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1,
    5.3.13.1 SDB:Entry.
    
    If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise
    a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or
    not.
    
    Thus, we should never raise a normal IRQ after having sent an error IRQ.
    
    It is valid to signal successfully completed commands as finished in the
    same SDB FIS that generates the error IRQ. The important thing is that
    commands that did not complete successfully (e.g. commands that were
    aborted, do not get the finished bit set).
    
    Before this commit, there was never a TFES IRQ raised on NCQ error.
    
    Signed-off-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20230609140844.202795-8-nks@flawful.org
    Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
Loading