Skip to contentSkip to conversation

BUG: key f70f4b50 not in .data

PATCH In review Sergey Senozhatsky 4 participants 9 messages Mar 9, 2010 – Apr 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,
x86, ASUS f3jc. 2.6.34-rc1.

Quoted 1 line

dmesg

[    0.921368] ACPI: SSDT 7ffb91b0 00D24 (v01    AMI   CPU1PM 00000001 INTL 02002026)
[    0.928266] Marking TSC unstable due to TSC halts in idle
[    0.929094] Switching to clocksource hpet
[    0.930444] ACPI Warning: Incorrect checksum in table [SSDT] - 54, should be 97 (20100121/tbutils-314)
[    0.930500] ACPI: SSDT 7ffb9ee0 00D24 (v01    AMI   CPU2PM 00000001 INTL 02002026)
[    0.952515] BUG: key f70f4b50 not in .data!
[    0.952537] ------------[ cut here ]------------
[    0.952564] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xc3/0xf3()
[    0.952589] Hardware name: F3JC                
[    0.952608] Modules linked in:
[    0.952633] Pid: 1, comm: swapper Not tainted 2.6.34-rc1-dbg #38
[    0.953245] Call Trace:
[    0.953888]  [<c102e663>] warn_slowpath_common+0x65/0x7c
[    0.954555]  [<c104e13c>] ? lockdep_init_map+0xc3/0xf3
[    0.955215]  [<c102e687>] warn_slowpath_null+0xd/0x10
[    0.955897]  [<c104e13c>] lockdep_init_map+0xc3/0xf3
[    0.956594]  [<c10e26df>] sysfs_add_file_mode+0x4c/0x7e
[    0.957305]  [<c10e271f>] sysfs_add_file+0xe/0x13
[    0.958036]  [<c10e2788>] sysfs_create_file+0x20/0x22
[    0.958760]  [<c12046b9>] device_create_file+0x13/0x15
[    0.959499]  [<c1242677>] thermal_zone_device_register+0x32e/0x53e
[    0.960264]  [<c11dc083>] acpi_thermal_add+0x1a2/0x3c4
[    0.961051]  [<c10e36bd>] ? sysfs_do_create_link+0xc5/0xec
[    0.961839]  [<c11b279f>] acpi_device_probe+0x3a/0x142
[    0.962633]  [<c12064d1>] driver_probe_device+0x87/0x107
[    0.963445]  [<c120658d>] __driver_attach+0x3c/0x54
[    0.964277]  [<c1205cd5>] bus_for_each_dev+0x3d/0x67
[    0.965113]  [<c120639a>] driver_attach+0x14/0x16
[    0.965953]  [<c1206551>] ? __driver_attach+0x0/0x54
[    0.966817]  [<c120608c>] bus_add_driver+0x92/0x1c6
[    0.967687]  [<c149bac5>] ? acpi_thermal_init+0x0/0x6f
[    0.968532]  [<c12067bf>] driver_register+0x79/0xe0
[    0.969378]  [<c149bac5>] ? acpi_thermal_init+0x0/0x6f
[    0.970220]  [<c149bac5>] ? acpi_thermal_init+0x0/0x6f
[    0.971062]  [<c11b3178>] acpi_bus_register_driver+0x3a/0x3c
[    0.971887]  [<c149bb15>] acpi_thermal_init+0x50/0x6f
[    0.972709]  [<c1001139>] do_one_initcall+0x4c/0x136
[    0.973533]  [<c147c35b>] kernel_init+0x128/0x1a9
[    0.974367]  [<c147c233>] ? kernel_init+0x0/0x1a9
[    0.975179]  [<c1002e42>] kernel_thread_helper+0x6/0x1a
[    0.975991] ---[ end trace a22d306b065d4a66 ]---
[    0.976803] BUG: key f70f4b80 not in .data!
[    0.977640] BUG: key f70c1048 not in .data!
[    0.978892] thermal LNXTHERM:01: registered as thermal_zone0
[    0.979695] ACPI: Thermal Zone [THRM] (68 C)

Sergey

#1 lore raw
Quoted 42 lines · Sergey Senozhatsky

Hello,
x86, ASUS f3jc. 2.6.34-rc1.

Quoted 1 line

dmesg

