From 75af757c1b7ba687c81003b6bf8b424d983447bf Mon Sep 17 00:00:00 2001 From: Dhaval Patel Date: Wed, 4 Nov 2015 14:01:09 -0800 Subject: msm: mdss: pass file pointer as argument to fb_ioctl api MDSS driver uses file pointer to track the client and associates the resources based on it. There can be a race condition between to clients ioctl call and it can lead to track resources with wrong caller. This can leads to release/reallocate resources prematurely to other client which may show blank screen on display. One good example client call flow is: <-step:1-> fb_open by client-X <-step:2-> fb_open by client-Y <-step:3-> fb_ioctl by client-X <-step:4-> fb_ioctl by client-Y <-step:5-> fb_ioctl by client-X <-step:6-> fb_close by client-Y If step-5 and step-6 both are running on two different CPUs at same time then it may overwrite the file node unintentionally. This change tries to pass the file pointer as one of the argument to IOCTL call. It avoids usage of mutex lock to support the concurrent calls. Change-Id: I0bfd76358c80892c8e4f56298bce6c33b4132550 Signed-off-by: Dhaval Patel --- include/linux/fb.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index 32d82ae5b55f..87942d80a465 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -288,10 +288,18 @@ struct fb_ops { int (*fb_ioctl)(struct fb_info *info, unsigned int cmd, unsigned long arg); + /* perform fb specific ioctl v2 (optional) - provides file param */ + int (*fb_ioctl_v2)(struct fb_info *info, unsigned int cmd, + unsigned long arg, struct file *file); + /* Handle 32bit compat ioctl (optional) */ int (*fb_compat_ioctl)(struct fb_info *info, unsigned cmd, unsigned long arg); + /* Handle 32bit compat ioctl (optional) */ + int (*fb_compat_ioctl_v2)(struct fb_info *info, unsigned cmd, + unsigned long arg, struct file *file); + /* perform fb specific mmap */ int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); -- cgit v1.2.3