linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/5] restart cleanups
@ 2011-11-01 16:07 Russell King - ARM Linux
  2011-11-01 16:08 ` [PATCH 1/5] ARM: restart: remove argument to setup_mm_for_reboot() Russell King - ARM Linux
                   ` (8 more replies)
  0 siblings, 9 replies; 32+ messages in thread
From: Russell King - ARM Linux @ 2011-11-01 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

This series cleans up some of the restart code for ARM.  It doesn't go
as far as Will's patch set (or even anywhere close to it) mainly because
of the poor state of the various implementations in various platforms.

Effectively, the various platforms themselves stand in the way of optimal
cleanup of this code.

We already have a function pointer to allow the restart to be hooked at
runtime - it's called arm_pm_restart().

What a lot of platforms use this for is to intercept the restart call,
do something, and then continue on by calling arm_machine_restart().

One platform (mioa701) in particular thinks its a good idea to call
functions like gpio_free() and free_irq() from here.  This is soo far
from reality its untrue; the restart paths can be called from _any_
context including IRQ context.  This alone effectively stands in the
way of moving the IRQ disables before the call to arm_pm_restart().

Other platforms use arm_pm_restart() to intercept the restart, and
force the mode to 'g', 'h' or 's'.  As the mode already defaults to
'h' I don't understand why people felt forcing it in that case was
necessary.  As for the 's' case, this can be done by merely specifying
".soft_reboot = 1" in the machine record.  We can solve the 'g' case
by changing .soft_reboot to be a char "restart_mode" argument which
sets the default restart mode.

Although I have a patch (not published as part of this series) which
makes that change, I've found it less than useful for getting rid of
some of the intercept crap because of other games platforms play in
there (like writing magic values to registers.)

Essentially, we want to move to a state where arm_pm_restart() is _the_
hook for platforms to insert their restart code into, with the default
function being a no-op.  All platforms which want to have working
restart support then have to insert their restart code into this hook.

So, this patch set takes us a little way there by cleaning up some of
the restart code:

1. remove the useless argument to setup_mm_for_reboot()
2. remove the silly indirection in AT91 code and do this like other
   platforms do.
3. remove any local_irq_disable() calls inside arch_reset() because
   this is already the case.
4. factor out the code which fiddles with the MMU tables.
5. provide (and use) a function for soft rebooting which includes the
   setup of the MMU tables and call cpu_reset() - and remove the MMU
   setup from the code paths before arch_reset() is called.

^ permalink raw reply	[flat|nested] 32+ messages in thread
[parent not found: <1676495226.4381981320219764753.JavaMail.root@zimbra20-e3.priv.proxad.net>]

end of thread, other threads:[~2011-11-04 14:22 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01 16:07 [RFC 0/5] restart cleanups Russell King - ARM Linux
2011-11-01 16:08 ` [PATCH 1/5] ARM: restart: remove argument to setup_mm_for_reboot() Russell King - ARM Linux
2011-11-01 22:27   ` Ryan Mallon
2011-11-02 14:48     ` Russell King - ARM Linux
2011-11-01 16:08 ` [PATCH 2/5] ARM: restart: get rid of needless at91_arch_reset additional indirection Russell King - ARM Linux
2011-11-01 16:09 ` [PATCH 3/5] ARM: restart: remove local_irq_disable() from within arch_reset() Russell King - ARM Linux
2011-11-01 16:36   ` H Hartley Sweeten
2011-11-01 17:56     ` Russell King - ARM Linux
2011-11-01 16:09 ` [PATCH 4/5] ARM: restart: turn reboot setup code into a library function Russell King - ARM Linux
2011-11-01 16:09 ` [PATCH 5/5] ARM: restart: only perform setup for restart when soft-restarting Russell King - ARM Linux
2011-11-02 12:12   ` Will Deacon
2011-11-02 12:37     ` Russell King - ARM Linux
2011-11-02 13:11       ` Will Deacon
2011-11-01 16:38 ` [RFC 0/5] restart cleanups Russell King - ARM Linux
2011-11-03  9:12   ` Russell King - ARM Linux
2011-11-03  9:24     ` Kukjin Kim
2011-11-03  9:57       ` Russell King - ARM Linux
2011-11-01 17:02 ` Russell King - ARM Linux
2011-11-02 13:49   ` Richard Purdie
2011-11-02 14:49     ` Russell King - ARM Linux
2011-11-04 13:58       ` Andrea Adami
2011-11-04 14:01         ` Russell King - ARM Linux
2011-11-04 14:22           ` Andrea Adami
2011-11-01 19:23 ` Will Deacon
2011-11-01 19:41   ` Russell King - ARM Linux
2011-11-01 21:19     ` Will Deacon
2011-11-01 23:09       ` Russell King - ARM Linux
2011-11-02 21:33         ` Robert Jarzmik
2011-11-02 23:31           ` Russell King - ARM Linux
2011-11-02 13:35 ` Nicolas Pitre
     [not found] <1676495226.4381981320219764753.JavaMail.root@zimbra20-e3.priv.proxad.net>
2011-11-02  7:46 ` Robert Jarzmik
2011-11-02 10:30   ` Russell King - ARM Linux

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).