From 341f3168d05a4d019a72d85a08ddd1b3a5ed488b Mon Sep 17 00:00:00 2001
From: John Snow <jsnow@redhat.com>
Date: Fri, 14 Nov 2014 22:07:22 +0100
Subject: [PATCH 34/48] ide: remove wrong setting of BM_STATUS_INT

Message-id: <1416002855-4964-8-git-send-email-jsnow@redhat.com>
Patchwork-id: 62395
O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH v2 07/20] ide: remove wrong setting of BM_STATUS_INT
Bugzilla: 1024599
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

From: Paolo Bonzini <pbonzini@redhat.com>

Similar to the case removed in commit 69c38b8 (ide/core: Remove explicit
setting of BM_STATUS_INT, 2011-05-19), the only remaining use of
add_status(..., BM_STATUS_INT) is for short PRDs.  The flag should
not be raised in this case.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 0def37baf9add908c5462b0b8e2d3f80b563a9f9)
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/ide/ahci.c  | 7 ++-----
 hw/ide/atapi.c | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 9d621e1..f2e10e2 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1104,13 +1104,10 @@ static int ahci_dma_set_unit(IDEDMA *dma, int unit)
 
 static int ahci_dma_add_status(IDEDMA *dma, int status)
 {
+#ifdef AHCI_DEBUG
     AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
     DPRINTF(ad->port_no, "set status: %x\n", status);
-
-    if (status & BM_STATUS_INT) {
-        ahci_trigger_irq(ad->hba, ad, PORT_IRQ_STAT_DSS);
-    }
-
+#endif
     return 0;
 }
 
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index d13395e..46ed3f5 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -355,7 +355,6 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)
 
 eot:
     bdrv_acct_done(s->bs, &s->acct);
-    s->bus->dma->ops->add_status(s->bus->dma, BM_STATUS_INT);
     ide_set_inactive(s);
 }
 
-- 
1.8.3.1