Skip to contentSkip to conversation

thermal: make lockdep happy

PATCH In review Dan Carpenter 3 participants 3 messages Mar 31, 2010 – Apr 1, 2010

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

PATCH 1/1 thermal: make lockdep happy

Hi Christian,

Can you test this patch?

I wrote this to address bugzilla bug:

	https://bugzilla.kernel.org/show_bug.cgi?id504
	BUG: key ffff88004c3811e0 not in .data! occured in lockdep.c

We now have to call sysfs_attr_init() for dynamically allocated sysfs attributes or lockdep complains.

drivers/thermal/thermal_sys.c +1 -0
index 5066de5..d4fec47 100644
@@ -725,6 +725,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;
#1 lore raw

Seems to fix it, at least when applied on -rc3.
I'm updating the bugzilla entry.

Thanks.

Le mercredi 31 mars 2010, Dan Carpenter a écrit :

Quoted 25 lines

Hi Christian,

Can you test this patch?

I wrote this to address bugzilla bug:

	https://bugzilla.kernel.org/show_bug.cgi?id=15504
	BUG: key ffff88004c3811e0 not in .data! occured in lockdep.c

We now have to call sysfs_attr_init() for dynamically allocated sysfs attributes or lockdep complains.

drivers/thermal/thermal_sys.c +1 -0
index 5066de5..d4fec47 100644
@@ -725,6 +725,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 Acked-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

Hi Christian,

Can you test this patch?

Quoted 8 lines

I wrote this to address bugzilla bug:

	https://bugzilla.kernel.org/show_bug.cgi?id=15504
	BUG: key ffff88004c3811e0 not in .data! occured in lockdep.c

We now have to call sysfs_attr_init() for dynamically allocated sysfs attributes or lockdep complains.

Quoted 13 lines
drivers/thermal/thermal_sys.c +1 -0
index 5066de5..d4fec47 100644
@@ -725,6 +725,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;