From patchwork Wed Jan 23 04:26:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\"Rajanikanth H.V" X-Patchwork-Id: 14221 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B502023E00 for ; Wed, 23 Jan 2013 04:27:11 +0000 (UTC) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by fiordland.canonical.com (Postfix) with ESMTP id 36043A1890E for ; Wed, 23 Jan 2013 04:27:11 +0000 (UTC) Received: by mail-vb0-f48.google.com with SMTP id fc21so2356092vbb.21 for ; Tue, 22 Jan 2013 20:27:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=x6VmzYbjlhl4//IHpSktNyukhRiHeAcnufHZOlvoPRI=; b=bPGaBxZzK3tjArZqWTfEp9ZeFFDSX4WQujxZjThb8M1sCCAePJj4geRU6bhVCL8aXG i7ZkIPrYuScpxU+iNTwfSkOLxtsspHrcQ13DOtr7KL2TJdA7/bYAzaKVWhNxBFRiMi4r z088cUvBZcrZzKejfzcpq+Z+dd+BSIcDOc1yPuo4DV+W5F9y5Lladow2U3fxXbx1Hqrf UhZVQ07WWnZ4UYHx3oUxoVDA8TuECKHPv8B1k5OuRdZJ0UpSCxHRhQd++7/H07CxKEAd stjtLycTVkT1ecW6CUkvtVO+D6KWq7D3mGZGkKLrKnWC7FSgyH/DEM/hvzOugfurHObW ALPA== X-Received: by 10.52.88.168 with SMTP id bh8mr22620747vdb.51.1358915230663; Tue, 22 Jan 2013 20:27:10 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp285553veb; Tue, 22 Jan 2013 20:27:09 -0800 (PST) X-Received: by 10.14.203.2 with SMTP id e2mr80018138eeo.20.1358915228755; Tue, 22 Jan 2013 20:27:08 -0800 (PST) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com [207.126.144.149]) by mx.google.com with SMTP id b7si33412596eep.117.2013.01.22.20.26.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 22 Jan 2013 20:27:08 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of rajanikanth.hv@stericsson.com) client-ip=207.126.144.149; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of rajanikanth.hv@stericsson.com) smtp.mail=rajanikanth.hv@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKUP9mj7ah70L9HN5Xttlx1WBy7DMzw5gG@postini.com; Wed, 23 Jan 2013 04:27:07 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 64A60E3; Wed, 23 Jan 2013 04:18:39 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 8B591100F; Wed, 23 Jan 2013 04:26:49 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id BE94AA8072; Wed, 23 Jan 2013 05:26:46 +0100 (CET) Received: from ubuntu12.bnr.st.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 23 Jan 2013 05:26:48 +0100 From: Rajanikanth H.V To: Cc: , , , , , , , Subject: [PATCH] ab8500: btemp: demote initcall sequence Date: Wed, 23 Jan 2013 09:56:45 +0530 Message-ID: <1358915205-7786-1-git-send-email-rajanikanth.hv@stericsson.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQntty1WzFGYH8H3aXww/87a6RYpjb0l0s79VKRFR1aWL9nbKfhjbEEf9QruYDyZm1ITZVg5 From: "Rajanikanth H.V" Power supply subsystem creates thermal zone device for the property 'POWER_SUPPLY_PROP_TEMP' which requires thermal subsystem to be ready before 'ab8500 battery temperature monitor' driver is initialized. ab8500 btemp driver is initialized with subsys_initcall whereas thermal subsystem is initialized with fs_initcall which causes thermal_zone_device_register(...) to crash since the required structure 'thermal_class' is not initialized yet. crash log: =================================================================== Unable to handle kernel NULL pointer dereference at virtual address 000000a4 pgd = c0004000 [000000a4] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 Tainted: G W (3.8.0-rc4-00001-g632fda8-dirty #1) PC is at _raw_spin_lock+0x18/0x54 LR is at get_device_parent+0x50/0x1b8 pc : [] lr : [] psr: 60000013 sp : ef04bdc8 ip : 00000000 fp : c0446180 r10: ef216e38 r9 : c03af5d0 r8 : ef275c18 r7 : 00000000 r6 : c0476c14 r5 : ef275c18 r4 : ef095840 r3 : ef04a000 r2 : 00000001 r1 : 00000000 r0 : 000000a4 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5787d Table: 0000404a DAC: 00000015 Process swapper/0 (pid: 1, stack limit = 0xef04a238) Stack: (0xef04bdc8 to 0xef04c000) bdc0: ef275c18 00000000 00000000 c01cb8d8 00000000 ef275c18 bde0: ef275c80 00000000 c0446180 c01d3edc ef275c18 ef275c00 00000000 00000000 be00: c03af5d0 ef275c18 c03af5d0 ef216e38 c0446180 c020b91c 00000000 ef275c04 be20: ef04be48 ef1ad000 ef216e38 ef1ad000 ef216e38 00000000 ef1b9010 00000002 be40: c03af5d0 00000000 c0446058 c0202030 c0445400 00000000 00000000 00000000 be60: ef216e10 ef1b9000 c04457f4 c02055ec 00000000 c01d57ac ef216e38 ef037a00 be80: ef181fc0 00000000 ef1b9010 c0476c38 ef1b9010 ef1b9044 c0446008 c041bbb0 bea0: c044d940 ef04a000 c0414b68 c01cf0dc c01cf0c8 c01cde70 00000000 ef1b9010 bec0: c0446008 ef1b9044 00000000 c01ce094 00000000 c0446008 c01ce008 c01cc640 bee0: ef032258 ef180334 ef222f00 c0446008 c0441778 c01cd6b4 c03ab170 c0446008 bf00: c0446008 c041bbd0 00000005 c044d940 c041bbb0 c01ce54c 00000000 c0422988 bf20: c041bbd0 00000005 c044d940 c041bbb0 ef04a000 c00086ac 00000049 c00360cc bf40: ef04bf6c 00000000 c0388c34 c03e1a78 00000004 00000004 c0436998 c0422988 bf60: c041bbd0 00000005 c044d940 c041bbb0 c040027c 00000049 00000000 c02e89c8 bf80: 00000004 00000004 c040027c c0c88340 00000000 c02e88a8 00000000 00000000 bfa0: 00000000 00000000 00000000 c000e358 00000000 00000000 00000000 00000000 bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 80800004 00304600 [] (_raw_spin_lock+0x18/0x54) from [] (get_device_parent+0x50/0x1b8) [] (get_device_parent+0x50/0x1b8) from [] (device_add+0xa4/0x574) [] (device_add+0xa4/0x574) from [] (thermal_zone_device_register+0x118/0x938) [] (thermal_zone_device_register+0x118/0x938) from [] (power_supply_register+0x170/0x1f8) [] (power_supply_register+0x170/0x1f8) from [] (ab8500_btemp_probe+0x208/0x47c) [] (ab8500_btemp_probe+0x208/0x47c) from [] (platform_drv_probe+0x14/0x18) [] (platform_drv_probe+0x14/0x18) from [] (driver_probe_device+0x74/0x20c) [] (driver_probe_device+0x74/0x20c) from [] (__driver_attach+0x8c/0x90) [] (__driver_attach+0x8c/0x90) from [] (bus_for_each_dev+0x4c/0x80) [] (bus_for_each_dev+0x4c/0x80) from [] (bus_add_driver+0x16c/0x23c) [] (bus_add_driver+0x16c/0x23c) from [] (driver_register+0x78/0x14c) [] (driver_register+0x78/0x14c) from [] (do_one_initcall+0xfc/0x164) [] (do_one_initcall+0xfc/0x164) from [] (kernel_init+0x120/0x2b8) [] (kernel_init+0x120/0x2b8) from [] (ret_from_fork+0x14/0x3c) Code: e3c3303f e5932004 e2822001 e5832004 (e1903f9f) ---[ end trace ed9df72941b5bada ]--- =================================================================== Signed-off-by: Rajanikanth H.V --- drivers/power/ab8500_btemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index 20e2a7d..056222e 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c @@ -1123,7 +1123,7 @@ static void __exit ab8500_btemp_exit(void) platform_driver_unregister(&ab8500_btemp_driver); } -subsys_initcall_sync(ab8500_btemp_init); +device_initcall(ab8500_btemp_init); module_exit(ab8500_btemp_exit); MODULE_LICENSE("GPL v2");