]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.8-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Feb 2013 18:55:15 +0000 (10:55 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Feb 2013 18:55:15 +0000 (10:55 -0800)
added patches:
asoc-arizona-fixed-a-bug-in-fll-fractional-calculation.patch
asoc-wm2200-correct-in2l-and-in3l-digital-mute.patch
staging-comedi-disallow-comedi_devconfig-on-non-board-minors.patch
staging-comedi-ni_labpc-correct-differential-channel-sequence-for-ai-commands.patch
staging-comedi-ni_labpc-set-up-command4-register-after-command3.patch
staging-vt6656-fix-urb-submitted-while-active-warning.patch
staging-vt6656-revert-64-bit-correctly-address-void-structure.patch
staging-vt6656-revert-64bit-fixes-dpc.c-incorrect-addressing-of-void-structure.patch
staging-zsmalloc-fix-tlb-coherency-and-build-problem.patch

queue-3.8/asoc-arizona-fixed-a-bug-in-fll-fractional-calculation.patch [new file with mode: 0644]
queue-3.8/asoc-wm2200-correct-in2l-and-in3l-digital-mute.patch [new file with mode: 0644]
queue-3.8/series
queue-3.8/staging-comedi-disallow-comedi_devconfig-on-non-board-minors.patch [new file with mode: 0644]
queue-3.8/staging-comedi-ni_labpc-correct-differential-channel-sequence-for-ai-commands.patch [new file with mode: 0644]
queue-3.8/staging-comedi-ni_labpc-set-up-command4-register-after-command3.patch [new file with mode: 0644]
queue-3.8/staging-vt6656-fix-urb-submitted-while-active-warning.patch [new file with mode: 0644]
queue-3.8/staging-vt6656-revert-64-bit-correctly-address-void-structure.patch [new file with mode: 0644]
queue-3.8/staging-vt6656-revert-64bit-fixes-dpc.c-incorrect-addressing-of-void-structure.patch [new file with mode: 0644]
queue-3.8/staging-zsmalloc-fix-tlb-coherency-and-build-problem.patch [new file with mode: 0644]

diff --git a/queue-3.8/asoc-arizona-fixed-a-bug-in-fll-fractional-calculation.patch b/queue-3.8/asoc-arizona-fixed-a-bug-in-fll-fractional-calculation.patch
new file mode 100644 (file)
index 0000000..0a0fd53
--- /dev/null
@@ -0,0 +1,52 @@
+From 01f58153aefc158fd690b337d29ad140e963959d Mon Sep 17 00:00:00 2001
+From: Ryo Tsutsui <ryo.tsutsui@wolfsonmicro.com>
+Date: Sun, 3 Feb 2013 17:18:00 +0900
+Subject: ASoC: arizona: Fixed a bug in FLL fractional calculation
+
+From: Ryo Tsutsui <ryo.tsutsui@wolfsonmicro.com>
+
+commit 01f58153aefc158fd690b337d29ad140e963959d upstream.
+
+Previously arizona_calc_fll() was checking if the target frequency is
+exactly divisible by reference frequency, but should have been product
+of the ratio and the reference frequency.
+
+Also scale down the Lamba and Theta coefficients be under 16-bits in
+order to match the registers.
+
+Signed-off-by: Ryo Tsutsui <ryo.tsutsui@wolfsonmicro.com>
+Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/arizona.c |   11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/arizona.c
++++ b/sound/soc/codecs/arizona.c
+@@ -910,7 +910,7 @@ static int arizona_calc_fll(struct arizo
+       cfg->n = target / (ratio * Fref);
+-      if (target % Fref) {
++      if (target % (ratio * Fref)) {
+               gcd_fll = gcd(target, ratio * Fref);
+               arizona_fll_dbg(fll, "GCD=%u\n", gcd_fll);
+@@ -922,6 +922,15 @@ static int arizona_calc_fll(struct arizo
+               cfg->lambda = 0;
+       }
++      /* Round down to 16bit range with cost of accuracy lost.
++       * Denominator must be bigger than numerator so we only
++       * take care of it.
++       */
++      while (cfg->lambda >= (1 << 16)) {
++              cfg->theta >>= 1;
++              cfg->lambda >>= 1;
++      }
++
+       arizona_fll_dbg(fll, "N=%x THETA=%x LAMBDA=%x\n",
+                       cfg->n, cfg->theta, cfg->lambda);
+       arizona_fll_dbg(fll, "FRATIO=%x(%d) OUTDIV=%x REFCLK_DIV=%x\n",
diff --git a/queue-3.8/asoc-wm2200-correct-in2l-and-in3l-digital-mute.patch b/queue-3.8/asoc-wm2200-correct-in2l-and-in3l-digital-mute.patch
new file mode 100644 (file)
index 0000000..72de9d4
--- /dev/null
@@ -0,0 +1,31 @@
+From 0d2b6422529a26ac4dee06196524ba9da70cf735 Mon Sep 17 00:00:00 2001
+From: Chris Rattray <crattray@opensource.wolfsonmicro.com>
+Date: Fri, 1 Feb 2013 15:51:41 +0000
+Subject: ASoC: wm2200: correct IN2L and IN3L digital mute
+
+From: Chris Rattray <crattray@opensource.wolfsonmicro.com>
+
+commit 0d2b6422529a26ac4dee06196524ba9da70cf735 upstream.
+
+Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm2200.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/soc/codecs/wm2200.c
++++ b/sound/soc/codecs/wm2200.c
+@@ -1126,9 +1126,9 @@ SOC_DOUBLE_R_TLV("IN3 Volume", WM2200_IN
+ SOC_DOUBLE_R("IN1 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_1L,
+            WM2200_ADC_DIGITAL_VOLUME_1R, WM2200_IN1L_MUTE_SHIFT, 1, 1),
+-SOC_DOUBLE_R("IN2 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_1L,
++SOC_DOUBLE_R("IN2 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_2L,
+            WM2200_ADC_DIGITAL_VOLUME_2R, WM2200_IN2L_MUTE_SHIFT, 1, 1),
+-SOC_DOUBLE_R("IN3 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_1L,
++SOC_DOUBLE_R("IN3 Digital Switch", WM2200_ADC_DIGITAL_VOLUME_3L,
+            WM2200_ADC_DIGITAL_VOLUME_3R, WM2200_IN3L_MUTE_SHIFT, 1, 1),
+ SOC_DOUBLE_R_TLV("IN1 Digital Volume", WM2200_ADC_DIGITAL_VOLUME_1L,
index 52645be76d54d8a1bec32022ad20af3a47599415..1eb2f4de99a2618f72a14a98fa688e7e80c9a763 100644 (file)
@@ -89,3 +89,12 @@ drm-i915-add-missing-n-to-uts_release-in-the-error_state.patch
 drm-i915-use-has_l3_gpu_cache-in-i915_gem_l3_remap.patch
 drm-i915-inverted-brightness-quirk-for-acer-aspire-4736z.patch
 drm-i915-handle-untiled-planes-when-computing-their-offsets.patch
+staging-zsmalloc-fix-tlb-coherency-and-build-problem.patch
+staging-comedi-disallow-comedi_devconfig-on-non-board-minors.patch
+staging-comedi-ni_labpc-set-up-command4-register-after-command3.patch
+staging-comedi-ni_labpc-correct-differential-channel-sequence-for-ai-commands.patch
+staging-vt6656-revert-64-bit-correctly-address-void-structure.patch
+staging-vt6656-revert-64bit-fixes-dpc.c-incorrect-addressing-of-void-structure.patch
+staging-vt6656-fix-urb-submitted-while-active-warning.patch
+asoc-wm2200-correct-in2l-and-in3l-digital-mute.patch
+asoc-arizona-fixed-a-bug-in-fll-fractional-calculation.patch
diff --git a/queue-3.8/staging-comedi-disallow-comedi_devconfig-on-non-board-minors.patch b/queue-3.8/staging-comedi-disallow-comedi_devconfig-on-non-board-minors.patch
new file mode 100644 (file)
index 0000000..c2df638
--- /dev/null
@@ -0,0 +1,51 @@
+From 754ab5c0e55dd118273ca2c217c4d95e9fbc8259 Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Mon, 28 Jan 2013 16:14:31 +0000
+Subject: staging: comedi: disallow COMEDI_DEVCONFIG on non-board minors
+
+From: Ian Abbott <abbotti@mev.co.uk>
+
+commit 754ab5c0e55dd118273ca2c217c4d95e9fbc8259 upstream.
+
+Comedi has two sorts of minor devices:
+(a) normal board minor devices in the range 0 to
+COMEDI_NUM_BOARD_MINORS-1 inclusive; and
+(b) special subdevice minor devices in the range COMEDI_NUM_BOARD_MINORS
+upwards that are used to open the same underlying comedi device as the
+normal board minor devices, but with non-default read and write
+subdevices for asynchronous commands.
+
+The special subdevice minor devices get created when a board supporting
+asynchronous commands is attached to a normal board minor device, and
+destroyed when the board is detached from the normal board minor device.
+One way to attach or detach a board is by using the COMEDI_DEVCONFIG
+ioctl.  This should only be used on normal board minors as the special
+subdevice minors are too ephemeral.  In particular, the change
+introduced in commit 7d3135af399e92cf4c9bbc5f86b6c140aab3b88c ("staging:
+comedi: prevent auto-unconfig of manually configured devices") breaks
+horribly for special subdevice minor devices.
+
+Since there's no legitimate use for the COMEDI_DEVCONFIG ioctl on a
+special subdevice minor device node, disallow it and return -ENOTTY.
+
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/comedi_fops.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/staging/comedi/comedi_fops.c
++++ b/drivers/staging/comedi/comedi_fops.c
+@@ -1547,6 +1547,11 @@ static long comedi_unlocked_ioctl(struct
+       /* Device config is special, because it must work on
+        * an unconfigured device. */
+       if (cmd == COMEDI_DEVCONFIG) {
++              if (minor >= COMEDI_NUM_BOARD_MINORS) {
++                      /* Device config not appropriate on non-board minors. */
++                      rc = -ENOTTY;
++                      goto done;
++              }
+               rc = do_devconfig_ioctl(dev,
+                                       (struct comedi_devconfig __user *)arg);
+               if (rc == 0)
diff --git a/queue-3.8/staging-comedi-ni_labpc-correct-differential-channel-sequence-for-ai-commands.patch b/queue-3.8/staging-comedi-ni_labpc-correct-differential-channel-sequence-for-ai-commands.patch
new file mode 100644 (file)
index 0000000..aba45c9
--- /dev/null
@@ -0,0 +1,50 @@
+From 4c4bc25d0fa6beaf054c0b4c3b324487f266c820 Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Fri, 1 Feb 2013 14:51:58 +0000
+Subject: staging: comedi: ni_labpc: correct differential channel sequence for AI commands
+
+From: Ian Abbott <abbotti@mev.co.uk>
+
+commit 4c4bc25d0fa6beaf054c0b4c3b324487f266c820 upstream.
+
+Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
+meaningful output from a Lab-PC+ in differential mode for AI cmds, but
+AI insn reads gave correct readings.  He tracked it down to two
+problems, one of which is addressed by this patch.
+
+It seems the setting of the channel bits for particular scanning modes
+was incorrect for differential mode.  (Only half the number of channels
+are available in differential mode; comedi refers to them as channels 0,
+1, 2 and 3, but the hardware documentation refers to them as channels 0,
+2, 4 and 6.)  In differential mode, the setting of the channel enable
+bits in the command1 register should depend on whether the scan enable
+bit is set.  Effectively, we need to double the comedi channel number
+when the scan enable bit is not set in differential mode.  The scan
+enable bit gets set when the AI scan mode is `MODE_MULT_CHAN_UP` or
+`MODE_MULT_CHAN_DOWN`, and gets cleared when the AI scan mode is
+`MODE_SINGLE_CHAN` or `MODE_SINGLE_CHAN_INTERVAL`.  The existing test
+for whether the comedi channel number needs to be doubled in
+differential mode is incorrect in `labpc_ai_cmd()`.  This patch corrects
+the test.
+
+Thanks to Tuomas for suggesting the fix.
+
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/drivers/ni_labpc.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/comedi/drivers/ni_labpc.c
++++ b/drivers/staging/comedi/drivers/ni_labpc.c
+@@ -1202,7 +1202,8 @@ static int labpc_ai_cmd(struct comedi_de
+       else
+               channel = CR_CHAN(cmd->chanlist[0]);
+       /* munge channel bits for differential / scan disabled mode */
+-      if (mode != MODE_SINGLE_CHAN && aref == AREF_DIFF)
++      if ((mode == MODE_SINGLE_CHAN || mode == MODE_SINGLE_CHAN_INTERVAL) &&
++          aref == AREF_DIFF)
+               channel *= 2;
+       devpriv->command1_bits |= ADC_CHAN_BITS(channel);
+       devpriv->command1_bits |= thisboard->ai_range_code[range];
diff --git a/queue-3.8/staging-comedi-ni_labpc-set-up-command4-register-after-command3.patch b/queue-3.8/staging-comedi-ni_labpc-set-up-command4-register-after-command3.patch
new file mode 100644 (file)
index 0000000..4b274d5
--- /dev/null
@@ -0,0 +1,76 @@
+From 22056e2b46246d97ff0f7c6e21a77b8daa07f02c Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Fri, 1 Feb 2013 14:51:57 +0000
+Subject: staging: comedi: ni_labpc: set up command4 register *after* command3
+
+From: Ian Abbott <abbotti@mev.co.uk>
+
+commit 22056e2b46246d97ff0f7c6e21a77b8daa07f02c upstream.
+
+Tuomas <tvainikk _at_ gmail _dot_ com> reported problems getting
+meaningful output from a Lab-PC+ in differential mode for AI cmds, but
+AI insn reads gave correct readings.  He tracked it down to two
+problems, one of which is addressed by this patch.
+
+It seems that writing to the command3 register after writing to the
+command4 register in `labpc_ai_cmd()` messes up the differential
+reference bit setting in the command4 register.  Set up the command4
+register after the command3 register (as in `labpc_ai_rinsn()`) to avoid
+the problem.
+
+Thanks to Tuomas for suggesting the fix.
+
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/drivers/ni_labpc.c |   31 +++++++++++++++---------------
+ 1 file changed, 16 insertions(+), 15 deletions(-)
+
+--- a/drivers/staging/comedi/drivers/ni_labpc.c
++++ b/drivers/staging/comedi/drivers/ni_labpc.c
+@@ -1217,21 +1217,6 @@ static int labpc_ai_cmd(struct comedi_de
+               devpriv->write_byte(devpriv->command1_bits,
+                                   dev->iobase + COMMAND1_REG);
+       }
+-      /*  setup any external triggering/pacing (command4 register) */
+-      devpriv->command4_bits = 0;
+-      if (cmd->convert_src != TRIG_EXT)
+-              devpriv->command4_bits |= EXT_CONVERT_DISABLE_BIT;
+-      /* XXX should discard first scan when using interval scanning
+-       * since manual says it is not synced with scan clock */
+-      if (labpc_use_continuous_mode(cmd, mode) == 0) {
+-              devpriv->command4_bits |= INTERVAL_SCAN_EN_BIT;
+-              if (cmd->scan_begin_src == TRIG_EXT)
+-                      devpriv->command4_bits |= EXT_SCAN_EN_BIT;
+-      }
+-      /*  single-ended/differential */
+-      if (aref == AREF_DIFF)
+-              devpriv->command4_bits |= ADC_DIFF_BIT;
+-      devpriv->write_byte(devpriv->command4_bits, dev->iobase + COMMAND4_REG);
+       devpriv->write_byte(cmd->chanlist_len,
+                           dev->iobase + INTERVAL_COUNT_REG);
+@@ -1311,6 +1296,22 @@ static int labpc_ai_cmd(struct comedi_de
+               devpriv->command3_bits &= ~ADC_FNE_INTR_EN_BIT;
+       devpriv->write_byte(devpriv->command3_bits, dev->iobase + COMMAND3_REG);
++      /*  setup any external triggering/pacing (command4 register) */
++      devpriv->command4_bits = 0;
++      if (cmd->convert_src != TRIG_EXT)
++              devpriv->command4_bits |= EXT_CONVERT_DISABLE_BIT;
++      /* XXX should discard first scan when using interval scanning
++       * since manual says it is not synced with scan clock */
++      if (labpc_use_continuous_mode(cmd, mode) == 0) {
++              devpriv->command4_bits |= INTERVAL_SCAN_EN_BIT;
++              if (cmd->scan_begin_src == TRIG_EXT)
++                      devpriv->command4_bits |= EXT_SCAN_EN_BIT;
++      }
++      /*  single-ended/differential */
++      if (aref == AREF_DIFF)
++              devpriv->command4_bits |= ADC_DIFF_BIT;
++      devpriv->write_byte(devpriv->command4_bits, dev->iobase + COMMAND4_REG);
++
+       /*  startup acquisition */
+       /*  command2 reg */
diff --git a/queue-3.8/staging-vt6656-fix-urb-submitted-while-active-warning.patch b/queue-3.8/staging-vt6656-fix-urb-submitted-while-active-warning.patch
new file mode 100644 (file)
index 0000000..e33201f
--- /dev/null
@@ -0,0 +1,85 @@
+From ae5943de8c8c4438cbac5cda599ff0b88c224468 Mon Sep 17 00:00:00 2001
+From: Malcolm Priestley <tvboxspy@gmail.com>
+Date: Wed, 30 Jan 2013 20:07:29 +0000
+Subject: staging: vt6656: Fix URB submitted while active warning.
+
+From: Malcolm Priestley <tvboxspy@gmail.com>
+
+commit ae5943de8c8c4438cbac5cda599ff0b88c224468 upstream.
+
+This error happens because PIPEnsControlOut and PIPEnsControlIn unlock the
+spin lock for delay, letting in another thread.
+
+The patch moves the current MP_SET_FLAG to before filling
+of sUsbCtlRequest for pControlURB and clears it in event of failing.
+
+Any thread calling either function while fMP_CONTROL_READS or fMP_CONTROL_WRITES
+flags set will return STATUS_FAILURE.
+
+Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/vt6656/usbpipe.c |   28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+--- a/drivers/staging/vt6656/usbpipe.c
++++ b/drivers/staging/vt6656/usbpipe.c
+@@ -165,6 +165,11 @@ int PIPEnsControlOut(
+     if (pDevice->Flags & fMP_CONTROL_WRITES)
+         return STATUS_FAILURE;
++      if (pDevice->Flags & fMP_CONTROL_READS)
++              return STATUS_FAILURE;
++
++      MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
++
+       pDevice->sUsbCtlRequest.bRequestType = 0x40;
+       pDevice->sUsbCtlRequest.bRequest = byRequest;
+       pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue);
+@@ -179,12 +184,13 @@ int PIPEnsControlOut(
+       ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC);
+       if (ntStatus != 0) {
+-              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control send request submission failed: %d\n", ntStatus);
++              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
++                      "control send request submission failed: %d\n",
++                              ntStatus);
++              MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES);
+               return STATUS_FAILURE;
+       }
+-      else {
+-          MP_SET_FLAG(pDevice, fMP_CONTROL_WRITES);
+-      }
++
+       spin_unlock_irq(&pDevice->lock);
+     for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
+@@ -224,6 +230,11 @@ int PIPEnsControlIn(
+     if (pDevice->Flags & fMP_CONTROL_READS)
+       return STATUS_FAILURE;
++      if (pDevice->Flags & fMP_CONTROL_WRITES)
++              return STATUS_FAILURE;
++
++      MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
++
+       pDevice->sUsbCtlRequest.bRequestType = 0xC0;
+       pDevice->sUsbCtlRequest.bRequest = byRequest;
+       pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue);
+@@ -237,10 +248,11 @@ int PIPEnsControlIn(
+       ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC);
+       if (ntStatus != 0) {
+-              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control request submission failed: %d\n", ntStatus);
+-      }else {
+-              MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
+-    }
++              DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
++                      "control request submission failed: %d\n", ntStatus);
++              MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS);
++              return STATUS_FAILURE;
++      }
+       spin_unlock_irq(&pDevice->lock);
+     for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
diff --git a/queue-3.8/staging-vt6656-revert-64-bit-correctly-address-void-structure.patch b/queue-3.8/staging-vt6656-revert-64-bit-correctly-address-void-structure.patch
new file mode 100644 (file)
index 0000000..26ab89b
--- /dev/null
@@ -0,0 +1,36 @@
+From d61ac98a4bd86b3217f0c6e058bd0b3a3282899b Mon Sep 17 00:00:00 2001
+From: Malcolm Priestley <tvboxspy@gmail.com>
+Date: Tue, 22 Jan 2013 20:12:34 +0000
+Subject: staging: vt6656: revert : 64 bit- Correctly address void structure.
+
+From: Malcolm Priestley <tvboxspy@gmail.com>
+
+commit d61ac98a4bd86b3217f0c6e058bd0b3a3282899b upstream.
+
+The patch is wrong and is partially reverted.
+
+The NULL check of pTransmitKey->pvKeyTable is kept.
+
+The problem was ultimately fixed by upstream commit.
+1ee4c55fc9620451b2a825d793042a7e0775391b
+staging: vt6656: Fix inconsistent structure packing
+
+Reported-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/vt6656/rxtx.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/vt6656/rxtx.c
++++ b/drivers/staging/vt6656/rxtx.c
+@@ -1454,7 +1454,7 @@ s_bPacketToWirelessUsb(
+     pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL;
+       if (bNeedEncryption && pTransmitKey->pvKeyTable) {
+-              if (((PSKeyTable)&pTransmitKey->pvKeyTable)->bSoftWEP == TRUE)
++              if (((PSKeyTable)pTransmitKey->pvKeyTable)->bSoftWEP == TRUE)
+                       bSoftWEP = TRUE; /* WEP 256 */
+       }
diff --git a/queue-3.8/staging-vt6656-revert-64bit-fixes-dpc.c-incorrect-addressing-of-void-structure.patch b/queue-3.8/staging-vt6656-revert-64bit-fixes-dpc.c-incorrect-addressing-of-void-structure.patch
new file mode 100644 (file)
index 0000000..a7bc813
--- /dev/null
@@ -0,0 +1,43 @@
+From 392c6ff87f568d573239b763855160d1f06114de Mon Sep 17 00:00:00 2001
+From: Malcolm Priestley <tvboxspy@gmail.com>
+Date: Tue, 22 Jan 2013 20:13:34 +0000
+Subject: staging: vt6656: Revert: 64bit fixes: dpc.c incorrect addressing of void structure.
+
+From: Malcolm Priestley <tvboxspy@gmail.com>
+
+commit 392c6ff87f568d573239b763855160d1f06114de upstream.
+
+The patch was totally wrong and is reverted.
+
+The problem was ultimately fixed by upstream commit.
+1ee4c55fc9620451b2a825d793042a7e0775391b
+staging: vt6656: Fix inconsistent structure packing
+
+Reported-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/vt6656/dpc.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/vt6656/dpc.c
++++ b/drivers/staging/vt6656/dpc.c
+@@ -1190,7 +1190,7 @@ static BOOL s_bHandleRxEncryption (
+     if (byDecMode == KEY_CTL_WEP) {
+         // handle WEP
+         if ((pDevice->byLocalID <= REV_ID_VT3253_A1) ||
+-              (((PSKeyTable)(&pKey->pvKeyTable))->bSoftWEP == TRUE)) {
++              (((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == TRUE)) {
+             // Software WEP
+             // 1. 3253A
+             // 2. WEP 256
+@@ -1299,7 +1299,7 @@ static BOOL s_bHostWepRxEncryption (
+         // handle WEP
+       DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"byDecMode == KEY_CTL_WEP\n");
+         if ((pDevice->byLocalID <= REV_ID_VT3253_A1) ||
+-              (((PSKeyTable)(&pKey->pvKeyTable))->bSoftWEP == TRUE) ||
++              (((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == TRUE) ||
+             (bOnFly == FALSE)) {
+             // Software WEP
+             // 1. 3253A
diff --git a/queue-3.8/staging-zsmalloc-fix-tlb-coherency-and-build-problem.patch b/queue-3.8/staging-zsmalloc-fix-tlb-coherency-and-build-problem.patch
new file mode 100644 (file)
index 0000000..c7f7367
--- /dev/null
@@ -0,0 +1,89 @@
+From 9915518887e83764269d5b617d01782893877ed3 Mon Sep 17 00:00:00 2001
+From: Minchan Kim <minchan@kernel.org>
+Date: Mon, 28 Jan 2013 10:00:08 +0900
+Subject: staging: zsmalloc: Fix TLB coherency and build problem
+
+From: Minchan Kim <minchan@kernel.org>
+
+commit 9915518887e83764269d5b617d01782893877ed3 upstream.
+
+Recently, Matt Sealey reported he fail to build zsmalloc caused by
+using of local_flush_tlb_kernel_range which are architecture dependent
+function so !CONFIG_SMP in ARM couldn't implement it so it ends up
+build error following as.
+
+  MODPOST 216 modules
+  LZMA    arch/arm/boot/compressed/piggy.lzma
+  AS      arch/arm/boot/compressed/lib1funcs.o
+ERROR: "v7wbi_flush_kern_tlb_range"
+[drivers/staging/zsmalloc/zsmalloc.ko] undefined!
+make[1]: *** [__modpost] Error 1
+make: *** [modules] Error 2
+make: *** Waiting for unfinished jobs....
+
+The reason we used that function is copy method by [1]
+was really slow in ARM but at that time.
+
+More severe problem is ARM can prefetch speculatively on other CPUs
+so under us, other TLBs can have an entry only if we do flush local
+CPU. Russell King pointed that. Thanks!
+We don't have many choices except using flush_tlb_kernel_range.
+
+My experiment in ARMv7 processor 4 core didn't make any difference with
+zsmapbench[2] between local_flush_tlb_kernel_range and flush_tlb_kernel_range
+but still page-table based is much better than copy-based.
+
+* bigger is better.
+
+1. local_flush_tlb_kernel_range: 3918795 mappings
+2. flush_tlb_kernel_range : 3989538 mappings
+3. copy-based: 635158 mappings
+
+This patch replace local_flush_tlb_kernel_range with
+flush_tlb_kernel_range which are avaialbe in all architectures
+because we already have used it in vmalloc allocator which are
+generic one so build problem should go away and performane loss
+shoud be void.
+
+[1] f553646, zsmalloc: add page table mapping method
+[2] https://github.com/spartacus06/zsmapbench
+
+Reported-by: Matt Sealey <matt@genesi-usa.com>
+Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
+Cc: Russell King <linux@arm.linux.org.uk>
+Cc: Konrad Rzeszutek Wilk <konrad@darnok.org>
+Cc: Nitin Gupta <ngupta@vflare.org>
+Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
+Signed-off-by: Minchan Kim <minchan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/zsmalloc/zsmalloc-main.c |   10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+--- a/drivers/staging/zsmalloc/zsmalloc-main.c
++++ b/drivers/staging/zsmalloc/zsmalloc-main.c
+@@ -222,11 +222,9 @@ struct zs_pool {
+ /*
+  * By default, zsmalloc uses a copy-based object mapping method to access
+  * allocations that span two pages. However, if a particular architecture
+- * 1) Implements local_flush_tlb_kernel_range() and 2) Performs VM mapping
+- * faster than copying, then it should be added here so that
+- * USE_PGTABLE_MAPPING is defined. This causes zsmalloc to use page table
+- * mapping rather than copying
+- * for object mapping.
++ * performs VM mapping faster than copying, then it should be added here
++ * so that USE_PGTABLE_MAPPING is defined. This causes zsmalloc to use
++ * page table mapping rather than copying for object mapping.
+ */
+ #if defined(CONFIG_ARM)
+ #define USE_PGTABLE_MAPPING
+@@ -663,7 +661,7 @@ static inline void __zs_unmap_object(str
+       flush_cache_vunmap(addr, end);
+       unmap_kernel_range_noflush(addr, PAGE_SIZE * 2);
+-      local_flush_tlb_kernel_range(addr, end);
++      flush_tlb_kernel_range(addr, end);
+ }
+ #else /* USE_PGTABLE_MAPPING */