From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGyAa-0001hB-Ou for qemu-devel@nongnu.org; Fri, 21 Feb 2014 17:02:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGyAW-0005ss-2Q for qemu-devel@nongnu.org; Fri, 21 Feb 2014 17:02:08 -0500 Received: from mout.gmx.net ([212.227.17.21]:59564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGyAV-0005sk-OR for qemu-devel@nongnu.org; Fri, 21 Feb 2014 17:02:04 -0500 Received: from [192.168.1.24] ([90.38.117.132]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M7Yhz-1XA39r1C2p-00xHPt for ; Fri, 21 Feb 2014 23:02:00 +0100 Message-ID: <5307CD31.1020206@caramail.com> Date: Fri, 21 Feb 2014 23:03:29 +0100 From: Olivier Danet MIME-Version: 1.0 References: <53014626.20009@caramail.com> <5305C3B2.7020800@ilande.co.uk> In-Reply-To: <5305C3B2.7020800@ilande.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Sun4m : SCSI ESP controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland , pbonzini@redhat.com Cc: Blue Swirl , qemu-devel , Artyom Tarasenko On 20/02/2014 09:58, Mark Cave-Ayland wrote: > On 16/02/14 23:13, Olivier Danet wrote: > >> Two small fixes for the ESP (AM53C94) SCSI controller >> >> * Signal the end of the DMA transfer after a SCSI command. >> >> * The status register (RSTAT) is cleared after reading the interrupt >> status register (RINTR), except for the TC bit (=Count To Zero) and the >> scsi phase bits, which mirror SCSI signals levels. >> >> Fixes the bug "esp0: !TC on DATA XFER" with NetBSD >> https://bugs.launchpad.net/qemu/+bug/1055090 >> >> Signed-off-by: Olivier Danet >> --- >> hw/scsi/esp.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c >> index 2d150bf..5e91077 100644 >> --- a/hw/scsi/esp.c >> +++ b/hw/scsi/esp.c >> @@ -246,6 +246,7 @@ static void esp_do_dma(ESPState *s) >> s->cmdlen = 0; >> s->do_cmd = 0; >> do_cmd(s, s->cmdbuf); >> + esp_dma_done(s); >> return; >> } >> if (s->async_len == 0) { >> @@ -417,10 +418,9 @@ uint64_t esp_reg_read(ESPState *s, uint32_t saddr) >> except TC */ >> old_val = s->rregs[ESP_RINTR]; >> s->rregs[ESP_RINTR] = 0; >> - s->rregs[ESP_RSTAT] &= ~STAT_TC; >> s->rregs[ESP_RSEQ] = SEQ_CD; >> esp_lower_irq(s); >> - >> + s->rregs[ESP_RSTAT] &= STAT_TC | STAT_MI; >> return old_val; >> default: >> break; > > Hi Olivier, > > I've applied the non-whitespace damaged patch (attached) but > unfortunately I still see the "!TC on DATA XFER" bug with my NetBSD 5 > ISO under qemu-system-sparc :/ Note that the second part of the patch > showed some fuzz so I'm wondering if this patch is complete or whether > part of it is still missing? > > Also ESP patches should have an esp or scsi/esp prefix in the subject > line and should CC the current SCSI maintainer (see MAINTAINERS file) > which is currently Paolo. > > > HTH, > > Mark. I don't get these errors installing NetBSD 5 (tried 5.02 & 5.1). With NetBSD 6, the patch makes a lot of difference : http://temlib.org/pub/qemu_tc_patch.png http://temlib.org/pub/qemu_tc_nopatch.png (the default terminal during install is terrible) * The dma() part is a coherence bug in the ESP driver which does not update the DMA registers after a command transfer. * The RINTR part makes the driver match more closely the datasheet: http://sensi.org/download/doc/am53c94.pdf Page 19/63 These modifications are not particularly tailored for NetBSD nor SPARCs. Olivier (Sorry about the whitespaces, I will try to find out the cause !)