summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-04-18 11:29:04 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-04-18 11:29:04 -0300
commit69bff8d36f5ec8e9beffeb41aaede0f07418d7f4 (patch)
tree4de90b9e04682f0f147dc1319b1783d1ef3733c0 /patches
parentcc23ca504e54659c24f0663a7b9221db21bd8fb2 (diff)
parentee751891605129530527d57dc245b10efec20942 (diff)
Merge branch 'master' of https://projects.archlinux.org/git/linux-2.6-ARCH
Conflicts: PATCHCFG
Diffstat (limited to 'patches')
-rw-r--r--patches/2.6.38.2-pre.patch1890
-rw-r--r--patches/2.6.38.3-pre.patch1140
-rw-r--r--patches/intel_ips-produces-constant-load-of-1.patch13
3 files changed, 1153 insertions, 1890 deletions
diff --git a/patches/2.6.38.2-pre.patch b/patches/2.6.38.2-pre.patch
deleted file mode 100644
index 66236cb..0000000
--- a/patches/2.6.38.2-pre.patch
+++ /dev/null
@@ -1,1890 +0,0 @@
-From 5a8826463c19b0d1a2fc60b2adac0ec318047844 Mon Sep 17 00:00:00 2001
-From: David Henningsson <david.henningsson@canonical.com>
-Date: Wed, 23 Mar 2011 08:35:07 +0100
-Subject: ALSA: HDA: Realtek: Avoid unnecessary volume control index on Surround/Side
-
-From: David Henningsson <david.henningsson@canonical.com>
-
-commit 5a8826463c19b0d1a2fc60b2adac0ec318047844 upstream.
-
-Similar to commit 7e59e097c09b82760bb0fe08b0fa2b704d76c3f4, this patch
-avoids unnecessary volume control indices for more
-Realtek auto-parsers, e g the ALC66x family, on the "Surround" and "Side"
-controls.
-These indices cause these volume controls to be ignored by PulseAudio and
-vmaster and should be removed whenever possible.
-
-Reported-by: Jan Losinski <losinski@wh2.tu-dresden.de>
-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 | 25 +++++++++++++++++--------
- 1 file changed, 17 insertions(+), 8 deletions(-)
-
---- a/sound/pci/hda/patch_realtek.c
-+++ b/sound/pci/hda/patch_realtek.c
-@@ -16085,9 +16085,12 @@ static int alc861_auto_create_multi_out_
- return err;
- } else {
- const char *name = pfx;
-- if (!name)
-+ int index = i;
-+ if (!name) {
- name = chname[i];
-- err = __alc861_create_out_sw(codec, name, nid, i, 3);
-+ index = 0;
-+ }
-+ err = __alc861_create_out_sw(codec, name, nid, index, 3);
- if (err < 0)
- return err;
- }
-@@ -17238,16 +17241,19 @@ static int alc861vd_auto_create_multi_ou
- return err;
- } else {
- const char *name = pfx;
-- if (!name)
-+ int index = i;
-+ if (!name) {
- name = chname[i];
-+ index = 0;
-+ }
- err = __add_pb_vol_ctrl(spec, ALC_CTL_WIDGET_VOL,
-- name, i,
-+ name, index,
- HDA_COMPOSE_AMP_VAL(nid_v, 3, 0,
- HDA_OUTPUT));
- if (err < 0)
- return err;
- err = __add_pb_sw_ctrl(spec, ALC_CTL_BIND_MUTE,
-- name, i,
-+ name, index,
- HDA_COMPOSE_AMP_VAL(nid_s, 3, 2,
- HDA_INPUT));
- if (err < 0)
-@@ -19296,12 +19302,15 @@ static int alc662_auto_create_multi_out_
- return err;
- } else {
- const char *name = pfx;
-- if (!name)
-+ int index = i;
-+ if (!name) {
- name = chname[i];
-- err = __alc662_add_vol_ctl(spec, name, nid, i, 3);
-+ index = 0;
-+ }
-+ err = __alc662_add_vol_ctl(spec, name, nid, index, 3);
- if (err < 0)
- return err;
-- err = __alc662_add_sw_ctl(spec, name, mix, i, 3);
-+ err = __alc662_add_sw_ctl(spec, name, mix, index, 3);
- if (err < 0)
- return err;
- }
-From bff5fbf50bd498c217994bd2d41a53ac3141185a Mon Sep 17 00:00:00 2001
-From: Lydia Wang <lydiawang@viatech.com.cn>
-Date: Tue, 22 Mar 2011 16:21:38 +0800
-Subject: ALSA: hda - VIA: Fix stereo mixer recording no sound issue
-
-From: Lydia Wang <lydiawang@viatech.com.cn>
-
-commit bff5fbf50bd498c217994bd2d41a53ac3141185a upstream.
-
-Modify function via_mux_enum_put() to fix stereo mixer recording
-no sound issue.
-
-Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- sound/pci/hda/patch_via.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
---- a/sound/pci/hda/patch_via.c
-+++ b/sound/pci/hda/patch_via.c
-@@ -1101,6 +1101,7 @@ static int via_mux_enum_put(struct snd_k
- struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
- struct via_spec *spec = codec->spec;
- unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
-+ int ret;
-
- if (!spec->mux_nids[adc_idx])
- return -EINVAL;
-@@ -1109,12 +1110,14 @@ static int via_mux_enum_put(struct snd_k
- AC_VERB_GET_POWER_STATE, 0x00) != AC_PWRST_D0)
- snd_hda_codec_write(codec, spec->mux_nids[adc_idx], 0,
- AC_VERB_SET_POWER_STATE, AC_PWRST_D0);
-- /* update jack power state */
-- set_jack_power_state(codec);
-
-- return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
-+ ret = snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
- spec->mux_nids[adc_idx],
- &spec->cur_mux[adc_idx]);
-+ /* update jack power state */
-+ set_jack_power_state(codec);
-+
-+ return ret;
- }
-
- static int via_independent_hp_info(struct snd_kcontrol *kcontrol,
-From ce0e5a9e81fbb153ee15ca60246c6722f07fc546 Mon Sep 17 00:00:00 2001
-From: Lydia Wang <lydiawang@viatech.com.cn>
-Date: Tue, 22 Mar 2011 16:22:37 +0800
-Subject: ALSA: hda - VIA: Fix independent headphone no sound issue
-
-From: Lydia Wang <lydiawang@viatech.com.cn>
-
-commit ce0e5a9e81fbb153ee15ca60246c6722f07fc546 upstream.
-
-Modify via_independent_hp_put() function to support VT1718S and VT1812
-codecs, and fix independent headphone no sound issue.
-
-Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- sound/pci/hda/patch_via.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
---- a/sound/pci/hda/patch_via.c
-+++ b/sound/pci/hda/patch_via.c
-@@ -1191,8 +1191,16 @@ static int via_independent_hp_put(struct
- /* Get Independent Mode index of headphone pin widget */
- spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
- ? 1 : 0;
-- snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, pinsel);
-+ if (spec->codec_type == VT1718S)
-+ snd_hda_codec_write(codec, nid, 0,
-+ AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
-+ else
-+ snd_hda_codec_write(codec, nid, 0,
-+ AC_VERB_SET_CONNECT_SEL, pinsel);
-
-+ if (spec->codec_type == VT1812)
-+ snd_hda_codec_write(codec, 0x35, 0,
-+ AC_VERB_SET_CONNECT_SEL, pinsel);
- if (spec->multiout.hp_nid && spec->multiout.hp_nid
- != spec->multiout.dac_nids[HDA_FRONT])
- snd_hda_codec_setup_stream(codec, spec->multiout.hp_nid,
-@@ -1211,6 +1219,8 @@ static int via_independent_hp_put(struct
- activate_ctl(codec, "Headphone Playback Switch",
- spec->hp_independent_mode);
- }
-+ /* update jack power state */
-+ set_jack_power_state(codec);
- return 0;
- }
-
-From ab657e0cacc39d88145871c6a3c844597c02d406 Mon Sep 17 00:00:00 2001
-From: Lydia Wang <lydiawang@viatech.com.cn>
-Date: Tue, 22 Mar 2011 16:23:23 +0800
-Subject: ALSA: hda - VIA: Add missing support for VT1718S in A-A path
-
-From: Lydia Wang <lydiawang@viatech.com.cn>
-
-commit ab657e0cacc39d88145871c6a3c844597c02d406 upstream.
-
-Modify mute_aa_path() function to support VT1718S codec.
-
-Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- sound/pci/hda/patch_via.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
---- a/sound/pci/hda/patch_via.c
-+++ b/sound/pci/hda/patch_via.c
-@@ -1323,6 +1323,11 @@ static void mute_aa_path(struct hda_code
- start_idx = 2;
- end_idx = 4;
- break;
-+ case VT1718S:
-+ nid_mixer = 0x21;
-+ start_idx = 1;
-+ end_idx = 3;
-+ break;
- default:
- return;
- }
-From 169222813eec8403c76394fb7b35ecab98e3c607 Mon Sep 17 00:00:00 2001
-From: Lydia Wang <lydiawang@viatech.com.cn>
-Date: Tue, 22 Mar 2011 16:24:10 +0800
-Subject: ALSA: hda - VIA: Fix invalid A-A path volume adjust issue
-
-From: Lydia Wang <lydiawang@viatech.com.cn>
-
-commit 169222813eec8403c76394fb7b35ecab98e3c607 upstream.
-
-Modify vt_auto_create_analog_input_ctls() function to fix invalid a-a path
-volume adjust issue for VT1708S, VT1702 and VT1716S codecs.
-
-Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- sound/pci/hda/patch_via.c | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
---- a/sound/pci/hda/patch_via.c
-+++ b/sound/pci/hda/patch_via.c
-@@ -2456,7 +2456,14 @@ static int vt_auto_create_analog_input_c
- else
- type_idx = 0;
- label = hda_get_autocfg_input_label(codec, cfg, i);
-- err = via_new_analog_input(spec, label, type_idx, idx, cap_nid);
-+ if (spec->codec_type == VT1708S ||
-+ spec->codec_type == VT1702 ||
-+ spec->codec_type == VT1716S)
-+ err = via_new_analog_input(spec, label, type_idx,
-+ idx+1, cap_nid);
-+ else
-+ err = via_new_analog_input(spec, label, type_idx,
-+ idx, cap_nid);
- if (err < 0)
- return err;
- snd_hda_add_imux_item(imux, label, idx, NULL);
-From 0341ccd7557fecafe6a79c55158670cf629d269e Mon Sep 17 00:00:00 2001
-From: Lydia Wang <lydiawang@viatech.com.cn>
-Date: Tue, 22 Mar 2011 16:25:03 +0800
-Subject: ALSA: hda - VIA: Fix codec type for VT1708BCE at the right timing
-
-From: Lydia Wang <lydiawang@viatech.com.cn>
-
-commit 0341ccd7557fecafe6a79c55158670cf629d269e upstream.
-
-Add get_codec_type() in via_new_spec() function to make sure getting
-correct codec type before building mixer controls.
-
-Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- sound/pci/hda/patch_via.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
---- a/sound/pci/hda/patch_via.c
-+++ b/sound/pci/hda/patch_via.c
-@@ -159,6 +159,7 @@ struct via_spec {
- #endif
- };
-
-+static enum VIA_HDA_CODEC get_codec_type(struct hda_codec *codec);
- static struct via_spec * via_new_spec(struct hda_codec *codec)
- {
- struct via_spec *spec;
-@@ -169,6 +170,10 @@ static struct via_spec * via_new_spec(st
-
- codec->spec = spec;
- spec->codec = codec;
-+ spec->codec_type = get_codec_type(codec);
-+ /* VT1708BCE & VT1708S are almost same */
-+ if (spec->codec_type == VT1708BCE)
-+ spec->codec_type = VT1708S;
- return spec;
- }
-
-@@ -2203,10 +2208,6 @@ static int via_init(struct hda_codec *co
- for (i = 0; i < spec->num_iverbs; i++)
- snd_hda_sequence_write(codec, spec->init_verbs[i]);
-
-- spec->codec_type = get_codec_type(codec);
-- if (spec->codec_type == VT1708BCE)
-- spec->codec_type = VT1708S; /* VT1708BCE & VT1708S are almost
-- same */
- /* Lydia Add for EAPD enable */
- if (!spec->dig_in_nid) { /* No Digital In connection */
- if (spec->dig_in_pin) {
-From ee3c35c0827de02de414d08b2ddcbb910c2263ab Mon Sep 17 00:00:00 2001
-From: Lydia Wang <lydiawang@viatech.com.cn>
-Date: Tue, 22 Mar 2011 16:26:36 +0800
-Subject: ALSA: hda - VIA: Fix VT1708 can't build up Headphone control issue
-
-From: Lydia Wang <lydiawang@viatech.com.cn>
-
-commit ee3c35c0827de02de414d08b2ddcbb910c2263ab upstream.
-
-Since VT1708 didn't support the control of getting connection number,
-building of headphone control will fail in via_hp_build() function.
-
-Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
-Signed-off-by: Takashi Iwai <tiwai@suse.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- sound/pci/hda/patch_via.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
---- a/sound/pci/hda/patch_via.c
-+++ b/sound/pci/hda/patch_via.c
-@@ -1266,9 +1266,12 @@ static int via_hp_build(struct hda_codec
- break;
- }
-
-- nums = snd_hda_get_connections(codec, nid, conn, HDA_MAX_CONNECTIONS);
-- if (nums <= 1)
-- return 0;
-+ if (spec->codec_type != VT1708) {
-+ nums = snd_hda_get_connections(codec, nid,
-+ conn, HDA_MAX_CONNECTIONS);
-+ if (nums <= 1)
-+ return 0;
-+ }
-
- knew = via_clone_control(spec, &via_hp_mixer[0]);
- if (knew == NULL)
-From a110f4ef810ee29d810876df725f41d66629733e Mon Sep 17 00:00:00 2001
-From: Marek Belisko <marek.belisko@open-nandra.com>
-Date: Wed, 9 Mar 2011 21:46:20 +0100
-Subject: ASoC: mini2440: Fix uda134x codec problem.
-
-From: Marek Belisko <marek.belisko@open-nandra.com>
-
-commit a110f4ef810ee29d810876df725f41d66629733e upstream.
-
-ASoC audio for mini2440 platform in current kenrel doesn't work.
-First problem is samsung_asoc_dma device is missing in initialization.
-Next problem is with codec. Codec is initialized but never probed
-because no platform_device exist for codec driver. It leads to errors
-during codec binding to asoc dai. Next problem was platform data which
-was passed from board to asoc main driver but not passed to codec when
-called codec_soc_probe().
-
-Following patch should fix issues. But not sure if in correct way.
-Please review.
-
-Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
-Acked-by: Liam Girdwood <lrg@ti.com>
-Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- arch/arm/mach-s3c2440/mach-mini2440.c | 7 +++++++
- sound/soc/codecs/uda134x.c | 3 ++-
- sound/soc/samsung/s3c24xx_uda134x.c | 3 ++-
- 3 files changed, 11 insertions(+), 2 deletions(-)
-
---- a/arch/arm/mach-s3c2440/mach-mini2440.c
-+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
-@@ -506,6 +506,11 @@ static struct i2c_board_info mini2440_i2
- },
- };
-
-+static struct platform_device uda1340_codec = {
-+ .name = "uda134x-codec",
-+ .id = -1,
-+};
-+
- static struct platform_device *mini2440_devices[] __initdata = {
- &s3c_device_ohci,
- &s3c_device_wdt,
-@@ -521,7 +526,9 @@ static struct platform_device *mini2440_
- &s3c_device_nand,
- &s3c_device_sdi,
- &s3c_device_iis,
-+ &uda1340_codec,
- &mini2440_audio,
-+ &samsung_asoc_dma,
- };
-
- static void __init mini2440_map_io(void)
---- a/sound/soc/codecs/uda134x.c
-+++ b/sound/soc/codecs/uda134x.c
-@@ -486,7 +486,8 @@ static struct snd_soc_dai_driver uda134x
- static int uda134x_soc_probe(struct snd_soc_codec *codec)
- {
- struct uda134x_priv *uda134x;
-- struct uda134x_platform_data *pd = dev_get_drvdata(codec->card->dev);
-+ struct uda134x_platform_data *pd = codec->card->dev->platform_data;
-+
- int ret;
-
- printk(KERN_INFO "UDA134X SoC Audio Codec\n");
---- a/sound/soc/samsung/s3c24xx_uda134x.c
-+++ b/sound/soc/samsung/s3c24xx_uda134x.c
-@@ -226,7 +226,7 @@ static struct snd_soc_ops s3c24xx_uda134
- static struct snd_soc_dai_link s3c24xx_uda134x_dai_link = {
- .name = "UDA134X",
- .stream_name = "UDA134X",
-- .codec_name = "uda134x-hifi",
-+ .codec_name = "uda134x-codec",
- .codec_dai_name = "uda134x-hifi",
- .cpu_dai_name = "s3c24xx-iis",
- .ops = &s3c24xx_uda134x_ops,
-@@ -321,6 +321,7 @@ static int s3c24xx_uda134x_probe(struct
-
- platform_set_drvdata(s3c24xx_uda134x_snd_device,
- &snd_soc_s3c24xx_uda134x);
-+ platform_device_add_data(s3c24xx_uda134x_snd_device, &s3c24xx_uda134x, sizeof(s3c24xx_uda134x));
- ret = platform_device_add(s3c24xx_uda134x_snd_device);
- if (ret) {
- printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n");
-From 3a7da39d165e0c363c294feec119db1427032afd Mon Sep 17 00:00:00 2001
-From: Ben Hutchings <bhutchings@solarflare.com>
-Date: Thu, 17 Mar 2011 07:34:32 +0000
-Subject: ethtool: Compat handling for struct ethtool_rxnfc
-
-From: Ben Hutchings <bhutchings@solarflare.com>
-
-commit 3a7da39d165e0c363c294feec119db1427032afd upstream.
-
-This structure was accidentally defined such that its layout can
-differ between 32-bit and 64-bit processes. Add compat structure
-definitions and an ioctl wrapper function.
-
-Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- include/linux/ethtool.h | 34 ++++++++++++++
- net/socket.c | 114 +++++++++++++++++++++++++++++++++++++++++++++---
- 2 files changed, 141 insertions(+), 7 deletions(-)
-
---- a/include/linux/ethtool.h
-+++ b/include/linux/ethtool.h
-@@ -13,6 +13,9 @@
- #ifndef _LINUX_ETHTOOL_H
- #define _LINUX_ETHTOOL_H
-
-+#ifdef __KERNEL__
-+#include <linux/compat.h>
-+#endif
- #include <linux/types.h>
- #include <linux/if_ether.h>
-
-@@ -449,6 +452,37 @@ struct ethtool_rxnfc {
- __u32 rule_locs[0];
- };
-
-+#ifdef __KERNEL__
-+#ifdef CONFIG_COMPAT
-+
-+struct compat_ethtool_rx_flow_spec {
-+ u32 flow_type;
-+ union {
-+ struct ethtool_tcpip4_spec tcp_ip4_spec;
-+ struct ethtool_tcpip4_spec udp_ip4_spec;
-+ struct ethtool_tcpip4_spec sctp_ip4_spec;
-+ struct ethtool_ah_espip4_spec ah_ip4_spec;
-+ struct ethtool_ah_espip4_spec esp_ip4_spec;
-+ struct ethtool_usrip4_spec usr_ip4_spec;
-+ struct ethhdr ether_spec;
-+ u8 hdata[72];
-+ } h_u, m_u;
-+ compat_u64 ring_cookie;
-+ u32 location;
-+};
-+
-+struct compat_ethtool_rxnfc {
-+ u32 cmd;
-+ u32 flow_type;
-+ compat_u64 data;
-+ struct compat_ethtool_rx_flow_spec fs;
-+ u32 rule_cnt;
-+ u32 rule_locs[0];
-+};
-+
-+#endif /* CONFIG_COMPAT */
-+#endif /* __KERNEL__ */
-+
- /**
- * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
- * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
---- a/net/socket.c
-+++ b/net/socket.c
-@@ -2583,23 +2583,123 @@ static int dev_ifconf(struct net *net, s
-
- static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
- {
-+ struct compat_ethtool_rxnfc __user *compat_rxnfc;
-+ bool convert_in = false, convert_out = false;
-+ size_t buf_size = ALIGN(sizeof(struct ifreq), 8);
-+ struct ethtool_rxnfc __user *rxnfc;
- struct ifreq __user *ifr;
-+ u32 rule_cnt = 0, actual_rule_cnt;
-+ u32 ethcmd;
- u32 data;
-- void __user *datap;
-+ int ret;
-
-- ifr = compat_alloc_user_space(sizeof(*ifr));
-+ if (get_user(data, &ifr32->ifr_ifru.ifru_data))
-+ return -EFAULT;
-
-- if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
-+ compat_rxnfc = compat_ptr(data);
-+
-+ if (get_user(ethcmd, &compat_rxnfc->cmd))
- return -EFAULT;
-
-- if (get_user(data, &ifr32->ifr_ifru.ifru_data))
-+ /* Most ethtool structures are defined without padding.
-+ * Unfortunately struct ethtool_rxnfc is an exception.
-+ */
-+ switch (ethcmd) {
-+ default:
-+ break;
-+ case ETHTOOL_GRXCLSRLALL:
-+ /* Buffer size is variable */
-+ if (get_user(rule_cnt, &compat_rxnfc->rule_cnt))
-+ return -EFAULT;
-+ if (rule_cnt > KMALLOC_MAX_SIZE / sizeof(u32))
-+ return -ENOMEM;
-+ buf_size += rule_cnt * sizeof(u32);
-+ /* fall through */
-+ case ETHTOOL_GRXRINGS:
-+ case ETHTOOL_GRXCLSRLCNT:
-+ case ETHTOOL_GRXCLSRULE:
-+ convert_out = true;
-+ /* fall through */
-+ case ETHTOOL_SRXCLSRLDEL:
-+ case ETHTOOL_SRXCLSRLINS:
-+ buf_size += sizeof(struct ethtool_rxnfc);
-+ convert_in = true;
-+ break;
-+ }
-+
-+ ifr = compat_alloc_user_space(buf_size);
-+ rxnfc = (void *)ifr + ALIGN(sizeof(struct ifreq), 8);
-+
-+ if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
- return -EFAULT;
-
-- datap = compat_ptr(data);
-- if (put_user(datap, &ifr->ifr_ifru.ifru_data))
-+ if (put_user(convert_in ? rxnfc : compat_ptr(data),
-+ &ifr->ifr_ifru.ifru_data))
- return -EFAULT;
-
-- return dev_ioctl(net, SIOCETHTOOL, ifr);
-+ if (convert_in) {
-+ /* We expect there to be holes between fs.m_u and
-+ * fs.ring_cookie and at the end of fs, but nowhere else.
-+ */
-+ BUILD_BUG_ON(offsetof(struct compat_ethtool_rxnfc, fs.m_u) +
-+ sizeof(compat_rxnfc->fs.m_u) !=
-+ offsetof(struct ethtool_rxnfc, fs.m_u) +
-+ sizeof(rxnfc->fs.m_u));
-+ BUILD_BUG_ON(
-+ offsetof(struct compat_ethtool_rxnfc, fs.location) -
-+ offsetof(struct compat_ethtool_rxnfc, fs.ring_cookie) !=
-+ offsetof(struct ethtool_rxnfc, fs.location) -
-+ offsetof(struct ethtool_rxnfc, fs.ring_cookie));
-+
-+ if (copy_in_user(rxnfc, compat_rxnfc,
-+ (void *)(&rxnfc->fs.m_u + 1) -
-+ (void *)rxnfc) ||
-+ copy_in_user(&rxnfc->fs.ring_cookie,
-+ &compat_rxnfc->fs.ring_cookie,
-+ (void *)(&rxnfc->fs.location + 1) -
-+ (void *)&rxnfc->fs.ring_cookie) ||
-+ copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt,
-+ sizeof(rxnfc->rule_cnt)))
-+ return -EFAULT;
-+ }
-+
-+ ret = dev_ioctl(net, SIOCETHTOOL, ifr);
-+ if (ret)
-+ return ret;
-+
-+ if (convert_out) {
-+ if (copy_in_user(compat_rxnfc, rxnfc,
-+ (const void *)(&rxnfc->fs.m_u + 1) -
-+ (const void *)rxnfc) ||
-+ copy_in_user(&compat_rxnfc->fs.ring_cookie,
-+ &rxnfc->fs.ring_cookie,
-+ (const void *)(&rxnfc->fs.location + 1) -
-+ (const void *)&rxnfc->fs.ring_cookie) ||
-+ copy_in_user(&compat_rxnfc->rule_cnt, &rxnfc->rule_cnt,
-+ sizeof(rxnfc->rule_cnt)))
-+ return -EFAULT;
-+
-+ if (ethcmd == ETHTOOL_GRXCLSRLALL) {
-+ /* As an optimisation, we only copy the actual
-+ * number of rules that the underlying
-+ * function returned. Since Mallory might
-+ * change the rule count in user memory, we
-+ * check that it is less than the rule count
-+ * originally given (as the user buffer size),
-+ * which has been range-checked.
-+ */
-+ if (get_user(actual_rule_cnt, &rxnfc->rule_cnt))
-+ return -EFAULT;
-+ if (actual_rule_cnt < rule_cnt)
-+ rule_cnt = actual_rule_cnt;
-+ if (copy_in_user(&compat_rxnfc->rule_locs[0],
-+ &rxnfc->rule_locs[0],
-+ rule_cnt * sizeof(u32)))
-+ return -EFAULT;
-+ }
-+ }
-+
-+ return 0;
- }
-
- static int compat_siocwandev(struct net *net, struct compat_ifreq __user *uifr32)
-From 3ff84a7f36554b257cd57325b1a7c1fa4b49fbe3 Mon Sep 17 00:00:00 2001
-From: Pekka Enberg <penberg@kernel.org>
-Date: Mon, 14 Feb 2011 17:46:21 +0200
-Subject: Revert "slab: Fix missing DEBUG_SLAB last user"
-
-From: Pekka Enberg <penberg@kernel.org>
-
-commit 3ff84a7f36554b257cd57325b1a7c1fa4b49fbe3 upstream.
-
-This reverts commit 5c5e3b33b7cb959a401f823707bee006caadd76e.
-
-The commit breaks ARM thusly:
-
-| Mount-cache hash table entries: 512
-| slab error in verify_redzone_free(): cache `idr_layer_cache': memory outside object was overwritten
-| Backtrace:
-| [<c0227088>] (dump_backtrace+0x0/0x110) from [<c0431afc>] (dump_stack+0x18/0x1c)
-| [<c0431ae4>] (dump_stack+0x0/0x1c) from [<c0293304>] (__slab_error+0x28/0x30)
-| [<c02932dc>] (__slab_error+0x0/0x30) from [<c0293a74>] (cache_free_debugcheck+0x1c0/0x2b8)
-| [<c02938b4>] (cache_free_debugcheck+0x0/0x2b8) from [<c0293f78>] (kmem_cache_free+0x3c/0xc0)
-| [<c0293f3c>] (kmem_cache_free+0x0/0xc0) from [<c032b1c8>] (ida_get_new_above+0x19c/0x1c0)
-| [<c032b02c>] (ida_get_new_above+0x0/0x1c0) from [<c02af7ec>] (alloc_vfsmnt+0x54/0x144)
-| [<c02af798>] (alloc_vfsmnt+0x0/0x144) from [<c0299830>] (vfs_kern_mount+0x30/0xec)
-| [<c0299800>] (vfs_kern_mount+0x0/0xec) from [<c0299908>] (kern_mount_data+0x1c/0x20)
-| [<c02998ec>] (kern_mount_data+0x0/0x20) from [<c02146c4>] (sysfs_init+0x68/0xc8)
-| [<c021465c>] (sysfs_init+0x0/0xc8) from [<c02137d4>] (mnt_init+0x90/0x1b0)
-| [<c0213744>] (mnt_init+0x0/0x1b0) from [<c0213388>] (vfs_caches_init+0x100/0x140)
-| [<c0213288>] (vfs_caches_init+0x0/0x140) from [<c0208c0c>] (start_kernel+0x2e8/0x368)
-| [<c0208924>] (start_kernel+0x0/0x368) from [<c0208034>] (__enable_mmu+0x0/0x2c)
-| c0113268: redzone 1:0xd84156c5c032b3ac, redzone 2:0xd84156c5635688c0.
-| slab error in cache_alloc_debugcheck_after(): cache `idr_layer_cache': double free, or memory outside object was overwritten
-| ...
-| c011307c: redzone 1:0x9f91102ffffffff, redzone 2:0x9f911029d74e35b
-| slab: Internal list corruption detected in cache 'idr_layer_cache'(24), slabp c0113000(16). Hexdump:
-|
-| 000: 20 4f 10 c0 20 4f 10 c0 7c 00 00 00 7c 30 11 c0
-| 010: 10 00 00 00 10 00 00 00 00 00 c9 17 fe ff ff ff
-| 020: fe ff ff ff fe ff ff ff fe ff ff ff fe ff ff ff
-| 030: fe ff ff ff fe ff ff ff fe ff ff ff fe ff ff ff
-| 040: fe ff ff ff fe ff ff ff fe ff ff ff fe ff ff ff
-| 050: fe ff ff ff fe ff ff ff fe ff ff ff 11 00 00 00
-| 060: 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00
-| 070: 16 00 00 00 17 00 00 00 c0 88 56 63
-| kernel BUG at /home/rmk/git/linux-2.6-rmk/mm/slab.c:2928!
-
-Reference: https://lkml.org/lkml/2011/2/7/238
-Reported-and-analyzed-by: Russell King <rmk@arm.linux.org.uk>
-Signed-off-by: Pekka Enberg <penberg@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- mm/slab.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/mm/slab.c
-+++ b/mm/slab.c
-@@ -2288,8 +2288,8 @@ kmem_cache_create (const char *name, siz
- if (ralign < align) {
- ralign = align;
- }
-- /* disable debug if not aligning with REDZONE_ALIGN */
-- if (ralign & (__alignof__(unsigned long long) - 1))
-+ /* disable debug if necessary */
-+ if (ralign > __alignof__(unsigned long long))
- flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
- /*
- * 4) Store it.
-@@ -2315,8 +2315,8 @@ kmem_cache_create (const char *name, siz
- */
- if (flags & SLAB_RED_ZONE) {
- /* add space for red zone words */
-- cachep->obj_offset += align;
-- size += align + sizeof(unsigned long long);
-+ cachep->obj_offset += sizeof(unsigned long long);
-+ size += 2 * sizeof(unsigned long long);
- }
- if (flags & SLAB_STORE_USER) {
- /* user store requires one word storage behind the end of
-From e91f90bb0bb10be9cc8efd09a3cf4ecffcad0db1 Mon Sep 17 00:00:00 2001
-From: Roland Dreier <roland@purestorage.com>
-Date: Tue, 22 Mar 2011 16:35:10 -0700
-Subject: aio: wake all waiters when destroying ctx
-
-From: Roland Dreier <roland@purestorage.com>
-
-commit e91f90bb0bb10be9cc8efd09a3cf4ecffcad0db1 upstream.
-
-The test program below will hang because io_getevents() uses
-add_wait_queue_exclusive(), which means the wake_up() in io_destroy() only
-wakes up one of the threads. Fix this by using wake_up_all() in the aio
-code paths where we want to make sure no one gets stuck.
-
- // t.c -- compile with gcc -lpthread -laio t.c
-
- #include <libaio.h>
- #include <pthread.h>
- #include <stdio.h>
- #include <unistd.h>
-
- static const int nthr = 2;
-
- void *getev(void *ctx)
- {
- struct io_event ev;
- io_getevents(ctx, 1, 1, &ev, NULL);
- printf("io_getevents returned\n");
- return NULL;
- }
-
- int main(int argc, char *argv[])
- {
- io_context_t ctx = 0;
- pthread_t thread[nthr];
- int i;
-
- io_setup(1024, &ctx);
-
- for (i = 0; i < nthr; ++i)
- pthread_create(&thread[i], NULL, getev, ctx);
-
- sleep(1);
-
- io_destroy(ctx);
-
- for (i = 0; i < nthr; ++i)
- pthread_join(thread[i], NULL);
-
- return 0;
- }
-
-Signed-off-by: Roland Dreier <roland@purestorage.com>
-Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- fs/aio.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/fs/aio.c
-+++ b/fs/aio.c
-@@ -520,7 +520,7 @@ static inline void really_put_req(struct
- ctx->reqs_active--;
-
- if (unlikely(!ctx->reqs_active && ctx->dead))
-- wake_up(&ctx->wait);
-+ wake_up_all(&ctx->wait);
- }
-
- static void aio_fput_routine(struct work_struct *data)
-@@ -1229,7 +1229,7 @@ static void io_destroy(struct kioctx *io
- * by other CPUs at this point. Right now, we rely on the
- * locking done by the above calls to ensure this consistency.
- */
-- wake_up(&ioctx->wait);
-+ wake_up_all(&ioctx->wait);
- put_ioctx(ioctx); /* once for the lookup */
- }
-
-From 8d2587970b8bdf7c8d9208e3f4bb93182aef1a0f Mon Sep 17 00:00:00 2001
-From: Phil Carmody <ext-phil.2.carmody@nokia.com>
-Date: Tue, 22 Mar 2011 16:30:13 -0700
-Subject: cgroups: if you list_empty() a head then don't list_del() it
-
-From: Phil Carmody <ext-phil.2.carmody@nokia.com>
-
-commit 8d2587970b8bdf7c8d9208e3f4bb93182aef1a0f upstream.
-
-list_del() leaves poison in the prev and next pointers. The next
-list_empty() will compare those poisons, and say the list isn't empty.
-Any list operations that assume the node is on a list because of such a
-check will be fooled into dereferencing poison. One needs to INIT the
-node after the del, and fortunately there's already a wrapper for that -
-list_del_init().
-
-Some of the dels are followed by deallocations, so can be ignored, and one
-can be merged with an add to make a move. Apart from that, I erred on the
-side of caution in making nodes list_empty()-queriable.
-
-Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
-Reviewed-by: Paul Menage <menage@google.com>
-Cc: Li Zefan <lizf@cn.fujitsu.com>
-Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- kernel/cgroup.c | 14 ++++++--------
- 1 file changed, 6 insertions(+), 8 deletions(-)
-
---- a/kernel/cgroup.c
-+++ b/kernel/cgroup.c
-@@ -1813,10 +1813,8 @@ int cgroup_attach_task(struct cgroup *cg
-
- /* Update the css_set linked lists if we're using them */
- write_lock(&css_set_lock);
-- if (!list_empty(&tsk->cg_list)) {
-- list_del(&tsk->cg_list);
-- list_add(&tsk->cg_list, &newcg->tasks);
-- }
-+ if (!list_empty(&tsk->cg_list))
-+ list_move(&tsk->cg_list, &newcg->tasks);
- write_unlock(&css_set_lock);
-
- for_each_subsys(root, ss) {
-@@ -3655,12 +3653,12 @@ again:
- spin_lock(&release_list_lock);
- set_bit(CGRP_REMOVED, &cgrp->flags);
- if (!list_empty(&cgrp->release_list))
-- list_del(&cgrp->release_list);
-+ list_del_init(&cgrp->release_list);
- spin_unlock(&release_list_lock);
-
- cgroup_lock_hierarchy(cgrp->root);
- /* delete this cgroup from parent->children */
-- list_del(&cgrp->sibling);
-+ list_del_init(&cgrp->sibling);
- cgroup_unlock_hierarchy(cgrp->root);
-
- d = dget(cgrp->dentry);
-@@ -3879,7 +3877,7 @@ void cgroup_unload_subsys(struct cgroup_
- subsys[ss->subsys_id] = NULL;
-
- /* remove subsystem from rootnode's list of subsystems */
-- list_del(&ss->sibling);
-+ list_del_init(&ss->sibling);
-
- /*
- * disentangle the css from all css_sets attached to the dummytop. as
-@@ -4253,7 +4251,7 @@ void cgroup_exit(struct task_struct *tsk
- if (!list_empty(&tsk->cg_list)) {
- write_lock(&css_set_lock);
- if (!list_empty(&tsk->cg_list))
-- list_del(&tsk->cg_list);
-+ list_del_init(&tsk->cg_list);
- write_unlock(&css_set_lock);
- }
-
-From bee4c36a5cf5c9f63ce1d7372aa62045fbd16d47 Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Tue, 22 Mar 2011 16:33:43 -0700
-Subject: shmem: let shared anonymous be nonlinear again
-
-From: Hugh Dickins <hughd@google.com>
-
-commit bee4c36a5cf5c9f63ce1d7372aa62045fbd16d47 upstream.
-
-Up to 2.6.22, you could use remap_file_pages(2) on a tmpfs file or a
-shared mapping of /dev/zero or a shared anonymous mapping. In 2.6.23 we
-disabled it by default, but set VM_CAN_NONLINEAR to enable it on safe
-mappings. We made sure to set it in shmem_mmap() for tmpfs files, but
-missed it in shmem_zero_setup() for the others. Fix that at last.
-
-Reported-by: Kenny Simpson <theonetruekenny@yahoo.com>
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- mm/shmem.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/mm/shmem.c
-+++ b/mm/shmem.c
-@@ -2791,5 +2791,6 @@ int shmem_zero_setup(struct vm_area_stru
- fput(vma->vm_file);
- vma->vm_file = file;
- vma->vm_ops = &shmem_vm_ops;
-+ vma->vm_flags |= VM_CAN_NONLINEAR;
- return 0;
- }
-From 52c50567d8ab0a0a87f12cceaa4194967854f0bd Mon Sep 17 00:00:00 2001
-From: Mel Gorman <mgorman@suse.de>
-Date: Tue, 22 Mar 2011 16:30:08 -0700
-Subject: mm: swap: unlock swapfile inode mutex before closing file on bad swapfiles
-
-From: Mel Gorman <mgorman@suse.de>
-
-commit 52c50567d8ab0a0a87f12cceaa4194967854f0bd upstream.
-
-If an administrator tries to swapon a file backed by NFS, the inode mutex is
-taken (as it is for any swapfile) but later identified to be a bad swapfile
-due to the lack of bmap and tries to cleanup. During cleanup, an attempt is
-made to close the file but with inode->i_mutex still held. Closing an NFS
-file syncs it which tries to acquire the inode mutex leading to deadlock. If
-lockdep is enabled the following appears on the console;
-
- =============================================
- [ INFO: possible recursive locking detected ]
- 2.6.38-rc8-autobuild #1
- ---------------------------------------------
- swapon/2192 is trying to acquire lock:
- (&sb->s_type->i_mutex_key#13){+.+.+.}, at: vfs_fsync_range+0x47/0x7c
-
- but task is already holding lock:
- (&sb->s_type->i_mutex_key#13){+.+.+.}, at: sys_swapon+0x28d/0xae7
-
- other info that might help us debug this:
- 1 lock held by swapon/2192:
- #0: (&sb->s_type->i_mutex_key#13){+.+.+.}, at: sys_swapon+0x28d/0xae7
-
- stack backtrace:
- Pid: 2192, comm: swapon Not tainted 2.6.38-rc8-autobuild #1
- Call Trace:
- __lock_acquire+0x2eb/0x1623
- find_get_pages_tag+0x14a/0x174
- pagevec_lookup_tag+0x25/0x2e
- vfs_fsync_range+0x47/0x7c
- lock_acquire+0xd3/0x100
- vfs_fsync_range+0x47/0x7c
- nfs_flush_one+0x0/0xdf [nfs]
- mutex_lock_nested+0x40/0x2b1
- vfs_fsync_range+0x47/0x7c
- vfs_fsync_range+0x47/0x7c
- vfs_fsync+0x1c/0x1e
- nfs_file_flush+0x64/0x69 [nfs]
- filp_close+0x43/0x72
- sys_swapon+0xa39/0xae7
- sysret_check+0x2e/0x69
- system_call_fastpath+0x16/0x1b
-
-This patch releases the mutex if its held before calling filep_close()
-so swapon fails as expected without deadlock when the swapfile is backed
-by NFS. If accepted for 2.6.39, it should also be considered a -stable
-candidate for 2.6.38 and 2.6.37.
-
-Signed-off-by: Mel Gorman <mgorman@suse.de>
-Acked-by: Hugh Dickins <hughd@google.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- mm/swapfile.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
---- a/mm/swapfile.c
-+++ b/mm/swapfile.c
-@@ -2149,8 +2149,13 @@ bad_swap_2:
- p->flags = 0;
- spin_unlock(&swap_lock);
- vfree(swap_map);
-- if (swap_file)
-+ if (swap_file) {
-+ if (did_down) {
-+ mutex_unlock(&inode->i_mutex);
-+ did_down = 0;
-+ }
- filp_close(swap_file, NULL);
-+ }
- out:
- if (page && !IS_ERR(page)) {
- kunmap(page);
-From d527caf22e48480b102c7c6ee5b9ba12170148f7 Mon Sep 17 00:00:00 2001
-From: Andrea Arcangeli <aarcange@redhat.com>
-Date: Tue, 22 Mar 2011 16:30:38 -0700
-Subject: mm: compaction: prevent kswapd compacting memory to reduce CPU usage
-
-From: Andrea Arcangeli <aarcange@redhat.com>
-
-commit d527caf22e48480b102c7c6ee5b9ba12170148f7 upstream.
-
-This patch reverts 5a03b051 ("thp: use compaction in kswapd for GFP_ATOMIC
-order > 0") due to reports stating that kswapd CPU usage was higher and
-IRQs were being disabled more frequently. This was reported at
-http://www.spinics.net/linux/fedora/alsa-user/msg09885.html.
-
-Without this patch applied, CPU usage by kswapd hovers around the 20% mark
-according to the tester (Arthur Marsh:
-http://www.spinics.net/linux/fedora/alsa-user/msg09899.html). With this
-patch applied, it's around 2%.
-
-The problem is not related to THP which specifies __GFP_NO_KSWAPD but is
-triggered by high-order allocations hitting the low watermark for their
-order and waking kswapd on kernels with CONFIG_COMPACTION set. The most
-common trigger for this is network cards configured for jumbo frames but
-it's also possible it'll be triggered by fork-heavy workloads (order-1)
-and some wireless cards which depend on order-1 allocations.
-
-The symptoms for the user will be high CPU usage by kswapd in low-memory
-situations which could be confused with another writeback problem. While
-a patch like 5a03b051 may be reintroduced in the future, this patch plays
-it safe for now and reverts it.
-
-[mel@csn.ul.ie: Beefed up the changelog]
-Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
-Signed-off-by: Mel Gorman <mel@csn.ul.ie>
-Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
-Tested-by: Arthur Marsh <arthur.marsh@internode.on.net>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- include/linux/compaction.h | 9 ++-------
- mm/compaction.c | 24 +++---------------------
- mm/vmscan.c | 18 +-----------------
- 3 files changed, 6 insertions(+), 45 deletions(-)
-
---- a/include/linux/compaction.h
-+++ b/include/linux/compaction.h
-@@ -11,9 +11,6 @@
- /* The full zone was compacted */
- #define COMPACT_COMPLETE 3
-
--#define COMPACT_MODE_DIRECT_RECLAIM 0
--#define COMPACT_MODE_KSWAPD 1
--
- #ifdef CONFIG_COMPACTION
- extern int sysctl_compact_memory;
- extern int sysctl_compaction_handler(struct ctl_table *table, int write,
-@@ -28,8 +25,7 @@ extern unsigned long try_to_compact_page
- bool sync);
- extern unsigned long compaction_suitable(struct zone *zone, int order);
- extern unsigned long compact_zone_order(struct zone *zone, int order,
-- gfp_t gfp_mask, bool sync,
-- int compact_mode);
-+ gfp_t gfp_mask, bool sync);
-
- /* Do not skip compaction more than 64 times */
- #define COMPACT_MAX_DEFER_SHIFT 6
-@@ -74,8 +70,7 @@ static inline unsigned long compaction_s
- }
-
- static inline unsigned long compact_zone_order(struct zone *zone, int order,
-- gfp_t gfp_mask, bool sync,
-- int compact_mode)
-+ gfp_t gfp_mask, bool sync)
- {
- return COMPACT_CONTINUE;
- }
---- a/mm/compaction.c
-+++ b/mm/compaction.c
-@@ -42,8 +42,6 @@ struct compact_control {
- unsigned int order; /* order a direct compactor needs */
- int migratetype; /* MOVABLE, RECLAIMABLE etc */
- struct zone *zone;
--
-- int compact_mode;
- };
-
- static unsigned long release_freepages(struct list_head *freelist)
-@@ -397,10 +395,7 @@ static int compact_finished(struct zone
- return COMPACT_COMPLETE;
-
- /* Compaction run is not finished if the watermark is not met */
-- if (cc->compact_mode != COMPACT_MODE_KSWAPD)
-- watermark = low_wmark_pages(zone);
-- else
-- watermark = high_wmark_pages(zone);
-+ watermark = low_wmark_pages(zone);
- watermark += (1 << cc->order);
-
- if (!zone_watermark_ok(zone, cc->order, watermark, 0, 0))
-@@ -413,15 +408,6 @@ static int compact_finished(struct zone
- if (cc->order == -1)
- return COMPACT_CONTINUE;
-
-- /*
-- * Generating only one page of the right order is not enough
-- * for kswapd, we must continue until we're above the high
-- * watermark as a pool for high order GFP_ATOMIC allocations
-- * too.
-- */
-- if (cc->compact_mode == COMPACT_MODE_KSWAPD)
-- return COMPACT_CONTINUE;
--
- /* Direct compactor: Is a suitable page free? */
- for (order = cc->order; order < MAX_ORDER; order++) {
- /* Job done if page is free of the right migratetype */
-@@ -543,8 +529,7 @@ static int compact_zone(struct zone *zon
-
- unsigned long compact_zone_order(struct zone *zone,
- int order, gfp_t gfp_mask,
-- bool sync,
-- int compact_mode)
-+ bool sync)
- {
- struct compact_control cc = {
- .nr_freepages = 0,
-@@ -553,7 +538,6 @@ unsigned long compact_zone_order(struct
- .migratetype = allocflags_to_migratetype(gfp_mask),
- .zone = zone,
- .sync = sync,
-- .compact_mode = compact_mode,
- };
- INIT_LIST_HEAD(&cc.freepages);
- INIT_LIST_HEAD(&cc.migratepages);
-@@ -599,8 +583,7 @@ unsigned long try_to_compact_pages(struc
- nodemask) {
- int status;
-
-- status = compact_zone_order(zone, order, gfp_mask, sync,
-- COMPACT_MODE_DIRECT_RECLAIM);
-+ status = compact_zone_order(zone, order, gfp_mask, sync);
- rc = max(status, rc);
-
- /* If a normal allocation would succeed, stop compacting */
-@@ -631,7 +614,6 @@ static int compact_node(int nid)
- .nr_freepages = 0,
- .nr_migratepages = 0,
- .order = -1,
-- .compact_mode = COMPACT_MODE_DIRECT_RECLAIM,
- };
-
- zone = &pgdat->node_zones[zoneid];
---- a/mm/vmscan.c
-+++ b/mm/vmscan.c
-@@ -2397,7 +2397,6 @@ loop_again:
- * cause too much scanning of the lower zones.
- */
- for (i = 0; i <= end_zone; i++) {
-- int compaction;
- struct zone *zone = pgdat->node_zones + i;
- int nr_slab;
-
-@@ -2428,24 +2427,9 @@ loop_again:
- sc.nr_reclaimed += reclaim_state->reclaimed_slab;
- total_scanned += sc.nr_scanned;
-
-- compaction = 0;
-- if (order &&
-- zone_watermark_ok(zone, 0,
-- high_wmark_pages(zone),
-- end_zone, 0) &&
-- !zone_watermark_ok(zone, order,
-- high_wmark_pages(zone),
-- end_zone, 0)) {
-- compact_zone_order(zone,
-- order,
-- sc.gfp_mask, false,
-- COMPACT_MODE_KSWAPD);
-- compaction = 1;
-- }
--
- if (zone->all_unreclaimable)
- continue;
-- if (!compaction && nr_slab == 0 &&
-+ if (nr_slab == 0 &&
- !zone_reclaimable(zone))
- zone->all_unreclaimable = 1;
- /*
-From 3a5dda7a17cf3706f79b86293f29db02d61e0d48 Mon Sep 17 00:00:00 2001
-From: David Rientjes <rientjes@google.com>
-Date: Tue, 22 Mar 2011 16:30:09 -0700
-Subject: oom: prevent unnecessary oom kills or kernel panics
-
-From: David Rientjes <rientjes@google.com>
-
-commit 3a5dda7a17cf3706f79b86293f29db02d61e0d48 upstream.
-
-This patch prevents unnecessary oom kills or kernel panics by reverting
-two commits:
-
- 495789a5 (oom: make oom_score to per-process value)
- cef1d352 (oom: multi threaded process coredump don't make deadlock)
-
-First, 495789a5 (oom: make oom_score to per-process value) ignores the
-fact that all threads in a thread group do not necessarily exit at the
-same time.
-
-It is imperative that select_bad_process() detect threads that are in the
-exit path, specifically those with PF_EXITING set, to prevent needlessly
-killing additional tasks. If a process is oom killed and the thread group
-leader exits, select_bad_process() cannot detect the other threads that
-are PF_EXITING by iterating over only processes. Thus, it currently
-chooses another task unnecessarily for oom kill or panics the machine when
-nothing else is eligible.
-
-By iterating over threads instead, it is possible to detect threads that
-are exiting and nominate them for oom kill so they get access to memory
-reserves.
-
-Second, cef1d352 (oom: multi threaded process coredump don't make
-deadlock) erroneously avoids making the oom killer a no-op when an
-eligible thread other than current isfound to be exiting. We want to
-detect this situation so that we may allow that exiting thread time to
-exit and free its memory; if it is able to exit on its own, that should
-free memory so current is no loner oom. If it is not able to exit on its
-own, the oom killer will nominate it for oom kill which, in this case,
-only means it will get access to memory reserves.
-
-Without this change, it is easy for the oom killer to unnecessarily target
-tasks when all threads of a victim don't exit before the thread group
-leader or, in the worst case, panic the machine.
-
-Signed-off-by: David Rientjes <rientjes@google.com>
-Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
-Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
-Cc: Oleg Nesterov <oleg@redhat.com>
-Cc: Hugh Dickins <hughd@google.com>
-Cc: Andrey Vagin <avagin@openvz.org>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- mm/oom_kill.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/mm/oom_kill.c
-+++ b/mm/oom_kill.c
-@@ -292,11 +292,11 @@ static struct task_struct *select_bad_pr
- unsigned long totalpages, struct mem_cgroup *mem,
- const nodemask_t *nodemask)
- {
-- struct task_struct *p;
-+ struct task_struct *g, *p;
- struct task_struct *chosen = NULL;
- *ppoints = 0;
-
-- for_each_process(p) {
-+ do_each_thread(g, p) {
- unsigned int points;
-
- if (oom_unkillable_task(p, mem, nodemask))
-@@ -324,7 +324,7 @@ static struct task_struct *select_bad_pr
- * the process of exiting and releasing its resources.
- * Otherwise we could get an easy OOM deadlock.
- */
-- if (thread_group_empty(p) && (p->flags & PF_EXITING) && p->mm) {
-+ if ((p->flags & PF_EXITING) && p->mm) {
- if (p != current)
- return ERR_PTR(-1UL);
-
-@@ -337,7 +337,7 @@ static struct task_struct *select_bad_pr
- chosen = p;
- *ppoints = points;
- }
-- }
-+ } while_each_thread(g, p);
-
- return chosen;
- }
-From 30e2b41f20b6238f51e7cffb879c7a0f0073f5fe Mon Sep 17 00:00:00 2001
-From: Andrey Vagin <avagin@openvz.org>
-Date: Tue, 22 Mar 2011 16:30:11 -0700
-Subject: oom: skip zombies when iterating tasklist
-
-From: Andrey Vagin <avagin@openvz.org>
-
-commit 30e2b41f20b6238f51e7cffb879c7a0f0073f5fe upstream.
-
-We shouldn't defer oom killing if a thread has already detached its ->mm
-and still has TIF_MEMDIE set. Memory needs to be freed, so find kill
-other threads that pin the same ->mm or find another task to kill.
-
-Signed-off-by: Andrey Vagin <avagin@openvz.org>
-Signed-off-by: David Rientjes <rientjes@google.com>
-Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- mm/oom_kill.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/mm/oom_kill.c
-+++ b/mm/oom_kill.c
-@@ -299,6 +299,8 @@ static struct task_struct *select_bad_pr
- do_each_thread(g, p) {
- unsigned int points;
-
-+ if (!p->mm)
-+ continue;
- if (oom_unkillable_task(p, mem, nodemask))
- continue;
-
-@@ -324,7 +326,7 @@ static struct task_struct *select_bad_pr
- * the process of exiting and releasing its resources.
- * Otherwise we could get an easy OOM deadlock.
- */
-- if ((p->flags & PF_EXITING) && p->mm) {
-+ if (p->flags & PF_EXITING) {
- if (p != current)
- return ERR_PTR(-1UL);
-
-From edd45544c6f09550df0a5491aa8a07af24767e73 Mon Sep 17 00:00:00 2001
-From: David Rientjes <rientjes@google.com>
-Date: Tue, 22 Mar 2011 16:30:12 -0700
-Subject: oom: avoid deferring oom killer if exiting task is being traced
-
-From: David Rientjes <rientjes@google.com>
-
-commit edd45544c6f09550df0a5491aa8a07af24767e73 upstream.
-
-The oom killer naturally defers killing anything if it finds an eligible
-task that is already exiting and has yet to detach its ->mm. This avoids
-unnecessarily killing tasks when one is already in the exit path and may
-free enough memory that the oom killer is no longer needed. This is
-detected by PF_EXITING since threads that have already detached its ->mm
-are no longer considered at all.
-
-The problem with always deferring when a thread is PF_EXITING, however, is
-that it may never actually exit when being traced, specifically if another
-task is tracing it with PTRACE_O_TRACEEXIT. The oom killer does not want
-to defer in this case since there is no guarantee that thread will ever
-exit without intervention.
-
-This patch will now only defer the oom killer when a thread is PF_EXITING
-and no ptracer has stopped its progress in the exit path. It also ensures
-that a child is sacrificed for the chosen parent only if it has a
-different ->mm as the comment implies: this ensures that the thread group
-leader is always targeted appropriately.
-
-Signed-off-by: David Rientjes <rientjes@google.com>
-Reported-by: Oleg Nesterov <oleg@redhat.com>
-Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
-Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
-Cc: Hugh Dickins <hughd@google.com>
-Cc: Andrey Vagin <avagin@openvz.org>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- mm/oom_kill.c | 40 +++++++++++++++++++++++++---------------
- 1 file changed, 25 insertions(+), 15 deletions(-)
-
---- a/mm/oom_kill.c
-+++ b/mm/oom_kill.c
-@@ -31,6 +31,7 @@
- #include <linux/memcontrol.h>
- #include <linux/mempolicy.h>
- #include <linux/security.h>
-+#include <linux/ptrace.h>
-
- int sysctl_panic_on_oom;
- int sysctl_oom_kill_allocating_task;
-@@ -316,22 +317,29 @@ static struct task_struct *select_bad_pr
- if (test_tsk_thread_flag(p, TIF_MEMDIE))
- return ERR_PTR(-1UL);
-
-- /*
-- * This is in the process of releasing memory so wait for it
-- * to finish before killing some other task by mistake.
-- *
-- * However, if p is the current task, we allow the 'kill' to
-- * go ahead if it is exiting: this will simply set TIF_MEMDIE,
-- * which will allow it to gain access to memory reserves in
-- * the process of exiting and releasing its resources.
-- * Otherwise we could get an easy OOM deadlock.
-- */
- if (p->flags & PF_EXITING) {
-- if (p != current)
-- return ERR_PTR(-1UL);
--
-- chosen = p;
-- *ppoints = 1000;
-+ /*
-+ * If p is the current task and is in the process of
-+ * releasing memory, we allow the "kill" to set
-+ * TIF_MEMDIE, which will allow it to gain access to
-+ * memory reserves. Otherwise, it may stall forever.
-+ *
-+ * The loop isn't broken here, however, in case other
-+ * threads are found to have already been oom killed.
-+ */
-+ if (p == current) {
-+ chosen = p;
-+ *ppoints = 1000;
-+ } else {
-+ /*
-+ * If this task is not being ptraced on exit,
-+ * then wait for it to finish before killing
-+ * some other task unnecessarily.
-+ */
-+ if (!(task_ptrace(p->group_leader) &
-+ PT_TRACE_EXIT))
-+ return ERR_PTR(-1UL);
-+ }
- }
-
- points = oom_badness(p, mem, nodemask, totalpages);
-@@ -493,6 +501,8 @@ static int oom_kill_process(struct task_
- list_for_each_entry(child, &t->children, sibling) {
- unsigned int child_points;
-
-+ if (child->mm == p->mm)
-+ continue;
- /*
- * oom_badness() returns 0 if the thread is unkillable
- */
-From 47e9037ac16637cd7f12b8790ea7ce6680e42168 Mon Sep 17 00:00:00 2001
-From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-Date: Mon, 28 Feb 2011 16:20:11 +0000
-Subject: PCI hotplug: acpiphp: set current_state to D0 in register_slot
-
-From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-
-commit 47e9037ac16637cd7f12b8790ea7ce6680e42168 upstream.
-
-If a device doesn't support power management (pm_cap == 0) but it is
-acpi_pci_power_manageable() because there is a _PS0 method declared for
-it and _EJ0 is also declared for the slot then nobody is going to set
-current_state = PCI_D0 for this device. This is what I think it is
-happening:
-
-pci_enable_device
- |
-__pci_enable_device_flags
-/* here we do not set current_state because !pm_cap */
- |
-do_pci_enable_device
- |
-pci_set_power_state
- |
-__pci_start_power_transition
- |
-pci_platform_power_transition
-/* platform_pci_power_manageable() calls acpi_pci_power_manageable that
- * returns true */
- |
-platform_pci_set_power_state
-/* acpi_pci_set_power_state gets called and does nothing because the
- * acpi device has _EJ0, see the comment "If the ACPI device has _EJ0,
- * ignore the device" */
-
-at this point if we refer to the commit message that introduced the
-comment above (10b3dcae0f275e2546e55303d64ddbb58cec7599), it is up to
-the hotplug driver to set the state to D0.
-However AFAICT the pci hotplug driver never does, in fact
-drivers/pci/hotplug/acpiphp_glue.c:register_slot sets the slot flags to
-(SLOT_ENABLED | SLOT_POWEREDON) but it does not set the pci device
-current state to PCI_D0.
-
-So my proposed fix is also to set current_state = PCI_D0 in
-register_slot.
-Comments are very welcome.
-
-Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/pci/hotplug/acpiphp_glue.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/pci/hotplug/acpiphp_glue.c
-+++ b/drivers/pci/hotplug/acpiphp_glue.c
-@@ -212,6 +212,7 @@ register_slot(acpi_handle handle, u32 lv
-
- pdev = pci_get_slot(pbus, PCI_DEVFN(device, function));
- if (pdev) {
-+ pdev->current_state = PCI_D0;
- slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
- pci_dev_put(pdev);
- }
-From 8c3c283e6bf463ab498d6e7823aff6c4762314b6 Mon Sep 17 00:00:00 2001
-From: Olaf Hering <olaf@aepfle.de>
-Date: Wed, 16 Mar 2011 22:11:46 -0700
-Subject: Input: xen-kbdfront - advertise either absolute or relative coordinates
-
-From: Olaf Hering <olaf@aepfle.de>
-
-commit 8c3c283e6bf463ab498d6e7823aff6c4762314b6 upstream.
-
-A virtualized display device is usually viewed with the vncviewer
-application, either by 'xm vnc domU' or with vncviewer localhost:port.
-vncviewer and the RFB protocol provides absolute coordinates to the
-virtual display. These coordinates are either passed through to a PV
-guest or converted to relative coordinates for a HVM guest.
-
-A PV guest receives these coordinates and passes them to the kernels
-evdev driver. There it can be picked up by applications such as the
-xorg-input drivers. Using absolute coordinates avoids issues such as
-guest mouse pointer not tracking host mouse pointer due to wrong mouse
-acceleration settings in the guests X display.
-
-Advertise either absolute or relative coordinates to the input system
-and the evdev driver, depending on what dom0 provides. The xorg-input
-driver prefers relative coordinates even if a devices provides both.
-
-Signed-off-by: Olaf Hering <olaf@aepfle.de>
-Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- drivers/input/xen-kbdfront.c | 44 +++++++++++++++++++++++--------------------
- 1 file changed, 24 insertions(+), 20 deletions(-)
-
---- a/drivers/input/xen-kbdfront.c
-+++ b/drivers/input/xen-kbdfront.c
-@@ -110,7 +110,7 @@ static irqreturn_t input_handler(int rq,
- static int __devinit xenkbd_probe(struct xenbus_device *dev,
- const struct xenbus_device_id *id)
- {
-- int ret, i;
-+ int ret, i, abs;
- struct xenkbd_info *info;
- struct input_dev *kbd, *ptr;
-
-@@ -128,6 +128,11 @@ static int __devinit xenkbd_probe(struct
- if (!info->page)
- goto error_nomem;
-
-+ if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0)
-+ abs = 0;
-+ if (abs)
-+ xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", "1");
-+
- /* keyboard */
- kbd = input_allocate_device();
- if (!kbd)
-@@ -137,11 +142,12 @@ static int __devinit xenkbd_probe(struct
- kbd->id.bustype = BUS_PCI;
- kbd->id.vendor = 0x5853;
- kbd->id.product = 0xffff;
-- kbd->evbit[0] = BIT(EV_KEY);
-+
-+ __set_bit(EV_KEY, kbd->evbit);
- for (i = KEY_ESC; i < KEY_UNKNOWN; i++)
-- set_bit(i, kbd->keybit);
-+ __set_bit(i, kbd->keybit);
- for (i = KEY_OK; i < KEY_MAX; i++)
-- set_bit(i, kbd->keybit);
-+ __set_bit(i, kbd->keybit);
-
- ret = input_register_device(kbd);
- if (ret) {
-@@ -160,12 +166,20 @@ static int __devinit xenkbd_probe(struct
- ptr->id.bustype = BUS_PCI;
- ptr->id.vendor = 0x5853;
- ptr->id.product = 0xfffe;
-- ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
-+
-+ if (abs) {
-+ __set_bit(EV_ABS, ptr->evbit);
-+ input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
-+ input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
-+ } else {
-+ input_set_capability(ptr, EV_REL, REL_X);
-+ input_set_capability(ptr, EV_REL, REL_Y);
-+ }
-+ input_set_capability(ptr, EV_REL, REL_WHEEL);
-+
-+ __set_bit(EV_KEY, ptr->evbit);
- for (i = BTN_LEFT; i <= BTN_TASK; i++)
-- set_bit(i, ptr->keybit);
-- ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL);
-- input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
-- input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
-+ __set_bit(i, ptr->keybit);
-
- ret = input_register_device(ptr);
- if (ret) {
-@@ -272,7 +286,7 @@ static void xenkbd_backend_changed(struc
- enum xenbus_state backend_state)
- {
- struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
-- int ret, val;
-+ int val;
-
- switch (backend_state) {
- case XenbusStateInitialising:
-@@ -285,16 +299,6 @@ static void xenkbd_backend_changed(struc
-
- case XenbusStateInitWait:
- InitWait:
-- ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
-- "feature-abs-pointer", "%d", &val);
-- if (ret < 0)
-- val = 0;
-- if (val) {
-- ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
-- "request-abs-pointer", "1");
-- if (ret)
-- pr_warning("can't request abs-pointer\n");
-- }
- xenbus_switch_state(dev, XenbusStateConnected);
- break;
-
-From 14988a4d350ce3b41ecad4f63c4f44c56f5ae34d Mon Sep 17 00:00:00 2001
-From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-Date: Fri, 18 Feb 2011 11:32:40 +0000
-Subject: xen: set max_pfn_mapped to the last pfn mapped
-
-From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-
-commit 14988a4d350ce3b41ecad4f63c4f44c56f5ae34d upstream.
-
-Do not set max_pfn_mapped to the end of the initial memory mappings,
-that also contain pages that don't belong in pfn space (like the mfn
-list).
-
-Set max_pfn_mapped to the last real pfn mapped in the initial memory
-mappings that is the pfn backing _end.
-
-Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-LKML-Reference: <alpine.DEB.2.00.1103171739050.3382@kaball-desktop>
-Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- arch/x86/xen/mmu.c | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
---- a/arch/x86/xen/mmu.c
-+++ b/arch/x86/xen/mmu.c
-@@ -1651,9 +1651,6 @@ static __init void xen_map_identity_earl
- for (pteidx = 0; pteidx < PTRS_PER_PTE; pteidx++, pfn++) {
- pte_t pte;
-
-- if (pfn > max_pfn_mapped)
-- max_pfn_mapped = pfn;
--
- if (!pte_none(pte_page[pteidx]))
- continue;
-
-@@ -1711,6 +1708,12 @@ __init pgd_t *xen_setup_kernel_pagetable
- pud_t *l3;
- pmd_t *l2;
-
-+ /* max_pfn_mapped is the last pfn mapped in the initial memory
-+ * mappings. Considering that on Xen after the kernel mappings we
-+ * have the mappings of some pages that don't exist in pfn space, we
-+ * set max_pfn_mapped to the last real pfn mapped. */
-+ max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list));
-+
- /* Zap identity mapping */
- init_level4_pgt[0] = __pgd(0);
-
-@@ -1815,9 +1818,7 @@ __init pgd_t *xen_setup_kernel_pagetable
- initial_kernel_pmd =
- extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE);
-
-- max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
-- xen_start_info->nr_pt_frames * PAGE_SIZE +
-- 512*1024);
-+ max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->mfn_list));
-
- kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd);
- memcpy(initial_kernel_pmd, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD);
-From da48524eb20662618854bb3df2db01fc65f3070c Mon Sep 17 00:00:00 2001
-From: Julien Tinnes <jln@google.com>
-Date: Fri, 18 Mar 2011 15:05:21 -0700
-Subject: Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code
-
-From: Julien Tinnes <jln@google.com>
-
-commit da48524eb20662618854bb3df2db01fc65f3070c upstream.
-
-Userland should be able to trust the pid and uid of the sender of a
-signal if the si_code is SI_TKILL.
-
-Unfortunately, the kernel has historically allowed sigqueueinfo() to
-send any si_code at all (as long as it was negative - to distinguish it
-from kernel-generated signals like SIGILL etc), so it could spoof a
-SI_TKILL with incorrect siginfo values.
-
-Happily, it looks like glibc has always set si_code to the appropriate
-SI_QUEUE, so there are probably no actual user code that ever uses
-anything but the appropriate SI_QUEUE flag.
-
-So just tighten the check for si_code (we used to allow any negative
-value), and add a (one-time) warning in case there are binaries out
-there that might depend on using other si_code values.
-
-Signed-off-by: Julien Tinnes <jln@google.com>
-Acked-by: Oleg Nesterov <oleg@redhat.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- kernel/signal.c | 16 ++++++++++++----
- 1 file changed, 12 insertions(+), 4 deletions(-)
-
---- a/kernel/signal.c
-+++ b/kernel/signal.c
-@@ -2421,9 +2421,13 @@ SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t,
- return -EFAULT;
-
- /* Not even root can pretend to send signals from the kernel.
-- Nor can they impersonate a kill(), which adds source info. */
-- if (info.si_code >= 0)
-+ * Nor can they impersonate a kill()/tgkill(), which adds source info.
-+ */
-+ if (info.si_code != SI_QUEUE) {
-+ /* We used to allow any < 0 si_code */
-+ WARN_ON_ONCE(info.si_code < 0);
- return -EPERM;
-+ }
- info.si_signo = sig;
-
- /* POSIX.1b doesn't mention process groups. */
-@@ -2437,9 +2441,13 @@ long do_rt_tgsigqueueinfo(pid_t tgid, pi
- return -EINVAL;
-
- /* Not even root can pretend to send signals from the kernel.
-- Nor can they impersonate a kill(), which adds source info. */
-- if (info->si_code >= 0)
-+ * Nor can they impersonate a kill()/tgkill(), which adds source info.
-+ */
-+ if (info->si_code != SI_QUEUE) {
-+ /* We used to allow any < 0 si_code */
-+ WARN_ON_ONCE(info->si_code < 0);
- return -EPERM;
-+ }
- info->si_signo = sig;
-
- return do_send_specific(tgid, pid, sig, info);
-From c6066ab342e8cb3e4e3ec74f7577f099d79465b3 Mon Sep 17 00:00:00 2001
-From: David Henningsson <david.henningsson@canonical.com>
-Date: Tue, 22 Mar 2011 10:23:28 +0100
-Subject: ALSA: HDA: Fix internal mic on Dell E5420/E5520
-
-From: David Henningsson <david.henningsson@canonical.com>
-
-This is a fixup for the 2.6.38 kernel, as the issue is being resolved
-by upstream commits 699d899560cd7e72da39231e584412e7ac8114a4 and
-094a42452abd5564429045e210281c6d22e67fca - which are too invasive
-to reach 2.6.38. Instead make pin fixes as a workaround.
-
-BugLink: http://bugs.launchpad.net/bugs/740055
-Tested-by: Kent Baxley <kent.baxley@canonical.com>
-Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-Acked-by: Takashi Iwai <tiwai@suse.de>
-
----
- sound/pci/hda/patch_sigmatel.c | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
---- a/sound/pci/hda/patch_sigmatel.c
-+++ b/sound/pci/hda/patch_sigmatel.c
-@@ -94,6 +94,7 @@ enum {
- STAC_92HD83XXX_REF,
- STAC_92HD83XXX_PWR_REF,
- STAC_DELL_S14,
-+ STAC_DELL_E5520M,
- STAC_92HD83XXX_HP,
- STAC_HP_DV7_4000,
- STAC_92HD83XXX_MODELS
-@@ -1657,6 +1658,13 @@ static unsigned int dell_s14_pin_configs
- 0x40f000f0, 0x40f000f0,
- };
-
-+/* Switch int mic from 0x20 to 0x11 */
-+static unsigned int dell_e5520m_pin_configs[10] = {
-+ 0x04a11020, 0x0421101f, 0x400000f0, 0x90170110,
-+ 0x23011050, 0x23a1102e, 0x400000f3, 0xd5a30130,
-+ 0x400000f0, 0x40f000f0,
-+};
-+
- static unsigned int hp_dv7_4000_pin_configs[10] = {
- 0x03a12050, 0x0321201f, 0x40f000f0, 0x90170110,
- 0x40f000f0, 0x40f000f0, 0x90170110, 0xd5a30140,
-@@ -1667,6 +1675,7 @@ static unsigned int *stac92hd83xxx_brd_t
- [STAC_92HD83XXX_REF] = ref92hd83xxx_pin_configs,
- [STAC_92HD83XXX_PWR_REF] = ref92hd83xxx_pin_configs,
- [STAC_DELL_S14] = dell_s14_pin_configs,
-+ [STAC_DELL_E5520M] = dell_e5520m_pin_configs,
- [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs,
- };
-
-@@ -1675,6 +1684,7 @@ static const char * const stac92hd83xxx_
- [STAC_92HD83XXX_REF] = "ref",
- [STAC_92HD83XXX_PWR_REF] = "mic-ref",
- [STAC_DELL_S14] = "dell-s14",
-+ [STAC_DELL_E5520M] = "dell-e5520m",
- [STAC_92HD83XXX_HP] = "hp",
- [STAC_HP_DV7_4000] = "hp-dv7-4000",
- };
-@@ -1687,6 +1697,14 @@ static struct snd_pci_quirk stac92hd83xx
- "DFI LanParty", STAC_92HD83XXX_REF),
- SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02ba,
- "unknown Dell", STAC_DELL_S14),
-+ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x049a,
-+ "Dell E5520", STAC_DELL_E5520M),
-+ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x049b,
-+ "Dell E5420", STAC_DELL_E5520M),
-+ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x04eb,
-+ "Dell E5420m", STAC_DELL_E5520M),
-+ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x04ec,
-+ "Dell E5520m", STAC_DELL_E5520M),
- SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xff00, 0x3600,
- "HP", STAC_92HD83XXX_HP),
- {} /* terminator */
-From ef2b4b95a63a1d23958dcb99eb2c6898eddc87d0 Mon Sep 17 00:00:00 2001
-From: Andrea Arcangeli <aarcange@redhat.com>
-Date: Fri, 18 Mar 2011 00:16:35 +0100
-Subject: mm: PageBuddy and mapcount robustness
-
-From: Andrea Arcangeli <aarcange@redhat.com>
-
-commit ef2b4b95a63a1d23958dcb99eb2c6898eddc87d0 upstream.
-
-Change the _mapcount value indicating PageBuddy from -2 to -128 for
-more robusteness against page_mapcount() undeflows.
-
-Use reset_page_mapcount instead of __ClearPageBuddy in bad_page to
-ignore the previous retval of PageBuddy().
-
-Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
-Reported-by: Hugh Dickins <hughd@google.com>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- include/linux/mm.h | 11 +++++++++--
- mm/page_alloc.c | 4 ++--
- 2 files changed, 11 insertions(+), 4 deletions(-)
-
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -402,16 +402,23 @@ static inline void init_page_count(struc
- /*
- * PageBuddy() indicate that the page is free and in the buddy system
- * (see mm/page_alloc.c).
-+ *
-+ * PAGE_BUDDY_MAPCOUNT_VALUE must be <= -2 but better not too close to
-+ * -2 so that an underflow of the page_mapcount() won't be mistaken
-+ * for a genuine PAGE_BUDDY_MAPCOUNT_VALUE. -128 can be created very
-+ * efficiently by most CPU architectures.
- */
-+#define PAGE_BUDDY_MAPCOUNT_VALUE (-128)
-+
- static inline int PageBuddy(struct page *page)
- {
-- return atomic_read(&page->_mapcount) == -2;
-+ return atomic_read(&page->_mapcount) == PAGE_BUDDY_MAPCOUNT_VALUE;
- }
-
- static inline void __SetPageBuddy(struct page *page)
- {
- VM_BUG_ON(atomic_read(&page->_mapcount) != -1);
-- atomic_set(&page->_mapcount, -2);
-+ atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE);
- }
-
- static inline void __ClearPageBuddy(struct page *page)
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -286,7 +286,7 @@ static void bad_page(struct page *page)
-
- /* Don't complain about poisoned pages */
- if (PageHWPoison(page)) {
-- __ClearPageBuddy(page);
-+ reset_page_mapcount(page); /* remove PageBuddy */
- return;
- }
-
-@@ -317,7 +317,7 @@ static void bad_page(struct page *page)
- dump_stack();
- out:
- /* Leave bad fields for debug, except PageBuddy could make trouble */
-- __ClearPageBuddy(page);
-+ reset_page_mapcount(page); /* remove PageBuddy */
- add_taint(TAINT_BAD_PAGE);
- }
-
diff --git a/patches/2.6.38.3-pre.patch b/patches/2.6.38.3-pre.patch
new file mode 100644
index 0000000..6d5f835
--- /dev/null
+++ b/patches/2.6.38.3-pre.patch
@@ -0,0 +1,1140 @@
+From 677cd904aba939bc4cfdc3c1eada8ec46582127e Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Mon, 7 Feb 2011 15:19:34 +0100
+Subject: ALSA: HDA: New AD1984A model for Dell Precision R5500
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+commit 677cd904aba939bc4cfdc3c1eada8ec46582127e upstream.
+
+For codec AD1984A, add a new model to support Dell Precision R5500
+or the microphone jack won't work correctly.
+
+BugLink: http://bugs.launchpad.net/bugs/741516
+Tested-by: Kent Baxley <kent.baxley@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_analog.c | 89 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 89 insertions(+)
+
+--- a/sound/pci/hda/patch_analog.c
++++ b/sound/pci/hda/patch_analog.c
+@@ -4353,6 +4353,84 @@ static int ad1984a_thinkpad_init(struct
+ }
+
+ /*
++ * Precision R5500
++ * 0x12 - HP/line-out
++ * 0x13 - speaker (mono)
++ * 0x15 - mic-in
++ */
++
++static struct hda_verb ad1984a_precision_verbs[] = {
++ /* Unmute main output path */
++ {0x03, AC_VERB_SET_AMP_GAIN_MUTE, 0x27}, /* 0dB */
++ {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x1f}, /* 0dB */
++ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5) + 0x17}, /* 0dB */
++ /* Analog mixer; mute as default */
++ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
++ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
++ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
++ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
++ {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
++ /* Select mic as input */
++ {0x0c, AC_VERB_SET_CONNECT_SEL, 0x1},
++ {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE + 0x27}, /* 0dB */
++ /* Configure as mic */
++ {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
++ {0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0x7002}, /* raise mic as default */
++ /* HP unmute */
++ {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
++ /* turn on EAPD */
++ {0x13, AC_VERB_SET_EAPD_BTLENABLE, 0x02},
++ /* unsolicited event for pin-sense */
++ {0x12, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1884A_HP_EVENT},
++ { } /* end */
++};
++
++static struct snd_kcontrol_new ad1984a_precision_mixers[] = {
++ HDA_CODEC_VOLUME("Master Playback Volume", 0x21, 0x0, HDA_OUTPUT),
++ HDA_CODEC_MUTE("Master Playback Switch", 0x21, 0x0, HDA_OUTPUT),
++ HDA_CODEC_VOLUME("PCM Playback Volume", 0x20, 0x5, HDA_INPUT),
++ HDA_CODEC_MUTE("PCM Playback Switch", 0x20, 0x5, HDA_INPUT),
++ HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x01, HDA_INPUT),
++ HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x01, HDA_INPUT),
++ HDA_CODEC_VOLUME("Mic Boost Volume", 0x15, 0x0, HDA_INPUT),
++ HDA_CODEC_MUTE("Front Playback Switch", 0x12, 0x0, HDA_OUTPUT),
++ HDA_CODEC_VOLUME("Speaker Playback Volume", 0x13, 0x0, HDA_OUTPUT),
++ HDA_CODEC_VOLUME("Capture Volume", 0x0c, 0x0, HDA_OUTPUT),
++ HDA_CODEC_MUTE("Capture Switch", 0x0c, 0x0, HDA_OUTPUT),
++ { } /* end */
++};
++
++
++/* mute internal speaker if HP is plugged */
++static void ad1984a_precision_automute(struct hda_codec *codec)
++{
++ unsigned int present;
++
++ present = snd_hda_jack_detect(codec, 0x12);
++ snd_hda_codec_amp_stereo(codec, 0x13, HDA_OUTPUT, 0,
++ HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
++}
++
++
++/* unsolicited event for HP jack sensing */
++static void ad1984a_precision_unsol_event(struct hda_codec *codec,
++ unsigned int res)
++{
++ if ((res >> 26) != AD1884A_HP_EVENT)
++ return;
++ ad1984a_precision_automute(codec);
++}
++
++/* initialize jack-sensing, too */
++static int ad1984a_precision_init(struct hda_codec *codec)
++{
++ ad198x_init(codec);
++ ad1984a_precision_automute(codec);
++ return 0;
++}
++
++
++/*
+ * HP Touchsmart
+ * port-A (0x11) - front hp-out
+ * port-B (0x14) - unused
+@@ -4481,6 +4559,7 @@ enum {
+ AD1884A_MOBILE,
+ AD1884A_THINKPAD,
+ AD1984A_TOUCHSMART,
++ AD1984A_PRECISION,
+ AD1884A_MODELS
+ };
+
+@@ -4490,9 +4569,11 @@ static const char * const ad1884a_models
+ [AD1884A_MOBILE] = "mobile",
+ [AD1884A_THINKPAD] = "thinkpad",
+ [AD1984A_TOUCHSMART] = "touchsmart",
++ [AD1984A_PRECISION] = "precision",
+ };
+
+ static struct snd_pci_quirk ad1884a_cfg_tbl[] = {
++ SND_PCI_QUIRK(0x1028, 0x04ac, "Precision R5500", AD1984A_PRECISION),
+ SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
+ SND_PCI_QUIRK(0x103c, 0x3037, "HP 2230s", AD1884A_LAPTOP),
+ SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE),
+@@ -4586,6 +4667,14 @@ static int patch_ad1884a(struct hda_code
+ codec->patch_ops.unsol_event = ad1984a_thinkpad_unsol_event;
+ codec->patch_ops.init = ad1984a_thinkpad_init;
+ break;
++ case AD1984A_PRECISION:
++ spec->mixers[0] = ad1984a_precision_mixers;
++ spec->init_verbs[spec->num_init_verbs++] =
++ ad1984a_precision_verbs;
++ spec->multiout.dig_out_nid = 0;
++ codec->patch_ops.unsol_event = ad1984a_precision_unsol_event;
++ codec->patch_ops.init = ad1984a_precision_init;
++ break;
+ case AD1984A_TOUCHSMART:
+ spec->mixers[0] = ad1984a_touchsmart_mixers;
+ spec->init_verbs[0] = ad1984a_touchsmart_verbs;
+From 20b67dddcc5f29d3d0c900225d85e0ac655bc69d Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 23 Mar 2011 22:54:32 +0100
+Subject: ALSA: hda - Fix SPDIF out regression on ALC889
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 20b67dddcc5f29d3d0c900225d85e0ac655bc69d upstream.
+
+The commit 5a8cfb4e8ae317d283f84122ed20faa069c5e0c4
+ ALSA: hda - Use ALC_INIT_DEFAULT for really default initialization
+changed to use the default initialization method for ALC889, but
+this caused a regression on SPDIF output on some machines.
+This seems due to the COEF setup included in the default init procedure.
+For making SPDIF working again, the COEF-setup has to be avoided for
+the id 0889.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=24342
+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
+@@ -1360,7 +1360,7 @@ static void alc_auto_init_amp(struct hda
+ case 0x10ec0883:
+ case 0x10ec0885:
+ case 0x10ec0887:
+- case 0x10ec0889:
++ /*case 0x10ec0889:*/ /* this causes an SPDIF problem */
+ alc889_coef_init(codec);
+ break;
+ case 0x10ec0888:
+From a45e3d6b13e97506b616980c0f122c3389bcefa4 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 24 Mar 2011 09:50:15 +0100
+Subject: ALSA: Fix yet another race in disconnection
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit a45e3d6b13e97506b616980c0f122c3389bcefa4 upstream.
+
+This patch fixes a race between snd_card_file_remove() and
+snd_card_disconnect(). When the card is added to shutdown_files list
+in snd_card_disconnect(), but it's freed in snd_card_file_remove() at
+the same time, the shutdown_files list gets corrupted. The list member
+must be freed in snd_card_file_remove() as well.
+
+Reported-and-tested-by: Russ Dill <russ.dill@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/core/init.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/sound/core/init.c
++++ b/sound/core/init.c
+@@ -848,6 +848,7 @@ int snd_card_file_add(struct snd_card *c
+ return -ENOMEM;
+ mfile->file = file;
+ mfile->disconnected_f_op = NULL;
++ INIT_LIST_HEAD(&mfile->shutdown_list);
+ spin_lock(&card->files_lock);
+ if (card->shutdown) {
+ spin_unlock(&card->files_lock);
+@@ -883,6 +884,9 @@ int snd_card_file_remove(struct snd_card
+ list_for_each_entry(mfile, &card->files_list, list) {
+ if (mfile->file == file) {
+ list_del(&mfile->list);
++ spin_lock(&shutdown_lock);
++ list_del(&mfile->shutdown_list);
++ spin_unlock(&shutdown_lock);
+ if (mfile->disconnected_f_op)
+ fops_put(mfile->disconnected_f_op);
+ found = mfile;
+From 3674f19dabd15f9541079a588149a370d888f4e6 Mon Sep 17 00:00:00 2001
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Fri, 25 Mar 2011 17:51:54 +1100
+Subject: ALSA: vmalloc buffers should use normal mmap
+
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+
+commit 3674f19dabd15f9541079a588149a370d888f4e6 upstream.
+
+It's a big no-no to use pgprot_noncached() when mmap'ing such buffers
+into userspace since they are mapped cachable in kernel space.
+
+This can cause all sort of interesting things ranging from to garbled
+sound to lockups on various architectures. I've observed that usb-audio
+is broken on powerpc 4xx for example because of that.
+
+Also remove the now unused snd_pcm_lib_mmap_noncached(). It's
+an arch business to know when to use uncached mappings, there's
+already hacks for MIPS inside snd_pcm_default_mmap() and other
+archs are supposed to use dma_mmap_coherent().
+
+(See my separate patch that adds dma_mmap_coherent() to powerpc)
+
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/sound/pcm.h | 4 +---
+ sound/core/pcm_native.c | 9 ---------
+ 2 files changed, 1 insertion(+), 12 deletions(-)
+
+--- a/include/sound/pcm.h
++++ b/include/sound/pcm.h
+@@ -1030,9 +1030,7 @@ int snd_pcm_lib_mmap_iomem(struct snd_pc
+ #define snd_pcm_lib_mmap_iomem NULL
+ #endif
+
+-int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream,
+- struct vm_area_struct *area);
+-#define snd_pcm_lib_mmap_vmalloc snd_pcm_lib_mmap_noncached
++#define snd_pcm_lib_mmap_vmalloc NULL
+
+ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
+ {
+--- a/sound/core/pcm_native.c
++++ b/sound/core/pcm_native.c
+@@ -3201,15 +3201,6 @@ int snd_pcm_lib_mmap_iomem(struct snd_pc
+ EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);
+ #endif /* SNDRV_PCM_INFO_MMAP */
+
+-/* mmap callback with pgprot_noncached */
+-int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream,
+- struct vm_area_struct *area)
+-{
+- area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
+- return snd_pcm_default_mmap(substream, area);
+-}
+-EXPORT_SYMBOL(snd_pcm_lib_mmap_noncached);
+-
+ /*
+ * mmap DMA buffer
+ */
+From 880f57318450dbead6a03f9e31a1468924d6dd88 Mon Sep 17 00:00:00 2001
+From: Frederic Weisbecker <fweisbec@gmail.com>
+Date: Wed, 23 Mar 2011 19:29:39 +0100
+Subject: perf: Better fit max unprivileged mlock pages for tools needs
+
+From: Frederic Weisbecker <fweisbec@gmail.com>
+
+commit 880f57318450dbead6a03f9e31a1468924d6dd88 upstream.
+
+The maximum kilobytes of locked memory that an unprivileged user
+can reserve is of 512 kB = 128 pages by default, scaled to the
+number of onlined CPUs, which fits well with the tools that use
+128 data pages by default.
+
+However tools actually use 129 pages, because they need one more
+for the user control page. Thus the default mlock threshold is
+not sufficient for the default tools needs and we always end up
+to evaluate the constant mlock rlimit policy, which doesn't have
+this scaling with the number of online CPUs.
+
+Hence, on systems that have more than 16 CPUs, we overlap the
+rlimit threshold and fail to mmap:
+
+ $ perf record ls
+ Error: failed to mmap with 1 (Operation not permitted)
+
+Just increase the max unprivileged mlock threshold by one page
+so that it supports well perf tools even after 16 CPUs.
+
+Reported-by: Han Pingtian <phan@redhat.com>
+Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
+Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Stephane Eranian <eranian@google.com>
+LKML-Reference: <1300904979-5508-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 | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/perf_event.c
++++ b/kernel/perf_event.c
+@@ -62,7 +62,8 @@ static struct srcu_struct pmus_srcu;
+ */
+ int sysctl_perf_event_paranoid __read_mostly = 1;
+
+-int sysctl_perf_event_mlock __read_mostly = 512; /* 'free' kb per user */
++/* Minimum for 128 pages + 1 for the user control page */
++int sysctl_perf_event_mlock __read_mostly = 516; /* 'free' kb per user */
+
+ /*
+ * max perf event sample rate
+From cda6587c21a887254c8ed4b58da8fcc4040ab557 Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+Date: Wed, 23 Mar 2011 02:44:30 +0000
+Subject: myri10ge: fix rmmod crash
+
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit cda6587c21a887254c8ed4b58da8fcc4040ab557 upstream.
+
+Rmmod myri10ge crash at free_netdev() -> netif_napi_del(), because napi
+structures are already deallocated. To fix call netif_napi_del() before
+kfree() at myri10ge_free_slices().
+
+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/myri10ge/myri10ge.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/myri10ge/myri10ge.c
++++ b/drivers/net/myri10ge/myri10ge.c
+@@ -3645,6 +3645,7 @@ static void myri10ge_free_slices(struct
+ dma_free_coherent(&pdev->dev, bytes,
+ ss->fw_stats, ss->fw_stats_bus);
+ ss->fw_stats = NULL;
++ netif_napi_del(&ss->napi);
+ }
+ }
+ kfree(mgp->ss);
+From 1ddd5049545e0aa1a0ed19bca4d9c9c3ce1ac8a2 Mon Sep 17 00:00:00 2001
+From: Bud Brown <bud.brown@redhat.com>
+Date: Wed, 23 Mar 2011 20:47:11 +0100
+Subject: cciss: fix lost command issue
+
+From: Bud Brown <bud.brown@redhat.com>
+
+commit 1ddd5049545e0aa1a0ed19bca4d9c9c3ce1ac8a2 upstream.
+
+Under certain workloads a command may seem to get lost. IOW, the Smart Array
+thinks all commands have been completed but we still have commands in our
+completion queue. This may lead to system instability, filesystems going
+read-only, or even panics depending on the affected filesystem. We add an
+extra read to force the write to complete.
+
+Testing shows this extra read avoids the problem.
+
+Signed-off-by: Mike Miller <mike.miller@hp.com>
+Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/block/cciss.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/block/cciss.h
++++ b/drivers/block/cciss.h
+@@ -222,6 +222,7 @@ static void SA5_submit_command( ctlr_inf
+ h->ctlr, c->busaddr);
+ #endif /* CCISS_DEBUG */
+ writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
++ readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
+ h->commands_outstanding++;
+ if ( h->commands_outstanding > h->max_outstanding)
+ h->max_outstanding = h->commands_outstanding;
+From 61e1b0b00c793ad5a32fe2181c9f77115fed5dc4 Mon Sep 17 00:00:00 2001
+From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
+Date: Mon, 21 Mar 2011 18:27:21 +0530
+Subject: ath9k: Fix kernel panic in AR2427
+
+From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
+
+commit 61e1b0b00c793ad5a32fe2181c9f77115fed5dc4 upstream.
+
+Kernel panic occurs just after AR2427 establishes connection with AP.
+Unless aggregation is enabled we don't initialize the TID structure.
+Thus accesing the elements of the TID structure when aggregation is
+disabled, leads to NULL pointer dereferencing.
+
+[ 191.320358] Call Trace:
+[ 191.320364] [<fd250ea7>] ? ath9k_tx+0xa7/0x200 [ath9k]
+[ 191.320376] [<fd1ec7fc>] ? __ieee80211_tx+0x5c/0x1e0 [mac80211]
+[ 191.320386] [<fd1edd2b>] ? ieee80211_tx+0x7b/0x90 [mac80211]
+[ 191.320395] [<fd1edddd>] ? ieee80211_xmit+0x9d/0x1d0 [mac80211]
+[ 191.320401] [<c014218f>] ? wake_up_state+0xf/0x20
+[ 191.320405] [<c015dbc8>] ? signal_wake_up+0x28/0x40
+[ 191.320410] [<c012a578>] ? default_spin_lock_flags+0x8/0x10
+[ 191.320420] [<fd1ee308>] ? ieee80211_subif_start_xmit+0x2e8/0x7c0
+[mac80211]
+[ 191.320425] [<c058f905>] ? do_page_fault+0x295/0x3a0
+[ 191.320431] [<c04c4a3d>] ? dev_hard_start_xmit+0x1ad/0x210
+[ 191.320436] [<c04d96b5>] ? sch_direct_xmit+0x105/0x170
+[ 191.320445] [<fd1f161a>] ? get_sta_flags+0x2a/0x40 [mac80211]
+[ 191.320449] [<c04c780f>] ? dev_queue_xmit+0x37f/0x4b0
+[ 191.320452] [<c04d75b0>] ? eth_header+0x0/0xb0
+[ 191.320456] [<c04cc479>] ? neigh_resolve_output+0xe9/0x310
+[ 191.320461] [<c053d295>] ? ip6_output_finish+0xa5/0x110
+[ 191.320464] [<c053e354>] ? ip6_output2+0x134/0x250
+[ 191.320468] [<c053f7dd>] ? ip6_output+0x6d/0x100
+[ 191.320471] [<c0559665>] ? mld_sendpack+0x395/0x3e0
+[ 191.320475] [<c0557f81>] ? add_grhead+0x31/0xa0
+[ 191.320478] [<c055a83c>] ? mld_send_cr+0x1bc/0x2b0
+[ 191.320482] [<c01535d9>] ? irq_exit+0x39/0x70
+[ 191.320485] [<c055a940>] ? mld_ifc_timer_expire+0x10/0x40
+[ 191.320489] [<c015b92e>] ? run_timer_softirq+0x13e/0x2c0
+[ 191.320493] [<c0103a30>] ? common_interrupt+0x30/0x40
+[ 191.320498] [<c055a930>] ? mld_ifc_timer_expire+0x0/0x40
+[ 191.320502] [<c0153358>] ? __do_softirq+0x98/0x1b0
+[ 191.320506] [<c01534b5>] ? do_softirq+0x45/0x50
+[ 191.320509] [<c0153605>] ? irq_exit+0x65/0x70
+[ 191.320513] [<c05917dc>] ? smp_apic_timer_interrupt+0x5c/0x8b
+[ 191.320516] [<c0103df1>] ? apic_timer_interrupt+0x31/0x40
+[ 191.320521] [<c016007b>] ? k_getrusage+0x12b/0x2f0
+[ 191.320525] [<c039e384>] ? acpi_idle_enter_simple+0x117/0x148
+[ 191.320529] [<c04a20da>] ? cpuidle_idle_call+0x7a/0x100
+[ 191.320532] [<c01021d4>] ? cpu_idle+0x94/0xd0
+[ 191.320536] [<c057ab88>] ? rest_init+0x58/0x60
+[ 191.320541] [<c07a58ec>] ? start_kernel+0x351/0x357
+[ 191.320544] [<c07a53c7>] ? unknown_bootoption+0x0/0x19e
+[ 191.320548] [<c07a50aa>] ? i386_start_kernel+0xaa/0xb1
+[ 191.320550] Code: 03 66 3d 00 03 0f 84 7c 02 00 00 83 c3 18 0f b6 03
+8b 4d e0 89 c3 83 e3 0f 6b c3 48 89 5d d8 8d 04 06 8d 50 0c 89 55 d0 8b
+40 20 <8b> 00 3b 01 0f 85 8e 02 00 00 f6 47 20 40 0f 84 29 ff ff ff 8b
+[ 191.320634] EIP: [<fd2586d4>] ath_tx_start+0x474/0x770 [ath9k] SS:ESP
+0068:c0761a90
+[ 191.320642] CR2: 0000000000000000
+[ 191.320647] ---[ end trace 9296ef23b9076ece ]---
+[ 191.320650] Kernel panic - not syncing: Fatal exception in interrupt
+
+Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/wireless/ath/ath9k/xmit.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -1699,8 +1699,8 @@ static void ath_tx_start_dma(struct ath_
+ u8 tidno;
+
+ spin_lock_bh(&txctl->txq->axq_lock);
+-
+- if (ieee80211_is_data_qos(hdr->frame_control) && txctl->an) {
++ if ((sc->sc_flags & SC_OP_TXAGGR) && txctl->an &&
++ ieee80211_is_data_qos(hdr->frame_control)) {
+ tidno = ieee80211_get_qos_ctl(hdr)[0] &
+ IEEE80211_QOS_CTL_TID_MASK;
+ tid = ATH_AN_2_TID(txctl->an, tidno);
+From 4d00135a680727f6c3be78f8befaac009030e4df Mon Sep 17 00:00:00 2001
+From: Dan Rosenberg <drosenberg@vsecurity.com>
+Date: Wed, 23 Mar 2011 11:42:57 -0400
+Subject: sound/oss/opl3: validate voice and channel indexes
+
+From: Dan Rosenberg <drosenberg@vsecurity.com>
+
+commit 4d00135a680727f6c3be78f8befaac009030e4df upstream.
+
+User-controllable indexes for voice and channel values may cause reading
+and writing beyond the bounds of their respective arrays, leading to
+potentially exploitable memory corruption. Validate these indexes.
+
+Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ sound/oss/opl3.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+--- a/sound/oss/opl3.c
++++ b/sound/oss/opl3.c
+@@ -849,6 +849,10 @@ static int opl3_load_patch(int dev, int
+
+ static void opl3_panning(int dev, int voice, int value)
+ {
++
++ if (voice < 0 || voice >= devc->nr_voice)
++ return;
++
+ devc->voc[voice].panning = value;
+ }
+
+@@ -1066,8 +1070,15 @@ static int opl3_alloc_voice(int dev, int
+
+ static void opl3_setup_voice(int dev, int voice, int chn)
+ {
+- struct channel_info *info =
+- &synth_devs[dev]->chn_info[chn];
++ struct channel_info *info;
++
++ if (voice < 0 || voice >= devc->nr_voice)
++ return;
++
++ if (chn < 0 || chn > 15)
++ return;
++
++ info = &synth_devs[dev]->chn_info[chn];
+
+ opl3_set_instr(dev, voice, info->pgm_num);
+
+From 8bc8aecdc5e26cfda12dbd6867af4aa67836da6a Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@openwrt.org>
+Date: Mon, 21 Mar 2011 20:01:00 +0100
+Subject: mac80211: initialize sta->last_rx in sta_info_alloc
+
+From: Felix Fietkau <nbd@openwrt.org>
+
+commit 8bc8aecdc5e26cfda12dbd6867af4aa67836da6a upstream.
+
+This field is used to determine the inactivity time. When in AP mode,
+hostapd uses it for kicking out inactive clients after a while. Without this
+patch, hostapd immediately deauthenticates a new client if it checks the
+inactivity time before the client sends its first data frame.
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ net/mac80211/sta_info.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -243,6 +243,7 @@ struct sta_info *sta_info_alloc(struct i
+ memcpy(sta->sta.addr, addr, ETH_ALEN);
+ sta->local = local;
+ sta->sdata = sdata;
++ sta->last_rx = jiffies;
+
+ ewma_init(&sta->avg_signal, 1024, 8);
+
+From 877a55979c189c590e819a61cbbe2b7947875f17 Mon Sep 17 00:00:00 2001
+From: John Hughes <john@Calva.COM>
+Date: Wed, 4 Nov 2009 19:01:22 +0100
+Subject: [SCSI] ses: show devices for enclosures with no page 7
+
+From: John Hughes <john@Calva.COM>
+
+commit 877a55979c189c590e819a61cbbe2b7947875f17 upstream.
+
+enclosure page 7 gives us the "pretty" names of the enclosure slots.
+Without a page 7, we can still use the enclosure code as long as we
+make up numeric names for the slots. Unfortunately, the current code
+fails to add any devices because the check for page 10 is in the wrong
+place if we have no page 7. Fix it so that devices show up even if
+the enclosure has no page 7.
+
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/ses.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/ses.c
++++ b/drivers/scsi/ses.c
+@@ -390,9 +390,9 @@ static void ses_enclosure_data_process(s
+ len = (desc_ptr[2] << 8) + desc_ptr[3];
+ /* skip past overall descriptor */
+ desc_ptr += len + 4;
+- if (ses_dev->page10)
+- addl_desc_ptr = ses_dev->page10 + 8;
+ }
++ if (ses_dev->page10)
++ addl_desc_ptr = ses_dev->page10 + 8;
+ type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11];
+ components = 0;
+ for (i = 0; i < types; i++, type_ptr += 4) {
+From d1e12de804f9d8ad114786ca7c2ce593cba79891 Mon Sep 17 00:00:00 2001
+From: Krishnasamy, Somasundaram <Somasundaram.Krishnasamy@lsi.com>
+Date: Mon, 28 Feb 2011 18:13:22 -0500
+Subject: [SCSI] ses: Avoid kernel panic when lun 0 is not mapped
+
+From: Krishnasamy, Somasundaram <Somasundaram.Krishnasamy@lsi.com>
+
+commit d1e12de804f9d8ad114786ca7c2ce593cba79891 upstream.
+
+During device discovery, scsi mid layer sends INQUIRY command to LUN
+0. If the LUN 0 is not mapped to host, it creates a temporary
+scsi_device with LUN id 0 and sends REPORT_LUNS command to it. After
+the REPORT_LUNS succeeds, it walks through the LUN table and adds each
+LUN found to sysfs. At the end of REPORT_LUNS lun table scan, it will
+delete the temporary scsi_device of LUN 0.
+
+When scsi devices are added to sysfs, it calls add_dev function of all
+the registered class interfaces. If ses driver has been registered,
+ses_intf_add() of ses module will be called. This function calls
+scsi_device_enclosure() to check the inquiry data for EncServ
+bit. Since inquiry was not allocated for temporary LUN 0 scsi_device,
+it will cause NULL pointer exception.
+
+To fix the problem, sdev->inquiry is checked for NULL before reading it.
+
+Signed-off-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
+Signed-off-by: Babu Moger <babu.moger@lsi.com>
+Signed-off-by: James Bottomley <James.Bottomley@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/scsi/scsi_device.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/scsi/scsi_device.h
++++ b/include/scsi/scsi_device.h
+@@ -461,7 +461,7 @@ static inline int scsi_device_qas(struct
+ }
+ static inline int scsi_device_enclosure(struct scsi_device *sdev)
+ {
+- return sdev->inquiry[6] & (1<<6);
++ return sdev->inquiry ? (sdev->inquiry[6] & (1<<6)) : 1;
+ }
+
+ static inline int scsi_device_protection(struct scsi_device *sdev)
+From 8b8bae901ce23addbdcdb54fa1696fb2d049feb5 Mon Sep 17 00:00:00 2001
+From: Rafael J. Wysocki <rjw@sisk.pl>
+Date: Sat, 5 Mar 2011 13:21:51 +0100
+Subject: PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Rafael J. Wysocki <rjw@sisk.pl>
+
+commit 8b8bae901ce23addbdcdb54fa1696fb2d049feb5 upstream.
+
+We need to distinguish the situation in which ASPM support is
+disabled from the command line or through .config from the situation
+in which it is disabled, because the hardware or BIOS can't handle
+it. In the former case we should not report ASPM support to the BIOS
+through ACPI _OSC, but in the latter case we should do that.
+
+Introduce pcie_aspm_support_enabled() that can be used by
+acpi_pci_root_add() to determine whether or not it should report ASPM
+support to the BIOS through _OSC.
+
+References: https://bugzilla.kernel.org/show_bug.cgi?id=29722
+References: https://bugzilla.kernel.org/show_bug.cgi?id=20232
+Reported-and-tested-by: Ortwin Glück <odi@odi.ch>
+Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
+Tested-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
+Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
+Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/acpi/pci_root.c | 2 +-
+ drivers/pci/pcie/aspm.c | 7 +++++++
+ include/linux/pci.h | 7 +++----
+ 3 files changed, 11 insertions(+), 5 deletions(-)
+
+--- a/drivers/acpi/pci_root.c
++++ b/drivers/acpi/pci_root.c
+@@ -564,7 +564,7 @@ static int __devinit acpi_pci_root_add(s
+ /* Indicate support for various _OSC capabilities. */
+ if (pci_ext_cfg_avail(root->bus->self))
+ flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
+- if (pcie_aspm_enabled())
++ if (pcie_aspm_support_enabled())
+ flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
+ OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
+ if (pci_msi_enabled())
+--- a/drivers/pci/pcie/aspm.c
++++ b/drivers/pci/pcie/aspm.c
+@@ -69,6 +69,7 @@ struct pcie_link_state {
+ };
+
+ static int aspm_disabled, aspm_force, aspm_clear_state;
++static bool aspm_support_enabled = true;
+ static DEFINE_MUTEX(aspm_lock);
+ static LIST_HEAD(link_list);
+
+@@ -896,6 +897,7 @@ static int __init pcie_aspm_disable(char
+ {
+ if (!strcmp(str, "off")) {
+ aspm_disabled = 1;
++ aspm_support_enabled = false;
+ printk(KERN_INFO "PCIe ASPM is disabled\n");
+ } else if (!strcmp(str, "force")) {
+ aspm_force = 1;
+@@ -930,3 +932,8 @@ int pcie_aspm_enabled(void)
+ }
+ EXPORT_SYMBOL(pcie_aspm_enabled);
+
++bool pcie_aspm_support_enabled(void)
++{
++ return aspm_support_enabled;
++}
++EXPORT_SYMBOL(pcie_aspm_support_enabled);
+--- a/include/linux/pci.h
++++ b/include/linux/pci.h
+@@ -1002,12 +1002,11 @@ extern bool pcie_ports_auto;
+ #endif
+
+ #ifndef CONFIG_PCIEASPM
+-static inline int pcie_aspm_enabled(void)
+-{
+- return 0;
+-}
++static inline int pcie_aspm_enabled(void) { return 0; }
++static inline bool pcie_aspm_support_enabled(void) { return false; }
+ #else
+ extern int pcie_aspm_enabled(void);
++extern bool pcie_aspm_support_enabled(void);
+ #endif
+
+ #ifdef CONFIG_PCIEAER
+From 4b239f458c229de044d6905c2b0f9fe16ed9e01e Mon Sep 17 00:00:00 2001
+From: Yinghai Lu <yinghai@kernel.org>
+Date: Fri, 17 Dec 2010 16:58:28 -0800
+Subject: x86-64, mm: Put early page table high
+
+From: Yinghai Lu <yinghai@kernel.org>
+
+commit 4b239f458c229de044d6905c2b0f9fe16ed9e01e upstream.
+
+While dubug kdump, found current kernel will have problem with crashkernel=512M.
+
+It turns out that initial mapping is to 512M, and later initial mapping to 4G
+(acutally is 2040M in my platform), will put page table near 512M.
+then initial mapping to 128g will be near 2g.
+
+before this patch:
+[ 0.000000] initial memory mapped : 0 - 20000000
+[ 0.000000] init_memory_mapping: [0x00000000000000-0x0000007f74ffff]
+[ 0.000000] 0000000000 - 007f600000 page 2M
+[ 0.000000] 007f600000 - 007f750000 page 4k
+[ 0.000000] kernel direct mapping tables up to 7f750000 @ [0x1fffc000-0x1fffffff]
+[ 0.000000] memblock_x86_reserve_range: [0x1fffc000-0x1fffdfff] PGTABLE
+[ 0.000000] init_memory_mapping: [0x00000100000000-0x0000207fffffff]
+[ 0.000000] 0100000000 - 2080000000 page 2M
+[ 0.000000] kernel direct mapping tables up to 2080000000 @ [0x7bc01000-0x7bc83fff]
+[ 0.000000] memblock_x86_reserve_range: [0x7bc01000-0x7bc7efff] PGTABLE
+[ 0.000000] RAMDISK: 7bc84000 - 7f745000
+[ 0.000000] crashkernel reservation failed - No suitable area found.
+
+after patch:
+[ 0.000000] initial memory mapped : 0 - 20000000
+[ 0.000000] init_memory_mapping: [0x00000000000000-0x0000007f74ffff]
+[ 0.000000] 0000000000 - 007f600000 page 2M
+[ 0.000000] 007f600000 - 007f750000 page 4k
+[ 0.000000] kernel direct mapping tables up to 7f750000 @ [0x7f74c000-0x7f74ffff]
+[ 0.000000] memblock_x86_reserve_range: [0x7f74c000-0x7f74dfff] PGTABLE
+[ 0.000000] init_memory_mapping: [0x00000100000000-0x0000207fffffff]
+[ 0.000000] 0100000000 - 2080000000 page 2M
+[ 0.000000] kernel direct mapping tables up to 2080000000 @ [0x207ff7d000-0x207fffffff]
+[ 0.000000] memblock_x86_reserve_range: [0x207ff7d000-0x207fffafff] PGTABLE
+[ 0.000000] RAMDISK: 7bc84000 - 7f745000
+[ 0.000000] memblock_x86_reserve_range: [0x17000000-0x36ffffff] CRASH KERNEL
+[ 0.000000] Reserving 512MB of memory at 368MB for crashkernel (System RAM: 133120MB)
+
+It means with the patch, page table for [0, 2g) will need 2g, instead of under 512M,
+page table for [4g, 128g) will be near 128g, instead of under 2g.
+
+That would good, if we have lots of memory above 4g, like 1024g, or 2048g or 16T, will not put
+related page table under 2g. that would be have chance to fill the under 2g if 1G or 2M page is
+not used.
+
+the code change will use add map_low_page() and update unmap_low_page() for 64bit, and use them
+to get access the corresponding high memory for page table setting.
+
+Signed-off-by: Yinghai Lu <yinghai@kernel.org>
+LKML-Reference: <4D0C0734.7060900@kernel.org>
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/mm/init.c | 9 ++-----
+ arch/x86/mm/init_64.c | 63 +++++++++++++++++++++-----------------------------
+ 2 files changed, 30 insertions(+), 42 deletions(-)
+
+--- a/arch/x86/mm/init.c
++++ b/arch/x86/mm/init.c
+@@ -33,7 +33,7 @@ int direct_gbpages
+ static void __init find_early_table_space(unsigned long end, int use_pse,
+ int use_gbpages)
+ {
+- unsigned long puds, pmds, ptes, tables, start;
++ unsigned long puds, pmds, ptes, tables, start = 0, good_end = end;
+ phys_addr_t base;
+
+ puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
+@@ -73,12 +73,9 @@ static void __init find_early_table_spac
+ * need roughly 0.5KB per GB.
+ */
+ #ifdef CONFIG_X86_32
+- start = 0x7000;
+-#else
+- start = 0x8000;
++ good_end = max_pfn_mapped << PAGE_SHIFT;
+ #endif
+- base = memblock_find_in_range(start, max_pfn_mapped<<PAGE_SHIFT,
+- tables, PAGE_SIZE);
++ base = memblock_find_in_range(start, good_end, tables, PAGE_SIZE);
+ if (base == MEMBLOCK_ERROR)
+ panic("Cannot find space for the kernel page tables");
+
+--- a/arch/x86/mm/init_64.c
++++ b/arch/x86/mm/init_64.c
+@@ -334,12 +334,28 @@ static __ref void *alloc_low_page(unsign
+ return adr;
+ }
+
++static __ref void *map_low_page(void *virt)
++{
++ void *adr;
++ unsigned long phys, left;
++
++ if (after_bootmem)
++ return virt;
++
++ phys = __pa(virt);
++ left = phys & (PAGE_SIZE - 1);
++ adr = early_memremap(phys & PAGE_MASK, PAGE_SIZE);
++ adr = (void *)(((unsigned long)adr) | left);
++
++ return adr;
++}
++
+ static __ref void unmap_low_page(void *adr)
+ {
+ if (after_bootmem)
+ return;
+
+- early_iounmap(adr, PAGE_SIZE);
++ early_iounmap((void *)((unsigned long)adr & PAGE_MASK), PAGE_SIZE);
+ }
+
+ static unsigned long __meminit
+@@ -387,15 +403,6 @@ phys_pte_init(pte_t *pte_page, unsigned
+ }
+
+ static unsigned long __meminit
+-phys_pte_update(pmd_t *pmd, unsigned long address, unsigned long end,
+- pgprot_t prot)
+-{
+- pte_t *pte = (pte_t *)pmd_page_vaddr(*pmd);
+-
+- return phys_pte_init(pte, address, end, prot);
+-}
+-
+-static unsigned long __meminit
+ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end,
+ unsigned long page_size_mask, pgprot_t prot)
+ {
+@@ -421,8 +428,10 @@ phys_pmd_init(pmd_t *pmd_page, unsigned
+ if (pmd_val(*pmd)) {
+ if (!pmd_large(*pmd)) {
+ spin_lock(&init_mm.page_table_lock);
+- last_map_addr = phys_pte_update(pmd, address,
++ pte = map_low_page((pte_t *)pmd_page_vaddr(*pmd));
++ last_map_addr = phys_pte_init(pte, address,
+ end, prot);
++ unmap_low_page(pte);
+ spin_unlock(&init_mm.page_table_lock);
+ continue;
+ }
+@@ -469,18 +478,6 @@ phys_pmd_init(pmd_t *pmd_page, unsigned
+ }
+
+ static unsigned long __meminit
+-phys_pmd_update(pud_t *pud, unsigned long address, unsigned long end,
+- unsigned long page_size_mask, pgprot_t prot)
+-{
+- pmd_t *pmd = pmd_offset(pud, 0);
+- unsigned long last_map_addr;
+-
+- last_map_addr = phys_pmd_init(pmd, address, end, page_size_mask, prot);
+- __flush_tlb_all();
+- return last_map_addr;
+-}
+-
+-static unsigned long __meminit
+ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
+ unsigned long page_size_mask)
+ {
+@@ -505,8 +502,11 @@ phys_pud_init(pud_t *pud_page, unsigned
+
+ if (pud_val(*pud)) {
+ if (!pud_large(*pud)) {
+- last_map_addr = phys_pmd_update(pud, addr, end,
++ pmd = map_low_page(pmd_offset(pud, 0));
++ last_map_addr = phys_pmd_init(pmd, addr, end,
+ page_size_mask, prot);
++ unmap_low_page(pmd);
++ __flush_tlb_all();
+ continue;
+ }
+ /*
+@@ -554,17 +554,6 @@ phys_pud_init(pud_t *pud_page, unsigned
+ return last_map_addr;
+ }
+
+-static unsigned long __meminit
+-phys_pud_update(pgd_t *pgd, unsigned long addr, unsigned long end,
+- unsigned long page_size_mask)
+-{
+- pud_t *pud;
+-
+- pud = (pud_t *)pgd_page_vaddr(*pgd);
+-
+- return phys_pud_init(pud, addr, end, page_size_mask);
+-}
+-
+ unsigned long __meminit
+ kernel_physical_mapping_init(unsigned long start,
+ unsigned long end,
+@@ -588,8 +577,10 @@ kernel_physical_mapping_init(unsigned lo
+ next = end;
+
+ if (pgd_val(*pgd)) {
+- last_map_addr = phys_pud_update(pgd, __pa(start),
++ pud = map_low_page((pud_t *)pgd_page_vaddr(*pgd));
++ last_map_addr = phys_pud_init(pud, __pa(start),
+ __pa(end), page_size_mask);
++ unmap_low_page(pud);
+ continue;
+ }
+
+From 50f198ae16ac66508d4b8d5a40967a8507ad19ee Mon Sep 17 00:00:00 2001
+From: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
+Date: Wed, 9 Mar 2011 11:49:13 -0600
+Subject: eCryptfs: Unlock page in write_begin error path
+
+From: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
+
+commit 50f198ae16ac66508d4b8d5a40967a8507ad19ee upstream.
+
+Unlock the page in error path of ecryptfs_write_begin(). This may
+happen, for example, if decryption fails while bring the page
+up-to-date.
+
+Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/ecryptfs/mmap.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/fs/ecryptfs/mmap.c
++++ b/fs/ecryptfs/mmap.c
+@@ -374,6 +374,11 @@ static int ecryptfs_write_begin(struct f
+ && (pos != 0))
+ zero_user(page, 0, PAGE_CACHE_SIZE);
+ out:
++ if (unlikely(rc)) {
++ unlock_page(page);
++ page_cache_release(page);
++ *pagep = NULL;
++ }
+ return rc;
+ }
+
+From 1821df040ac3cd6a57518739f345da6d50ea9d3f Mon Sep 17 00:00:00 2001
+From: Roberto Sassu <roberto.sassu@polito.it>
+Date: Thu, 17 Mar 2011 12:48:50 +0100
+Subject: eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix
+
+From: Roberto Sassu <roberto.sassu@polito.it>
+
+commit 1821df040ac3cd6a57518739f345da6d50ea9d3f upstream.
+
+The pointer '(*auth_tok_key)' is set to NULL in case request_key()
+fails, in order to prevent its use by functions calling
+ecryptfs_keyring_auth_tok_for_sig().
+
+Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
+Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/ecryptfs/keystore.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/fs/ecryptfs/keystore.c
++++ b/fs/ecryptfs/keystore.c
+@@ -1563,6 +1563,7 @@ int ecryptfs_keyring_auth_tok_for_sig(st
+ printk(KERN_ERR "Could not find key with description: [%s]\n",
+ sig);
+ rc = process_request_key_err(PTR_ERR(*auth_tok_key));
++ (*auth_tok_key) = NULL;
+ goto out;
+ }
+ (*auth_tok) = ecryptfs_get_key_payload_data(*auth_tok_key);
+From 60af520cf264ea26b2af3a6871bbd71850522aea Mon Sep 17 00:00:00 2001
+From: Tadeusz Struk <tadeusz.struk@intel.com>
+Date: Sun, 13 Mar 2011 16:56:17 +0800
+Subject: crypto: aesni-intel - fixed problem with packets that are not multiple of 64bytes
+
+From: Tadeusz Struk <tadeusz.struk@intel.com>
+
+commit 60af520cf264ea26b2af3a6871bbd71850522aea upstream.
+
+This patch fixes problem with packets that are not multiple of 64bytes.
+
+Signed-off-by: Adrian Hoban <adrian.hoban@intel.com>
+Signed-off-by: Aidan O'Mahony <aidan.o.mahony@intel.com>
+Signed-off-by: Gabriele Paoloni <gabriele.paoloni@intel.com>
+Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/crypto/aesni-intel_asm.S | 5 ++++-
+ arch/x86/crypto/aesni-intel_glue.c | 14 ++++++++++++--
+ 2 files changed, 16 insertions(+), 3 deletions(-)
+
+--- a/arch/x86/crypto/aesni-intel_asm.S
++++ b/arch/x86/crypto/aesni-intel_asm.S
+@@ -1612,6 +1612,7 @@ _zero_cipher_left_encrypt:
+ movdqa SHUF_MASK(%rip), %xmm10
+ PSHUFB_XMM %xmm10, %xmm0
+
++
+ ENCRYPT_SINGLE_BLOCK %xmm0, %xmm1 # Encrypt(K, Yn)
+ sub $16, %r11
+ add %r13, %r11
+@@ -1634,7 +1635,9 @@ _zero_cipher_left_encrypt:
+ # GHASH computation for the last <16 byte block
+ sub %r13, %r11
+ add $16, %r11
+- PSHUFB_XMM %xmm10, %xmm1
++
++ movdqa SHUF_MASK(%rip), %xmm10
++ PSHUFB_XMM %xmm10, %xmm0
+
+ # shuffle xmm0 back to output as ciphertext
+
+--- a/arch/x86/crypto/aesni-intel_glue.c
++++ b/arch/x86/crypto/aesni-intel_glue.c
+@@ -828,9 +828,15 @@ static int rfc4106_init(struct crypto_tf
+ struct cryptd_aead *cryptd_tfm;
+ struct aesni_rfc4106_gcm_ctx *ctx = (struct aesni_rfc4106_gcm_ctx *)
+ PTR_ALIGN((u8 *)crypto_tfm_ctx(tfm), AESNI_ALIGN);
++ struct crypto_aead *cryptd_child;
++ struct aesni_rfc4106_gcm_ctx *child_ctx;
+ cryptd_tfm = cryptd_alloc_aead("__driver-gcm-aes-aesni", 0, 0);
+ if (IS_ERR(cryptd_tfm))
+ return PTR_ERR(cryptd_tfm);
++
++ cryptd_child = cryptd_aead_child(cryptd_tfm);
++ child_ctx = aesni_rfc4106_gcm_ctx_get(cryptd_child);
++ memcpy(child_ctx, ctx, sizeof(*ctx));
+ ctx->cryptd_tfm = cryptd_tfm;
+ tfm->crt_aead.reqsize = sizeof(struct aead_request)
+ + crypto_aead_reqsize(&cryptd_tfm->base);
+@@ -925,6 +931,9 @@ static int rfc4106_set_key(struct crypto
+ int ret = 0;
+ struct crypto_tfm *tfm = crypto_aead_tfm(parent);
+ struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(parent);
++ struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
++ struct aesni_rfc4106_gcm_ctx *child_ctx =
++ aesni_rfc4106_gcm_ctx_get(cryptd_child);
+ u8 *new_key_mem = NULL;
+
+ if (key_len < 4) {
+@@ -968,6 +977,7 @@ static int rfc4106_set_key(struct crypto
+ goto exit;
+ }
+ ret = rfc4106_set_hash_subkey(ctx->hash_subkey, key, key_len);
++ memcpy(child_ctx, ctx, sizeof(*ctx));
+ exit:
+ kfree(new_key_mem);
+ return ret;
+@@ -999,7 +1009,6 @@ static int rfc4106_encrypt(struct aead_r
+ int ret;
+ struct crypto_aead *tfm = crypto_aead_reqtfm(req);
+ struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm);
+- struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
+
+ if (!irq_fpu_usable()) {
+ struct aead_request *cryptd_req =
+@@ -1008,6 +1017,7 @@ static int rfc4106_encrypt(struct aead_r
+ aead_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
+ return crypto_aead_encrypt(cryptd_req);
+ } else {
++ struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
+ kernel_fpu_begin();
+ ret = cryptd_child->base.crt_aead.encrypt(req);
+ kernel_fpu_end();
+@@ -1020,7 +1030,6 @@ static int rfc4106_decrypt(struct aead_r
+ int ret;
+ struct crypto_aead *tfm = crypto_aead_reqtfm(req);
+ struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm);
+- struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
+
+ if (!irq_fpu_usable()) {
+ struct aead_request *cryptd_req =
+@@ -1029,6 +1038,7 @@ static int rfc4106_decrypt(struct aead_r
+ aead_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
+ return crypto_aead_decrypt(cryptd_req);
+ } else {
++ struct crypto_aead *cryptd_child = cryptd_aead_child(ctx->cryptd_tfm);
+ kernel_fpu_begin();
+ ret = cryptd_child->base.crt_aead.decrypt(req);
+ kernel_fpu_end();
diff --git a/patches/intel_ips-produces-constant-load-of-1.patch b/patches/intel_ips-produces-constant-load-of-1.patch
new file mode 100644
index 0000000..b259aa8
--- /dev/null
+++ b/patches/intel_ips-produces-constant-load-of-1.patch
@@ -0,0 +1,13 @@
+diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
+index 1294a39..85c8ad4 100644
+--- a/drivers/platform/x86/intel_ips.c
++++ b/drivers/platform/x86/intel_ips.c
+@@ -1111,7 +1111,7 @@ static int ips_monitor(void *data)
+ last_msecs = jiffies_to_msecs(jiffies);
+ expire = jiffies + msecs_to_jiffies(IPS_SAMPLE_PERIOD);
+
+- __set_current_state(TASK_UNINTERRUPTIBLE);
++ __set_current_state(TASK_INTERRUPTIBLE);
+ mod_timer(&timer, expire);
+ schedule();
+ \ No newline at end of file