public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrei Birjukov <andrei.birjukov@artecdesign.ee>
To: linux@maxim.org.za
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix for Atmel AT91 powersaving
Date: Sat, 31 Jan 2009 15:55:31 +0200	[thread overview]
Message-ID: <49845853.3020402@artecdesign.ee> (raw)

Hello,

We've discovered that our AT91SAM9260 board consumed too much power when 
returning from a slowclock low-power mode. RAM self-refresh is enabled 
in a bootloader in our case, this is how we saw a difference. Estimated 
ca. 30mA more on 4V battery than the same state before powersaving. 
After a small research we found that there seems to be a bogus 
sdram_selfrefresh_disable() call at the end of at91_pm_enter() call, 
which overwrites the LPR register with uninitialized value. Please find 
the suggested patch attached.

The below patch is tested and works ok. The patch was generated against 
a 2.6.28 kernel with no additional patches.

Regards,
andrei

---
This patch fixes correct restoring of LPR register of the Atmel AT91 
SDRAM controller
when returning from a power saving mode.

Signed-off-by: Andrei Birjukov <andrei.birjukov@artecdesign.ee>

---
diff -purN linux-2.6.28-clean/arch/arm/mach-at91/pm.c 
linux-2.6.28/arch/arm/mach-at91/pm.c
--- linux-2.6.28-clean/arch/arm/mach-at91/pm.c    2008-12-25 
01:26:37.000000000 +0200
+++ linux-2.6.28/arch/arm/mach-at91/pm.c    2009-01-20 
13:00:01.000000000 +0200
@@ -332,7 +332,6 @@ static int at91_pm_enter(suspend_state_t
             at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));
 
 error:
-    sdram_selfrefresh_disable();
     target_state = PM_SUSPEND_ON;
     at91_irq_resume();
     at91_gpio_resume();


-- 
Andrei Birjukov
Embedded Software Engineer
Artec Design LLC
Akadeemia tee 23a, 12618, Tallinn, Estonia
Phone: +3726718559
Fax: +3726718555
GSM: +37256908939
E-mail: andrei.birjukov@artecdesign.ee
WWW: http://www.artecdesign.com


             reply	other threads:[~2009-01-31 14:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-31 13:55 Andrei Birjukov [this message]
2009-02-02 20:54 ` [PATCH] Fix for Atmel AT91 powersaving Andrew Victor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49845853.3020402@artecdesign.ee \
    --to=andrei.birjukov@artecdesign.ee \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@maxim.org.za \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox