linux-mips
[Top] [All Lists]

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

To: Roel Kluin <roel.kluin@gmail.com>
Subject: Re: [PATCH] mips: decrease size of au1xxx_dbdma_pm_regs[][]
From: Manuel Lauss <manuel.lauss@googlemail.com>
Date: Tue, 21 Jul 2009 15:06:09 +0200
Cc: rjw@sisk.pl, ralf@linux-mips.org, linux-pm@lists.linux-foundation.org, linux-mips@linux-mips.org, Andrew Morton <akpm@linux-foundation.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VlwtZ8kS5JO8q5yrMlY8xn9BgX7X41U5erP8Y+cGjjY=; b=Q2exc7rqtWfhewEsYyxMKVrP8iPFyaNudmA/Ofys+kB42tKgFKX3Xk/M/IFlNuAaxw pU7yPHufBAtc8S1Z+e3ojZXTJvl1AaLSzgqONssA6iJ3iPlkdoBT1Gsy2Gw05XHgN9QY xjZMVd+sNuXyqC+/xZBftimvqPov9t6LhYXfI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Pr3/kjgv5i+5Mn9+YHcMBDbUEa7/EYK0kdne6zl9Wn5tXYG5xPrLgAI1qf3B0rhSPe mapmCLjiwEE6zzWZPPncR1d7gSw95q/Ah8zwI92nBh6uBEl+4RiQDEdXrRIo9PBrFiZq 7Rj+nownaqhTFXNOItUrAWENiSYLS9g9dldUE=
In-reply-to: <4A65B8BB.40502@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <4A65B8BB.40502@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
Hi Roel,

On Tue, Jul 21, 2009 at 2:46 PM, Roel Kluin<roel.kluin@gmail.com> wrote:
> Only registers [0-DDMA_CHANNEL_BASE][0-6] are used by the suspend
> and resume routines.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> 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

<Prev in Thread] Current Thread [Next in Thread>