Commit 39243fc1 authored by Laurentiu Tudor's avatar Laurentiu Tudor Committed by Greg Kroah-Hartman
Browse files

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: default avatarLaurentiu Tudor <laurentiu.tudor@nxp.com>
Link: https://lore.kernel.org/r/20210715140718.8513-6-laurentiu.tudor@nxp.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8c97a4fc
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -1207,6 +1207,16 @@ static int fsl_mc_bus_remove(struct platform_device *pdev)


	bus_unregister_notifier(&fsl_mc_bus_type, &fsl_mc_nb);
	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;
	return 0;
}
}