* Re: Small error?? in IDE dma processing?
[not found] <9812159137.AA913779792@ccmail.ray.ca>
@ 1998-12-17 18:38 ` Benjamin Herrenschmidt
0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 1998-12-17 18:38 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras
Hi Paul !
On the linux kernel mailing list, I've catched the following message :
On Tue, Dec 15, 1998, <jason.harp@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@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@lists.linuxppc.org ]]
^ permalink raw reply [flat|nested] only message in thread