qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: Kevin Wolf <kwolf@redhat.com>
Cc: phrdina@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] fdc: Fix false FD_SR0_SEEK
Date: Thu, 06 Sep 2012 21:17:41 +0200	[thread overview]
Message-ID: <5048F6D5.7050903@reactos.org> (raw)
In-Reply-To: <1346752016-3569-3-git-send-email-kwolf@redhat.com>

Kevin Wolf a écrit :
> 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 <kwolf@redhat.com>
> ---
>  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;
>  
>      cur_drv = get_cur_drv(fdctrl);
> -    fdctrl->status0 = status0 | FD_SR0_SEEK | (cur_drv->head << 2) |
> -                      GET_CUR_DRV(fdctrl);
> +    fdctrl->status0 = status0 | (cur_drv->head << 2) | GET_CUR_DRV(fdctrl);
>  
>      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 != FD_DIR_WRITE)
>          fdctrl->msr |= 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);
>  
>      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)
>      }
>  
>      st0 = floppy_recv();
> -    if (st0 != 0x60) {
> +    if (st0 != 0x40) {
>          ret = 1;
>      }
>  
>   

NACK for this patch.
It fixes the seek flags DMA transfers, but does not handles PIO transfer 
case.
I just sent a whole serie for floppy improvements on ML, with a fixed 
version of this patch.

Hervé

  reply	other threads:[~2012-09-06 19:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04  9:46 [Qemu-devel] [PATCH 0/3] fdc: Fix FD_SR0_SEEK flag Kevin Wolf
2012-09-04  9:46 ` [Qemu-devel] [PATCH 1/3] fdc: Remove status0 parameter from fdctrl_set_fifo() Kevin Wolf
2012-09-04  9:46 ` [Qemu-devel] [PATCH 2/3] fdc: Fix false FD_SR0_SEEK Kevin Wolf
2012-09-06 19:17   ` Hervé Poussineau [this message]
2012-09-04  9:46 ` [Qemu-devel] [PATCH 3/3] fdc-test: Check READ ID Kevin Wolf
2012-09-05  9:28 ` [Qemu-devel] [PATCH 0/3] fdc: Fix FD_SR0_SEEK flag Pavel Hrdina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5048F6D5.7050903@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=kwolf@redhat.com \
    --cc=phrdina@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).