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 ]---
thermal LNXTHERM:01: registered as thermal_zone0
ACPI: Thermal Zone [THRM] (39 C)
driver: 'LNXTHERM:01': driver_bound: bound to device 'thermal'
bus: 'acpi': really_probe: bound device LNXTHERM:01 to driver thermal
CONFIG_ACPI=y
# CONFIG_ACPI_PROCFS is not set
# CONFIG_ACPI_PROCFS_POWER is not set
# CONFIG_ACPI_POWER_METER is not set
# CONFIG_ACPI_SYSFS_POWER is not set
# CONFIG_ACPI_PROC_EVENT is not set
# CONFIG_ACPI_AC is not set
# CONFIG_ACPI_BATTERY is not set
# CONFIG_ACPI_BUTTON is not set
# CONFIG_ACPI_FAN is not set
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PROCESSOR=y
# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
# CONFIG_ACPI_PCI_SLOT is not set
# CONFIG_ACPI_CONTAINER is not set
# CONFIG_ACPI_SBS is not set
# CONFIG_X86_ACPI_CPUFREQ is not set
CONFIG_PNPACPI=y
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
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 ]---
related to ?
commit a2db6842873c8e5a70652f278d469128cb52db70
Author: Eric W. Biederman <ebie...@xmission.com>
Date: Thu Feb 11 15:20:00 2010 -0800
sysfs: Only take active references on attributes.
If we exclude directories and symlinks from the set of sysfs
dirents where we need active references we are left with
sysfs attributes (binary or not).
- Tweak sysfs_deactivate to only do something on attributes
- Move lockdep initialization into sysfs_file_add_mode to
limit it to just attributes.
Yes. Need to add sysfs_attr_init() or sysfs_bin_attr_init() in the
driver code.
--
Live like a child, think like the god.
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.ber...@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
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...
YH
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
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
still need this one for inifiniband.
---
drivers/infiniband/core/sysfs.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-2.6/drivers/infiniband/core/sysfs.c
===================================================================
--- linux-2.6.orig/drivers/infiniband/core/sysfs.c
+++ linux-2.6/drivers/infiniband/core/sysfs.c
@@ -461,6 +461,7 @@ alloc_group_attrs(ssize_t (*show)(struct
element->attr.attr.mode = S_IRUGO;
element->attr.show = show;
element->index = i;
+ sysfs_attr_init(&element->attr.attr);
tab_attr[i] = &element->attr.attr;
have some typo in your patch.. all have the same name....
change them to right name, will fix that in ipmi path...
---
drivers/char/ipmi/ipmi_msghandler.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: linux-2.6/drivers/char/ipmi/ipmi_msghandler.c
===================================================================
--- linux-2.6.orig/drivers/char/ipmi/ipmi_msghandler.c
+++ linux-2.6/drivers/char/ipmi/ipmi_msghandler.c
@@ -2272,42 +2272,52 @@ static int create_files(struct bmc_devic
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->provides_dev_sdrs_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->revision_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->firmware_rev_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->version_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->add_dev_support_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->manufacturer_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->product_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->guid_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->aux_firmware_rev_attr.attr);
err = device_create_file(&bmc->dev->dev,
&bmc->device_id_attr);
Index: linux-2.6/drivers/scsi/lpfc/lpfc_attr.c
===================================================================
--- linux-2.6.orig/drivers/scsi/lpfc/lpfc_attr.c
+++ linux-2.6/drivers/scsi/lpfc/lpfc_attr.c
@@ -3780,6 +3780,7 @@ lpfc_alloc_sysfs_attr(struct lpfc_vport
struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
int error;
+ sysfs_bin_attr_init(&sysfs_drvr_stat_data_attr);
error = sysfs_create_bin_file(&shost->shost_dev.kobj,
&sysfs_drvr_stat_data_attr);
@@ -3787,11 +3788,13 @@ lpfc_alloc_sysfs_attr(struct lpfc_vport
if (error || vport->port_type == LPFC_NPIV_PORT)
goto out;
+ sysfs_bin_attr_init(&sysfs_ctlreg_attr);
error = sysfs_create_bin_file(&shost->shost_dev.kobj,
&sysfs_ctlreg_attr);
if (error)
goto out_remove_stat_attr;
+ sysfs_bin_attr_init(&sysfs_mbox_attr);
error = sysfs_create_bin_file(&shost->shost_dev.kobj,
&sysfs_mbox_attr);
if (error)
Index: linux-2.6/drivers/scsi/scsi_sysfs.c
===================================================================
--- linux-2.6.orig/drivers/scsi/scsi_sysfs.c
+++ linux-2.6/drivers/scsi/scsi_sysfs.c
@@ -907,20 +907,27 @@ int scsi_sysfs_add_sdev(struct scsi_devi
/* create queue files, which may be writable, depending on the host */
if (sdev->host->hostt->change_queue_depth) {
+ sysfs_bin_attr_init(&sdev_attr_queue_depth_rw);
error = device_create_file(&sdev->sdev_gendev,
&sdev_attr_queue_depth_rw);
+ sysfs_bin_attr_init(&sdev_attr_queue_ramp_up_period);
error = device_create_file(&sdev->sdev_gendev,
&sdev_attr_queue_ramp_up_period);
}
- else
+ else {
+ sysfs_bin_attr_init(&dev_attr_queue_depth);
error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth);
+ }
if (error)
return error;
- if (sdev->host->hostt->change_queue_type)
+ if (sdev->host->hostt->change_queue_type) {
+ sysfs_bin_attr_init(&sdev_attr_queue_type_rw);
error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw);
- else
+ } else {
+ sysfs_bin_attr_init(&dev_attr_queue_type);
error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type);
+ }
if (error)
return error;
@@ -935,6 +942,7 @@ int scsi_sysfs_add_sdev(struct scsi_devi
/* add additional host specific attributes */
if (sdev->host->hostt->sdev_attrs) {
for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) {
+ sysfs_bin_attr_init(sdev->host->hostt->sdev_attrs[i]);
error = device_create_file(&sdev->sdev_gendev,
sdev->host->hostt->sdev_attrs[i]);
if (error)
@@ -1060,6 +1068,7 @@ int scsi_sysfs_add_host(struct Scsi_Host
/* add host specific attributes */
if (shost->hostt->shost_attrs) {
for (i = 0; shost->hostt->shost_attrs[i]; i++) {
+ sysfs_bin_attr_init(shost->hostt->shost_attrs[i]);
error = device_create_file(&shost->shost_dev,
shost->hostt->shost_attrs[i]);
if (error)
Index: linux-2.6/drivers/base/attribute_container.c
===================================================================
--- linux-2.6.orig/drivers/base/attribute_container.c
+++ linux-2.6/drivers/base/attribute_container.c
@@ -328,6 +328,7 @@ attribute_container_add_attrs(struct dev
return sysfs_create_group(&classdev->kobj, cont->grp);
for (i = 0; attrs[i]; i++) {
+ sysfs_bin_attr_init(attrs[i]);
error = device_create_file(classdev, attrs[i]);
if (error)
return error;
Index: linux-2.6/drivers/net/mlx4/main.c
===================================================================
--- linux-2.6.orig/drivers/net/mlx4/main.c
+++ linux-2.6/drivers/net/mlx4/main.c
@@ -1023,6 +1023,7 @@ static int mlx4_init_port_info(struct ml
info->port_attr.attr.mode = S_IRUGO | S_IWUSR;
info->port_attr.show = show_port_type;
info->port_attr.store = set_port_type;
+ sysfs_attr_init(&info->port_attr.attr);
err = device_create_file(&dev->pdev->dev, &info->port_attr);
if (err) {
No change log entry + no Signed-off-by: line = email deleted
It's as if we write documentation on how to do all of this to just watch
no one read it :(
Added linux-scsi, since this seems to be a SCSI fix.
I've no idea what actual problem this is fixing, what's the descriptive
changelog for this?
James
> On Fri, 2010-03-12 at 19:37 -0800, Yinghai Lu wrote:
>> ---
>> drivers/base/attribute_container.c | 1 +
>> drivers/scsi/lpfc/lpfc_attr.c | 3 +++
>> drivers/scsi/scsi_sysfs.c | 15 ++++++++++++---
>> 3 files changed, 16 insertions(+), 3 deletions(-)
>
> Added linux-scsi, since this seems to be a SCSI fix.
>
> I've no idea what actual problem this is fixing, what's the descriptive
> changelog for this?
The root problem is that we occasionally have unrecognized deadlocks
on the sysfs attributes.
For 2.6.33 I managed to get lockdep mostly working but there the way
I did it generated a lot of false positives.
For 2.6.34 I reworked the sysfs lockdep handling to remove the false
positives by treating each sysfs attribute as it's own class. Most
sysfs attributes are declared statically and don't need any
initialization. Unfortunately there are a handful of dynamically
allocated sysfs attributes that do need initialization.
This patch is a fix to get one of those last handful of dynamically
allocated sysfs attributes that I missed and apparently do not
exist in my test system.
None of this has any effect (for now) when lockdep is disabled.
Eric
There's a few more than this showing up on my laptop. Looking in dmesg,
the first gets a backtrace:
[ 1.034471] BUG: key f6a26638 not in .data!
[ 1.034600] ------------[ cut here ]------------
[ 1.034736] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xd1/0x40c()
[ 1.034867] Hardware name: LifeBook P8010
[ 1.034993] Modules linked in:
[ 1.035170] Pid: 1, comm: swapper Not tainted 2.6.34-rc1-00005-g522dba7 #80
[ 1.035300] Call Trace:
[ 1.035428] [<c102caba>] warn_slowpath_common+0x60/0x90
[ 1.035561] [<c102caf7>] warn_slowpath_null+0xd/0x10
[ 1.035694] [<c104fa6a>] lockdep_init_map+0xd1/0x40c
[ 1.035827] [<c10de32a>] ? sysfs_new_dirent+0x73/0xdb
[ 1.035959] [<c10ddc56>] sysfs_add_file_mode+0x4c/0x88
[ 1.036132] [<c10ddca0>] sysfs_add_file+0xe/0x13
[ 1.036264] [<c10ddd32>] sysfs_create_file+0x20/0x22
[ 1.036394] [<c11ee279>] device_create_file+0x13/0x15
[ 1.036528] [<c129246e>] thermal_zone_device_register+0x3d0/0x5db
[ 1.036662] [<c11b160f>] acpi_thermal_add+0x1f6/0x42d
Subsequent ones don't:
[ 1.039072] BUG: key f6a26668 not in .data!
[ 1.039220] BUG: key f6a2f488 not in .data!
[ 1.039358] BUG: key f6a2f408 not in .data!
[ 1.039571] thermal LNXTHERM:01: registered as thermal_zone0
[ 1.039719] ACPI: Thermal Zone [TZ00] (27 C)
[ 1.040515] BUG: key f6a18e38 not in .data!
[ 1.040648] BUG: key f6a18e68 not in .data!
[ 1.040800] BUG: key f6a9ef88 not in .data!
[ 1.040941] BUG: key f6a9ef08 not in .data!
[ 1.041185] thermal LNXTHERM:02: registered as thermal_zone1
[ 25.196957] iwlagn 0000:14:00.0: firmware: requesting iwlwifi-4965-2.ucode
[ 25.197163] BUG: key f663393c not in .data!
[ 25.217340] iwlagn 0000:14:00.0: loaded firmware version 228.57.2.21
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
Signed-off-by: Yinghai Lu <yin...@kernel.org>
---
drivers/base/attribute_container.c | 1 +
drivers/scsi/lpfc/lpfc_attr.c | 3 +++
drivers/scsi/scsi_sysfs.c | 15 ++++++++++++---
3 files changed, 16 insertions(+), 3 deletions(-)
Index: linux-2.6/drivers/scsi/lpfc/lpfc_attr.c
Huh, why is this? They are statically declared.
> if (error)
> Index: linux-2.6/drivers/scsi/scsi_sysfs.c
> ===================================================================
> --- linux-2.6.orig/drivers/scsi/scsi_sysfs.c
> +++ linux-2.6/drivers/scsi/scsi_sysfs.c
> @@ -907,20 +907,27 @@ int scsi_sysfs_add_sdev(struct scsi_devi
>
> /* create queue files, which may be writable, depending on the host */
> if (sdev->host->hostt->change_queue_depth) {
> + sysfs_bin_attr_init(&sdev_attr_queue_depth_rw);
> error = device_create_file(&sdev->sdev_gendev,
> &sdev_attr_queue_depth_rw);
> + sysfs_bin_attr_init(&sdev_attr_queue_ramp_up_period);
> error = device_create_file(&sdev->sdev_gendev,
> &sdev_attr_queue_ramp_up_period);
ditto
> }
> - else
> + else {
> + sysfs_bin_attr_init(&dev_attr_queue_depth);
> error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth);
> + }
> if (error)
> return error;
>
> - if (sdev->host->hostt->change_queue_type)
> + if (sdev->host->hostt->change_queue_type) {
> + sysfs_bin_attr_init(&sdev_attr_queue_type_rw);
> error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw);
ditto
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Is this still needed with 2.6.34-rc2?
And as was pointed out, this does not look correct as you are doing it
on static attributes.
thanks,
greg k-h
These are all clearly wrong. The attribute in question is a device
attribute not a binary attribute. It only actually compiles because
whoever did sysfs_bin_attr_init() has no type checking on the define and
it just so happens that struct device_attr has a member named attr as
well.
Also, none of these are dynamic attributes, so they shouldn't actually
need initialisation even for lockdep, so what went wrong?
James
[ 135.305026] QLogic Fibre Channel HBA Driver: 8.03.02-k1
[ 135.310509] qla2xxx 0000:cc:00.0: PCI INT A -> GSI 99 (level, low) -> IRQ 99
[ 135.326453] qla2xxx 0000:cc:00.0: MSI-X vector count: 31
[ 135.341911] qla2xxx 0000:cc:00.0: Found an ISP2532, irq 99, iobase 0xffffc9007285c000
[ 135.352495] alloc irq_desc for 146 on node 6
[ 135.356272] alloc kstat_irqs on node 6
[ 135.367624] qla2xxx 0000:cc:00.0: irq 146 for MSI/MSI-X
[ 135.372172] alloc irq_desc for 147 on node 6
[ 135.376164] alloc kstat_irqs on node 6
[ 135.391973] qla2xxx 0000:cc:00.0: irq 147 for MSI/MSI-X
[ 135.403591] qla2xxx 0000:cc:00.0: Configuring PCI space...
[ 135.413614] qla2xxx 0000:cc:00.0: setting latency timer to 64
[ 135.422740] qla2xxx 0000:cc:00.0: enabling Mem-Wr-Inval
[ 135.445429] qla2xxx 0000:cc:00.0: Configure NVRAM parameters...
[ 135.462077] qla2xxx 0000:cc:00.0: Verifying loaded RISC code...
[ 135.469113] qla2xxx 0000:cc:00.0: firmware: using built-in firmware ql2500_fw.bin
[ 135.482852] qla2xxx 0000:cc:00.0: FW: Loading via request-firmware...
[ 135.519818] qla2xxx 0000:cc:00.0: Allocated (64 KB) for FCE...
[ 135.525475] qla2xxx 0000:cc:00.0: Allocated (64 KB) for EFT...
[ 135.533345] qla2xxx 0000:cc:00.0: Allocated (1350 KB) for firmware dump...
[ 135.539819] scsi0 : qla2xxx
[ 135.554163] BUG: key ffff8840723fe310 not in .data!
[ 135.558600] ------------[ cut here ]------------
[ 135.562666] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xf1/0x53c()
[ 135.574592] Hardware name: Sun Fire x4800
[ 135.576871] Modules linked in:
[ 135.592605] Pid: 14368, comm: work_for_cpu Not tainted 2.6.34-rc2-tip-yh-03489-gae232d1-dirty #687
[ 135.599585] Call Trace:
[ 135.612279] [<ffffffff81079c04>] warn_slowpath_common+0x7c/0x94
[ 135.618090] [<ffffffff81079c30>] warn_slowpath_null+0x14/0x16
[ 135.633496] [<ffffffff810a4715>] lockdep_init_map+0xf1/0x53c
[ 135.638220] [<ffffffff811869d0>] ? sysfs_new_dirent+0x8f/0x104
[ 135.654379] [<ffffffff81185ffc>] sysfs_add_file_mode+0x66/0xae
[ 135.659672] [<ffffffff813c7587>] ? kobject_put+0x47/0x4b
[ 135.674975] [<ffffffff81498b0f>] ? transport_add_class_device+0x0/0x39
[ 135.681399] [<ffffffff81186055>] sysfs_add_file+0x11/0x13
[ 135.695045] [<ffffffff81186114>] sysfs_create_file+0x2a/0x2c
[ 135.698206] [<ffffffff81493308>] device_create_file+0x19/0x1b
[ 135.714671] [<ffffffff81498501>] attribute_container_add_attrs+0x56/0x74
[ 135.731897] [<ffffffff81498541>] attribute_container_add_class_device+0x22/0x27
[ 135.738647] [<ffffffff81498b29>] transport_add_class_device+0x1a/0x39
[ 135.754319] [<ffffffff81498644>] attribute_container_device_trigger+0x7c/0xbc
[ 135.759012] [<ffffffff81498ab4>] transport_add_device+0x15/0x17
[ 135.777621] [<ffffffff814b169e>] scsi_sysfs_add_host+0x8c/0x9e
[ 135.791587] [<ffffffff814a79df>] scsi_add_host_with_dma+0x1c2/0x217
[ 135.798047] [<ffffffff81bb4599>] qla2x00_probe_one+0xbeb/0xe17
[ 135.813384] [<ffffffff810a5f6b>] ? trace_hardirqs_on+0xd/0xf
[ 135.819473] [<ffffffff81bfb004>] ? _raw_spin_unlock_irq+0x30/0x36
[ 135.834964] [<ffffffff81072699>] ? finish_task_switch+0x70/0xe4
[ 135.839030] [<ffffffff81bf82a4>] ? schedule+0x65f/0x72b
[ 135.854065] [<ffffffff81090c9e>] ? do_work_for_cpu+0x0/0x2a
[ 135.858979] [<ffffffff813ebaad>] local_pci_probe+0x17/0x1b
[ 135.874627] [<ffffffff81090cb6>] do_work_for_cpu+0x18/0x2a
[ 135.879828] [<ffffffff810947fc>] kthread+0x9a/0xa2
[ 135.893473] [<ffffffff810a5f33>] ? trace_hardirqs_on_caller+0x120/0x14b
[ 135.897853] [<ffffffff810349d4>] kernel_thread_helper+0x4/0x10
[ 135.915221] [<ffffffff81bfb33c>] ? restore_args+0x0/0x30
[ 135.920415] [<ffffffff81094762>] ? kthread+0x0/0xa2
[ 135.934108] [<ffffffff810349d0>] ? kernel_thread_helper+0x0/0x10
[ 135.938754] ---[ end trace 0f8a5c5b26192860 ]---
[ 135.955325] BUG: key ffff8840723fe348 not in .data!
[ 135.957618] BUG: key ffff8840723fe380 not in .data!
[ 135.972538] BUG: key ffff8840723fe3b8 not in .data!
[ 135.976839] BUG: key ffff8840723fe3f0 not in .data!
[ 135.992169] BUG: key ffff8840723fe428 not in .data!
[ 135.995598] BUG: key ffff8840723fe460 not in .data!
[ 136.001329] BUG: key ffff8840723fe498 not in .data!
[ 136.015597] BUG: key ffff8840723fe4d0 not in .data!
[ 136.019889] BUG: key ffff8840723fe508 not in .data!
[ 136.034086] BUG: key ffff8840723fe540 not in .data!
[ 136.036915] BUG: key ffff8840723fe578 not in .data!
[ 136.053066] BUG: key ffff8840723fe5b0 not in .data!
[ 136.058530] BUG: key ffff8840723fe5e8 not in .data!
[ 136.071615] BUG: key ffff8840723fe620 not in .data!
[ 136.076256] BUG: key ffff8840723fe658 not in .data!
[ 136.081129] BUG: key ffff8840723fe690 not in .data!
and
[ 132.409474] Emulex LightPulse Fibre Channel SCSI driver 8.3.10
[ 132.424746] Copyright(c) 2004-2009 Emulex. All rights reserved.
[ 132.430422] lpfc 0000:cd:00.0: PCI INT A -> GSI 101 (level, low) -> IRQ 101
[ 132.445731] lpfc 0000:cd:00.0: setting latency timer to 64
[ 132.450672] lpfc 0000:cd:00.0: enabling Mem-Wr-Inval
[ 132.469272] scsi0 : on PCI bus cd device 00 irq 101
[ 132.476490] BUG: key ffff881c7b86c310 not in .data!
[ 132.484102] ------------[ cut here ]------------
[ 132.486701] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xf1/0x53c()
[ 132.504379] Hardware name: Sun Fire x4800
[ 132.507564] Modules linked in:
[ 132.509834] Pid: 7071, comm: work_for_cpu Not tainted 2.6.34-rc2-tip-yh-03489-gae232d1-dirty #687
[ 132.527149] Call Trace:
[ 132.541391] [<ffffffff81079c04>] warn_slowpath_common+0x7c/0x94
[ 132.544345] [<ffffffff81079c30>] warn_slowpath_null+0x14/0x16
[ 132.562047] [<ffffffff810a4715>] lockdep_init_map+0xf1/0x53c
[ 132.566212] [<ffffffff811869d0>] ? sysfs_new_dirent+0x8f/0x104
[ 132.581672] [<ffffffff81185ffc>] sysfs_add_file_mode+0x66/0xae
[ 132.585236] [<ffffffff813c7587>] ? kobject_put+0x47/0x4b
[ 132.603426] [<ffffffff81498b0f>] ? transport_add_class_device+0x0/0x39
[ 132.607886] [<ffffffff81186055>] sysfs_add_file+0x11/0x13
[ 132.623460] [<ffffffff81186114>] sysfs_create_file+0x2a/0x2c
[ 132.628466] [<ffffffff81493308>] device_create_file+0x19/0x1b
[ 132.643430] [<ffffffff81498501>] attribute_container_add_attrs+0x56/0x74
[ 132.648177] [<ffffffff81498541>] attribute_container_add_class_device+0x22/0x27
[ 132.665296] [<ffffffff81498b29>] transport_add_class_device+0x1a/0x39
[ 132.681485] [<ffffffff81498644>] attribute_container_device_trigger+0x7c/0xbc
[ 132.686590] [<ffffffff81498ab4>] transport_add_device+0x15/0x17
[ 132.702516] [<ffffffff814b169e>] scsi_sysfs_add_host+0x8c/0x9e
[ 132.708766] [<ffffffff814a79df>] scsi_add_host_with_dma+0x1c2/0x217
[ 132.724171] [<ffffffff8158b3f0>] lpfc_create_port+0x247/0x295
[ 132.740978] [<ffffffff8158b48e>] lpfc_create_shost+0x50/0x8e
[ 132.745700] [<ffffffff81bb4fe7>] lpfc_pci_probe_one_s3+0x21f/0x48b
[ 132.762194] [<ffffffff81090c9e>] ? do_work_for_cpu+0x0/0x2a
[ 132.768137] [<ffffffff81bb5797>] lpfc_pci_probe_one+0x66/0x6d
[ 132.781613] [<ffffffff813ebaad>] local_pci_probe+0x17/0x1b
[ 132.786593] [<ffffffff81090cb6>] do_work_for_cpu+0x18/0x2a
[ 132.801537] [<ffffffff810947fc>] kthread+0x9a/0xa2
[ 132.805921] [<ffffffff810a5f33>] ? trace_hardirqs_on_caller+0x120/0x14b
[ 132.822948] [<ffffffff810349d4>] kernel_thread_helper+0x4/0x10
[ 132.827937] [<ffffffff81bfb33c>] ? restore_args+0x0/0x30
[ 132.843328] [<ffffffff81094762>] ? kthread+0x0/0xa2
[ 132.845962] [<ffffffff810349d0>] ? kernel_thread_helper+0x0/0x10
[ 132.862076] ---[ end trace b22595c04061dc94 ]---
[ 132.863756] BUG: key ffff881c7b86c348 not in .data!
[ 132.881037] BUG: key ffff881c7b86c380 not in .data!
[ 132.884181] BUG: key ffff881c7b86c3b8 not in .data!
[ 132.888249] BUG: key ffff881c7b86c3f0 not in .data!
[ 132.905692] BUG: key ffff881c7b86c428 not in .data!
[ 132.908299] BUG: key ffff881c7b86c460 not in .data!
[ 132.922920] BUG: key ffff881c7b86c498 not in .data!
[ 132.928176] BUG: key ffff881c7b86c4d0 not in .data!
[ 132.942182] BUG: key ffff881c7b86c508 not in .data!
[ 132.946896] BUG: key ffff881c7b86c540 not in .data!
[ 132.960576] BUG: key ffff881c7b86c578 not in .data!
[ 132.964449] BUG: key ffff881c7b86c5b0 not in .data!
[ 132.967376] BUG: key ffff881c7b86c5e8 not in .data!
[ 132.983418] BUG: key ffff881c7b86c620 not in .data!
Signed-off-by: Yinghai Lu <yin...@kernel.org>
---
drivers/base/attribute_container.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-2.6/drivers/base/attribute_container.c
===================================================================
--- linux-2.6.orig/drivers/base/attribute_container.c
+++ linux-2.6/drivers/base/attribute_container.c
@@ -328,6 +328,7 @@ attribute_container_add_attrs(struct dev
return sysfs_create_group(&classdev->kobj, cont->grp);
for (i = 0; attrs[i]; i++) {
+ sysfs_attr_init(&attrs[i]->attr);
error = device_create_file(classdev, attrs[i]);
if (error)
return error;
As several others have pointed out, you appear to be call sysfs_bin_attr_init()
against statically allocated attributes. Is there an updated patchset that you've been meaning to send out?
Moreover, there are still failures in the ACPI thermal driver (at very least)
on master (9623e5a23724d09283c238960946ec6f65733afe).
- Ben
[ 3.240692] BUG: key ffff88011b1a9528 not in .data!
[ 3.245578] ------------[ cut here ]------------
[ 3.250195] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0x125/0x140()
[ 3.257229] Hardware name: Latitude D830
[ 3.262793] Modules linked in:
[ 3.265864] Pid: 1, comm: swapper Not tainted 2.6.34-rc2-ben #137
[ 3.271946] Call Trace:
[ 3.274397] [<ffffffff8105a86b>] warn_slowpath_common+0x7b/0xc0
[ 3.280395] [<ffffffff8105a8c4>] warn_slowpath_null+0x14/0x20
[ 3.286220] [<ffffffff8108ea75>] lockdep_init_map+0x125/0x140
[ 3.292046] [<ffffffff811ae51f>] sysfs_add_file_mode+0x6f/0xd0
[ 3.297960] [<ffffffff8130b464>] ? snprintf+0x34/0x40
[ 3.303093] [<ffffffff811ae591>] sysfs_add_file+0x11/0x20
[ 3.308570] [<ffffffff811ae676>] sysfs_create_file+0x26/0x30
[ 3.314311] [<ffffffff813bbe99>] device_create_file+0x19/0x20
[ 3.320136] [<ffffffff8146176b>] thermal_zone_device_register+0x45b/0x860
[ 3.327001] [<ffffffff81370e45>] acpi_thermal_add+0x245/0x4e4
[ 3.332827] [<ffffffff811b0250>] ? sysfs_do_create_link+0xd0/0x170
[ 3.339085] [<ffffffff81347100>] acpi_device_probe+0x50/0x122
[ 3.344909] [<ffffffff813bee86>] driver_probe_device+0x96/0x1a0
[ 3.350906] [<ffffffff813bef90>] ? __driver_attach+0x0/0xa0
[ 3.356557] [<ffffffff813bf02b>] __driver_attach+0x9b/0xa0
[ 3.362121] [<ffffffff813bef90>] ? __driver_attach+0x0/0xa0
[ 3.367773] [<ffffffff813be2ac>] bus_for_each_dev+0x6c/0xa0
[ 3.373423] [<ffffffff813becce>] driver_attach+0x1e/0x20
[ 3.378814] [<ffffffff813be591>] bus_add_driver+0xe1/0x280
[ 3.384380] [<ffffffff813bf378>] driver_register+0x78/0x140
[ 3.390031] [<ffffffff81b2f591>] ? acpi_thermal_init+0x0/0x7b
[ 3.395855] [<ffffffff81347a70>] acpi_bus_register_driver+0x43/0x45
[ 3.402199] [<ffffffff81b2f5ea>] acpi_thermal_init+0x59/0x7b
[ 3.407938] [<ffffffff8100204c>] do_one_initcall+0x3c/0x1a0
[ 3.413591] [<ffffffff81b05757>] kernel_init+0x15a/0x1e4
[ 3.418984] [<ffffffff8100aee4>] kernel_thread_helper+0x4/0x10
[ 3.424895] [<ffffffff815bbf90>] ? restore_args+0x0/0x30
[ 3.430286] [<ffffffff81b055fd>] ? kernel_init+0x0/0x1e4
[ 3.435678] [<ffffffff8100aee0>] ? kernel_thread_helper+0x0/0x10
[ 3.441765] ---[ end trace a22d306b065d4a66 ]---
[ 3.446380] BUG: key ffff88011b1a9570 not in .data!
not tracking it for while. it seems James had the same version in scsi-next
>
> Moreover, there are still failures in the ACPI thermal driver (at very least)
> on master (9623e5a23724d09283c238960946ec6f65733afe).
can you send out the trace?
Thanks
Yinghai
- Ben
--
https://patchwork.kernel.org/patch/87436/
(or https://bugzilla.kernel.org/show_bug.cgi?id=15548)
Regards,
Wolfram