From: kbaidarov@dev.rtsoft.ru (Konstantin Baydarov)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 04/11] OMAP: Add early device for system control module
Date: Fri, 25 May 2012 15:32:23 +0400 [thread overview]
Message-ID: <4FBF6DC7.6070707@dev.rtsoft.ru> (raw)
In-Reply-To: <1337934361-1606-5-git-send-email-eduardo.valentin@ti.com>
Hi , Eduardo.
On 05/25/2012 12:25 PM, Eduardo Valentin wrote:
> This is a way to add an early device for system control module.
> the code is also requesting for driver registration and probing.
> Done at early_initcall because at that time, ioremapping is possible.
>
> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
> ---
> arch/arm/mach-omap2/devices.c | 29 +++++++++++++++++++++++++++++
> 1 files changed, 29 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 9332673..58cc5c3 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -40,6 +40,35 @@
> #define L3_MODULES_MAX_LEN 12
> #define L3_MODULES 3
>
> +static struct resource control_resources[] = {
> + [0] = {
> + .start = 0x4a002000,
> + .end = 0x4a0027ff,
> + .flags = IORESOURCE_MEM,
> + },
> +};
> +static struct platform_device control_device = {
> + .name = "omap-control-core",
> + .id = 0,
> + .resource = control_resources,
> + .num_resources = ARRAY_SIZE(control_resources),
> +};
> +
> +static struct platform_device *early_devices[] __initdata = {
> + &control_device,
> +};
> +
> +static int __init plat_early_device_setup(void)
> +{
> + early_platform_add_devices(early_devices,
> + ARRAY_SIZE(early_devices));
> + early_platform_driver_register_all("early_omap_control");
> + early_platform_driver_probe("early_omap_control", 1, false);
I checked out git://gitorious.org/omap-thermal/omap-thermal.git omap_scm_dev.
Looks like that calling devm_kzalloc() and platform_get_resource() from early_initcall is too early.
I get following backtrace (probably the backtrace is kernel config dependent):
...
[ 0.198455] [<c00193b4>] (unwind_backtrace+0x0/0xe0) from [<c02b2a10>] (do_raw_spin_lock+0x20/0x134)
[ 0.207977] [<c02b2a10>] (do_raw_spin_lock+0x20/0x134) from [<c05df068>] (_raw_spin_lock_irqsave+0x58/0x64)
[ 0.218109] [<c05df068>] (_raw_spin_lock_irqsave+0x58/0x64) from [<c02f03bc>] (devres_add+0x18/0x38)
[ 0.227600] [<c02f03bc>] (devres_add+0x18/0x38) from [<c02f07d0>] (devm_kzalloc+0x50/0x5c)
[ 0.236206] [<c02f07d0>] (devm_kzalloc+0x50/0x5c) from [<c05c73a4>] (omap_control_probe+0x20/0xe4)
[ 0.245544] [<c05c73a4>] (omap_control_probe+0x20/0xe4) from [<c07b3178>] (early_platform_driver_probe+0x1ac/0x23c)
[ 0.256378] [<c07b3178>] (early_platform_driver_probe+0x1ac/0x23c) from [<c0798030>] (plat_early_device_setup+0x2c/0x3c)
[ 0.267700] [<c0798030>] (plat_early_device_setup+0x2c/0x3c) from [<c078f8c4>] (do_one_initcall+0x90/0x164)
[ 0.277801] [<c078f8c4>] (do_one_initcall+0x90/0x164) from [<c078f9ec>] (kernel_init+0x54/0x1a4)
[ 0.286956] [<c078f9ec>] (kernel_init+0x54/0x1a4) from [<c0013818>] (kernel_thread_exit+0x0/0x8)
[ 0.296203] ------------[ cut here ]------------
[ 0.301086] WARNING: at include/linux/kref.h:41 kobject_get+0x24/0x48()
[ 0.308044] [<c00193b4>] (unwind_backtrace+0x0/0xe0) from [<c00394a4>] (warn_slowpath_common+0x48/0x60)
[ 0.317871] [<c00394a4>] (warn_slowpath_common+0x48/0x60) from [<c0039574>] (warn_slowpath_null+0x18/0x1c)
[ 0.327941] [<c0039574>] (warn_slowpath_null+0x18/0x1c) from [<c02a59b4>] (kobject_get+0x24/0x48)
[ 0.337219] [<c02a59b4>] (kobject_get+0x24/0x48) from [<c02eb588>] (get_device+0x14/0x1c)
[ 0.345764] [<c02eb588>] (get_device+0x14/0x1c) from [<c02eb66c>] (device_add+0xc4/0x594)
[ 0.354370] [<c02eb66c>] (device_add+0xc4/0x594) from [<c03eeab4>] (of_platform_device_create_pdata+0x5c/0x7c)
[ 0.364807] [<c03eeab4>] (of_platform_device_create_pdata+0x5c/0x7c) from [<c03eec94>] (of_platform_bus_create+0x1c0/0x258)
[ 0.376403] [<c03eec94>] (of_platform_bus_create+0x1c0/0x258) from [<c03eee4c>] (of_platform_populate+0x5c/0x88)
[ 0.387023] [<c03eee4c>] (of_platform_populate+0x5c/0x88) from [<c07b3178>] (early_platform_driver_probe+0x1ac/0x23c)
[ 0.398101] [<c07b3178>] (early_platform_driver_probe+0x1ac/0x23c) from [<c0798030>] (plat_early_device_setup+0x2c/0x3c)
[ 0.409423] [<c0798030>] (plat_early_device_setup+0x2c/0x3c) from [<c078f8c4>] (do_one_initcall+0x90/0x164)
[ 0.419586] [<c078f8c4>] (do_one_initcall+0x90/0x164) from [<c078f9ec>] (kernel_init+0x54/0x1a4)
[ 0.428771] [<c078f9ec>] (kernel_init+0x54/0x1a4) from [<c0013818>] (kernel_thread_exit+0x0/0x8)
[ 0.437957] ---[ end trace da227214a82491b7 ]--
...
BR,
Konstantin Baydarov.
> +
> + return 0;
> +}
> +early_initcall(plat_early_device_setup);
> +
> static int omap_init_control(void)
> {
> struct omap_hwmod *oh;
next prev parent reply other threads:[~2012-05-25 11:32 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-25 8:25 [RFC PATCH 00/11] OMAP System Control Module Eduardo Valentin
2012-05-25 8:25 ` [RFC PATCH 01/11] ARM: OMAP4: Remove un-used control module headers and defines Eduardo Valentin
2012-05-28 9:12 ` Shilimkar, Santosh
2012-05-25 8:25 ` [RFC PATCH 02/11] ARM: OMAP: expose control.h to mach area Eduardo Valentin
2012-05-28 9:25 ` Shilimkar, Santosh
2012-05-28 10:30 ` Valentin, Eduardo
2012-06-01 11:19 ` Tony Lindgren
2012-05-25 8:25 ` [RFC PATCH 03/11] arm: omap: device: create a device for system control module Eduardo Valentin
2012-05-25 12:30 ` Cousson, Benoit
2012-05-29 9:44 ` Eduardo Valentin
2012-06-14 13:50 ` Konstantin Baydarov
2012-06-15 9:22 ` Valentin, Eduardo
2012-05-29 13:39 ` Konstantin Baydarov
2012-05-25 8:25 ` [RFC PATCH 04/11] OMAP: Add early " Eduardo Valentin
2012-05-25 11:32 ` Konstantin Baydarov [this message]
2012-05-25 11:44 ` Valentin, Eduardo
2012-05-25 11:54 ` Konstantin Baydarov
2012-05-25 12:32 ` Cousson, Benoit
2012-05-28 9:58 ` Shilimkar, Santosh
2012-05-25 8:25 ` [RFC PATCH 05/11] mfd: omap: control: core system control driver Eduardo Valentin
2012-05-25 12:52 ` Cousson, Benoit
2012-05-28 11:35 ` Eduardo Valentin
2012-05-29 13:25 ` Cousson, Benoit
2012-06-01 11:29 ` Tony Lindgren
2012-06-01 12:30 ` Shilimkar, Santosh
2012-06-01 12:43 ` Cousson, Benoit
2012-06-01 17:19 ` Eduardo Valentin
2012-06-01 13:40 ` Konstantin Baydarov
2012-06-01 14:13 ` Tony Lindgren
2012-06-01 14:26 ` Konstantin Baydarov
2012-05-28 9:54 ` Shilimkar, Santosh
2012-05-28 11:42 ` Eduardo Valentin
2012-05-28 13:15 ` Shilimkar, Santosh
2012-05-29 13:31 ` Cousson, Benoit
2012-05-25 8:25 ` [RFC PATCH 06/11] OMAP2+: use control module mfd driver in omap_type Eduardo Valentin
2012-05-25 12:53 ` Cousson, Benoit
2012-05-28 10:02 ` Shilimkar, Santosh
2012-05-28 11:24 ` Eduardo Valentin
2012-06-01 11:35 ` Tony Lindgren
2012-05-25 8:25 ` [RFC PATCH 07/11] mfd: omap: control: usb-phy: introduce the ctrl-module usb driver Eduardo Valentin
2012-05-25 13:35 ` Shubhrajyoti Datta
2012-05-25 15:06 ` Cousson, Benoit
2012-06-01 11:38 ` Tony Lindgren
2012-06-01 13:20 ` [linux-pm] " Tony Lindgren
2012-06-01 14:07 ` Kevin Hilman
2012-06-01 14:15 ` Tony Lindgren
2012-05-25 8:25 ` [RFC PATCH 08/11] ARM: OMAP4+: Adding the temperature sensor register set bit fields Eduardo Valentin
2012-05-25 15:13 ` Cousson, Benoit
2012-05-28 11:17 ` Eduardo Valentin
2012-05-28 10:04 ` Shilimkar, Santosh
2012-05-28 11:18 ` Eduardo Valentin
2012-05-25 8:25 ` [RFC PATCH 09/11] ARM: OMAP4+: thermal: introduce bandgap temperature sensor Eduardo Valentin
2012-05-25 15:49 ` Cousson, Benoit
2012-05-28 11:06 ` Eduardo Valentin
2012-05-28 11:16 ` Eduardo Valentin
2012-05-29 13:14 ` Cousson, Benoit
2012-05-29 17:51 ` Mike Turquette
2012-05-25 16:39 ` Konstantin Baydarov
2012-05-28 10:55 ` Eduardo Valentin
2012-06-01 11:42 ` Tony Lindgren
2012-05-25 8:26 ` [RFC PATCH 10/11] omap4: thermal: add basic CPU thermal zone Eduardo Valentin
2012-05-28 9:33 ` Shilimkar, Santosh
2012-05-28 9:48 ` Felipe Balbi
2012-05-28 10:26 ` Valentin, Eduardo
2012-05-29 12:54 ` Cousson, Benoit
2012-05-25 8:26 ` [RFC PATCH 11/11] ARM: DT: Add support to system control module for OMAP4 Eduardo Valentin
2012-05-29 9:49 ` Konstantin Baydarov
2012-05-30 8:38 ` Cousson, Benoit
2012-05-30 9:05 ` Konstantin Baydarov
2012-05-30 9:26 ` Cousson, Benoit
2012-05-30 10:17 ` Konstantin Baydarov
2012-05-30 10:22 ` Cousson, Benoit
2012-05-30 10:42 ` Eduardo Valentin
2012-05-30 12:16 ` Cousson, Benoit
2012-05-31 12:06 ` Konstantin Baydarov
2012-05-31 12:49 ` Eduardo Valentin
2012-05-31 12:52 ` Cousson, Benoit
2012-05-31 14:51 ` Konstantin Baydarov
2012-05-25 8:35 ` [RFC PATCH 00/11] OMAP System Control Module Eduardo Valentin
2012-05-25 10:50 ` Konstantin Baydarov
2012-05-25 11:11 ` Valentin, Eduardo
2012-05-25 12:21 ` Konstantin Baydarov
2012-06-01 0:12 ` [linux-pm] " Kevin Hilman
2012-06-18 11:32 ` [RFC PATCH v2 01/11] ARM: OMAP4: Remove un-used control module headers and defines Konstantin Baydarov
2012-06-18 11:32 ` [RFC PATCH v2 02/11] ARM: OMAP: expose control.h to mach area Konstantin Baydarov
2012-06-20 10:17 ` Tony Lindgren
2012-06-18 11:32 ` [RFC PATCH v2 03/11] mfd: omap: control: core system control driver Konstantin Baydarov
2012-06-20 10:22 ` Tony Lindgren
2012-06-20 14:13 ` Konstantin Baydarov
2012-06-26 11:17 ` Tony Lindgren
2012-06-18 11:32 ` [RFC PATCH v2 04/11] OMAP2+: use control module mfd driver in omap_type Konstantin Baydarov
2012-06-20 10:24 ` Tony Lindgren
2012-06-18 11:32 ` [RFC PATCH v2 05/11] mfd: omap: control: usb-phy: introduce the ctrl-module usb driver Konstantin Baydarov
2012-06-18 11:32 ` [RFC PATCH v2 06/11] ARM: OMAP4+: Adding the temperature sensor register set bit fields Konstantin Baydarov
2012-06-20 10:25 ` Tony Lindgren
2012-06-18 11:32 ` [RFC PATCH v2 07/11] ARM: OMAP4+: thermal: introduce bandgap temperature sensor Konstantin Baydarov
2012-06-18 11:32 ` [RFC PATCH v2 08/11] omap4: thermal: add basic CPU thermal zone Konstantin Baydarov
2012-06-18 11:32 ` [RFC PATCH v2 09/11] ARM: DT: Add support to system control module for OMAP4 Konstantin Baydarov
2012-06-18 12:13 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FBF6DC7.6070707@dev.rtsoft.ru \
--to=kbaidarov@dev.rtsoft.ru \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).