From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmiiO-0005dJ-2h for qemu-devel@nongnu.org; Fri, 07 Nov 2014 07:32:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmiiJ-0005l5-IH for qemu-devel@nongnu.org; Fri, 07 Nov 2014 07:32:32 -0500 Message-ID: <545CBBCA.9010608@redhat.com> Date: Fri, 07 Nov 2014 13:32:10 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1415362952-16047-1-git-send-email-hare@suse.de> In-Reply-To: <1415362952-16047-1-git-send-email-hare@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] esp-pci: fixup deadlock with linux List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke Cc: qemu-devel@nongnu.org, qemu-stable On 07/11/2014 13:22, Hannes Reinecke wrote: > 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 Applied, thanks. Paolo > --- > 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 82795e6..77b8647 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) >