]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jan 2013 19:21:04 +0000 (11:21 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jan 2013 19:21:04 +0000 (11:21 -0800)
added patches:
acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch
alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch
alsa-usb-audio-fix-missing-autopm-for-midi-input.patch
mm-fix-pagehead-when-config_pageflags_extended.patch
p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch
p54usb-add-usbids-for-two-more-p54usb-devices.patch
tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch
usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch
usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch
virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch
x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch

12 files changed:
queue-3.0/acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch [new file with mode: 0644]
queue-3.0/alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch [new file with mode: 0644]
queue-3.0/alsa-usb-audio-fix-missing-autopm-for-midi-input.patch [new file with mode: 0644]
queue-3.0/mm-fix-pagehead-when-config_pageflags_extended.patch [new file with mode: 0644]
queue-3.0/p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch [new file with mode: 0644]
queue-3.0/p54usb-add-usbids-for-two-more-p54usb-devices.patch [new file with mode: 0644]
queue-3.0/series
queue-3.0/tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch [new file with mode: 0644]
queue-3.0/usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch [new file with mode: 0644]
queue-3.0/usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch [new file with mode: 0644]
queue-3.0/virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch [new file with mode: 0644]
queue-3.0/x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch [new file with mode: 0644]

diff --git a/queue-3.0/acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch b/queue-3.0/acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch
new file mode 100644 (file)
index 0000000..93fda48
--- /dev/null
@@ -0,0 +1,33 @@
+From 4f5f64cf0cc916220aaa055992e31195470cfe37 Mon Sep 17 00:00:00 2001
+From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+Date: Fri, 4 Jan 2013 23:00:54 +0100
+Subject: ACPI / scan: Do not use dummy HID for system bus ACPI nodes
+
+From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+
+commit 4f5f64cf0cc916220aaa055992e31195470cfe37 upstream.
+
+At one point acpi_device_set_id() checks if acpi_device_hid(device)
+returns NULL, but that never happens, so system bus devices with an
+empty list of PNP IDs are given the dummy HID ("device") instead of
+the "system bus HID" ("LNXSYBUS").  Fix the code to use the right
+check.
+
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/scan.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/acpi/scan.c
++++ b/drivers/acpi/scan.c
+@@ -1153,7 +1153,7 @@ static void acpi_device_set_id(struct ac
+                       acpi_add_id(device, ACPI_DOCK_HID);
+               else if (!acpi_ibm_smbus_match(device))
+                       acpi_add_id(device, ACPI_SMBUS_IBM_HID);
+-              else if (!acpi_device_hid(device) &&
++              else if (list_empty(&device->pnp.ids) &&
+                        ACPI_IS_ROOT_DEVICE(device->parent)) {
+                       acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
+                       strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
diff --git a/queue-3.0/alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch b/queue-3.0/alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch
new file mode 100644 (file)
index 0000000..7185348
--- /dev/null
@@ -0,0 +1,104 @@
+From 59866da9e4ae54819e3c4e0a8f426bdb0c2ef993 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 3 Dec 2012 11:12:46 +0100
+Subject: ALSA: usb-audio: Avoid autopm calls after disconnection
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 59866da9e4ae54819e3c4e0a8f426bdb0c2ef993 upstream.
+
+Add a similar protection against the disconnection race and the
+invalid use of usb instance after disconnection, as well as we've done
+for the USB audio PCM.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51201
+
+Reviewd-by: Clemens Ladisch <clemens@ladisch.de>
+Tested-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/midi.c |   23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+--- a/sound/usb/midi.c
++++ b/sound/usb/midi.c
+@@ -115,6 +115,7 @@ struct snd_usb_midi {
+       struct list_head list;
+       struct timer_list error_timer;
+       spinlock_t disc_lock;
++      struct rw_semaphore disc_rwsem;
+       struct mutex mutex;
+       u32 usb_id;
+       int next_midi_device;
+@@ -1021,6 +1022,12 @@ static void substream_open(struct snd_ra
+       struct snd_usb_midi* umidi = substream->rmidi->private_data;
+       struct snd_kcontrol *ctl;
++      down_read(&umidi->disc_rwsem);
++      if (umidi->disconnected) {
++              up_read(&umidi->disc_rwsem);
++              return;
++      }
++
+       mutex_lock(&umidi->mutex);
+       if (open) {
+               if (umidi->opened++ == 0 && umidi->roland_load_ctl) {
+@@ -1039,6 +1046,7 @@ static void substream_open(struct snd_ra
+               }
+       }
+       mutex_unlock(&umidi->mutex);
++      up_read(&umidi->disc_rwsem);
+ }
+ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
+@@ -1059,8 +1067,15 @@ static int snd_usbmidi_output_open(struc
+               snd_BUG();
+               return -ENXIO;
+       }
++
++      down_read(&umidi->disc_rwsem);
++      if (umidi->disconnected) {
++              up_read(&umidi->disc_rwsem);
++              return -ENODEV;
++      }
+       err = usb_autopm_get_interface(umidi->iface);
+       port->autopm_reference = err >= 0;
++      up_read(&umidi->disc_rwsem);
+       if (err < 0 && err != -EACCES)
+               return -EIO;
+       substream->runtime->private_data = port;
+@@ -1075,8 +1090,10 @@ static int snd_usbmidi_output_close(stru
+       struct usbmidi_out_port *port = substream->runtime->private_data;
+       substream_open(substream, 0);
+-      if (port->autopm_reference)
++      down_read(&umidi->disc_rwsem);
++      if (!umidi->disconnected && port->autopm_reference)
+               usb_autopm_put_interface(umidi->iface);
++      up_read(&umidi->disc_rwsem);
+       return 0;
+ }
+@@ -1386,9 +1403,12 @@ void snd_usbmidi_disconnect(struct list_
+        * a timer may submit an URB. To reliably break the cycle
+        * a flag under lock must be used
+        */
++      down_write(&umidi->disc_rwsem);
+       spin_lock_irq(&umidi->disc_lock);
+       umidi->disconnected = 1;
+       spin_unlock_irq(&umidi->disc_lock);
++      up_write(&umidi->disc_rwsem);
++
+       for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
+               struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i];
+               if (ep->out)
+@@ -2100,6 +2120,7 @@ int snd_usbmidi_create(struct snd_card *
+       umidi->usb_protocol_ops = &snd_usbmidi_standard_ops;
+       init_timer(&umidi->error_timer);
+       spin_lock_init(&umidi->disc_lock);
++      init_rwsem(&umidi->disc_rwsem);
+       mutex_init(&umidi->mutex);
+       umidi->usb_id = USB_ID(le16_to_cpu(umidi->dev->descriptor.idVendor),
+                              le16_to_cpu(umidi->dev->descriptor.idProduct));
diff --git a/queue-3.0/alsa-usb-audio-fix-missing-autopm-for-midi-input.patch b/queue-3.0/alsa-usb-audio-fix-missing-autopm-for-midi-input.patch
new file mode 100644 (file)
index 0000000..7c87cff
--- /dev/null
@@ -0,0 +1,220 @@
+From f5f165418cabf2218eb466c0e94693b8b1aee88b Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 3 Dec 2012 11:30:50 +0100
+Subject: ALSA: usb-audio: Fix missing autopm for MIDI input
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit f5f165418cabf2218eb466c0e94693b8b1aee88b upstream.
+
+The commit [88a8516a: ALSA: usbaudio: implement USB autosuspend] added
+the support of autopm for USB MIDI output, but it didn't take the MIDI
+input into account.
+
+This patch adds the following for fixing the autopm:
+- Manage the URB start at the first MIDI input stream open, instead of
+  the time of instance creation
+- Move autopm code to the common substream_open()
+- Make snd_usbmidi_input_start/_stop() more robust and add the running
+  state check
+
+Reviewd-by: Clemens Ladisch <clemens@ladisch.de>
+Tested-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/midi.c |   88 ++++++++++++++++++++++++++++---------------------------
+ 1 file changed, 46 insertions(+), 42 deletions(-)
+
+--- a/sound/usb/midi.c
++++ b/sound/usb/midi.c
+@@ -125,8 +125,10 @@ struct snd_usb_midi {
+               struct snd_usb_midi_in_endpoint *in;
+       } endpoints[MIDI_MAX_ENDPOINTS];
+       unsigned long input_triggered;
+-      unsigned int opened;
++      bool autopm_reference;
++      unsigned int opened[2];
+       unsigned char disconnected;
++      unsigned char input_running;
+       struct snd_kcontrol *roland_load_ctl;
+ };
+@@ -148,7 +150,6 @@ struct snd_usb_midi_out_endpoint {
+               struct snd_usb_midi_out_endpoint* ep;
+               struct snd_rawmidi_substream *substream;
+               int active;
+-              bool autopm_reference;
+               uint8_t cable;          /* cable number << 4 */
+               uint8_t state;
+ #define STATE_UNKNOWN 0
+@@ -1017,36 +1018,58 @@ static void update_roland_altsetting(str
+       snd_usbmidi_input_start(&umidi->list);
+ }
+-static void substream_open(struct snd_rawmidi_substream *substream, int open)
++static int substream_open(struct snd_rawmidi_substream *substream, int dir,
++                        int open)
+ {
+       struct snd_usb_midi* umidi = substream->rmidi->private_data;
+       struct snd_kcontrol *ctl;
++      int err;
+       down_read(&umidi->disc_rwsem);
+       if (umidi->disconnected) {
+               up_read(&umidi->disc_rwsem);
+-              return;
++              return open ? -ENODEV : 0;
+       }
+       mutex_lock(&umidi->mutex);
+       if (open) {
+-              if (umidi->opened++ == 0 && umidi->roland_load_ctl) {
+-                      ctl = umidi->roland_load_ctl;
+-                      ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
+-                      snd_ctl_notify(umidi->card,
++              if (!umidi->opened[0] && !umidi->opened[1]) {
++                      err = usb_autopm_get_interface(umidi->iface);
++                      umidi->autopm_reference = err >= 0;
++                      if (err < 0 && err != -EACCES) {
++                              mutex_unlock(&umidi->mutex);
++                              up_read(&umidi->disc_rwsem);
++                              return -EIO;
++                      }
++                      if (umidi->roland_load_ctl) {
++                              ctl = umidi->roland_load_ctl;
++                              ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
++                              snd_ctl_notify(umidi->card,
+                                      SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
+-                      update_roland_altsetting(umidi);
++                              update_roland_altsetting(umidi);
++                      }
+               }
++              umidi->opened[dir]++;
++              if (umidi->opened[1])
++                      snd_usbmidi_input_start(&umidi->list);
+       } else {
+-              if (--umidi->opened == 0 && umidi->roland_load_ctl) {
+-                      ctl = umidi->roland_load_ctl;
+-                      ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
+-                      snd_ctl_notify(umidi->card,
++              umidi->opened[dir]--;
++              if (!umidi->opened[1])
++                      snd_usbmidi_input_stop(&umidi->list);
++              if (!umidi->opened[0] && !umidi->opened[1]) {
++                      if (umidi->roland_load_ctl) {
++                              ctl = umidi->roland_load_ctl;
++                              ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
++                              snd_ctl_notify(umidi->card,
+                                      SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
++                      }
++                      if (umidi->autopm_reference)
++                              usb_autopm_put_interface(umidi->iface);
+               }
+       }
+       mutex_unlock(&umidi->mutex);
+       up_read(&umidi->disc_rwsem);
++      return 0;
+ }
+ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
+@@ -1054,7 +1077,6 @@ static int snd_usbmidi_output_open(struc
+       struct snd_usb_midi* umidi = substream->rmidi->private_data;
+       struct usbmidi_out_port* port = NULL;
+       int i, j;
+-      int err;
+       for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
+               if (umidi->endpoints[i].out)
+@@ -1068,33 +1090,14 @@ static int snd_usbmidi_output_open(struc
+               return -ENXIO;
+       }
+-      down_read(&umidi->disc_rwsem);
+-      if (umidi->disconnected) {
+-              up_read(&umidi->disc_rwsem);
+-              return -ENODEV;
+-      }
+-      err = usb_autopm_get_interface(umidi->iface);
+-      port->autopm_reference = err >= 0;
+-      up_read(&umidi->disc_rwsem);
+-      if (err < 0 && err != -EACCES)
+-              return -EIO;
+       substream->runtime->private_data = port;
+       port->state = STATE_UNKNOWN;
+-      substream_open(substream, 1);
+-      return 0;
++      return substream_open(substream, 0, 1);
+ }
+ static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream)
+ {
+-      struct snd_usb_midi* umidi = substream->rmidi->private_data;
+-      struct usbmidi_out_port *port = substream->runtime->private_data;
+-
+-      substream_open(substream, 0);
+-      down_read(&umidi->disc_rwsem);
+-      if (!umidi->disconnected && port->autopm_reference)
+-              usb_autopm_put_interface(umidi->iface);
+-      up_read(&umidi->disc_rwsem);
+-      return 0;
++      return substream_open(substream, 0, 0);
+ }
+ static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream, int up)
+@@ -1147,14 +1150,12 @@ static void snd_usbmidi_output_drain(str
+ static int snd_usbmidi_input_open(struct snd_rawmidi_substream *substream)
+ {
+-      substream_open(substream, 1);
+-      return 0;
++      return substream_open(substream, 1, 1);
+ }
+ static int snd_usbmidi_input_close(struct snd_rawmidi_substream *substream)
+ {
+-      substream_open(substream, 0);
+-      return 0;
++      return substream_open(substream, 1, 0);
+ }
+ static void snd_usbmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
+@@ -2063,12 +2064,15 @@ void snd_usbmidi_input_stop(struct list_
+       unsigned int i, j;
+       umidi = list_entry(p, struct snd_usb_midi, list);
++      if (!umidi->input_running)
++              return;
+       for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
+               struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i];
+               if (ep->in)
+                       for (j = 0; j < INPUT_URBS; ++j)
+                               usb_kill_urb(ep->in->urbs[j]);
+       }
++      umidi->input_running = 0;
+ }
+ static void snd_usbmidi_input_start_ep(struct snd_usb_midi_in_endpoint* ep)
+@@ -2093,8 +2097,11 @@ void snd_usbmidi_input_start(struct list
+       int i;
+       umidi = list_entry(p, struct snd_usb_midi, list);
++      if (umidi->input_running || !umidi->opened[1])
++              return;
+       for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
+               snd_usbmidi_input_start_ep(umidi->endpoints[i].in);
++      umidi->input_running = 1;
+ }
+ /*
+@@ -2222,9 +2229,6 @@ int snd_usbmidi_create(struct snd_card *
+       }
+       list_add_tail(&umidi->list, midi_list);
+-
+-      for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
+-              snd_usbmidi_input_start_ep(umidi->endpoints[i].in);
+       return 0;
+ }
diff --git a/queue-3.0/mm-fix-pagehead-when-config_pageflags_extended.patch b/queue-3.0/mm-fix-pagehead-when-config_pageflags_extended.patch
new file mode 100644 (file)
index 0000000..ecd2182
--- /dev/null
@@ -0,0 +1,63 @@
+From ad4b3fb7ff9940bcdb1e4cd62bd189d10fa636ba Mon Sep 17 00:00:00 2001
+From: Christoffer Dall <cdall@cs.columbia.edu>
+Date: Fri, 21 Dec 2012 13:03:50 -0500
+Subject: mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED
+
+From: Christoffer Dall <cdall@cs.columbia.edu>
+
+commit ad4b3fb7ff9940bcdb1e4cd62bd189d10fa636ba upstream.
+
+Unfortunately with !CONFIG_PAGEFLAGS_EXTENDED, (!PageHead) is false, and
+(PageHead) is true, for tail pages.  If this is indeed the intended
+behavior, which I doubt because it breaks cache cleaning on some ARM
+systems, then the nomenclature is highly problematic.
+
+This patch makes sure PageHead is only true for head pages and PageTail
+is only true for tail pages, and neither is true for non-compound pages.
+
+[ This buglet seems ancient - seems to have been introduced back in Apr
+  2008 in commit 6a1e7f777f61: "pageflags: convert to the use of new
+  macros".  And the reason nobody noticed is because the PageHead()
+  tests are almost all about just sanity-checking, and only used on
+  pages that are actual page heads.  The fact that the old code returned
+  true for tail pages too was thus not really noticeable.   - Linus ]
+
+Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
+Acked-by:  Andrea Arcangeli <aarcange@redhat.com>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Will Deacon <Will.Deacon@arm.com>
+Cc: Steve Capper <Steve.Capper@arm.com>
+Cc: Christoph Lameter <cl@linux.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/page-flags.h |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/include/linux/page-flags.h
++++ b/include/linux/page-flags.h
+@@ -365,7 +365,7 @@ static inline void ClearPageCompound(str
+  * pages on the LRU and/or pagecache.
+  */
+ TESTPAGEFLAG(Compound, compound)
+-__PAGEFLAG(Head, compound)
++__SETPAGEFLAG(Head, compound)  __CLEARPAGEFLAG(Head, compound)
+ /*
+  * PG_reclaim is used in combination with PG_compound to mark the
+@@ -377,8 +377,14 @@ __PAGEFLAG(Head, compound)
+  * PG_compound & PG_reclaim   => Tail page
+  * PG_compound & ~PG_reclaim  => Head page
+  */
++#define PG_head_mask ((1L << PG_compound))
+ #define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim))
++static inline int PageHead(struct page *page)
++{
++      return ((page->flags & PG_head_tail_mask) == PG_head_mask);
++}
++
+ static inline int PageTail(struct page *page)
+ {
+       return ((page->flags & PG_head_tail_mask) == PG_head_tail_mask);
diff --git a/queue-3.0/p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch b/queue-3.0/p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch
new file mode 100644 (file)
index 0000000..97c79ca
--- /dev/null
@@ -0,0 +1,30 @@
+From 3194b7fcdf6caea338b5d2c72d76fed80437649c Mon Sep 17 00:00:00 2001
+From: Tomasz Guszkowski <tsg@o2.pl>
+Date: Sat, 22 Dec 2012 18:30:01 +0100
+Subject: p54usb: add USB ID for T-Com Sinus 154 data II
+
+From: Tomasz Guszkowski <tsg@o2.pl>
+
+commit 3194b7fcdf6caea338b5d2c72d76fed80437649c upstream.
+
+Added USB ID for T-Com Sinus 154 data II.
+
+Signed-off-by: Tomasz Guszkowski <tsg@o2.pl>
+Acked-by: Christian Lamparter <chunkeey@googlemail.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/p54/p54usb.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/p54/p54usb.c
++++ b/drivers/net/wireless/p54/p54usb.c
+@@ -81,6 +81,7 @@ static struct usb_device_id p54u_table[]
+       {USB_DEVICE(0x06a9, 0x000e)},   /* Westell 802.11g USB (A90-211WG-01) */
+       {USB_DEVICE(0x06b9, 0x0121)},   /* Thomson SpeedTouch 121g */
+       {USB_DEVICE(0x0707, 0xee13)},   /* SMC 2862W-G version 2 */
++      {USB_DEVICE(0x083a, 0x4503)},   /* T-Com Sinus 154 data II */
+       {USB_DEVICE(0x083a, 0x4521)},   /* Siemens Gigaset USB Adapter 54 version 2 */
+       {USB_DEVICE(0x083a, 0xc501)},   /* Zoom Wireless-G 4410 */
+       {USB_DEVICE(0x083a, 0xf503)},   /* Accton FD7050E ver 1010ec  */
diff --git a/queue-3.0/p54usb-add-usbids-for-two-more-p54usb-devices.patch b/queue-3.0/p54usb-add-usbids-for-two-more-p54usb-devices.patch
new file mode 100644 (file)
index 0000000..24c3584
--- /dev/null
@@ -0,0 +1,55 @@
+From 4010fe21a315b4223c25376714c6a2b61b722e5c Mon Sep 17 00:00:00 2001
+From: Christian Lamparter <chunkeey@googlemail.com>
+Date: Thu, 27 Dec 2012 15:18:20 +0100
+Subject: p54usb: add USBIDs for two more p54usb devices
+
+From: Christian Lamparter <chunkeey@googlemail.com>
+
+commit 4010fe21a315b4223c25376714c6a2b61b722e5c upstream.
+
+This patch adds USBIDs for:
+       - DrayTek Vigor 530
+       - Zoom 4410a
+
+It also adds a note about Gemtek WUBI-100GW
+and SparkLAN WL-682 USBID conflict [WUBI-100GW
+is a ISL3886+NET2280 (LM86 firmare) solution,
+whereas WL-682 is a ISL3887 (LM87 firmware)]
+device.
+
+Source: <http://www.wikidevi.com/wiki/Intersil/p54/usb/windows>
+
+Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/p54/p54usb.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/wireless/p54/p54usb.c
++++ b/drivers/net/wireless/p54/p54usb.c
+@@ -46,6 +46,7 @@ static struct usb_device_id p54u_table[]
+       {USB_DEVICE(0x0411, 0x0050)},   /* Buffalo WLI2-USB2-G54 */
+       {USB_DEVICE(0x045e, 0x00c2)},   /* Microsoft MN-710 */
+       {USB_DEVICE(0x0506, 0x0a11)},   /* 3COM 3CRWE254G72 */
++      {USB_DEVICE(0x0675, 0x0530)},   /* DrayTek Vigor 530 */
+       {USB_DEVICE(0x06b9, 0x0120)},   /* Thomson SpeedTouch 120g */
+       {USB_DEVICE(0x0707, 0xee06)},   /* SMC 2862W-G */
+       {USB_DEVICE(0x07aa, 0x001c)},   /* Corega CG-WLUSB2GT */
+@@ -81,6 +82,7 @@ static struct usb_device_id p54u_table[]
+       {USB_DEVICE(0x06a9, 0x000e)},   /* Westell 802.11g USB (A90-211WG-01) */
+       {USB_DEVICE(0x06b9, 0x0121)},   /* Thomson SpeedTouch 121g */
+       {USB_DEVICE(0x0707, 0xee13)},   /* SMC 2862W-G version 2 */
++      {USB_DEVICE(0x0803, 0x4310)},   /* Zoom 4410a */
+       {USB_DEVICE(0x083a, 0x4503)},   /* T-Com Sinus 154 data II */
+       {USB_DEVICE(0x083a, 0x4521)},   /* Siemens Gigaset USB Adapter 54 version 2 */
+       {USB_DEVICE(0x083a, 0xc501)},   /* Zoom Wireless-G 4410 */
+@@ -101,6 +103,7 @@ static struct usb_device_id p54u_table[]
+       {USB_DEVICE(0x13B1, 0x000C)},   /* Linksys WUSB54AG */
+       {USB_DEVICE(0x1413, 0x5400)},   /* Telsey 802.11g USB2.0 Adapter */
+       {USB_DEVICE(0x1435, 0x0427)},   /* Inventel UR054G */
++      /* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */
+       {USB_DEVICE(0x1668, 0x1050)},   /* Actiontec 802UIG-1 */
+       {USB_DEVICE(0x1740, 0x1000)},   /* Senao NUB-350 */
+       {USB_DEVICE(0x2001, 0x3704)},   /* DLink DWL-G122 rev A2 */
index 6b32a3eb2e1cbef7456b6459b5fc25b522ecae3c..2555f64ffc937a9f19257786961e7036d8f99a20 100644 (file)
@@ -7,3 +7,14 @@ irda-sir_dev-fix-copy-paste-typo.patch
 usb-ipheth-add-iphone-5-support.patch
 pnpacpi-fix-incorrect-test_alpha-test.patch
 exec-do-not-leave-bprm-interp-on-stack.patch
+x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch
+virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch
+mm-fix-pagehead-when-config_pageflags_extended.patch
+tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch
+alsa-usb-audio-avoid-autopm-calls-after-disconnection.patch
+alsa-usb-audio-fix-missing-autopm-for-midi-input.patch
+p54usb-add-usb-id-for-t-com-sinus-154-data-ii.patch
+p54usb-add-usbids-for-two-more-p54usb-devices.patch
+usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch
+usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch
+acpi-scan-do-not-use-dummy-hid-for-system-bus-acpi-nodes.patch
diff --git a/queue-3.0/tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch b/queue-3.0/tmpfs-mempolicy-fix-proc-mounts-corrupting-memory.patch
new file mode 100644 (file)
index 0000000..793ef2a
--- /dev/null
@@ -0,0 +1,172 @@
+From f2a07f40dbc603c15f8b06e6ec7f768af67b424f Mon Sep 17 00:00:00 2001
+From: Hugh Dickins <hughd@google.com>
+Date: Wed, 2 Jan 2013 02:01:33 -0800
+Subject: tmpfs mempolicy: fix /proc/mounts corrupting memory
+
+From: Hugh Dickins <hughd@google.com>
+
+commit f2a07f40dbc603c15f8b06e6ec7f768af67b424f upstream.
+
+Recently I suggested using "mount -o remount,mpol=local /tmp" in NUMA
+mempolicy testing.  Very nasty.  Reading /proc/mounts, /proc/pid/mounts
+or /proc/pid/mountinfo may then corrupt one bit of kernel memory, often
+in a page table (causing "Bad swap" or "Bad page map" warning or "Bad
+pagetable" oops), sometimes in a vm_area_struct or rbnode or somewhere
+worse.  "mpol=prefer" and "mpol=prefer:Node" are equally toxic.
+
+Recent NUMA enhancements are not to blame: this dates back to 2.6.35,
+when commit e17f74af351c "mempolicy: don't call mpol_set_nodemask() when
+no_context" skipped mpol_parse_str()'s call to mpol_set_nodemask(),
+which used to initialize v.preferred_node, or set MPOL_F_LOCAL in flags.
+With slab poisoning, you can then rely on mpol_to_str() to set the bit
+for node 0x6b6b, probably in the next page above the caller's stack.
+
+mpol_parse_str() is only called from shmem_parse_options(): no_context
+is always true, so call it unused for now, and remove !no_context code.
+Set v.nodes or v.preferred_node or MPOL_F_LOCAL as mpol_to_str() might
+expect.  Then mpol_to_str() can ignore its no_context argument also,
+the mpol being appropriately initialized whether contextualized or not.
+Rename its no_context unused too, and let subsequent patch remove them
+(that's not needed for stable backporting, which would involve rejects).
+
+I don't understand why MPOL_LOCAL is described as a pseudo-policy:
+it's a reasonable policy which suffers from a confusing implementation
+in terms of MPOL_PREFERRED with MPOL_F_LOCAL.  I believe this would be
+much more robust if MPOL_LOCAL were recognized in switch statements
+throughout, MPOL_F_LOCAL deleted, and MPOL_PREFERRED use the (possibly
+empty) nodes mask like everyone else, instead of its preferred_node
+variant (I presume an optimization from the days before MPOL_LOCAL).
+But that would take me too long to get right and fully tested.
+
+Signed-off-by: Hugh Dickins <hughd@google.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/mempolicy.c |   64 +++++++++++++++++++++++----------------------------------
+ 1 file changed, 26 insertions(+), 38 deletions(-)
+
+--- a/mm/mempolicy.c
++++ b/mm/mempolicy.c
+@@ -2308,8 +2308,7 @@ void numa_default_policy(void)
+  */
+ /*
+- * "local" is pseudo-policy:  MPOL_PREFERRED with MPOL_F_LOCAL flag
+- * Used only for mpol_parse_str() and mpol_to_str()
++ * "local" is implemented internally by MPOL_PREFERRED with MPOL_F_LOCAL flag.
+  */
+ #define MPOL_LOCAL MPOL_MAX
+ static const char * const policy_modes[] =
+@@ -2324,28 +2323,21 @@ static const char * const policy_modes[]
+ #ifdef CONFIG_TMPFS
+ /**
+- * mpol_parse_str - parse string to mempolicy
++ * mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option.
+  * @str:  string containing mempolicy to parse
+  * @mpol:  pointer to struct mempolicy pointer, returned on success.
+- * @no_context:  flag whether to "contextualize" the mempolicy
++ * @unused:  redundant argument, to be removed later.
+  *
+  * Format of input:
+  *    <mode>[=<flags>][:<nodelist>]
+  *
+- * if @no_context is true, save the input nodemask in w.user_nodemask in
+- * the returned mempolicy.  This will be used to "clone" the mempolicy in
+- * a specific context [cpuset] at a later time.  Used to parse tmpfs mpol
+- * mount option.  Note that if 'static' or 'relative' mode flags were
+- * specified, the input nodemask will already have been saved.  Saving
+- * it again is redundant, but safe.
+- *
+  * On success, returns 0, else 1
+  */
+-int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
++int mpol_parse_str(char *str, struct mempolicy **mpol, int unused)
+ {
+       struct mempolicy *new = NULL;
+       unsigned short mode;
+-      unsigned short uninitialized_var(mode_flags);
++      unsigned short mode_flags;
+       nodemask_t nodes;
+       char *nodelist = strchr(str, ':');
+       char *flags = strchr(str, '=');
+@@ -2433,24 +2425,23 @@ int mpol_parse_str(char *str, struct mem
+       if (IS_ERR(new))
+               goto out;
+-      if (no_context) {
+-              /* save for contextualization */
+-              new->w.user_nodemask = nodes;
+-      } else {
+-              int ret;
+-              NODEMASK_SCRATCH(scratch);
+-              if (scratch) {
+-                      task_lock(current);
+-                      ret = mpol_set_nodemask(new, &nodes, scratch);
+-                      task_unlock(current);
+-              } else
+-                      ret = -ENOMEM;
+-              NODEMASK_SCRATCH_FREE(scratch);
+-              if (ret) {
+-                      mpol_put(new);
+-                      goto out;
+-              }
+-      }
++      /*
++       * Save nodes for mpol_to_str() to show the tmpfs mount options
++       * for /proc/mounts, /proc/pid/mounts and /proc/pid/mountinfo.
++       */
++      if (mode != MPOL_PREFERRED)
++              new->v.nodes = nodes;
++      else if (nodelist)
++              new->v.preferred_node = first_node(nodes);
++      else
++              new->flags |= MPOL_F_LOCAL;
++
++      /*
++       * Save nodes for contextualization: this will be used to "clone"
++       * the mempolicy in a specific context [cpuset] at a later time.
++       */
++      new->w.user_nodemask = nodes;
++
+       err = 0;
+ out:
+@@ -2470,13 +2461,13 @@ out:
+  * @buffer:  to contain formatted mempolicy string
+  * @maxlen:  length of @buffer
+  * @pol:  pointer to mempolicy to be formatted
+- * @no_context:  "context free" mempolicy - use nodemask in w.user_nodemask
++ * @unused:  redundant argument, to be removed later.
+  *
+  * Convert a mempolicy into a string.
+  * Returns the number of characters in buffer (if positive)
+  * or an error (negative)
+  */
+-int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context)
++int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int unused)
+ {
+       char *p = buffer;
+       int l;
+@@ -2502,7 +2493,7 @@ int mpol_to_str(char *buffer, int maxlen
+       case MPOL_PREFERRED:
+               nodes_clear(nodes);
+               if (flags & MPOL_F_LOCAL)
+-                      mode = MPOL_LOCAL;      /* pseudo-policy */
++                      mode = MPOL_LOCAL;
+               else
+                       node_set(pol->v.preferred_node, nodes);
+               break;
+@@ -2510,10 +2501,7 @@ int mpol_to_str(char *buffer, int maxlen
+       case MPOL_BIND:
+               /* Fall through */
+       case MPOL_INTERLEAVE:
+-              if (no_context)
+-                      nodes = pol->w.user_nodemask;
+-              else
+-                      nodes = pol->v.nodes;
++              nodes = pol->v.nodes;
+               break;
+       default:
diff --git a/queue-3.0/usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch b/queue-3.0/usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch
new file mode 100644 (file)
index 0000000..b74bdb6
--- /dev/null
@@ -0,0 +1,48 @@
+From d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Mon, 22 Oct 2012 22:15:04 +0200
+Subject: usb: gadget: phonet: free requests in pn_bind()'s error path
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+commit d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd upstream.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/f_phonet.c |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/gadget/f_phonet.c
++++ b/drivers/usb/gadget/f_phonet.c
+@@ -541,7 +541,7 @@ int pn_bind(struct usb_configuration *c,
+               req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL);
+               if (!req)
+-                      goto err;
++                      goto err_req;
+               req->complete = pn_rx_complete;
+               fp->out_reqv[i] = req;
+@@ -550,14 +550,18 @@ int pn_bind(struct usb_configuration *c,
+       /* Outgoing USB requests */
+       fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL);
+       if (!fp->in_req)
+-              goto err;
++              goto err_req;
+       INFO(cdev, "USB CDC Phonet function\n");
+       INFO(cdev, "using %s, OUT %s, IN %s\n", cdev->gadget->name,
+               fp->out_ep->name, fp->in_ep->name);
+       return 0;
++err_req:
++      for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++)
++              usb_ep_free_request(fp->out_ep, fp->out_reqv[i]);
+ err:
++
+       if (fp->out_ep)
+               fp->out_ep->driver_data = NULL;
+       if (fp->in_ep)
diff --git a/queue-3.0/usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch b/queue-3.0/usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch
new file mode 100644 (file)
index 0000000..7108198
--- /dev/null
@@ -0,0 +1,96 @@
+From 0f9df939385527049c8062a099fbfa1479fe7ce0 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Mon, 22 Oct 2012 22:15:05 +0200
+Subject: usb: gadget: uvc: fix error path in uvc_function_bind()
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+commit 0f9df939385527049c8062a099fbfa1479fe7ce0 upstream.
+
+The "video->minor = -1" assigment is done in V4L2 by
+video_register_device() so it is removed here.
+Now. uvc_function_bind() calls in error case uvc_function_unbind() for
+cleanup. The problem is that uvc_function_unbind() frees the uvc struct
+and uvc_bind_config() does as well in error case of usb_add_function().
+Removing kfree() in usb_add_function() would make the patch smaller but
+it would look odd because the new allocated memory is not cleaned up.
+However it is not guaranteed that if we call usb_add_function() we also
+get to the bind function.
+Therefore the patch extracts the conditional cleanup from
+uvc_function_unbind() applies to uvc_function_bind().
+uvc_function_unbind() now contains only the complete cleanup which is
+required once everything has been registrated.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/f_uvc.c |   39 +++++++++++++++++++++------------------
+ 1 file changed, 21 insertions(+), 18 deletions(-)
+
+--- a/drivers/usb/gadget/f_uvc.c
++++ b/drivers/usb/gadget/f_uvc.c
+@@ -334,7 +334,6 @@ uvc_register_video(struct uvc_device *uv
+               return -ENOMEM;
+       video->parent = &cdev->gadget->dev;
+-      video->minor = -1;
+       video->fops = &uvc_v4l2_fops;
+       video->release = video_device_release;
+       strncpy(video->name, cdev->gadget->name, sizeof(video->name));
+@@ -461,23 +460,12 @@ uvc_function_unbind(struct usb_configura
+       INFO(cdev, "uvc_function_unbind\n");
+-      if (uvc->vdev) {
+-              if (uvc->vdev->minor == -1)
+-                      video_device_release(uvc->vdev);
+-              else
+-                      video_unregister_device(uvc->vdev);
+-              uvc->vdev = NULL;
+-      }
+-
+-      if (uvc->control_ep)
+-              uvc->control_ep->driver_data = NULL;
+-      if (uvc->video.ep)
+-              uvc->video.ep->driver_data = NULL;
++      video_unregister_device(uvc->vdev);
++      uvc->control_ep->driver_data = NULL;
++      uvc->video.ep->driver_data = NULL;
+-      if (uvc->control_req) {
+-              usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
+-              kfree(uvc->control_buf);
+-      }
++      usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
++      kfree(uvc->control_buf);
+       kfree(f->descriptors);
+       kfree(f->hs_descriptors);
+@@ -562,7 +550,22 @@ uvc_function_bind(struct usb_configurati
+       return 0;
+ error:
+-      uvc_function_unbind(c, f);
++      if (uvc->vdev)
++              video_device_release(uvc->vdev);
++
++      if (uvc->control_ep)
++              uvc->control_ep->driver_data = NULL;
++      if (uvc->video.ep)
++              uvc->video.ep->driver_data = NULL;
++
++      if (uvc->control_req) {
++              usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
++              kfree(uvc->control_buf);
++      }
++
++      kfree(f->descriptors);
++      kfree(f->hs_descriptors);
++      kfree(f->ss_descriptors);
+       return ret;
+ }
diff --git a/queue-3.0/virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch b/queue-3.0/virtio-force-vring-descriptors-to-be-allocated-from-lowmem.patch
new file mode 100644 (file)
index 0000000..9142032
--- /dev/null
@@ -0,0 +1,45 @@
+From b92b1b89a33c172c075edccf6afb0edc41d851fd Mon Sep 17 00:00:00 2001
+From: Will Deacon <will.deacon@arm.com>
+Date: Fri, 19 Oct 2012 14:03:33 +0100
+Subject: virtio: force vring descriptors to be allocated from lowmem
+
+From: Will Deacon <will.deacon@arm.com>
+
+commit b92b1b89a33c172c075edccf6afb0edc41d851fd upstream.
+
+Virtio devices may attempt to add descriptors to a virtqueue from atomic
+context using GFP_ATOMIC allocation. This is problematic because such
+allocations can fall outside of the lowmem mapping, causing virt_to_phys
+to report bogus physical addresses which are subsequently passed to
+userspace via the buffers for the virtual device.
+
+This patch masks out __GFP_HIGH and __GFP_HIGHMEM from the requested
+flags when allocating descriptors for a virtqueue. If an atomic
+allocation is requested and later fails, we will return -ENOSPC which
+will be handled by the driver.
+
+Signed-off-by: Will Deacon <will.deacon@arm.com>
+Cc: Sasha Levin <levinsasha928@gmail.com>
+Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/virtio/virtio_ring.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/virtio/virtio_ring.c
++++ b/drivers/virtio/virtio_ring.c
+@@ -120,6 +120,13 @@ static int vring_add_indirect(struct vri
+       unsigned head;
+       int i;
++      /*
++       * We require lowmem mappings for the descriptors because
++       * otherwise virt_to_phys will give us bogus addresses in the
++       * virtqueue.
++       */
++      gfp &= ~(__GFP_HIGHMEM | __GFP_HIGH);
++
+       desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
+       if (!desc)
+               return -ENOMEM;
diff --git a/queue-3.0/x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch b/queue-3.0/x86-8042-enable-a20-using-kbc-to-fix-s3-resume-on-some-msi-laptops.patch
new file mode 100644 (file)
index 0000000..d736e91
--- /dev/null
@@ -0,0 +1,55 @@
+From ad68652412276f68ad4fe3e1ecf5ee6880876783 Mon Sep 17 00:00:00 2001
+From: Ondrej Zary <linux@rainbow-software.org>
+Date: Tue, 11 Dec 2012 22:18:05 +0100
+Subject: x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops
+
+From: Ondrej Zary <linux@rainbow-software.org>
+
+commit ad68652412276f68ad4fe3e1ecf5ee6880876783 upstream.
+
+Some MSI laptop BIOSes are broken - INT 15h code uses port 92h to enable A20
+line but resume code assumes that KBC was used.
+The laptop will not resume from S3 otherwise but powers off after a while
+and then powers on again stuck with a blank screen.
+
+Fix it by enabling A20 using KBC in i8042_platform_init for x86.
+
+Fixes https://bugzilla.kernel.org/show_bug.cgi?id=12878
+
+Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
+Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
+Cc: Rafael J. Wysocki <rjw@sisk.pl>
+Link: http://lkml.kernel.org/r/201212112218.06551.linux@rainbow-software.org
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/serio/i8042-x86ia64io.h |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/input/serio/i8042-x86ia64io.h
++++ b/drivers/input/serio/i8042-x86ia64io.h
+@@ -900,6 +900,7 @@ static int __init i8042_platform_init(vo
+       int retval;
+ #ifdef CONFIG_X86
++      u8 a20_on = 0xdf;
+       /* Just return if pre-detection shows no i8042 controller exist */
+       if (!x86_platform.i8042_detect())
+               return -ENODEV;
+@@ -939,6 +940,14 @@ static int __init i8042_platform_init(vo
+       if (dmi_check_system(i8042_dmi_dritek_table))
+               i8042_dritek = true;
++
++      /*
++       * A20 was already enabled during early kernel init. But some buggy
++       * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
++       * resume from S3. So we do it here and hope that nothing breaks.
++       */
++      i8042_command(&a20_on, 0x10d1);
++      i8042_command(NULL, 0x00ff);    /* Null command for SMM firmware */
+ #endif /* CONFIG_X86 */
+       return retval;