From: Greg Kroah-Hartman Date: Mon, 16 Mar 2015 11:45:19 +0000 (+0100) Subject: 3.19-stable patches X-Git-Tag: v3.10.72~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f121e093536669ddc152f58187bb8adfc15b1e32;p=thirdparty%2Fkernel%2Fstable-queue.git 3.19-stable patches added patches: clk-fix-debugfs-clk-removal-before-inited.patch clk-zynq-force-cpu_2x-clock-to-be-ungated.patch fixed-invalid-assignment-of-64bit-mask-to-host-dma_boundary-for-scatter-gather-segment-boundary-limit.patch staging-comedi-comedi_compat32.c-fix-comedi_cmd-copy-back.patch sunxi-clk-set-sun6i-pll1-n_start-1.patch wd719x-add-missing-.module-to-wd719x_template.patch --- diff --git a/queue-3.19/clk-fix-debugfs-clk-removal-before-inited.patch b/queue-3.19/clk-fix-debugfs-clk-removal-before-inited.patch new file mode 100644 index 00000000000..9bb1678a8d9 --- /dev/null +++ b/queue-3.19/clk-fix-debugfs-clk-removal-before-inited.patch @@ -0,0 +1,94 @@ +From 52bba9809a954d72bc77773bd560b9724b495eb7 Mon Sep 17 00:00:00 2001 +From: Srinivas Kandagatla +Date: Mon, 19 Jan 2015 09:57:13 +0000 +Subject: clk: Fix debugfs clk removal before inited + +From: Srinivas Kandagatla + +commit 52bba9809a954d72bc77773bd560b9724b495eb7 upstream. + +Some of the clks can be registered & unregistered before the clk related debugfs +entries are initialized at late_initcall. In the unregister path checking for only +dentry before clk_debug_init() would lead dangling pointers in the debug clk list, +because the list is already populated in register path and the clk pointer freed in +unregister path. +The side effect of not removing it from the list is either a null pointer +dereference or if lucky to boot the system, the number of clk entries in +debugfs disappear. + +We could add more checks like if (inited && !clk->dentry) but just removing +the check for dentry made more sense as debugfs_remove_recursive() seems to be +safe with null pointers. This will ensure that the unregistering clk would be +removed from the debug list in all the code paths. + +Without this patch kernel would crash with log: +Unable to handle kernel NULL pointer dereference at virtual address 00000000 +pgd = c0204000 +[00000000] *pgd=00000000 +Internal error: Oops: 5 [#1] SMP ARM +Modules linked in: +CPU: 1 PID: 1 Comm: swapper/0 Tainted: G B 3.19.0-rc3-00007-g412f9ba-dirty #840 +Hardware name: Qualcomm (Flattened Device Tree) +task: ed948000 ti: ed944000 task.ti: ed944000 +PC is at strlen+0xc/0x40 +LR is at __create_file+0x64/0x1dc +pc : [] lr : [] psr: 60000013 +sp : ed945e40 ip : ed945e50 fp : ed945e4c +r10: 00000000 r9 : c1006094 r8 : 00000000 +r7 : 000041ed r6 : 00000000 r5 : ed4af998 r4 : c11b5e28 +r3 : 00000000 r2 : ed945e38 r1 : a0000013 r0 : 00000000 +Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel +Control: 10c5787d Table: 8020406a DAC: 00000015 +Process swapper/0 (pid: 1, stack limit = 0xed944248) +Stack: (0xed945e40 to 0xed946000) +5e40: ed945e7c ed945e50 c049f1c4 c04ee604 c0fc2fa4 00000000 ecb748c0 c11c2b80 +5e60: c0beec04 0000011c c0fc2fa4 00000000 ed945e94 ed945e80 c049f3e0 c049f16c +5e80: 00000000 00000000 ed945eac ed945e98 c08cbc50 c049f3c0 ecb748c0 c11c2b80 +5ea0: ed945ed4 ed945eb0 c0fc3080 c08cbc30 c0beec04 c107e1d8 ecdf0600 c107e1d8 +5ec0: c107e1d8 ecdf0600 ed945f54 ed945ed8 c0208ed4 c0fc2fb0 c026a784 c04ee628 +5ee0: ed945f0c ed945ef0 c0f5d600 c04ee604 c0f5d5ec ef7fcc7d c0b40ecc 0000011c +5f00: ed945f54 ed945f10 c026a994 c0f5d5f8 c04ecc00 00000007 ef7fcc95 00000007 +5f20: c0e90744 c0dd0884 ed945f54 c106cde0 00000007 c117f8c0 0000011c c0f5d5ec +5f40: c1006094 c100609c ed945f94 ed945f58 c0f5de34 c0208e50 00000007 00000007 +5f60: c0f5d5ec be9b5ae0 00000000 c117f8c0 c0af1680 00000000 00000000 00000000 +5f80: 00000000 00000000 ed945fac ed945f98 c0af169c c0f5dd2c ed944000 00000000 +5fa0: 00000000 ed945fb0 c020f298 c0af168c 00000000 00000000 00000000 00000000 +5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 +5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ebcc6d33 bfffca73 +[] (strlen) from [] (__create_file+0x64/0x1dc) +[] (__create_file) from [] (debugfs_create_dir+0x2c/0x34) +[] (debugfs_create_dir) from [] (clk_debug_create_one+0x2c/0x16c) +[] (clk_debug_create_one) from [] (clk_debug_init+0xdc/0x144) +[] (clk_debug_init) from [] (do_one_initcall+0x90/0x1e0) +[] (do_one_initcall) from [] (kernel_init_freeable+0x114/0x1e0) +[] (kernel_init_freeable) from [] (kernel_init+0x1c/0xfc) +[] (kernel_init) from [] (ret_from_fork+0x14/0x3c) +Code: c0b40ecc e1a0c00d e92dd800 e24cb004 (e5d02000) +---[ end trace b940e45b5e25c1e7 ]--- + +Fixes: 6314b6796e3c "clk: Don't hold prepare_lock across debugfs creation" +Signed-off-by: Srinivas Kandagatla +Reviewed-by: Stephen Boyd +Signed-off-by: Michael Turquette +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/clk.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/clk/clk.c ++++ b/drivers/clk/clk.c +@@ -343,13 +343,9 @@ unlock: + static void clk_debug_unregister(struct clk *clk) + { + mutex_lock(&clk_debug_lock); +- if (!clk->dentry) +- goto out; +- + hlist_del_init(&clk->debug_node); + debugfs_remove_recursive(clk->dentry); + clk->dentry = NULL; +-out: + mutex_unlock(&clk_debug_lock); + } + diff --git a/queue-3.19/clk-zynq-force-cpu_2x-clock-to-be-ungated.patch b/queue-3.19/clk-zynq-force-cpu_2x-clock-to-be-ungated.patch new file mode 100644 index 00000000000..259cebdfaca --- /dev/null +++ b/queue-3.19/clk-zynq-force-cpu_2x-clock-to-be-ungated.patch @@ -0,0 +1,33 @@ +From 3dccfecdb867fe35b305a4e493ef5652b7d9d4cb Mon Sep 17 00:00:00 2001 +From: Soren Brinkmann +Date: Tue, 27 Jan 2015 11:05:27 -0800 +Subject: clk: zynq: Force CPU_2X clock to be ungated + +From: Soren Brinkmann + +commit 3dccfecdb867fe35b305a4e493ef5652b7d9d4cb upstream. + +The CPU_2X clock does not have a classical in-kernel user, but is, +amongst other things, required for OCM and debug access. Make sure this +clock is not mistakenly disabled during boot up by enabling it in the +platform's clock driver. + +Fixes: 0ee52b157b8e 'clk: zynq: Add clock controller driver' +Signed-off-by: Soren Brinkmann +Signed-off-by: Michael Turquette +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/zynq/clkc.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/zynq/clkc.c ++++ b/drivers/clk/zynq/clkc.c +@@ -303,6 +303,7 @@ static void __init zynq_clk_setup(struct + clks[cpu_2x] = clk_register_gate(NULL, clk_output_name[cpu_2x], + "cpu_2x_div", CLK_IGNORE_UNUSED, SLCR_ARM_CLK_CTRL, + 26, 0, &armclk_lock); ++ clk_prepare_enable(clks[cpu_2x]); + + clk = clk_register_fixed_factor(NULL, "cpu_1x_div", "cpu_div", 0, 1, + 4 + 2 * tmp); diff --git a/queue-3.19/fixed-invalid-assignment-of-64bit-mask-to-host-dma_boundary-for-scatter-gather-segment-boundary-limit.patch b/queue-3.19/fixed-invalid-assignment-of-64bit-mask-to-host-dma_boundary-for-scatter-gather-segment-boundary-limit.patch new file mode 100644 index 00000000000..580e1e070d7 --- /dev/null +++ b/queue-3.19/fixed-invalid-assignment-of-64bit-mask-to-host-dma_boundary-for-scatter-gather-segment-boundary-limit.patch @@ -0,0 +1,34 @@ +From f76a610a8b4b6280eaedf48f3af9d5d74e418b66 Mon Sep 17 00:00:00 2001 +From: Minh Duc Tran +Date: Mon, 9 Feb 2015 18:54:09 +0000 +Subject: fixed invalid assignment of 64bit mask to host dma_boundary for scatter gather segment boundary limit. + +From: Minh Duc Tran + +commit f76a610a8b4b6280eaedf48f3af9d5d74e418b66 upstream. + +In reference to bug https://bugzilla.redhat.com/show_bug.cgi?id=1097141 +Assert is seen with AMD cpu whenever calling pci_alloc_consistent. + +[ 29.406183] ------------[ cut here ]------------ +[ 29.410505] kernel BUG at lib/iommu-helper.c:13! + +Signed-off-by: Minh Tran +Fixes: 6733b39a1301b0b020bbcbf3295852e93e624cb1 +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/be2iscsi/be_main.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/scsi/be2iscsi/be_main.c ++++ b/drivers/scsi/be2iscsi/be_main.c +@@ -586,7 +586,6 @@ static struct beiscsi_hba *beiscsi_hba_a + "beiscsi_hba_alloc - iscsi_host_alloc failed\n"); + return NULL; + } +- shost->dma_boundary = pcidev->dma_mask; + shost->max_id = BE2_MAX_SESSIONS; + shost->max_channel = 0; + shost->max_cmd_len = BEISCSI_MAX_CMD_LEN; diff --git a/queue-3.19/series b/queue-3.19/series index 904e7b85f40..4dead3e4912 100644 --- a/queue-3.19/series +++ b/queue-3.19/series @@ -125,3 +125,9 @@ ib-core-fix-deadlock-on-uverbs-modify_qp-error-flow.patch ib-core-properly-handle-registration-of-on-demand-paging-mrs-after-dereg.patch ib-core-when-marshaling-ucma-path-from-user-space-clear-unused-fields.patch nilfs2-fix-potential-memory-overrun-on-inode.patch +wd719x-add-missing-.module-to-wd719x_template.patch +fixed-invalid-assignment-of-64bit-mask-to-host-dma_boundary-for-scatter-gather-segment-boundary-limit.patch +clk-zynq-force-cpu_2x-clock-to-be-ungated.patch +clk-fix-debugfs-clk-removal-before-inited.patch +sunxi-clk-set-sun6i-pll1-n_start-1.patch +staging-comedi-comedi_compat32.c-fix-comedi_cmd-copy-back.patch diff --git a/queue-3.19/staging-comedi-comedi_compat32.c-fix-comedi_cmd-copy-back.patch b/queue-3.19/staging-comedi-comedi_compat32.c-fix-comedi_cmd-copy-back.patch new file mode 100644 index 00000000000..2d4f9efac0c --- /dev/null +++ b/queue-3.19/staging-comedi-comedi_compat32.c-fix-comedi_cmd-copy-back.patch @@ -0,0 +1,61 @@ +From 42b8ce6f55facfa101462e694d33fc6bca471138 Mon Sep 17 00:00:00 2001 +From: Ian Abbott +Date: Tue, 27 Jan 2015 18:16:51 +0000 +Subject: staging: comedi: comedi_compat32.c: fix COMEDI_CMD copy back + +From: Ian Abbott + +commit 42b8ce6f55facfa101462e694d33fc6bca471138 upstream. + +`do_cmd_ioctl()` in "comedi_fops.c" handles the `COMEDI_CMD` ioctl. +This returns `-EAGAIN` if it has copied a modified `struct comedi_cmd` +back to user-space. (This occurs when the low-level Comedi driver's +`do_cmdtest()` handler returns non-zero to indicate a problem with the +contents of the `struct comedi_cmd`, or when the `struct comedi_cmd` has +the `CMDF_BOGUS` flag set.) + +`compat_cmd()` in "comedi_compat32.c" handles the 32-bit compatible +version of the `COMEDI_CMD` ioctl. Currently, it never copies a 32-bit +compatible version of `struct comedi_cmd` back to user-space, which is +at odds with the way the regular `COMEDI_CMD` ioctl is handled. To fix +it, change `compat_cmd()` to copy a 32-bit compatible version of the +`struct comedi_cmd` back to user-space when the main ioctl handler +returns `-EAGAIN`. + +Signed-off-by: Ian Abbott +Reviewed-by: H Hartley Sweeten +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/comedi/comedi_compat32.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/staging/comedi/comedi_compat32.c ++++ b/drivers/staging/comedi/comedi_compat32.c +@@ -262,7 +262,7 @@ static int compat_cmd(struct file *file, + { + struct comedi_cmd __user *cmd; + struct comedi32_cmd_struct __user *cmd32; +- int rc; ++ int rc, err; + + cmd32 = compat_ptr(arg); + cmd = compat_alloc_user_space(sizeof(*cmd)); +@@ -271,7 +271,15 @@ static int compat_cmd(struct file *file, + if (rc) + return rc; + +- return translated_ioctl(file, COMEDI_CMD, (unsigned long)cmd); ++ rc = translated_ioctl(file, COMEDI_CMD, (unsigned long)cmd); ++ if (rc == -EAGAIN) { ++ /* Special case: copy cmd back to user. */ ++ err = put_compat_cmd(cmd32, cmd); ++ if (err) ++ rc = err; ++ } ++ ++ return rc; + } + + /* Handle 32-bit COMEDI_CMDTEST ioctl. */ diff --git a/queue-3.19/sunxi-clk-set-sun6i-pll1-n_start-1.patch b/queue-3.19/sunxi-clk-set-sun6i-pll1-n_start-1.patch new file mode 100644 index 00000000000..6a7d5dcd5ce --- /dev/null +++ b/queue-3.19/sunxi-clk-set-sun6i-pll1-n_start-1.patch @@ -0,0 +1,32 @@ +From 76820fcf7aa5a418b69cb7bed31b62d1feb1d6ad Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 24 Jan 2015 12:56:32 +0100 +Subject: sunxi: clk: Set sun6i-pll1 n_start = 1 + +From: Hans de Goede + +commit 76820fcf7aa5a418b69cb7bed31b62d1feb1d6ad upstream. + +For all pll-s on sun6i n == 0 means use a multiplier of 1, rather then 0 as +it means on sun4i / sun5i / sun7i. n_start = 1 is already correctly set +for sun6i pll6, but was missing for pll1, this commit fixes this. + +Cc: Chen-Yu Tsai +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/sunxi/clk-sunxi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/sunxi/clk-sunxi.c ++++ b/drivers/clk/sunxi/clk-sunxi.c +@@ -413,6 +413,7 @@ static struct clk_factors_config sun6i_a + .kwidth = 2, + .mshift = 0, + .mwidth = 2, ++ .n_start = 1, + }; + + static struct clk_factors_config sun8i_a23_pll1_config = { diff --git a/queue-3.19/wd719x-add-missing-.module-to-wd719x_template.patch b/queue-3.19/wd719x-add-missing-.module-to-wd719x_template.patch new file mode 100644 index 00000000000..9777c5db540 --- /dev/null +++ b/queue-3.19/wd719x-add-missing-.module-to-wd719x_template.patch @@ -0,0 +1,33 @@ +From 2ecf8e0ae28cb22d434e628c351c6193fd75fafa Mon Sep 17 00:00:00 2001 +From: Ondrej Zary +Date: Mon, 9 Feb 2015 13:38:21 +0100 +Subject: wd719x: add missing .module to wd719x_template + +From: Ondrej Zary + +commit 2ecf8e0ae28cb22d434e628c351c6193fd75fafa upstream. + +wd719x_template is missing the .module field, causing module refcount +not to work, allowing to rmmod the driver while in use (mounted filesystem), +causing an oops. + +Set .module to THIS_MODULE to fix the problem. + +Signed-off-by: Ondrej Zary +Signed-off-by: James Bottomley +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/wd719x.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/scsi/wd719x.c ++++ b/drivers/scsi/wd719x.c +@@ -870,6 +870,7 @@ fail_free_params: + } + + static struct scsi_host_template wd719x_template = { ++ .module = THIS_MODULE, + .name = "Western Digital 719x", + .queuecommand = wd719x_queuecommand, + .eh_abort_handler = wd719x_abort,