From: ebiederm@xmission.com (Eric W. Biederman)
To: Yinghai Lu <yinghai@kernel.org>
Cc: Alexander Beregalov <a.beregalov@gmail.com>,
Greg KH <gregkh@suse.de>,
linux-acpi@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.34-rc1: ACPI: BUG: key f71f0168 not in .data!
Date: Mon, 08 Mar 2010 23:57:46 -0800 [thread overview]
Message-ID: <m16356nczp.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <4B95F37E.6060309@kernel.org> (Yinghai Lu's message of "Mon\, 08 Mar 2010 23\:06\:38 -0800")
Yinghai Lu <yinghai@kernel.org> writes:
> On 03/08/2010 04:35 PM, Eric W. Biederman wrote:
>> Yinghai Lu <yinghai@kernel.org> writes:
>>
>> Yep this looks like a couple more cases of drivers that don't
>> statically declare and allocate their sysfs attributes.
>> The ipmi driver looks like it just wants to waste memory.
>> I haven't made sense of the thermal driver yet.
>>
>> Something like the untested patch below should fix the impi driver.
>>
>>
>> Eric
>>
>>> On Mon, Mar 8, 2010 at 3:47 PM, Alexander Beregalov
>>> <a.beregalov@gmail.com> wrote:
>>>> Hi
>>>>
>>>> Kernel version is 2.6.34-rc1
>>>>
>>>> bus: 'acpi': add driver processor
>>>> bus: 'acpi': driver_probe_device: matched device LNXCPU:00 with driver processor
>>>> bus: 'acpi': really_probe: probing driver processor with device LNXCPU:00
>>>> device: 'cooling_device0': device_add
>>>> driver: 'LNXCPU:00': driver_bound: bound to device 'processor'
>>>> bus: 'acpi': really_probe: bound device LNXCPU:00 to driver processor
>>>> bus: 'acpi': add driver thermal
>>>> bus: 'acpi': driver_probe_device: matched device LNXTHERM:00 with driver thermal
>>>> bus: 'acpi': really_probe: probing driver thermal with device LNXTHERM:00
>>>> bus: 'acpi': driver_probe_device: matched device LNXTHERM:01 with driver thermal
>>>> bus: 'acpi': really_probe: probing driver thermal with device LNXTHERM:01
>>>> device: 'thermal_zone0': device_add
>>>> BUG: key f71f0168 not in .data!
>>>> ------------[ cut here ]------------
>>>> WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0x16f/0x4f0()
>>>> Hardware name:
>>>> Modules linked in:
>>>> Pid: 1, comm: swapper Not tainted 2.6.34-rc1 #1
>>>> Call Trace:
>>>> [<c1351758>] ? printk+0x18/0x20
>>>> [<c102aa5d>] warn_slowpath_common+0x6d/0xa0
>>>> [<c104e9af>] ? lockdep_init_map+0x16f/0x4f0
>>>> [<c104e9af>] ? lockdep_init_map+0x16f/0x4f0
>>>> [<c1001000>] ? do_one_initcall+0x0/0x190
>>>> [<c102aaa5>] warn_slowpath_null+0x15/0x20
>>>> [<c104e9af>] lockdep_init_map+0x16f/0x4f0
>>>> [<c10dcd98>] sysfs_add_file_mode+0x58/0xb0
>>>> [<c10dce03>] sysfs_add_file+0x13/0x20
>>>> Switched to NOHz mode on CPU #0
>>>> [<c10dcec6>] sysfs_create_file+0x26/0x30
>>>> [<c1247ab3>] device_create_file+0x13/0x20
>>>> [<c12c5bd4>] thermal_zone_bind_cooling_device+0x1e4/0x2f0
>>>> [<c11feb35>] ? acpi_bus_data_handler+0x0/0x5
>>>> [<c121ed40>] acpi_thermal_cooling_device_cb+0x70/0x11e
>>>> [<c12c5780>] ? thermal_zone_device_register+0x260/0x400
>>>> [<c12c59f0>] ? thermal_zone_bind_cooling_device+0x0/0x2f0
>>>> [<c121ee0a>] acpi_thermal_bind_cooling_device+0xd/0xf
>>>> [<c12c57f9>] thermal_zone_device_register+0x2d9/0x400
>>>> [<c121ef82>] acpi_thermal_add+0x176/0x398
>>>> [<c10de301>] ? sysfs_do_create_link+0xa1/0x140
>>>> [<c11fec0f>] acpi_device_probe+0x3a/0xf4
>>>> [<c124a097>] driver_probe_device+0xb7/0x1b0
>>>> [<c124a219>] __driver_attach+0x89/0x90
>>>> [<c12498b8>] bus_for_each_dev+0x48/0x70
>>>> [<c1249e79>] driver_attach+0x19/0x20
>>>> [<c124a190>] ? __driver_attach+0x0/0x90
>>>> [<c124922b>] bus_add_driver+0xcb/0x230
>>>> [<c11feb45>] ? acpi_device_remove+0x0/0x90
>>>> [<c124a495>] driver_register+0x65/0x110
>>>> [<c162119a>] ? kernel_init+0x0/0x120
>>>> [<c10d6bd3>] ? proc_mkdir_mode+0x33/0x50
>>>> [<c162119a>] ? kernel_init+0x0/0x120
>>>> [<c11ffebb>] acpi_bus_register_driver+0x3a/0x3f
>>>> [<c1639062>] acpi_thermal_init+0x50/0x6f
>>>> [<c100102d>] do_one_initcall+0x2d/0x190
>>>> [<c162119a>] ? kernel_init+0x0/0x120
>>>> [<c1639012>] ? acpi_thermal_init+0x0/0x6f
>>>> [<c162119a>] ? kernel_init+0x0/0x120
>>>> [<c1621221>] kernel_init+0x87/0x120
>>>> [<c1002fba>] kernel_thread_helper+0x6/0x1c
>>>> ---[ end trace a7919e7f17c0a725 ]---
>>>
>>>
>>> got
>>>
>>> [ 145.239329] BUG: key ffff88206fe99c58 not in .data!
>>> [ 145.244994] ------------[ cut here ]------------
>>> [ 145.250949] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xf1/0x53c()
>>> [ 145.262424] Hardware name: Sun Fire x4800
>>> [ 145.267543] Modules linked in:
>>> [ 145.275078] Pid: 1, comm: swapper Not tainted 2.6.34-rc1-yh-dirty #221
>>> [ 145.285140] Call Trace:
>>> [ 145.290143] [<ffffffff810759b0>] warn_slowpath_common+0x7c/0x94
>>> [ 145.304624] [<ffffffff810759dc>] warn_slowpath_null+0x14/0x16
>>> [ 145.314632] [<ffffffff8109f299>] lockdep_init_map+0xf1/0x53c
>>> [ 145.325228] [<ffffffff8117e100>] ? sysfs_new_dirent+0x8f/0x104
>>> [ 145.334331] [<ffffffff8117d72e>] sysfs_add_file_mode+0x66/0xac
>>> [ 145.339850] [<ffffffff8117d785>] sysfs_add_file+0x11/0x13
>>> [ 145.355513] [<ffffffff8117d844>] sysfs_create_file+0x2a/0x2c
>>> [ 145.360637] [<ffffffff8148ca98>] device_create_file+0x19/0x1b
>>> [ 145.375187] [<ffffffff8145fc9a>] ipmi_register_smi+0x862/0xd72
>>> [ 145.384606] [<ffffffff8148b9f8>] ? put_device+0x17/0x19
>>> [ 145.395142] [<ffffffff8148cee5>] ? device_add+0x44b/0x52a
>>> [ 145.403666] [<ffffffff8108fb5a>] ? autoremove_wake_function+0x0/0x39
>>> [ 145.416309] [<ffffffff81462e71>] try_smi_init+0x6d0/0x8a0
>>> [ 145.424534] [<ffffffff81ba2fd5>] init_ipmi_si+0x4cf/0x907
>>> [ 145.434799] [<ffffffff81ba2b06>] ? init_ipmi_si+0x0/0x907
>>> [ 145.439677] [<ffffffff8100020d>] do_one_initcall+0x72/0x17f
>>> [ 145.455681] [<ffffffff826836a0>] kernel_init+0x166/0x1f0
>>> [ 145.463319] [<ffffffff81032914>] kernel_thread_helper+0x4/0x10
>>> [ 145.476497] [<ffffffff81bfc2bc>] ? restore_args+0x0/0x30
>>> [ 145.485014] [<ffffffff8268353a>] ? kernel_init+0x0/0x1f0
>>> [ 145.495859] [<ffffffff81032910>] ? kernel_thread_helper+0x0/0x10
>>> [ 145.501541] ---[ end trace 0ec12b1482c47368 ]---
>>
>> diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
>> index ec5e3f8..16e9073 100644
>> --- a/drivers/char/ipmi/ipmi_msghandler.c
>> +++ b/drivers/char/ipmi/ipmi_msghandler.c
>> @@ -2272,42 +2272,52 @@ static int create_files(struct bmc_device *bmc)
>> bmc->device_id_attr.attr.name = "device_id";
>> bmc->device_id_attr.attr.mode = S_IRUGO;
>> bmc->device_id_attr.show = device_id_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->provides_dev_sdrs_attr.attr.name = "provides_device_sdrs";
>> bmc->provides_dev_sdrs_attr.attr.mode = S_IRUGO;
>> bmc->provides_dev_sdrs_attr.show = provides_dev_sdrs_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->revision_attr.attr.name = "revision";
>> bmc->revision_attr.attr.mode = S_IRUGO;
>> bmc->revision_attr.show = revision_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->firmware_rev_attr.attr.name = "firmware_revision";
>> bmc->firmware_rev_attr.attr.mode = S_IRUGO;
>> bmc->firmware_rev_attr.show = firmware_rev_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->version_attr.attr.name = "ipmi_version";
>> bmc->version_attr.attr.mode = S_IRUGO;
>> bmc->version_attr.show = ipmi_version_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->add_dev_support_attr.attr.name = "additional_device_support";
>> bmc->add_dev_support_attr.attr.mode = S_IRUGO;
>> bmc->add_dev_support_attr.show = add_dev_support_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->manufacturer_id_attr.attr.name = "manufacturer_id";
>> bmc->manufacturer_id_attr.attr.mode = S_IRUGO;
>> bmc->manufacturer_id_attr.show = manufacturer_id_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->product_id_attr.attr.name = "product_id";
>> bmc->product_id_attr.attr.mode = S_IRUGO;
>> bmc->product_id_attr.show = product_id_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->guid_attr.attr.name = "guid";
>> bmc->guid_attr.attr.mode = S_IRUGO;
>> bmc->guid_attr.show = guid_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> bmc->aux_firmware_rev_attr.attr.name = "aux_firmware_revision";
>> bmc->aux_firmware_rev_attr.attr.mode = S_IRUGO;
>> bmc->aux_firmware_rev_attr.show = aux_firmware_rev_show;
>> + sysfs_attr_init(&bmc->device_id_attr.attr);
>>
>> err = device_create_file(&bmc->dev->dev,
>> &bmc->device_id_attr);
>
> still have bunch of that BUG...
I expect if you look the backtrace will be different.
There are real issues here, I just don't know how to find them
without bug reports, or volunteers helping me to fix them.
But the fixes are trivial, there is no problem if you disable lockdep,
and the machine still runs with lockdep enabled.
Which ultimately means that lockdep can finally report errors between
sysfs and files and locking reasonably accurately.
If you would be so kind and help by posting the back traces so we can
find the handful of places left that dynamically allocate their sysfs
attributes that would be very much appreciated.
Eric
next prev parent reply other threads:[~2010-03-09 7:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-08 23:47 2.6.34-rc1: ACPI: BUG: key f71f0168 not in .data! Alexander Beregalov
2010-03-09 0:12 ` Yinghai Lu
2010-03-09 0:32 ` Yinghai Lu
2010-03-09 0:40 ` Américo Wang
2010-03-09 0:35 ` Eric W. Biederman
2010-03-09 7:06 ` Yinghai Lu
2010-03-09 7:57 ` Eric W. Biederman [this message]
2010-03-09 7:57 ` Eric W. Biederman
2010-03-12 2:29 ` Yinghai Lu
2010-03-12 2:32 ` Yinghai Lu
2010-03-13 3:36 ` Yinghai Lu
2010-03-13 3:54 ` Greg KH
2010-03-13 3:37 ` Yinghai Lu
2010-03-13 4:46 ` James Bottomley
2010-03-13 4:58 ` Eric W. Biederman
2010-03-13 5:13 ` Matthew Wilcox
2010-03-20 7:17 ` [PATCH] scsi: fix lockdep warning Yinghai Lu
2010-03-20 7:57 ` Wolfram Sang
2010-03-20 12:58 ` Greg KH
2010-03-20 15:41 ` James Bottomley
2010-03-20 19:07 ` [PATCH] driver: fix lockdep with sysfs Yinghai Lu
2010-03-30 15:05 ` [PATCH] scsi: fix lockdep warning Ben Gamari
2010-03-30 17:08 ` Yinghai Lu
2010-03-30 20:33 ` Ben Gamari
2010-03-31 1:55 ` Wolfram Sang
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=m16356nczp.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=a.beregalov@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yinghai@kernel.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