Add mako subsystem restart and then will add stuff on top of it later.
msm: subsystem_restart: Don't use phase 3 SSR on the SGLTE

On the SGLTE platform, phase 2 SSR is required to address
the dependency between the internal and external modems. The
other subsystems (RIVA, LPASS etc) still need to do an
independent restart. In the absence of a matching restart
order, a request for a subsystem restart on a subsystem will
be treated as an  independent phase-3 like restart, even if
the current restart_level is phase 2. Therefore, don't allow
phase 3 on SGLTE platforms.

Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
(cherry picked from commit e4ae75ea79620e3b59859d82aa1809a256e48364)

Change-Id: Ie7f9b8f966c1d77832486226e0f6d316717ec8e7
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: SSR: Don't fail init on NULL restart orders

The subsystem framework works fine without a restart_order for a
particular machine. Therefore, always return success if there are
no restart orders. This allows 8974 to start using the subsystem
restart framework while we work on removing the need for the
restart order list.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 973b3ef7f54569a777ebb5d49fdd02ff155b62b0)

Change-Id: I054f2c90598889bb3de042296f96c4e09d5a1589
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: subsystem_restart: Use a CPU intensive workqueue for SSR

Using the default workqueue settings can result in the SSR
work item blocking the watchdog petting function. To avoid
this, schedule the SSR work on a workqueue that has the
WQ_CPU_INTENSIVE flag set. This will prevent any work item
posted to the workqueue from blocking other work items
posted by other drivers in the system, including the watchdog
pet work item.

Change-Id: I159f8c5aba9ff3b40f61bdb101f266436bd2c9bc
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
msm: sglte2: add restart orders for combined SSR

The two external modems need to be restarted together because
of the uart connection between them.

Change-Id: I376f29f1049e56b32e883783e5963cf98b322bb1
Signed-off-by: Joel King <joelking@codeaurora.org>
msm: subsystem_restart: Don't use phase 3 SSR on the SGLTE2

This change has already been done for the SGLTE target.
See commit e4ae75ea79620e3b59859d82aa1809a256e48364. The
current patch extends the change to the SGLTE2 target.
The original commit text follows.

On the SGLTE2 platform, phase 2 SSR is required to address
the dependency between the internal and external modems. The
other subsystems (RIVA, LPASS etc) still need to do an
independent restart. In the absence of a matching restart
order, a request for a subsystem restart on a subsystem will
be treated as an  independent phase-3 like restart, even if
the current restart_level is phase 2. Therefore, don't allow
phase 3 on SGLTE platforms.

Change-Id: I99469883e85f87a3b49846699c4b9d84cd385285
Signed-off-by: Joel King <joelking@codeaurora.org>
msm: SSR: Fix problems with concurrent SSRs

If one SSR call comes in and queues a work and the work item
starts running and then another SSR call comes in we will end up
with a running work item and a pending work item. The pending
work item will not run until the running work item completes.
With the current code the work item will run to completion and
then the pending work item will run and restart the subsystem
again.

This is wrong since we want to 'short-circuit' the code in this
case and do nothing if multiple SSR calls come in while the
subsystem is in the 'crashed' state.  Add state tracking logic so
that we know what part of the restart process a particular
subsystem is in and use it to fix this problem.

Conflicts:

	arch/arm/mach-msm/subsystem_restart.c

Change-Id: Iac8713951af1f290af1df7e94468d1843fc7980b
CRs-Fixed: 397848
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>