Skip to content

Commit

Permalink
drm/nouveau: initialise display before enabling interrupts
Browse files Browse the repository at this point in the history
In some situations it's possible we can receive a spurious hotplug IRQ
before we're ready to handle it, leading to an oops.

Calling the display init before enabling interrupts should clear any
pending IRQs on the GPU and prevent this from happening.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jul 13, 2010
1 parent 271f29e commit e88efe0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/gpu/drm/nouveau/nouveau_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,19 @@ nouveau_card_init(struct drm_device *dev)
goto out_graph;
}

if (dev_priv->card_type >= NV_50)
ret = nv50_display_create(dev);
else
ret = nv04_display_create(dev);
if (ret)
goto out_fifo;

/* this call irq_preinstall, register irq handler and
* call irq_postinstall
*/
ret = drm_irq_install(dev);
if (ret)
goto out_fifo;
goto out_display;

ret = drm_vblank_init(dev, 0);
if (ret)
Expand All @@ -490,13 +497,6 @@ nouveau_card_init(struct drm_device *dev)
goto out_irq;
}

if (dev_priv->card_type >= NV_50)
ret = nv50_display_create(dev);
else
ret = nv04_display_create(dev);
if (ret)
goto out_channel;

ret = nouveau_backlight_init(dev);
if (ret)
NV_ERROR(dev, "Error %d registering backlight\n", ret);
Expand All @@ -505,13 +505,13 @@ nouveau_card_init(struct drm_device *dev)
drm_kms_helper_poll_init(dev);
return 0;

out_channel:
if (dev_priv->channel) {
nouveau_channel_free(dev_priv->channel);
dev_priv->channel = NULL;
}
out_irq:
drm_irq_uninstall(dev);
out_display:
if (dev_priv->card_type >= NV_50)
nv50_display_destroy(dev);
else
nv04_display_destroy(dev);
out_fifo:
if (!nouveau_noaccel)
engine->fifo.takedown(dev);
Expand Down

0 comments on commit e88efe0

Please sign in to comment.