summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-01-12 10:38:08 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-01-12 10:38:08 +0000
commitcf57c2f18b4fc7d9207d5321be18ddab214965bb (patch)
treeb2191ee983aa072c38c319554cfb3474a3d20df3 /hw
parent7b8a354d4716ab2c201fad04c22b8d4a16a1b8c6 (diff)
parentc5620e658e4061ac1bd51377966590d5aca2ad05 (diff)
downloadfocaccia-qemu-cf57c2f18b4fc7d9207d5321be18ddab214965bb.tar.gz
focaccia-qemu-cf57c2f18b4fc7d9207d5321be18ddab214965bb.zip
Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging
# gpg: Signature made Mon 11 Jan 2016 19:16:27 GMT using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"

* remotes/jnsnow/tags/ide-pull-request:
  libqos/ahci: organize header
  qtest/ahci: ATAPI data tests
  libqos/ahci: add ahci_exec
  libqos/ahci: allow nondata commands for ahci_io variants
  libqos: allow zero-size allocations
  libqos/ahci: Switch to mutable properties
  libqos/ahci: ATAPI identify
  libqos/ahci: ATAPI support
  ahci-test: fix memory leak
  ide: ahci: reset ncq object to unused on error
  macio: fix overflow in lba to offset conversion for ATAPI devices

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/ide/ahci.c1
-rw-r--r--hw/ide/macio.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index dd1912e80d..17f1cbd930 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *ncq_tfs)
     ide_state->error = ABRT_ERR;
     ide_state->status = READY_STAT | ERR_STAT;
     ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag);
+    ncq_tfs->used = 0;
 }
 
 static void ncq_finish(NCQTransferState *ncq_tfs)
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 97712619cd..d4031b65e4 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -280,7 +280,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
     }
 
     /* Calculate current offset */
-    offset = (int64_t)(s->lba << 11) + s->io_buffer_index;
+    offset = ((int64_t)s->lba << 11) + s->io_buffer_index;
 
     pmac_dma_read(s->blk, offset, io->len, pmac_ide_atapi_transfer_cb, io);
     return;