From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmjoL-0005D2-7R for qemu-devel@nongnu.org; Mon, 16 Jan 2012 05:29:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmjoK-0008De-2f for qemu-devel@nongnu.org; Mon, 16 Jan 2012 05:29:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmjoJ-0008Da-Nt for qemu-devel@nongnu.org; Mon, 16 Jan 2012 05:29:08 -0500 Message-ID: <4F13FCBE.1050006@redhat.com> Date: Mon, 16 Jan 2012 11:32:30 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1326613915-3282-1-git-send-email-hpoussin@reactos.org> <1326613915-3282-10-git-send-email-hpoussin@reactos.org> In-Reply-To: <1326613915-3282-10-git-send-email-hpoussin@reactos.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 09/10] fdc: fix seek command, which shouldn't check tracks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= Cc: qemu-devel@nongnu.org Am 15.01.2012 08:51, schrieb Herv=C3=A9 Poussineau: > The seek command just sends step pulses to the drive and doesn't care i= f > there is a medium inserted of if it is banging the head against the dri= ve. >=20 > Signed-off-by: Herv=C3=A9 Poussineau > --- > hw/fdc.c | 13 ++++++------- > 1 files changed, 6 insertions(+), 7 deletions(-) >=20 > diff --git a/hw/fdc.c b/hw/fdc.c > index 685ea88..61d70eb 100644 > --- a/hw/fdc.c > +++ b/hw/fdc.c > @@ -1599,13 +1599,12 @@ static void fdctrl_handle_seek(FDCtrl *fdctrl, = int direction) > SET_CUR_DRV(fdctrl, fdctrl->fifo[1] & FD_DOR_SELMASK); > cur_drv =3D get_cur_drv(fdctrl); > fdctrl_reset_fifo(fdctrl); > - if (fdctrl->fifo[2] > cur_drv->max_track) { > - fdctrl_raise_irq(fdctrl, FD_SR0_ABNTERM | FD_SR0_SEEK); > - } else { > - cur_drv->track =3D fdctrl->fifo[2]; > - /* Raise Interrupt */ > - fdctrl_raise_irq(fdctrl, FD_SR0_SEEK); > - } > + /* The seek command just sends step pulses to the drive and doesn'= t care if > + * there is a medium inserted of if it's banging the head against = the drive. > + */ > + cur_drv->track =3D fdctrl->fifo[2]; Do you really want to update this with an invalid value? This value is used in other places without being checked again against max_track. > + /* Raise Interrupt */ > + fdctrl_raise_irq(fdctrl, FD_SR0_SEEK); > } > =20 > static void fdctrl_handle_perpendicular_mode(FDCtrl *fdctrl, int direc= tion) Kevin