[    0.921368] ACPI: SSDT 7ffb91b0 00D24 (v01    AMI   CPU1PM 00000001 INTL 02002026)
[    0.928266] Marking TSC unstable due to TSC halts in idle
[    0.929094] Switching to clocksource hpet
[    0.930444] ACPI Warning: Incorrect checksum in table [SSDT] - 54, should be 97 (20100121/tbutils-314)
[    0.930500] ACPI: SSDT 7ffb9ee0 00D24 (v01    AMI   CPU2PM 00000001 INTL 02002026)
[    0.952515] BUG: key f70f4b50 not in .data!
[    0.952537] ------------[ cut here ]------------
[    0.952564] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xc3/0xf3()
[    0.952589] Hardware name: F3JC                
[    0.952608] Modules linked in:
[    0.952633] Pid: 1, comm: swapper Not tainted 2.6.34-rc1-dbg #38
[    0.953245] Call Trace:
[    0.953888]  [<c102e663>] warn_slowpath_common+0x65/0x7c
[    0.954555]  [<c104e13c>] ? lockdep_init_map+0xc3/0xf3
[    0.955215]  [<c102e687>] warn_slowpath_null+0xd/0x10
[    0.955897]  [<c104e13c>] lockdep_init_map+0xc3/0xf3
[    0.956594]  [<c10e26df>] sysfs_add_file_mode+0x4c/0x7e
[    0.957305]  [<c10e271f>] sysfs_add_file+0xe/0x13
[    0.958036]  [<c10e2788>] sysfs_create_file+0x20/0x22
[    0.958760]  [<c12046b9>] device_create_file+0x13/0x15
[    0.959499]  [<c1242677>] thermal_zone_device_register+0x32e/0x53e
[    0.960264]  [<c11dc083>] acpi_thermal_add+0x1a2/0x3c4
[    0.961051]  [<c10e36bd>] ? sysfs_do_create_link+0xc5/0xec
[    0.961839]  [<c11b279f>] acpi_device_probe+0x3a/0x142
[    0.962633]  [<c12064d1>] driver_probe_device+0x87/0x107
[    0.963445]  [<c120658d>] __driver_attach+0x3c/0x54
[    0.964277]  [<c1205cd5>] bus_for_each_dev+0x3d/0x67
[    0.965113]  [<c120639a>] driver_attach+0x14/0x16
[    0.965953]  [<c1206551>] ? __driver_attach+0x0/0x54
[    0.966817]  [<c120608c>] bus_add_driver+0x92/0x1c6
[    0.967687]  [<c149bac5>] ? acpi_thermal_init+0x0/0x6f
[    0.968532]  [<c12067bf>] driver_register+0x79/0xe0
[    0.969378]  [<c149bac5>] ? acpi_thermal_init+0x0/0x6f
[    0.970220]  [<c149bac5>] ? acpi_thermal_init+0x0/0x6f
[    0.971062]  [<c11b3178>] acpi_bus_register_driver+0x3a/0x3c
[    0.971887]  [<c149bb15>] acpi_thermal_init+0x50/0x6f
[    0.972709]  [<c1001139>] do_one_initcall+0x4c/0x136
Quoted 8 lines
[    0.973533]  [<c147c35b>] kernel_init+0x128/0x1a9
[    0.974367]  [<c147c233>] ? kernel_init+0x0/0x1a9
[    0.975179]  [<c1002e42>] kernel_thread_helper+0x6/0x1a
[    0.975991] ---[ end trace a22d306b065d4a66 ]---
[    0.976803] BUG: key f70f4b80 not in .data!
[    0.977640] BUG: key f70c1048 not in .data!
[    0.978892] thermal LNXTHERM:01: registered as thermal_zone0
[    0.979695] ACPI: Thermal Zone [THRM] (68 C)

Eric, yet another one :)

thanks,

greg k-h

#2 lore raw

PATCH 1/1 Fix key f70f4b50 not in .data in thermal_sys

Initialize sysfs attributes before device_create_file call.

---

drivers/thermal/thermal_sys.c +3 -0
index 5066de5..a76a6ff 100644
@@ -492,6 +492,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 		goto free_mem;
 	}
 	dev_set_drvdata(hwmon->device, hwmon);
+	sysfs_attr_init(&dev_attr_name.attr);
 	result = device_create_file(hwmon->device, &dev_attr_name);
 	if (result)
 		goto unregister_hwmon_device;
@@ -505,6 +506,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	tz->temp_input.attr.attr.name = tz->temp_input.name;
 	tz->temp_input.attr.attr.mode = 0444;
 	tz->temp_input.attr.show = temp_input_show;
+	sysfs_attr_init(&tz->temp_input.attr.attr);
 	result = device_create_file(hwmon->device, &tz->temp_input.attr);
 	if (result)
 		goto unregister_hwmon_device;
@@ -517,6 +519,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 			tz->temp_crit.attr.attr.name = tz->temp_crit.name;
 			tz->temp_crit.attr.attr.mode = 0444;
 			tz->temp_crit.attr.show = temp_crit_show;
