lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220208145928.12468-7-laurentiu.tudor@nxp.com>
Date:   Tue,  8 Feb 2022 16:59:28 +0200
From:   laurentiu.tudor@....com
To:     gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Cc:     ioana.ciornei@....com, diana.craciun@....nxp.com,
        jon@...id-run.com, Laurentiu Tudor <laurentiu.tudor@....com>
Subject: [PATCH 6/6] bus: fsl-mc: add .shutdown() op for DPRC driver

From: Laurentiu Tudor <laurentiu.tudor@....com>

In order for kexec scenarios to work, implement a .shutdown() op for
the DPRC driver.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@....com>
---
 drivers/bus/fsl-mc/dprc-driver.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-driver.c
index 82bf3fe09273..405cd054c2ea 100644
--- a/drivers/bus/fsl-mc/dprc-driver.c
+++ b/drivers/bus/fsl-mc/dprc-driver.c
@@ -861,6 +861,30 @@ static int dprc_remove(struct fsl_mc_device *mc_dev)
 	return 0;
 }
 
+/**
+ * dprc_shutdown - callback invoked when a DPRC should be quiesced
+ *
+ * @mc_dev: Pointer to fsl-mc device representing the DPRC
+ *
+ * Closes the DPRC device in the MC.
+ * It tears down the interrupts that were configured for the DPRC device.
+ * It destroys the interrupt pool associated with this MC bus.
+ */
+static void dprc_shutdown(struct fsl_mc_device *mc_dev)
+{
+	struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_dev);
+
+	if (!is_fsl_mc_bus_dprc(mc_dev))
+		return;
+
+	if (!mc_bus->irq_resources)
+		return;
+
+	dprc_cleanup(mc_dev);
+
+	dev_info(&mc_dev->dev, "DPRC device shutdown");
+}
+
 static const struct fsl_mc_device_id match_id_table[] = {
 	{
 	 .vendor = FSL_MC_VENDOR_FREESCALE,
@@ -877,6 +901,7 @@ static struct fsl_mc_driver dprc_driver = {
 	.match_id_table = match_id_table,
 	.probe = dprc_probe,
 	.remove = dprc_remove,
+	.shutdown = dprc_shutdown,
 };
 
 int __init dprc_driver_init(void)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