From patchwork Mon Dec 20 12:45:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 76202 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A1160B6EED for ; Mon, 20 Dec 2010 23:47:11 +1100 (EST) Received: from localhost ([127.0.0.1]:39267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUf8r-00071r-SH for incoming@patchwork.ozlabs.org; Mon, 20 Dec 2010 07:47:05 -0500 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 To: qemu-devel@nongnu.org Message-ID: <20101220124558.GA6423@lst.de> References: <20101220124548.GA6395@lst.de> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <20101220124548.GA6395@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 2/3] ide: also reset io_buffer_index for writes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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;