* [PATCH] drm/i915: don't use i915_driver_unload() to cleanup failed vblank init
@ 2010-11-17 6:24 Jeremy Kerr
2010-11-17 11:19 ` [PATCH] drm/i915: dont " Chris Wilson
0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Kerr @ 2010-11-17 6:24 UTC (permalink / raw)
To: intel-gfx
Currently, i915_driver_load calls i915_driver_unload if drm_vblank_init
fails. However, we have not yet fully initialised drm_i915_private (eg.
->hangcheck_timer), so we're calling unload from an inconsistent state.
This change uses the existing error path to do the cleanup instead, as
is used before and after the drm_vblank_init() call.
Also, as drm_vblank_init doesn't print any message on failure, add a
DRM_ERROR to explain what happened, as is done for the other error
paths.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
---
drivers/gpu/drm/i915/i915_dma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 7a26f4d..80766b6 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2043,8 +2043,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
ret = drm_vblank_init(dev, I915_NUM_PIPE);
if (ret) {
- (void) i915_driver_unload(dev);
- return ret;
+ DRM_ERROR("failed to init vblank\n");
+ goto out_workqueue_free;
}
/* Start out suspended */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/i915: dont use i915_driver_unload() to cleanup failed vblank init
2010-11-17 6:24 [PATCH] drm/i915: don't use i915_driver_unload() to cleanup failed vblank init Jeremy Kerr
@ 2010-11-17 11:19 ` Chris Wilson
0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2010-11-17 11:19 UTC (permalink / raw)
To: Jeremy Kerr, intel-gfx
On Wed, 17 Nov 2010 14:24:53 +0800, Jeremy Kerr <jeremy.kerr@canonical.com> wrote:
> Currently, i915_driver_load calls i915_driver_unload if drm_vblank_init
> fails. However, we have not yet fully initialised drm_i915_private (eg.
> ->hangcheck_timer), so we're calling unload from an inconsistent state.
>
> This change uses the existing error path to do the cleanup instead, as
> is used before and after the drm_vblank_init() call.
Already done for -next, thanks anyway.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-17 11:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-17 6:24 [PATCH] drm/i915: don't use i915_driver_unload() to cleanup failed vblank init Jeremy Kerr
2010-11-17 11:19 ` [PATCH] drm/i915: dont " Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox