--- /dev/null
+From d9ab344336f74c012f6643ed3d1ad8ca0136de3b Mon Sep 17 00:00:00 2001
+From: Raymond Yau <superquad.vortex2@gmail.com>
+Date: Sun, 16 Jan 2011 10:55:54 +0800
+Subject: ALSA : au88x0 - Limit number of channels to fix Oops via OSS emu
+
+From: Raymond Yau <superquad.vortex2@gmail.com>
+
+commit d9ab344336f74c012f6643ed3d1ad8ca0136de3b upstream.
+
+Fix playback/capture channels patch to change supported playback
+channels of au8830 to 1,2,4 and capture channels to 1,2.
+This prevent oops when oss emulation use SNDCTL_DSP_CHANNELS to
+set 3 Channels
+
+Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/au88x0/au88x0_pcm.c | 24 ++++++++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
+
+--- a/sound/pci/au88x0/au88x0_pcm.c
++++ b/sound/pci/au88x0/au88x0_pcm.c
+@@ -42,11 +42,7 @@ static struct snd_pcm_hardware snd_vorte
+ .rate_min = 5000,
+ .rate_max = 48000,
+ .channels_min = 1,
+-#ifdef CHIP_AU8830
+- .channels_max = 4,
+-#else
+ .channels_max = 2,
+-#endif
+ .buffer_bytes_max = 0x10000,
+ .period_bytes_min = 0x1,
+ .period_bytes_max = 0x1000,
+@@ -115,6 +111,17 @@ static struct snd_pcm_hardware snd_vorte
+ .periods_max = 64,
+ };
+ #endif
++#ifdef CHIP_AU8830
++static unsigned int au8830_channels[3] = {
++ 1, 2, 4,
++};
++
++static struct snd_pcm_hw_constraint_list hw_constraints_au8830_channels = {
++ .count = ARRAY_SIZE(au8830_channels),
++ .list = au8830_channels,
++ .mask = 0,
++};
++#endif
+ /* open callback */
+ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
+ {
+@@ -156,6 +163,15 @@ static int snd_vortex_pcm_open(struct sn
+ if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB
+ || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S)
+ runtime->hw = snd_vortex_playback_hw_adb;
++#ifdef CHIP_AU8830
++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
++ VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
++ runtime->hw.channels_max = 4;
++ snd_pcm_hw_constraint_list(runtime, 0,
++ SNDRV_PCM_HW_PARAM_CHANNELS,
++ &hw_constraints_au8830_channels);
++ }
++#endif
+ substream->runtime->private_data = NULL;
+ }
+ #ifndef CHIP_AU8810
--- /dev/null
+From fd76804f3f5484b35e6a51214c91e916ebba05aa Mon Sep 17 00:00:00 2001
+From: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
+Date: Mon, 24 Jan 2011 16:09:56 +0100
+Subject: ALSA: fix invalid hardware.h include in ac97c for AVR32 architecture
+
+From: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
+
+commit fd76804f3f5484b35e6a51214c91e916ebba05aa upstream.
+
+This patch fixes the non-compiling AC97C driver for AVR32 architecture by
+include mach/hardware.h only for AT91 architecture. The AVR32 architecture does
+not supply the hardware.h include file.
+
+Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/atmel/ac97c.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/sound/atmel/ac97c.c
++++ b/sound/atmel/ac97c.c
+@@ -33,9 +33,12 @@
+ #include <linux/dw_dmac.h>
+
+ #include <mach/cpu.h>
+-#include <mach/hardware.h>
+ #include <mach/gpio.h>
+
++#ifdef CONFIG_ARCH_AT91
++#include <mach/hardware.h>
++#endif
++
+ #include "ac97c.h"
+
+ enum {
--- /dev/null
+From 700b65cee958d81b16c48378d5759c46d01e24d0 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 12 Jan 2011 09:03:05 +0100
+Subject: ALSA: hda - Add missing NID 0x19 fixup for Sony VAIO
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 700b65cee958d81b16c48378d5759c46d01e24d0 upstream.
+
+With GPIO2-fixup, another fixup for NID 0x19 was missing because the
+fixup is applied only once. Add the corresponding verb to the entry.
+
+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
+@@ -14830,6 +14830,7 @@ static const struct alc_fixup alc269_fix
+ {0x01, AC_VERB_SET_GPIO_MASK, 0x04},
+ {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04},
+ {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
++ {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
+ { }
+ }
+ },
--- /dev/null
+From 0ebaa24c6b1f62839bcd12d63fa76e3cf23b9bd0 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 11 Jan 2011 18:11:04 +0100
+Subject: ALSA: hda - Add static_hdmi_pcm option to HDMI codec parser
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 0ebaa24c6b1f62839bcd12d63fa76e3cf23b9bd0 upstream.
+
+The dynamic PCM restriction based on ELD information may lead to the
+problem in some cases, e.g. when the receiver is turned off. Then it
+may send a TV HDMI default such as channels = 2. Since it's still
+plugged, the driver doesn't know whether it's the right configuration
+for future use. Now, when an app opens the device at this moment,
+then turn on the receiver, the app still sends channels=2.
+
+The right solution is to implement some kind of notification and
+automatic re-open mechanism. But, this is a goal far ahead.
+
+This patch provides a workaround for such a case by providing a new
+module option static_hdmi_pcm for snd-hda-codec-hdmi module. When
+this is set to true, the driver doesn't change PCM parameters per
+ELD information. For users who need the static configuration like
+the scenario above, set this to true.
+
+The parameter can be changed dynamically via sysfs, too.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_hdmi.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -31,10 +31,15 @@
+ #include <linux/init.h>
+ #include <linux/delay.h>
+ #include <linux/slab.h>
++#include <linux/moduleparam.h>
+ #include <sound/core.h>
+ #include "hda_codec.h"
+ #include "hda_local.h"
+
++static bool static_hdmi_pcm;
++module_param(static_hdmi_pcm, bool, 0644);
++MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info");
++
+ /*
+ * The HDMI/DisplayPort configuration can be highly dynamic. A graphics device
+ * could support two independent pipes, each of them can be connected to one or
+@@ -827,7 +832,7 @@ static int hdmi_pcm_open(struct hda_pcm_
+ *codec_pars = *hinfo;
+
+ eld = &spec->sink_eld[idx];
+- if (eld->eld_valid && eld->sad_count > 0) {
++ if (!static_hdmi_pcm && eld->eld_valid && eld->sad_count > 0) {
+ hdmi_eld_update_pcm_info(eld, hinfo, codec_pars);
+ if (hinfo->channels_min > hinfo->channels_max ||
+ !hinfo->rates || !hinfo->formats)
--- /dev/null
+From 03b7a1ab557efe34e8f79b78660e514bd7374248 Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Tue, 9 Nov 2010 14:35:30 +0100
+Subject: ALSA: HDA: Create mixers on ALC887
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+commit 03b7a1ab557efe34e8f79b78660e514bd7374248 upstream.
+
+BugLink: http://launchpad.net/bugs/669092
+
+ALC887 does not have any volume control ability on the mixer NIDs,
+so put the volume controls on the dac NIDs instead. Without this
+patch, ALC887 users cannot use alsamixer at all.
+
+Signed-off-by: David Henningsson <david.henningsson@canonical.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_realtek.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -10857,6 +10857,9 @@ static int alc_auto_add_mic_boost(struct
+ return 0;
+ }
+
++static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
++ const struct auto_pin_cfg *cfg);
++
+ /* almost identical with ALC880 parser... */
+ static int alc882_parse_auto_config(struct hda_codec *codec)
+ {
+@@ -10874,7 +10877,10 @@ static int alc882_parse_auto_config(stru
+ err = alc880_auto_fill_dac_nids(spec, &spec->autocfg);
+ if (err < 0)
+ return err;
+- err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg);
++ if (codec->vendor_id == 0x10ec0887)
++ err = alc861vd_auto_create_multi_out_ctls(spec, &spec->autocfg);
++ else
++ err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg);
+ if (err < 0)
+ return err;
+ err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0],
+@@ -17043,7 +17049,7 @@ static void alc861vd_auto_init_analog_in
+ #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c)
+
+ /* add playback controls from the parsed DAC table */
+-/* Based on ALC880 version. But ALC861VD has separate,
++/* Based on ALC880 version. But ALC861VD and ALC887 have separate,
+ * different NIDs for mute/unmute switch and volume control */
+ static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
+ const struct auto_pin_cfg *cfg)
--- /dev/null
+From 393004b2ea49524ee41a562cae8db67f50f372a5 Mon Sep 17 00:00:00 2001
+From: Nitin Daga <ndaga@nvidia.com>
+Date: Mon, 10 Jan 2011 21:49:31 +0530
+Subject: ALSA: hda: Disable 4/6 channels on some NVIDIA GPUs.
+
+From: Nitin Daga <ndaga@nvidia.com>
+
+commit 393004b2ea49524ee41a562cae8db67f50f372a5 upstream.
+
+Added hardware constraint in patch_hdmi.c to disable
+channels 4/6 which are not supported by some older
+NVIDIA GPUs.
+
+Signed-off-by: Nitin Daga <ndaga@nvidia.com>
+Acked-By: Stephen Warren <swarren@nvidia.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_hdmi.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1165,11 +1165,53 @@ static int nvhdmi_7x_init(struct hda_cod
+ return 0;
+ }
+
++static unsigned int channels_2_6_8[] = {
++ 2, 6, 8
++};
++
++static unsigned int channels_2_8[] = {
++ 2, 8
++};
++
++static struct snd_pcm_hw_constraint_list hw_constraints_2_6_8_channels = {
++ .count = ARRAY_SIZE(channels_2_6_8),
++ .list = channels_2_6_8,
++ .mask = 0,
++};
++
++static struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = {
++ .count = ARRAY_SIZE(channels_2_8),
++ .list = channels_2_8,
++ .mask = 0,
++};
++
+ static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+ {
+ struct hdmi_spec *spec = codec->spec;
++ struct snd_pcm_hw_constraint_list *hw_constraints_channels = NULL;
++
++ switch (codec->preset->id) {
++ case 0x10de0002:
++ case 0x10de0003:
++ case 0x10de0005:
++ case 0x10de0006:
++ hw_constraints_channels = &hw_constraints_2_8_channels;
++ break;
++ case 0x10de0007:
++ hw_constraints_channels = &hw_constraints_2_6_8_channels;
++ break;
++ default:
++ break;
++ }
++
++ if (hw_constraints_channels != NULL) {
++ snd_pcm_hw_constraint_list(substream->runtime, 0,
++ SNDRV_PCM_HW_PARAM_CHANNELS,
++ hw_constraints_channels);
++ }
++
+ return snd_hda_multi_out_dig_open(codec, &spec->multiout);
+ }
+
--- /dev/null
+From 6661702f2e803b55b50cc0471eb6b9254e99eef2 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 11 Jan 2011 18:07:14 +0100
+Subject: ALSA: hda - Don't refer ELD when unplugged
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 6661702f2e803b55b50cc0471eb6b9254e99eef2 upstream.
+
+When unplugged, we shouldn't refer to ELD information for PCM open
+any more.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_hdmi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -827,7 +827,7 @@ static int hdmi_pcm_open(struct hda_pcm_
+ *codec_pars = *hinfo;
+
+ eld = &spec->sink_eld[idx];
+- if (eld->sad_count > 0) {
++ if (eld->eld_valid && eld->sad_count > 0) {
+ hdmi_eld_update_pcm_info(eld, hinfo, codec_pars);
+ if (hinfo->channels_min > hinfo->channels_max ||
+ !hinfo->rates || !hinfo->formats)
--- /dev/null
+From d757534ed15387202e322854cd72dc58bbb975de Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Tue, 25 Jan 2011 19:44:26 +0100
+Subject: ALSA: HDA: Fix dmesg output of HDMI supported bits
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+commit d757534ed15387202e322854cd72dc58bbb975de upstream.
+
+This typo caused the dmesg output of the supported bits of HDMI
+to be cut off early.
+
+Signed-off-by: David Henningsson <david.henningsson@canonical.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/hda_eld.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/hda_eld.c
++++ b/sound/pci/hda/hda_eld.c
+@@ -381,7 +381,7 @@ static void hdmi_show_short_audio_desc(s
+ snd_print_pcm_rates(a->rates, buf, sizeof(buf));
+
+ if (a->format == AUDIO_CODING_TYPE_LPCM)
+- snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2 - 8));
++ snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2) - 8);
+ else if (a->max_bitrate)
+ snprintf(buf2, sizeof(buf2),
+ ", max bitrate = %d", a->max_bitrate);
--- /dev/null
+From 70f7db11c45a313b23922cacf248c613c3b2144c Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 2 Feb 2011 17:16:38 +0100
+Subject: ALSA: hda - Fix memory leaks in conexant jack arrays
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 70f7db11c45a313b23922cacf248c613c3b2144c upstream.
+
+The Conexant codec driver adds the jack arrays in init callback which
+may be called also in each PM resume. This results in the addition of
+new jack element at each time.
+
+The fix is to check whether the requested jack is already present in
+the array.
+
+Reference: Novell bug 668929
+ https://bugzilla.novell.com/show_bug.cgi?id=668929
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_conexant.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -403,10 +403,16 @@ static int conexant_add_jack(struct hda_
+ struct conexant_spec *spec;
+ struct conexant_jack *jack;
+ const char *name;
+- int err;
++ int i, err;
+
+ spec = codec->spec;
+ snd_array_init(&spec->jacks, sizeof(*jack), 32);
++
++ jack = spec->jacks.list;
++ for (i = 0; i < spec->jacks.used; i++, jack++)
++ if (jack->nid == nid)
++ return 0 ; /* already present */
++
+ jack = snd_array_new(&spec->jacks);
+ name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ;
+
--- /dev/null
+From b2d0576055bd1cafcd91a23cf85064815f1396cd Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 10 Jan 2011 14:47:35 +0100
+Subject: ALSA: hda - Fix multi-headphone handling for Realtek codecs
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit b2d0576055bd1cafcd91a23cf85064815f1396cd upstream.
+
+When multiple headphone pins are defined without line-out pins, the
+driver takes them as primary outputs. But it forgot to set line_out_type
+to HP by assuming there is some rest of HP pins. This results in some
+mis-handling of these pins for Realtek codec parser. It takes as if
+these are pure line-out jacks.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/hda_codec.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/sound/pci/hda/hda_codec.c
++++ b/sound/pci/hda/hda_codec.c
+@@ -4571,6 +4571,9 @@ int snd_hda_parse_pin_def_config(struct
+ }
+ memset(cfg->hp_pins + cfg->hp_outs, 0,
+ sizeof(hda_nid_t) * (AUTO_CFG_MAX_OUTS - cfg->hp_outs));
++ if (!cfg->hp_outs)
++ cfg->line_out_type = AUTO_PIN_HP_OUT;
++
+ }
+
+ /* sort by sequence */
--- /dev/null
+From 80c678526d7da73bde4d46a4622449c2b3c88409 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 13 Jan 2011 08:08:08 +0100
+Subject: ALSA: hda - Fix NULL-derefence with a single mic in STAC auto-mic detection
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 80c678526d7da73bde4d46a4622449c2b3c88409 upstream.
+
+When only one mic is available and it's an analog mic, the current
+IDT/STAC parser may give an Oops.
+
+Reference: bko#25692
+ https://bugzilla.kernel.org/show_bug.cgi?id=25692
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/hda/patch_sigmatel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_sigmatel.c
++++ b/sound/pci/hda/patch_sigmatel.c
+@@ -3591,7 +3591,7 @@ static int stac_check_auto_mic(struct hd
+ if (check_mic_pin(codec, spec->dmic_nids[i],
+ &fixed, &ext, &dock))
+ return 0;
+- if (!fixed && !ext && !dock)
++ if (!fixed || (!ext && !dock))
+ return 0; /* no input to switch */
+ if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))
+ return 0; /* no unsol support */
--- /dev/null
+From ca6cd851d7d22767d68b674590d836f468d1913a Mon Sep 17 00:00:00 2001
+From: Daniel T Chen <crimsun@ubuntu.com>
+Date: Sat, 8 Jan 2011 18:25:27 -0500
+Subject: ALSA: hda: Use vostro model quirk for Dell Vostro 1014
+
+From: Daniel T Chen <crimsun@ubuntu.com>
+
+commit ca6cd851d7d22767d68b674590d836f468d1913a upstream.
+
+BugLink: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5184
+
+A user reported on the alsa-devel mailing list that he needs to use
+the vostro model quirk to have audible playback, so apply it for his
+PCI SSID.
+
+Reported-and-tested-by: Fernando Lemos <fernandotcl@gmail.com>
+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_conexant.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -3097,6 +3097,7 @@ static struct snd_pci_quirk cxt5066_cfg_
+ SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD),
+ SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
+ SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
++ SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
+ SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
+ SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
+ SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP),
--- /dev/null
+From 749b527b21465fb079796c03ffb4302584dc31c1 Mon Sep 17 00:00:00 2001
+From: Luis R. Rodriguez <lrodriguez@atheros.com>
+Date: Wed, 20 Oct 2010 10:18:54 -0700
+Subject: cfg80211: fix allowing country IEs for WIPHY_FLAG_STRICT_REGULATORY
+
+From: Luis R. Rodriguez <lrodriguez@atheros.com>
+
+commit 749b527b21465fb079796c03ffb4302584dc31c1 upstream.
+
+We should be enabling country IE hints for WIPHY_FLAG_STRICT_REGULATORY
+even if we haven't yet recieved regulatory domain hint for the driver
+if it needed one. Without this Country IEs are not passed on to drivers
+that have set WIPHY_FLAG_STRICT_REGULATORY, today this is just all
+Atheros chipset drivers: ath5k, ath9k, ar9170, carl9170.
+
+This was part of the original design, however it was completely
+overlooked...
+
+Cc: Easwar Krishnan <easwar.krishnan@atheros.com>
+Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/net/cfg80211.h | 15 ++++++++-------
+ net/wireless/reg.c | 1 +
+ 2 files changed, 9 insertions(+), 7 deletions(-)
+
+--- a/include/net/cfg80211.h
++++ b/include/net/cfg80211.h
+@@ -1321,13 +1321,14 @@ struct cfg80211_ops {
+ * initiator is %REGDOM_SET_BY_CORE).
+ * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
+ * ignore regulatory domain settings until it gets its own regulatory
+- * domain via its regulatory_hint(). After its gets its own regulatory
+- * domain it will only allow further regulatory domain settings to
+- * further enhance compliance. For example if channel 13 and 14 are
+- * disabled by this regulatory domain no user regulatory domain can
+- * enable these channels at a later time. This can be used for devices
+- * which do not have calibration information gauranteed for frequencies
+- * or settings outside of its regulatory domain.
++ * domain via its regulatory_hint() unless the regulatory hint is
++ * from a country IE. After its gets its own regulatory domain it will
++ * only allow further regulatory domain settings to further enhance
++ * compliance. For example if channel 13 and 14 are disabled by this
++ * regulatory domain no user regulatory domain can enable these channels
++ * at a later time. This can be used for devices which do not have
++ * calibration information guaranteed for frequencies or settings
++ * outside of its regulatory domain.
+ * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
+ * that passive scan flags and beaconing flags may not be lifted by
+ * cfg80211 due to regulatory beacon hints. For more information on beacon
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -813,6 +813,7 @@ static bool ignore_reg_update(struct wip
+ * desired regulatory domain set
+ */
+ if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd &&
++ initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
+ !is_world_regdom(last_request->alpha2))
+ return true;
+ return false;
--- /dev/null
+From ca4ffe8f2848169a8ded0ea8a60b2d81925564c9 Mon Sep 17 00:00:00 2001
+From: Luis R. Rodriguez <lrodriguez@atheros.com>
+Date: Wed, 20 Oct 2010 10:18:55 -0700
+Subject: cfg80211: fix disabling channels based on hints
+
+From: Luis R. Rodriguez <lrodriguez@atheros.com>
+
+commit ca4ffe8f2848169a8ded0ea8a60b2d81925564c9 upstream.
+
+After a module loads you will have loaded the world roaming regulatory
+domain or a custom regulatory domain. Further regulatory hints are
+welcomed and should be respected unless the regulatory hint is coming
+from a country IE as the IEEE spec allows for a country IE to be a subset
+of what is allowed by the local regulatory agencies.
+
+So disable all channels that do not fit a regulatory domain sent
+from a unless the hint is from a country IE and the country IE had
+no information about the band we are currently processing.
+
+This fixes a few regulatory issues, for example for drivers that depend
+on CRDA and had no 5 GHz freqencies allowed were not properly disabling
+5 GHz at all, furthermore it also allows users to restrict devices
+further as was intended.
+
+If you recieve a country IE upon association we will also disable the
+channels that are not allowed if the country IE had at least one
+channel on the respective band we are procesing.
+
+This was the original intention behind this design but it was
+completely overlooked...
+
+Cc: David Quan <david.quan@atheros.com>
+Cc: Jouni Malinen <jouni.malinen@atheros.com>
+cc: Easwar Krishnan <easwar.krishnan@atheros.com>
+Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/linux/nl80211.h | 6 +++++-
+ net/wireless/reg.c | 20 +++++++++++++++++++-
+ 2 files changed, 24 insertions(+), 2 deletions(-)
+
+--- a/include/linux/nl80211.h
++++ b/include/linux/nl80211.h
+@@ -1307,7 +1307,11 @@ enum nl80211_bitrate_attr {
+ * wireless core it thinks its knows the regulatory domain we should be in.
+ * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
+ * 802.11 country information element with regulatory information it
+- * thinks we should consider.
++ * thinks we should consider. cfg80211 only processes the country
++ * code from the IE, and relies on the regulatory domain information
++ * structure pased by userspace (CRDA) from our wireless-regdb.
++ * If a channel is enabled but the country code indicates it should
++ * be disabled we disable the channel and re-enable it upon disassociation.
+ */
+ enum nl80211_reg_initiator {
+ NL80211_REGDOM_SET_BY_CORE,
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -750,8 +750,26 @@ static void handle_channel(struct wiphy
+ desired_bw_khz,
+ ®_rule);
+
+- if (r)
++ if (r) {
++ /*
++ * We will disable all channels that do not match our
++ * recieved regulatory rule unless the hint is coming
++ * from a Country IE and the Country IE had no information
++ * about a band. The IEEE 802.11 spec allows for an AP
++ * to send only a subset of the regulatory rules allowed,
++ * so an AP in the US that only supports 2.4 GHz may only send
++ * a country IE with information for the 2.4 GHz band
++ * while 5 GHz is still supported.
++ */
++ if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
++ r == -ERANGE)
++ return;
++
++ REG_DBG_PRINT("cfg80211: Disabling freq %d MHz\n",
++ chan->center_freq);
++ chan->flags = IEEE80211_CHAN_DISABLED;
+ return;
++ }
+
+ power_rule = ®_rule->power_rule;
+ freq_range = ®_rule->freq_range;
--- /dev/null
+From 7ca43d03b1291481bdf894bbaec5d580e7684e7d Mon Sep 17 00:00:00 2001
+From: Luis R. Rodriguez <lrodriguez@atheros.com>
+Date: Wed, 20 Oct 2010 10:18:53 -0700
+Subject: cfg80211: pass the reg hint initiator to helpers
+
+From: Luis R. Rodriguez <lrodriguez@atheros.com>
+
+commit 7ca43d03b1291481bdf894bbaec5d580e7684e7d upstream.
+
+This is required later.
+
+Cc: Easwar Krishnan <easwar.krishnan@atheros.com>
+Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ net/wireless/reg.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -720,7 +720,9 @@ EXPORT_SYMBOL(freq_reg_info);
+ * on the wiphy with the target_bw specified. Then we can simply use
+ * that below for the desired_bw_khz below.
+ */
+-static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band,
++static void handle_channel(struct wiphy *wiphy,
++ enum nl80211_reg_initiator initiator,
++ enum ieee80211_band band,
+ unsigned int chan_idx)
+ {
+ int r;
+@@ -784,7 +786,9 @@ static void handle_channel(struct wiphy
+ chan->max_power = (int) MBM_TO_DBM(power_rule->max_eirp);
+ }
+
+-static void handle_band(struct wiphy *wiphy, enum ieee80211_band band)
++static void handle_band(struct wiphy *wiphy,
++ enum ieee80211_band band,
++ enum nl80211_reg_initiator initiator)
+ {
+ unsigned int i;
+ struct ieee80211_supported_band *sband;
+@@ -793,7 +797,7 @@ static void handle_band(struct wiphy *wi
+ sband = wiphy->bands[band];
+
+ for (i = 0; i < sband->n_channels; i++)
+- handle_channel(wiphy, band, i);
++ handle_channel(wiphy, initiator, band, i);
+ }
+
+ static bool ignore_reg_update(struct wiphy *wiphy,
+@@ -1030,7 +1034,7 @@ void wiphy_update_regulatory(struct wiph
+ goto out;
+ for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
+ if (wiphy->bands[band])
+- handle_band(wiphy, band);
++ handle_band(wiphy, band, initiator);
+ }
+ out:
+ reg_process_beacons(wiphy);
--- /dev/null
+From 19a0b67afd174c4db261d587b5c67704dcd53c17 Mon Sep 17 00:00:00 2001
+From: Dean Nelson <dnelson@redhat.com>
+Date: Thu, 11 Nov 2010 05:50:25 +0000
+Subject: e1000: fix return value not set on error
+
+From: Dean Nelson <dnelson@redhat.com>
+
+commit 19a0b67afd174c4db261d587b5c67704dcd53c17 upstream.
+
+Dean noticed that 'err' wasn't being set when the "goto err_dma"
+statement is executed in the following hunk from the commit. It's value
+will be zero as a result of a successful call to e1000_init_hw_struct().
+
+This patch changes the error condition to be correctly propagated.
+
+Signed-off-by: Dean Nelson <dnelson@redhat.com>
+Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
+Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/e1000/e1000_main.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/e1000/e1000_main.c
++++ b/drivers/net/e1000/e1000_main.c
+@@ -971,11 +971,13 @@ static int __devinit e1000_probe(struct
+ */
+ dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
+ pci_using_dac = 1;
+- } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
+- dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+ } else {
+- pr_err("No usable DMA config, aborting\n");
+- goto err_dma;
++ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
++ if (err) {
++ pr_err("No usable DMA config, aborting\n");
++ goto err_dma;
++ }
++ dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+ }
+
+ netdev->netdev_ops = &e1000_netdev_ops;
--- /dev/null
+From a3fa904ec79b94f0db7faed010ff94d42f7d1d47 Mon Sep 17 00:00:00 2001
+From: Mauro Carvalho Chehab <mchehab@redhat.com>
+Date: Mon, 25 Oct 2010 17:51:15 -0300
+Subject: [media] em28xx: Fix audio input for Terratec Grabby
+
+From: Mauro Carvalho Chehab <mchehab@redhat.com>
+
+commit a3fa904ec79b94f0db7faed010ff94d42f7d1d47 upstream.
+
+The audio input line was wrong. Fix it.
+
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/video/em28xx/em28xx-cards.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/media/video/em28xx/em28xx-cards.c
++++ b/drivers/media/video/em28xx/em28xx-cards.c
+@@ -1633,11 +1633,11 @@ struct em28xx_board em28xx_boards[] = {
+ .input = { {
+ .type = EM28XX_VMUX_COMPOSITE1,
+ .vmux = SAA7115_COMPOSITE0,
+- .amux = EM28XX_AMUX_VIDEO2,
++ .amux = EM28XX_AMUX_LINE_IN,
+ }, {
+ .type = EM28XX_VMUX_SVIDEO,
+ .vmux = SAA7115_SVIDEO3,
+- .amux = EM28XX_AMUX_VIDEO2,
++ .amux = EM28XX_AMUX_LINE_IN,
+ } },
+ },
+ [EM2860_BOARD_TERRATEC_AV350] = {
--- /dev/null
+From ac61c46f4f7665ab4548e90430c37b2529e16cff Mon Sep 17 00:00:00 2001
+From: David Dillow <dillowda@ornl.gov>
+Date: Sun, 16 Jan 2011 15:12:39 -0500
+Subject: [SCSI] fix incorrect value of SCSI_MAX_SG_CHAIN_SEGMENTS due to include file ordering
+
+From: David Dillow <dillowda@ornl.gov>
+
+commit ac61c46f4f7665ab4548e90430c37b2529e16cff upstream.
+
+If the compiled object doesn't include linux/scatterlist.h before
+scsi/scsi.h, it will get an incorrect definition of
+SCSI_MAX_SG_CHAIN_SEGMENTS.
+
+Signed-off-by: David Dillow <dillowda@ornl.gov>
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/scsi/scsi.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/include/scsi/scsi.h
++++ b/include/scsi/scsi.h
+@@ -9,6 +9,7 @@
+ #define _SCSI_SCSI_H
+
+ #include <linux/types.h>
++#include <linux/scatterlist.h>
+
+ struct scsi_cmnd;
+
--- /dev/null
+From a8733c7baf457b071528e385a0b7d4aaec79287c Mon Sep 17 00:00:00 2001
+From: James Bottomley <James.Bottomley@suse.de>
+Date: Fri, 17 Dec 2010 15:36:34 -0500
+Subject: [SCSI] fix medium error problems with some arrays which can cause data corruption
+
+From: James Bottomley <James.Bottomley@suse.de>
+
+commit a8733c7baf457b071528e385a0b7d4aaec79287c upstream.
+
+Our current handling of medium error assumes that data is returned up
+to the bad sector. This assumption holds good for all disk devices,
+all DIF arrays and most ordinary arrays. However, an LSI array engine
+was recently discovered which reports a medium error without returning
+any data. This means that when we report good data up to the medium
+error, we've reported junk originally in the buffer as good. Worse,
+if the read consists of requested data plus a readahead, and the error
+occurs in readahead, we'll just strip off the readahead and report
+junk up to userspace as good data with no error.
+
+The fix for this is to have the error position computation take into
+account the amount of data returned by the driver using the scsi
+residual data. Unfortunately, not every driver fills in this data,
+but for those who don't, it's set to zero, which means we'll think a
+full set of data was transferred and the behaviour will be identical
+to the prior behaviour of the code (believe the buffer up to the error
+sector). All modern drivers seem to set the residual, so that should
+fix up the LSI failure/corruption case.
+
+Reported-by: Douglas Gilbert <dgilbert@interlog.com>
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/sd.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -1175,6 +1175,12 @@ static unsigned int sd_completed_bytes(s
+ u64 end_lba = blk_rq_pos(scmd->request) + (scsi_bufflen(scmd) / 512);
+ u64 bad_lba;
+ int info_valid;
++ /*
++ * resid is optional but mostly filled in. When it's unused,
++ * its value is zero, so we assume the whole buffer transferred
++ */
++ unsigned int transferred = scsi_bufflen(scmd) - scsi_get_resid(scmd);
++ unsigned int good_bytes;
+
+ if (scmd->request->cmd_type != REQ_TYPE_FS)
+ return 0;
+@@ -1208,7 +1214,8 @@ static unsigned int sd_completed_bytes(s
+ /* This computation should always be done in terms of
+ * the resolution of the device's medium.
+ */
+- return (bad_lba - start_lba) * scmd->device->sector_size;
++ good_bytes = (bad_lba - start_lba) * scmd->device->sector_size;
++ return min(good_bytes, transferred);
+ }
+
+ /**
--- /dev/null
+From 6021afcf19d8c6f5db6d11cadcfb6a22d0c28a48 Mon Sep 17 00:00:00 2001
+From: Edgar (gimli) Hucek <gimli@dark-green.com>
+Date: Tue, 9 Nov 2010 17:38:42 +0100
+Subject: input: bcm5974: Add support for MacBookAir3
+
+From: Edgar (gimli) Hucek <gimli@dark-green.com>
+
+commit 6021afcf19d8c6f5db6d11cadcfb6a22d0c28a48 upstream.
+
+This patch adds support for the MacBookAir3,1 and MacBookAir3,2
+models.
+
+[rydberg@euromail.se: touchpad range calibration]
+Signed-off-by: Edgar (gimli) Hucek <gimli@dark-green.com>
+Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/input/mouse/bcm5974.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+
+--- a/drivers/input/mouse/bcm5974.c
++++ b/drivers/input/mouse/bcm5974.c
+@@ -55,6 +55,14 @@
+ #define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI 0x0236
+ #define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO 0x0237
+ #define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS 0x0238
++/* MacbookAir3,2 (unibody), aka wellspring5 */
++#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI 0x023f
++#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO 0x0240
++#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS 0x0241
++/* MacbookAir3,1 (unibody), aka wellspring4 */
++#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI 0x0242
++#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO 0x0243
++#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS 0x0244
+
+ #define BCM5974_DEVICE(prod) { \
+ .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
+@@ -80,6 +88,14 @@ static const struct usb_device_id bcm597
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI),
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_ISO),
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING3_JIS),
++ /* MacbookAir3,2 */
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI),
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4_ISO),
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4_JIS),
++ /* MacbookAir3,1 */
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI),
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO),
++ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS),
+ /* Terminating entry */
+ {}
+ };
+@@ -234,6 +250,30 @@ static const struct bcm5974_config bcm59
+ { DIM_X, DIM_X / SN_COORD, -4460, 5166 },
+ { DIM_Y, DIM_Y / SN_COORD, -75, 6700 }
+ },
++ {
++ USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI,
++ USB_DEVICE_ID_APPLE_WELLSPRING4_ISO,
++ USB_DEVICE_ID_APPLE_WELLSPRING4_JIS,
++ HAS_INTEGRATED_BUTTON,
++ 0x84, sizeof(struct bt_data),
++ 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
++ { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
++ { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
++ { DIM_X, DIM_X / SN_COORD, -4620, 5140 },
++ { DIM_Y, DIM_Y / SN_COORD, -150, 6600 }
++ },
++ {
++ USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI,
++ USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO,
++ USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS,
++ HAS_INTEGRATED_BUTTON,
++ 0x84, sizeof(struct bt_data),
++ 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
++ { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
++ { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
++ { DIM_X, DIM_X / SN_COORD, -4616, 5112 },
++ { DIM_Y, DIM_Y / SN_COORD, -142, 5234 }
++ },
+ {}
+ };
+
--- /dev/null
+From f8313ef1f448006207f12c107123522c8bc00f15 Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Sat, 8 Jan 2011 01:37:26 -0800
+Subject: Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit f8313ef1f448006207f12c107123522c8bc00f15 upstream.
+
+i8042 controller present in Dell Vostro V13 errorneously signals spurious
+timeouts.
+
+Introduce i8042.notimeout parameter for ignoring i8042-signalled timeouts
+and apply this quirk automatically for Dell Vostro V13, based on DMI match.
+
+In addition to that, this machine also needs to be added to nomux blacklist.
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+Cc: Tim Gardner <tcanonical@tpi.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ Documentation/kernel-parameters.txt | 1 +
+ drivers/input/serio/i8042-x86ia64io.h | 21 +++++++++++++++++++++
+ drivers/input/serio/i8042.c | 6 +++++-
+ 3 files changed, 27 insertions(+), 1 deletion(-)
+
+--- a/Documentation/kernel-parameters.txt
++++ b/Documentation/kernel-parameters.txt
+@@ -884,6 +884,7 @@ and is between 256 and 4096 characters.
+ controller
+ i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
+ controllers
++ i8042.notimeout [HW] Ignore timeout condition signalled by conroller
+ i8042.reset [HW] Reset the controller during init and cleanup
+ i8042.unlock [HW] Unlock (ignore) the keylock
+
+--- a/drivers/input/serio/i8042-x86ia64io.h
++++ b/drivers/input/serio/i8042-x86ia64io.h
+@@ -424,6 +424,13 @@ static const struct dmi_system_id __init
+ DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
+ },
+ },
++ {
++ /* Dell Vostro V13 */
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
++ },
++ },
+ { }
+ };
+
+@@ -545,6 +552,17 @@ static const struct dmi_system_id __init
+ };
+ #endif
+
++static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
++ {
++ /* Dell Vostro V13 */
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
++ },
++ },
++ { }
++};
++
+ /*
+ * Some Wistron based laptops need us to explicitly enable the 'Dritek
+ * keyboard extension' to make their extra keys start generating scancodes.
+@@ -897,6 +915,9 @@ static int __init i8042_platform_init(vo
+ if (dmi_check_system(i8042_dmi_nomux_table))
+ i8042_nomux = true;
+
++ if (dmi_check_system(i8042_dmi_notimeout_table))
++ i8042_notimeout = true;
++
+ if (dmi_check_system(i8042_dmi_dritek_table))
+ i8042_dritek = true;
+ #endif /* CONFIG_X86 */
+--- a/drivers/input/serio/i8042.c
++++ b/drivers/input/serio/i8042.c
+@@ -61,6 +61,10 @@ static bool i8042_noloop;
+ module_param_named(noloop, i8042_noloop, bool, 0);
+ MODULE_PARM_DESC(noloop, "Disable the AUX Loopback command while probing for the AUX port");
+
++static bool i8042_notimeout;
++module_param_named(notimeout, i8042_notimeout, bool, 0);
++MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
++
+ #ifdef CONFIG_X86
+ static bool i8042_dritek;
+ module_param_named(dritek, i8042_dritek, bool, 0);
+@@ -503,7 +507,7 @@ static irqreturn_t i8042_interrupt(int i
+ } else {
+
+ dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
+- ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
++ ((str & I8042_STR_TIMEOUT && !i8042_notimeout) ? SERIO_TIMEOUT : 0);
+
+ port_no = (str & I8042_STR_AUXDATA) ?
+ I8042_AUX_PORT_NO : I8042_KBD_PORT_NO;
--- /dev/null
+From 54e74b87e2a9941c6fa82189f270b47cceeba714 Mon Sep 17 00:00:00 2001
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Date: Fri, 28 Jan 2011 23:33:29 -0800
+Subject: Input: rc-keymap - return KEY_RESERVED for unknown mappings
+
+From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+commit 54e74b87e2a9941c6fa82189f270b47cceeba714 upstream.
+
+Do not respond with -EINVAL to EVIOCGKEYCODE for not-yet-mapped
+scancodes, but rather return KEY_RESERVED.
+
+This fixes breakage with Ubuntu's input-kbd utility that stopped
+returning full keymaps for remote controls.
+
+Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Tested-by: Mark Lord <kernel@teksavvy.com>
+Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/media/IR/ir-keytable.c | 28 +++++++++++++++++-----------
+ 1 file changed, 17 insertions(+), 11 deletions(-)
+
+--- a/drivers/media/IR/ir-keytable.c
++++ b/drivers/media/IR/ir-keytable.c
+@@ -374,21 +374,27 @@ static int ir_getkeycode(struct input_de
+ index = ir_lookup_by_scancode(rc_tab, scancode);
+ }
+
+- if (index >= rc_tab->len) {
+- if (!(ke->flags & INPUT_KEYMAP_BY_INDEX))
+- IR_dprintk(1, "unknown key for scancode 0x%04x\n",
+- scancode);
++ if (index < rc_tab->len) {
++ entry = &rc_tab->scan[index];
++
++ ke->index = index;
++ ke->keycode = entry->keycode;
++ ke->len = sizeof(entry->scancode);
++ memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode));
++
++ } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) {
++ /*
++ * We do not really know the valid range of scancodes
++ * so let's respond with KEY_RESERVED to anything we
++ * do not have mapping for [yet].
++ */
++ ke->index = index;
++ ke->keycode = KEY_RESERVED;
++ } else {
+ retval = -EINVAL;
+ goto out;
+ }
+
+- entry = &rc_tab->scan[index];
+-
+- ke->index = index;
+- ke->keycode = entry->keycode;
+- ke->len = sizeof(entry->scancode);
+- memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode));
+-
+ retval = 0;
+
+ out:
--- /dev/null
+From 13d28e4917fb6cf6898e8998f01ab83b3f468aeb Mon Sep 17 00:00:00 2001
+From: Matthias Schwarzott <zzam@gentoo.org>
+Date: Sun, 7 Nov 2010 10:57:13 -0300
+Subject: [media] IX2505V: i2c transfer error code ignored
+
+From: Matthias Schwarzott <zzam@gentoo.org>
+
+commit 13d28e4917fb6cf6898e8998f01ab83b3f468aeb upstream.
+
+It seems that ix2505v driver ignores a i2c error in ix2505v_read_status_reg.
+This looks like a typing error using (ret = 1) instead of correct (ret == 1).
+
+Acked-by: Malcolm Priestley <tvboxspy@gmail.com>
+Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/dvb/frontends/ix2505v.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/media/dvb/frontends/ix2505v.c
++++ b/drivers/media/dvb/frontends/ix2505v.c
+@@ -72,7 +72,7 @@ static int ix2505v_read_status_reg(struc
+ ret = i2c_transfer(state->i2c, msg, 1);
+ deb_i2c("Read %s ", __func__);
+
+- return (ret = 1) ? (int) b2[0] : -1;
++ return (ret == 1) ? (int) b2[0] : -1;
+ }
+
+ static int ix2505v_write(struct ix2505v_state *state, u8 buf[], u8 count)
--- /dev/null
+From 9ee91f7fb550a4c82f82d9818e42493484c754af Mon Sep 17 00:00:00 2001
+From: James Bottomley <James.Bottomley@suse.de>
+Date: Thu, 20 Jan 2011 17:26:44 -0600
+Subject: [SCSI] libsas: fix runaway error handler problem
+
+From: James Bottomley <James.Bottomley@suse.de>
+
+commit 9ee91f7fb550a4c82f82d9818e42493484c754af upstream.
+
+libsas makes use of scsi_schedule_eh() but forgets to clear the
+host_eh_scheduled flag in its error handling routine. Because of this,
+the error handler thread never gets to sleep; it's constantly awake and
+trying to run the error routine leading to console spew and inability to
+run anything else (at least on a UP system). The fix is to clear the
+flag as we splice the work queue.
+
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/libsas/sas_scsi_host.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/scsi/libsas/sas_scsi_host.c
++++ b/drivers/scsi/libsas/sas_scsi_host.c
+@@ -647,6 +647,7 @@ void sas_scsi_recover_host(struct Scsi_H
+
+ spin_lock_irqsave(shost->host_lock, flags);
+ list_splice_init(&shost->eh_cmd_q, &eh_work_q);
++ shost->host_eh_scheduled = 0;
+ spin_unlock_irqrestore(shost->host_lock, flags);
+
+ SAS_DPRINTK("Enter %s\n", __func__);
--- /dev/null
+From d685c262083dcd5fd98b7499b22a377a3225229c Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Tue, 17 Nov 2009 13:16:37 +0530
+Subject: [SCSI] mpt2sas: add missing initialization of scsih_cmds
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit d685c262083dcd5fd98b7499b22a377a3225229c upstream.
+
+Internal command scsih_cmds init is included in mpt2sas_base_attach.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/mpt2sas/mpt2sas_base.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
+@@ -3662,6 +3662,11 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPT
+ ioc->scsih_cmds.status = MPT2_CMD_NOT_USED;
+ mutex_init(&ioc->scsih_cmds.mutex);
+
++ /* scsih internal command bits */
++ ioc->scsih_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL);
++ ioc->scsih_cmds.status = MPT2_CMD_NOT_USED;
++ mutex_init(&ioc->scsih_cmds.mutex);
++
+ /* task management internal command bits */
+ ioc->tm_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL);
+ ioc->tm_cmds.status = MPT2_CMD_NOT_USED;
--- /dev/null
+From 11e1b961ab067ee3acaf723531da4d3f23e1d6f7 Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Tue, 4 Jan 2011 11:34:57 +0530
+Subject: [SCSI] mpt2sas: Correct resizing calculation for max_queue_depth
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit 11e1b961ab067ee3acaf723531da4d3f23e1d6f7 upstream.
+
+The ioc->hba_queue_depth is not properly resized when the controller
+firmware reports that it supports more outstanding IO than what can be fit
+inside the reply descriptor pool depth. This is reproduced by setting the
+controller global credits larger than 30,000. The bug results in an
+incorrect sizing of the queues. The fix is to resize the queue_size by
+dividing queue_diff by two.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/mpt2sas/mpt2sas_base.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
+@@ -2057,9 +2057,9 @@ _base_allocate_memory_pools(struct MPT2S
+ /* adjust hba_queue_depth, reply_free_queue_depth,
+ * and queue_size
+ */
+- ioc->hba_queue_depth -= queue_diff;
+- ioc->reply_free_queue_depth -= queue_diff;
+- queue_size -= queue_diff;
++ ioc->hba_queue_depth -= (queue_diff / 2);
++ ioc->reply_free_queue_depth -= (queue_diff / 2);
++ queue_size = facts->MaxReplyDescriptorPostQueueDepth;
+ }
+ ioc->reply_post_queue_depth = queue_size;
+
--- /dev/null
+From 4dc2757a2e9a9d1f2faee4fc6119276fc0061c16 Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Tue, 4 Jan 2011 11:32:13 +0530
+Subject: [SCSI] mpt2sas: Fix device removal handshake for zoned devices
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit 4dc2757a2e9a9d1f2faee4fc6119276fc0061c16 upstream.
+
+When zoning end devices, the driver is not sending device
+removal handshake alogrithm to firmware. This results in controller
+firmware not sending sas topology add events the next time the device is
+added. The fix is the driver should be doing the device removal handshake
+even though the PHYSTATUS_VACANT bit is set in the PhyStatus of the
+event data. The current design is avoiding the handshake when the
+VACANT bit is set in the phy status.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@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 | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+@@ -2957,9 +2957,6 @@ _scsih_check_topo_delete_events(struct M
+ u16 handle;
+
+ for (i = 0 ; i < event_data->NumEntries; i++) {
+- if (event_data->PHY[i].PhyStatus &
+- MPI2_EVENT_SAS_TOPO_PHYSTATUS_VACANT)
+- continue;
+ handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle);
+ if (!handle)
+ continue;
--- /dev/null
+From 3a9c913a3e57b170887d39456e04c18f2305ec67 Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Tue, 4 Jan 2011 11:40:23 +0530
+Subject: [SCSI] mpt2sas: fix Integrated Raid unsynced on shutdown problem
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit 3a9c913a3e57b170887d39456e04c18f2305ec67 upstream.
+
+Issue:
+IR shutdown(sending) and IR shutdown(complete) messages not
+listed in /var/log/messages when driver is removed.
+
+The driver needs to issue a MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED
+request when the driver is unloaded so the IR metadata journal is updated.
+If this request is not sent, then the volume would need a "check
+consistency" issued on the next bootup if the volume was roamed from one
+initiator to another. The current driver supports this feature only when the
+system is rebooted, however this also need to be supported if the driver is
+unloaded
+
+Fix:
+To fix this issue, the driver is going
+to need to call the _scsih_ir_shutdown prior to reporting
+the volumes missing from the OS, hence the device handles
+are still present.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@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 | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+@@ -6687,6 +6687,7 @@ _scsih_remove(struct pci_dev *pdev)
+ destroy_workqueue(wq);
+
+ /* release all the volumes */
++ _scsih_ir_shutdown(ioc);
+ list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list,
+ list) {
+ if (raid_device->starget) {
--- /dev/null
+From efe82a16bc0f9f9e1fc8fa706eb0309fcd57770a Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Tue, 4 Jan 2011 11:34:17 +0530
+Subject: [SCSI] mpt2sas: fix internal device reset for older firmware prior to MPI Rev K
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit efe82a16bc0f9f9e1fc8fa706eb0309fcd57770a upstream.
+
+The "internal device reset complete" event is not supported
+for older firmware prior to MPI Rev K We added
+a check in the driver so the "internal device reset" event is
+ignored for older firmware. When ignored, the tm_busy flag doesn't
+get set nor cleared. Without this fix, IO queues would be froozen
+indefinetly after the "internal device reset" event, as the "complete" event
+never sent to clear the flag.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@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 | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+@@ -4939,6 +4939,12 @@ _scsih_sas_device_status_change_event(st
+ event_data);
+ #endif
+
++ /* In MPI Revision K (0xC), the internal device reset complete was
++ * implemented, so avoid setting tm_busy flag for older firmware.
++ */
++ if ((ioc->facts.HeaderVersion >> 8) < 0xC)
++ return;
++
+ if (event_data->ReasonCode !=
+ MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET &&
+ event_data->ReasonCode !=
--- /dev/null
+From ec07a053597bdab51cbd23619f9f9f392712508a Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Wed, 5 Jan 2011 17:54:32 +0530
+Subject: [SCSI] mpt2sas: Fix the race between broadcast asyn event and scsi command completion
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit ec07a053597bdab51cbd23619f9f9f392712508a upstream.
+
+False timeout after hard resets, there were two issues which leads
+to timeout.
+(1) Panic because of invalid memory access in the broadcast asyn
+event processing routine due to a race between accessing the scsi command
+pointer from broadcast asyn event processing thread and completing
+the same scsi command from the interrupt context.
+(2) Broadcast asyn event notifcations are not handled due to events
+ignored while the broadcast asyn event is activity being processed
+from the event process kernel thread.
+
+In addition, changed the ABRT_TASK_SET to ABORT_TASK in the
+broadcast async event processing routine. This is less disruptive to other
+request that generate Broadcast Asyn Primitives besides target
+reset. e.g clear reservations, microcode download,and mode select.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@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 | 54 +++++++++++++++++++++++++++++------
+ 1 file changed, 45 insertions(+), 9 deletions(-)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+@@ -819,7 +819,7 @@ _scsih_is_end_device(u32 device_info)
+ }
+
+ /**
+- * mptscsih_get_scsi_lookup - returns scmd entry
++ * _scsih_scsi_lookup_get - returns scmd entry
+ * @ioc: per adapter object
+ * @smid: system request message index
+ *
+@@ -832,6 +832,28 @@ _scsih_scsi_lookup_get(struct MPT2SAS_AD
+ }
+
+ /**
++ * _scsih_scsi_lookup_get_clear - returns scmd entry
++ * @ioc: per adapter object
++ * @smid: system request message index
++ *
++ * Returns the smid stored scmd pointer.
++ * Then will derefrence the stored scmd pointer.
++ */
++static inline struct scsi_cmnd *
++_scsih_scsi_lookup_get_clear(struct MPT2SAS_ADAPTER *ioc, u16 smid)
++{
++ unsigned long flags;
++ struct scsi_cmnd *scmd;
++
++ spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
++ scmd = ioc->scsi_lookup[smid - 1].scmd;
++ ioc->scsi_lookup[smid - 1].scmd = NULL;
++ spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
++
++ return scmd;
++}
++
++/**
+ * _scsih_scsi_lookup_find_by_scmd - scmd lookup
+ * @ioc: per adapter object
+ * @smid: system request message index
+@@ -3183,7 +3205,7 @@ _scsih_flush_running_cmds(struct MPT2SAS
+ u16 count = 0;
+
+ for (smid = 1; smid <= ioc->scsiio_depth; smid++) {
+- scmd = _scsih_scsi_lookup_get(ioc, smid);
++ scmd = _scsih_scsi_lookup_get_clear(ioc, smid);
+ if (!scmd)
+ continue;
+ count++;
+@@ -3777,7 +3799,7 @@ _scsih_io_done(struct MPT2SAS_ADAPTER *i
+ u32 response_code = 0;
+
+ mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply);
+- scmd = _scsih_scsi_lookup_get(ioc, smid);
++ scmd = _scsih_scsi_lookup_get_clear(ioc, smid);
+ if (scmd == NULL)
+ return 1;
+
+@@ -5039,6 +5061,7 @@ _scsih_sas_broadcast_primative_event(str
+ struct fw_event_work *fw_event)
+ {
+ struct scsi_cmnd *scmd;
++ struct scsi_device *sdev;
+ u16 smid, handle;
+ u32 lun;
+ struct MPT2SAS_DEVICE *sas_device_priv_data;
+@@ -5049,12 +5072,17 @@ _scsih_sas_broadcast_primative_event(str
+ Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event->event_data;
+ #endif
+ u16 ioc_status;
++ unsigned long flags;
++ int r;
++
+ dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "broadcast primative: "
+ "phy number(%d), width(%d)\n", ioc->name, event_data->PhyNum,
+ event_data->PortWidth));
+ dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name,
+ __func__));
+
++ spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
++ ioc->broadcast_aen_busy = 0;
+ termination_count = 0;
+ query_count = 0;
+ mpi_reply = ioc->tm_cmds.reply;
+@@ -5062,7 +5090,8 @@ _scsih_sas_broadcast_primative_event(str
+ scmd = _scsih_scsi_lookup_get(ioc, smid);
+ if (!scmd)
+ continue;
+- sas_device_priv_data = scmd->device->hostdata;
++ sdev = scmd->device;
++ sas_device_priv_data = sdev->hostdata;
+ if (!sas_device_priv_data || !sas_device_priv_data->sas_target)
+ continue;
+ /* skip hidden raid components */
+@@ -5078,6 +5107,7 @@ _scsih_sas_broadcast_primative_event(str
+ lun = sas_device_priv_data->lun;
+ query_count++;
+
++ spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
+ mpt2sas_scsih_issue_tm(ioc, handle, 0, 0, lun,
+ MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK, smid, 30, NULL);
+ ioc->tm_cmds.status = MPT2_CMD_NOT_USED;
+@@ -5087,14 +5117,20 @@ _scsih_sas_broadcast_primative_event(str
+ (mpi_reply->ResponseCode ==
+ MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED ||
+ mpi_reply->ResponseCode ==
+- MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC))
++ MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC)) {
++ spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
+ continue;
+-
+- mpt2sas_scsih_issue_tm(ioc, handle, 0, 0, lun,
+- MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET, 0, 30, NULL);
++ }
++ r = mpt2sas_scsih_issue_tm(ioc, handle, sdev->channel, sdev->id,
++ sdev->lun, MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK, smid, 30,
++ scmd);
++ if (r == FAILED)
++ sdev_printk(KERN_WARNING, sdev, "task abort: FAILED "
++ "scmd(%p)\n", scmd);
+ termination_count += le32_to_cpu(mpi_reply->TerminationCount);
++ spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
+ }
+- ioc->broadcast_aen_busy = 0;
++ spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
+
+ dtmprintk(ioc, printk(MPT2SAS_INFO_FMT
+ "%s - exit, query_count = %d termination_count = %d\n",
--- /dev/null
+From 4224489f45b503f0a1f1cf310f76dc108f45689a Mon Sep 17 00:00:00 2001
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+Date: Tue, 4 Jan 2011 11:38:39 +0530
+Subject: [SCSI] mpt2sas: Kernel Panic during Large Topology discovery
+
+From: Kashyap, Desai <kashyap.desai@lsi.com>
+
+commit 4224489f45b503f0a1f1cf310f76dc108f45689a upstream.
+
+There was a configuration page timing out during the initial port
+enable at driver load time. The port enable would fail, and this would
+result in the driver unloading itself, meanwhile the driver was accessing
+freed memory in another context resulting in the panic. The fix is to
+prevent access to freed memory once the driver had issued the diag reset
+which woke up the sleeping port enable process. The routine
+_base_reset_handler was reorganized so the last sleeping process woken up was
+the port_enable.
+
+Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/mpt2sas/mpt2sas_base.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
++++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
+@@ -3791,6 +3791,8 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPT
+ static void
+ _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase)
+ {
++ mpt2sas_scsih_reset_handler(ioc, reset_phase);
++ mpt2sas_ctl_reset_handler(ioc, reset_phase);
+ switch (reset_phase) {
+ case MPT2_IOC_PRE_RESET:
+ dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: "
+@@ -3821,8 +3823,6 @@ _base_reset_handler(struct MPT2SAS_ADAPT
+ "MPT2_IOC_DONE_RESET\n", ioc->name, __func__));
+ break;
+ }
+- mpt2sas_scsih_reset_handler(ioc, reset_phase);
+- mpt2sas_ctl_reset_handler(ioc, reset_phase);
+ }
+
+ /**
+@@ -3876,6 +3876,7 @@ mpt2sas_base_hard_reset_handler(struct M
+ {
+ int r;
+ unsigned long flags;
++ u8 pe_complete = ioc->wait_for_port_enable_to_complete;
+
+ dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name,
+ __func__));
+@@ -3918,6 +3919,14 @@ mpt2sas_base_hard_reset_handler(struct M
+ if (r)
+ goto out;
+ _base_reset_handler(ioc, MPT2_IOC_AFTER_RESET);
++
++ /* If this hard reset is called while port enable is active, then
++ * there is no reason to call make_ioc_operational
++ */
++ if (pe_complete) {
++ r = -EFAULT;
++ goto out;
++ }
+ r = _base_make_ioc_operational(ioc, sleep_flag);
+ if (!r)
+ _base_reset_handler(ioc, MPT2_IOC_DONE_RESET);
--- /dev/null
+From 958c0ba403cb6a693b54be2389f9ef53377fa259 Mon Sep 17 00:00:00 2001
+From: Jan Glauber <jang@linux.vnet.ibm.com>
+Date: Wed, 5 Jan 2011 12:47:52 +0100
+Subject: [S390] qdio: use proper QEBSM operand for SIGA-R and SIGA-S
+
+From: Jan Glauber <jang@linux.vnet.ibm.com>
+
+commit 958c0ba403cb6a693b54be2389f9ef53377fa259 upstream.
+
+If QIOASSIST is enabled for a qdio device the SIGA instruction requires
+a modified function code. This function code modifier was missing for
+SIGA-R and SIGA-S which can lead to a kernel panic caused by an
+operand exception.
+
+Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/s390/cio/qdio.h | 6 ++++++
+ drivers/s390/cio/qdio_main.c | 43 ++++++++++++++++++++++++++++---------------
+ 2 files changed, 34 insertions(+), 15 deletions(-)
+
+--- a/drivers/s390/cio/qdio.h
++++ b/drivers/s390/cio/qdio.h
+@@ -91,6 +91,12 @@ enum qdio_irq_states {
+ #define AC1_SC_QEBSM_AVAILABLE 0x02 /* available for subchannel */
+ #define AC1_SC_QEBSM_ENABLED 0x01 /* enabled for subchannel */
+
++/* SIGA flags */
++#define QDIO_SIGA_WRITE 0x00
++#define QDIO_SIGA_READ 0x01
++#define QDIO_SIGA_SYNC 0x02
++#define QDIO_SIGA_QEBSM_FLAG 0x80
++
+ #ifdef CONFIG_64BIT
+ static inline int do_sqbs(u64 token, unsigned char state, int queue,
+ int *start, int *count)
+--- a/drivers/s390/cio/qdio_main.c
++++ b/drivers/s390/cio/qdio_main.c
+@@ -29,11 +29,12 @@ MODULE_AUTHOR("Utz Bacher <utz.bacher@de
+ MODULE_DESCRIPTION("QDIO base support");
+ MODULE_LICENSE("GPL");
+
+-static inline int do_siga_sync(struct subchannel_id schid,
+- unsigned int out_mask, unsigned int in_mask)
++static inline int do_siga_sync(unsigned long schid,
++ unsigned int out_mask, unsigned int in_mask,
++ unsigned int fc)
+ {
+- register unsigned long __fc asm ("0") = 2;
+- register struct subchannel_id __schid asm ("1") = schid;
++ register unsigned long __fc asm ("0") = fc;
++ register unsigned long __schid asm ("1") = schid;
+ register unsigned long out asm ("2") = out_mask;
+ register unsigned long in asm ("3") = in_mask;
+ int cc;
+@@ -47,10 +48,11 @@ static inline int do_siga_sync(struct su
+ return cc;
+ }
+
+-static inline int do_siga_input(struct subchannel_id schid, unsigned int mask)
++static inline int do_siga_input(unsigned long schid, unsigned int mask,
++ unsigned int fc)
+ {
+- register unsigned long __fc asm ("0") = 1;
+- register struct subchannel_id __schid asm ("1") = schid;
++ register unsigned long __fc asm ("0") = fc;
++ register unsigned long __schid asm ("1") = schid;
+ register unsigned long __mask asm ("2") = mask;
+ int cc;
+
+@@ -279,6 +281,8 @@ void qdio_init_buf_states(struct qdio_ir
+ static inline int qdio_siga_sync(struct qdio_q *q, unsigned int output,
+ unsigned int input)
+ {
++ unsigned long schid = *((u32 *) &q->irq_ptr->schid);
++ unsigned int fc = QDIO_SIGA_SYNC;
+ int cc;
+
+ if (!need_siga_sync(q))
+@@ -287,7 +291,12 @@ static inline int qdio_siga_sync(struct
+ DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-s:%1d", q->nr);
+ qperf_inc(q, siga_sync);
+
+- cc = do_siga_sync(q->irq_ptr->schid, output, input);
++ if (is_qebsm(q)) {
++ schid = q->irq_ptr->sch_token;
++ fc |= QDIO_SIGA_QEBSM_FLAG;
++ }
++
++ cc = do_siga_sync(schid, output, input, fc);
+ if (cc)
+ DBF_ERROR("%4x SIGA-S:%2d", SCH_NO(q), cc);
+ return cc;
+@@ -313,8 +322,8 @@ static inline int qdio_siga_sync_all(str
+
+ static int qdio_siga_output(struct qdio_q *q, unsigned int *busy_bit)
+ {
+- unsigned long schid;
+- unsigned int fc = 0;
++ unsigned long schid = *((u32 *) &q->irq_ptr->schid);
++ unsigned int fc = QDIO_SIGA_WRITE;
+ u64 start_time = 0;
+ int cc;
+
+@@ -323,11 +332,8 @@ static int qdio_siga_output(struct qdio_
+
+ if (is_qebsm(q)) {
+ schid = q->irq_ptr->sch_token;
+- fc |= 0x80;
++ fc |= QDIO_SIGA_QEBSM_FLAG;
+ }
+- else
+- schid = *((u32 *)&q->irq_ptr->schid);
+-
+ again:
+ cc = do_siga_output(schid, q->mask, busy_bit, fc);
+
+@@ -347,12 +353,19 @@ again:
+
+ static inline int qdio_siga_input(struct qdio_q *q)
+ {
++ unsigned long schid = *((u32 *) &q->irq_ptr->schid);
++ unsigned int fc = QDIO_SIGA_READ;
+ int cc;
+
+ DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-r:%1d", q->nr);
+ qperf_inc(q, siga_read);
+
+- cc = do_siga_input(q->irq_ptr->schid, q->mask);
++ if (is_qebsm(q)) {
++ schid = q->irq_ptr->sch_token;
++ fc |= QDIO_SIGA_QEBSM_FLAG;
++ }
++
++ cc = do_siga_input(schid, q->mask, fc);
+ if (cc)
+ DBF_ERROR("%4x SIGA-R:%2d", SCH_NO(q), cc);
+ return cc;
--- /dev/null
+From e3c92215198cb6aa00ad38db2780faa6b72e0a3f Mon Sep 17 00:00:00 2001
+From: Mauro Carvalho Chehab <mchehab@redhat.com>
+Date: Thu, 6 Jan 2011 08:16:04 -0200
+Subject: [media] radio-aimslab.c: Fix gcc 4.5+ bug
+
+From: Mauro Carvalho Chehab <mchehab@redhat.com>
+
+commit e3c92215198cb6aa00ad38db2780faa6b72e0a3f upstream.
+
+gcc 4.5+ doesn't properly evaluate some inlined expressions.
+A previous patch were proposed by Andrew Morton using noinline.
+However, the entire inlined function is bogus, so let's just
+remove it and be happy.
+
+Reported-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/radio/radio-aimslab.c | 23 ++++++-----------------
+ 1 file changed, 6 insertions(+), 17 deletions(-)
+
+--- a/drivers/media/radio/radio-aimslab.c
++++ b/drivers/media/radio/radio-aimslab.c
+@@ -31,7 +31,6 @@
+ #include <linux/module.h> /* Modules */
+ #include <linux/init.h> /* Initdata */
+ #include <linux/ioport.h> /* request_region */
+-#include <linux/delay.h> /* udelay */
+ #include <linux/videodev2.h> /* kernel radio structs */
+ #include <linux/version.h> /* for KERNEL_VERSION MACRO */
+ #include <linux/io.h> /* outb, outb_p */
+@@ -71,27 +70,17 @@ static struct rtrack rtrack_card;
+
+ /* local things */
+
+-static void sleep_delay(long n)
+-{
+- /* Sleep nicely for 'n' uS */
+- int d = n / msecs_to_jiffies(1000);
+- if (!d)
+- udelay(n);
+- else
+- msleep(jiffies_to_msecs(d));
+-}
+-
+ static void rt_decvol(struct rtrack *rt)
+ {
+ outb(0x58, rt->io); /* volume down + sigstr + on */
+- sleep_delay(100000);
++ msleep(100);
+ outb(0xd8, rt->io); /* volume steady + sigstr + on */
+ }
+
+ static void rt_incvol(struct rtrack *rt)
+ {
+ outb(0x98, rt->io); /* volume up + sigstr + on */
+- sleep_delay(100000);
++ msleep(100);
+ outb(0xd8, rt->io); /* volume steady + sigstr + on */
+ }
+
+@@ -120,7 +109,7 @@ static int rt_setvol(struct rtrack *rt,
+
+ if (vol == 0) { /* volume = 0 means mute the card */
+ outb(0x48, rt->io); /* volume down but still "on" */
+- sleep_delay(2000000); /* make sure it's totally down */
++ msleep(2000); /* make sure it's totally down */
+ outb(0xd0, rt->io); /* volume steady, off */
+ rt->curvol = 0; /* track the volume state! */
+ mutex_unlock(&rt->lock);
+@@ -155,7 +144,7 @@ static void send_0_byte(struct rtrack *r
+ outb_p(128+64+16+8+ 1, rt->io); /* on + wr-enable + data low */
+ outb_p(128+64+16+8+2+1, rt->io); /* clock */
+ }
+- sleep_delay(1000);
++ msleep(1);
+ }
+
+ static void send_1_byte(struct rtrack *rt)
+@@ -169,7 +158,7 @@ static void send_1_byte(struct rtrack *r
+ outb_p(128+64+16+8+4+2+1, rt->io); /* clock */
+ }
+
+- sleep_delay(1000);
++ msleep(1);
+ }
+
+ static int rt_setfreq(struct rtrack *rt, unsigned long freq)
+@@ -420,7 +409,7 @@ static int __init rtrack_init(void)
+
+ /* this ensures that the volume is all the way down */
+ outb(0x48, rt->io); /* volume down but still "on" */
+- sleep_delay(2000000); /* make sure it's totally down */
++ msleep(2000); /* make sure it's totally down */
+ outb(0xc0, rt->io); /* steady volume, mute card */
+
+ if (video_register_device(&rt->vdev, VFL_TYPE_RADIO, radio_nr) < 0) {
ath9k_hw-fix-system-hang-when-resuming-from-s3-s4.patch
ath9k-fix-race-conditions-when-stop-device.patch
ath-missed-to-clear-key4-of-micentry.patch
+qdio-use-proper-qebsm-operand-for-siga-r-and-siga-s.patch
+zcrypt-fix-check-to-look-for-facility-bits-2-65.patch
+fix-medium-error-problems-with-some-arrays-which-can-cause-data-corruption.patch
+libsas-fix-runaway-error-handler-problem.patch
+mpt2sas-fix-integrated-raid-unsynced-on-shutdown-problem.patch
+fix-incorrect-value-of-scsi_max_sg_chain_segments-due-to-include-file-ordering.patch
+mpt2sas-fix-device-removal-handshake-for-zoned-devices.patch
+mpt2sas-fix-internal-device-reset-for-older-firmware-prior-to-mpi-rev-k.patch
+mpt2sas-fix-the-race-between-broadcast-asyn-event-and-scsi-command-completion.patch
+mpt2sas-correct-resizing-calculation-for-max_queue_depth.patch
+mpt2sas-add-missing-initialization-of-scsih_cmds.patch
+mpt2sas-kernel-panic-during-large-topology-discovery.patch
+e1000-fix-return-value-not-set-on-error.patch
+cfg80211-pass-the-reg-hint-initiator-to-helpers.patch
+cfg80211-fix-allowing-country-ies-for-wiphy_flag_strict_regulatory.patch
+cfg80211-fix-disabling-channels-based-on-hints.patch
+radio-aimslab.c-fix-gcc-4.5-bug.patch
+em28xx-fix-audio-input-for-terratec-grabby.patch
+ix2505v-i2c-transfer-error-code-ignored.patch
+alsa-hda-create-mixers-on-alc887.patch
+alsa-hda-add-missing-nid-0x19-fixup-for-sony-vaio.patch
+alsa-hda-don-t-refer-eld-when-unplugged.patch
+alsa-hda-fix-null-derefence-with-a-single-mic-in-stac-auto-mic-detection.patch
+alsa-hda-fix-multi-headphone-handling-for-realtek-codecs.patch
+alsa-hda-use-vostro-model-quirk-for-dell-vostro-1014.patch
+alsa-hda-disable-4-6-channels-on-some-nvidia-gpus.patch
+alsa-hda-add-static_hdmi_pcm-option-to-hdmi-codec-parser.patch
+alsa-au88x0-limit-number-of-channels-to-fix-oops-via-oss-emu.patch
+alsa-fix-invalid-hardware.h-include-in-ac97c-for-avr32-architecture.patch
+alsa-hda-fix-dmesg-output-of-hdmi-supported-bits.patch
+alsa-hda-fix-memory-leaks-in-conexant-jack-arrays.patch
+input-i8042-introduce-notimeout-blacklist-for-dell-vostro-v13.patch
+input-bcm5974-add-support-for-macbookair3.patch
+input-rc-keymap-return-key_reserved-for-unknown-mappings.patch
--- /dev/null
+From 53ec24b1e6c7118a127cf029a1519a2ce55268ec Mon Sep 17 00:00:00 2001
+From: Felix Beck <felix.beck@de.ibm.com>
+Date: Wed, 5 Jan 2011 12:46:44 +0100
+Subject: [S390] zcrypt: Fix check to look for facility bits 2 & 65
+
+From: Felix Beck <felix.beck@de.ibm.com>
+
+commit 53ec24b1e6c7118a127cf029a1519a2ce55268ec upstream.
+
+Fix the check for ap interupts to look for facility bits 2 and 65.
+Make sure that we only register interrupts for aps, if the machine
+has ap interrupt support.
+
+This patch is relevant only for the 2.6.37 stable series.
+
+Signed-off-by: Felix Beck <felix.beck@de.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/s390/crypto/ap_bus.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/s390/crypto/ap_bus.c
++++ b/drivers/s390/crypto/ap_bus.c
+@@ -154,7 +154,7 @@ static inline int ap_instructions_availa
+ */
+ static int ap_interrupts_available(void)
+ {
+- return test_facility(1) && test_facility(2);
++ return test_facility(2) && test_facility(65);
+ }
+
+ /**