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-next>] [day] [month] [year] [list]
Message-ID: <1412822646-11257-1-git-send-email-dinguyen@opensource.altera.com>
Date:	Wed, 8 Oct 2014 21:44:06 -0500
From:	<dinguyen@...nsource.altera.com>
To:	<p.zabel@...gutronix.de>
CC:	<dinh.linux@...il.com>, <s.trumtrar@...gutronix.de>,
	<grant.likely@...aro.org>, <robh+dt@...nel.org>,
	<atull@...nsource.altera.com>, <devicetree@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	Dinh Nguyen <dinguyen@...nsource.altera.com>
Subject: [PATCH] reset: socfpga: use arch_initcall for early initialization

From: Dinh Nguyen <dinguyen@...nsource.altera.com>

There are certain drivers that are required to get loaded very early using
arch_initcall. An example of such a driver is the SOCFPGA's FPGA bridge driver.
This driver has to get loaded early because it needs to enable FPGA components
that are connected to the bridge.

This FPGA bridge driver will using the reset controller API to toggle it's
reset bits, thus, it needs the reset driver to be loaded as early as possible
in order for it to get used properly.

Signed-off-by: Dinh Nguyen <dinguyen@...nsource.altera.com>
---
 drivers/reset/reset-socfpga.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
index 79c32ca..a5e8d37 100644
--- a/drivers/reset/reset-socfpga.c
+++ b/drivers/reset/reset-socfpga.c
@@ -139,7 +139,20 @@ static struct platform_driver socfpga_reset_driver = {
 		.of_match_table	= socfpga_reset_dt_ids,
 	},
 };
-module_platform_driver(socfpga_reset_driver);
+
+static int __init socfpga_reset_init(void)
+{
+	return platform_driver_probe(&socfpga_reset_driver,
+					socfpga_reset_probe);
+}
+
+static void __exit socfpga_reset_exit(void)
+{
+	platform_driver_unregister(&socfpga_reset_driver);
+}
+
+arch_initcall(socfpga_reset_init);
+module_exit(socfpga_reset_exit);
 
 MODULE_AUTHOR("Steffen Trumtrar <s.trumtrar@...gutronix.de");
 MODULE_DESCRIPTION("Socfpga Reset Controller Driver");
-- 
2.0.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