From: jean.pihet@newoldbits.com
To: linux-omap@vger.kernel.org
Subject: [RFC/PATCH 00/13] OMAP2+: PM: isolate PM code in modules
Date: Wed, 18 May 2011 19:32:17 +0200 [thread overview]
Message-ID: <1305739950-11695-1-git-send-email-j-pihet@ti.com> (raw)
From: Jean Pihet <j-pihet@ti.com>
First attempt at isolation of the OMAP2+ PM code
RFC quality code but successfully tested on board as a proof
of concept
1) provide PM functionality as modules
To allow for the PM functionality to be built and used as modules a
clean-up and isolation task first has been performed ('spaghetti
unwinding') because there are a lot of cross calls between various parts
of the PM code (core, platform specific, cpuidle ...).
Since the option CONFIG_PM is always set for OMAP chips and since
CONFIG_PM cannot be set to 'm', a new config option CONFIG_OMAP_PM is defined.
This option allows for the OMAP2+ PM code to be enabled, disabled or
built as modules.
Furthermore CONFIG_PM is used to completely enable or disable the whole
PM code.
The PM functionality is split into the following modules:
- omap_pm_debug
- omap2_pm
- omap3_pm
- omap4_pm
The following functionality is moved to the modules:
- platform specific PM core
- suspend
- cpuidle
- PM debug
The following functionality is needed at boot time and so is left
in the PM core code (i.e. not built as modules):
- PRCM
- clock domains
- power domains
- voltage domains
- hwmod
- smart reflex
- per-platform PRCM data
- per-platform clock data
- per-platform power domains data
- per-platform hwmod data
- per-platform OPP data
2) Addition of EXPORT_SYMBOL for functions and variables used by
the code in PM modules. Lots of (too many?) symbols need to exported
to the PM modules.
3) Clean-up of used resources to allow clean insertion and removal
of the PM modules. This allows insmod/rmmod of the PM modules
to work.
Questions/concerns
------------------
- IMHO too many symbols are exported from various layers to the PM modules, e.g.
cpu_init, flush_tlb_all, omap_irq_pending, v7_flush_dcache_all ...) in patches
10/13, 12/13. Is that OK?
- v7_flush_dcache_all which is implemented in assembly is exported using
EXPORT_SYMBOL in pm.c, or by using a C stub function. That obvioulsy looks wrong
but no cleaner way has been found yet.
- export suspend_set_ops to PM modules hack (patch 09/13): a stub is needed
because the suspend_set_ops functions are not exported by the kernel.
Could that be done?
- the most worrysome piece of code to isolate is pm-debug.c aka 'the octopus'.
The main problem is that pm-debug is needed for a useful PM. The reason is
that most of the PM control knobs (enable_off_mode, sleep_while_idle ...)
are controlled by pm-debug via debugfs and are disabled by default.
This patch series is moving the variables and functions from pm-debug to
mach-omap2/pm.c but not the control mechanism.
More clean-up effort is needed.
Tested on OMAP3 Beagleboard with cpuidle in RET mode.
ToDo:
- suspend not tested
- OFF mode in cpuidle not working (console garbage + reboot), investigation on-going
- power domains timer stats initialized with weird values (i.e. not 0), investigation
on-going
Jean Pihet (13):
perf: export power_start and power_end tracepoints
OMAP2+: PM: isolate PM code
OMAP2+: PM: clean up usage of SRAM functions
OMAP2+: cpuidle: register the board specific C-states table
OMAP2+: PM: move common code from pm-debug.c to pm.c
OMAP2+: PM: isolate the scratchpad save function from the PM code
OMAP2+: PM: move the powerdomains time stats to powerdomain code
OMAP2+: PM: provide the next timer event API to PM modules
OMAP2+: PM: export suspend_set_ops to PM modules
OMAP3: PM: export the v7_flush_dcache_all API to modules
OMAP2+: PM: implement modules insertion and removal code
OMAP2+: PM: export functions and variables to PM modules
OMAP2+: PM: build PM functionality as modules
arch/arm/kernel/setup.c | 1 +
arch/arm/kernel/smp_tlb.c | 2 +
arch/arm/mach-omap2/Makefile | 77 +++++++++++++++++++++-------------
arch/arm/mach-omap2/clockdomain.c | 7 +++
arch/arm/mach-omap2/cm2xxx_3xxx.c | 7 +++
arch/arm/mach-omap2/control.c | 36 ++++++++--------
arch/arm/mach-omap2/control.h | 6 +--
arch/arm/mach-omap2/cpuidle34xx.c | 27 +++++++++---
arch/arm/mach-omap2/gpmc.c | 2 +
arch/arm/mach-omap2/id.c | 1 +
arch/arm/mach-omap2/irq.c | 7 +++
arch/arm/mach-omap2/pm-debug.c | 80 ++++++++++++------------------------
arch/arm/mach-omap2/pm.c | 79 +++++++++++++++++++++++++++++++++++
arch/arm/mach-omap2/pm.h | 33 +++++++++++----
arch/arm/mach-omap2/pm24xx.c | 33 ++++++++++++--
arch/arm/mach-omap2/pm34xx.c | 74 +++++++++++++++++++++++++++++++--
arch/arm/mach-omap2/pm44xx.c | 27 +++++++++++-
arch/arm/mach-omap2/powerdomain.c | 41 ++++++++++++++++++-
arch/arm/mach-omap2/powerdomain.h | 3 +
arch/arm/mach-omap2/prm2xxx_3xxx.c | 6 +++
arch/arm/mach-omap2/sdrc.c | 2 +
arch/arm/mach-omap2/serial.c | 5 ++
arch/arm/mach-omap2/timer-gp.c | 1 +
arch/arm/plat-omap/Kconfig | 9 ++++
arch/arm/plat-omap/common.c | 1 +
arch/arm/plat-omap/dma.c | 3 +
arch/arm/plat-omap/gpio.c | 4 ++
arch/arm/plat-omap/omap-pm-noop.c | 2 +
arch/arm/plat-omap/omap_device.c | 1 +
arch/arm/plat-omap/sram.c | 4 +-
kernel/trace/power-traces.c | 3 +-
31 files changed, 446 insertions(+), 138 deletions(-)
--
1.7.4.1
next reply other threads:[~2011-05-18 17:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 17:32 jean.pihet [this message]
2011-05-18 17:32 ` [PATCH 01/13] perf: export power_start and power_end tracepoints jean.pihet
2011-05-18 17:32 ` [PATCH 02/13] OMAP2+: PM: isolate PM code jean.pihet
2011-05-18 17:32 ` [PATCH 03/13] OMAP2+: PM: clean up usage of SRAM functions jean.pihet
2011-05-26 20:34 ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 04/13] OMAP2+: cpuidle: register the board specific C-states table jean.pihet
2011-05-18 17:32 ` [PATCH 05/13] OMAP2+: PM: move common code from pm-debug.c to pm.c jean.pihet
2011-05-18 17:32 ` [PATCH 06/13] OMAP2+: PM: isolate the scratchpad save function from the PM code jean.pihet
2011-05-18 17:32 ` [PATCH 07/13] OMAP2+: PM: move the powerdomains time stats to powerdomain code jean.pihet
2011-05-26 20:45 ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 08/13] OMAP2+: PM: provide the next timer event API to PM modules jean.pihet
2011-05-19 7:59 ` Santosh Shilimkar
2011-05-19 12:02 ` Jean Pihet
2011-05-26 23:00 ` Kevin Hilman
2011-05-27 7:44 ` Jean Pihet
2011-05-18 17:32 ` [PATCH 09/13] OMAP2+: PM: export suspend_set_ops " jean.pihet
2011-05-26 23:09 ` Kevin Hilman
2011-05-27 7:48 ` Jean Pihet
2011-05-28 0:28 ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 10/13] OMAP3: PM: export the v7_flush_dcache_all API to modules jean.pihet
2011-05-19 8:04 ` Santosh Shilimkar
2011-05-25 12:21 ` Jean Pihet
2011-05-18 17:32 ` [PATCH 11/13] OMAP2+: PM: implement modules insertion and removal code jean.pihet
2011-05-18 17:32 ` [PATCH 12/13] OMAP2+: PM: export functions and variables to PM modules jean.pihet
2011-05-19 8:32 ` Santosh Shilimkar
2011-05-18 17:32 ` [PATCH 13/13] OMAP2+: PM: build PM functionality as modules jean.pihet
2011-05-31 8:02 ` [RFC/PATCH 00/13] OMAP2+: PM: isolate PM code in modules Tony Lindgren
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=1305739950-11695-1-git-send-email-j-pihet@ti.com \
--to=jean.pihet@newoldbits.com \
--cc=linux-omap@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;
as well as URLs for NNTP newsgroup(s).