From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUsPw-0005dT-MF for qemu-devel@nongnu.org; Wed, 03 Aug 2016 05:24:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUsPu-00036R-KX for qemu-devel@nongnu.org; Wed, 03 Aug 2016 05:24:47 -0400 Date: Wed, 3 Aug 2016 11:24:34 +0200 From: Kevin Wolf Message-ID: <20160803092434.GA4629@noname.redhat.com> References: <1470175541-19344-1-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] ide: fix DMA register transitions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: John Snow , qemu-block@nongnu.org, Benjamin David Lunt , QEMU Developer , Paolo Bonzini --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 03.08.2016 um 07:06 hat Stefan Weil geschrieben: > Am 03.08.2016 um 00:05 schrieb John Snow: > > ATA8-APT defines the state transitions for both a host controller and > > for the hardware device during the lifecycle of a DMA transfer, in > > section 9.7 "DMA command protocol." > >=20 > > One of the interesting tidbits here is that when a device transitions > > from DDMA0 ("Prepare state") to DDMA1 ("Data_Transfer State"), it can > > choose to set either BSY or DRQ to signal this transition, but not both. > >=20 > > as ide_sector_dma_start is the last point in our preparation process > > before we begin the real data transfer process (for either AHCI or BMDM= A), > > this is the correct transition point for DDMA0 to DDMA1. > >=20 > > I have chosen !BSY && DRQ for QEMU to make the transition from DDMA0 the > > most obvious. > >=20 > > Reported-by: Benjamin David Lunt > > Signed-off-by: John Snow > > --- > > hw/ide/core.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/hw/ide/core.c b/hw/ide/core.c > > index d117b7c..e961d42 100644 > > --- a/hw/ide/core.c > > +++ b/hw/ide/core.c > > @@ -907,7 +907,7 @@ eot: > > =20 > > static void ide_sector_start_dma(IDEState *s, enum ide_dma_cmd dma_cmd) > > { > > - s->status =3D READY_STAT | SEEK_STAT | DRQ_STAT | BUSY_STAT; > > + s->status =3D READY_STAT | SEEK_STAT | DRQ_STAT; > > s->io_buffer_size =3D 0; > > s->dma_cmd =3D dma_cmd; >=20 >=20 > This patch fixes the reported test case, thank you. >=20 > Tested-by: Stefan Weil Reviewed-by: Kevin Wolf Benjamin, you'll still want to fix your driver code. If John had chosen BSY && !DRQ, which is an equally valid option, qemu would be working correctly, but your test case would still hang. Kevin --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXobhSAAoJEH8JsnLIjy/WeiEP/jZrA24ophtmWNoso6+FjJzJ UH795hgtfYYoQFL3AnCDDydIqIIXDzNQWsGvgjjYa0MLRuj0RcZ6jHSXlAO4/VAg Tf9JcKgP2G1pdQRU6psY53330LifJcl6rHBXlHCcfgtRDT21jz9Gxmjjse84+xlZ t8pdrQDs5DYrKA0CzvUza+W1n97w3Mz3Wu8oiSr0OmcI1PUsaa8FWI0sqztbOqOy TMYA16K9HT880Pfai48zIFRBrrCiDWxLCmv3wcW49YQkR1zWtn4s+t4QHd01rXTM Kwl4R3RSzFETgDRBO6AlrCbuuUIKj4NpCkvbh0bE8aXYptPEVwHzvA7HrDK666HN BYY6bDxl496F2WJqwwLMktCOO3ESd4JjcQztBp8nOLaxY+JNo7d1fqqd7x/aQk9z sEfth6k4CCoQe5n5wJ5vhQmFxA5aGauCIUJTWNeJ7CctpC1zqhLkiaKhn6/H5vqx C1iNWQ9R4qwdWVuhjVW6mo//kz9dsWFs6wJLmwAONik/SSbMfILzPPyWG14YNCDU NTekmjWWthSWAfpEF50bQxbm+zeaGM6/QfD4YDNjmAE88rtKFcK7e7/wjLDsM9jH kN340YDrQS7vwWZvG5kzj7hzi9gyPvafm27KuOV5y13uc1Vga4sZwUt7szg1KRjs 491BiylRXEweyTDfmCtx =egqm -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s--