+			sysfs_attr_init(&tz->temp_crit.attr.attr);
 			result = device_create_file(hwmon->device,
 						    &tz->temp_crit.attr);
 			if (result)
#3 lore raw

Re: [PATCH] Fix key f70f4b50 not in .data in thermal_sys

Quoted 10 lines · Sergey Senozhatsky

Initialize sysfs attributes before device_create_file call.

---

drivers/thermal/thermal_sys.c +0 -0
index 5066de5..a76a6ff 100644

drivers/thermal/thermal_sys.c thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) · line 496

Quoted 5 lines
drivers/thermal/thermal_sys.c +1 -0
@@ -492,6 +492,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 		goto free_mem;
 	}
 	dev_set_drvdata(hwmon->device, hwmon);
+	sysfs_attr_init(&dev_attr_name.attr);
 	result = device_create_file(hwmon->device, &dev_attr_name);

This one should not be needed? Is declared static in line 426.

Quoted 11 lines
drivers/thermal/thermal_sys.c +1 -0
 	if (result)
 		goto unregister_hwmon_device;
@@ -505,6 +506,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	tz->temp_input.attr.attr.name = tz->temp_input.name;
 	tz->temp_input.attr.attr.mode = 0444;
 	tz->temp_input.attr.show = temp_input_show;
+	sysfs_attr_init(&tz->temp_input.attr.attr);
 	result = device_create_file(hwmon->device, &tz->temp_input.attr);
 	if (result)
 		goto unregister_hwmon_device;

drivers/thermal/thermal_sys.c thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) · line 522

Quoted 4 lines
drivers/thermal/thermal_sys.c +1 -0
@@ -517,6 +519,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 			tz->temp_crit.attr.attr.name = tz->temp_crit.name;
 			tz->temp_crit.attr.attr.mode = 0444;
 			tz->temp_crit.attr.show = temp_crit_show;
+			sysfs_attr_init(&tz->temp_crit.attr.attr);

Those encapsuled attributes are trickier to find, sigh...

Regards,

Wolfram

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#4 lore raw

Re: [PATCH] Fix key f70f4b50 not in .data in thermal_sys

Hello,
Wolfram you are 100% right. My first patch didn't solve the problem. Please see v2.

Sergey

Quoted 41 lines · Wolfram Sang
Quoted 10 lines · Sergey Senozhatsky

Initialize sysfs attributes before device_create_file call.

---

drivers/thermal/thermal_sys.c +0 -0
index 5066de5..a76a6ff 100644

drivers/thermal/thermal_sys.c thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) · line 496

Quoted 5 lines
drivers/thermal/thermal_sys.c +1 -0
@@ -492,6 +492,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 		goto free_mem;
 	}
 	dev_set_drvdata(hwmon->device, hwmon);
+	sysfs_attr_init(&dev_attr_name.attr);
 	result = device_create_file(hwmon->device, &dev_attr_name);

This one should not be needed? Is declared static in line 426.

Quoted 11 lines
drivers/thermal/thermal_sys.c +1 -0
 	if (result)
 		goto unregister_hwmon_device;
@@ -505,6 +506,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	tz->temp_input.attr.attr.name = tz->temp_input.name;
 	tz->temp_input.attr.attr.mode = 0444;
 	tz->temp_input.attr.show = temp_input_show;
+	sysfs_attr_init(&tz->temp_input.attr.attr);
 	result = device_create_file(hwmon->device, &tz->temp_input.attr);
 	if (result)
 		goto unregister_hwmon_device;

drivers/thermal/thermal_sys.c thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) · line 522

Quoted 4 lines
drivers/thermal/thermal_sys.c +1 -0
@@ -517,6 +519,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 			tz->temp_crit.attr.attr.name = tz->temp_crit.name;
 			tz->temp_crit.attr.attr.mode = 0444;
 			tz->temp_crit.attr.show = temp_crit_show;
+			sysfs_attr_init(&tz->temp_crit.attr.attr);

Those encapsuled attributes are trickier to find, sigh...

Regards,

Wolfram

#5 lore raw

PATCH 1/1 Fix key f70f4b50 not in .data in thermal_sys

In reply to Greg KH

Nope. Sorry, I didn't test carefully. Oh, Monday... Proposed patch doesn't fix the problem. The given below patch does.

Note that thermal_zone_bind_cooling_device part was proposed by Wolfram Sang here:
https://patchwork.kernel.org/patch/87359/

So, Wolfram, we need to cooperate to solve the problem.

Initialize sysfs attributes before device_create_file call.

---

drivers/thermal/thermal_sys.c +3 -0
index 5066de5..ecb181d 100644
@@ -505,6 +505,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	tz->temp_input.attr.attr.name = tz->temp_input.name;
 	tz->temp_input.attr.attr.mode = 0444;
 	tz->temp_input.attr.show = temp_input_show;
