Commit 93c176f3 authored by Caglar Akyuz's avatar Caglar Akyuz Committed by Paul Mundt

video: da8xx: Register IRQ as last thing in driver probing.

Following commit exposed a bug in driver:

	"fbdev: da8xx/omap-l1xx: implement double buffering"

Bug is, if interrupt handler is called before initialization is
finished, raster controller is enabled and following register
modifications causes hardware to stay in a broken state.

By looking at this one may say that proper locking is missing in
this driver, and a more proper fix should be prepared. However,
aformentioned commit causes a regression in the driver and some
fix to current one should be applied first.
Signed-off-by: default avatarCaglar Akyuz <caglar@bilkon-kontrol.com.tr>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 22a95949
...@@ -1029,10 +1029,6 @@ static int __init fb_probe(struct platform_device *device) ...@@ -1029,10 +1029,6 @@ static int __init fb_probe(struct platform_device *device)
goto err_release_pl_mem; goto err_release_pl_mem;
} }
ret = request_irq(par->irq, lcdc_irq_handler, 0, DRIVER_NAME, par);
if (ret)
goto err_release_pl_mem;
/* Initialize par */ /* Initialize par */
da8xx_fb_info->var.bits_per_pixel = lcd_cfg->bpp; da8xx_fb_info->var.bits_per_pixel = lcd_cfg->bpp;
...@@ -1060,7 +1056,7 @@ static int __init fb_probe(struct platform_device *device) ...@@ -1060,7 +1056,7 @@ static int __init fb_probe(struct platform_device *device)
ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0);
if (ret) if (ret)
goto err_free_irq; goto err_release_pl_mem;
da8xx_fb_info->cmap.len = par->palette_sz; da8xx_fb_info->cmap.len = par->palette_sz;
/* initialize var_screeninfo */ /* initialize var_screeninfo */
...@@ -1088,8 +1084,13 @@ static int __init fb_probe(struct platform_device *device) ...@@ -1088,8 +1084,13 @@ static int __init fb_probe(struct platform_device *device)
goto err_cpu_freq; goto err_cpu_freq;
} }
#endif #endif
ret = request_irq(par->irq, lcdc_irq_handler, 0, DRIVER_NAME, par);
if (ret)
goto irq_freq;
return 0; return 0;
irq_freq:
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
err_cpu_freq: err_cpu_freq:
unregister_framebuffer(da8xx_fb_info); unregister_framebuffer(da8xx_fb_info);
...@@ -1098,9 +1099,6 @@ static int __init fb_probe(struct platform_device *device) ...@@ -1098,9 +1099,6 @@ static int __init fb_probe(struct platform_device *device)
err_dealloc_cmap: err_dealloc_cmap:
fb_dealloc_cmap(&da8xx_fb_info->cmap); fb_dealloc_cmap(&da8xx_fb_info->cmap);
err_free_irq:
free_irq(par->irq, par);
err_release_pl_mem: err_release_pl_mem:
dma_free_coherent(NULL, PALETTE_SIZE, par->v_palette_base, dma_free_coherent(NULL, PALETTE_SIZE, par->v_palette_base,
par->p_palette_base); par->p_palette_base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment