From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSTGz-00060z-6m for qemu-devel@nongnu.org; Fri, 12 Sep 2014 12:00:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSTGs-0002A8-5f for qemu-devel@nongnu.org; Fri, 12 Sep 2014 12:00:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSTGr-0002A1-Un for qemu-devel@nongnu.org; Fri, 12 Sep 2014 12:00:26 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8CG0O83007024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 12 Sep 2014 12:00:24 -0400 From: John Snow Date: Fri, 12 Sep 2014 12:00:09 -0400 Message-Id: <1410537609-14959-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 1/1] ide/atapi: Mark non-data commands as complete List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, jsnow@redhat.com, stefanha@redhat.com When the command completion code in IDE and AHCI was unified to put all command completion inside of a callback, "cmd_done," we neglected to ensure that all AHCI/ATAPI command paths would eventually register as finished. for the PCI interface to IDE this is not a problem because cmd_done is a nop, but the AHCI implementation needs to send a D2H_REG_FIS and interrupt back to the guest to inform of completion. This patch adds calls to ide_set_inactive, which calls ide_cmd_done, inside of ide_atapi_cmd_ok and ide_atapi_cmd_error. This fixes regressions observed by trying to boot QEMU with a Fedora 20 live CD under Q35/AHCI, which uses ATAPI command 0x00, which is a status check that may cause a hang because we never complete, and ATAPI command 0x56, which is unsupported by our current implementation and results in an error that we never report back to the guest. Signed-off-by: John Snow --- hw/ide/atapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 3d92b52..3e9ad7b 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -134,6 +134,7 @@ void ide_atapi_cmd_ok(IDEState *s) s->error = 0; s->status = READY_STAT | SEEK_STAT; s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD; + ide_set_inactive(s, false); ide_set_irq(s->bus); } @@ -147,6 +148,7 @@ void ide_atapi_cmd_error(IDEState *s, int sense_key, int asc) s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO | ATAPI_INT_REASON_CD; s->sense_key = sense_key; s->asc = asc; + ide_set_inactive(s, false); ide_set_irq(s->bus); } -- 1.9.3