]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.39 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 14 Jun 2011 22:00:30 +0000 (15:00 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 14 Jun 2011 22:00:30 +0000 (15:00 -0700)
17 files changed:
queue-2.6.39/alsa-hda-fix-quirk-for-dell-inspiron-910.patch [new file with mode: 0644]
queue-2.6.39/apparmor-fix-sleep-in-invalid-context-from-task_setrlimit.patch [new file with mode: 0644]
queue-2.6.39/asoc-ad1836-fix-setting-the-pcm-format.patch [new file with mode: 0644]
queue-2.6.39/asoc-fix-wm8962-headphone-volume-update-for-use-of-advanced.patch [new file with mode: 0644]
queue-2.6.39/asoc-samsung-fix-the-incorrect-referencing-of-i2scon.patch [new file with mode: 0644]
queue-2.6.39/asoc-snd_soc_new_-mixer-mux-pga-make-sure-to-use-right.patch [new file with mode: 0644]
queue-2.6.39/asoc-wm8804-does-not-support-sample-rates-below-32khz.patch [new file with mode: 0644]
queue-2.6.39/cifs-don-t-allow-cifs_reconnect-to-exit-with-null-socket.patch [new file with mode: 0644]
queue-2.6.39/drm-radeon-kms-do-bounds-checking-for-3d_load_vbpntr-and.patch [new file with mode: 0644]
queue-2.6.39/oprofile-dcookies-fix-possible-circular-locking-dependency.patch [new file with mode: 0644]
queue-2.6.39/oprofile-fix-locking-dependency-in-sync_start.patch [new file with mode: 0644]
queue-2.6.39/oprofile-free-potentially-owned-tasks-in-case-of-errors.patch [new file with mode: 0644]
queue-2.6.39/series
queue-2.6.39/usb-xhci-fix-interval-calculation-for-fs-isoc-endpoints.patch [new file with mode: 0644]
queue-2.6.39/xhci-add-defines-for-hardcoded-slot-states.patch [new file with mode: 0644]
queue-2.6.39/xhci-disable-msi-for-some-fresco-logic-hosts.patch [new file with mode: 0644]
queue-2.6.39/xhci-do-not-issue-device-reset-when-device-is-not-setup.patch [new file with mode: 0644]

diff --git a/queue-2.6.39/alsa-hda-fix-quirk-for-dell-inspiron-910.patch b/queue-2.6.39/alsa-hda-fix-quirk-for-dell-inspiron-910.patch
new file mode 100644 (file)
index 0000000..78d0a51
--- /dev/null
@@ -0,0 +1,36 @@
+From 0a1896b27b030529ec770aefd790544a1bdb7d5a Mon Sep 17 00:00:00 2001
+From: Daniel T Chen <crimsun@ubuntu.com>
+Date: Mon, 6 Jun 2011 18:55:34 -0400
+Subject: ALSA: hda: Fix quirk for Dell Inspiron 910
+
+From: Daniel T Chen <crimsun@ubuntu.com>
+
+commit 0a1896b27b030529ec770aefd790544a1bdb7d5a upstream.
+
+BugLink: https://launchpad.net/bugs/792712
+
+The original reporter states that sound from the internal speakers is
+inaudible until using the model=auto quirk. This symptom is due to an
+existing quirk mask for 0x102802b* that uses the model=dell quirk. To
+limit the possible regressions, leave the existing quirk mask but add
+a higher priority specific mask for the reporter's PCI SSID.
+
+Reported-and-tested-by: rodni hipp
+Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -13804,6 +13804,7 @@ static struct snd_pci_quirk alc268_cfg_t
+       SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
+                                               ALC268_ACER_ASPIRE_ONE),
+       SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
++      SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron 910", ALC268_AUTO),
+       SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
+                       "Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
+       /* almost compatible with toshiba but with optional digital outs;
diff --git a/queue-2.6.39/apparmor-fix-sleep-in-invalid-context-from-task_setrlimit.patch b/queue-2.6.39/apparmor-fix-sleep-in-invalid-context-from-task_setrlimit.patch
new file mode 100644 (file)
index 0000000..efba85c
--- /dev/null
@@ -0,0 +1,56 @@
+From 1780f2d3839a0d3eb85ee014a708f9e2c8f8ba0e Mon Sep 17 00:00:00 2001
+From: John Johansen <john.johansen@canonical.com>
+Date: Wed, 8 Jun 2011 15:07:47 -0700
+Subject: AppArmor: Fix sleep in invalid context from task_setrlimit
+
+From: John Johansen <john.johansen@canonical.com>
+
+commit 1780f2d3839a0d3eb85ee014a708f9e2c8f8ba0e upstream.
+
+Affected kernels 2.6.36 - 3.0
+
+AppArmor may do a GFP_KERNEL memory allocation with task_lock(tsk->group_leader);
+held when called from security_task_setrlimit.  This will only occur when the
+task's current policy has been replaced, and the task's creds have not been
+updated before entering the LSM security_task_setrlimit() hook.
+
+BUG: sleeping function called from invalid context at mm/slub.c:847
+ in_atomic(): 1, irqs_disabled(): 0, pid: 1583, name: cupsd
+ 2 locks held by cupsd/1583:
+  #0:  (tasklist_lock){.+.+.+}, at: [<ffffffff8104dafa>] do_prlimit+0x61/0x189
+  #1:  (&(&p->alloc_lock)->rlock){+.+.+.}, at: [<ffffffff8104db2d>]
+do_prlimit+0x94/0x189
+ Pid: 1583, comm: cupsd Not tainted 3.0.0-rc2-git1 #7
+ Call Trace:
+  [<ffffffff8102ebf2>] __might_sleep+0x10d/0x112
+  [<ffffffff810e6f46>] slab_pre_alloc_hook.isra.49+0x2d/0x33
+  [<ffffffff810e7bc4>] kmem_cache_alloc+0x22/0x132
+  [<ffffffff8105b6e6>] prepare_creds+0x35/0xe4
+  [<ffffffff811c0675>] aa_replace_current_profile+0x35/0xb2
+  [<ffffffff811c4d2d>] aa_current_profile+0x45/0x4c
+  [<ffffffff811c4d4d>] apparmor_task_setrlimit+0x19/0x3a
+  [<ffffffff811beaa5>] security_task_setrlimit+0x11/0x13
+  [<ffffffff8104db6b>] do_prlimit+0xd2/0x189
+  [<ffffffff8104dea9>] sys_setrlimit+0x3b/0x48
+  [<ffffffff814062bb>] system_call_fastpath+0x16/0x1b
+
+Signed-off-by: John Johansen <john.johansen@canonical.com>
+Reported-by: Miles Lane <miles.lane@gmail.com>
+Signed-off-by: James Morris <jmorris@namei.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ security/apparmor/lsm.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/security/apparmor/lsm.c
++++ b/security/apparmor/lsm.c
+@@ -612,7 +612,7 @@ static int apparmor_setprocattr(struct t
+ static int apparmor_task_setrlimit(struct task_struct *task,
+               unsigned int resource, struct rlimit *new_rlim)
+ {
+-      struct aa_profile *profile = aa_current_profile();
++      struct aa_profile *profile = __aa_current_profile();
+       int error = 0;
+       if (!unconfined(profile))
diff --git a/queue-2.6.39/asoc-ad1836-fix-setting-the-pcm-format.patch b/queue-2.6.39/asoc-ad1836-fix-setting-the-pcm-format.patch
new file mode 100644 (file)
index 0000000..894d942
--- /dev/null
@@ -0,0 +1,78 @@
+From 8ca695f273709a9d147826716a8dee3e0eb2407f Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Mon, 6 Jun 2011 13:38:35 +0200
+Subject: ASoC: AD1836: Fix setting the PCM format
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+commit 8ca695f273709a9d147826716a8dee3e0eb2407f upstream.
+
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Acked-by: Liam Girdwood <lrg@ti.com>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/soc/codecs/ad1836.c |   14 +++++++-------
+ sound/soc/codecs/ad1836.h |    6 ++++++
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+--- a/sound/soc/codecs/ad1836.c
++++ b/sound/soc/codecs/ad1836.c
+@@ -145,22 +145,22 @@ static int ad1836_hw_params(struct snd_p
+       /* bit size */
+       switch (params_format(params)) {
+       case SNDRV_PCM_FORMAT_S16_LE:
+-              word_len = 3;
++              word_len = AD1836_WORD_LEN_16;
+               break;
+       case SNDRV_PCM_FORMAT_S20_3LE:
+-              word_len = 1;
++              word_len = AD1836_WORD_LEN_20;
+               break;
+       case SNDRV_PCM_FORMAT_S24_LE:
+       case SNDRV_PCM_FORMAT_S32_LE:
+-              word_len = 0;
++              word_len = AD1836_WORD_LEN_24;
+               break;
+       }
+-      snd_soc_update_bits(codec, AD1836_DAC_CTRL1,
+-              AD1836_DAC_WORD_LEN_MASK, word_len);
++      snd_soc_update_bits(codec, AD1836_DAC_CTRL1, AD1836_DAC_WORD_LEN_MASK,
++              word_len << AD1836_DAC_WORD_LEN_OFFSET);
+-      snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
+-              AD1836_ADC_WORD_LEN_MASK, word_len);
++      snd_soc_update_bits(codec, AD1836_ADC_CTRL2, AD1836_ADC_WORD_LEN_MASK,
++              word_len << AD1836_ADC_WORD_OFFSET);
+       return 0;
+ }
+--- a/sound/soc/codecs/ad1836.h
++++ b/sound/soc/codecs/ad1836.h
+@@ -25,6 +25,7 @@
+ #define AD1836_DAC_SERFMT_PCK256       (0x4 << 5)
+ #define AD1836_DAC_SERFMT_PCK128       (0x5 << 5)
+ #define AD1836_DAC_WORD_LEN_MASK       0x18
++#define AD1836_DAC_WORD_LEN_OFFSET     3
+ #define AD1836_DAC_CTRL2               1
+ #define AD1836_DACL1_MUTE              0
+@@ -51,6 +52,7 @@
+ #define AD1836_ADCL2_MUTE             2
+ #define AD1836_ADCR2_MUTE             3
+ #define AD1836_ADC_WORD_LEN_MASK       0x30
++#define AD1836_ADC_WORD_OFFSET         5
+ #define AD1836_ADC_SERFMT_MASK               (7 << 6)
+ #define AD1836_ADC_SERFMT_PCK256       (0x4 << 6)
+ #define AD1836_ADC_SERFMT_PCK128       (0x5 << 6)
+@@ -60,4 +62,8 @@
+ #define AD1836_NUM_REGS                16
++#define AD1836_WORD_LEN_24 0x0
++#define AD1836_WORD_LEN_20 0x1
++#define AD1836_WORD_LEN_16 0x2
++
+ #endif
diff --git a/queue-2.6.39/asoc-fix-wm8962-headphone-volume-update-for-use-of-advanced.patch b/queue-2.6.39/asoc-fix-wm8962-headphone-volume-update-for-use-of-advanced.patch
new file mode 100644 (file)
index 0000000..8439962
--- /dev/null
@@ -0,0 +1,35 @@
+From 0f82bdf572fc6e42147151aa4d52542f7fc6d793 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Tue, 7 Jun 2011 23:42:04 +0100
+Subject: ASoC: Fix WM8962 headphone volume update for use of advanced
+ caches
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 0f82bdf572fc6e42147151aa4d52542f7fc6d793 upstream.
+
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Acked-by: Liam Girdwood <lrg@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/soc/codecs/wm8962.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/soc/codecs/wm8962.c
++++ b/sound/soc/codecs/wm8962.c
+@@ -1998,12 +1998,12 @@ static int wm8962_put_hp_sw(struct snd_k
+               return 0;
+       /* If the left PGA is enabled hit that VU bit... */
+-      if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTL_PGA_ENA)
++      if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTL_PGA_ENA)
+               return snd_soc_write(codec, WM8962_HPOUTL_VOLUME,
+                                    reg_cache[WM8962_HPOUTL_VOLUME]);
+       /* ...otherwise the right.  The VU is stereo. */
+-      if (reg_cache[WM8962_PWR_MGMT_2] & WM8962_HPOUTR_PGA_ENA)
++      if (snd_soc_read(codec, WM8962_PWR_MGMT_2) & WM8962_HPOUTR_PGA_ENA)
+               return snd_soc_write(codec, WM8962_HPOUTR_VOLUME,
+                                    reg_cache[WM8962_HPOUTR_VOLUME]);
diff --git a/queue-2.6.39/asoc-samsung-fix-the-incorrect-referencing-of-i2scon.patch b/queue-2.6.39/asoc-samsung-fix-the-incorrect-referencing-of-i2scon.patch
new file mode 100644 (file)
index 0000000..c43e98d
--- /dev/null
@@ -0,0 +1,44 @@
+From 33195500edf260e8c8809ab9dfc67f50e0ce031f Mon Sep 17 00:00:00 2001
+From: Sangbeom Kim <sbkim73@samsung.com>
+Date: Fri, 10 Jun 2011 10:36:54 +0900
+Subject: ASoC: SAMSUNG: Fix the incorrect referencing of I2SCON
+ register
+
+From: Sangbeom Kim <sbkim73@samsung.com>
+
+commit 33195500edf260e8c8809ab9dfc67f50e0ce031f upstream.
+
+If DMA active status should be checked, I2SCON register should be referenced.
+In this patch, Fix the incorrect referencing of I2SCON register.
+
+Reported-by : Lakkyung Jung <lakkyung.jung@samsung.com>
+Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
+Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
+Acked-by: Liam Girdwood <lrg@ti.com>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/soc/samsung/i2s.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/soc/samsung/i2s.c
++++ b/sound/soc/samsung/i2s.c
+@@ -191,7 +191,7 @@ static inline bool tx_active(struct i2s_
+       if (!i2s)
+               return false;
+-      active = readl(i2s->addr + I2SMOD);
++      active = readl(i2s->addr + I2SCON);
+       if (is_secondary(i2s))
+               active &= CON_TXSDMA_ACTIVE;
+@@ -223,7 +223,7 @@ static inline bool rx_active(struct i2s_
+       if (!i2s)
+               return false;
+-      active = readl(i2s->addr + I2SMOD) & CON_RXDMA_ACTIVE;
++      active = readl(i2s->addr + I2SCON) & CON_RXDMA_ACTIVE;
+       return active ? true : false;
+ }
diff --git a/queue-2.6.39/asoc-snd_soc_new_-mixer-mux-pga-make-sure-to-use-right.patch b/queue-2.6.39/asoc-snd_soc_new_-mixer-mux-pga-make-sure-to-use-right.patch
new file mode 100644 (file)
index 0000000..83208a9
--- /dev/null
@@ -0,0 +1,85 @@
+From 4b80b8c2eee5282dab57f094fd3893c0c09f750c Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Thu, 9 Jun 2011 13:22:36 +0200
+Subject: ASoC: snd_soc_new_{mixer,mux,pga} make sure to use right
+ DAPM context
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+commit 4b80b8c2eee5282dab57f094fd3893c0c09f750c upstream.
+
+Currently it is possible that snd_soc_new_{mixer,mux,pga} is called with a
+DAPM context not matching the widgets context. This can lead to a wrong
+prefix_len calculation, which will result in undefined behaviour. To avoid
+this always use the DAPM context from the widget itself.
+
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Acked-by: Liam Girdwood <lrg@ti.com>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/soc/soc-dapm.c |   17 ++++++++---------
+ 1 file changed, 8 insertions(+), 9 deletions(-)
+
+--- a/sound/soc/soc-dapm.c
++++ b/sound/soc/soc-dapm.c
+@@ -362,9 +362,9 @@ static int dapm_update_bits(struct snd_s
+ }
+ /* create new dapm mixer control */
+-static int dapm_new_mixer(struct snd_soc_dapm_context *dapm,
+-      struct snd_soc_dapm_widget *w)
++static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
+ {
++      struct snd_soc_dapm_context *dapm = w->dapm;
+       int i, ret = 0;
+       size_t name_len, prefix_len;
+       struct snd_soc_dapm_path *path;
+@@ -443,9 +443,9 @@ static int dapm_new_mixer(struct snd_soc
+ }
+ /* create new dapm mux control */
+-static int dapm_new_mux(struct snd_soc_dapm_context *dapm,
+-      struct snd_soc_dapm_widget *w)
++static int dapm_new_mux(struct snd_soc_dapm_widget *w)
+ {
++      struct snd_soc_dapm_context *dapm = w->dapm;
+       struct snd_soc_dapm_path *path = NULL;
+       struct snd_kcontrol *kcontrol;
+       struct snd_card *card = dapm->card->snd_card;
+@@ -490,8 +490,7 @@ err:
+ }
+ /* create new dapm volume control */
+-static int dapm_new_pga(struct snd_soc_dapm_context *dapm,
+-      struct snd_soc_dapm_widget *w)
++static int dapm_new_pga(struct snd_soc_dapm_widget *w)
+ {
+       if (w->num_kcontrols)
+               dev_err(w->dapm->dev,
+@@ -1735,13 +1734,13 @@ int snd_soc_dapm_new_widgets(struct snd_
+               case snd_soc_dapm_mixer:
+               case snd_soc_dapm_mixer_named_ctl:
+                       w->power_check = dapm_generic_check_power;
+-                      dapm_new_mixer(dapm, w);
++                      dapm_new_mixer(w);
+                       break;
+               case snd_soc_dapm_mux:
+               case snd_soc_dapm_virt_mux:
+               case snd_soc_dapm_value_mux:
+                       w->power_check = dapm_generic_check_power;
+-                      dapm_new_mux(dapm, w);
++                      dapm_new_mux(w);
+                       break;
+               case snd_soc_dapm_adc:
+               case snd_soc_dapm_aif_out:
+@@ -1754,7 +1753,7 @@ int snd_soc_dapm_new_widgets(struct snd_
+               case snd_soc_dapm_pga:
+               case snd_soc_dapm_out_drv:
+                       w->power_check = dapm_generic_check_power;
+-                      dapm_new_pga(dapm, w);
++                      dapm_new_pga(w);
+                       break;
+               case snd_soc_dapm_input:
+               case snd_soc_dapm_output:
diff --git a/queue-2.6.39/asoc-wm8804-does-not-support-sample-rates-below-32khz.patch b/queue-2.6.39/asoc-wm8804-does-not-support-sample-rates-below-32khz.patch
new file mode 100644 (file)
index 0000000..082a07f
--- /dev/null
@@ -0,0 +1,48 @@
+From 3115ae174620eeab4b16f52c8d0a9a35d2717e3c Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Wed, 8 Jun 2011 18:07:49 +0100
+Subject: ASoC: WM8804 does not support sample rates below 32kHz
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 3115ae174620eeab4b16f52c8d0a9a35d2717e3c upstream.
+
+Reported-by: Kieran O'Leary <Kieran.O'Leary@wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Acked-by: Liam Girdwood <lrg@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/soc/codecs/wm8804.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/sound/soc/codecs/wm8804.c
++++ b/sound/soc/codecs/wm8804.c
+@@ -680,20 +680,25 @@ static struct snd_soc_dai_ops wm8804_dai
+ #define WM8804_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
+                       SNDRV_PCM_FMTBIT_S24_LE)
++#define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
++                    SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \
++                    SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \
++                    SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000)
++
+ static struct snd_soc_dai_driver wm8804_dai = {
+       .name = "wm8804-spdif",
+       .playback = {
+               .stream_name = "Playback",
+               .channels_min = 2,
+               .channels_max = 2,
+-              .rates = SNDRV_PCM_RATE_8000_192000,
++              .rates = WM8804_RATES,
+               .formats = WM8804_FORMATS,
+       },
+       .capture = {
+               .stream_name = "Capture",
+               .channels_min = 2,
+               .channels_max = 2,
+-              .rates = SNDRV_PCM_RATE_8000_192000,
++              .rates = WM8804_RATES,
+               .formats = WM8804_FORMATS,
+       },
+       .ops = &wm8804_dai_ops,
diff --git a/queue-2.6.39/cifs-don-t-allow-cifs_reconnect-to-exit-with-null-socket.patch b/queue-2.6.39/cifs-don-t-allow-cifs_reconnect-to-exit-with-null-socket.patch
new file mode 100644 (file)
index 0000000..130ad53
--- /dev/null
@@ -0,0 +1,71 @@
+From 7fdbaa1b8daa1009b705985b903e3d2ebccad456 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@redhat.com>
+Date: Fri, 10 Jun 2011 16:14:57 -0400
+Subject: cifs: don't allow cifs_reconnect to exit with NULL socket
+ pointer
+
+From: Jeff Layton <jlayton@redhat.com>
+
+commit 7fdbaa1b8daa1009b705985b903e3d2ebccad456 upstream.
+
+It's possible for the following set of events to happen:
+
+cifsd calls cifs_reconnect which reconnects the socket. A userspace
+process then calls cifs_negotiate_protocol to handle the NEGOTIATE and
+gets a reply. But, while processing the reply, cifsd calls
+cifs_reconnect again.  Eventually the GlobalMid_Lock is dropped and the
+reply from the earlier NEGOTIATE completes and the tcpStatus is set to
+CifsGood. cifs_reconnect then goes through and closes the socket and sets the
+pointer to zero, but because the status is now CifsGood, the new socket
+is not created and cifs_reconnect exits with the socket pointer set to
+NULL.
+
+Fix this by only setting the tcpStatus to CifsGood if the tcpStatus is
+CifsNeedNegotiate, and by making sure that generic_ip_connect is always
+called at least once in cifs_reconnect.
+
+Note that this is not a perfect fix for this issue. It's still possible
+that the NEGOTIATE reply is handled after the socket has been closed and
+reconnected. In that case, the socket state will look correct but it no
+NEGOTIATE was performed on it be for the wrong socket. In that situation
+though the server should just shut down the socket on the next attempted
+send, rather than causing the oops that occurs today.
+
+Reported-and-Tested-by: Ben Greear <greearb@candelatech.com>
+Signed-off-by: Jeff Layton <jlayton@redhat.com>
+Signed-off-by: Steve French <sfrench@us.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/cifs/connect.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/fs/cifs/connect.c
++++ b/fs/cifs/connect.c
+@@ -199,7 +199,7 @@ cifs_reconnect(struct TCP_Server_Info *s
+       }
+       spin_unlock(&GlobalMid_Lock);
+-      while (server->tcpStatus == CifsNeedReconnect) {
++      do {
+               try_to_freeze();
+               /* we should try only the port we connected to before */
+@@ -214,7 +214,7 @@ cifs_reconnect(struct TCP_Server_Info *s
+                               server->tcpStatus = CifsNeedNegotiate;
+                       spin_unlock(&GlobalMid_Lock);
+               }
+-      }
++      } while (server->tcpStatus == CifsNeedReconnect);
+       return rc;
+ }
+@@ -3208,7 +3208,7 @@ int cifs_negotiate_protocol(unsigned int
+       }
+       if (rc == 0) {
+               spin_lock(&GlobalMid_Lock);
+-              if (server->tcpStatus != CifsExiting)
++              if (server->tcpStatus == CifsNeedNegotiate)
+                       server->tcpStatus = CifsGood;
+               else
+                       rc = -EHOSTDOWN;
diff --git a/queue-2.6.39/drm-radeon-kms-do-bounds-checking-for-3d_load_vbpntr-and.patch b/queue-2.6.39/drm-radeon-kms-do-bounds-checking-for-3d_load_vbpntr-and.patch
new file mode 100644 (file)
index 0000000..ae151b1
--- /dev/null
@@ -0,0 +1,54 @@
+From a27bb4b209dd6c327fa4e7185f2487f9508a58db Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <maraeo@gmail.com>
+Date: Fri, 10 Jun 2011 14:41:26 +0000
+Subject: drm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and
+ bump array limit
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <maraeo@gmail.com>
+
+commit a27bb4b209dd6c327fa4e7185f2487f9508a58db upstream.
+
+To my knowledge, the limit is 16 on r300.
+(the docs don't say what the limit is)
+
+The lack of bounds checking can be abused to do all sorts of things
+(from bypassing parts of the CS checker to crashing the kernel).
+
+Bugzilla:
+https://bugs.freedesktop.org/show_bug.cgi?id=36745
+
+Signed-off-by: Marek Olšák <maraeo@gmail.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/radeon/r100_track.h |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/radeon/r100_track.h
++++ b/drivers/gpu/drm/radeon/r100_track.h
+@@ -63,7 +63,7 @@ struct r100_cs_track {
+       unsigned                        num_arrays;
+       unsigned                        max_indx;
+       unsigned                        color_channel_mask;
+-      struct r100_cs_track_array      arrays[11];
++      struct r100_cs_track_array      arrays[16];
+       struct r100_cs_track_cb         cb[R300_MAX_CB];
+       struct r100_cs_track_cb         zb;
+       struct r100_cs_track_cb         aa;
+@@ -146,6 +146,12 @@ static inline int r100_packet3_load_vbpn
+       ib = p->ib->ptr;
+       track = (struct r100_cs_track *)p->track;
+       c = radeon_get_ib_value(p, idx++) & 0x1F;
++      if (c > 16) {
++          DRM_ERROR("Only 16 vertex buffers are allowed %d\n",
++                    pkt->opcode);
++          r100_cs_dump_packet(p, pkt);
++          return -EINVAL;
++      }
+       track->num_arrays = c;
+       for (i = 0; i < (c - 1); i+=2, idx+=3) {
+               r = r100_cs_packet_next_reloc(p, &reloc);
diff --git a/queue-2.6.39/oprofile-dcookies-fix-possible-circular-locking-dependency.patch b/queue-2.6.39/oprofile-dcookies-fix-possible-circular-locking-dependency.patch
new file mode 100644 (file)
index 0000000..edfbf64
--- /dev/null
@@ -0,0 +1,96 @@
+From fe47ae7f53e179d2ef6771024feb000cbb86640f Mon Sep 17 00:00:00 2001
+From: Robert Richter <robert.richter@amd.com>
+Date: Tue, 31 May 2011 12:35:41 +0200
+Subject: oprofile, dcookies: Fix possible circular locking dependency
+
+From: Robert Richter <robert.richter@amd.com>
+
+commit fe47ae7f53e179d2ef6771024feb000cbb86640f upstream.
+
+The lockdep warning below detects a possible A->B/B->A locking
+dependency of mm->mmap_sem and dcookie_mutex. The order in
+sync_buffer() is mm->mmap_sem/dcookie_mutex, while in
+sys_lookup_dcookie() it is vice versa.
+
+Fixing it in sys_lookup_dcookie() by unlocking dcookie_mutex before
+copy_to_user().
+
+oprofiled/4432 is trying to acquire lock:
+ (&mm->mmap_sem){++++++}, at: [<ffffffff810b444b>] might_fault+0x53/0xa3
+
+but task is already holding lock:
+ (dcookie_mutex){+.+.+.}, at: [<ffffffff81124d28>] sys_lookup_dcookie+0x45/0x149
+
+which lock already depends on the new lock.
+
+the existing dependency chain (in reverse order) is:
+
+-> #1 (dcookie_mutex){+.+.+.}:
+       [<ffffffff8106557f>] lock_acquire+0xf8/0x11e
+       [<ffffffff814634f0>] mutex_lock_nested+0x63/0x309
+       [<ffffffff81124e5c>] get_dcookie+0x30/0x144
+       [<ffffffffa0000fba>] sync_buffer+0x196/0x3ec [oprofile]
+       [<ffffffffa0001226>] task_exit_notify+0x16/0x1a [oprofile]
+       [<ffffffff81467b96>] notifier_call_chain+0x37/0x63
+       [<ffffffff8105803d>] __blocking_notifier_call_chain+0x50/0x67
+       [<ffffffff81058068>] blocking_notifier_call_chain+0x14/0x16
+       [<ffffffff8105a718>] profile_task_exit+0x1a/0x1c
+       [<ffffffff81039e8f>] do_exit+0x2a/0x6fc
+       [<ffffffff8103a5e4>] do_group_exit+0x83/0xae
+       [<ffffffff8103a626>] sys_exit_group+0x17/0x1b
+       [<ffffffff8146ad4b>] system_call_fastpath+0x16/0x1b
+
+-> #0 (&mm->mmap_sem){++++++}:
+       [<ffffffff81064dfb>] __lock_acquire+0x1085/0x1711
+       [<ffffffff8106557f>] lock_acquire+0xf8/0x11e
+       [<ffffffff810b4478>] might_fault+0x80/0xa3
+       [<ffffffff81124de7>] sys_lookup_dcookie+0x104/0x149
+       [<ffffffff8146ad4b>] system_call_fastpath+0x16/0x1b
+
+other info that might help us debug this:
+
+1 lock held by oprofiled/4432:
+ #0:  (dcookie_mutex){+.+.+.}, at: [<ffffffff81124d28>] sys_lookup_dcookie+0x45/0x149
+
+stack backtrace:
+Pid: 4432, comm: oprofiled Not tainted 2.6.39-00008-ge5a450d #9
+Call Trace:
+ [<ffffffff81063193>] print_circular_bug+0xae/0xbc
+ [<ffffffff81064dfb>] __lock_acquire+0x1085/0x1711
+ [<ffffffff8102ef13>] ? get_parent_ip+0x11/0x42
+ [<ffffffff810b444b>] ? might_fault+0x53/0xa3
+ [<ffffffff8106557f>] lock_acquire+0xf8/0x11e
+ [<ffffffff810b444b>] ? might_fault+0x53/0xa3
+ [<ffffffff810d7d54>] ? path_put+0x22/0x27
+ [<ffffffff810b4478>] might_fault+0x80/0xa3
+ [<ffffffff810b444b>] ? might_fault+0x53/0xa3
+ [<ffffffff81124de7>] sys_lookup_dcookie+0x104/0x149
+ [<ffffffff8146ad4b>] system_call_fastpath+0x16/0x1b
+
+References: https://bugzilla.kernel.org/show_bug.cgi?id=13809
+Signed-off-by: Robert Richter <robert.richter@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/dcookies.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/fs/dcookies.c
++++ b/fs/dcookies.c
+@@ -178,6 +178,8 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cooki
+       /* FIXME: (deleted) ? */
+       path = d_path(&dcs->path, kbuf, PAGE_SIZE);
++      mutex_unlock(&dcookie_mutex);
++
+       if (IS_ERR(path)) {
+               err = PTR_ERR(path);
+               goto out_free;
+@@ -194,6 +196,7 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cooki
+ out_free:
+       kfree(kbuf);
++      return err;
+ out:
+       mutex_unlock(&dcookie_mutex);
+       return err;
diff --git a/queue-2.6.39/oprofile-fix-locking-dependency-in-sync_start.patch b/queue-2.6.39/oprofile-fix-locking-dependency-in-sync_start.patch
new file mode 100644 (file)
index 0000000..a0a56cf
--- /dev/null
@@ -0,0 +1,154 @@
+From 130c5ce716c9bfd1c2a2ec840a746eb7ff9ce1e6 Mon Sep 17 00:00:00 2001
+From: Robert Richter <robert.richter@amd.com>
+Date: Thu, 26 May 2011 18:39:35 +0200
+Subject: oprofile: Fix locking dependency in sync_start()
+
+From: Robert Richter <robert.richter@amd.com>
+
+commit 130c5ce716c9bfd1c2a2ec840a746eb7ff9ce1e6 upstream.
+
+This fixes the A->B/B->A locking dependency, see the warning below.
+
+The function task_exit_notify() is called with (task_exit_notifier)
+.rwsem set and then calls sync_buffer() which locks buffer_mutex. In
+sync_start() the buffer_mutex was set to prevent notifier functions to
+be started before sync_start() is finished. But when registering the
+notifier, (task_exit_notifier).rwsem is locked too, but now in
+different order than in sync_buffer(). In theory this causes a locking
+dependency, what does not occur in practice since task_exit_notify()
+is always called after the notifier is registered which means the lock
+is already released.
+
+However, after checking the notifier functions it turned out the
+buffer_mutex in sync_start() is unnecessary. This is because
+sync_buffer() may be called from the notifiers even if sync_start()
+did not finish yet, the buffers are already allocated but empty. No
+need to protect this with the mutex.
+
+So we fix this theoretical locking dependency by removing buffer_mutex
+in sync_start(). This is similar to the implementation before commit:
+
+ 750d857 oprofile: fix crash when accessing freed task structs
+
+which introduced the locking dependency.
+
+Lockdep warning:
+
+oprofiled/4447 is trying to acquire lock:
+ (buffer_mutex){+.+...}, at: [<ffffffffa0000e55>] sync_buffer+0x31/0x3ec [oprofile]
+
+but task is already holding lock:
+ ((task_exit_notifier).rwsem){++++..}, at: [<ffffffff81058026>] __blocking_notifier_call_chain+0x39/0x67
+
+which lock already depends on the new lock.
+
+the existing dependency chain (in reverse order) is:
+
+-> #1 ((task_exit_notifier).rwsem){++++..}:
+       [<ffffffff8106557f>] lock_acquire+0xf8/0x11e
+       [<ffffffff81463a2b>] down_write+0x44/0x67
+       [<ffffffff810581c0>] blocking_notifier_chain_register+0x52/0x8b
+       [<ffffffff8105a6ac>] profile_event_register+0x2d/0x2f
+       [<ffffffffa00013c1>] sync_start+0x47/0xc6 [oprofile]
+       [<ffffffffa00001bb>] oprofile_setup+0x60/0xa5 [oprofile]
+       [<ffffffffa00014e3>] event_buffer_open+0x59/0x8c [oprofile]
+       [<ffffffff810cd3b9>] __dentry_open+0x1eb/0x308
+       [<ffffffff810cd59d>] nameidata_to_filp+0x60/0x67
+       [<ffffffff810daad6>] do_last+0x5be/0x6b2
+       [<ffffffff810dbc33>] path_openat+0xc7/0x360
+       [<ffffffff810dbfc5>] do_filp_open+0x3d/0x8c
+       [<ffffffff810ccfd2>] do_sys_open+0x110/0x1a9
+       [<ffffffff810cd09e>] sys_open+0x20/0x22
+       [<ffffffff8146ad4b>] system_call_fastpath+0x16/0x1b
+
+-> #0 (buffer_mutex){+.+...}:
+       [<ffffffff81064dfb>] __lock_acquire+0x1085/0x1711
+       [<ffffffff8106557f>] lock_acquire+0xf8/0x11e
+       [<ffffffff814634f0>] mutex_lock_nested+0x63/0x309
+       [<ffffffffa0000e55>] sync_buffer+0x31/0x3ec [oprofile]
+       [<ffffffffa0001226>] task_exit_notify+0x16/0x1a [oprofile]
+       [<ffffffff81467b96>] notifier_call_chain+0x37/0x63
+       [<ffffffff8105803d>] __blocking_notifier_call_chain+0x50/0x67
+       [<ffffffff81058068>] blocking_notifier_call_chain+0x14/0x16
+       [<ffffffff8105a718>] profile_task_exit+0x1a/0x1c
+       [<ffffffff81039e8f>] do_exit+0x2a/0x6fc
+       [<ffffffff8103a5e4>] do_group_exit+0x83/0xae
+       [<ffffffff8103a626>] sys_exit_group+0x17/0x1b
+       [<ffffffff8146ad4b>] system_call_fastpath+0x16/0x1b
+
+other info that might help us debug this:
+
+1 lock held by oprofiled/4447:
+ #0:  ((task_exit_notifier).rwsem){++++..}, at: [<ffffffff81058026>] __blocking_notifier_call_chain+0x39/0x67
+
+stack backtrace:
+Pid: 4447, comm: oprofiled Not tainted 2.6.39-00007-gcf4d8d4 #10
+Call Trace:
+ [<ffffffff81063193>] print_circular_bug+0xae/0xbc
+ [<ffffffff81064dfb>] __lock_acquire+0x1085/0x1711
+ [<ffffffffa0000e55>] ? sync_buffer+0x31/0x3ec [oprofile]
+ [<ffffffff8106557f>] lock_acquire+0xf8/0x11e
+ [<ffffffffa0000e55>] ? sync_buffer+0x31/0x3ec [oprofile]
+ [<ffffffff81062627>] ? mark_lock+0x42f/0x552
+ [<ffffffffa0000e55>] ? sync_buffer+0x31/0x3ec [oprofile]
+ [<ffffffff814634f0>] mutex_lock_nested+0x63/0x309
+ [<ffffffffa0000e55>] ? sync_buffer+0x31/0x3ec [oprofile]
+ [<ffffffffa0000e55>] sync_buffer+0x31/0x3ec [oprofile]
+ [<ffffffff81058026>] ? __blocking_notifier_call_chain+0x39/0x67
+ [<ffffffff81058026>] ? __blocking_notifier_call_chain+0x39/0x67
+ [<ffffffffa0001226>] task_exit_notify+0x16/0x1a [oprofile]
+ [<ffffffff81467b96>] notifier_call_chain+0x37/0x63
+ [<ffffffff8105803d>] __blocking_notifier_call_chain+0x50/0x67
+ [<ffffffff81058068>] blocking_notifier_call_chain+0x14/0x16
+ [<ffffffff8105a718>] profile_task_exit+0x1a/0x1c
+ [<ffffffff81039e8f>] do_exit+0x2a/0x6fc
+ [<ffffffff81465031>] ? retint_swapgs+0xe/0x13
+ [<ffffffff8103a5e4>] do_group_exit+0x83/0xae
+ [<ffffffff8103a626>] sys_exit_group+0x17/0x1b
+ [<ffffffff8146ad4b>] system_call_fastpath+0x16/0x1b
+
+Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
+Cc: Carl Love <carll@us.ibm.com>
+Signed-off-by: Robert Richter <robert.richter@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/oprofile/buffer_sync.c |    8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/drivers/oprofile/buffer_sync.c
++++ b/drivers/oprofile/buffer_sync.c
+@@ -155,8 +155,6 @@ int sync_start(void)
+       if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL))
+               return -ENOMEM;
+-      mutex_lock(&buffer_mutex);
+-
+       err = task_handoff_register(&task_free_nb);
+       if (err)
+               goto out1;
+@@ -173,7 +171,6 @@ int sync_start(void)
+       start_cpu_work();
+ out:
+-      mutex_unlock(&buffer_mutex);
+       return err;
+ out4:
+       profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
+@@ -190,14 +187,13 @@ out1:
+ void sync_stop(void)
+ {
+-      /* flush buffers */
+-      mutex_lock(&buffer_mutex);
+       end_cpu_work();
+       unregister_module_notifier(&module_load_nb);
+       profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
+       profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
+       task_handoff_unregister(&task_free_nb);
+-      mutex_unlock(&buffer_mutex);
++      barrier();                      /* do all of the above first */
++
+       flush_cpu_work();
+       free_all_tasks();
diff --git a/queue-2.6.39/oprofile-free-potentially-owned-tasks-in-case-of-errors.patch b/queue-2.6.39/oprofile-free-potentially-owned-tasks-in-case-of-errors.patch
new file mode 100644 (file)
index 0000000..126871e
--- /dev/null
@@ -0,0 +1,56 @@
+From 6ac6519b93065625119a347be1cbcc1b89edb773 Mon Sep 17 00:00:00 2001
+From: Robert Richter <robert.richter@amd.com>
+Date: Thu, 26 May 2011 18:22:54 +0200
+Subject: oprofile: Free potentially owned tasks in case of errors
+
+From: Robert Richter <robert.richter@amd.com>
+
+commit 6ac6519b93065625119a347be1cbcc1b89edb773 upstream.
+
+After registering the task free notifier we possibly have tasks in our
+dying_tasks list. Free them after unregistering the notifier in case
+of an error.
+
+Signed-off-by: Robert Richter <robert.richter@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/oprofile/buffer_sync.c |   13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+--- a/drivers/oprofile/buffer_sync.c
++++ b/drivers/oprofile/buffer_sync.c
+@@ -141,6 +141,13 @@ static struct notifier_block module_load
+       .notifier_call = module_load_notify,
+ };
++static void free_all_tasks(void)
++{
++      /* make sure we don't leak task structs */
++      process_task_mortuary();
++      process_task_mortuary();
++}
++
+ int sync_start(void)
+ {
+       int err;
+@@ -174,6 +181,7 @@ out3:
+       profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
+ out2:
+       task_handoff_unregister(&task_free_nb);
++      free_all_tasks();
+ out1:
+       free_cpumask_var(marked_cpus);
+       goto out;
+@@ -192,10 +200,7 @@ void sync_stop(void)
+       mutex_unlock(&buffer_mutex);
+       flush_cpu_work();
+-      /* make sure we don't leak task structs */
+-      process_task_mortuary();
+-      process_task_mortuary();
+-
++      free_all_tasks();
+       free_cpumask_var(marked_cpus);
+ }
index 9b4fab4956980d1bd194d6a293241fb2fa2ea738..6954bfe5c454e702efde6b9a8ef4adb9b7b7ebb9 100644 (file)
@@ -57,3 +57,19 @@ usb-core-tolerate-protocol-stall-during-hub-and-port.patch
 usb-serial-add-another-4n-galaxy.de-pid-to-ftdi_sio-driver.patch
 usb-storage-redo-incorrect-reads.patch
 revert-x86-efi-retain-boot-service-code-until-after-switching-to-virtual-mode.patch
+xhci-add-defines-for-hardcoded-slot-states.patch
+xhci-do-not-issue-device-reset-when-device-is-not-setup.patch
+xhci-disable-msi-for-some-fresco-logic-hosts.patch
+usb-xhci-fix-interval-calculation-for-fs-isoc-endpoints.patch
+apparmor-fix-sleep-in-invalid-context-from-task_setrlimit.patch
+cifs-don-t-allow-cifs_reconnect-to-exit-with-null-socket.patch
+asoc-ad1836-fix-setting-the-pcm-format.patch
+asoc-fix-wm8962-headphone-volume-update-for-use-of-advanced.patch
+asoc-wm8804-does-not-support-sample-rates-below-32khz.patch
+asoc-snd_soc_new_-mixer-mux-pga-make-sure-to-use-right.patch
+asoc-samsung-fix-the-incorrect-referencing-of-i2scon.patch
+alsa-hda-fix-quirk-for-dell-inspiron-910.patch
+oprofile-free-potentially-owned-tasks-in-case-of-errors.patch
+oprofile-fix-locking-dependency-in-sync_start.patch
+oprofile-dcookies-fix-possible-circular-locking-dependency.patch
+drm-radeon-kms-do-bounds-checking-for-3d_load_vbpntr-and.patch
diff --git a/queue-2.6.39/usb-xhci-fix-interval-calculation-for-fs-isoc-endpoints.patch b/queue-2.6.39/usb-xhci-fix-interval-calculation-for-fs-isoc-endpoints.patch
new file mode 100644 (file)
index 0000000..1e43c02
--- /dev/null
@@ -0,0 +1,58 @@
+From cd3c18ba2fac14b34d03cae111f215009735ea06 Mon Sep 17 00:00:00 2001
+From: Dmitry Torokhov <dtor@vmware.com>
+Date: Tue, 31 May 2011 14:37:23 -0700
+Subject: USB: xhci - fix interval calculation for FS isoc endpoints
+
+From: Dmitry Torokhov <dtor@vmware.com>
+
+commit cd3c18ba2fac14b34d03cae111f215009735ea06 upstream.
+
+Full-speed isoc endpoints specify interval in exponent based form in
+frames, not microframes, so we need to adjust accordingly.
+
+NEC xHCI host controllers will return an error code of 0x11 if a full
+speed isochronous endpoint is added with the Interval field set to
+something less than 3 (2^3 = 8 microframes, or one frame).  It is
+impossible for a full speed device to have an interval smaller than one
+frame.
+
+This was always an issue in the xHCI driver, but commit
+dfa49c4ad120a784ef1ff0717168aa79f55a483a "USB: xhci - fix math in
+xhci_get_endpoint_interval()" removed the clamping of the minimum value
+in the Interval field, which revealed this bug.
+
+This needs to be backported to stable kernels back to 2.6.31.
+
+Reported-by: Matt Evans <matt@ozlabs.org>
+Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
+Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/xhci-mem.c |   14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/host/xhci-mem.c
++++ b/drivers/usb/host/xhci-mem.c
+@@ -986,9 +986,19 @@ static unsigned int xhci_parse_exponent_
+       interval = clamp_val(ep->desc.bInterval, 1, 16) - 1;
+       if (interval != ep->desc.bInterval - 1)
+               dev_warn(&udev->dev,
+-                       "ep %#x - rounding interval to %d microframes\n",
++                       "ep %#x - rounding interval to %d %sframes\n",
+                        ep->desc.bEndpointAddress,
+-                       1 << interval);
++                       1 << interval,
++                       udev->speed == USB_SPEED_FULL ? "" : "micro");
++
++      if (udev->speed == USB_SPEED_FULL) {
++              /*
++               * Full speed isoc endpoints specify interval in frames,
++               * not microframes. We are using microframes everywhere,
++               * so adjust accordingly.
++               */
++              interval += 3;  /* 1 frame = 2^3 uframes */
++      }
+       return interval;
+ }
diff --git a/queue-2.6.39/xhci-add-defines-for-hardcoded-slot-states.patch b/queue-2.6.39/xhci-add-defines-for-hardcoded-slot-states.patch
new file mode 100644 (file)
index 0000000..bf920d3
--- /dev/null
@@ -0,0 +1,55 @@
+From e2b0217715c6d10379d94bdfe5560af96eecbb7c Mon Sep 17 00:00:00 2001
+From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
+Date: Wed, 1 Jun 2011 23:27:49 +0200
+Subject: xhci: Add defines for hardcoded slot states
+
+From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
+
+commit e2b0217715c6d10379d94bdfe5560af96eecbb7c upstream.
+
+This needs to be added to the stable trees back to 2.6.34 to support an
+upcoming bug fix.
+
+Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
+Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/xhci-dbg.c |    8 ++++----
+ drivers/usb/host/xhci.h     |    5 +++++
+ 2 files changed, 9 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/host/xhci-dbg.c
++++ b/drivers/usb/host/xhci-dbg.c
+@@ -437,13 +437,13 @@ char *xhci_get_slot_state(struct xhci_hc
+       struct xhci_slot_ctx *slot_ctx = xhci_get_slot_ctx(xhci, ctx);
+       switch (GET_SLOT_STATE(slot_ctx->dev_state)) {
+-      case 0:
++      case SLOT_STATE_ENABLED:
+               return "enabled/disabled";
+-      case 1:
++      case SLOT_STATE_DEFAULT:
+               return "default";
+-      case 2:
++      case SLOT_STATE_ADDRESSED:
+               return "addressed";
+-      case 3:
++      case SLOT_STATE_CONFIGURED:
+               return "configured";
+       default:
+               return "reserved";
+--- a/drivers/usb/host/xhci.h
++++ b/drivers/usb/host/xhci.h
+@@ -560,6 +560,11 @@ struct xhci_slot_ctx {
+ #define SLOT_STATE    (0x1f << 27)
+ #define GET_SLOT_STATE(p)     (((p) & (0x1f << 27)) >> 27)
++#define SLOT_STATE_DISABLED   0
++#define SLOT_STATE_ENABLED    SLOT_STATE_DISABLED
++#define SLOT_STATE_DEFAULT    1
++#define SLOT_STATE_ADDRESSED  2
++#define SLOT_STATE_CONFIGURED 3
+ /**
+  * struct xhci_ep_ctx
diff --git a/queue-2.6.39/xhci-disable-msi-for-some-fresco-logic-hosts.patch b/queue-2.6.39/xhci-disable-msi-for-some-fresco-logic-hosts.patch
new file mode 100644 (file)
index 0000000..5953121
--- /dev/null
@@ -0,0 +1,87 @@
+From f5182b4155b9d686c5540a6822486400e34ddd98 Mon Sep 17 00:00:00 2001
+From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
+Date: Thu, 2 Jun 2011 11:33:02 -0700
+Subject: xhci: Disable MSI for some Fresco Logic hosts.
+
+From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
+
+commit f5182b4155b9d686c5540a6822486400e34ddd98 upstream.
+
+Some Fresco Logic hosts, including those found in the AUAU N533V laptop,
+advertise MSI, but fail to actually generate MSI interrupts.  Add a new
+xHCI quirk to skip MSI enabling for the Fresco Logic host controllers.
+Fresco Logic confirms that all chips with PCI vendor ID 0x1b73 and device
+ID 0x1000, regardless of PCI revision ID, do not support MSI.
+
+This should be backported to stable kernels as far back as 2.6.36, which
+was the first kernel to support MSI on xHCI hosts.
+
+Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
+Reported-by: Sergey Galanov <sergey.e.galanov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/xhci-pci.c |   14 ++++++++++++--
+ drivers/usb/host/xhci.c     |    7 +++++++
+ drivers/usb/host/xhci.h     |    1 +
+ 3 files changed, 20 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/host/xhci-pci.c
++++ b/drivers/usb/host/xhci-pci.c
+@@ -105,12 +105,22 @@ static int xhci_pci_setup(struct usb_hcd
+       /* Look for vendor-specific quirks */
+       if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
+-                      pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
+-                      pdev->revision == 0x0) {
++                      pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) {
++              if (pdev->revision == 0x0) {
+                       xhci->quirks |= XHCI_RESET_EP_QUIRK;
+                       xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure"
+                                       " endpoint cmd after reset endpoint\n");
++              }
++              /* Fresco Logic confirms: all revisions of this chip do not
++               * support MSI, even though some of them claim to in their PCI
++               * capabilities.
++               */
++              xhci->quirks |= XHCI_BROKEN_MSI;
++              xhci_dbg(xhci, "QUIRK: Fresco Logic revision %u "
++                              "has broken MSI implementation\n",
++                              pdev->revision);
+       }
++
+       if (pdev->vendor == PCI_VENDOR_ID_NEC)
+               xhci->quirks |= XHCI_NEC_HOST;
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -430,12 +430,19 @@ int xhci_run(struct usb_hcd *hcd)
+               free_irq(hcd->irq, hcd);
+       hcd->irq = -1;
++      /* Some Fresco Logic host controllers advertise MSI, but fail to
++       * generate interrupts.  Don't even try to enable MSI.
++       */
++      if (xhci->quirks & XHCI_BROKEN_MSI)
++              goto legacy_irq;
++
+       ret = xhci_setup_msix(xhci);
+       if (ret)
+               /* fall back to msi*/
+               ret = xhci_setup_msi(xhci);
+       if (ret) {
++legacy_irq:
+               /* fall back to legacy interrupt*/
+               ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
+                                       hcd->irq_descr, hcd);
+--- a/drivers/usb/host/xhci.h
++++ b/drivers/usb/host/xhci.h
+@@ -1286,6 +1286,7 @@ struct xhci_hcd {
+ #define XHCI_RESET_EP_QUIRK   (1 << 1)
+ #define XHCI_NEC_HOST         (1 << 2)
+ #define XHCI_AMD_PLL_FIX      (1 << 3)
++#define XHCI_BROKEN_MSI               (1 << 6)
+       /* There are two roothubs to keep track of bus suspend info for */
+       struct xhci_bus_state   bus_state[2];
+       /* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */
diff --git a/queue-2.6.39/xhci-do-not-issue-device-reset-when-device-is-not-setup.patch b/queue-2.6.39/xhci-do-not-issue-device-reset-when-device-is-not-setup.patch
new file mode 100644 (file)
index 0000000..4c38b0e
--- /dev/null
@@ -0,0 +1,51 @@
+From 001fd3826f4c736ce292315782d015f768399080 Mon Sep 17 00:00:00 2001
+From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
+Date: Wed, 1 Jun 2011 23:27:50 +0200
+Subject: xhci: Do not issue device reset when device is not setup
+
+From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
+
+commit 001fd3826f4c736ce292315782d015f768399080 upstream.
+
+xHCI controllers respond to a Reset Device command when the Slot is in the
+Enabled/Disabled state by returning an error.  This is fine on other host
+controllers, but the Etron xHCI host controller returns a vendor-specific
+error code that the xHCI driver doesn't understand.  The xHCI driver then
+gives up on device enumeration.
+
+Instead of issuing a command that will fail, just return.  This fixes the
+issue with the xhci driver not working on ASRock P67 Pro/Extreme boards.
+
+This should be backported to stable kernels as far back as 2.6.34.
+
+Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
+Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/xhci.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/usb/host/xhci.c
++++ b/drivers/usb/host/xhci.c
+@@ -2284,6 +2284,7 @@ int xhci_discover_or_reset_device(struct
+       struct xhci_command *reset_device_cmd;
+       int timeleft;
+       int last_freed_endpoint;
++      struct xhci_slot_ctx *slot_ctx;
+       ret = xhci_check_args(hcd, udev, NULL, 0, false, __func__);
+       if (ret <= 0)
+@@ -2316,6 +2317,12 @@ int xhci_discover_or_reset_device(struct
+                       return -EINVAL;
+       }
++      /* If device is not setup, there is no point in resetting it */
++      slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx);
++      if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) ==
++                                              SLOT_STATE_DISABLED)
++              return 0;
++
+       xhci_dbg(xhci, "Resetting device with slot ID %u\n", slot_id);
+       /* Allocate the command structure that holds the struct completion.
+        * Assume we're in process context, since the normal device reset