--- /dev/null
+From d306ebc28649b89877a22158fe0076f06cc46f60 Mon Sep 17 00:00:00 2001
+From: Pallipadi, Venkatesh <venkatesh.pallipadi@intel.com>
+Date: Wed, 10 Feb 2010 10:35:31 -0800
+Subject: ACPI: Be in TS_POLLING state during mwait based C-state entry
+
+From: Pallipadi, Venkatesh <venkatesh.pallipadi@intel.com>
+
+commit d306ebc28649b89877a22158fe0076f06cc46f60 upstream.
+
+ACPI deep C-state entry had a long standing bug/missing feature, wherein we were sending
+resched IPIs when an idle CPU is in mwait based deep C-state. Only mwait based C1 was using
+the write to the monitored address to wake up mwait'ing CPU.
+
+This patch changes the code to retain TS_POLLING bit if we are entering an mwait based
+deep C-state.
+
+The patch has been verified to reduce the number of resched IPIs in general and also
+improves the performance/power on workloads with low system utilization (i.e., when mwait based
+deep C-states are being used).
+
+Fixes "netperf ~50% regression with 2.6.33-rc1, bisect to 1b9508f"
+http://marc.info/?l=linux-kernel&m=126441481427331&w=4
+
+Reported-by: Lin Ming <ming.m.lin@intel.com>
+Tested-by: Alex Shi <alex.shi@intel.com>
+Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/acpi/processor_idle.c | 28 ++++++++++++++++------------
+ 1 file changed, 16 insertions(+), 12 deletions(-)
+
+--- a/drivers/acpi/processor_idle.c
++++ b/drivers/acpi/processor_idle.c
+@@ -888,12 +888,14 @@ static int acpi_idle_enter_simple(struct
+ return(acpi_idle_enter_c1(dev, state));
+
+ local_irq_disable();
+- current_thread_info()->status &= ~TS_POLLING;
+- /*
+- * TS_POLLING-cleared state must be visible before we test
+- * NEED_RESCHED:
+- */
+- smp_mb();
++ if (cx->entry_method != ACPI_CSTATE_FFH) {
++ current_thread_info()->status &= ~TS_POLLING;
++ /*
++ * TS_POLLING-cleared state must be visible before we test
++ * NEED_RESCHED:
++ */
++ smp_mb();
++ }
+
+ if (unlikely(need_resched())) {
+ current_thread_info()->status |= TS_POLLING;
+@@ -973,12 +975,14 @@ static int acpi_idle_enter_bm(struct cpu
+ }
+
+ local_irq_disable();
+- current_thread_info()->status &= ~TS_POLLING;
+- /*
+- * TS_POLLING-cleared state must be visible before we test
+- * NEED_RESCHED:
+- */
+- smp_mb();
++ if (cx->entry_method != ACPI_CSTATE_FFH) {
++ current_thread_info()->status &= ~TS_POLLING;
++ /*
++ * TS_POLLING-cleared state must be visible before we test
++ * NEED_RESCHED:
++ */
++ smp_mb();
++ }
+
+ if (unlikely(need_resched())) {
+ current_thread_info()->status |= TS_POLLING;
--- /dev/null
+From 49bf83a45fc677db1ed44d0e072e6aaeabe4e124 Mon Sep 17 00:00:00 2001
+From: Len Brown <len.brown@intel.com>
+Date: Tue, 16 Feb 2010 03:45:45 -0500
+Subject: ACPI: fix "acpi=ht" boot option
+
+From: Len Brown <len.brown@intel.com>
+
+commit 49bf83a45fc677db1ed44d0e072e6aaeabe4e124 upstream.
+
+We broke "acpi=ht" in 2.6.32 by disabling MADT parsing
+for acpi=disabled. e5b8fc6ac158f65598f58dba2c0d52ba3b412f52
+This also broke systems which invoked acpi=ht via DMI blacklist.
+
+acpi=ht is a really ugly hack,
+but restore it for those that still use it.
+
+http://bugzilla.kernel.org/show_bug.cgi?id=14886
+
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/ia64/include/asm/acpi.h | 1 +
+ drivers/acpi/tables.c | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+--- a/arch/ia64/include/asm/acpi.h
++++ b/arch/ia64/include/asm/acpi.h
+@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned
+ #define acpi_noirq 0 /* ACPI always enabled on IA64 */
+ #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
+ #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */
++#define acpi_ht 0 /* no HT-only mode on IA64 */
+ #endif
+ #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
+ static inline void disable_acpi(void) { }
+--- a/drivers/acpi/tables.c
++++ b/drivers/acpi/tables.c
+@@ -213,7 +213,7 @@ acpi_table_parse_entries(char *id,
+ unsigned long table_end;
+ acpi_size tbl_size;
+
+- if (acpi_disabled)
++ if (acpi_disabled && !acpi_ht)
+ return -ENODEV;
+
+ if (!handler)
+@@ -280,7 +280,7 @@ int __init acpi_table_parse(char *id, ac
+ struct acpi_table_header *table = NULL;
+ acpi_size tbl_size;
+
+- if (acpi_disabled)
++ if (acpi_disabled && !acpi_ht)
+ return -ENODEV;
+
+ if (!handler)
--- /dev/null
+From 1379d2fef0ec07c7027a5e89036025ce761470c8 Mon Sep 17 00:00:00 2001
+From: Zhang Rui <rui.zhang@intel.com>
+Date: Tue, 16 Feb 2010 04:16:55 -0500
+Subject: ACPI, i915: blacklist Clevo M5x0N bad_lid state
+
+From: Zhang Rui <rui.zhang@intel.com>
+
+commit 1379d2fef0ec07c7027a5e89036025ce761470c8 upstream.
+
+Wrong Lid state reported.
+Need to blacklist this machine for LVDS detection.
+
+Signed-off-by: Zhang Rui <rui.zhang@intel.com>
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/i915/intel_lvds.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/gpu/drm/i915/intel_lvds.c
++++ b/drivers/gpu/drm/i915/intel_lvds.c
+@@ -629,6 +629,13 @@ static const struct dmi_system_id bad_li
+ DMI_MATCH(DMI_PRODUCT_NAME, "PC-81005"),
+ },
+ },
++ {
++ .ident = "Clevo M5x0N",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
++ DMI_MATCH(DMI_BOARD_NAME, "M5x0N"),
++ },
++ },
+ { }
+ };
+
--- /dev/null
+From 97c169d39b6846a564dc8d883832e7fef9bdb77d Mon Sep 17 00:00:00 2001
+From: Len Brown <len.brown@intel.com>
+Date: Tue, 16 Feb 2010 03:30:06 -0500
+Subject: ACPI: remove Asus P2B-DS from acpi=ht blacklist
+
+From: Len Brown <len.brown@intel.com>
+
+commit 97c169d39b6846a564dc8d883832e7fef9bdb77d upstream.
+
+We realized when we broke acpi=ht
+http://bugzilla.kernel.org/show_bug.cgi?id=14886
+that acpi=ht is not needed on this box
+and folks have been using acpi=force on it anyway.
+
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/acpi/boot.c | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/arch/x86/kernel/acpi/boot.c
++++ b/arch/x86/kernel/acpi/boot.c
+@@ -1348,14 +1348,6 @@ static struct dmi_system_id __initdata a
+ },
+ {
+ .callback = force_acpi_ht,
+- .ident = "ASUS P2B-DS",
+- .matches = {
+- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+- DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
+- },
+- },
+- {
+- .callback = force_acpi_ht,
+ .ident = "ASUS CUR-DLS",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
--- /dev/null
+From f09c256375c7cf1e112b8ef6306cdd313490d7c0 Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+Date: Tue, 2 Feb 2010 15:34:50 +0100
+Subject: airo: fix setting zero length WEP key
+
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit f09c256375c7cf1e112b8ef6306cdd313490d7c0 upstream.
+
+Patch prevents call set_wep_key() with zero key length. That fix long
+standing regression since commit c0380693520b1a1e4f756799a0edc379378b462a
+"airo: clean up WEP key operations". Additionally print call trace when
+someone will try to use improper parameters, and remove key.len = 0
+assignment, because it is in not possible code path.
+
+Reported-by: Chris Siebenmann <cks-rhbugzilla@cs.toronto.edu>
+Bisected-by: Chris Siebenmann <cks-rhbugzilla@cs.toronto.edu>
+Tested-by: Chris Siebenmann <cks@cs.toronto.edu>
+Cc: Dan Williams <dcbw@redhat.com>
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/wireless/airo.c | 34 ++++++++++++++++++----------------
+ 1 file changed, 18 insertions(+), 16 deletions(-)
+
+--- a/drivers/net/wireless/airo.c
++++ b/drivers/net/wireless/airo.c
+@@ -5254,11 +5254,7 @@ static int set_wep_key(struct airo_info
+ WepKeyRid wkr;
+ int rc;
+
+- if (keylen == 0) {
+- airo_print_err(ai->dev->name, "%s: key length to set was zero",
+- __func__);
+- return -1;
+- }
++ WARN_ON(keylen == 0);
+
+ memset(&wkr, 0, sizeof(wkr));
+ wkr.len = cpu_to_le16(sizeof(wkr));
+@@ -6404,11 +6400,7 @@ static int airo_set_encode(struct net_de
+ if (dwrq->length > MIN_KEY_SIZE)
+ key.len = MAX_KEY_SIZE;
+ else
+- if (dwrq->length > 0)
+- key.len = MIN_KEY_SIZE;
+- else
+- /* Disable the key */
+- key.len = 0;
++ key.len = MIN_KEY_SIZE;
+ /* Check if the key is not marked as invalid */
+ if(!(dwrq->flags & IW_ENCODE_NOKEY)) {
+ /* Cleanup */
+@@ -6589,12 +6581,22 @@ static int airo_set_encodeext(struct net
+ default:
+ return -EINVAL;
+ }
+- /* Send the key to the card */
+- rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
+- if (rc < 0) {
+- airo_print_err(local->dev->name, "failed to set WEP key"
+- " at index %d: %d.", idx, rc);
+- return rc;
++ if (key.len == 0) {
++ rc = set_wep_tx_idx(local, idx, perm, 1);
++ if (rc < 0) {
++ airo_print_err(local->dev->name,
++ "failed to set WEP transmit index to %d: %d.",
++ idx, rc);
++ return rc;
++ }
++ } else {
++ rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
++ if (rc < 0) {
++ airo_print_err(local->dev->name,
++ "failed to set WEP key at index %d: %d.",
++ idx, rc);
++ return rc;
++ }
+ }
+ }
+
--- /dev/null
+From 9db630b48a99adb4156e205b812fba8959644280 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@redhat.com>
+Date: Thu, 3 Dec 2009 15:08:10 +1000
+Subject: HID: add multi-input quirk for NextWindow Touchscreen.
+
+From: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 9db630b48a99adb4156e205b812fba8959644280 upstream.
+
+These touchscreens are mounted onto HP TouchSmart and the Dell Studio One
+19. Without a quirk they report a wrong button set and the x/y coordinates
+through ABS_Z/ABS_RX, confusing the higher levels (most notably X.Org's
+evdev driver).
+
+Device id 0x003 covers models 1900, 2150, and 2700 [1] though testing could
+only be performed on a model 1900.
+
+[1] http://www.nextwindow.com/nextwindow_support/latest_tech_info.html
+
+Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Cc: maximilian attems <max@stro.at>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-ids.h | 3 +++
+ drivers/hid/usbhid/hid-quirks.c | 1 +
+ 2 files changed, 4 insertions(+)
+
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -349,6 +349,9 @@
+ #define USB_VENDOR_ID_NEC 0x073e
+ #define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301
+
++#define USB_VENDOR_ID_NEXTWINDOW 0x1926
++#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
++
+ #define USB_VENDOR_ID_NTRIG 0x1b96
+ #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN 0x0001
+
+--- a/drivers/hid/usbhid/hid-quirks.c
++++ b/drivers/hid/usbhid/hid-quirks.c
+@@ -37,6 +37,7 @@ static const struct hid_blacklist {
+ { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
+ { USB_VENDOR_ID_NATSU, USB_DEVICE_ID_NATSU_GAMEPAD, HID_QUIRK_BADPAD },
+ { USB_VENDOR_ID_NEC, USB_DEVICE_ID_NEC_USB_GAME_PAD, HID_QUIRK_BADPAD },
++ { USB_VENDOR_ID_NEXTWINDOW, USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN, HID_QUIRK_MULTI_INPUT},
+ { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
+ { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
+
--- /dev/null
+From 4bb9508bbbb06f10bc3e249dd34375b4a4d6bfc0 Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Wed, 23 Dec 2009 14:13:46 +0100
+Subject: HID: remove TENX iBuddy from blacklist
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit 4bb9508bbbb06f10bc3e249dd34375b4a4d6bfc0 upstream.
+
+There were multiple reports which indicate that vendor messed up horribly
+and the same VID/PID combination is used for completely different devices,
+some of them requiring the blacklist entry and other not.
+
+Remove the blacklist entry for this combination of VID/PID completely, and let
+the user decide and unbind the driver via sysfs eventually, if needed. Proper
+fix would be fixing the vendor.
+
+References:
+
+http://lkml.org/lkml/2009/2/10/434
+http://bugzilla.kernel.org/show_bug.cgi?id=13411
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-core.c | 2 --
+ drivers/hid/hid-ids.h | 4 ----
+ 2 files changed, 6 deletions(-)
+
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1658,8 +1658,6 @@ static const struct hid_device_id hid_ig
+ { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
+- { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY1) },
+- { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY2) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -392,10 +392,6 @@
+ #define USB_VENDOR_ID_SUNPLUS 0x04fc
+ #define USB_DEVICE_ID_SUNPLUS_WDESKTOP 0x05d8
+
+-#define USB_VENDOR_ID_TENX 0x1130
+-#define USB_DEVICE_ID_TENX_IBUDDY1 0x0001
+-#define USB_DEVICE_ID_TENX_IBUDDY2 0x0002
+-
+ #define USB_VENDOR_ID_THRUSTMASTER 0x044f
+
+ #define USB_VENDOR_ID_TOPMAX 0x0663
--- /dev/null
+From 858155fbcc0cd713f6382c527bb1c3abc0ed6d00 Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oliver@neukum.org>
+Date: Fri, 12 Feb 2010 13:02:28 +0100
+Subject: HID: usbhid: introduce timeout for stuck ctrl/out URBs
+
+From: Oliver Neukum <oliver@neukum.org>
+
+commit 858155fbcc0cd713f6382c527bb1c3abc0ed6d00 upstream.
+
+Some devices do not react to a control request (seen on APC UPS's) resulting in
+a slow stream of messages, "generic-usb ... control queue full". Therefore
+request needs a timeout.
+
+Signed-off-by: Oliver Neukum <oliver@neukum.org>
+Signed-off-by: David Fries <david@fries.net>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/usbhid/hid-core.c | 28 ++++++++++++++++++++++++++--
+ drivers/hid/usbhid/usbhid.h | 2 ++
+ 2 files changed, 28 insertions(+), 2 deletions(-)
+
+--- a/drivers/hid/usbhid/hid-core.c
++++ b/drivers/hid/usbhid/hid-core.c
+@@ -318,6 +318,7 @@ static int hid_submit_out(struct hid_dev
+ err_hid("usb_submit_urb(out) failed");
+ return -1;
+ }
++ usbhid->last_out = jiffies;
+ } else {
+ /*
+ * queue work to wake up the device.
+@@ -379,6 +380,7 @@ static int hid_submit_ctrl(struct hid_de
+ err_hid("usb_submit_urb(ctrl) failed");
+ return -1;
+ }
++ usbhid->last_ctrl = jiffies;
+ } else {
+ /*
+ * queue work to wake up the device.
+@@ -514,9 +516,20 @@ static void __usbhid_submit_report(struc
+ usbhid->out[usbhid->outhead].report = report;
+ usbhid->outhead = head;
+
+- if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl))
++ if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl)) {
+ if (hid_submit_out(hid))
+ clear_bit(HID_OUT_RUNNING, &usbhid->iofl);
++ } else {
++ /*
++ * the queue is known to run
++ * but an earlier request may be stuck
++ * we may need to time out
++ * no race because this is called under
++ * spinlock
++ */
++ if (time_after(jiffies, usbhid->last_out + HZ * 5))
++ usb_unlink_urb(usbhid->urbout);
++ }
+ return;
+ }
+
+@@ -537,9 +550,20 @@ static void __usbhid_submit_report(struc
+ usbhid->ctrl[usbhid->ctrlhead].dir = dir;
+ usbhid->ctrlhead = head;
+
+- if (!test_and_set_bit(HID_CTRL_RUNNING, &usbhid->iofl))
++ if (!test_and_set_bit(HID_CTRL_RUNNING, &usbhid->iofl)) {
+ if (hid_submit_ctrl(hid))
+ clear_bit(HID_CTRL_RUNNING, &usbhid->iofl);
++ } else {
++ /*
++ * the queue is known to run
++ * but an earlier request may be stuck
++ * we may need to time out
++ * no race because this is called under
++ * spinlock
++ */
++ if (time_after(jiffies, usbhid->last_ctrl + HZ * 5))
++ usb_unlink_urb(usbhid->urbctrl);
++ }
+ }
+
+ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir)
+--- a/drivers/hid/usbhid/usbhid.h
++++ b/drivers/hid/usbhid/usbhid.h
+@@ -80,12 +80,14 @@ struct usbhid_device {
+ unsigned char ctrlhead, ctrltail; /* Control fifo head & tail */
+ char *ctrlbuf; /* Control buffer */
+ dma_addr_t ctrlbuf_dma; /* Control buffer dma */
++ unsigned long last_ctrl; /* record of last output for timeouts */
+
+ struct urb *urbout; /* Output URB */
+ struct hid_output_fifo out[HID_CONTROL_FIFO_SIZE]; /* Output pipe fifo */
+ unsigned char outhead, outtail; /* Output pipe fifo head & tail */
+ char *outbuf; /* Output buffer */
+ dma_addr_t outbuf_dma; /* Output buffer dma */
++ unsigned long last_out; /* record of last output for timeouts */
+
+ spinlock_t lock; /* fifo spinlock */
+ unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
--- /dev/null
+From d2e7276b6b5e4bc2148891a056d5862c5314342d Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Mon, 22 Feb 2010 12:44:19 -0800
+Subject: idr: fix a critical misallocation bug, take#2
+
+From: Tejun Heo <tj@kernel.org>
+
+commit d2e7276b6b5e4bc2148891a056d5862c5314342d upstream.
+
+This is retry of reverted 859ddf09743a8cc680af33f7259ccd0fd36bfe9d
+("idr: fix a critical misallocation bug") which contained two bugs.
+
+* pa[idp->layers] should be cleared even if it's not used by
+ sub_alloc() because it's used by mark idr_mark_full().
+
+* The original condition check also assigned pa[l] to p which the new
+ code didn't do thus leaving p pointing at the wrong layer.
+
+Both problems have been fixed and the idr code has received good amount
+testing using userland testing setup where simple bitmap allocator is
+run parallel to verify the result of idr allocation.
+
+The bug this patch fixes is caused by sub_alloc() optimization path
+bypassing out-of-room condition check and restarting allocation loop
+with starting value higher than maximum allowed value. For detailed
+description, please read commit message of 859ddf09.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Based-on-patch-from: Eric Paris <eparis@redhat.com>
+Reported-by: Eric Paris <eparis@redhat.com>
+Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
+Tested-by: Serge Hallyn <serue@us.ibm.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ lib/idr.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/lib/idr.c
++++ b/lib/idr.c
+@@ -156,10 +156,12 @@ static int sub_alloc(struct idr *idp, in
+ id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1;
+
+ /* if already at the top layer, we need to grow */
+- if (!(p = pa[l])) {
++ if (id >= 1 << (idp->layers * IDR_BITS)) {
+ *starting_id = id;
+ return IDR_NEED_TO_GROW;
+ }
++ p = pa[l];
++ BUG_ON(!p);
+
+ /* If we need to go up one layer, continue the
+ * loop; otherwise, restart from the top.
--- /dev/null
+From 3dc1de0bf23816ed557ac8addf680cd5ee57e805 Mon Sep 17 00:00:00 2001
+From: Zhu Yi <yi.zhu@intel.com>
+Date: Mon, 28 Dec 2009 16:57:15 +0800
+Subject: mac80211: quit addba_resp_timer if Tx BA session is torn down
+
+From: Zhu Yi <yi.zhu@intel.com>
+
+commit 3dc1de0bf23816ed557ac8addf680cd5ee57e805 upstream.
+
+Make addba_resp_timer aware the HT_AGG_STATE_REQ_STOP_BA_MSK mask
+so that when ___ieee80211_stop_tx_ba_session() is issued the timer
+will quit. Otherwise when suspend happens before the timer expired,
+the timer handler will be called immediately after resume and
+messes up driver status.
+
+Signed-off-by: Zhu Yi <yi.zhu@intel.com>
+Acked-by: Johannes Berg <johannes@sipsolutions.net>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ net/mac80211/agg-tx.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/mac80211/agg-tx.c
++++ b/net/mac80211/agg-tx.c
+@@ -177,7 +177,8 @@ static void sta_addba_resp_timer_expired
+
+ /* check if the TID waits for addBA response */
+ spin_lock_bh(&sta->lock);
+- if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
++ if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK |
++ HT_AGG_STATE_REQ_STOP_BA_MSK)) !=
+ HT_ADDBA_REQUESTED_MSK) {
+ spin_unlock_bh(&sta->lock);
+ *state = HT_AGG_STATE_IDLE;
--- /dev/null
+From d7384b28afb2bf2b7be835ddc8c852bdc5e0ce1c Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Wed, 16 Dec 2009 18:50:06 +0530
+Subject: [SCSI] mpt2sas: Delete volume before HBA detach.
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit d7384b28afb2bf2b7be835ddc8c852bdc5e0ce1c upstream.
+
+The driver hangs when doing `rmmod mpt2sas` if there are any
+IR volumes present.The hang is due the scsi midlayer trying to access the
+IR volumes after the driver releases controller resources. Perhaps when
+scsi_remove_host is called,the scsi mid layer is sending some request.
+This doesn't occur for bare drives becuase the driver is already reporting
+those drives deleted prior to calling mpt2sas_base_detach.
+To solve this issue, we need to delete the volumes as well.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
+Reviewed-by: Eric Moore <eric.moore@lsi.com>
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/mpt2sas/mpt2sas_scsih.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+@@ -5721,6 +5721,8 @@ _scsih_remove(struct pci_dev *pdev)
+ struct _sas_port *mpt2sas_port;
+ struct _sas_device *sas_device;
+ struct _sas_node *expander_sibling;
++ struct _raid_device *raid_device, *next;
++ struct MPT2SAS_TARGET *sas_target_priv_data;
+ struct workqueue_struct *wq;
+ unsigned long flags;
+
+@@ -5734,6 +5736,21 @@ _scsih_remove(struct pci_dev *pdev)
+ if (wq)
+ destroy_workqueue(wq);
+
++ /* release all the volumes */
++ list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list,
++ list) {
++ if (raid_device->starget) {
++ sas_target_priv_data =
++ raid_device->starget->hostdata;
++ sas_target_priv_data->deleted = 1;
++ scsi_remove_target(&raid_device->starget->dev);
++ }
++ printk(MPT2SAS_INFO_FMT "removing handle(0x%04x), wwid"
++ "(0x%016llx)\n", ioc->name, raid_device->handle,
++ (unsigned long long) raid_device->wwid);
++ _scsih_raid_device_remove(ioc, raid_device);
++ }
++
+ /* free ports attached to the sas_host */
+ retry_again:
+ list_for_each_entry(mpt2sas_port,
--- /dev/null
+From 0141450f66c3c12a3aaa869748caa64241885cdf Mon Sep 17 00:00:00 2001
+From: Wu Fengguang <fengguang.wu@intel.com>
+Date: Fri, 5 Mar 2010 13:42:03 -0800
+Subject: readahead: introduce FMODE_RANDOM for POSIX_FADV_RANDOM
+
+From: Wu Fengguang <fengguang.wu@intel.com>
+
+commit 0141450f66c3c12a3aaa869748caa64241885cdf upstream.
+
+This fixes inefficient page-by-page reads on POSIX_FADV_RANDOM.
+
+POSIX_FADV_RANDOM used to set ra_pages=0, which leads to poor performance:
+a 16K read will be carried out in 4 _sync_ 1-page reads.
+
+In other places, ra_pages==0 means
+- it's ramfs/tmpfs/hugetlbfs/sysfs/configfs
+- some IO error happened
+where multi-page read IO won't help or should be avoided.
+
+POSIX_FADV_RANDOM actually want a different semantics: to disable the
+*heuristic* readahead algorithm, and to use a dumb one which faithfully
+submit read IO for whatever application requests.
+
+So introduce a flag FMODE_RANDOM for POSIX_FADV_RANDOM.
+
+Note that the random hint is not likely to help random reads performance
+noticeably. And it may be too permissive on huge request size (its IO
+size is not limited by read_ahead_kb).
+
+In Quentin's report (http://lkml.org/lkml/2009/12/24/145), the overall
+(NFS read) performance of the application increased by 313%!
+
+Tested-by: Quentin Barnes <qbarnes+nfs@yahoo-inc.com>
+Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
+Cc: Nick Piggin <npiggin@suse.de>
+Cc: Andi Kleen <andi@firstfloor.org>
+Cc: Steven Whitehouse <swhiteho@redhat.com>
+Cc: David Howells <dhowells@redhat.com>
+Cc: Jonathan Corbet <corbet@lwn.net>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Christoph Hellwig <hch@infradead.org>
+Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
+Cc: Chuck Lever <chuck.lever@oracle.com>
+Cc: <qbarnes+nfs@yahoo-inc.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/linux/fs.h | 3 +++
+ mm/fadvise.c | 10 +++++++++-
+ mm/readahead.c | 6 ++++++
+ 3 files changed, 18 insertions(+), 1 deletion(-)
+
+--- a/include/linux/fs.h
++++ b/include/linux/fs.h
+@@ -87,6 +87,9 @@ struct inodes_stat_t {
+ */
+ #define FMODE_NOCMTIME ((__force fmode_t)2048)
+
++/* Expect random access pattern */
++#define FMODE_RANDOM ((__force fmode_t)4096)
++
+ /*
+ * The below are the various read and write types that we support. Some of
+ * them include behavioral modifiers that send information down to the
+--- a/mm/fadvise.c
++++ b/mm/fadvise.c
+@@ -77,12 +77,20 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, lof
+ switch (advice) {
+ case POSIX_FADV_NORMAL:
+ file->f_ra.ra_pages = bdi->ra_pages;
++ spin_lock(&file->f_lock);
++ file->f_mode &= ~FMODE_RANDOM;
++ spin_unlock(&file->f_lock);
+ break;
+ case POSIX_FADV_RANDOM:
+- file->f_ra.ra_pages = 0;
++ spin_lock(&file->f_lock);
++ file->f_mode |= FMODE_RANDOM;
++ spin_unlock(&file->f_lock);
+ break;
+ case POSIX_FADV_SEQUENTIAL:
+ file->f_ra.ra_pages = bdi->ra_pages * 2;
++ spin_lock(&file->f_lock);
++ file->f_mode &= ~FMODE_RANDOM;
++ spin_unlock(&file->f_lock);
+ break;
+ case POSIX_FADV_WILLNEED:
+ if (!mapping->a_ops->readpage) {
+--- a/mm/readahead.c
++++ b/mm/readahead.c
+@@ -501,6 +501,12 @@ void page_cache_sync_readahead(struct ad
+ if (!ra->ra_pages)
+ return;
+
++ /* be dumb */
++ if (filp->f_mode & FMODE_RANDOM) {
++ force_page_cache_readahead(mapping, filp, offset, req_size);
++ return;
++ }
++
+ /* do read-ahead */
+ ondemand_readahead(mapping, ra, filp, false, offset, req_size);
+ }
ahci-disable-fpdma-auto-activate-optimization-on-nvidia-ahci.patch
pci-hotplug-ibmphp-read-the-length-of-ebda-and-map-entire-ebda-region.patch
pci-hotplug-check-ioremap-return-value-in-ibmphp_ebda.c.patch
+acpi-remove-asus-p2b-ds-from-acpi-ht-blacklist.patch
+acpi-fix-acpi-ht-boot-option.patch
+thinkpad-acpi-wrong-thermal-attribute_group-removed-in-thermal_exit.patch
+acpi-i915-blacklist-clevo-m5x0n-bad_lid-state.patch
+acpi-be-in-ts_polling-state-during-mwait-based-c-state-entry.patch
+mpt2sas-delete-volume-before-hba-detach.patch
+slab-initialize-unused-alien-cache-entry-as-null-at-alloc_alien_cache.patch
+mac80211-quit-addba_resp_timer-if-tx-ba-session-is-torn-down.patch
+v4l-dvb-13991-gspca_mr973010a-fix-cif-type-1-cameras-not-streaming-on-uhci-controllers.patch
+vfs-take-f_lock-on-modifying-f_mode-after-open-time.patch
+readahead-introduce-fmode_random-for-posix_fadv_random.patch
+hid-remove-tenx-ibuddy-from-blacklist.patch
+hid-add-multi-input-quirk-for-nextwindow-touchscreen.patch
+hid-usbhid-introduce-timeout-for-stuck-ctrl-out-urbs.patch
+airo-fix-setting-zero-length-wep-key.patch
+idr-fix-a-critical-misallocation-bug-take-2.patch
+switch-proc-self-to-nd_set_link.patch
--- /dev/null
+From f3186a9c51eabe75b2780153ed7f07778d78b16e Mon Sep 17 00:00:00 2001
+From: Haicheng Li <haicheng.li@linux.intel.com>
+Date: Wed, 6 Jan 2010 15:25:23 +0800
+Subject: slab: initialize unused alien cache entry as NULL at alloc_alien_cache().
+
+From: Haicheng Li <haicheng.li@linux.intel.com>
+
+commit f3186a9c51eabe75b2780153ed7f07778d78b16e upstream.
+
+Comparing with existing code, it's a simpler way to use kzalloc_node()
+to ensure that each unused alien cache entry is NULL.
+
+CC: Eric Dumazet <eric.dumazet@gmail.com>
+Acked-by: Andi Kleen <ak@linux.intel.com>
+Acked-by: Christoph Lameter <cl@linux-foundation.org>
+Acked-by: Matt Mackall <mpm@selenic.com>
+Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com>
+Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/slab.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/mm/slab.c
++++ b/mm/slab.c
+@@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_
+
+ if (limit > 1)
+ limit = 12;
+- ac_ptr = kmalloc_node(memsize, gfp, node);
++ ac_ptr = kzalloc_node(memsize, gfp, node);
+ if (ac_ptr) {
+ for_each_node(i) {
+- if (i == node || !node_online(i)) {
+- ac_ptr[i] = NULL;
++ if (i == node || !node_online(i))
+ continue;
+- }
+ ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp);
+ if (!ac_ptr[i]) {
+ for (i--; i >= 0; i--)
--- /dev/null
+From 7fee4868be91e71a3ee8e57289ebf5e10a12297e Mon Sep 17 00:00:00 2001
+From: Al Viro <viro@zeniv.linux.org.uk>
+Date: Thu, 14 Jan 2010 01:03:28 -0500
+Subject: Switch proc/self to nd_set_link()
+
+From: Al Viro <viro@zeniv.linux.org.uk>
+
+commit 7fee4868be91e71a3ee8e57289ebf5e10a12297e upstream.
+
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/proc/base.c | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+--- a/fs/proc/base.c
++++ b/fs/proc/base.c
+@@ -2304,16 +2304,30 @@ static void *proc_self_follow_link(struc
+ {
+ struct pid_namespace *ns = dentry->d_sb->s_fs_info;
+ pid_t tgid = task_tgid_nr_ns(current, ns);
+- char tmp[PROC_NUMBUF];
+- if (!tgid)
+- return ERR_PTR(-ENOENT);
+- sprintf(tmp, "%d", task_tgid_nr_ns(current, ns));
+- return ERR_PTR(vfs_follow_link(nd,tmp));
++ char *name = ERR_PTR(-ENOENT);
++ if (tgid) {
++ name = __getname();
++ if (!name)
++ name = ERR_PTR(-ENOMEM);
++ else
++ sprintf(name, "%d", tgid);
++ }
++ nd_set_link(nd, name);
++ return NULL;
++}
++
++static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd,
++ void *cookie)
++{
++ char *s = nd_get_link(nd);
++ if (!IS_ERR(s))
++ __putname(s);
+ }
+
+ static const struct inode_operations proc_self_inode_operations = {
+ .readlink = proc_self_readlink,
+ .follow_link = proc_self_follow_link,
++ .put_link = proc_self_put_link,
+ };
+
+ /*
--- /dev/null
+From f04d5e012d73ea441bd39804ace39fd6d1ce5611 Mon Sep 17 00:00:00 2001
+From: Roel Kluin <roel.kluin@gmail.com>
+Date: Tue, 2 Feb 2010 14:37:58 -0800
+Subject: thinkpad-acpi: wrong thermal attribute_group removed in thermal_exit()
+
+From: Roel Kluin <roel.kluin@gmail.com>
+
+commit f04d5e012d73ea441bd39804ace39fd6d1ce5611 upstream.
+
+sysfs_remove_group() removed the wrong attribute_group for
+thermal_read_mode TPEC_8, ACPI_TMP07 and ACPI_UPDT
+
+Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
+Acked-by: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/platform/x86/thinkpad_acpi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/platform/x86/thinkpad_acpi.c
++++ b/drivers/platform/x86/thinkpad_acpi.c
+@@ -5736,7 +5736,7 @@ static void thermal_exit(void)
+ case TPACPI_THERMAL_ACPI_TMP07:
+ case TPACPI_THERMAL_ACPI_UPDT:
+ sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj,
+- &thermal_temp_input16_group);
++ &thermal_temp_input8_group);
+ break;
+ case TPACPI_THERMAL_NONE:
+ default:
--- /dev/null
+From 70136081fc67ea77d849f86fa323e5773c8e40ea Mon Sep 17 00:00:00 2001
+From: Theodore Kilgore <kilgota@auburn.edu>
+Date: Fri, 25 Dec 2009 05:15:10 -0300
+Subject: V4L/DVB (13991): gspca_mr973010a: Fix cif type 1 cameras not streaming on UHCI controllers
+
+From: Theodore Kilgore <kilgota@auburn.edu>
+
+commit 70136081fc67ea77d849f86fa323e5773c8e40ea upstream.
+
+If you read the mail to Oliver Neukum on the linux-usb list, then you know
+that I found a cure for the mysterious problem that the MR97310a CIF "type
+1" cameras have been freezing up and refusing to stream if hooked up to a
+machine with a UHCI controller.
+
+Namely, the cure is that if the camera is an mr97310a CIF type 1 camera, you
+have to send it 0xa0, 0x00. Somehow, this is a timing reset command, or
+such. It un-blocks whatever was previously stopping the CIF type 1 cameras
+from working on the UHCI-based machines.
+
+Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/video/gspca/mr97310a.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/media/video/gspca/mr97310a.c
++++ b/drivers/media/video/gspca/mr97310a.c
+@@ -530,6 +530,12 @@ static int start_cif_cam(struct gspca_de
+ {0x13, 0x00, {0x01}, 1},
+ {0, 0, {0}, 0}
+ };
++ /* Without this command the cam won't work with USB-UHCI */
++ gspca_dev->usb_buf[0] = 0x0a;
++ gspca_dev->usb_buf[1] = 0x00;
++ err_code = mr_write(gspca_dev, 2);
++ if (err_code < 0)
++ return err_code;
+ err_code = sensor_write_regs(gspca_dev, cif_sensor1_init_data,
+ ARRAY_SIZE(cif_sensor1_init_data));
+ }
--- /dev/null
+From 42e49608683ab25fbbbf9c40edb944601e543882 Mon Sep 17 00:00:00 2001
+From: Wu Fengguang <fengguang.wu@intel.com>
+Date: Fri, 5 Mar 2010 13:42:01 -0800
+Subject: vfs: take f_lock on modifying f_mode after open time
+
+From: Wu Fengguang <fengguang.wu@intel.com>
+
+commit 42e49608683ab25fbbbf9c40edb944601e543882 upstream.
+
+We'll introduce FMODE_RANDOM which will be runtime modified. So protect
+all runtime modification to f_mode with f_lock to avoid races.
+
+Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Christoph Hellwig <hch@infradead.org>
+Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
+Cc: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/file_table.c | 2 ++
+ fs/nfsd/nfs4state.c | 2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/fs/file_table.c
++++ b/fs/file_table.c
+@@ -420,7 +420,9 @@ retry:
+ continue;
+ if (!(f->f_mode & FMODE_WRITE))
+ continue;
++ spin_lock(&f->f_lock);
+ f->f_mode &= ~FMODE_WRITE;
++ spin_unlock(&f->f_lock);
+ if (file_check_writeable(f) != 0)
+ continue;
+ file_release_write(f);
+--- a/fs/nfsd/nfs4state.c
++++ b/fs/nfsd/nfs4state.c
+@@ -2002,7 +2002,9 @@ nfs4_file_downgrade(struct file *filp, u
+ {
+ if (share_access & NFS4_SHARE_ACCESS_WRITE) {
+ drop_file_write_access(filp);
++ spin_lock(&filp->f_lock);
+ filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE;
++ spin_unlock(&filp->f_lock);
+ }
+ }
+