[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [RFC] ide: fix bmdma underflow code
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [RFC] ide: fix bmdma underflow code |
Date: |
Wed, 1 Jul 2015 11:18:37 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Jun 29, 2015 at 04:16:06PM -0400, John Snow wrote:
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 8c271cc..6bcf07c 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -716,8 +716,8 @@ static void ide_dma_cb(void *opaque, int ret)
>
> sector_num = ide_get_sector(s);
> if (n > 0) {
> - assert(s->io_buffer_size == s->sg.size);
> - dma_buf_commit(s, s->io_buffer_size);
> + assert(s->nsector * 512 == s->sg.size);
The short PRDT case:
nsector = 2 sectors
PRD length = 1 sector
After prepare_buf() io_buffer_size = 1 sector and sg.size = 1 sector.
When ide_dma_cb() is called again:
nsector = 2 sectors
sg.size = 1 sector
So this assertion fails?
The assertion can be dropped.
Anyway, I think this change is good. Previously, IDE DMA transferred
the full PRDT and then completed the request. Now it only transfers the
capped PRDT.
pgpbN1uDaKU0j.pgp
Description: PGP signature
- Re: [Qemu-block] [RFC] ide: fix bmdma underflow code,
Stefan Hajnoczi <=