Patchwork [2/3] ide: also reset io_buffer_index for writes

login
register
mail settings
Submitter Christoph Hellwig
Date Dec. 20, 2010, 12:45 p.m.
Message ID <20101220124558.GA6423@lst.de>
Download mbox | patch
Permalink /patch/76202/
State New
Headers show

Comments

Christoph Hellwig - Dec. 20, 2010, 12:45 p.m.
Currenly the code only resets the io_buffer_index field for reads,
but the code seems to expect this for all types of I/O.  I guess
we simply don't hit large enough transfers that would require this
often enough.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Patch

Index: qemu/hw/ide/core.c
===================================================================
--- qemu.orig/hw/ide/core.c	2010-12-17 12:03:27.737004194 +0100
+++ qemu/hw/ide/core.c	2010-12-17 12:03:41.485004404 +0100
@@ -521,8 +521,7 @@  void ide_dma_cb(void *opaque, int ret)
 
     /* launch next transfer */
     n = s->nsector;
-    if (s->is_read)
-        s->io_buffer_index = 0;
+    s->io_buffer_index = 0;
     s->io_buffer_size = n * 512;
     if (s->bus->dma->ops->prepare_buf(s->bus->dma, s->is_read) == 0)
         goto eot;