Skip to contentSkip to conversation

Small error?? in IDE dma processing?

DISCUSSION Benjamin Herrenschmidt 1 participant 1 message Dec 17, 1998 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Paul !

On the linux kernel mailing list, I've catched the following message :

Quoted 11 lines · On Tue, Dec 15, 1998, <[email protected]> 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:

Quoted 7 lines

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 ?

Signature · 11 lines
           E-Mail: <mailto:[email protected]>
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 [email protected] ]]