From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9H02-0004Ge-Mi for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:36:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9Gzo-0006mF-Le for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:58 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:43750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Gzo-0006lU-8M for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:44 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 12:35:44 -0500 From: Michael Roth Date: Thu, 8 Jan 2015 11:34:01 -0600 Message-Id: <1420738472-23267-58-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 57/88] esp-pci: fixup deadlock with linux List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Hannes Reinecke A linux guest will be issuing messages: [ 32.124042] DC390: Deadlock in DataIn_0: DMA aborted unfinished: 000000 bytes remain!! [ 32.126348] DC390: DataIn_0: DMA State: 0 and the HBA will fail to work properly. Reason is the emulation is not setting the 'DMA transfer done' status correctly. Signed-off-by: Hannes Reinecke Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit c3543fb5fe4520f03dd4fef04fab7745eeca1c96) Signed-off-by: Michael Roth --- hw/scsi/esp-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index 9971bbf..32849bd 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -268,6 +268,8 @@ static void esp_pci_dma_memory_rw(PCIESPState *pci, uint8_t *buf, int len, /* update status registers */ pci->dma_regs[DMA_WBC] -= len; pci->dma_regs[DMA_WAC] += len; + if (pci->dma_regs[DMA_WBC] == 0) + pci->dma_regs[DMA_STAT] |= DMA_STAT_DONE; } static void esp_pci_dma_memory_read(void *opaque, uint8_t *buf, int len) -- 1.9.1