Skip to content

RFC restart cleanups

Will Deacon linux-arm-kernel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest0 of 5 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 5 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/5] restart cleanups

Hi Russell,

Quoted 3 lines · Russell King - ARM Linux

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.

Thanks for helping out with this!

Quoted 2 lines

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

Agreed. I'm hoping that people will complain if we break them by accident.

Quoted 7 lines

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.

Actually, I think we can go as far as deleteing the 'g' mode and using the GPIO reset as a fallback if we fail in the usual 'h' case. This mode is only used by mach-pxa, so it would be good to get rid of it.

We can always do this in a later patch series if it gets in the way (I have a series to clean up the reboot modes already).

Quoted 4 lines

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

I'm definitely in favour of this change, but be aware that I plan to modify setup_mm_for_reboot in the future to:

(a) Use a static identity mapping so we don't have to pgd_alloc explicitly [I can't see this affecting anything]

(b) Extend the identity mapping into kernel space, leaving some room for the kernel image. If this is all called from soft_reboot, which just does the cpu_reset(addr) afterwards, then we're fine. I have code to take care of changing stack and switching to the new mapping.

Quoted 3 lines

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.

This function will probably grow to contain the arm_machine_reset function body that I have for kexec.

If you're happy with the direction I'd like to take this in, then you can have my Acked-by tags for patches 1 and 5.

Cheers,

Will