Small error?? in IDE dma processing?
Benjamin Herrenschmidt
bh40 at calva.net
Fri Dec 18 05:38:27 EST 1998
Hi Paul !
On the linux kernel mailing list, I've catched the following message :
On Tue, Dec 15, 1998, <jason.harp at mail.ray.ca> wrote:
> Can you confirm an error in the following code for dma_intr(): (2.0)
>
>
> dma_stat = inb(dma_base+2); /* get DMA status */
> outb(inb(dma_base)&~1, dma_base); /* stop DMA operation */
> stat = GET_STAT(); /* get drive status */
>
>
> Should this not be:
>
>
> outb(inb(dma_base)&~1, dma_base); /* stop DMA operation*/
> dma_stat = inb(dma_base+2); /* get DMA status */
> stat = GET_STAT(); /* get drive status */
>
>
> Similar for (2.1) the DMA status is retrieve before you stop the DMA
> operation.
The error was then confirmed I think by Andre M. Hedrick.
Then, I looked at our ide-dma.c and ide-pmac.c, and it looks like we have
the same kind of issue:
ide-pmac.c, line 301:
case ide_dma_end:
drive->waiting_for_dma = 0;
dstat = in_le32(&dma->status);
out_le32(&dma->control, ((RUN|WAKE|DEAD) << 16));
/* verify good DMA status */
return (dstat & ((RUN|DEAD|ACTIVE)) != RUN;
shouldn't we do the same split and reverse the status read and the
control write ?
--
E-Mail: <mailto:bh40 at calva.net>
BenH. Web : <http://calvaweb.calvacom.fr/bh40/>
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request at lists.linuxppc.org ]]
More information about the Linuxppc-dev
mailing list