[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 09/10] fdc: fix seek command, which shouldn't
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 09/10] fdc: fix seek command, which shouldn't check tracks |
Date: |
Mon, 16 Jan 2012 11:32:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 |
Am 15.01.2012 08:51, schrieb Hervé Poussineau:
> The seek command just sends step pulses to the drive and doesn't care if
> there is a medium inserted of if it is banging the head against the drive.
>
> Signed-off-by: Hervé Poussineau <address@hidden>
> ---
> hw/fdc.c | 13 ++++++-------
> 1 files changed, 6 insertions(+), 7 deletions(-)
>
> 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 = 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 = 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 = 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);
> }
>
> static void fdctrl_handle_perpendicular_mode(FDCtrl *fdctrl, int direction)
Kevin
- Re: [Qemu-devel] [PATCH v2 02/10] fdc: set busy bit when starting a command, (continued)
- [Qemu-devel] [PATCH v2 05/10] fdc: handle read-only floppies (abort early on write commands), Hervé Poussineau, 2012/01/15
- [Qemu-devel] [PATCH v2 06/10] fdc: add CCR (Configuration Control Register) write register, Hervé Poussineau, 2012/01/15
- [Qemu-devel] [PATCH v2 04/10] fdc: emulate stepping 0, Hervé Poussineau, 2012/01/15
- [Qemu-devel] [PATCH v2 07/10] block: add a transfer rate for floppy types, Hervé Poussineau, 2012/01/15
- [Qemu-devel] [PATCH v2 10/10] fdc: DIR (Digital Input Register) should return status of current drive..., Hervé Poussineau, 2012/01/15
- [Qemu-devel] [PATCH v2 08/10] fdc: check if media rate is correct before doing any transfer, Hervé Poussineau, 2012/01/15
- [Qemu-devel] [PATCH v2 09/10] fdc: fix seek command, which shouldn't check tracks, Hervé Poussineau, 2012/01/15
- Re: [Qemu-devel] [PATCH v2 09/10] fdc: fix seek command, which shouldn't check tracks,
Kevin Wolf <=