[Nouveau] [PATCH] drm/nouveau/pm: Fix kernel oops when setting perflvl at boot-time

Roy Spliet r.spliet at student.tudelft.nl
Mon Jan 30 01:56:06 PST 2012


CRTC needs to be initialised before nouveau_pm_trigger() is called, otherwise a NULLptr deref occurs

Signed-off-by: Roy Spliet <r.spliet at student.tudelft.nl>
---
 drivers/gpu/drm/nouveau/nouveau_pm.c    |    3 +++
 drivers/gpu/drm/nouveau/nouveau_state.c |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c
index 2418eea..ac7df10 100644
--- a/drivers/gpu/drm/nouveau/nouveau_pm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_pm.c
@@ -169,6 +169,9 @@ error:
 	return ret;
 }
 
+/**
+ * @pre CRTCs must be initialised
+ */
 void
 nouveau_pm_trigger(struct drm_device *dev)
 {
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index cdaf981..54e83a7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -632,8 +632,6 @@ nouveau_card_init(struct drm_device *dev)
 	if (ret)
 		goto out_ttmvram;
 
-	nouveau_pm_init(dev);
-
 	if (!dev_priv->noaccel) {
 		switch (dev_priv->card_type) {
 		case NV_04:
@@ -737,6 +735,8 @@ nouveau_card_init(struct drm_device *dev)
 	if (ret)
 		goto out_irq;
 
+	nouveau_pm_init(dev);
+
 	nouveau_backlight_init(dev);
 
 	if (dev_priv->eng[NVOBJ_ENGINE_GR]) {
-- 
1.7.7.6



More information about the Nouveau mailing list