qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: John Snow <jsnow@redhat.com>,
	qemu-block@nongnu.org, Benjamin David Lunt <fys@fysnet.net>,
	QEMU Developer <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] ide: fix DMA register transitions
Date: Wed, 3 Aug 2016 11:24:34 +0200	[thread overview]
Message-ID: <20160803092434.GA4629@noname.redhat.com> (raw)
In-Reply-To: <cab5b1c0-34ee-8aeb-db79-62165bcf5c5e@weilnetz.de>

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

Am 03.08.2016 um 07:06 hat Stefan Weil geschrieben:
> Am 03.08.2016 um 00:05 schrieb John Snow:
> > ATA8-APT defines the state transitions for both a host controller and
> > for the hardware device during the lifecycle of a DMA transfer, in
> > section 9.7 "DMA command protocol."
> > 
> > One of the interesting tidbits here is that when a device transitions
> > from DDMA0 ("Prepare state") to DDMA1 ("Data_Transfer State"), it can
> > choose to set either BSY or DRQ to signal this transition, but not both.
> > 
> > as ide_sector_dma_start is the last point in our preparation process
> > before we begin the real data transfer process (for either AHCI or BMDMA),
> > this is the correct transition point for DDMA0 to DDMA1.
> > 
> > I have chosen !BSY && DRQ for QEMU to make the transition from DDMA0 the
> > most obvious.
> > 
> > Reported-by: Benjamin David Lunt <fys@fysnet.net>
> > Signed-off-by: John Snow <jsnow@redhat.com>
> > ---
> >  hw/ide/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/ide/core.c b/hw/ide/core.c
> > index d117b7c..e961d42 100644
> > --- a/hw/ide/core.c
> > +++ b/hw/ide/core.c
> > @@ -907,7 +907,7 @@ eot:
> >  
> >  static void ide_sector_start_dma(IDEState *s, enum ide_dma_cmd dma_cmd)
> >  {
> > -    s->status = READY_STAT | SEEK_STAT | DRQ_STAT | BUSY_STAT;
> > +    s->status = READY_STAT | SEEK_STAT | DRQ_STAT;
> >      s->io_buffer_size = 0;
> >      s->dma_cmd = dma_cmd;
> 
> 
> This patch fixes the reported test case, thank you.
> 
> Tested-by: Stefan Weil <sw@weilnetz.de>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>

Benjamin, you'll still want to fix your driver code. If John had chosen
BSY && !DRQ, which is an equally valid option, qemu would be working
correctly, but your test case would still hang.

Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2016-08-03  9:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 22:05 [Qemu-devel] [PATCH] ide: fix DMA register transitions John Snow
2016-08-03  5:06 ` Stefan Weil
2016-08-03  9:24   ` Kevin Wolf [this message]
2016-08-03 13:19     ` John Snow
2016-08-03 16:34       ` Stefan Weil
2016-08-04 18:33 ` John Snow

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=20160803092434.GA4629@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=fys@fysnet.net \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).