From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZSAq-0000fR-UM for qemu-devel@nongnu.org; Fri, 26 Feb 2016 18:51:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZSAm-0001N4-T9 for qemu-devel@nongnu.org; Fri, 26 Feb 2016 18:51:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZSAm-0001MA-Np for qemu-devel@nongnu.org; Fri, 26 Feb 2016 18:51:48 -0500 References: <1456404332-31556-1-git-send-email-hpoussin@reactos.org> From: John Snow Message-ID: <56D0E512.8030606@redhat.com> Date: Fri, 26 Feb 2016 18:51:46 -0500 MIME-Version: 1.0 In-Reply-To: <1456404332-31556-1-git-send-email-hpoussin@reactos.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] i8257: fix Terminal Count status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Herv=c3=a9_Poussineau?= , qemu-devel@nongnu.org Cc: Paolo Bonzini , "Michael S. Tsirkin" On 02/25/2016 07:45 AM, Herv=C3=A9 Poussineau wrote: > When a DMA transfer is done (ie all bytes have been transfered), the co= rresponding > Terminal Count bit must be set in the status register. > This bit is already cleared in i8257_read_cont and i8257_write_cont whe= n required. >=20 > This fixes (at least) floppy transfer in IBM 40p firmware, which checks= in DMA > controller if everything went fine. >=20 > Signed-off-by: Herv=C3=A9 Poussineau > --- > hw/dma/i8257.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c > index 5a52707..6078893 100644 > --- a/hw/dma/i8257.c > +++ b/hw/dma/i8257.c > @@ -342,6 +342,10 @@ static void i8257_channel_run(I8257State *d, int i= chan) > r->now[COUNT], (r->base[COUNT] + 1) << nc= ont); > r->now[COUNT] =3D n; > ldebug ("dma_pos %d size %d\n", n, (r->base[COUNT] + 1) << ncont); > + if (n =3D=3D (r->base[COUNT] + 1) << ncont) { > + ldebug("transfer done\n"); > + d->status |=3D (1 << ichan); > + } > } > =20 > static void i8257_dma_run(void *opaque) >=20 As best as I can tell from the i8257 data sheet I found this seems to be correct, assuming the size calculation is correct (looks right, based on that existing ldebug print.) Reviewed-by: John Snow