From: Greg Kroah-Hartman Date: Wed, 8 Aug 2012 16:02:17 +0000 (-0700) Subject: 3.5-stable patches X-Git-Tag: v3.5.1~2^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c1e5ba6fb7e58f2a4b96446341f1d0e6bae4eed;p=thirdparty%2Fkernel%2Fstable-queue.git 3.5-stable patches added patches: media-ene_ir-fix-driver-initialisation.patch media-m5mols-correct-reported-iso-values.patch media-videobuf-dma-contig-restore-buffer-mapping-for-uncached-bufers.patch nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioctls.patch --- diff --git a/queue-3.5/media-ene_ir-fix-driver-initialisation.patch b/queue-3.5/media-ene_ir-fix-driver-initialisation.patch new file mode 100644 index 00000000000..c97b4acb609 --- /dev/null +++ b/queue-3.5/media-ene_ir-fix-driver-initialisation.patch @@ -0,0 +1,45 @@ +From b31b021988fed9e3741a46918f14ba9b063811db Mon Sep 17 00:00:00 2001 +From: Luis Henriques +Date: Tue, 19 Jun 2012 11:29:49 -0300 +Subject: media: ene_ir: Fix driver initialisation + +From: Luis Henriques + +commit b31b021988fed9e3741a46918f14ba9b063811db upstream. + +commit 9ef449c6b31bb6a8e6dedc24de475a3b8c79be20 ("[media] rc: Postpone ISR +registration") fixed an early ISR registration on several drivers. It did +however also introduced a bug by moving the invocation of pnp_port_start() +to the end of the probe function. + +This patch fixes this issue by moving the invocation of pnp_port_start() to +an earlier stage in the probe function. + +Signed-off-by: Luis Henriques +Cc: Jarod Wilson +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/rc/ene_ir.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/media/rc/ene_ir.c ++++ b/drivers/media/rc/ene_ir.c +@@ -1018,6 +1018,8 @@ static int ene_probe(struct pnp_dev *pnp + + spin_lock_init(&dev->hw_lock); + ++ dev->hw_io = pnp_port_start(pnp_dev, 0); ++ + pnp_set_drvdata(pnp_dev, dev); + dev->pnp_dev = pnp_dev; + +@@ -1072,7 +1074,6 @@ static int ene_probe(struct pnp_dev *pnp + + /* claim the resources */ + error = -EBUSY; +- dev->hw_io = pnp_port_start(pnp_dev, 0); + if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { + dev->hw_io = -1; + dev->irq = -1; diff --git a/queue-3.5/media-m5mols-correct-reported-iso-values.patch b/queue-3.5/media-m5mols-correct-reported-iso-values.patch new file mode 100644 index 00000000000..8473c42e48b --- /dev/null +++ b/queue-3.5/media-m5mols-correct-reported-iso-values.patch @@ -0,0 +1,37 @@ +From 6126b912c84240692e26c1b820a7097610eddf34 Mon Sep 17 00:00:00 2001 +From: Sylwester Nawrocki +Date: Tue, 24 Jul 2012 12:12:07 -0300 +Subject: media: m5mols: Correct reported ISO values + +From: Sylwester Nawrocki + +commit 6126b912c84240692e26c1b820a7097610eddf34 upstream. + +The V4L2_CID_ISO_SENSITIVITY control menu values should be +standard ISO values multiplied by 1000. Multiply all menu +items by 1000 so ISO is properly reported as 50...3200 range. + +This applies to kernels 3.5+. + +Signed-off-by: Sylwester Nawrocki +Signed-off-by: Kyungmin Park +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/video/m5mols/m5mols_controls.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/media/video/m5mols/m5mols_controls.c ++++ b/drivers/media/video/m5mols/m5mols_controls.c +@@ -527,8 +527,8 @@ static const struct v4l2_ctrl_ops m5mols + + /* Supported manual ISO values */ + static const s64 iso_qmenu[] = { +- /* AE_ISO: 0x01...0x07 */ +- 50, 100, 200, 400, 800, 1600, 3200 ++ /* AE_ISO: 0x01...0x07 (ISO: 50...3200) */ ++ 50000, 100000, 200000, 400000, 800000, 1600000, 3200000 + }; + + /* Supported Exposure Bias values, -2.0EV...+2.0EV */ diff --git a/queue-3.5/media-videobuf-dma-contig-restore-buffer-mapping-for-uncached-bufers.patch b/queue-3.5/media-videobuf-dma-contig-restore-buffer-mapping-for-uncached-bufers.patch new file mode 100644 index 00000000000..d1595c767b1 --- /dev/null +++ b/queue-3.5/media-videobuf-dma-contig-restore-buffer-mapping-for-uncached-bufers.patch @@ -0,0 +1,93 @@ +From 4099040eaaa4fe543c4e915b8cab51b1d843edee Mon Sep 17 00:00:00 2001 +From: "Lad, Prabhakar" +Date: Fri, 22 Jun 2012 06:19:28 -0300 +Subject: media: videobuf-dma-contig: restore buffer mapping for uncached bufers + +From: "Lad, Prabhakar" + +commit 4099040eaaa4fe543c4e915b8cab51b1d843edee upstream. + +from commit a8f3c203e19b702fa5e8e83a9b6fb3c5a6d1cce4 +restore the mapping scheme for uncached buffers, +which was changed in a common scheme for cached and uncached. +This apparently was wrong, and was probably intended only for cached buffers. +the fix fixes the crash observed while mapping uncached buffers. + +Signed-off-by: Lad, Prabhakar +Signed-off-by: Hadli, Manjunath +Acked-by: Federico Vaga +Acked-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/video/videobuf-dma-contig.c | 53 ++++++++++++++++++------------ + 1 file changed, 32 insertions(+), 21 deletions(-) + +--- a/drivers/media/video/videobuf-dma-contig.c ++++ b/drivers/media/video/videobuf-dma-contig.c +@@ -359,32 +359,43 @@ static int __videobuf_mmap_mapper(struct + size = vma->vm_end - vma->vm_start; + size = (size < mem->size) ? size : mem->size; + +- if (!mem->cached) ++ if (!mem->cached) { + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); +- +- pos = (unsigned long)mem->vaddr; +- +- while (size > 0) { +- page = virt_to_page((void *)pos); +- if (NULL == page) { +- dev_err(q->dev, "mmap: virt_to_page failed\n"); +- __videobuf_dc_free(q->dev, mem); +- goto error; +- } +- retval = vm_insert_page(vma, start, page); ++ retval = remap_pfn_range(vma, vma->vm_start, ++ mem->dma_handle >> PAGE_SHIFT, ++ size, vma->vm_page_prot); + if (retval) { +- dev_err(q->dev, "mmap: insert failed with error %d\n", +- retval); +- __videobuf_dc_free(q->dev, mem); ++ dev_err(q->dev, "mmap: remap failed with error %d. ", ++ retval); ++ dma_free_coherent(q->dev, mem->size, ++ mem->vaddr, mem->dma_handle); + goto error; + } +- start += PAGE_SIZE; +- pos += PAGE_SIZE; ++ } else { ++ pos = (unsigned long)mem->vaddr; ++ ++ while (size > 0) { ++ page = virt_to_page((void *)pos); ++ if (NULL == page) { ++ dev_err(q->dev, "mmap: virt_to_page failed\n"); ++ __videobuf_dc_free(q->dev, mem); ++ goto error; ++ } ++ retval = vm_insert_page(vma, start, page); ++ if (retval) { ++ dev_err(q->dev, "mmap: insert failed with error %d\n", ++ retval); ++ __videobuf_dc_free(q->dev, mem); ++ goto error; ++ } ++ start += PAGE_SIZE; ++ pos += PAGE_SIZE; + +- if (size > PAGE_SIZE) +- size -= PAGE_SIZE; +- else +- size = 0; ++ if (size > PAGE_SIZE) ++ size -= PAGE_SIZE; ++ else ++ size = 0; ++ } + } + + vma->vm_ops = &videobuf_vm_ops; diff --git a/queue-3.5/nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioctls.patch b/queue-3.5/nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioctls.patch new file mode 100644 index 00000000000..6702469082d --- /dev/null +++ b/queue-3.5/nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioctls.patch @@ -0,0 +1,135 @@ +From 572d8b3945a31bee7c40d21556803e4807fd9141 Mon Sep 17 00:00:00 2001 +From: Ryusuke Konishi +Date: Mon, 30 Jul 2012 14:42:07 -0700 +Subject: nilfs2: fix deadlock issue between chcp and thaw ioctls + +From: Ryusuke Konishi + +commit 572d8b3945a31bee7c40d21556803e4807fd9141 upstream. + +An fs-thaw ioctl causes deadlock with a chcp or mkcp -s command: + + chcp D ffff88013870f3d0 0 1325 1324 0x00000004 + ... + Call Trace: + nilfs_transaction_begin+0x11c/0x1a0 [nilfs2] + wake_up_bit+0x20/0x20 + copy_from_user+0x18/0x30 [nilfs2] + nilfs_ioctl_change_cpmode+0x7d/0xcf [nilfs2] + nilfs_ioctl+0x252/0x61a [nilfs2] + do_page_fault+0x311/0x34c + get_unmapped_area+0x132/0x14e + do_vfs_ioctl+0x44b/0x490 + __set_task_blocked+0x5a/0x61 + vm_mmap_pgoff+0x76/0x87 + __set_current_blocked+0x30/0x4a + sys_ioctl+0x4b/0x6f + system_call_fastpath+0x16/0x1b + thaw D ffff88013870d890 0 1352 1351 0x00000004 + ... + Call Trace: + rwsem_down_failed_common+0xdb/0x10f + call_rwsem_down_write_failed+0x13/0x20 + down_write+0x25/0x27 + thaw_super+0x13/0x9e + do_vfs_ioctl+0x1f5/0x490 + vm_mmap_pgoff+0x76/0x87 + sys_ioctl+0x4b/0x6f + filp_close+0x64/0x6c + system_call_fastpath+0x16/0x1b + +where the thaw ioctl deadlocked at thaw_super() when called while chcp was +waiting at nilfs_transaction_begin() called from +nilfs_ioctl_change_cpmode(). This deadlock is 100% reproducible. + +This is because nilfs_ioctl_change_cpmode() first locks sb->s_umount in +read mode and then waits for unfreezing in nilfs_transaction_begin(), +whereas thaw_super() locks sb->s_umount in write mode. The locking of +sb->s_umount here was intended to make snapshot mounts and the downgrade +of snapshots to checkpoints exclusive. + +This fixes the deadlock issue by replacing the sb->s_umount usage in +nilfs_ioctl_change_cpmode() with a dedicated mutex which protects snapshot +mounts. + +Signed-off-by: Ryusuke Konishi +Cc: Fernando Luis Vazquez Cao +Tested-by: Ryusuke Konishi +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nilfs2/ioctl.c | 4 ++-- + fs/nilfs2/super.c | 3 +++ + fs/nilfs2/the_nilfs.c | 1 + + fs/nilfs2/the_nilfs.h | 2 ++ + 4 files changed, 8 insertions(+), 2 deletions(-) + +--- a/fs/nilfs2/ioctl.c ++++ b/fs/nilfs2/ioctl.c +@@ -182,7 +182,7 @@ static int nilfs_ioctl_change_cpmode(str + if (copy_from_user(&cpmode, argp, sizeof(cpmode))) + goto out; + +- down_read(&inode->i_sb->s_umount); ++ mutex_lock(&nilfs->ns_snapshot_mount_mutex); + + nilfs_transaction_begin(inode->i_sb, &ti, 0); + ret = nilfs_cpfile_change_cpmode( +@@ -192,7 +192,7 @@ static int nilfs_ioctl_change_cpmode(str + else + nilfs_transaction_commit(inode->i_sb); /* never fails */ + +- up_read(&inode->i_sb->s_umount); ++ mutex_unlock(&nilfs->ns_snapshot_mount_mutex); + out: + mnt_drop_write_file(filp); + return ret; +--- a/fs/nilfs2/super.c ++++ b/fs/nilfs2/super.c +@@ -948,6 +948,8 @@ static int nilfs_attach_snapshot(struct + struct nilfs_root *root; + int ret; + ++ mutex_lock(&nilfs->ns_snapshot_mount_mutex); ++ + down_read(&nilfs->ns_segctor_sem); + ret = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, cno); + up_read(&nilfs->ns_segctor_sem); +@@ -972,6 +974,7 @@ static int nilfs_attach_snapshot(struct + ret = nilfs_get_root_dentry(s, root, root_dentry); + nilfs_put_root(root); + out: ++ mutex_unlock(&nilfs->ns_snapshot_mount_mutex); + return ret; + } + +--- a/fs/nilfs2/the_nilfs.c ++++ b/fs/nilfs2/the_nilfs.c +@@ -76,6 +76,7 @@ struct the_nilfs *alloc_nilfs(struct blo + nilfs->ns_bdev = bdev; + atomic_set(&nilfs->ns_ndirtyblks, 0); + init_rwsem(&nilfs->ns_sem); ++ mutex_init(&nilfs->ns_snapshot_mount_mutex); + INIT_LIST_HEAD(&nilfs->ns_dirty_files); + INIT_LIST_HEAD(&nilfs->ns_gc_inodes); + spin_lock_init(&nilfs->ns_inode_lock); +--- a/fs/nilfs2/the_nilfs.h ++++ b/fs/nilfs2/the_nilfs.h +@@ -47,6 +47,7 @@ enum { + * @ns_flags: flags + * @ns_bdev: block device + * @ns_sem: semaphore for shared states ++ * @ns_snapshot_mount_mutex: mutex to protect snapshot mounts + * @ns_sbh: buffer heads of on-disk super blocks + * @ns_sbp: pointers to super block data + * @ns_sbwtime: previous write time of super block +@@ -99,6 +100,7 @@ struct the_nilfs { + + struct block_device *ns_bdev; + struct rw_semaphore ns_sem; ++ struct mutex ns_snapshot_mount_mutex; + + /* + * used for diff --git a/queue-3.5/series b/queue-3.5/series index 6993322c484..efa8c454963 100644 --- a/queue-3.5/series +++ b/queue-3.5/series @@ -8,3 +8,7 @@ lib-vsprintf.c-kptr_restrict-fix-pk-error-in-sysrq-show-all-timers-q.patch sunrpc-clnt-add-missing-braces.patch sunrpc-return-negative-value-in-case-rpcbind-client-creation-error.patch misdn-bugfix-only-few-bytes-are-transfered-on-a-connection.patch +nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioctls.patch +media-ene_ir-fix-driver-initialisation.patch +media-m5mols-correct-reported-iso-values.patch +media-videobuf-dma-contig-restore-buffer-mapping-for-uncached-bufers.patch