From 702b0f6584fb603be86dfe0c5c9d1b9905d4e7b5 Mon Sep 17 00:00:00 2001 From: Fancy Fang Date: Wed, 14 Oct 2015 17:37:13 +0800 Subject: [PATCH] MLK-11687 video: mxsfb: remove timestamp in wait for vsync ioctl Remove the timestamp usage in the 'MXCFB_WAIT_FOR_VSYNC' ioctl handler, since the 64 bit timestamp would cause data overflow when writing it to user memory. Signed-off-by: Fancy Fang (cherry picked from commit 4bfbf67a384f1292d217769b77858c08f38fe658) Conflicts: drivers/video/mxsfb.c --- drivers/video/fbdev/mxsfb.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c index 7e0e44530c47..ea7a34ee12eb 100644 --- a/drivers/video/fbdev/mxsfb.c +++ b/drivers/video/fbdev/mxsfb.c @@ -216,7 +216,6 @@ struct mxsfb_info { struct regulator *reg_lcd; bool wait4vsync; struct completion vsync_complete; - ktime_t vsync_nf_timestamp; struct completion flip_complete; int cur_blank; int restore_blank; @@ -413,7 +412,6 @@ static irqreturn_t mxsfb_irq_handler(int irq, void *dev_id) writel(CTRL1_VSYNC_EDGE_IRQ_EN, host->base + LCDC_CTRL1 + REG_CLR); host->wait4vsync = 0; - host->vsync_nf_timestamp = ktime_get(); complete(&host->vsync_complete); } @@ -870,16 +868,7 @@ static int mxsfb_ioctl(struct fb_info *fb_info, unsigned int cmd, switch (cmd) { case MXCFB_WAIT_FOR_VSYNC: - { - long long timestamp; - struct mxsfb_info *host = to_imxfb_host(fb_info); - ret = mxsfb_wait_for_vsync(fb_info); - timestamp = ktime_to_ns(host->vsync_nf_timestamp); - if ((ret == 0) && copy_to_user((void *)arg, - ×tamp, sizeof(timestamp))) { - ret = -EFAULT; - } - } + ret = mxsfb_wait_for_vsync(fb_info); break; default: break; -- 2.17.1