All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: exynos5: Move initialization code to subsys_initcall()
@ 2015-01-12  2:53 Joonyoung Shim
       [not found] ` <1421031182-18992-1-git-send-email-jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Joonyoung Shim @ 2015-01-12  2:53 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-samsung-soc, wsa, kgene.kim, naveenkrishna.ch, broonie,
	jy0922.shim

This is required in order to ensure that core system devices such as
voltage regulators attached via I2C are available early in boot.

Signed-off-by: Joonyoung Shim <jy0922.shim@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 b29c750..18ca097 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 exynos5_i2c_init_driver(void)
+{
+	return platform_driver_register(&exynos5_i2c_driver);
+}
+subsys_initcall(exynos5_i2c_init_driver);
+
+static void __exit exynos5_i2c_exit_driver(void)
+{
+	platform_driver_unregister(&exynos5_i2c_driver);
+}
+module_exit(exynos5_i2c_exit_driver);
 
 MODULE_DESCRIPTION("Exynos5 HS-I2C Bus driver");
 MODULE_AUTHOR("Naveen Krishna Chatradhi, <ch.naveen@samsung.com>");
-- 
1.9.1

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

* Re: [PATCH] i2c: exynos5: Move initialization code to subsys_initcall()
       [not found] ` <1421031182-18992-1-git-send-email-jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2015-01-12  7:50   ` Uwe Kleine-König
       [not found]     ` <20150112075019.GB22880-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2015-01-12  7:50 UTC (permalink / raw)
  To: Joonyoung Shim
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	wsa-z923LK4zBo2bacvFa/9K2g, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	naveenkrishna.ch-Re5JQEeQqe8AvxtiuMwx3w,
	broonie-DgEjT+Ai2ygdnm+yROfE0A

Hello,

On Mon, Jan 12, 2015 at 11:53:02AM +0900, Joonyoung Shim wrote:
> This is required in order to ensure that core system devices such as
> voltage regulators attached via I2C are available early in boot.
Deferred probing isn't an option? If so I suggest adding the reasoning
in a comment to stop the next person converting it to that.
(And if not, please fix accordingly to use deferred probing.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH] i2c: exynos5: Move initialization code to subsys_initcall()
       [not found]     ` <20150112075019.GB22880-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2015-01-12  8:43       ` Joonyoung Shim
       [not found]         ` <54B38946.3020406-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Joonyoung Shim @ 2015-01-12  8:43 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	wsa-z923LK4zBo2bacvFa/9K2g, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	naveenkrishna.ch-Re5JQEeQqe8AvxtiuMwx3w,
	broonie-DgEjT+Ai2ygdnm+yROfE0A, tomi.valkeinen-l0cyMroinI0

+Cc Tomi Valkeinen,

Hi Uwe,

On 01/12/2015 04:50 PM, Uwe Kleine-König wrote:
> Hello,
> 
> On Mon, Jan 12, 2015 at 11:53:02AM +0900, Joonyoung Shim wrote:
>> This is required in order to ensure that core system devices such as
>> voltage regulators attached via I2C are available early in boot.
> Deferred probing isn't an option? If so I suggest adding the reasoning
> in a comment to stop the next person converting it to that.
> (And if not, please fix accordingly to use deferred probing.)
> 

I couldn't get penguin logo since the commit 92b004d ("video/logo:
prevent use of logos after they have been freed") and i just tried old
way because i missed the flow to move to deferred probing.

Fb driver probe seems to be ran between fb_logo_late_init late_initcall
and the freeing of the logos.

Any ideas?

Thanks for pointing.

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

* Re: [PATCH] i2c: exynos5: Move initialization code to subsys_initcall()
       [not found]         ` <54B38946.3020406-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2015-01-13 12:13           ` Tomi Valkeinen
  2015-01-16 12:35             ` Thierry Reding
  0 siblings, 1 reply; 5+ messages in thread
From: Tomi Valkeinen @ 2015-01-13 12:13 UTC (permalink / raw)
  To: Joonyoung Shim, Uwe Kleine-König, Thierry Reding
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	wsa-z923LK4zBo2bacvFa/9K2g, kgene.kim-Sze3O3UU22JBDgjK7y7TUQ,
	naveenkrishna.ch-Re5JQEeQqe8AvxtiuMwx3w,
	broonie-DgEjT+Ai2ygdnm+yROfE0A

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

