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  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]
Date:	Mon, 22 Dec 2014 15:15:49 -0300
From:	Walter Lozano <>
Cc:	Walter Lozano <>
Subject: [RFC] i2c: designware: Avoid initcall and initialize the driver like a regular one

Currently, the driver is relying on a subsys_initcall() to register
the platform driver struct. This is typically done to allow early uses
of the I2C bus (for instance, I2C regulators used from early machine code).

While this might work on some cases, it breaks on others. For instance,
I2C devices with GPIO-wired interrupts will fail to request the
interrupt because of this initcall usage.

This commits attempts to fix the above issue, by converting the I2C
driver into a regular kernel platform driver. This guarantees it will
probe after GPIOs drivers.

Platforms based on devicetree won't be affected by this change. Legacy
platforms, relying on the I2C being available early, might need to
implement proper defered mechanisms to overcome potential problems.

Signed-off-by: Walter Lozano <>
 drivers/i2c/busses/i2c-designware-platdrv.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 2b463c3..579e65c 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -333,17 +333,7 @@ static struct platform_driver dw_i2c_driver = {
-static int __init dw_i2c_init_driver(void)
-	return platform_driver_register(&dw_i2c_driver);
-static void __exit dw_i2c_exit_driver(void)
-	platform_driver_unregister(&dw_i2c_driver);
 MODULE_AUTHOR("Baruch Siach <>");
 MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter");

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists