]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.13-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 22:42:51 +0000 (14:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 22:42:51 +0000 (14:42 -0800)
added patches:
ftrace-x86-use-breakpoints-for-converting-function-graph-caller.patch
iio-adis16400-set-timestamp-as-the-last-element-in-chan_spec.patch
iio-ak8975-fix-calculation-formula-for-convert-micro-tesla-to-gauss-unit.patch
iio-max1363-use-devm_regulator_get_optional-for-optional-regulator.patch
staging-comedi-adv_pci1710-fix-analog-output-readback-value.patch
staging-iio-ad799x-fix-error_free_irq-which-was-freeing-an-irq-that-may-not-have-been-requested.patch
staging-iio-ad799x-fix-typo-in-ad799x_events.patch
staging-iio-impedance-ad5933-correct-error-check.patch
staging-lustre-fix-quotactl-permission-denied-lu-4530.patch
staging-r8188eu-fix-typo-in-usb_device-list.patch
x86-smap-don-t-enable-smap-if-config_x86_smap-is-disabled.patch
x86-smap-smap_violation-is-bogus-if-config_x86_smap-is-off.patch

13 files changed:
queue-3.13/ftrace-x86-use-breakpoints-for-converting-function-graph-caller.patch [new file with mode: 0644]
queue-3.13/iio-adis16400-set-timestamp-as-the-last-element-in-chan_spec.patch [new file with mode: 0644]
queue-3.13/iio-ak8975-fix-calculation-formula-for-convert-micro-tesla-to-gauss-unit.patch [new file with mode: 0644]
queue-3.13/iio-max1363-use-devm_regulator_get_optional-for-optional-regulator.patch [new file with mode: 0644]
queue-3.13/series
queue-3.13/staging-comedi-adv_pci1710-fix-analog-output-readback-value.patch [new file with mode: 0644]
queue-3.13/staging-iio-ad799x-fix-error_free_irq-which-was-freeing-an-irq-that-may-not-have-been-requested.patch [new file with mode: 0644]
queue-3.13/staging-iio-ad799x-fix-typo-in-ad799x_events.patch [new file with mode: 0644]
queue-3.13/staging-iio-impedance-ad5933-correct-error-check.patch [new file with mode: 0644]
queue-3.13/staging-lustre-fix-quotactl-permission-denied-lu-4530.patch [new file with mode: 0644]
queue-3.13/staging-r8188eu-fix-typo-in-usb_device-list.patch [new file with mode: 0644]
queue-3.13/x86-smap-don-t-enable-smap-if-config_x86_smap-is-disabled.patch [new file with mode: 0644]
queue-3.13/x86-smap-smap_violation-is-bogus-if-config_x86_smap-is-off.patch [new file with mode: 0644]

diff --git a/queue-3.13/ftrace-x86-use-breakpoints-for-converting-function-graph-caller.patch b/queue-3.13/ftrace-x86-use-breakpoints-for-converting-function-graph-caller.patch
new file mode 100644 (file)
index 0000000..924e41a
--- /dev/null
@@ -0,0 +1,189 @@
+From 87fbb2ac6073a7039303517546a76074feb14c84 Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+Date: Tue, 11 Feb 2014 20:19:44 -0500
+Subject: ftrace/x86: Use breakpoints for converting function graph caller
+
+From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
+
+commit 87fbb2ac6073a7039303517546a76074feb14c84 upstream.
+
+When the conversion was made to remove stop machine and use the breakpoint
+logic instead, the modification of the function graph caller is still
+done directly as though it was being done under stop machine.
+
+As it is not converted via stop machine anymore, there is a possibility
+that the code could be layed across cache lines and if another CPU is
+accessing that function graph call when it is being updated, it could
+cause a General Protection Fault.
+
+Convert the update of the function graph caller to use the breakpoint
+method as well.
+
+Cc: H. Peter Anvin <hpa@zytor.com>
+Fixes: 08d636b6d4fb "ftrace/x86: Have arch x86_64 use breakpoints instead of stop machine"
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/ftrace.c |   83 ++++++++++++++++++++++++++---------------------
+ 1 file changed, 47 insertions(+), 36 deletions(-)
+
+--- a/arch/x86/kernel/ftrace.c
++++ b/arch/x86/kernel/ftrace.c
+@@ -77,8 +77,7 @@ within(unsigned long addr, unsigned long
+       return addr >= start && addr < end;
+ }
+-static int
+-do_ftrace_mod_code(unsigned long ip, const void *new_code)
++static unsigned long text_ip_addr(unsigned long ip)
+ {
+       /*
+        * On x86_64, kernel text mappings are mapped read-only with
+@@ -91,7 +90,7 @@ do_ftrace_mod_code(unsigned long ip, con
+       if (within(ip, (unsigned long)_text, (unsigned long)_etext))
+               ip = (unsigned long)__va(__pa_symbol(ip));
+-      return probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE);
++      return ip;
+ }
+ static const unsigned char *ftrace_nop_replace(void)
+@@ -123,8 +122,10 @@ ftrace_modify_code_direct(unsigned long
+       if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0)
+               return -EINVAL;
++      ip = text_ip_addr(ip);
++
+       /* replace the text with the new text */
+-      if (do_ftrace_mod_code(ip, new_code))
++      if (probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE))
+               return -EPERM;
+       sync_core();
+@@ -221,37 +222,51 @@ int ftrace_modify_call(struct dyn_ftrace
+       return -EINVAL;
+ }
+-int ftrace_update_ftrace_func(ftrace_func_t func)
++static unsigned long ftrace_update_func;
++
++static int update_ftrace_func(unsigned long ip, void *new)
+ {
+-      unsigned long ip = (unsigned long)(&ftrace_call);
+-      unsigned char old[MCOUNT_INSN_SIZE], *new;
++      unsigned char old[MCOUNT_INSN_SIZE];
+       int ret;
+-      memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
+-      new = ftrace_call_replace(ip, (unsigned long)func);
++      memcpy(old, (void *)ip, MCOUNT_INSN_SIZE);
++
++      ftrace_update_func = ip;
++      /* Make sure the breakpoints see the ftrace_update_func update */
++      smp_wmb();
+       /* See comment above by declaration of modifying_ftrace_code */
+       atomic_inc(&modifying_ftrace_code);
+       ret = ftrace_modify_code(ip, old, new);
++      atomic_dec(&modifying_ftrace_code);
++
++      return ret;
++}
++
++int ftrace_update_ftrace_func(ftrace_func_t func)
++{
++      unsigned long ip = (unsigned long)(&ftrace_call);
++      unsigned char *new;
++      int ret;
++
++      new = ftrace_call_replace(ip, (unsigned long)func);
++      ret = update_ftrace_func(ip, new);
++
+       /* Also update the regs callback function */
+       if (!ret) {
+               ip = (unsigned long)(&ftrace_regs_call);
+-              memcpy(old, &ftrace_regs_call, MCOUNT_INSN_SIZE);
+               new = ftrace_call_replace(ip, (unsigned long)func);
+-              ret = ftrace_modify_code(ip, old, new);
++              ret = update_ftrace_func(ip, new);
+       }
+-      atomic_dec(&modifying_ftrace_code);
+-
+       return ret;
+ }
+ static int is_ftrace_caller(unsigned long ip)
+ {
+-      if (ip == (unsigned long)(&ftrace_call) ||
+-              ip == (unsigned long)(&ftrace_regs_call))
++      if (ip == ftrace_update_func)
+               return 1;
+       return 0;
+@@ -677,45 +692,41 @@ int __init ftrace_dyn_arch_init(void *da
+ #ifdef CONFIG_DYNAMIC_FTRACE
+ extern void ftrace_graph_call(void);
+-static int ftrace_mod_jmp(unsigned long ip,
+-                        int old_offset, int new_offset)
++static unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr)
+ {
+-      unsigned char code[MCOUNT_INSN_SIZE];
++      static union ftrace_code_union calc;
+-      if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE))
+-              return -EFAULT;
++      /* Jmp not a call (ignore the .e8) */
++      calc.e8         = 0xe9;
++      calc.offset     = ftrace_calc_offset(ip + MCOUNT_INSN_SIZE, addr);
+-      if (code[0] != 0xe9 || old_offset != *(int *)(&code[1]))
+-              return -EINVAL;
++      /*
++       * ftrace external locks synchronize the access to the static variable.
++       */
++      return calc.code;
++}
+-      *(int *)(&code[1]) = new_offset;
++static int ftrace_mod_jmp(unsigned long ip, void *func)
++{
++      unsigned char *new;
+-      if (do_ftrace_mod_code(ip, &code))
+-              return -EPERM;
++      new = ftrace_jmp_replace(ip, (unsigned long)func);
+-      return 0;
++      return update_ftrace_func(ip, new);
+ }
+ int ftrace_enable_ftrace_graph_caller(void)
+ {
+       unsigned long ip = (unsigned long)(&ftrace_graph_call);
+-      int old_offset, new_offset;
+-
+-      old_offset = (unsigned long)(&ftrace_stub) - (ip + MCOUNT_INSN_SIZE);
+-      new_offset = (unsigned long)(&ftrace_graph_caller) - (ip + MCOUNT_INSN_SIZE);
+-      return ftrace_mod_jmp(ip, old_offset, new_offset);
++      return ftrace_mod_jmp(ip, &ftrace_graph_caller);
+ }
+ int ftrace_disable_ftrace_graph_caller(void)
+ {
+       unsigned long ip = (unsigned long)(&ftrace_graph_call);
+-      int old_offset, new_offset;
+-
+-      old_offset = (unsigned long)(&ftrace_graph_caller) - (ip + MCOUNT_INSN_SIZE);
+-      new_offset = (unsigned long)(&ftrace_stub) - (ip + MCOUNT_INSN_SIZE);
+-      return ftrace_mod_jmp(ip, old_offset, new_offset);
++      return ftrace_mod_jmp(ip, &ftrace_stub);
+ }
+ #endif /* !CONFIG_DYNAMIC_FTRACE */
diff --git a/queue-3.13/iio-adis16400-set-timestamp-as-the-last-element-in-chan_spec.patch b/queue-3.13/iio-adis16400-set-timestamp-as-the-last-element-in-chan_spec.patch
new file mode 100644 (file)
index 0000000..670de18
--- /dev/null
@@ -0,0 +1,82 @@
+From c76782d151dab7ecfdcdf9a01561c2d61d9b490f Mon Sep 17 00:00:00 2001
+From: Marcus Folkesson <marcus.folkesson@gmail.com>
+Date: Fri, 24 Jan 2014 11:24:00 +0000
+Subject: iio: adis16400: Set timestamp as the last element in chan_spec
+
+From: Marcus Folkesson <marcus.folkesson@gmail.com>
+
+commit c76782d151dab7ecfdcdf9a01561c2d61d9b490f upstream.
+
+This is necessary since timestamp is calculated as the last element
+in iio_compute_scan_bytes().
+
+Without this fix any userspace code reading the layout of the buffer via
+sysfs will incorrectly interpret the data leading some nasty corruption.
+
+Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
+Acked-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/imu/adis16400.h      |    1 +
+ drivers/iio/imu/adis16400_core.c |   10 +++++-----
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+--- a/drivers/iio/imu/adis16400.h
++++ b/drivers/iio/imu/adis16400.h
+@@ -189,6 +189,7 @@ enum {
+       ADIS16300_SCAN_INCLI_X,
+       ADIS16300_SCAN_INCLI_Y,
+       ADIS16400_SCAN_ADC,
++      ADIS16400_SCAN_TIMESTAMP,
+ };
+ #ifdef CONFIG_IIO_BUFFER
+--- a/drivers/iio/imu/adis16400_core.c
++++ b/drivers/iio/imu/adis16400_core.c
+@@ -632,7 +632,7 @@ static const struct iio_chan_spec adis16
+       ADIS16400_MAGN_CHAN(Z, ADIS16400_ZMAGN_OUT, 14),
+       ADIS16400_TEMP_CHAN(ADIS16400_TEMP_OUT, 12),
+       ADIS16400_AUX_ADC_CHAN(ADIS16400_AUX_ADC, 12),
+-      IIO_CHAN_SOFT_TIMESTAMP(12)
++      IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
+ };
+ static const struct iio_chan_spec adis16448_channels[] = {
+@@ -659,7 +659,7 @@ static const struct iio_chan_spec adis16
+               },
+       },
+       ADIS16400_TEMP_CHAN(ADIS16448_TEMP_OUT, 12),
+-      IIO_CHAN_SOFT_TIMESTAMP(11)
++      IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
+ };
+ static const struct iio_chan_spec adis16350_channels[] = {
+@@ -677,7 +677,7 @@ static const struct iio_chan_spec adis16
+       ADIS16400_MOD_TEMP_CHAN(X, ADIS16350_XTEMP_OUT, 12),
+       ADIS16400_MOD_TEMP_CHAN(Y, ADIS16350_YTEMP_OUT, 12),
+       ADIS16400_MOD_TEMP_CHAN(Z, ADIS16350_ZTEMP_OUT, 12),
+-      IIO_CHAN_SOFT_TIMESTAMP(11)
++      IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
+ };
+ static const struct iio_chan_spec adis16300_channels[] = {
+@@ -690,7 +690,7 @@ static const struct iio_chan_spec adis16
+       ADIS16400_AUX_ADC_CHAN(ADIS16300_AUX_ADC, 12),
+       ADIS16400_INCLI_CHAN(X, ADIS16300_PITCH_OUT, 13),
+       ADIS16400_INCLI_CHAN(Y, ADIS16300_ROLL_OUT, 13),
+-      IIO_CHAN_SOFT_TIMESTAMP(14)
++      IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
+ };
+ static const struct iio_chan_spec adis16334_channels[] = {
+@@ -701,7 +701,7 @@ static const struct iio_chan_spec adis16
+       ADIS16400_ACCEL_CHAN(Y, ADIS16400_YACCL_OUT, 14),
+       ADIS16400_ACCEL_CHAN(Z, ADIS16400_ZACCL_OUT, 14),
+       ADIS16400_TEMP_CHAN(ADIS16350_XTEMP_OUT, 12),
+-      IIO_CHAN_SOFT_TIMESTAMP(8)
++      IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
+ };
+ static struct attribute *adis16400_attributes[] = {
diff --git a/queue-3.13/iio-ak8975-fix-calculation-formula-for-convert-micro-tesla-to-gauss-unit.patch b/queue-3.13/iio-ak8975-fix-calculation-formula-for-convert-micro-tesla-to-gauss-unit.patch
new file mode 100644 (file)
index 0000000..8f1ddb3
--- /dev/null
@@ -0,0 +1,68 @@
+From bef44abccb2677e8d16e50b75316d4fd1061be81 Mon Sep 17 00:00:00 2001
+From: Beomho Seo <beomho.seo@samsung.com>
+Date: Wed, 2 Apr 2014 09:15:00 +0100
+Subject: iio: ak8975: Fix calculation formula for convert micro tesla to gauss unit
+
+From: Beomho Seo <beomho.seo@samsung.com>
+
+commit bef44abccb2677e8d16e50b75316d4fd1061be81 upstream.
+
+This effects the reported scale of the raw values, and thus userspace
+applications that use this value.
+
+One micro tesla equal 0.01 gauss. So I have fixed calculation formula And add RAW_TO_GAUSS macro.
+ASA is in the range of 0 to 255. If multiply 0.003, calculation result(in_magn_[*]_scale) is
+always 0. So multiply 3000 and return and IIO_VAL_INT_PLUS_MICRO.
+As a result, read_raw call back function return accurate scale value.
+
+Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/magnetometer/ak8975.c |   16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/drivers/iio/magnetometer/ak8975.c
++++ b/drivers/iio/magnetometer/ak8975.c
+@@ -85,6 +85,7 @@
+ #define AK8975_MAX_CONVERSION_TIMEOUT 500
+ #define AK8975_CONVERSION_DONE_POLL_TIME 10
+ #define AK8975_DATA_READY_TIMEOUT     ((100*HZ)/1000)
++#define RAW_TO_GAUSS(asa) ((((asa) + 128) * 3000) / 256)
+ /*
+  * Per-instance context data for the device.
+@@ -265,15 +266,15 @@ static int ak8975_setup(struct i2c_clien
+  *
+  * Since 1uT = 0.01 gauss, our final scale factor becomes:
+  *
+- * Hadj = H * ((ASA + 128) / 256) * 3/10 * 100
+- * Hadj = H * ((ASA + 128) * 30 / 256
++ * Hadj = H * ((ASA + 128) / 256) * 3/10 * 1/100
++ * Hadj = H * ((ASA + 128) * 0.003) / 256
+  *
+  * Since ASA doesn't change, we cache the resultant scale factor into the
+  * device context in ak8975_setup().
+  */
+-      data->raw_to_gauss[0] = ((data->asa[0] + 128) * 30) >> 8;
+-      data->raw_to_gauss[1] = ((data->asa[1] + 128) * 30) >> 8;
+-      data->raw_to_gauss[2] = ((data->asa[2] + 128) * 30) >> 8;
++      data->raw_to_gauss[0] = RAW_TO_GAUSS(data->asa[0]);
++      data->raw_to_gauss[1] = RAW_TO_GAUSS(data->asa[1]);
++      data->raw_to_gauss[2] = RAW_TO_GAUSS(data->asa[2]);
+       return 0;
+ }
+@@ -428,8 +429,9 @@ static int ak8975_read_raw(struct iio_de
+       case IIO_CHAN_INFO_RAW:
+               return ak8975_read_axis(indio_dev, chan->address, val);
+       case IIO_CHAN_INFO_SCALE:
+-              *val = data->raw_to_gauss[chan->address];
+-              return IIO_VAL_INT;
++              *val = 0;
++              *val2 = data->raw_to_gauss[chan->address];
++              return IIO_VAL_INT_PLUS_MICRO;
+       }
+       return -EINVAL;
+ }
diff --git a/queue-3.13/iio-max1363-use-devm_regulator_get_optional-for-optional-regulator.patch b/queue-3.13/iio-max1363-use-devm_regulator_get_optional-for-optional-regulator.patch
new file mode 100644 (file)
index 0000000..a7cc5d6
--- /dev/null
@@ -0,0 +1,35 @@
+From 55b40d37311807a6bb2acdae0df904f54a0da3ae Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Mon, 27 Jan 2014 18:10:00 +0000
+Subject: iio: max1363: Use devm_regulator_get_optional for optional regulator
+
+From: Guenter Roeck <linux@roeck-us.net>
+
+commit 55b40d37311807a6bb2acdae0df904f54a0da3ae upstream.
+
+In kernel version 3.13, devm_regulator_get() may return no error
+if a regulator is undeclared. regulator_get_voltage() will return
+-EINVAL if this happens. This causes the driver to fail loading if
+the vref regulator is not declared.
+
+Since vref is optional, call devm_regulator_get_optional instead.
+
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/adc/max1363.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/adc/max1363.c
++++ b/drivers/iio/adc/max1363.c
+@@ -1560,7 +1560,7 @@ static int max1363_probe(struct i2c_clie
+       st->client = client;
+       st->vref_uv = st->chip_info->int_vref_mv * 1000;
+-      vref = devm_regulator_get(&client->dev, "vref");
++      vref = devm_regulator_get_optional(&client->dev, "vref");
+       if (!IS_ERR(vref)) {
+               int vref_uv;
index 8045031b1733fe644bc17723027a815ab740ae98..52a6344083dd4cd3b51dd3996990d017371cefd1 100644 (file)
@@ -45,3 +45,15 @@ vt-fix-secure-clear-screen.patch
 serial-omap-serial-move-info-message-to-probe-function.patch
 usb-qcserial-add-netgear-aircard-340u.patch
 arm-pxa-fix-compilation-problem-on-am300epd-board.patch
+staging-lustre-fix-quotactl-permission-denied-lu-4530.patch
+staging-r8188eu-fix-typo-in-usb_device-list.patch
+staging-comedi-adv_pci1710-fix-analog-output-readback-value.patch
+staging-iio-impedance-ad5933-correct-error-check.patch
+staging-iio-ad799x-fix-error_free_irq-which-was-freeing-an-irq-that-may-not-have-been-requested.patch
+staging-iio-ad799x-fix-typo-in-ad799x_events.patch
+iio-max1363-use-devm_regulator_get_optional-for-optional-regulator.patch
+iio-adis16400-set-timestamp-as-the-last-element-in-chan_spec.patch
+iio-ak8975-fix-calculation-formula-for-convert-micro-tesla-to-gauss-unit.patch
+x86-smap-don-t-enable-smap-if-config_x86_smap-is-disabled.patch
+x86-smap-smap_violation-is-bogus-if-config_x86_smap-is-off.patch
+ftrace-x86-use-breakpoints-for-converting-function-graph-caller.patch
diff --git a/queue-3.13/staging-comedi-adv_pci1710-fix-analog-output-readback-value.patch b/queue-3.13/staging-comedi-adv_pci1710-fix-analog-output-readback-value.patch
new file mode 100644 (file)
index 0000000..abed863
--- /dev/null
@@ -0,0 +1,85 @@
+From 1e85c1ea1ff2a60659e790ef8ec76c7339445841 Mon Sep 17 00:00:00 2001
+From: H Hartley Sweeten <hsweeten@visionengravers.com>
+Date: Wed, 5 Feb 2014 14:59:53 -0700
+Subject: staging: comedi: adv_pci1710: fix analog output readback value
+
+From: H Hartley Sweeten <hsweeten@visionengravers.com>
+
+commit 1e85c1ea1ff2a60659e790ef8ec76c7339445841 upstream.
+
+The last value written to a analog output channel is cached in the
+private data of this driver for readback.
+
+Currently, the wrong value is cached in the (*insn_write) functions.
+The current code stores the data[n] value for readback afer the loop
+has written all the values. At this time 'n' points past the end of
+the data array.
+
+Fix the functions by using a local variable to hold the data being
+written to the analog output channel. This variable is then used
+after the loop is complete to store the readback value. The current
+value is retrieved before the loop in case no values are actually
+written..
+
+Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
+Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/drivers/adv_pci1710.c |   17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+--- a/drivers/staging/comedi/drivers/adv_pci1710.c
++++ b/drivers/staging/comedi/drivers/adv_pci1710.c
+@@ -489,6 +489,7 @@ static int pci171x_insn_write_ao(struct
+                                struct comedi_insn *insn, unsigned int *data)
+ {
+       struct pci1710_private *devpriv = dev->private;
++      unsigned int val;
+       int n, chan, range, ofs;
+       chan = CR_CHAN(insn->chanspec);
+@@ -504,11 +505,14 @@ static int pci171x_insn_write_ao(struct
+               outw(devpriv->da_ranges, dev->iobase + PCI171x_DAREF);
+               ofs = PCI171x_DA1;
+       }
++      val = devpriv->ao_data[chan];
+-      for (n = 0; n < insn->n; n++)
+-              outw(data[n], dev->iobase + ofs);
++      for (n = 0; n < insn->n; n++) {
++              val = data[n];
++              outw(val, dev->iobase + ofs);
++      }
+-      devpriv->ao_data[chan] = data[n];
++      devpriv->ao_data[chan] = val;
+       return n;
+@@ -674,6 +678,7 @@ static int pci1720_insn_write_ao(struct
+                                struct comedi_insn *insn, unsigned int *data)
+ {
+       struct pci1710_private *devpriv = dev->private;
++      unsigned int val;
+       int n, rangereg, chan;
+       chan = CR_CHAN(insn->chanspec);
+@@ -683,13 +688,15 @@ static int pci1720_insn_write_ao(struct
+               outb(rangereg, dev->iobase + PCI1720_RANGE);
+               devpriv->da_ranges = rangereg;
+       }
++      val = devpriv->ao_data[chan];
+       for (n = 0; n < insn->n; n++) {
+-              outw(data[n], dev->iobase + PCI1720_DA0 + (chan << 1));
++              val = data[n];
++              outw(val, dev->iobase + PCI1720_DA0 + (chan << 1));
+               outb(0, dev->iobase + PCI1720_SYNCOUT); /*  update outputs */
+       }
+-      devpriv->ao_data[chan] = data[n];
++      devpriv->ao_data[chan] = val;
+       return n;
+ }
diff --git a/queue-3.13/staging-iio-ad799x-fix-error_free_irq-which-was-freeing-an-irq-that-may-not-have-been-requested.patch b/queue-3.13/staging-iio-ad799x-fix-error_free_irq-which-was-freeing-an-irq-that-may-not-have-been-requested.patch
new file mode 100644 (file)
index 0000000..0fb7a39
--- /dev/null
@@ -0,0 +1,32 @@
+From 38408d056188be29a6c4e17f3703c796551bb330 Mon Sep 17 00:00:00 2001
+From: Hartmut Knaack <knaack.h@gmx.de>
+Date: Wed, 1 Jan 2014 23:04:00 +0000
+Subject: staging:iio:ad799x fix error_free_irq which was freeing an irq that may not have been requested
+
+From: Hartmut Knaack <knaack.h@gmx.de>
+
+commit 38408d056188be29a6c4e17f3703c796551bb330 upstream.
+
+Only free an IRQ in error_free_irq, if it has been requested previously.
+
+Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
+Acked-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/iio/adc/ad799x_core.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/iio/adc/ad799x_core.c
++++ b/drivers/staging/iio/adc/ad799x_core.c
+@@ -588,7 +588,8 @@ static int ad799x_probe(struct i2c_clien
+       return 0;
+ error_free_irq:
+-      free_irq(client->irq, indio_dev);
++      if (client->irq > 0)
++              free_irq(client->irq, indio_dev);
+ error_cleanup_ring:
+       ad799x_ring_cleanup(indio_dev);
+ error_disable_reg:
diff --git a/queue-3.13/staging-iio-ad799x-fix-typo-in-ad799x_events.patch b/queue-3.13/staging-iio-ad799x-fix-typo-in-ad799x_events.patch
new file mode 100644 (file)
index 0000000..46a6753
--- /dev/null
@@ -0,0 +1,30 @@
+From d180371d412627a10dc31d675ef8bc777567df09 Mon Sep 17 00:00:00 2001
+From: Hartmut Knaack <knaack.h@gmx.de>
+Date: Sat, 2 Aug 2014 00:07:00 +0100
+Subject: staging:iio:ad799x fix typo in ad799x_events[]
+
+From: Hartmut Knaack <knaack.h@gmx.de>
+
+commit d180371d412627a10dc31d675ef8bc777567df09 upstream.
+
+This patch fixes a typo in ad799x_events[], which caused the error "Failed to register event set".
+
+Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/iio/adc/ad799x_core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/iio/adc/ad799x_core.c
++++ b/drivers/staging/iio/adc/ad799x_core.c
+@@ -393,7 +393,7 @@ static const struct iio_event_spec ad799
+       }, {
+               .type = IIO_EV_TYPE_THRESH,
+               .dir = IIO_EV_DIR_FALLING,
+-              .mask_separate = BIT(IIO_EV_INFO_VALUE),
++              .mask_separate = BIT(IIO_EV_INFO_VALUE) |
+                       BIT(IIO_EV_INFO_ENABLE),
+       }, {
+               .type = IIO_EV_TYPE_THRESH,
diff --git a/queue-3.13/staging-iio-impedance-ad5933-correct-error-check.patch b/queue-3.13/staging-iio-impedance-ad5933-correct-error-check.patch
new file mode 100644 (file)
index 0000000..27a726f
--- /dev/null
@@ -0,0 +1,45 @@
+From e9ed104de68c345c9a827225e93c74c6894613a9 Mon Sep 17 00:00:00 2001
+From: Julia Lawall <Julia.Lawall@lip6.fr>
+Date: Wed, 1 Jan 2014 13:07:00 +0000
+Subject: staging:iio:impedance:ad5933: correct error check
+
+From: Julia Lawall <Julia.Lawall@lip6.fr>
+
+commit e9ed104de68c345c9a827225e93c74c6894613a9 upstream.
+
+iio_kfifo_allocate returns NULL in case of error.
+
+The semantic match that finds this problem is as follows:
+(http://coccinelle.lip6.fr/)
+
+// <smpl>
+@@
+expression *x;
+identifier f;
+statement S1,S2;
+@@
+
+*x = f(...);
+ if (x) { <+... when != if (...) S1 else S2
+     -ENOMEM ...+> }
+// </smpl>
+
+Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/iio/impedance-analyzer/ad5933.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
++++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
+@@ -629,7 +629,7 @@ static int ad5933_register_ring_funcs_an
+       struct iio_buffer *buffer;
+       buffer = iio_kfifo_allocate(indio_dev);
+-      if (buffer)
++      if (!buffer)
+               return -ENOMEM;
+       iio_device_attach_buffer(indio_dev, buffer);
diff --git a/queue-3.13/staging-lustre-fix-quotactl-permission-denied-lu-4530.patch b/queue-3.13/staging-lustre-fix-quotactl-permission-denied-lu-4530.patch
new file mode 100644 (file)
index 0000000..9759037
--- /dev/null
@@ -0,0 +1,40 @@
+From 8b9e418c013e8b671fc10108ab14243f0657bffd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?C=C3=A9dric=20Dufour=20-=20Idiap=20Research=20Institute?=
+ <cedric.dufour@idiap.ch>
+Date: Fri, 24 Jan 2014 20:57:05 +0100
+Subject: staging: lustre: fix quotactl permission denied (LU-4530)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?C=C3=A9dric=20Dufour=20-=20Idiap=20Research=20Institute?=
+
+commit 8b9e418c013e8b671fc10108ab14243f0657bffd upstream.
+
+The changes introduced in commit 4b1a25f06b30b203 ("fix build when
+CONFIG_UIDGID_STRICT_TYPE_CHECKS is on") got the UID check the wrong way
+around, leading to "Permission denied" when a regular user attempts to
+retrieve his quota (lfs quota -u ...) but allowing him to retrieve other
+users quota.
+
+Full details at: https://jira.hpdd.intel.com/browse/LU-4530
+
+Cc: Peng Tao <tao.peng@emc.com>
+Signed-off-by: Cédric Dufour <cedric.dufour@idiap.ch>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/lustre/lustre/llite/dir.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/lustre/lustre/llite/dir.c
++++ b/drivers/staging/lustre/lustre/llite/dir.c
+@@ -1086,7 +1086,7 @@ static int quotactl_ioctl(struct ll_sb_i
+               break;
+       case Q_GETQUOTA:
+               if (((type == USRQUOTA &&
+-                    uid_eq(current_euid(), make_kuid(&init_user_ns, id))) ||
++                    !uid_eq(current_euid(), make_kuid(&init_user_ns, id))) ||
+                    (type == GRPQUOTA &&
+                     !in_egroup_p(make_kgid(&init_user_ns, id)))) &&
+                   (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
diff --git a/queue-3.13/staging-r8188eu-fix-typo-in-usb_device-list.patch b/queue-3.13/staging-r8188eu-fix-typo-in-usb_device-list.patch
new file mode 100644 (file)
index 0000000..9a73ce2
--- /dev/null
@@ -0,0 +1,32 @@
+From 08951f10ae146d0c4114ac508310ad316b6f8798 Mon Sep 17 00:00:00 2001
+From: Larry Finger <Larry.Finger@lwfinger.net>
+Date: Sun, 2 Feb 2014 22:23:06 -0600
+Subject: staging: r8188eu: Fix typo in USB_DEVICE list
+
+From: Larry Finger <Larry.Finger@lwfinger.net>
+
+commit 08951f10ae146d0c4114ac508310ad316b6f8798 upstream.
+
+There is a typo in the device list that interchanges the vendor and
+product codes for one of the entries. This exchange was determined
+by noticing that the vendor code is 0x07b8 for Abocom at
+http://www.linux-usb.org/usb.ids.
+
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/rtl8188eu/os_dep/usb_intf.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
++++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+@@ -53,7 +53,7 @@ static struct usb_device_id rtw_usb_id_t
+       {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0179)}, /* 8188ETV */
+       /*=== Customer ID ===*/
+       /****** 8188EUS ********/
+-      {USB_DEVICE(0x8179, 0x07B8)}, /* Abocom - Abocom */
++      {USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */
+       {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
+       {}      /* Terminating entry */
+ };
diff --git a/queue-3.13/x86-smap-don-t-enable-smap-if-config_x86_smap-is-disabled.patch b/queue-3.13/x86-smap-don-t-enable-smap-if-config_x86_smap-is-disabled.patch
new file mode 100644 (file)
index 0000000..986fb15
--- /dev/null
@@ -0,0 +1,41 @@
+From 03bbd596ac04fef47ce93a730b8f086d797c3021 Mon Sep 17 00:00:00 2001
+From: "H. Peter Anvin" <hpa@linux.intel.com>
+Date: Thu, 13 Feb 2014 07:34:30 -0800
+Subject: x86, smap: Don't enable SMAP if CONFIG_X86_SMAP is disabled
+
+From: "H. Peter Anvin" <hpa@linux.intel.com>
+
+commit 03bbd596ac04fef47ce93a730b8f086d797c3021 upstream.
+
+If SMAP support is not compiled into the kernel, don't enable SMAP in
+CR4 -- in fact, we should clear it, because the kernel doesn't contain
+the proper STAC/CLAC instructions for SMAP support.
+
+Found by Fengguang Wu's test system.
+
+Reported-by: Fengguang Wu <fengguang.wu@intel.com>
+Link: http://lkml.kernel.org/r/20140213124550.GA30497@localhost
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/cpu/common.c |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/cpu/common.c
++++ b/arch/x86/kernel/cpu/common.c
+@@ -284,8 +284,13 @@ static __always_inline void setup_smap(s
+       raw_local_save_flags(eflags);
+       BUG_ON(eflags & X86_EFLAGS_AC);
+-      if (cpu_has(c, X86_FEATURE_SMAP))
++      if (cpu_has(c, X86_FEATURE_SMAP)) {
++#ifdef CONFIG_X86_SMAP
+               set_in_cr4(X86_CR4_SMAP);
++#else
++              clear_in_cr4(X86_CR4_SMAP);
++#endif
++      }
+ }
+ /*
diff --git a/queue-3.13/x86-smap-smap_violation-is-bogus-if-config_x86_smap-is-off.patch b/queue-3.13/x86-smap-smap_violation-is-bogus-if-config_x86_smap-is-off.patch
new file mode 100644 (file)
index 0000000..b1e16d1
--- /dev/null
@@ -0,0 +1,61 @@
+From 4640c7ee9b8953237d05a61ea3ea93981d1bc961 Mon Sep 17 00:00:00 2001
+From: "H. Peter Anvin" <hpa@linux.intel.com>
+Date: Thu, 13 Feb 2014 07:46:04 -0800
+Subject: x86, smap: smap_violation() is bogus if CONFIG_X86_SMAP is off
+
+From: "H. Peter Anvin" <hpa@linux.intel.com>
+
+commit 4640c7ee9b8953237d05a61ea3ea93981d1bc961 upstream.
+
+If CONFIG_X86_SMAP is disabled, smap_violation() tests for conditions
+which are incorrect (as the AC flag doesn't matter), causing spurious
+faults.
+
+The dynamic disabling of SMAP (nosmap on the command line) is fine
+because it disables X86_FEATURE_SMAP, therefore causing the
+static_cpu_has() to return false.
+
+Found by Fengguang Wu's test system.
+
+[ v3: move all predicates into smap_violation() ]
+[ v2: use IS_ENABLED() instead of #ifdef ]
+
+Reported-by: Fengguang Wu <fengguang.wu@intel.com>
+Link: http://lkml.kernel.org/r/20140213124550.GA30497@localhost
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/mm/fault.c |   14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+--- a/arch/x86/mm/fault.c
++++ b/arch/x86/mm/fault.c
+@@ -1001,6 +1001,12 @@ static int fault_in_kernel_space(unsigne
+ static inline bool smap_violation(int error_code, struct pt_regs *regs)
+ {
++      if (!IS_ENABLED(CONFIG_X86_SMAP))
++              return false;
++
++      if (!static_cpu_has(X86_FEATURE_SMAP))
++              return false;
++
+       if (error_code & PF_USER)
+               return false;
+@@ -1087,11 +1093,9 @@ __do_page_fault(struct pt_regs *regs, un
+       if (unlikely(error_code & PF_RSVD))
+               pgtable_bad(regs, error_code, address);
+-      if (static_cpu_has(X86_FEATURE_SMAP)) {
+-              if (unlikely(smap_violation(error_code, regs))) {
+-                      bad_area_nosemaphore(regs, error_code, address);
+-                      return;
+-              }
++      if (unlikely(smap_violation(error_code, regs))) {
++              bad_area_nosemaphore(regs, error_code, address);
++              return;
+       }
+       /*