drm/nouveau/therm: always initialize alarm_program_lock
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Wed, 30 Jan 2013 21:21:31 +0000 (22:21 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 20 Feb 2013 06:00:40 +0000 (16:00 +1000)
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 <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/therm/base.c
drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c

index 25b7f6a907c83ff010eb5d4e5e26e6bf97415d8a..f794dc89a3b2a1ddaf68dc686b5ef13c0f9bbbcb 100644 (file)
@@ -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;
index 4b7fe24f5506bf1a8a8b767bb05ae79950b279d8..86632cbd65cea4ccabff257c19838f0f82efb931 100644 (file)
@@ -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 */