--- /dev/null
+From 6ebb8a4a43e34f999ab36f27f972f3cd751cda4f Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Wed, 30 Mar 2011 08:24:25 +0200
+Subject: ALSA: ens1371: fix Creative Ectiva support
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit 6ebb8a4a43e34f999ab36f27f972f3cd751cda4f upstream.
+
+To make the EV1938 chip work, add a magic bit and an extra delay.
+
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Tested-by: Tino Schmidt <mailtinoshomepage@gmx.net>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/pci/ens1370.c | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+--- a/sound/pci/ens1370.c
++++ b/sound/pci/ens1370.c
+@@ -229,6 +229,7 @@ MODULE_PARM_DESC(lineio, "Line In to Rea
+ #define ES_REG_1371_CODEC 0x14 /* W/R: Codec Read/Write register address */
+ #define ES_1371_CODEC_RDY (1<<31) /* codec ready */
+ #define ES_1371_CODEC_WIP (1<<30) /* codec register access in progress */
++#define EV_1938_CODEC_MAGIC (1<<26)
+ #define ES_1371_CODEC_PIRD (1<<23) /* codec read/write select register */
+ #define ES_1371_CODEC_WRITE(a,d) ((((a)&0x7f)<<16)|(((d)&0xffff)<<0))
+ #define ES_1371_CODEC_READS(a) ((((a)&0x7f)<<16)|ES_1371_CODEC_PIRD)
+@@ -603,12 +604,18 @@ static void snd_es1370_codec_write(struc
+
+ #ifdef CHIP1371
+
++static inline bool is_ev1938(struct ensoniq *ensoniq)
++{
++ return ensoniq->pci->device == 0x8938;
++}
++
+ static void snd_es1371_codec_write(struct snd_ac97 *ac97,
+ unsigned short reg, unsigned short val)
+ {
+ struct ensoniq *ensoniq = ac97->private_data;
+- unsigned int t, x;
++ unsigned int t, x, flag;
+
++ flag = is_ev1938(ensoniq) ? EV_1938_CODEC_MAGIC : 0;
+ mutex_lock(&ensoniq->src_mutex);
+ for (t = 0; t < POLL_COUNT; t++) {
+ if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
+@@ -630,7 +637,8 @@ static void snd_es1371_codec_write(struc
+ 0x00010000)
+ break;
+ }
+- outl(ES_1371_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1371_CODEC));
++ outl(ES_1371_CODEC_WRITE(reg, val) | flag,
++ ES_REG(ensoniq, 1371_CODEC));
+ /* restore SRC reg */
+ snd_es1371_wait_src_ready(ensoniq);
+ outl(x, ES_REG(ensoniq, 1371_SMPRATE));
+@@ -647,8 +655,9 @@ static unsigned short snd_es1371_codec_r
+ unsigned short reg)
+ {
+ struct ensoniq *ensoniq = ac97->private_data;
+- unsigned int t, x, fail = 0;
++ unsigned int t, x, flag, fail = 0;
+
++ flag = is_ev1938(ensoniq) ? EV_1938_CODEC_MAGIC : 0;
+ __again:
+ mutex_lock(&ensoniq->src_mutex);
+ for (t = 0; t < POLL_COUNT; t++) {
+@@ -671,7 +680,8 @@ static unsigned short snd_es1371_codec_r
+ 0x00010000)
+ break;
+ }
+- outl(ES_1371_CODEC_READS(reg), ES_REG(ensoniq, 1371_CODEC));
++ outl(ES_1371_CODEC_READS(reg) | flag,
++ ES_REG(ensoniq, 1371_CODEC));
+ /* restore SRC reg */
+ snd_es1371_wait_src_ready(ensoniq);
+ outl(x, ES_REG(ensoniq, 1371_SMPRATE));
+@@ -683,6 +693,11 @@ static unsigned short snd_es1371_codec_r
+ /* now wait for the stinkin' data (RDY) */
+ for (t = 0; t < POLL_COUNT; t++) {
+ if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) {
++ if (is_ev1938(ensoniq)) {
++ for (t = 0; t < 100; t++)
++ inl(ES_REG(ensoniq, CONTROL));
++ x = inl(ES_REG(ensoniq, 1371_CODEC));
++ }
+ mutex_unlock(&ensoniq->src_mutex);
+ return ES_1371_CODEC_READ(x);
+ }
--- /dev/null
+From 840126579da56edae8ecc4a0d85198f742982f10 Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Thu, 31 Mar 2011 09:36:19 +0200
+Subject: ALSA: HDA: Add dock mic quirk for Lenovo Thinkpad X220
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+commit 840126579da56edae8ecc4a0d85198f742982f10 upstream.
+
+This quirk is needed for the docking station mic of
+Lenovo Thinkpad X220 to function correctly.
+
+BugLink: http://bugs.launchpad.net/bugs/746259
+Tested-by: James Ferguson <james.ferguson@canonical.com>
+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_conexant.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -3130,6 +3130,7 @@ static struct snd_pci_quirk cxt5066_cfg_
+ SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
+ SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
+ SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
++ SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD),
+ SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
+ SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
+ {}
--- /dev/null
+From b2cb1292b1c7c73abbdc0e07ef3aab056fc2615f Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Tue, 5 Apr 2011 07:55:24 +0200
+Subject: ALSA: HDA: Fix dock mic for Lenovo X220-tablet
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+commit b2cb1292b1c7c73abbdc0e07ef3aab056fc2615f upstream.
+
+Without the "thinkpad" quirk, the dock mic in
+Lenovo X220 tablet edition won't work.
+
+BugLink: http://bugs.launchpad.net/bugs/751033
+Tested-by: James Ferguson <james.ferguson@canonical.com>
+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_conexant.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -3131,6 +3131,7 @@ static struct snd_pci_quirk cxt5066_cfg_
+ SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
+ SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
+ SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD),
++ SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT5066_THINKPAD),
+ SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
+ SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
+ {}
--- /dev/null
+From 262ac22d21ee2bf3e1655b2e5e45cc94b356e62f Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Thu, 7 Apr 2011 11:43:00 +0200
+Subject: ALSA: HDA: Fix single internal mic on ALC275 (Sony Vaio VPCSB1C5E)
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+commit 262ac22d21ee2bf3e1655b2e5e45cc94b356e62f upstream.
+
+In cases where there is only one internal mic connected to ADC 0x11,
+alc275_setup_dual_adc won't handle the case, so we need to add the
+ADC node to the array of candidates.
+
+BugLink: http://bugs.launchpad.net/bugs/752792
+Reported-by: Vincenzo Pii
+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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -14191,7 +14191,7 @@ static hda_nid_t alc269vb_capsrc_nids[1]
+ };
+
+ static hda_nid_t alc269_adc_candidates[] = {
+- 0x08, 0x09, 0x07,
++ 0x08, 0x09, 0x07, 0x11,
+ };
+
+ #define alc269_modes alc260_modes
--- /dev/null
+From 1f348522844bb1f6e7b10d50b9e8aa89a2511b09 Mon Sep 17 00:00:00 2001
+From: Aaron Plattner <aplattner@nvidia.com>
+Date: Wed, 6 Apr 2011 17:19:04 -0700
+Subject: ALSA: hda - HDMI: Fix MCP7x audio infoframe checksums
+
+From: Aaron Plattner <aplattner@nvidia.com>
+
+commit 1f348522844bb1f6e7b10d50b9e8aa89a2511b09 upstream.
+
+The MCP7x hardware computes the audio infoframe channel count
+automatically, but requires the audio driver to set the audio
+infoframe checksum manually via the Nv_VERB_SET_Info_Frame_Checksum
+control verb.
+
+When audio starts playing, nvhdmi_8ch_7x_pcm_prepare sets the checksum
+to (0x71 - chan - chanmask). For example, for 2ch audio, chan == 1
+and chanmask == 0 so the checksum is set to 0x70. When audio playback
+finishes and the device is closed, nvhdmi_8ch_7x_pcm_close resets the
+channel formats, causing the channel count to revert to 8ch. Since
+the checksum is not reset, the hardware starts generating audio
+infoframes with invalid checksums. This causes some displays to blank
+the video.
+
+Fix this by updating the checksum and channel mask when the device is
+closed and also when it is first initialized. In addition, make sure
+that the channel mask is appropriate for an 8ch infoframe by setting
+it to 0x13 (FL FR LFE FC RL RR RLC RRC).
+
+Signed-off-by: Aaron Plattner <aplattner@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 | 70 ++++++++++++++++++++++++++++-----------------
+ 1 file changed, 44 insertions(+), 26 deletions(-)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1276,6 +1276,39 @@ static int simple_playback_pcm_prepare(s
+ stream_tag, format, substream);
+ }
+
++static void nvhdmi_8ch_7x_set_info_frame_parameters(struct hda_codec *codec,
++ int channels)
++{
++ unsigned int chanmask;
++ int chan = channels ? (channels - 1) : 1;
++
++ switch (channels) {
++ default:
++ case 0:
++ case 2:
++ chanmask = 0x00;
++ break;
++ case 4:
++ chanmask = 0x08;
++ break;
++ case 6:
++ chanmask = 0x0b;
++ break;
++ case 8:
++ chanmask = 0x13;
++ break;
++ }
++
++ /* Set the audio infoframe channel allocation and checksum fields. The
++ * channel count is computed implicitly by the hardware. */
++ snd_hda_codec_write(codec, 0x1, 0,
++ Nv_VERB_SET_Channel_Allocation, chanmask);
++
++ snd_hda_codec_write(codec, 0x1, 0,
++ Nv_VERB_SET_Info_Frame_Checksum,
++ (0x71 - chan - chanmask));
++}
++
+ static int nvhdmi_8ch_7x_pcm_close(struct hda_pcm_stream *hinfo,
+ struct hda_codec *codec,
+ struct snd_pcm_substream *substream)
+@@ -1294,6 +1327,10 @@ static int nvhdmi_8ch_7x_pcm_close(struc
+ AC_VERB_SET_STREAM_FORMAT, 0);
+ }
+
++ /* The audio hardware sends a channel count of 0x7 (8ch) when all the
++ * streams are disabled. */
++ nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8);
++
+ return snd_hda_multi_out_dig_close(codec, &spec->multiout);
+ }
+
+@@ -1304,37 +1341,16 @@ static int nvhdmi_8ch_7x_pcm_prepare(str
+ struct snd_pcm_substream *substream)
+ {
+ int chs;
+- unsigned int dataDCC1, dataDCC2, chan, chanmask, channel_id;
++ unsigned int dataDCC1, dataDCC2, channel_id;
+ int i;
+
+ mutex_lock(&codec->spdif_mutex);
+
+ chs = substream->runtime->channels;
+- chan = chs ? (chs - 1) : 1;
+
+- switch (chs) {
+- default:
+- case 0:
+- case 2:
+- chanmask = 0x00;
+- break;
+- case 4:
+- chanmask = 0x08;
+- break;
+- case 6:
+- chanmask = 0x0b;
+- break;
+- case 8:
+- chanmask = 0x13;
+- break;
+- }
+ dataDCC1 = AC_DIG1_ENABLE | AC_DIG1_COPYRIGHT;
+ dataDCC2 = 0x2;
+
+- /* set the Audio InforFrame Channel Allocation */
+- snd_hda_codec_write(codec, 0x1, 0,
+- Nv_VERB_SET_Channel_Allocation, chanmask);
+-
+ /* turn off SPDIF once; otherwise the IEC958 bits won't be updated */
+ if (codec->spdif_status_reset && (codec->spdif_ctls & AC_DIG1_ENABLE))
+ snd_hda_codec_write(codec,
+@@ -1409,10 +1425,7 @@ static int nvhdmi_8ch_7x_pcm_prepare(str
+ }
+ }
+
+- /* set the Audio Info Frame Checksum */
+- snd_hda_codec_write(codec, 0x1, 0,
+- Nv_VERB_SET_Info_Frame_Checksum,
+- (0x71 - chan - chanmask));
++ nvhdmi_8ch_7x_set_info_frame_parameters(codec, chs);
+
+ mutex_unlock(&codec->spdif_mutex);
+ return 0;
+@@ -1508,6 +1521,11 @@ static int patch_nvhdmi_8ch_7x(struct hd
+ spec->multiout.max_channels = 8;
+ spec->pcm_playback = &nvhdmi_pcm_playback_8ch_7x;
+ codec->patch_ops = nvhdmi_patch_ops_8ch_7x;
++
++ /* Initialize the audio infoframe channel mask and checksum to something
++ * valid */
++ nvhdmi_8ch_7x_set_info_frame_parameters(codec, 8);
++
+ return 0;
+ }
+
--- /dev/null
+From 12ff414e2e4512f59fe191dc18e856e2939a1c79 Mon Sep 17 00:00:00 2001
+From: Kelly Anderson <kelly@silka.with-linux.com>
+Date: Fri, 1 Apr 2011 11:58:25 +0200
+Subject: ALSA: pcm: fix infinite loop in snd_pcm_update_hw_ptr0()
+
+From: Kelly Anderson <kelly@silka.with-linux.com>
+
+commit 12ff414e2e4512f59fe191dc18e856e2939a1c79 upstream.
+
+When period interrupts are disabled, snd_pcm_update_hw_ptr0() compares
+the current time against the time estimated for the current hardware
+pointer to detect xruns. The somewhat fuzzy threshold in the while loop
+makes it possible that hdelta becomes negative; the comparison being
+done with unsigned types then makes the loop go through the entire 263
+negative range, and, depending on the value, never reach an unsigned
+value that is small enough to stop the loop. Doing this with interrupts
+disabled results in the machine locking up.
+
+To prevent this, ensure that the loop condition uses signed types for
+both operands so that the comparison is correctly done.
+
+Many thanks to Kelly Anderson for debugging this.
+
+Reported-by: Nix <nix@esperi.org.uk>
+Reported-by: "Christopher K." <c.krooss@googlemail.com>
+Reported-and-tested-by: Kelly Anderson <kelly@silka.with-linux.com>
+Signed-off-by: Kelly Anderson <kelly@silka.with-linux.com>
+[cl: remove unneeded casts; use a temp variable]
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/core/pcm_lib.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/sound/core/pcm_lib.c
++++ b/sound/core/pcm_lib.c
+@@ -375,6 +375,7 @@ static int snd_pcm_update_hw_ptr0(struct
+ }
+
+ if (runtime->no_period_wakeup) {
++ snd_pcm_sframes_t xrun_threshold;
+ /*
+ * Without regular period interrupts, we have to check
+ * the elapsed time to detect xruns.
+@@ -383,7 +384,8 @@ static int snd_pcm_update_hw_ptr0(struct
+ if (jdelta < runtime->hw_ptr_buffer_jiffies / 2)
+ goto no_delta_check;
+ hdelta = jdelta - delta * HZ / runtime->rate;
+- while (hdelta > runtime->hw_ptr_buffer_jiffies / 2 + 1) {
++ xrun_threshold = runtime->hw_ptr_buffer_jiffies / 2 + 1;
++ while (hdelta > xrun_threshold) {
+ delta += runtime->buffer_size;
+ hw_base += runtime->buffer_size;
+ if (hw_base >= runtime->boundary)
--- /dev/null
+From 0ca03cd7d0fa3bfbd56958136a10f19733c4ce12 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Wed, 23 Mar 2011 20:45:40 +0000
+Subject: ASoC: Explicitly say registerless widgets have no register
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 0ca03cd7d0fa3bfbd56958136a10f19733c4ce12 upstream.
+
+This stops code that handles widgets generically from attempting to access
+registers for these widgets.
+
+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>
+
+---
+ include/sound/soc-dapm.h | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/include/sound/soc-dapm.h
++++ b/include/sound/soc-dapm.h
+@@ -45,25 +45,25 @@
+ /* platform domain */
+ #define SND_SOC_DAPM_INPUT(wname) \
+ { .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0}
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM }
+ #define SND_SOC_DAPM_OUTPUT(wname) \
+ { .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0}
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM }
+ #define SND_SOC_DAPM_MIC(wname, wevent) \
+ { .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0, .event = wevent, \
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
+ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
+ #define SND_SOC_DAPM_HP(wname, wevent) \
+ { .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0, .event = wevent, \
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
+ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
+ #define SND_SOC_DAPM_SPK(wname, wevent) \
+ { .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0, .event = wevent, \
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
+ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
+ #define SND_SOC_DAPM_LINE(wname, wevent) \
+ { .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0, .event = wevent, \
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
+ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
+
+ /* path domain */
+@@ -177,11 +177,11 @@
+ /* events that are pre and post DAPM */
+ #define SND_SOC_DAPM_PRE(wname, wevent) \
+ { .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0, .event = wevent, \
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
+ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD}
+ #define SND_SOC_DAPM_POST(wname, wevent) \
+ { .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \
+- .num_kcontrols = 0, .event = wevent, \
++ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
+ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}
+
+ /* stream domain */
--- /dev/null
+From 326b9bdc2a0e4d556a0f444085dca103bcd505de Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+Date: Sun, 27 Mar 2011 14:40:01 +0100
+Subject: ASoC: Fix CODEC device name for Corgi
+
+From: Mark Brown <broonie@opensource.wolfsonmicro.com>
+
+commit 326b9bdc2a0e4d556a0f444085dca103bcd505de upstream.
+
+Got typoed in the multi-component changes.
+
+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/pxa/corgi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/pxa/corgi.c
++++ b/sound/soc/pxa/corgi.c
+@@ -310,7 +310,7 @@ static struct snd_soc_dai_link corgi_dai
+ .cpu_dai_name = "pxa2xx-i2s",
+ .codec_dai_name = "wm8731-hifi",
+ .platform_name = "pxa-pcm-audio",
+- .codec_name = "wm8731-codec-0.001b",
++ .codec_name = "wm8731-codec.0-001b",
+ .init = corgi_wm8731_init,
+ .ops = &corgi_ops,
+ };
--- /dev/null
+From e1bb31b444668bc957c337d33803db7cb3330745 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <w.sang@pengutronix.de>
+Date: Fri, 25 Mar 2011 16:51:45 +0100
+Subject: ASoC: imx: fix burstsize for DMA
+
+From: Wolfram Sang <w.sang@pengutronix.de>
+
+commit e1bb31b444668bc957c337d33803db7cb3330745 upstream.
+
+SSI counts in words, the DMA engine in bytes. (Wrong) factor got removed
+in bf974a0 (ASoC i.MX: switch to new DMA api).
+
+Signed-off-by: Wolfram Sang <w.sang@pengutronix.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/imx/imx-pcm-dma-mx2.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/soc/imx/imx-pcm-dma-mx2.c
++++ b/sound/soc/imx/imx-pcm-dma-mx2.c
+@@ -110,12 +110,12 @@ static int imx_ssi_dma_alloc(struct snd_
+ slave_config.direction = DMA_TO_DEVICE;
+ slave_config.dst_addr = dma_params->dma_addr;
+ slave_config.dst_addr_width = buswidth;
+- slave_config.dst_maxburst = dma_params->burstsize;
++ slave_config.dst_maxburst = dma_params->burstsize * buswidth;
+ } else {
+ slave_config.direction = DMA_FROM_DEVICE;
+ slave_config.src_addr = dma_params->dma_addr;
+ slave_config.src_addr_width = buswidth;
+- slave_config.src_maxburst = dma_params->burstsize;
++ slave_config.src_maxburst = dma_params->burstsize * buswidth;
+ }
+
+ ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config);
--- /dev/null
+From 2c4cf17a52f04fbe929977252d5b8ab81d2c6e9b Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <w.sang@pengutronix.de>
+Date: Fri, 25 Mar 2011 16:51:44 +0100
+Subject: ASoC: imx: set watermarks for mx2-dma
+
+From: Wolfram Sang <w.sang@pengutronix.de>
+
+commit 2c4cf17a52f04fbe929977252d5b8ab81d2c6e9b upstream.
+
+They got accidently removed by f0fba2a (ASoC: multi-component - ASoC
+Multi-Component Support). Reintroduce them and get rid of the
+superfluous defines because the fiq-driver has its own hardcoded values.
+
+Signed-off-by: Wolfram Sang <w.sang@pengutronix.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/imx/imx-pcm-dma-mx2.c | 5 +++++
+ sound/soc/imx/imx-ssi.h | 3 ---
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+--- a/sound/soc/imx/imx-pcm-dma-mx2.c
++++ b/sound/soc/imx/imx-pcm-dma-mx2.c
+@@ -303,6 +303,11 @@ static struct snd_soc_platform_driver im
+
+ static int __devinit imx_soc_platform_probe(struct platform_device *pdev)
+ {
++ struct imx_ssi *ssi = platform_get_drvdata(pdev);
++
++ ssi->dma_params_tx.burstsize = 6;
++ ssi->dma_params_rx.burstsize = 4;
++
+ return snd_soc_register_platform(&pdev->dev, &imx_soc_platform_mx2);
+ }
+
+--- a/sound/soc/imx/imx-ssi.h
++++ b/sound/soc/imx/imx-ssi.h
+@@ -234,7 +234,4 @@ void imx_pcm_free(struct snd_pcm *pcm);
+ */
+ #define IMX_SSI_DMABUF_SIZE (64 * 1024)
+
+-#define DMA_RXFIFO_BURST 0x4
+-#define DMA_TXFIFO_BURST 0x6
+-
+ #endif /* _IMX_SSI_H */
--- /dev/null
+From 758f231ea280d0e5f01d537f26ad8f5c0e3de1cc Mon Sep 17 00:00:00 2001
+From: Alex Deucher <alexdeucher@gmail.com>
+Date: Mon, 4 Apr 2011 11:03:16 -0400
+Subject: drm/radeon/kms: add some new ontario pci ids
+
+From: Alex Deucher <alexdeucher@gmail.com>
+
+commit 758f231ea280d0e5f01d537f26ad8f5c0e3de1cc upstream.
+
+Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/drm/drm_pciids.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/include/drm/drm_pciids.h
++++ b/include/drm/drm_pciids.h
+@@ -458,6 +458,8 @@
+ {0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+ {0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+ {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
++ {0x1002, 0x9806, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
++ {0x1002, 0x9807, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
+ {0, 0, 0}
+
+ #define r128_PCI_IDS \
--- /dev/null
+From 97ea530f6fac1f9632b0c4792a2a56411454adbe Mon Sep 17 00:00:00 2001
+From: John Lindgren <john.lindgren@tds.net>
+Date: Thu, 24 Mar 2011 23:28:31 +0000
+Subject: drm/radeon/kms: add some sanity checks to obj info record parsingi (v2)
+
+From: John Lindgren <john.lindgren@tds.net>
+
+commit 97ea530f6fac1f9632b0c4792a2a56411454adbe upstream.
+
+Fixes:
+https://bugs.freedesktop.org/show_bug.cgi?id=35502
+
+agd5f: also add sanity check to connector records.
+
+v2: fix one more case.
+
+Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/gpu/drm/radeon/radeon_atombios.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/gpu/drm/radeon/radeon_atombios.c
++++ b/drivers/gpu/drm/radeon/radeon_atombios.c
+@@ -675,7 +675,8 @@ bool radeon_get_atom_connector_info_from
+ ATOM_ENCODER_CAP_RECORD *cap_record;
+ u16 caps = 0;
+
+- while (record->ucRecordType > 0 &&
++ while (record->ucRecordSize > 0 &&
++ record->ucRecordType > 0 &&
+ record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
+ switch (record->ucRecordType) {
+ case ATOM_ENCODER_CAP_RECORD_TYPE:
+@@ -720,7 +721,8 @@ bool radeon_get_atom_connector_info_from
+ break;
+ }
+
+- while (record->ucRecordType > 0 &&
++ while (record->ucRecordSize > 0 &&
++ record->ucRecordType > 0 &&
+ record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
+ switch (record->ucRecordType) {
+ case ATOM_I2C_RECORD_TYPE:
+@@ -782,10 +784,9 @@ bool radeon_get_atom_connector_info_from
+ ATOM_HPD_INT_RECORD *hpd_record;
+ ATOM_I2C_ID_CONFIG_ACCESS *i2c_config;
+
+- while (record->ucRecordType > 0
+- && record->
+- ucRecordType <=
+- ATOM_MAX_OBJECT_RECORD_NUMBER) {
++ while (record->ucRecordSize > 0 &&
++ record->ucRecordType > 0 &&
++ record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
+ switch (record->ucRecordType) {
+ case ATOM_I2C_RECORD_TYPE:
+ i2c_record =
--- /dev/null
+From cc5e0f08ca2a66fc4c6984ccff74fd529e969fac Mon Sep 17 00:00:00 2001
+From: Chase Douglas <chase.douglas@canonical.com>
+Date: Fri, 1 Apr 2011 17:03:39 -0400
+Subject: HID: hid-magicmouse: Increase evdev buffer size
+
+From: Chase Douglas <chase.douglas@canonical.com>
+
+commit cc5e0f08ca2a66fc4c6984ccff74fd529e969fac upstream.
+
+The evdev buffer isn't big enough when you get many fingers on the
+device. Bump up the buffer to a reasonable size, matching what other
+multitouch devices use. Without this change, events may be discarded in
+the evdev buffer before they are read.
+
+Reported-by: Simon Budig <simon@budig.de>
+Cc: Henrik Rydberg <rydberg@euromail.se>
+Cc: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+Acked-by: Henrik Rydberg <rydberg@euromail.se>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hid/hid-magicmouse.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/hid/hid-magicmouse.c
++++ b/drivers/hid/hid-magicmouse.c
+@@ -418,6 +418,8 @@ static void magicmouse_setup_input(struc
+ input_set_abs_params(input, ABS_MT_POSITION_Y, -2456,
+ 2565, 4, 0);
+ }
++
++ input_set_events_per_packet(input, 60);
+ }
+
+ if (report_undeciphered) {
--- /dev/null
+From d0de4dc584ec6aa3b26fffea320a8457827768fc Mon Sep 17 00:00:00 2001
+From: Eric Paris <eparis@redhat.com>
+Date: Tue, 5 Apr 2011 17:20:50 -0400
+Subject: inotify: fix double free/corruption of stuct user
+
+From: Eric Paris <eparis@redhat.com>
+
+commit d0de4dc584ec6aa3b26fffea320a8457827768fc upstream.
+
+On an error path in inotify_init1 a normal user can trigger a double
+free of struct user. This is a regression introduced by a2ae4cc9a16e
+("inotify: stop kernel memory leak on file creation failure").
+
+We fix this by making sure that if a group exists the user reference is
+dropped when the group is cleaned up. We should not explictly drop the
+reference on error and also drop the reference when the group is cleaned
+up.
+
+The new lifetime rules are that an inotify group lives from
+inotify_new_group to the last fsnotify_put_group. Since the struct user
+and inotify_devs are directly tied to this lifetime they are only
+changed/updated in those two locations. We get rid of all special
+casing of struct user or user->inotify_devs.
+
+Signed-off-by: Eric Paris <eparis@redhat.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/notify/inotify/inotify_fsnotify.c | 1
+ fs/notify/inotify/inotify_user.c | 39 +++++++++++------------------------
+ 2 files changed, 14 insertions(+), 26 deletions(-)
+
+--- a/fs/notify/inotify/inotify_fsnotify.c
++++ b/fs/notify/inotify/inotify_fsnotify.c
+@@ -198,6 +198,7 @@ static void inotify_free_group_priv(stru
+ idr_for_each(&group->inotify_data.idr, idr_callback, group);
+ idr_remove_all(&group->inotify_data.idr);
+ idr_destroy(&group->inotify_data.idr);
++ atomic_dec(&group->inotify_data.user->inotify_devs);
+ free_uid(group->inotify_data.user);
+ }
+
+--- a/fs/notify/inotify/inotify_user.c
++++ b/fs/notify/inotify/inotify_user.c
+@@ -290,7 +290,6 @@ static int inotify_fasync(int fd, struct
+ static int inotify_release(struct inode *ignored, struct file *file)
+ {
+ struct fsnotify_group *group = file->private_data;
+- struct user_struct *user = group->inotify_data.user;
+
+ pr_debug("%s: group=%p\n", __func__, group);
+
+@@ -299,8 +298,6 @@ static int inotify_release(struct inode
+ /* free this group, matching get was inotify_init->fsnotify_obtain_group */
+ fsnotify_put_group(group);
+
+- atomic_dec(&user->inotify_devs);
+-
+ return 0;
+ }
+
+@@ -697,7 +694,7 @@ retry:
+ return ret;
+ }
+
+-static struct fsnotify_group *inotify_new_group(struct user_struct *user, unsigned int max_events)
++static struct fsnotify_group *inotify_new_group(unsigned int max_events)
+ {
+ struct fsnotify_group *group;
+
+@@ -710,8 +707,14 @@ static struct fsnotify_group *inotify_ne
+ spin_lock_init(&group->inotify_data.idr_lock);
+ idr_init(&group->inotify_data.idr);
+ group->inotify_data.last_wd = 0;
+- group->inotify_data.user = user;
+ group->inotify_data.fa = NULL;
++ group->inotify_data.user = get_current_user();
++
++ if (atomic_inc_return(&group->inotify_data.user->inotify_devs) >
++ inotify_max_user_instances) {
++ fsnotify_put_group(group);
++ return ERR_PTR(-EMFILE);
++ }
+
+ return group;
+ }
+@@ -721,7 +724,6 @@ static struct fsnotify_group *inotify_ne
+ SYSCALL_DEFINE1(inotify_init1, int, flags)
+ {
+ struct fsnotify_group *group;
+- struct user_struct *user;
+ int ret;
+
+ /* Check the IN_* constants for consistency. */
+@@ -731,31 +733,16 @@ SYSCALL_DEFINE1(inotify_init1, int, flag
+ if (flags & ~(IN_CLOEXEC | IN_NONBLOCK))
+ return -EINVAL;
+
+- user = get_current_user();
+- if (unlikely(atomic_read(&user->inotify_devs) >=
+- inotify_max_user_instances)) {
+- ret = -EMFILE;
+- goto out_free_uid;
+- }
+-
+ /* fsnotify_obtain_group took a reference to group, we put this when we kill the file in the end */
+- group = inotify_new_group(user, inotify_max_queued_events);
+- if (IS_ERR(group)) {
+- ret = PTR_ERR(group);
+- goto out_free_uid;
+- }
+-
+- atomic_inc(&user->inotify_devs);
++ group = inotify_new_group(inotify_max_queued_events);
++ if (IS_ERR(group))
++ return PTR_ERR(group);
+
+ ret = anon_inode_getfd("inotify", &inotify_fops, group,
+ O_RDONLY | flags);
+- if (ret >= 0)
+- return ret;
++ if (ret < 0)
++ fsnotify_put_group(group);
+
+- fsnotify_put_group(group);
+- atomic_dec(&user->inotify_devs);
+-out_free_uid:
+- free_uid(user);
+ return ret;
+ }
+
--- /dev/null
+From 673e63c688f43104c73aad8ea4237f7ad41fa14d Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+Date: Tue, 22 Mar 2011 23:54:49 +0000
+Subject: net: fix ethtool->set_flags not intended -EINVAL return value
+
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit 673e63c688f43104c73aad8ea4237f7ad41fa14d upstream.
+
+After commit d5dbda23804156ae6f35025ade5307a49d1db6d7 "ethtool: Add
+support for vlan accleration.", drivers that have NETIF_F_HW_VLAN_TX,
+and/or NETIF_F_HW_VLAN_RX feature, but do not allow enable/disable vlan
+acceleration via ethtool set_flags, always return -EINVAL from that
+function. Fix by returning -EINVAL only if requested features do not
+match current settings and can not be changed by driver.
+
+Change any driver that define ethtool->set_flags to use
+ethtool_invalid_flags() to avoid similar problems in the future
+(also on drivers that do not have the problem).
+
+Tested with modified (to reproduce this bug) myri10ge driver.
+
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/netxen/netxen_nic_ethtool.c | 2 +-
+ drivers/net/qlcnic/qlcnic_ethtool.c | 2 +-
+ drivers/net/s2io.c | 2 +-
+ drivers/net/vmxnet3/vmxnet3_ethtool.c | 4 ++--
+ drivers/net/vxge/vxge-ethtool.c | 4 ++--
+ include/linux/ethtool.h | 1 +
+ net/core/ethtool.c | 17 ++++++++++++++++-
+ 7 files changed, 24 insertions(+), 8 deletions(-)
+
+--- a/drivers/net/netxen/netxen_nic_ethtool.c
++++ b/drivers/net/netxen/netxen_nic_ethtool.c
+@@ -901,7 +901,7 @@ static int netxen_nic_set_flags(struct n
+ struct netxen_adapter *adapter = netdev_priv(netdev);
+ int hw_lro;
+
+- if (data & ~ETH_FLAG_LRO)
++ if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
+ return -EINVAL;
+
+ if (!(adapter->capabilities & NX_FW_CAPABILITY_HW_LRO))
+--- a/drivers/net/qlcnic/qlcnic_ethtool.c
++++ b/drivers/net/qlcnic/qlcnic_ethtool.c
+@@ -1003,7 +1003,7 @@ static int qlcnic_set_flags(struct net_d
+ struct qlcnic_adapter *adapter = netdev_priv(netdev);
+ int hw_lro;
+
+- if (data & ~ETH_FLAG_LRO)
++ if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
+ return -EINVAL;
+
+ if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
+--- a/drivers/net/s2io.c
++++ b/drivers/net/s2io.c
+@@ -6726,7 +6726,7 @@ static int s2io_ethtool_set_flags(struct
+ int rc = 0;
+ int changed = 0;
+
+- if (data & ~ETH_FLAG_LRO)
++ if (ethtool_invalid_flags(dev, data, ETH_FLAG_LRO))
+ return -EINVAL;
+
+ if (data & ETH_FLAG_LRO) {
+--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
++++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
+@@ -304,8 +304,8 @@ vmxnet3_set_flags(struct net_device *net
+ u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1;
+ unsigned long flags;
+
+- if (data & ~ETH_FLAG_LRO)
+- return -EOPNOTSUPP;
++ if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
++ return -EINVAL;
+
+ if (lro_requested ^ lro_present) {
+ /* toggle the LRO feature*/
+--- a/drivers/net/vxge/vxge-ethtool.c
++++ b/drivers/net/vxge/vxge-ethtool.c
+@@ -1117,8 +1117,8 @@ static int vxge_set_flags(struct net_dev
+ struct vxgedev *vdev = netdev_priv(dev);
+ enum vxge_hw_status status;
+
+- if (data & ~ETH_FLAG_RXHASH)
+- return -EOPNOTSUPP;
++ if (ethtool_invalid_flags(dev, data, ETH_FLAG_RXHASH))
++ return -EINVAL;
+
+ if (!!(data & ETH_FLAG_RXHASH) == vdev->devh->config.rth_en)
+ return 0;
+--- a/include/linux/ethtool.h
++++ b/include/linux/ethtool.h
+@@ -591,6 +591,7 @@ int ethtool_op_set_ufo(struct net_device
+ u32 ethtool_op_get_flags(struct net_device *dev);
+ int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported);
+ void ethtool_ntuple_flush(struct net_device *dev);
++bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
+
+ /**
+ * ðtool_ops - Alter and report network device settings
+--- a/net/core/ethtool.c
++++ b/net/core/ethtool.c
+@@ -146,9 +146,24 @@ u32 ethtool_op_get_flags(struct net_devi
+ }
+ EXPORT_SYMBOL(ethtool_op_get_flags);
+
++/* Check if device can enable (or disable) particular feature coded in "data"
++ * argument. Flags "supported" describe features that can be toggled by device.
++ * If feature can not be toggled, it state (enabled or disabled) must match
++ * hardcoded device features state, otherwise flags are marked as invalid.
++ */
++bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported)
++{
++ u32 features = dev->features & flags_dup_features;
++ /* "data" can contain only flags_dup_features bits,
++ * see __ethtool_set_flags */
++
++ return (features & ~supported) != (data & ~supported);
++}
++EXPORT_SYMBOL(ethtool_invalid_flags);
++
+ int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported)
+ {
+- if (data & ~supported)
++ if (ethtool_invalid_flags(dev, data, supported))
+ return -EINVAL;
+
+ dev->features = ((dev->features & ~flags_dup_features) |
--- /dev/null
+From fd1edb3aa2c1d92618d8f0c6d15d44ea41fcac6a Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Date: Mon, 28 Mar 2011 13:13:56 +0200
+Subject: perf: Fix task_struct reference leak
+
+From: Peter Zijlstra <a.p.zijlstra@chello.nl>
+
+commit fd1edb3aa2c1d92618d8f0c6d15d44ea41fcac6a upstream.
+
+sys_perf_event_open() had an imbalance in the number of task refs it
+took causing memory leakage
+
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Oleg Nesterov <oleg@redhat.com>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+LKML-Reference: <new-submission>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/perf_event.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/kernel/perf_event.c
++++ b/kernel/perf_event.c
+@@ -5917,6 +5917,11 @@ SYSCALL_DEFINE5(perf_event_open,
+ goto err_alloc;
+ }
+
++ if (task) {
++ put_task_struct(task);
++ task = NULL;
++ }
++
+ /*
+ * Look up the group leader (we will attach this event to it):
+ */
--- /dev/null
+From 20443384fe090c5f8aeb016e7e85659c5bbdd69f Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Thu, 31 Mar 2011 03:33:29 +0200
+Subject: perf: Rebase max unprivileged mlock threshold on top of page size
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 20443384fe090c5f8aeb016e7e85659c5bbdd69f upstream.
+
+Ensure we allow 512 kiB + 1 page for user control without
+assuming a 4096 bytes page size.
+
+Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Paul Mackerras <paulus@samba.org>
+Cc: Stephane Eranian <eranian@google.com>
+LKML-Reference: <1301535209-9679-1-git-send-email-fweisbec@gmail.com>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/perf_event.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/kernel/perf_event.c
++++ b/kernel/perf_event.c
+@@ -62,8 +62,8 @@ static struct srcu_struct pmus_srcu;
+ */
+ int sysctl_perf_event_paranoid __read_mostly = 1;
+
+-/* Minimum for 128 pages + 1 for the user control page */
+-int sysctl_perf_event_mlock __read_mostly = 516; /* 'free' kb per user */
++/* Minimum for 512 kiB + 1 user control page */
++int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */
+
+ /*
+ * max perf event sample rate
irda-prevent-heap-corruption-on-invalid-nickname.patch
powerpc-fix-accounting-of-softirq-time-when-idle.patch
nilfs2-fix-data-loss-in-mmap-page-write-for-hole-blocks.patch
+asoc-explicitly-say-registerless-widgets-have-no-register.patch
+asoc-imx-set-watermarks-for-mx2-dma.patch
+asoc-imx-fix-burstsize-for-dma.patch
+asoc-fix-codec-device-name-for-corgi.patch
+alsa-ens1371-fix-creative-ectiva-support.patch
+alsa-pcm-fix-infinite-loop-in-snd_pcm_update_hw_ptr0.patch
+alsa-hda-add-dock-mic-quirk-for-lenovo-thinkpad-x220.patch
+alsa-hda-fix-dock-mic-for-lenovo-x220-tablet.patch
+alsa-hda-hdmi-fix-mcp7x-audio-infoframe-checksums.patch
+alsa-hda-fix-single-internal-mic-on-alc275-sony-vaio-vpcsb1c5e.patch
+net-fix-ethtool-set_flags-not-intended-einval-return-value.patch
+drm-radeon-kms-add-some-new-ontario-pci-ids.patch
+drm-radeon-kms-add-some-sanity-checks-to-obj-info-record-parsingi-v2.patch
+inotify-fix-double-free-corruption-of-stuct-user.patch
+hid-hid-magicmouse-increase-evdev-buffer-size.patch
+perf-fix-task_struct-reference-leak.patch
+perf-rebase-max-unprivileged-mlock-threshold-on-top-of-page-size.patch