qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2 v5-test] add function DMA_set_return and DMA


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/2 v5-test] add function DMA_set_return and DMA_set_channel_async in dma.c
Date: Fri, 20 Apr 2012 15:07:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Il 20/04/2012 04:36, Zhi Hui Li ha scritto:
> If I add the code :
>    if ((0 == (d->mask & mask)) && (0 != (d->status & (mask << 4)))) {
>        channel_run (icont, ichan);
>    }
> Because function DMA_set_return is called in fdctrl_read_DMA_cb and
> fdctrl_write_DMA_cb, the fdctrl_stop_transfer will release the channel,
> but fdctrl_stop_transfer is after the DMA_set_return, so the channel_run
> will run again, so here I delete the above code.

I looked again at the code, and man it is painful! :)  (Both the
synchronous and asynchronous versions).

I think the best bet is to do the transfer one sector at a time even in
the asynchronous code, and reuse the fifo buffer for this).

Remember that your final objective is to execute exactly the same code
that is in QEMU right now, only scattered across multiple function calls.

Some other notes:

- you don't need the opaque_cb.  Just pass the fdctrl, the dma_len can
be stored in there and the channel is already available

- the scan support is completely broken in QEMU already.  It always
returns SEH (scan equal hit), probably because of misplaced gotos.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]