From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38412 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUf7q-0006w6-9k for qemu-devel@nongnu.org; Mon, 20 Dec 2010 07:46:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUf7n-0007pg-VY for qemu-devel@nongnu.org; Mon, 20 Dec 2010 07:46:02 -0500 Received: from verein.lst.de ([213.95.11.210]:38323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUf7n-0007ov-MY for qemu-devel@nongnu.org; Mon, 20 Dec 2010 07:45:59 -0500 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id oBKCjwE5006436 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 20 Dec 2010 13:45:58 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-7.2) id oBKCjwHx006435 for qemu-devel@nongnu.org; Mon, 20 Dec 2010 13:45:58 +0100 Date: Mon, 20 Dec 2010 13:45:58 +0100 From: Christoph Hellwig Message-ID: <20101220124558.GA6423@lst.de> References: <20101220124548.GA6395@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101220124548.GA6395@lst.de> Subject: [Qemu-devel] [PATCH 2/3] 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: qemu-devel@nongnu.org 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 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;