From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9haK-0004j5-9R for qemu-devel@nongnu.org; Thu, 06 Sep 2012 15:17:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9haF-0002HM-Sk for qemu-devel@nongnu.org; Thu, 06 Sep 2012 15:17:52 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:57973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9haF-0002Gl-Ay for qemu-devel@nongnu.org; Thu, 06 Sep 2012 15:17:47 -0400 Message-ID: <5048F6D5.7050903@reactos.org> Date: Thu, 06 Sep 2012 21:17:41 +0200 From: =?ISO-8859-1?Q?Herv=E9_Poussineau?= MIME-Version: 1.0 References: <1346752016-3569-1-git-send-email-kwolf@redhat.com> <1346752016-3569-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1346752016-3569-3-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] fdc: Fix false FD_SR0_SEEK List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: phrdina@redhat.com, qemu-devel@nongnu.org Kevin Wolf a =E9crit : > fdctrl_start/stop_transfer() used to set FD_SR0_SEEK no matter if > there actually was a seek or not. This is obviously wrong. > > fdctrl_start_transfer() has this information because it performs the > seek itself. fdctrl_stop_transfer() gets status0 passed and callers > already take care of setting FD_SR0_SEEK where appropriate. > > Signed-off-by: Kevin Wolf > --- > hw/fdc.c | 5 ++--- > tests/fdc-test.c | 2 +- > 2 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/hw/fdc.c b/hw/fdc.c > index 78ae064..8ea3341 100644 > --- a/hw/fdc.c > +++ b/hw/fdc.c > @@ -1149,8 +1149,7 @@ static void fdctrl_stop_transfer(FDCtrl *fdctrl, = uint8_t status0, > FDrive *cur_drv; > =20 > cur_drv =3D get_cur_drv(fdctrl); > - fdctrl->status0 =3D status0 | FD_SR0_SEEK | (cur_drv->head << 2) | > - GET_CUR_DRV(fdctrl); > + fdctrl->status0 =3D status0 | (cur_drv->head << 2) | GET_CUR_DRV(f= dctrl); > =20 > FLOPPY_DPRINTF("transfer status: %02x %02x %02x (%02x)\n", > status0, status1, status2, fdctrl->status0); > @@ -1284,7 +1283,7 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl,= int direction) > if (direction !=3D FD_DIR_WRITE) > fdctrl->msr |=3D FD_MSR_DIO; > /* IO based transfer: calculate len */ > - fdctrl_raise_irq(fdctrl, FD_SR0_SEEK); > + fdctrl_raise_irq(fdctrl, did_seek ? FD_SR0_SEEK : 0); > =20 > return; > } > diff --git a/tests/fdc-test.c b/tests/fdc-test.c > index fa74411..ff96560 100644 > --- a/tests/fdc-test.c > +++ b/tests/fdc-test.c > @@ -152,7 +152,7 @@ static uint8_t send_read_command(void) > } > =20 > st0 =3D floppy_recv(); > - if (st0 !=3D 0x60) { > + if (st0 !=3D 0x40) { > ret =3D 1; > } > =20 > =20 NACK for this patch. It fixes the seek flags DMA transfers, but does not handles PIO transfer=20 case. I just sent a whole serie for floppy improvements on ML, with a fixed=20 version of this patch. Herv=E9