On 12/01/15 10:43, Joonyoung Shim wrote:
> +Cc Tomi Valkeinen,
> 
> Hi Uwe,
> 
> On 01/12/2015 04:50 PM, Uwe Kleine-König wrote:
>> Hello,
>>
>> On Mon, Jan 12, 2015 at 11:53:02AM +0900, Joonyoung Shim wrote:
>>> This is required in order to ensure that core system devices such as
>>> voltage regulators attached via I2C are available early in boot.
>> Deferred probing isn't an option? If so I suggest adding the reasoning
>> in a comment to stop the next person converting it to that.
>> (And if not, please fix accordingly to use deferred probing.)
>>
> 
> I couldn't get penguin logo since the commit 92b004d ("video/logo:
> prevent use of logos after they have been freed") and i just tried old
> way because i missed the flow to move to deferred probing.
> 
> Fb driver probe seems to be ran between fb_logo_late_init late_initcall
> and the freeing of the logos.
> 
> Any ideas?

Thierry mentioned on IRC that he encountered the same issue. And I
encountered it also.

So... I'd rather not revert the fix, as it's quite a nasty one, and it
happens while console lock is held, so it looks like the machine just
froze. But I don't know how it could be improved with the current kernel.

We could make the logos non-initdata, but I don't much like that option.
Or we could perhaps implement some new way to catch the freeing of initdata.

Any other ideas?

 Tomi



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

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

* Re: [PATCH] i2c: exynos5: Move initialization code to subsys_initcall()
  2015-01-13 12:13           ` Tomi Valkeinen
@ 2015-01-16 12:35             ` Thierry Reding
  0 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2015-01-16 12:35 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Joonyoung Shim, Uwe Kleine-König, linux-i2c,
	linux-samsung-soc, wsa, kgene.kim, naveenkrishna.ch, broonie

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

On Tue, Jan 13, 2015 at 02:13:51PM +0200, Tomi Valkeinen wrote:
> On 12/01/15 10:43, Joonyoung Shim wrote:
> > +Cc Tomi Valkeinen,
> > 
> > Hi Uwe,
> > 
> > On 01/12/2015 04:50 PM, Uwe Kleine-König wrote:
> >> Hello,
> >>
> >> On Mon, Jan 12, 2015 at 11:53:02AM +0900, Joonyoung Shim wrote:
> >>> This is required in order to ensure that core system devices such as
> >>> voltage regulators attached via I2C are available early in boot.
> >> Deferred probing isn't an option? If so I suggest adding the reasoning
> >> in a comment to stop the next person converting it to that.
> >> (And if not, please fix accordingly to use deferred probing.)
> >>
> > 
> > I couldn't get penguin logo since the commit 92b004d ("video/logo:
> > prevent use of logos after they have been freed") and i just tried old
> > way because i missed the flow to move to deferred probing.
> > 
> > Fb driver probe seems to be ran between fb_logo_late_init late_initcall
> > and the freeing of the logos.
> > 
> > Any ideas?
> 
> Thierry mentioned on IRC that he encountered the same issue. And I
> encountered it also.
> 
> So... I'd rather not revert the fix, as it's quite a nasty one, and it
> happens while console lock is held, so it looks like the machine just
> froze. But I don't know how it could be improved with the current kernel.
> 
> We could make the logos non-initdata, but I don't much like that option.
> Or we could perhaps implement some new way to catch the freeing of initdata.
> 
> Any other ideas?

I think we could still make the logos non-initdata based on a Kconfig
symbol. Another option might be to copy the logo data to memory that's
not automatically freed after init, so that we get better control over
when it is released. I tried tracing the various parts that would need
this data, but couldn't find any place after which it isn't needed
anymore. Specifically it is code that can be executed on every console
switch, so we can't really get rid of it at any sensible time.

I'd argue that if it's needed at every VT switch where the framebuffer
console is activated, then we really can't get rid of it at all. Or we
don't display the logo at every switch and can free the backing memory
right after the first switch for example.

Thierry

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

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

end of thread, other threads:[~2015-01-16 12:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12  2:53 [PATCH] i2c: exynos5: Move initialization code to subsys_initcall() Joonyoung Shim
     [not found] ` <1421031182-18992-1-git-send-email-jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-12  7:50   ` Uwe Kleine-König
     [not found]     ` <20150112075019.GB22880-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-01-12  8:43       ` Joonyoung Shim
     [not found]         ` <54B38946.3020406-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-13 12:13           ` Tomi Valkeinen
2015-01-16 12:35             ` Thierry Reding

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.