From patchwork Wed May 8 14:28:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 242594 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 65FFB2C0161 for ; Thu, 9 May 2013 00:50:46 +1000 (EST) Received: from localhost ([::1]:56761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua5hc-0007J8-I7 for incoming@patchwork.ozlabs.org; Wed, 08 May 2013 10:50:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua5hC-0007Di-8d for qemu-devel@nongnu.org; Wed, 08 May 2013 10:50:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ua5hA-00055l-GL for qemu-devel@nongnu.org; Wed, 08 May 2013 10:50:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua5Mp-0005MO-8W for qemu-devel@nongnu.org; Wed, 08 May 2013 10:29:15 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r48ETEht020791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 8 May 2013 10:29:14 -0400 Received: from dhcp-200-207.str.redhat.com (dhcp-192-246.str.redhat.com [10.33.192.246]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r48ET9QL021027; Wed, 8 May 2013 10:29:13 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Wed, 8 May 2013 16:28:57 +0200 Message-Id: <1368023344-29731-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1368023344-29731-1-git-send-email-kwolf@redhat.com> References: <1368023344-29731-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 03/10] ide: Reset BMIDEA bit when the bus master is stopped X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The device is supposed to reset the Bus Master IDE Active bit in the status register when 0 is written to the Start/Stop Bus Master bit in the command register. In the common cases this happens automatically because bdrv_drain_all() flushes the requests, but with a large PRDT it could remain set. Signed-off-by: Kevin Wolf --- hw/ide/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index a310975..635a364 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -312,6 +312,7 @@ void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val) bdrv_drain_all(); assert(bm->bus->dma->aiocb == NULL); } + bm->status &= ~BM_STATUS_DMAING; } else { bm->cur_addr = bm->addr; if (!(bm->status & BM_STATUS_DMAING)) {