From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYiG2-00075i-SC for qemu-devel@nongnu.org; Wed, 14 Nov 2012 14:04:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYiFz-00064O-OH for qemu-devel@nongnu.org; Wed, 14 Nov 2012 14:04:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYiFz-00062l-Ev for qemu-devel@nongnu.org; Wed, 14 Nov 2012 14:04:15 -0500 From: Kevin Wolf Date: Wed, 14 Nov 2012 19:47:16 +0100 Message-Id: <1352918847-3696-16-git-send-email-kwolf@redhat.com> In-Reply-To: <1352918847-3696-1-git-send-email-kwolf@redhat.com> References: <1352918847-3696-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 15/26] fdc: fix FD_SR0_SEEK for non-DMA transfers and multi sectors transfers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Herv=C3=A9 Poussineau On non-DMA transfers, fdctrl_stop_transfer() used to set FD_SR0_SEEK no matter if there actually was a seek or not. This is obviously wrong. fdctrl_seek_to_next_sect() has this information because it performs the seek itself. Signed-off-by: Herv=C3=A9 Poussineau Signed-off-by: Kevin Wolf --- hw/fdc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index 7e4b0ce..e47050f 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -1123,11 +1123,13 @@ static int fdctrl_seek_to_next_sect(FDCtrl *fdctr= l, FDrive *cur_drv) } else { new_head =3D 0; new_track++; + fdctrl->status0 |=3D FD_SR0_SEEK; if ((cur_drv->flags & FDISK_DBL_SIDES) =3D=3D 0) { ret =3D 0; } } } else { + fdctrl->status0 |=3D FD_SR0_SEEK; new_track++; ret =3D 0; } @@ -1458,7 +1460,7 @@ static uint32_t fdctrl_read_data(FDCtrl *fdctrl) * then from status mode to command mode */ if (fdctrl->msr & FD_MSR_NONDMA) { - fdctrl_stop_transfer(fdctrl, FD_SR0_SEEK, 0x00, 0x00); + fdctrl_stop_transfer(fdctrl, 0x00, 0x00, 0x00); } else { fdctrl_reset_fifo(fdctrl); fdctrl_reset_irq(fdctrl); @@ -1922,7 +1924,7 @@ static void fdctrl_write_data(FDCtrl *fdctrl, uint3= 2_t value) * then from status mode to command mode */ if (fdctrl->data_pos =3D=3D fdctrl->data_len) - fdctrl_stop_transfer(fdctrl, FD_SR0_SEEK, 0x00, 0x00); + fdctrl_stop_transfer(fdctrl, 0x00, 0x00, 0x00); return; } if (fdctrl->data_pos =3D=3D 0) { --=20 1.7.6.5