msm: SSR: Make restart level per-subsystem instead of global

Each subsystem would like to have its own say on what the restart
level should be for their particular device. Instead of having a
global knob that chooses the subsystem restart level, have a per
subsystem restart level so that each subsystem can choose their
own restart level. Do this by introducing a per-device sysfs knob
that can be written with a string indicating the restart level
for that device.

"SYSTEM" will reset the entire system when a subsystem crashes,
while "RELATED" will restart the subsystem and the group of
subsystems related to the subsystem that crashed. Independent
used to be possible, but we remove it here because it is
equivalent to "RELATED". Also independent restart can cause
confusion if the hardware really doesn't support independent
restart and the user attempts to choose the independent restart
level. Let's not expose broken options to userspace.

Some code was using get_restart_level() to determine the global
restart level. Luckily most of that code was doing purely
debugging things so just remove it and update the last few
callers to use a new device call, subsys_get_restart_level(), so
they can determine what userspace has chosen for their device.

Change-Id: If8f1d57a465cd1c763f1dd6b2cbd6083ff94bb99
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
6 files changed