From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBGbm-0006F0-1p for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBGbl-0003Ud-9G for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBGbl-0003UR-52 for qemu-devel@nongnu.org; Sat, 04 Jul 2015 02:07:25 -0400 From: John Snow Date: Sat, 4 Jul 2015 02:06:51 -0400 Message-Id: <1435990034-8945-13-git-send-email-jsnow@redhat.com> In-Reply-To: <1435990034-8945-1-git-send-email-jsnow@redhat.com> References: <1435990034-8945-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PULL 12/35] ahci/qtest: Execute IDENTIFY prior to data commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, jsnow@redhat.com If you try to execute an NCQ command before trying to engage with the device by issuing an IDENTIFY command, the error bits that are part of the signature will fool the test suite into thinking there was a failure. Issue IDENTIFY first on "boot", which will clear the signature out of the registers for us. Signed-off-by: John Snow Reviewed-by: Stefan Hajnoczi Message-id: 1435016308-6150-9-git-send-email-jsnow@redhat.com --- tests/ahci-test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 0a0ef2a..ee1dc20 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -228,6 +228,8 @@ static AHCIQState *ahci_boot_and_enable(const char *cli, ...) { AHCIQState *ahci; va_list ap; + uint16_t buff[256]; + uint8_t port; if (cli) { va_start(ap, cli); @@ -239,6 +241,10 @@ static AHCIQState *ahci_boot_and_enable(const char *cli, ...) ahci_pci_enable(ahci); ahci_hba_enable(ahci); + /* Initialize test device */ + port = ahci_port_select(ahci); + ahci_port_clear(ahci, port); + ahci_io(ahci, port, CMD_IDENTIFY, &buff, sizeof(buff), 0); return ahci; } -- 2.1.0