summaryrefslogtreecommitdiff
path: root/drivers/bus/fsl-mc
diff options
context:
space:
mode:
authorLaurentiu Tudor <laurentiu.tudor@nxp.com>2021-07-15 17:07:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-21 13:56:25 +0200
commit39243fc1110caf1e76ea647059e061a021680dfd (patch)
tree5d331e2faa24739d913f75344222727769f2b4d4 /drivers/bus/fsl-mc
parent8c97a4fc1b34856812b6775f1f1d46b3bf59bc9d (diff)
bus: fsl-mc: pause the MC firmware when unloading
Pause the MC firmware when unloading the driver so that it doesn't crash in certain scenarios, such as kexec. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Link: https://lore.kernel.org/r/20210715140718.8513-6-laurentiu.tudor@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bus/fsl-mc')
-rw-r--r--drivers/bus/fsl-mc/fsl-mc-bus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 41861ca5c8f1..e5b4830cf3c5 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -1207,6 +1207,16 @@ static int fsl_mc_bus_remove(struct platform_device *pdev)
bus_unregister_notifier(&fsl_mc_bus_type, &fsl_mc_nb);
+ if (mc->fsl_mc_regs) {
+ /*
+ * Pause the MC firmware so that it doesn't crash in certain
+ * scenarios, such as kexec.
+ */
+ writel(readl(mc->fsl_mc_regs + FSL_MC_GCR1) |
+ (GCR1_P1_STOP | GCR1_P2_STOP),
+ mc->fsl_mc_regs + FSL_MC_GCR1);
+ }
+
return 0;
}