Received: from eggs.gnu.org ([2001:4830:134:3::10]:48017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl2Gl-0001A8-SI for qemu-devel@nongnu.org; Thu, 15 May 2014 16:28:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wl2Gb-0003Il-Gg for qemu-devel@nongnu.org; Thu, 15 May 2014 16:28:47 -0400 Date: Thu, 15 May 2014 22:28:35 +0200 (CEST) From: BALATON Zoltan In-Reply-To: Message-ID: References: <5366CA94.3030803@ilande.co.uk> <536A328F.6070100@ilande.co.uk> <536A6F3C.1030708@ilande.co.uk> <5370F620.7050206@ilande.co.uk> <5371303F.1060903@ilande.co.uk> <5372F741.9080108@ilande.co.uk> <5373CD82.6000407@ilande.co.uk> <53748952.9080909@ilande.co.uk> <537513FA.6060705@ilande.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [Qemu-devel] [Qemu-ppc] macio ide question/bug report List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org On Thu, 15 May 2014, BALATON Zoltan wrote: > On Thu, 15 May 2014, BALATON Zoltan wrote: >> confusing.) Do you think that replacing io->len in your patch with >> s->io_buffer_size would be the correct thing to do? > > Probably that's not enough. I've tried it and then it gets to here: I should've also included these lines too to make it more clear what did I change: 114 if (s->packet_transfer_size && s->lba == -1) { 115 MACIO_DPRINTF("non-IO ATAPI DMA transfer size: %d\n", io->len); non-IO ATAPI DMA transfer size: 804 117 cpu_physical_memory_write(io->addr, s->io_buffer, s->io_buffer_size); 118 s->packet_transfer_size -= s->io_buffer_size; 119 MACIO_DPRINTF("end of non-IO ATAPI DMA transfer\n"); > end of non-IO ATAPI DMA transfer > 122 if (!s->packet_transfer_size) { > (gdb) p s->packet_transfer_size > $1 = 0 > (gdb) n > 123 MACIO_DPRINTF("end of transfer\n"); > end of transfer > 124 ide_atapi_cmd_ok(s); > 125 m->dma_active = false; > 128 if (io->len == 0) { > (gdb) p io->len > $2 = 804 > (gdb) l > 123 MACIO_DPRINTF("end of transfer\n"); > 124 ide_atapi_cmd_ok(s); > 125 m->dma_active = false; > 126 } > 127 > 128 if (io->len == 0) { > 129 MACIO_DPRINTF("end of DMA\n"); > 130 goto done; > 131 } > 132 > 133 /* launch next transfer */ > 134 > 135 /* handle unaligned accesses first, get them over with and only > do the > 136 remaining bulk transfer using our async DMA helpers */ > 137 unaligned = io->len & 0x1ff; > 138 if (unaligned) { > 139 int sector_num = (s->lba << 2) + (s->io_buffer_index >> 9); > 140 int nsector = io->len >> 9; > 141 > 142 MACIO_DPRINTF("precopying unaligned %d bytes to %#" > HWADDR_PRIx "\n", > (gdb) c > Continuing. > precopying unaligned 292 bytes to 0xe4f50c > io->len = 0x200 > set remainder to: -20 > sector_num=-4 size=0, cmd_cmd=0 > atapi_cmd_error: sense=0x5 asc=0x21 > done DMA > DBDMA: dbdma_end > > Regards, > BALATON Zoltan >