All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Butsykin <pbutsykin@virtuozzo.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>,
	qemu-devel@nongnu.org
Cc: John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] ide: don't loose pending dma state
Date: Thu, 24 Mar 2016 18:11:15 +0300	[thread overview]
Message-ID: <56F40393.20505@virtuozzo.com> (raw)
In-Reply-To: <56F3F498.30809@redhat.com>

On 24.03.2016 17:07, Paolo Bonzini wrote:
>
>
> On 24/03/2016 14:38, Pavel Butsykin wrote:
>> Look at the ide_sector_read_cb function. The ->dma_cmd field is used
>> only for the DMA, we can't use the ide_cmd_is_read macro for PIO or
>> ATAPI. In fact, the ide_handle_rw_error looks like a generic function
>> and I do not see any good reason to move the handling of the dma_cmd
>> field(especially in the context of bug fixes).
>
> I agree now.
>
>>> However, if it works, using dma_cmd would be better than using the
>>> dma_cb.
>>>
>> We can't use the dma_cmd field to build the ATAPI ->error_status. Your
>> proposal is quite logical, but please look at the 3rd patch, there to
>> build ->error_status we can use the same dma_cb, it is very convenient.
>
> Couldn't you just add a new dma_cmd value IDE_DMA_ATAPI, and set it
> before every call to ide_start_dma(s, ide_atapi_cmd_read_dma_cb)?
>
You want something like this:
dma_cb()
{
...
     if (ret < 0) {
         if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s))) {
             return;
         }
     }
...
}

static void ide_bmdma_pre_save(void *opaque)
{
...
     if (!(bm->status & BM_STATUS_DMAING) && bm->dma_cb) {
         bm->bus->error_status = ide_dma_cmd_to_retry(bmdma_active_if(bm));
     }
...
}

??

> Thanks,
>
> Paolo
>

  reply	other threads:[~2016-03-24 15:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 10:26 [Qemu-devel] [PATCH for 2.6 0/3] ide: fix loss of the dma/atapi state during migration Denis V. Lunev
2016-03-23 10:26 ` [Qemu-devel] [PATCH 1/3] ide: don't loose pending dma state Denis V. Lunev
2016-03-23 20:34   ` Paolo Bonzini
2016-03-24  9:24     ` Pavel Butsykin
2016-03-24 11:23       ` Paolo Bonzini
2016-03-24 13:38         ` Pavel Butsykin
2016-03-24 14:07           ` Paolo Bonzini
2016-03-24 15:11             ` Pavel Butsykin [this message]
2016-03-24 15:12               ` Paolo Bonzini
2016-03-24 15:20                 ` Pavel Butsykin
2016-03-24 14:47       ` Eric Blake
2016-03-24 15:40         ` Pavel Butsykin
2016-03-30 17:35   ` John Snow
2016-03-30 17:38     ` Denis V. Lunev
2016-03-30 17:44       ` John Snow
2016-03-23 10:26 ` [Qemu-devel] [PATCH 2/3] ide: restart atapi dma by re-evaluating command packet Denis V. Lunev
2016-03-23 10:26 ` [Qemu-devel] [PATCH 3/3] ide: really restart pending and in-flight atapi dma Denis V. Lunev
2016-03-23 19:36   ` John Snow
2016-03-24  8:34     ` Pavel Butsykin

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=56F40393.20505@virtuozzo.com \
    --to=pbutsykin@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.