+	sysfs_attr_init(&tz->temp_input.attr.attr);
 	result = device_create_file(hwmon->device, &tz->temp_input.attr);
 	if (result)
 		goto unregister_hwmon_device;
@@ -517,6 +518,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 			tz->temp_crit.attr.attr.name = tz->temp_crit.name;
 			tz->temp_crit.attr.attr.mode = 0444;
 			tz->temp_crit.attr.show = temp_crit_show;
+			sysfs_attr_init(&tz->temp_crit.attr.attr);
 			result = device_create_file(hwmon->device,
 						    &tz->temp_crit.attr);
 			if (result)
@@ -725,6 +727,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
 		goto release_idr;
 
 	sprintf(dev->attr_name, "cdev%d_trip_point", dev->id);
+	sysfs_attr_init(&dev->attr.attr);
 	dev->attr.attr.name = dev->attr_name;
 	dev->attr.attr.mode = 0444;
 	dev->attr.show = thermal_cooling_device_trip_point_show;
#6 lore raw

Re: [PATCH] Fix key f70f4b50 not in .data in thermal_sys

Quoted 9 lines · Sergey Senozhatsky

Nope. Sorry, I didn't test carefully. Oh, Monday... Proposed patch doesn't fix the problem. The given below patch does.

Note that thermal_zone_bind_cooling_device part was proposed by Wolfram Sang here:
https://patchwork.kernel.org/patch/87359/

So, Wolfram, we need to cooperate to solve the problem.

Looks good to me. Add my SoB, this should do:

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#7 lore raw

PATCH 1/1 Fix key f70f4b50 not in .data in thermal_sys V2

Initialize sysfs attributes before device_create_file call.

---

drivers/thermal/thermal_sys.c +3 -0
index 5066de5..ecb181d 100644
@@ -505,6 +505,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	tz->temp_input.attr.attr.name = tz->temp_input.name;
 	tz->temp_input.attr.attr.mode = 0444;
 	tz->temp_input.attr.show = temp_input_show;
+	sysfs_attr_init(&tz->temp_input.attr.attr);
 	result = device_create_file(hwmon->device, &tz->temp_input.attr);
 	if (result)
 		goto unregister_hwmon_device;
@@ -517,6 +518,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 			tz->temp_crit.attr.attr.name = tz->temp_crit.name;
 			tz->temp_crit.attr.attr.mode = 0444;
 			tz->temp_crit.attr.show = temp_crit_show;
+			sysfs_attr_init(&tz->temp_crit.attr.attr);
 			result = device_create_file(hwmon->device,
 						    &tz->temp_crit.attr);
 			if (result)
@@ -725,6 +727,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
 		goto release_idr;
 
 	sprintf(dev->attr_name, "cdev%d_trip_point", dev->id);
+	sysfs_attr_init(&dev->attr.attr);
 	dev->attr.attr.name = dev->attr_name;
 	dev->attr.attr.mode = 0444;
 	dev->attr.show = thermal_cooling_device_trip_point_show;
reviewer Applied
#8 lore raw

Re: [PATCH] Fix key f70f4b50 not in .data in thermal_sys V2

applied

thanks,
Len Brown, Intel Open Source Technology Center

Quoted 37 lines · Sergey Senozhatsky

Initialize sysfs attributes before device_create_file call.

---

drivers/thermal/thermal_sys.c +3 -0
index 5066de5..ecb181d 100644
@@ -505,6 +505,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 	tz->temp_input.attr.attr.name = tz->temp_input.name;
 	tz->temp_input.attr.attr.mode = 0444;
 	tz->temp_input.attr.show = temp_input_show;
+	sysfs_attr_init(&tz->temp_input.attr.attr);
 	result = device_create_file(hwmon->device, &tz->temp_input.attr);
 	if (result)
 		goto unregister_hwmon_device;
@@ -517,6 +518,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 			tz->temp_crit.attr.attr.name = tz->temp_crit.name;
 			tz->temp_crit.attr.attr.mode = 0444;
 			tz->temp_crit.attr.show = temp_crit_show;
+			sysfs_attr_init(&tz->temp_crit.attr.attr);
 			result = device_create_file(hwmon->device,
 						    &tz->temp_crit.attr);
 			if (result)
@@ -725,6 +727,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
 		goto release_idr;
 
 	sprintf(dev->attr_name, "cdev%d_trip_point", dev->id);
+	sysfs_attr_init(&dev->attr.attr);
 	dev->attr.attr.name = dev->attr_name;
 	dev->attr.attr.mode = 0444;
 	dev->attr.show = thermal_cooling_device_trip_point_show;