login
Header Space

 
 

Re: [PATCH] Fix SH DMAC code to handle PVR2 cascade

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Paul Mundt <lethal@...>, linux-sh <linuxsh-dev@...>, LKML <linux-kernel@...>
Date: Wednesday, October 3, 2007 - 11:41 am

On Wed, October 3, 2007 7:18 am, Paul Mundt wrote:


From include/asm-sh/cpu-sh4/dma.h

53 /*
54  * The DMA count is defined as the number of bytes to transfer.
55  */
56 static unsigned int ts_shift[] __maybe_unused = {
57         [XMIT_SZ_64BIT]         = 3,
58         [XMIT_SZ_8BIT]          = 0,
59         [XMIT_SZ_16BIT]         = 1,
60         [XMIT_SZ_32BIT]         = 2,
61         [XMIT_SZ_256BIT]        = 5,
62 };
63 #endif

ie ts_shift returns the number of bytes per transfer, but is then used as
a bit shift:

45 /*
46  * We determine the correct shift size based off of the CHCR transmit size
47  * for the given channel. Since we know that it will take:
48  *
49  *      info->count >> ts_shift[transmit_size]
50  *
51  * iterations to complete the transfer.
52  */
53 static inline unsigned int calc_xmit_shift(struct dma_channel *chan)
54 {
55         u32 chcr = ctrl_inl(CHCR[chan->chan]);
56
57         return ts_shift[(chcr & CHCR_TS_MASK)>>CHCR_TS_SHIFT];
58 }


(From arch/sh/drivers/dma/dma-sh.c)

I'm not anywhere where I can fix this at the moment, but i am sure it
could be patched quite trivally.




-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix SH DMAC code to handle PVR2 cascade, Adrian McMenamin, (Tue Oct 2, 5:09 pm)
Re: [PATCH] Fix SH DMAC code to handle PVR2 cascade, Paul Mundt, (Wed Oct 3, 2:18 am)
Re: [PATCH] Fix SH DMAC code to handle PVR2 cascade, Adrian McMenamin, (Wed Oct 3, 11:41 am)
Re: [PATCH] Fix SH DMAC code to handle PVR2 cascade, Paul Mundt, (Thu Oct 4, 6:01 am)
Re: [PATCH] Fix SH DMAC code to handle PVR2 cascade, Adrian McMenamin, (Thu Oct 4, 7:34 am)
speck-geostationary