]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/ide/ahci: fix ahci_write_fis_sdb()
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 9 Jun 2023 14:08:43 +0000 (16:08 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 10 Sep 2023 16:40:11 +0000 (19:40 +0300)
commit9c7e2253eba2e057f11377beb64dd78d12a1e27d
tree5dc6fc28db1fe8b41a33738ac966a1f134e6c6ed
parentf7cca09987983644d054fc4f4feb8414dcd624c5
hw/ide/ahci: fix ahci_write_fis_sdb()

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: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230609140844.202795-8-nks@flawful.org
Signed-off-by: John Snow <jsnow@redhat.com>
(cherry picked from commit 7e85cb0db4c693b4e084a00e66fe73a22ed1688a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/ide/ahci.c