RE: Alchemy DMA and GFP_DMA

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

 



>arch/mips/au1000/common/dbdma.c uses GFP_DMA in two places and I think
>both instances are uncessary.  Could some alchmist confirm that both are
>unnecessary?
>
>Thanks,
>
>  Ralf

I tested it without GFP_DMA on Au1550 board. It worked.

The more serious problem in dbdma.c is how DMA descriptor cmd1
register is used. In multiple places, it just do

-       dp->dscr_cmd1 = nbytes;

Au1550/1200 supports 0x3fffff bytes of buffer. So the following is
better I think.

+       if(nbytes > DSCR_CMD1_BC_MASK) {
+               return 0;
+       }
+       dp->dscr_cmd1 = (dp->dscr_cmd1 & ~DSCR_CMD1_BC_MASK) + nbytes;

Also, there is no way to do memory-to-PCI dma. I added a few lines in
au1xxx_dbdma_ring_alloc().

+         if(DSCR_CUSTOM2DEV_ID(destid) == DSCR_CMD0_PCI_WRITE) {
+                cmd1 |= 0x04000000;
+         }
+         if(DSCR_CUSTOM2DEV_ID(srcid) == DSCR_CMD0_PCI_WRITE) {
+                cmd1 |= 0x40000000;
+         }

Last, a few places like:

-       nbytes = dscr->dscr_cmd1;

+       nbytes = (DSCR_CMD1_BC_MASK & dscr->dscr_cmd1);


Thanks.

Bo


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux