aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/uaccess_64.h2
-rw-r--r--arch/x86/lib/usercopy_64.c15
-rw-r--r--drivers/media/dvb-frontends/rtl2832.c2
-rw-r--r--drivers/media/pci/cx23885/cx23885-417.c13
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-core.c3
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c2
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c1
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_common.h2
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_opr.h2
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c6
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c6
-rw-r--r--drivers/media/platform/s5p-tv/Kconfig1
-rw-r--r--drivers/media/platform/sh_veu.c1
-rw-r--r--drivers/media/platform/soc_camera/atmel-isi.c2
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c2
-rw-r--r--drivers/media/usb/dvb-usb-v2/rtl28xxu.c2
-rw-r--r--drivers/media/usb/gspca/Kconfig1
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c11
-rw-r--r--drivers/media/v4l2-core/videobuf2-dma-contig.c3
-rw-r--r--include/media/atmel-isi.h4
-rw-r--r--kernel/module.c19
21 files changed, 60 insertions, 40 deletions
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index 12a26b979bf1..f2f9b39b274a 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -231,6 +231,6 @@ __copy_from_user_inatomic_nocache(void *dst, const void __user *src,
231} 231}
232 232
233unsigned long 233unsigned long
234copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest); 234copy_user_handle_tail(char *to, char *from, unsigned len);
235 235
236#endif /* _ASM_X86_UACCESS_64_H */ 236#endif /* _ASM_X86_UACCESS_64_H */
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
index c905e89e19fe..1f33b3d1fd68 100644
--- a/arch/x86/lib/usercopy_64.c
+++ b/arch/x86/lib/usercopy_64.c
@@ -69,21 +69,20 @@ EXPORT_SYMBOL(copy_in_user);
69 * it is not necessary to optimize tail handling. 69 * it is not necessary to optimize tail handling.
70 */ 70 */
71__visible unsigned long 71__visible unsigned long
72copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest) 72copy_user_handle_tail(char *to, char *from, unsigned len)
73{ 73{
74 char c;
75 unsigned zero_len;
76
77 for (; len; --len, to++) { 74 for (; len; --len, to++) {
75 char c;
76
78 if (__get_user_nocheck(c, from++, sizeof(char))) 77 if (__get_user_nocheck(c, from++, sizeof(char)))
79 break; 78 break;
80 if (__put_user_nocheck(c, to, sizeof(char))) 79 if (__put_user_nocheck(c, to, sizeof(char)))
81 break; 80 break;
82 } 81 }
83
84 for (c = 0, zero_len = len; zerorest && zero_len; --zero_len)
85 if (__put_user_nocheck(c, to++, sizeof(char)))
86 break;
87 clac(); 82 clac();
83
84 /* If the destination is a kernel buffer, we always clear the end */
85 if ((unsigned long)to >= TASK_SIZE_MAX)
86 memset(to, 0, len);
88 return len; 87 return len;
89} 88}
diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c
index 5d2d8f45b4b6..67faa8d6950e 100644
--- a/drivers/media/dvb-frontends/rtl2832.c
+++ b/drivers/media/dvb-frontends/rtl2832.c
@@ -1240,7 +1240,7 @@ static int rtl2832_probe(struct i2c_client *client,
1240 dev->regmap_config.max_register = 5 * 0x100, 1240 dev->regmap_config.max_register = 5 * 0x100,
1241 dev->regmap_config.ranges = regmap_range_cfg, 1241 dev->regmap_config.ranges = regmap_range_cfg,
1242 dev->regmap_config.num_ranges = ARRAY_SIZE(regmap_range_cfg), 1242 dev->regmap_config.num_ranges = ARRAY_SIZE(regmap_range_cfg),
1243 dev->regmap_config.cache_type = REGCACHE_RBTREE, 1243 dev->regmap_config.cache_type = REGCACHE_NONE,
1244 dev->regmap = regmap_init(&client->dev, &regmap_bus, client, 1244 dev->regmap = regmap_init(&client->dev, &regmap_bus, client,
1245 &dev->regmap_config); 1245 &dev->regmap_config);
1246 if (IS_ERR(dev->regmap)) { 1246 if (IS_ERR(dev->regmap)) {
diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c
index e4901a503c73..63c0ee5d0bf5 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1339,14 +1339,13 @@ static int vidioc_querycap(struct file *file, void *priv,
1339 strlcpy(cap->driver, dev->name, sizeof(cap->driver)); 1339 strlcpy(cap->driver, dev->name, sizeof(cap->driver));
1340 strlcpy(cap->card, cx23885_boards[tsport->dev->board].name, 1340 strlcpy(cap->card, cx23885_boards[tsport->dev->board].name,
1341 sizeof(cap->card)); 1341 sizeof(cap->card));
1342 sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); 1342 sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
1343 cap->capabilities = 1343 cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
1344 V4L2_CAP_VIDEO_CAPTURE | 1344 V4L2_CAP_STREAMING;
1345 V4L2_CAP_READWRITE |
1346 V4L2_CAP_STREAMING |
1347 0;
1348 if (dev->tuner_type != TUNER_ABSENT) 1345 if (dev->tuner_type != TUNER_ABSENT)
1349 cap->capabilities |= V4L2_CAP_TUNER; 1346 cap->device_caps |= V4L2_CAP_TUNER;
1347 cap->capabilities = cap->device_caps | V4L2_CAP_VBI_CAPTURE |
1348 V4L2_CAP_AUDIO | V4L2_CAP_DEVICE_CAPS;
1350 1349
1351 return 0; 1350 return 0;
1352} 1351}
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 12f7452edce3..a92ff4249d10 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1845,6 +1845,9 @@ static void exynos4_jpeg_set_img_addr(struct s5p_jpeg_ctx *ctx)
1845 struct s5p_jpeg_addr jpeg_addr; 1845 struct s5p_jpeg_addr jpeg_addr;
1846 u32 pix_size, padding_bytes = 0; 1846 u32 pix_size, padding_bytes = 0;
1847 1847
1848 jpeg_addr.cb = 0;
1849 jpeg_addr.cr = 0;
1850
1848 pix_size = ctx->cap_q.w * ctx->cap_q.h; 1851 pix_size = ctx->cap_q.w * ctx->cap_q.h;
1849 1852
1850 if (ctx->mode == S5P_JPEG_ENCODE) { 1853 if (ctx->mode == S5P_JPEG_ENCODE) {
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c
index e8c2cad93962..0974b9a7a584 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c
@@ -20,7 +20,7 @@
20 20
21void exynos3250_jpeg_reset(void __iomem *regs) 21void exynos3250_jpeg_reset(void __iomem *regs)
22{ 22{
23 u32 reg = 0; 23 u32 reg = 1;
24 int count = 1000; 24 int count = 1000;
25 25
26 writel(1, regs + EXYNOS3250_SW_RESET); 26 writel(1, regs + EXYNOS3250_SW_RESET);
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 8e44a59d8ec2..98374e8bad3e 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -833,6 +833,7 @@ static int s5p_mfc_open(struct file *file)
833 q->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; 833 q->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
834 q->io_modes = VB2_MMAP; 834 q->io_modes = VB2_MMAP;
835 q->drv_priv = &ctx->fh; 835 q->drv_priv = &ctx->fh;
836 q->lock = &dev->mfc_mutex;
836 if (vdev == dev->vfd_dec) { 837 if (vdev == dev->vfd_dec) {
837 q->io_modes = VB2_MMAP; 838 q->io_modes = VB2_MMAP;
838 q->ops = get_dec_queue_ops(); 839 q->ops = get_dec_queue_ops();
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index 15f7663dd9f5..24262bbb1a35 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -29,7 +29,7 @@
29 29
30/* Offset base used to differentiate between CAPTURE and OUTPUT 30/* Offset base used to differentiate between CAPTURE and OUTPUT
31* while mmaping */ 31* while mmaping */
32#define DST_QUEUE_OFF_BASE (TASK_SIZE / 2) 32#define DST_QUEUE_OFF_BASE (1 << 30)
33 33
34#define MFC_BANK1_ALLOC_CTX 0 34#define MFC_BANK1_ALLOC_CTX 0
35#define MFC_BANK2_ALLOC_CTX 1 35#define MFC_BANK2_ALLOC_CTX 1
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
index de2b8c69daa5..22dfb3effda8 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.h
@@ -302,7 +302,7 @@ struct s5p_mfc_hw_ops {
302 void (*write_info)(struct s5p_mfc_ctx *ctx, unsigned int data, 302 void (*write_info)(struct s5p_mfc_ctx *ctx, unsigned int data,
303 unsigned int ofs); 303 unsigned int ofs);
304 unsigned int (*read_info)(struct s5p_mfc_ctx *ctx, 304 unsigned int (*read_info)(struct s5p_mfc_ctx *ctx,
305 unsigned int ofs); 305 unsigned long ofs);
306 int (*get_dspl_y_adr)(struct s5p_mfc_dev *dev); 306 int (*get_dspl_y_adr)(struct s5p_mfc_dev *dev);
307 int (*get_dec_y_adr)(struct s5p_mfc_dev *dev); 307 int (*get_dec_y_adr)(struct s5p_mfc_dev *dev);
308 int (*get_dspl_status)(struct s5p_mfc_dev *dev); 308 int (*get_dspl_status)(struct s5p_mfc_dev *dev);
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
index 0c4fcf2dfd09..b09bcd140491 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
@@ -263,15 +263,15 @@ static void s5p_mfc_release_dev_context_buffer_v5(struct s5p_mfc_dev *dev)
263static void s5p_mfc_write_info_v5(struct s5p_mfc_ctx *ctx, unsigned int data, 263static void s5p_mfc_write_info_v5(struct s5p_mfc_ctx *ctx, unsigned int data,
264 unsigned int ofs) 264 unsigned int ofs)
265{ 265{
266 writel(data, (volatile void __iomem *)(ctx->shm.virt + ofs)); 266 writel(data, (void *)(ctx->shm.virt + ofs));
267 wmb(); 267 wmb();
268} 268}
269 269
270static unsigned int s5p_mfc_read_info_v5(struct s5p_mfc_ctx *ctx, 270static unsigned int s5p_mfc_read_info_v5(struct s5p_mfc_ctx *ctx,
271 unsigned int ofs) 271 unsigned long ofs)
272{ 272{
273 rmb(); 273 rmb();
274 return readl((volatile void __iomem *)(ctx->shm.virt + ofs)); 274 return readl((void *)(ctx->shm.virt + ofs));
275} 275}
276 276
277static void s5p_mfc_dec_calc_dpb_size_v5(struct s5p_mfc_ctx *ctx) 277static void s5p_mfc_dec_calc_dpb_size_v5(struct s5p_mfc_ctx *ctx)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index d826c58b5d53..cefad184fe96 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -1852,17 +1852,17 @@ static void s5p_mfc_write_info_v6(struct s5p_mfc_ctx *ctx, unsigned int data,
1852 unsigned int ofs) 1852 unsigned int ofs)
1853{ 1853{
1854 s5p_mfc_clock_on(); 1854 s5p_mfc_clock_on();
1855 writel(data, (volatile void __iomem *)((unsigned long)ofs)); 1855 writel(data, (void *)((unsigned long)ofs));
1856 s5p_mfc_clock_off(); 1856 s5p_mfc_clock_off();
1857} 1857}
1858 1858
1859static unsigned int 1859static unsigned int
1860s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned int ofs) 1860s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned long ofs)
1861{ 1861{
1862 int ret; 1862 int ret;
1863 1863
1864 s5p_mfc_clock_on(); 1864 s5p_mfc_clock_on();
1865 ret = readl((volatile void __iomem *)((unsigned long)ofs)); 1865 ret = readl((void *)ofs);
1866 s5p_mfc_clock_off(); 1866 s5p_mfc_clock_off();
1867 1867
1868 return ret; 1868 return ret;
diff --git a/drivers/media/platform/s5p-tv/Kconfig b/drivers/media/platform/s5p-tv/Kconfig
index 5a1835dd65e8..697aaed42486 100644
--- a/drivers/media/platform/s5p-tv/Kconfig
+++ b/drivers/media/platform/s5p-tv/Kconfig
@@ -20,6 +20,7 @@ if VIDEO_SAMSUNG_S5P_TV
20config VIDEO_SAMSUNG_S5P_HDMI 20config VIDEO_SAMSUNG_S5P_HDMI
21 tristate "Samsung HDMI Driver" 21 tristate "Samsung HDMI Driver"
22 depends on VIDEO_V4L2 22 depends on VIDEO_V4L2
23 depends on I2C
23 depends on VIDEO_SAMSUNG_S5P_TV 24 depends on VIDEO_SAMSUNG_S5P_TV
24 select VIDEO_SAMSUNG_S5P_HDMIPHY 25 select VIDEO_SAMSUNG_S5P_HDMIPHY
25 help 26 help
diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index a901b6248557..2554f3719b9e 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -1158,6 +1158,7 @@ static int sh_veu_probe(struct platform_device *pdev)
1158 } 1158 }
1159 1159
1160 *vdev = sh_veu_videodev; 1160 *vdev = sh_veu_videodev;
1161 vdev->v4l2_dev = &veu->v4l2_dev;
1161 spin_lock_init(&veu->lock); 1162 spin_lock_init(&veu->lock);
1162 mutex_init(&veu->fop_lock); 1163 mutex_init(&veu->fop_lock);
1163 vdev->lock = &veu->fop_lock; 1164 vdev->lock = &veu->fop_lock;
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index 8526bf5c8429..c835beb2a1a8 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -843,6 +843,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd)
843 if (isi->pdata.full_mode) 843 if (isi->pdata.full_mode)
844 cfg1 |= ISI_CFG1_FULL_MODE; 844 cfg1 |= ISI_CFG1_FULL_MODE;
845 845
846 cfg1 |= ISI_CFG1_THMASK_BEATS_16;
847
846 isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); 848 isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
847 isi_writel(isi, ISI_CFG1, cfg1); 849 isi_writel(isi, ISI_CFG1, cfg1);
848 850
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index cee7b56f8404..66634b469c98 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1665,7 +1665,7 @@ eclkreg:
1665eaddpdev: 1665eaddpdev:
1666 platform_device_put(sasc->pdev); 1666 platform_device_put(sasc->pdev);
1667eallocpdev: 1667eallocpdev:
1668 devm_kfree(ici->v4l2_dev.dev, sasc); 1668 devm_kfree(ici->v4l2_dev.dev, info);
1669 dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret); 1669 dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret);
1670 1670
1671 return ret; 1671 return ret;
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 77dcfdf547ac..87fc0fe29ebd 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -780,8 +780,6 @@ static int rtl2832u_frontend_callback(void *adapter_priv, int component,
780 case TUNER_RTL2832_TUA9001: 780 case TUNER_RTL2832_TUA9001:
781 return rtl2832u_tua9001_tuner_callback(d, cmd, arg); 781 return rtl2832u_tua9001_tuner_callback(d, cmd, arg);
782 } 782 }
783 default:
784 return -EINVAL;
785 } 783 }
786 784
787 return 0; 785 return 0;
diff --git a/drivers/media/usb/gspca/Kconfig b/drivers/media/usb/gspca/Kconfig
index 60af3b167f3b..3fd94fe7e1eb 100644
--- a/drivers/media/usb/gspca/Kconfig
+++ b/drivers/media/usb/gspca/Kconfig
@@ -1,6 +1,7 @@
1menuconfig USB_GSPCA 1menuconfig USB_GSPCA
2 tristate "GSPCA based webcams" 2 tristate "GSPCA based webcams"
3 depends on VIDEO_V4L2 3 depends on VIDEO_V4L2
4 depends on INPUT || INPUT=n
4 default m 5 default m
5 ---help--- 6 ---help---
6 Say Y here if you want to enable selecting webcams based 7 Say Y here if you want to enable selecting webcams based
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index bc08a829bc13..cc16e76a2493 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -3230,18 +3230,13 @@ int vb2_thread_stop(struct vb2_queue *q)
3230 3230
3231 if (threadio == NULL) 3231 if (threadio == NULL)
3232 return 0; 3232 return 0;
3233 call_void_qop(q, wait_finish, q);
3234 threadio->stop = true; 3233 threadio->stop = true;
3235 vb2_internal_streamoff(q, q->type); 3234 /* Wake up all pending sleeps in the thread */
3236 call_void_qop(q, wait_prepare, q); 3235 vb2_queue_error(q);
3237 err = kthread_stop(threadio->thread); 3236 err = kthread_stop(threadio->thread);
3238 q->fileio = NULL; 3237 __vb2_cleanup_fileio(q);
3239 fileio->req.count = 0;
3240 vb2_reqbufs(q, &fileio->req);
3241 kfree(fileio);
3242 threadio->thread = NULL; 3238 threadio->thread = NULL;
3243 kfree(threadio); 3239 kfree(threadio);
3244 q->fileio = NULL;
3245 q->threadio = NULL; 3240 q->threadio = NULL;
3246 return err; 3241 return err;
3247} 3242}
diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c
index b481d20c8372..69e0483adfee 100644
--- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
@@ -632,8 +632,7 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr,
632 } 632 }
633 633
634 /* extract page list from userspace mapping */ 634 /* extract page list from userspace mapping */
635 ret = vb2_dc_get_user_pages(start, pages, n_pages, vma, 635 ret = vb2_dc_get_user_pages(start, pages, n_pages, vma, dma_dir);
636 dma_dir == DMA_FROM_DEVICE);
637 if (ret) { 636 if (ret) {
638 unsigned long pfn; 637 unsigned long pfn;
639 if (vb2_dc_get_user_pfn(start, n_pages, vma, &pfn) == 0) { 638 if (vb2_dc_get_user_pfn(start, n_pages, vma, &pfn) == 0) {
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h
index c2e570336269..6008b0985b7b 100644
--- a/include/media/atmel-isi.h
+++ b/include/media/atmel-isi.h
@@ -59,6 +59,10 @@
59#define ISI_CFG1_FRATE_DIV_MASK (7 << 8) 59#define ISI_CFG1_FRATE_DIV_MASK (7 << 8)
60#define ISI_CFG1_DISCR (1 << 11) 60#define ISI_CFG1_DISCR (1 << 11)
61#define ISI_CFG1_FULL_MODE (1 << 12) 61#define ISI_CFG1_FULL_MODE (1 << 12)
62/* Definition for THMASK(ISI_V2) */
63#define ISI_CFG1_THMASK_BEATS_4 (0 << 13)
64#define ISI_CFG1_THMASK_BEATS_8 (1 << 13)
65#define ISI_CFG1_THMASK_BEATS_16 (2 << 13)
62 66
63/* Bitfields in CFG2 */ 67/* Bitfields in CFG2 */
64#define ISI_CFG2_GRAYSCALE (1 << 13) 68#define ISI_CFG2_GRAYSCALE (1 << 13)
diff --git a/kernel/module.c b/kernel/module.c
index 99fdf94efce8..ec53f594e9c9 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2479,6 +2479,23 @@ static int elf_header_check(struct load_info *info)
2479 return 0; 2479 return 0;
2480} 2480}
2481 2481
2482#define COPY_CHUNK_SIZE (16*PAGE_SIZE)
2483
2484static int copy_chunked_from_user(void *dst, const void __user *usrc, unsigned long len)
2485{
2486 do {
2487 unsigned long n = min(len, COPY_CHUNK_SIZE);
2488
2489 if (copy_from_user(dst, usrc, n) != 0)
2490 return -EFAULT;
2491 cond_resched();
2492 dst += n;
2493 usrc += n;
2494 len -= n;
2495 } while (len);
2496 return 0;
2497}
2498
2482/* Sets info->hdr and info->len. */ 2499/* Sets info->hdr and info->len. */
2483static int copy_module_from_user(const void __user *umod, unsigned long len, 2500static int copy_module_from_user(const void __user *umod, unsigned long len,
2484 struct load_info *info) 2501 struct load_info *info)
@@ -2498,7 +2515,7 @@ static int copy_module_from_user(const void __user *umod, unsigned long len,
2498 if (!info->hdr) 2515 if (!info->hdr)
2499 return -ENOMEM; 2516 return -ENOMEM;
2500 2517
2501 if (copy_from_user(info->hdr, umod, info->len) != 0) { 2518 if (copy_chunked_from_user(info->hdr, umod, info->len) != 0) {
2502 vfree(info->hdr); 2519 vfree(info->hdr);
2503 return -EFAULT; 2520 return -EFAULT;
2504 } 2521 }