[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/5] libqos/ahci: improve ahci_port_check_error()
From: |
Niklas Cassel |
Subject: |
[PATCH 4/5] libqos/ahci: improve ahci_port_check_error() |
Date: |
Thu, 8 Jun 2023 17:15:27 +0200 |
From: Niklas Cassel <niklas.cassel@wdc.com>
Improve ahci_port_check_error() to also assert that PxIS.TFES is set when
expecting errors.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
---
tests/qtest/libqos/ahci.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/qtest/libqos/ahci.c b/tests/qtest/libqos/ahci.c
index 644ed7e79f..b216f61f14 100644
--- a/tests/qtest/libqos/ahci.c
+++ b/tests/qtest/libqos/ahci.c
@@ -409,13 +409,19 @@ void ahci_port_check_error(AHCIQState *ahci, AHCICommand
*cmd)
uint8_t port = cmd->port;
uint32_t reg;
- /* The upper 9 bits of the IS register all indicate errors. */
- reg = ahci_px_rreg(ahci, port, AHCI_PX_IS);
- reg &= ~cmd->interrupts;
- reg >>= 23;
- g_assert_cmphex(reg, ==, 0);
+ /* If expecting TF error, ensure that TFES is set. */
+ if (cmd->errors) {
+ reg = ahci_px_rreg(ahci, port, AHCI_PX_IS);
+ ASSERT_BIT_SET(reg, AHCI_PX_IS_TFES);
+ } else {
+ /* The upper 9 bits of the IS register all indicate errors. */
+ reg = ahci_px_rreg(ahci, port, AHCI_PX_IS);
+ reg &= ~cmd->interrupts;
+ reg >>= 23;
+ g_assert_cmphex(reg, ==, 0);
+ }
- /* The Sata Error Register should be empty. */
+ /* The Sata Error Register should be empty, even when expecting TF error.
*/
reg = ahci_px_rreg(ahci, port, AHCI_PX_SERR);
g_assert_cmphex(reg, ==, 0);
--
2.40.1
- [PATCH 0/5] improve ahci test suite, Niklas Cassel, 2023/06/08
- [PATCH 1/5] libqos/ahci: fix ahci_command_wait(), Niklas Cassel, 2023/06/08
- [PATCH 2/5] libqos/ahci: fix ahci_port_check_nonbusy(), Niklas Cassel, 2023/06/08
- [PATCH 3/5] libqos/ahci: simplify ahci_port_check_error(), Niklas Cassel, 2023/06/08
- [PATCH 4/5] libqos/ahci: improve ahci_port_check_error(),
Niklas Cassel <=
- [PATCH 5/5] libqos/ahci: perform mandatory error recovery on error, Niklas Cassel, 2023/06/08
- Re: [PATCH 0/5] improve ahci test suite, John Snow, 2023/06/08