From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grygorii Strashko Subject: Re: [BUG] omap: mfd/regulator: twl/core: init order Date: Mon, 15 Apr 2013 13:59:56 +0300 Message-ID: <516BDDAC.8040905@ti.com> References: <1365877659.3812.110.camel@mars> <516BD479.2020904@ti.com> <1366023401.957.5.camel@mars> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366023401.957.5.camel@mars> Sender: linux-omap-owner@vger.kernel.org To: Christoph Fritz Cc: Tony Lindgren , Javier Martinez Canillas , Liam Girdwood , =?UTF-8?B?QmVub8OudCBDb3Vzc29u?= , Tomi Valkeinen , Alessandro Zummo , Peter Ujfalusi , Samuel Ortiz , "linux-omap@vger.kernel.org" , devicetree-discuss@lists.ozlabs.org, Daniel Mack , "Hans J. Koch" List-Id: devicetree@vger.kernel.org On 04/15/2013 01:56 PM, Christoph Fritz wrote: > On Mon, 2013-04-15 at 13:20 +0300, Grygorii Strashko wrote: >> On 04/13/2013 09:27 PM, Christoph Fritz wrote: >>> Hi >>> >>> while testing an omap3 board with device tree support I stumbled upon a >>> bug which is due to wrong initialization order of twl-core and >>> twl-regulator (I suppose): In the boot process they get loaded way too >>> late so that a lot of drivers before where configured wrong or just >>> refuse to load. >>> >>> For example the real time clock driver: The RTC kicks in way before >>> twl_probe() and due to that it configures its register map wrong >>> (at this time twl_priv->twl_id isn't configured yet). >>> >>> Another example is the omap display subsystem. It (DSS) fails loading >>> while trying to register some not yet existent regulators and because it >>> lacks EPROBE_DEFER. >>> >>> USB and MMC is also not working and I'm suspicious of the same cause. >>> >>> Any ideas? >> Hi Christoph, >> >> It happens, because I2C probes execution have been deferred due to >> "pinctrl-single" driver (, which is not ready at i2c bus initialization >> time: >> >> [ 0.525939] omap_i2c 48070000.i2c: could not find pctldev for node >> /ocp/pinmux@4a100040/pinmux_i2c1_pins, deferring probe >> [ 0.526000] platform 48070000.i2c: Driver omap_i2c requests probe >> deferral >> [ 0.526062] omap_i2c 48072000.i2c: could not find pctldev for node >> /ocp/pinmux@4a100040/pinmux_i2c2_pins, deferring probe >> [ 0.526092] platform 48072000.i2c: Driver omap_i2c requests probe >> deferral >> [ 0.526153] omap_i2c 48060000.i2c: could not find pctldev for node >> /ocp/pinmux@4a100040/pinmux_i2c3_pins, deferring probe >> [ 0.526184] platform 48060000.i2c: Driver omap_i2c requests probe >> deferral >> [ 0.526245] omap_i2c 48350000.i2c: could not find pctldev for node >> /ocp/pinmux@4a100040/pinmux_i2c4_pins, deferring probe >> [ 0.526275] platform 48350000.i2c: Driver omap_i2c requests probe >> deferral >> >> I think following change should fix it, could you try it, pls: >> diff --git a/drivers/pinctrl/pinctrl-single.c >> b/drivers/pinctrl/pinctrl-single.c >> index 5c32e88..b2a9d4b 100644 >> --- a/drivers/pinctrl/pinctrl-single.c >> +++ b/drivers/pinctrl/pinctrl-single.c >> @@ -1014,7 +1014,18 @@ static struct platform_driver pcs_driver = { >> }, >> }; >> >> -module_platform_driver(pcs_driver); >> +static int __init pcs_driver_drv_init(void) >> +{ >> + return platform_driver_register(&pcs_driver); >> +} >> +postcore_initcall(pcs_driver_drv_init); >> + >> +static void __exit pcs_driver_drv_exit(void) >> +{ >> + platform_driver_unregister(&pcs_driver); >> +} >> +module_exit(pcs_driver_drv_exit); >> + > Hi Grygorii, > thanks - indeed it does fix the problem. I checked at least the rtc > which is now configured right and working :-) > > Do you consider the patch above as a hack or will it go mainline? I think, need more opinions on this from community ) I'm just trying to solve my problem and found similar issue. > > Thanks > -- Christoph > > >