[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 22/22] PPC: dbdma: Support more multi-issue DMA requ
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 22/22] PPC: dbdma: Support more multi-issue DMA requests |
Date: |
Thu, 11 Jul 2013 19:01:25 +0200 |
A DMA request can happen for data that hasn't been completely been
provided by the IDE core yet. For example
- DBDMA request for 0x1000 bytes
- IDE request for 1 sector
- DBDMA wants to read 0x1000 bytes (8 sectors) from bdrv
- breakage
Instead, we should truncate our bdrv request to the maximum number
of sectors we're allowed to read at that given time. Once that transfer
is through, we will fall into our recently introduced waiting logic.
- DBDMA requests for 0x1000 bytes
- IDE request for 1 sector
- DBDMA wants to read MIN(0x1000, 1 * 512) bytes
- DBDMA finishes reading, indicates to IDE core that transfer is complete
- IDE request for 7 sectors
- DBDMA finishes the DMA
Reported-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ide/macio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 18bc1d1..38ad924 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -87,7 +87,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
s->io_buffer_index &= 0x7ff;
}
- s->io_buffer_size = io->len;
+ s->io_buffer_size = MIN(io->len, s->packet_transfer_size);
MACIO_DPRINTF("remainder: %d io->len: %d size: %d\n", io->remainder_len,
io->len, s->packet_transfer_size);
@@ -253,7 +253,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
/* launch next transfer */
s->io_buffer_index = 0;
- s->io_buffer_size = io->len;
+ s->io_buffer_size = MIN(io->len, s->nsector * 512);
/* handle unaligned accesses first, get them over with and only do the
remaining bulk transfer using our async DMA helpers */
--
1.8.1.4
- [Qemu-devel] [PULL 00/22] ppc patch queue 2013-07-11, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 04/22] spapr: Respect -bios command line option for SLOF, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 05/22] pseries: move interrupt controllers to hw/intc/, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 02/22] spapr: Fix compiler warnings for some versions of gcc, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 09/22] PPC: Macio: Replace tabs with spaces, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 03/22] spapr: Use named enum for function remove_hpte, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 01/22] e600 core for MPC86xx processors, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 12/22] PPC: dbdma: Fix debug print, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 15/22] PPC: dbdma: Introduce kick function, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 22/22] PPC: dbdma: Support more multi-issue DMA requests,
Alexander Graf <=
- [Qemu-devel] [PATCH 21/22] PPC: Add timer handler for newworld mac-io, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 17/22] PPC: dbdma: macio: Add DMA callback, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 11/22] PPC: Mac: Add debug prints in macio and dbdma code, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 18/22] PPC: dbdma: Move processing to io, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 10/22] PPC: dbdma: Replace tabs with spaces, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 13/22] PPC: dbdma: Allow new commands in RUN state, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 16/22] PPC: dbdma: Move static bh variable to device struct, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 07/22] PPC: Mac: Fix guest exported tbfreq values, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 14/22] PPC: dbdma: Move defines into header file, Alexander Graf, 2013/07/11
- [Qemu-devel] [PATCH 08/22] PPC: g3beige: Move secondary IDE bus to mac-io, Alexander Graf, 2013/07/11