mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Antti Andreimann <Antti.Andreimann@mail.ee>
To: linux-kernel@vger.kernel.org
Subject: Trying to fix radeonfb suspending on IBM Thinkpad T41
Date: Sun, 23 Jan 2005 05:25:04 +0200	[thread overview]
Message-ID: <1106450704.10594.52.camel@localhost.localdomain> (raw)

Dear community!

The aim of this post is to discuss the radeonfb driver power management
issues. Enabling this feature dramatically reduces power consumtion
during ACPI suspend to ram. I would appriciate comments from people who
are more familiar with Radeon HW programming.

Long and boring background
--------------------------
I have a beast called IBM ThinkPad T41. Model No. 2373-2FG
Since 2.6.9 ACPI suspend to RAM (S3) has been working nicely, but the
power consumption during sleep is unacceptably high: the battery will
run dry in about 5-6 hours in sleep mode.
The root cause of this is the fact that not all hardware is properly
turned off. Namely, at least ethernet adapter, USB and most notably
graphics accelerator chip (Radeon Mobility M7 LW) remain powered on.
Unfortunately current radeonfb driver is hardcoded to do power
management only on PPC platform.
Volker Braun has some kernels on his page
(http://www.sas.upenn.edu/~vbraun/computing/T41/kernel.html) that
incorporate his patch to enable PM on other platforms as well. He also
owns a T41, but It's a bit different model and those kernels do not
resume properly on my laptop: the machine crashes hard on resume.
After a few hours of hacking around in radeonfb sources I think I found
the problem and fixed it for my hardware. The results are promising: the
power consumption during sleep is about 4-5 times lower: 15min ACPI
sleep consumes 1100mW/h without radeonfb and only 230mW/h with properly
patched radeonfb driver loaded.

A question to anyone familiar with radeon hardware programming
--------------------------------------------------------------
The radeonfb driver has a power management implementation that is used
on PPC platform (Macintosh laptops ;). The same implementation seems to
work fine on some Thinkpads, but crashes on others. In
drivers/video/aty/radeon_pm.c resides a function called:
radeon_pm_setup_for_suspend. This function has a following section that
manages to crash at least my laptop:

/* AGP PLL control */
OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) |  BUS_CNTL1__AGPCLK_VALID);

OUTREG(BUS_CNTL1,
     (INREG(BUS_CNTL1) & ~BUS_CNTL1__MOBILE_PLATFORM_SEL_MASK)
     | (2<<BUS_CNTL1__MOBILE_PLATFORM_SEL__SHIFT));  // 440BX
OUTREG(CRTC_OFFSET_CNTL, (INREG(CRTC_OFFSET_CNTL) &
      ~CRTC_OFFSET_CNTL__CRTC_STEREO_SYNC_OUT_EN));

clk_pin_cntl &= ~CLK_PIN_CNTL__CG_CLK_TO_OUTPIN;
clk_pin_cntl |= CLK_PIN_CNTL__XTALIN_ALWAYS_ONb;
OUTPLL( pllCLK_PIN_CNTL, clk_pin_cntl);

It can be seen from the comments that this code is specific to Intel
440BX or similar chipset and this is most probably the reason it manages
to crash machines that are based on a different chip.

What exactly does this piece of code do and is it needed after all? My
machine seems to work fine without it.
If it is needed, is it possible to make it more generic?

-- 
 Antti Andreimann - Security Consultant
      Using Linux since 1993
  Member of ELUG since 29.01.2000

             reply	other threads:[~2005-01-23  3:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-23  3:25 Antti Andreimann [this message]
2005-01-23  4:33 ` Volker Braun
2005-01-23 21:54 ` Volker Braun
2005-01-24  0:54   ` Antti Andreimann
     [not found]     ` <1106537779.5069.2.camel@localhost.localdomain>
     [not found]       ` <1106552017.17621.13.camel@localhost.localdomain>
     [not found]         ` <1106600491.14176.21.camel@carrot.hep.upenn.edu>
2005-01-24 22:12           ` Antti Andreimann

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=1106450704.10594.52.camel@localhost.localdomain \
    --to=antti.andreimann@mail.ee \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome