From patchwork Fri Dec 10 15:01:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 75103 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 4EB1CB7080 for ; Sat, 11 Dec 2010 02:15:02 +1100 (EST) Received: from localhost ([127.0.0.1]:51191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR4gU-0000qr-Qp for incoming@patchwork.ozlabs.org; Fri, 10 Dec 2010 10:14:58 -0500 Received: from [140.186.70.92] (port=47496 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR4TP-0001Nf-JY for qemu-devel@nongnu.org; Fri, 10 Dec 2010 10:01:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR4TO-0003pV-4a for qemu-devel@nongnu.org; Fri, 10 Dec 2010 10:01:27 -0500 Received: from verein.lst.de ([213.95.11.210]:55202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR4TN-0003pC-Qw for qemu-devel@nongnu.org; Fri, 10 Dec 2010 10:01:26 -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 oBAF1P88031181 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 10 Dec 2010 16:01:25 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-7.2) id oBAF1PGZ031180 for qemu-devel@nongnu.org; Fri, 10 Dec 2010 16:01:25 +0100 Date: Fri, 10 Dec 2010 16:01:25 +0100 From: Christoph Hellwig To: qemu-devel@nongnu.org Message-ID: <20101210150125.GE31114@lst.de> References: <20101210150038.GA30990@lst.de> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <20101210150038.GA30990@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 5/7] 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-10 11:35:23.164005731 +0100 +++ qemu/hw/ide/core.c 2010-12-10 11:35:30.471253949 +0100 @@ -605,8 +605,7 @@ static void ide_dma_cb(void *opaque, int /* 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 (dma_buf_prepare(bm, s->is_read) == 0) goto eot;