From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60545 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTfQ-0000uP-Te for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:09:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhTfO-0007Mr-HK for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:09:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhTfO-0007Mg-7p for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:09:38 -0500 From: Kevin Wolf Date: Mon, 24 Jan 2011 22:10:36 +0100 Message-Id: <1295903452-18017-8-git-send-email-kwolf@redhat.com> In-Reply-To: <1295903452-18017-1-git-send-email-kwolf@redhat.com> References: <1295903452-18017-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 07/23] ide: also reset io_buffer_index for writes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Christoph Hellwig 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 Signed-off-by: Kevin Wolf --- hw/ide/core.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index e93dd46..12b9c53 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -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; -- 1.7.2.3