All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: exynos5: register driver early in subsys initcall to avoid probe defer
@ 2015-10-30 14:23 Marek Szyprowski
  2015-11-01 16:02 ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Szyprowski @ 2015-10-30 14:23 UTC (permalink / raw)
  To: linux-samsung-soc, linux-kernel, linux-i2c
  Cc: Marek Szyprowski, Wolfram Sang, Krzysztof Kozlowski

i2c bus drivers should be registered earlier than typical drivers to let
important i2c devices (like PMICs/regulators) get registered early
enough to avoid probe defer of all devices in typical embedded system.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/i2c/busses/i2c-exynos5.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index b29c7500461a..934a5cbcbdd3 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -867,7 +867,17 @@ static struct platform_driver exynos5_i2c_driver = {
 	},
 };
 
-module_platform_driver(exynos5_i2c_driver);
+static int __init i2c_adap_exynos5_i2c_init(void)
+{
+	return platform_driver_register(&exynos5_i2c_driver);
+}
+subsys_initcall(i2c_adap_exynos5_i2c_init);
+
+static void __exit i2c_adap_exynos5_i2c_exit(void)
+{
+	platform_driver_unregister(&exynos5_i2c_driver);
+}
+module_exit(i2c_adap_exynos5_i2c_exit);
 
 MODULE_DESCRIPTION("Exynos5 HS-I2C Bus driver");
 MODULE_AUTHOR("Naveen Krishna Chatradhi, <ch.naveen@samsung.com>");
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: exynos5: register driver early in subsys initcall to avoid probe defer
  2015-10-30 14:23 [PATCH] i2c: exynos5: register driver early in subsys initcall to avoid probe defer Marek Szyprowski
@ 2015-11-01 16:02 ` Wolfram Sang
  2015-11-19 13:20   ` Marek Szyprowski
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2015-11-01 16:02 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, linux-kernel, linux-i2c, Krzysztof Kozlowski

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

On Fri, Oct 30, 2015 at 03:23:28PM +0100, Marek Szyprowski wrote:
> i2c bus drivers should be registered earlier than typical drivers to let
> important i2c devices (like PMICs/regulators) get registered early
> enough to avoid probe defer of all devices in typical embedded system.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

I don't accept such patches anymore. Some more background:

http://www.spinics.net/lists/linux-i2c/msg13102.html
http://www.spinics.net/lists/linux-i2c/msg16644.html


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: exynos5: register driver early in subsys initcall to avoid probe defer
  2015-11-01 16:02 ` Wolfram Sang
@ 2015-11-19 13:20   ` Marek Szyprowski
  2015-11-19 13:46     ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Szyprowski @ 2015-11-19 13:20 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-samsung-soc, linux-kernel, linux-i2c, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, Robert Baldyga, balbi

Hello,

On 2015-11-01 17:02, Wolfram Sang wrote:
> On Fri, Oct 30, 2015 at 03:23:28PM +0100, Marek Szyprowski wrote:
>> i2c bus drivers should be registered earlier than typical drivers to let
>> important i2c devices (like PMICs/regulators) get registered early
>> enough to avoid probe defer of all devices in typical embedded system.
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> I don't accept such patches anymore. Some more background:
>
> http://www.spinics.net/lists/linux-i2c/msg13102.html
> http://www.spinics.net/lists/linux-i2c/msg16644.html

Well, then how can we get Exynos5xxx-based boards working with USB gadget
driver compiled-in? USB Device controller driver (UDC) needs regulator to
probe successfully. On the other hand USB gadget subsystem doesn't wait
until all UDC drivers gets probed and fails to bind compiled-in gadget
drivers if no UDC is available on probe time.

This problem is known for ages, there were number of attempts to add
support for deferred probe or solve the problem of deferred UDC driver
probe, but none got accepted so far:

http://www.spinics.net/lists/linux-usb/msg102795.html (20 Feb 2014)
http://www.spinics.net/lists/linux-usb/msg105279.html (2 Apr 2014)
http://thread.gmane.org/gmane.linux.usb.general/109745 (10 Jun 2014)
https://lkml.org/lkml/2015/6/22/554 (23 Jun 2015)

Till now it worked somehow for boards with older i2c bus drivers, which
were registered in subsys initcall. Boards, which use newer i2c bus drivers
cannot be used with usb gadgets compiled-in.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: exynos5: register driver early in subsys initcall to avoid probe defer
  2015-11-19 13:20   ` Marek Szyprowski
@ 2015-11-19 13:46     ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-11-19 13:46 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: linux-samsung-soc, linux-kernel, linux-i2c, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, Robert Baldyga, balbi

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

Hi Marek,

> This problem is known for ages, there were number of attempts to add

Yes, I heard of it, too.

> support for deferred probe or solve the problem of deferred UDC driver
> probe, but none got accepted so far:

Then they need to be worked on. AFAIK the rejection is based on
implementation details, not because the feature itself is not wanted,
or?

> Till now it worked somehow for boards with older i2c bus drivers, which
> were registered in subsys initcall. Boards, which use newer i2c bus drivers
> cannot be used with usb gadgets compiled-in.

Yes, because the above issue needs to be *fixed*, not workarounded. You
still have the option to carry your patch out-of-tree if fixing the
issue is not an option for you.

We already had problems here when someone tried to revert
subsys_initcall to module_init because of other dependency issues on
another particular board. So, the pain should really go where the fixing
is needed.

I hope you understand,

   Wolfram


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-19 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-30 14:23 [PATCH] i2c: exynos5: register driver early in subsys initcall to avoid probe defer Marek Szyprowski
2015-11-01 16:02 ` Wolfram Sang
2015-11-19 13:20   ` Marek Szyprowski
2015-11-19 13:46     ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.