From patchwork Mon Apr 15 10:20:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 2444501 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DB0BD3FD1A for ; Mon, 15 Apr 2013 10:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753946Ab3DOKVd (ORCPT ); Mon, 15 Apr 2013 06:21:33 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:59794 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753635Ab3DOKVc (ORCPT ); Mon, 15 Apr 2013 06:21:32 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r3FAL8n5007073; Mon, 15 Apr 2013 05:21:08 -0500 Received: from DNCE70.ent.ti.com (dnce70.ent.ti.com [137.167.131.19]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3FAL7Ye031282; Mon, 15 Apr 2013 05:21:07 -0500 Received: from [10.167.145.172] (10.167.145.172) by DNCE70.ent.ti.com (137.167.131.19) with Microsoft SMTP Server id 14.1.323.3; Mon, 15 Apr 2013 12:21:07 +0200 Message-ID: <516BD479.2020904@ti.com> Date: Mon, 15 Apr 2013 13:20:41 +0300 From: Grygorii Strashko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 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" , , Daniel Mack , "Hans J. Koch" Subject: Re: [BUG] omap: mfd/regulator: twl/core: init order References: <1365877659.3812.110.camel@mars> In-Reply-To: <1365877659.3812.110.camel@mars> X-Originating-IP: [10.167.145.172] X-EXCLAIMER-MD-CONFIG: f9c360f5-3d1e-4c3c-8703-f45bf52eff6b Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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: pinctrl driver"); > Thanks > -- Christoph > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); + MODULE_AUTHOR("Tony Lindgren "); MODULE_DESCRIPTION("One-register-per-pin type device tree based