Thread (1 message) 1 message, 1 author, 2009-07-21

Re: [PATCH] mips: decrease size of au1xxx_dbdma_pm_regs[][]

From: Manuel Lauss <hidden>
Date: 2009-07-21 13:06:09

Hi Roel,

On Tue, Jul 21, 2009 at 2:46 PM, Roel Kluin[off-list ref] wrote:
Only registers [0-DDMA_CHANNEL_BASE][0-6] are used by the suspend
and resume routines.

Signed-off-by: Roel Kluin <redacted>
---
These routines are on the bottom of the file. Only used are
registers:

au1xxx_dbdma_pm_regs[0][0-3]

and

au1xxx_dbdma_pm_regs[1-NUM_DBDMA_CHANS][0-6]

Is my patch right, that assumes that the array can be smaller, or
should the storage and recovery of other registers be added?
Actually, I think there's a bug in the save/restore functions.

This:
  for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) {

should be changed to
 for (i = 1, addr = DDMA_CHANNEL_BASE; i <= NUM_DBDMA_CHANS; i++)

as there are 16 individual channels (NUM_DBDMA_CHANS) to save/restore
plus the global ddma block config (the +1).
And looking closer at it, the last register in a channel can be
skipped since it's
read-only (at offset 0x18).

So, 6 slots per channel for 16 channels plus one row for the ddma global
config are enough:

static u32 au1xxx_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][6];

Thanks!
      Manuel Lauss
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help