From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUJ4w-0005cs-HG for qemu-devel@nongnu.org; Wed, 08 Jun 2011 09:46:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUJ4p-0008TN-O3 for qemu-devel@nongnu.org; Wed, 08 Jun 2011 09:45:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUJ4p-0008ST-3H for qemu-devel@nongnu.org; Wed, 08 Jun 2011 09:45:43 -0400 From: Kevin Wolf Date: Wed, 8 Jun 2011 15:48:19 +0200 Message-Id: <1307540910-12398-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1307540910-12398-1-git-send-email-kwolf@redhat.com> References: <1307540910-12398-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 01/12] ide/core: Remove explicit setting of BM_STATUS_INT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org BM_STATUS_INT is automatically set during ide_set_irq(), there's no reason to set it manually in addition. There is even one case where the interrupt status bit was set, but no IRQ was raised. This is when the PRD table was reached but there is more data to transfer. The correct behaviour for this case is not to set BM_STATUS_INT. Signed-off-by: Kevin Wolf --- hw/ide/core.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 45410e8..95beb17 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -430,7 +430,6 @@ void ide_dma_error(IDEState *s) s->error = ABRT_ERR; s->status = READY_STAT | ERR_STAT; ide_set_inactive(s); - s->bus->dma->ops->add_status(s->bus->dma, BM_STATUS_INT); ide_set_irq(s->bus); } @@ -500,8 +499,11 @@ handle_rw_error: n = s->nsector; 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) + if (s->bus->dma->ops->prepare_buf(s->bus->dma, s->is_read) == 0) { + /* The PRDs were too short. Reset the Active bit, but don't raise an + * interrupt. */ goto eot; + } #ifdef DEBUG_AIO printf("ide_dma_cb: sector_num=%" PRId64 " n=%d, is_read=%d\n", @@ -523,7 +525,6 @@ handle_rw_error: return; eot: - s->bus->dma->ops->add_status(s->bus->dma, BM_STATUS_INT); ide_set_inactive(s); } -- 1.7.5.2