From: Marcin Slusarz Date: Wed, 30 Jan 2013 21:21:31 +0000 (+0100) Subject: drm/nouveau/therm: always initialize alarm_program_lock X-Git-Tag: v3.9~351^2~10^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3969f05bb8d0d72ba974ab5f74a7bafb61dd16d0;p=platform%2Fkernel%2Flinux-amlogic.git drm/nouveau/therm: always initialize alarm_program_lock Fixes "BUG: spinlock bad magic" on module load for nva3+ cards. Introduced in commit "drm/nouveau/therm: implement support for temperature alarms". Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c index 25b7f6a..f794dc8 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c @@ -299,6 +299,7 @@ nouveau_therm_create_(struct nouveau_object *parent, nouveau_alarm_init(&priv->alarm, nouveau_therm_alarm); spin_lock_init(&priv->lock); + spin_lock_init(&priv->sensor.alarm_program_lock); priv->base.fan_get = nouveau_therm_fan_user_get; priv->base.fan_set = nouveau_therm_fan_user_set; diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c index 4b7fe24..86632cb 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c @@ -279,7 +279,6 @@ nv50_therm_ctor(struct nouveau_object *parent, priv->base.base.pwm_clock = nv50_fan_pwm_clock; priv->base.base.temp_get = nv50_temp_get; priv->base.sensor.program_alarms = nv50_therm_program_alarms; - spin_lock_init(&priv->base.sensor.alarm_program_lock); nv_subdev(priv)->intr = nv50_therm_intr; /* init the thresholds */