rk fb: fix fb_info free too early when shutdown

This commit is contained in:
hjc
2013-10-08 17:33:32 -07:00
parent 6eb352d200
commit 565bb88003
2 changed files with 7 additions and 3 deletions

View File

@@ -1121,7 +1121,7 @@ static int rk_fb_wait_for_vsync_thread(void *data)
ktime_t timestamp = dev_drv->vsync_info.timestamp;
int ret = wait_event_interruptible(dev_drv->vsync_info.wait,
!ktime_equal(timestamp, dev_drv->vsync_info.timestamp) &&
dev_drv->vsync_info.active);
dev_drv->vsync_info.active || dev_drv->vsync_info.irq_stop);
if (!ret) {
sysfs_notify(&fbi->dev->kobj, NULL, "vsync");
@@ -1808,6 +1808,11 @@ int rk_fb_unregister(struct rk_lcdc_device_driver *dev_drv)
return -ENOENT;
}
if(fb_inf->lcdc_dev_drv[i]->vsync_info.thread){
fb_inf->lcdc_dev_drv[i]->vsync_info.irq_stop = 1;
kthread_stop(fb_inf->lcdc_dev_drv[i]->vsync_info.thread);
}
for(i = 0; i < fb_num; i++)
{
kfree(dev_drv->layer_par[i]);
@@ -1912,8 +1917,6 @@ static void rk_fb_shutdown(struct platform_device *pdev)
if (!inf->lcdc_dev_drv[i])
continue;
if(inf->lcdc_dev_drv[i]->vsync_info.thread)
kthread_stop(inf->lcdc_dev_drv[i]->vsync_info.thread);
}
// kfree(fb_inf);
// platform_set_drvdata(pdev, NULL);

View File

@@ -187,6 +187,7 @@ struct rk_fb_vsync {
wait_queue_head_t wait;
ktime_t timestamp;
bool active;
bool irq_stop;
int irq_refcount;
struct mutex irq_lock;
struct task_struct *thread;