--- /dev/null
+From 4c3773eda49c872a3034382f8ec3080002e715bf Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 23 Jan 2014 11:21:28 +0300
+Subject: ALSA: bits vs bytes bug in snd_card_create()
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit 4c3773eda49c872a3034382f8ec3080002e715bf upstream.
+
+The test here is intended intended to prevent shift wrapping bugs when
+we do "1U << idx2". We should consider the number of bits in a u32
+instead of the number of bytes.
+
+[fix another chunk similarly by tiwai]
+
+Fixes: 7bb2491b35a2 ('ALSA: Add kconfig to specify the max card numbers')
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/init.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/core/init.c
++++ b/sound/core/init.c
+@@ -170,7 +170,7 @@ int snd_card_create(int idx, const char
+ if (idx < 0) {
+ for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++) {
+ /* idx == -1 == 0xffff means: take any free slot */
+- if (idx2 < sizeof(int) && !(idx & (1U << idx2)))
++ if (idx2 < 32 && !(idx & (1U << idx2)))
+ continue;
+ if (!test_bit(idx2, snd_cards_lock)) {
+ if (module_slot_match(module, idx2)) {
+@@ -183,7 +183,7 @@ int snd_card_create(int idx, const char
+ if (idx < 0) {
+ for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++) {
+ /* idx == -1 == 0xffff means: take any free slot */
+- if (idx2 < sizeof(int) && !(idx & (1U << idx2)))
++ if (idx2 < 32 && !(idx & (1U << idx2)))
+ continue;
+ if (!test_bit(idx2, snd_cards_lock)) {
+ if (!slots[idx2] || !*slots[idx2]) {
--- /dev/null
+From 80ab8eae70e51d578ebbeb228e0f7a562471b8b7 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 10 Jan 2014 14:20:42 +0100
+Subject: ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 80ab8eae70e51d578ebbeb228e0f7a562471b8b7 upstream.
+
+The PCI devices with DMA masks smaller than 32bit should enable
+CONFIG_ZONE_DMA. Since the recent change of page allocator, page
+allocations via dma_alloc_coherent() with the limited DMA mask bits
+may fail more frequently, ended up with no available buffers, when
+CONFIG_ZONE_DMA isn't enabled. With CONFIG_ZONE_DMA, the system has
+much more chance to obtain such pages.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=68221
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/Kconfig | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/sound/pci/Kconfig
++++ b/sound/pci/Kconfig
+@@ -25,6 +25,7 @@ config SND_ALS300
+ select SND_PCM
+ select SND_AC97_CODEC
+ select SND_OPL3_LIB
++ select ZONE_DMA
+ help
+ Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+
+
+@@ -49,6 +50,7 @@ config SND_ALI5451
+ tristate "ALi M5451 PCI Audio Controller"
+ select SND_MPU401_UART
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for the integrated AC97 sound
+ device on motherboards using the ALi M5451 Audio Controller
+@@ -153,6 +155,7 @@ config SND_AZT3328
+ select SND_PCM
+ select SND_RAWMIDI
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for Aztech AZF3328 (PCI168)
+ soundcards.
+@@ -458,6 +461,7 @@ config SND_EMU10K1
+ select SND_HWDEP
+ select SND_RAWMIDI
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y to include support for Sound Blaster PCI 512, Live!,
+ Audigy and E-mu APS (partially supported) soundcards.
+@@ -473,6 +477,7 @@ config SND_EMU10K1X
+ tristate "Emu10k1X (Dell OEM Version)"
+ select SND_AC97_CODEC
+ select SND_RAWMIDI
++ select ZONE_DMA
+ help
+ Say Y here to include support for the Dell OEM version of the
+ Sound Blaster Live!.
+@@ -506,6 +511,7 @@ config SND_ES1938
+ select SND_OPL3_LIB
+ select SND_MPU401_UART
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for soundcards based on ESS Solo-1
+ (ES1938, ES1946, ES1969) chips.
+@@ -517,6 +523,7 @@ config SND_ES1968
+ tristate "ESS ES1968/1978 (Maestro-1/2/2E)"
+ select SND_MPU401_UART
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for soundcards based on ESS Maestro
+ 1/2/2E chips.
+@@ -605,6 +612,7 @@ config SND_ICE1712
+ select SND_MPU401_UART
+ select SND_AC97_CODEC
+ select BITREVERSE
++ select ZONE_DMA
+ help
+ Say Y here to include support for soundcards based on the
+ ICE1712 (Envy24) chip.
+@@ -692,6 +700,7 @@ config SND_LX6464ES
+ config SND_MAESTRO3
+ tristate "ESS Allegro/Maestro3"
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for soundcards based on ESS Maestro 3
+ (Allegro) chips.
+@@ -788,6 +797,7 @@ config SND_SIS7019
+ tristate "SiS 7019 Audio Accelerator"
+ depends on X86 && !X86_64
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for the SiS 7019 Audio Accelerator.
+
+@@ -799,6 +809,7 @@ config SND_SONICVIBES
+ select SND_OPL3_LIB
+ select SND_MPU401_UART
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for soundcards based on the S3
+ SonicVibes chip.
+@@ -810,6 +821,7 @@ config SND_TRIDENT
+ tristate "Trident 4D-Wave DX/NX; SiS 7018"
+ select SND_MPU401_UART
+ select SND_AC97_CODEC
++ select ZONE_DMA
+ help
+ Say Y here to include support for soundcards based on Trident
+ 4D-Wave DX/NX or SiS 7018 chips.
--- /dev/null
+From ed0e0d0617a8dc3d8b82c6e54827f269f2247b07 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 7 Jan 2014 17:48:11 +0100
+Subject: ALSA: hda - Correct AD1986A 3stack pin configs
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit ed0e0d0617a8dc3d8b82c6e54827f269f2247b07 upstream.
+
+The 3stack pin configs for AD1986A codec had incorrect values that
+resulted in broken mic and line-in.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_analog.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/sound/pci/hda/patch_analog.c
++++ b/sound/pci/hda/patch_analog.c
+@@ -264,11 +264,11 @@ static const struct hda_fixup ad1986a_fi
+ .v.pins = (const struct hda_pintbl[]) {
+ { 0x1a, 0x02214021 }, /* headphone */
+ { 0x1b, 0x01014011 }, /* front */
+- { 0x1c, 0x01013012 }, /* surround */
+- { 0x1d, 0x01019015 }, /* clfe */
++ { 0x1c, 0x01813030 }, /* line-in */
++ { 0x1d, 0x01a19020 }, /* rear mic */
+ { 0x1e, 0x411111f0 }, /* N/A */
+ { 0x1f, 0x02a190f0 }, /* mic */
+- { 0x20, 0x018130f0 }, /* line-in */
++ { 0x20, 0x411111f0 }, /* N/A */
+ {}
+ },
+ },
--- /dev/null
+From 43a8e50a46a4e1dd1451e4a4ffa1f7695fb7d287 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 7 Jan 2014 18:11:44 +0100
+Subject: ALSA: hda - Don't create duplicated ctls for loopback paths
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 43a8e50a46a4e1dd1451e4a4ffa1f7695fb7d287 upstream.
+
+AD1986A mic pins (0x1d and 0x1f) share the same widget for controlling
+the loopback volume/mute, but the generic parser didn't check it.
+This ended up with the duplicated controls for the same effect.
+
+This patch adds the check of the duplication for avoiding it.
+
+After this fix, there will be only one control although it affects
+both paths; this remaining issue should be fixed later in a different
+patch.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_generic.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/hda_generic.c
++++ b/sound/pci/hda/hda_generic.c
+@@ -2857,9 +2857,11 @@ static bool look_for_mix_leaf_ctls(struc
+ if (num_conns < idx)
+ return false;
+ nid = list[idx];
+- if (!*mix_val && nid_has_volume(codec, nid, HDA_OUTPUT))
++ if (!*mix_val && nid_has_volume(codec, nid, HDA_OUTPUT) &&
++ !is_ctl_associated(codec, nid, HDA_OUTPUT, 0, NID_PATH_VOL_CTL))
+ *mix_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
+- if (!*mute_val && nid_has_mute(codec, nid, HDA_OUTPUT))
++ if (!*mute_val && nid_has_mute(codec, nid, HDA_OUTPUT) &&
++ !is_ctl_associated(codec, nid, HDA_OUTPUT, 0, NID_PATH_MUTE_CTL))
+ *mute_val = HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_OUTPUT);
+
+ return *mix_val || *mute_val;
--- /dev/null
+From e7729a415315fcd9516912050d85d5aaebcededc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Adrien=20Verg=C3=A9?= <adrienverge@gmail.com>
+Date: Fri, 24 Jan 2014 14:56:14 -0500
+Subject: ALSA: hda - Fix silent output on MacBook Air 1,1
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Adrien Vergé <adrienverge@gmail.com>
+
+commit e7729a415315fcd9516912050d85d5aaebcededc upstream.
+
+Similarly to other Apple products, MBA 1,1 needs a specific quirk.
+Pin 0x18 must be set to VREF_50 to have sound output. This was no
+longer done since commit 1a97b7f, resulting in a mute built-in speaker.
+
+This patch corrects the regression by creating a fixup for the MBA 1,1.
+
+Fixes: 1a97b7f22774 ("ALSA: hda/realtek - Remove the last static quirks for ALC882")
+Tested-by: Adrien Vergé <adrienverge@gmail.com>
+Signed-off-by: Adrien Vergé <adrienverge@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c | 19 ++++++++++++++++++-
+ 1 file changed, 18 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -1769,6 +1769,7 @@ enum {
+ ALC889_FIXUP_DAC_ROUTE,
+ ALC889_FIXUP_MBP_VREF,
+ ALC889_FIXUP_IMAC91_VREF,
++ ALC889_FIXUP_MBA11_VREF,
+ ALC889_FIXUP_MBA21_VREF,
+ ALC882_FIXUP_INV_DMIC,
+ ALC882_FIXUP_NO_PRIMARY_HP,
+@@ -1898,6 +1899,16 @@ static void alc889_fixup_imac91_vref(str
+ alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
+ }
+
++/* Set VREF on speaker pins on mba11 */
++static void alc889_fixup_mba11_vref(struct hda_codec *codec,
++ const struct hda_fixup *fix, int action)
++{
++ static hda_nid_t nids[1] = { 0x18 };
++
++ if (action == HDA_FIXUP_ACT_INIT)
++ alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
++}
++
+ /* Set VREF on speaker pins on mba21 */
+ static void alc889_fixup_mba21_vref(struct hda_codec *codec,
+ const struct hda_fixup *fix, int action)
+@@ -2104,6 +2115,12 @@ static const struct hda_fixup alc882_fix
+ .chained = true,
+ .chain_id = ALC882_FIXUP_GPIO1,
+ },
++ [ALC889_FIXUP_MBA11_VREF] = {
++ .type = HDA_FIXUP_FUNC,
++ .v.func = alc889_fixup_mba11_vref,
++ .chained = true,
++ .chain_id = ALC889_FIXUP_MBP_VREF,
++ },
+ [ALC889_FIXUP_MBA21_VREF] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc889_fixup_mba21_vref,
+@@ -2173,7 +2190,7 @@ static const struct snd_pci_quirk alc882
+ SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
+ SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
+ SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
+- SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF),
++ SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
+ SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
+ SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
+ SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
--- /dev/null
+From 770bd4bf2e664939a9dacd3d26ec9ff7a3933210 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 27 Dec 2013 00:13:08 +0200
+Subject: ALSA: rme9652: fix a missing comma in channel_map_9636_ds[]
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 770bd4bf2e664939a9dacd3d26ec9ff7a3933210 upstream.
+
+The lack of comma leads to the wrong channel for an SPDIF channel.
+Unfortunately this wasn't caught by compiler because it's still a
+valid expression.
+
+Reported-by: Alexander Aristov <aristov.alexander@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/rme9652/rme9652.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/rme9652/rme9652.c
++++ b/sound/pci/rme9652/rme9652.c
+@@ -285,7 +285,7 @@ static char channel_map_9636_ds[26] = {
+ /* ADAT channels are remapped */
+ 1, 3, 5, 7, 9, 11, 13, 15,
+ /* channels 8 and 9 are S/PDIF */
+- 24, 25
++ 24, 25,
+ /* others don't exist */
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+ };
--- /dev/null
+From 85e618a1be2b2092318178d1d66bdad49cbbeeeb Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Date: Tue, 7 Jan 2014 16:26:01 +0100
+Subject: ARM: mvebu: Add quirk for i2c for the OpenBlocks AX3-4 board
+
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+
+commit 85e618a1be2b2092318178d1d66bdad49cbbeeeb upstream.
+
+The first variants of Armada XP SoCs (A0 stepping) have issues related
+to the i2c controller which prevent to use the offload mechanism and
+lead to a kernel hang during boot.
+
+This commit add quirk in the mvebu platform code to check the SoC
+version and then update the compatible string for the i2c controller
+according to the revision of the SoC. Currently only some OpenBlocks
+AX3-4 boards are known to use an A0 revision so the check is done only
+for these boards.
+
+Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Fixes: 930ab3d403ae (i2c: mv64xxx: Add I2C Transaction Generator support)
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-mvebu/armada-370-xp.c | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+--- a/arch/arm/mach-mvebu/armada-370-xp.c
++++ b/arch/arm/mach-mvebu/armada-370-xp.c
+@@ -21,6 +21,7 @@
+ #include <linux/clocksource.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/mbus.h>
++#include <linux/slab.h>
+ #include <asm/hardware/cache-l2x0.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/map.h>
+@@ -28,6 +29,7 @@
+ #include "armada-370-xp.h"
+ #include "common.h"
+ #include "coherency.h"
++#include "mvebu-soc-id.h"
+
+ static void __init armada_370_xp_map_io(void)
+ {
+@@ -45,8 +47,38 @@ static void __init armada_370_xp_timer_a
+ #endif
+ }
+
++static void __init i2c_quirk(void)
++{
++ struct device_node *np;
++ u32 dev, rev;
++
++ /*
++ * Only revisons more recent than A0 support the offload
++ * mechanism. We can exit only if we are sure that we can
++ * get the SoC revision and it is more recent than A0.
++ */
++ if (mvebu_get_soc_id(&rev, &dev) == 0 && dev > MV78XX0_A0_REV)
++ return;
++
++ for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
++ struct property *new_compat;
++
++ new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
++
++ new_compat->name = kstrdup("compatible", GFP_KERNEL);
++ new_compat->length = sizeof("marvell,mv78230-a0-i2c");
++ new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
++ GFP_KERNEL);
++
++ of_update_property(np, new_compat);
++ }
++ return;
++}
++
+ static void __init armada_370_xp_dt_init(void)
+ {
++ if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
++ i2c_quirk();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ }
+
--- /dev/null
+From af8d1c63afcbf36eea06789c92e22d4af118d2fb Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Date: Thu, 2 Jan 2014 15:08:59 +0100
+Subject: ARM: mvebu: Add support to get the ID and the revision of a SoC
+
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+
+commit af8d1c63afcbf36eea06789c92e22d4af118d2fb upstream.
+
+All the mvebu SoCs have information related to their variant and
+revision that can be read from the PCI control register.
+
+This patch adds support for Armada XP and Armada 370. This reading of
+the revision and the ID are done before the PCI initialization to
+avoid any conflicts. Once these data are retrieved, the resources are
+freed to let the PCI subsystem use it.
+
+Fixes: 930ab3d403ae (i2c: mv64xxx: Add I2C Transaction Generator support)
+Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-mvebu/Makefile | 2
+ arch/arm/mach-mvebu/mvebu-soc-id.c | 119 +++++++++++++++++++++++++++++++++++++
+ arch/arm/mach-mvebu/mvebu-soc-id.h | 32 +++++++++
+ 3 files changed, 152 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/mach-mvebu/Makefile
++++ b/arch/arm/mach-mvebu/Makefile
+@@ -3,7 +3,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) :=
+
+ AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
+
+-obj-y += system-controller.o
++obj-y += system-controller.o mvebu-soc-id.o
+ obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
+ obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o
+ obj-$(CONFIG_SMP) += platsmp.o headsmp.o
+--- /dev/null
++++ b/arch/arm/mach-mvebu/mvebu-soc-id.c
+@@ -0,0 +1,119 @@
++/*
++ * ID and revision information for mvebu SoCs
++ *
++ * Copyright (C) 2014 Marvell
++ *
++ * Gregory CLEMENT <gregory.clement@free-electrons.com>
++ *
++ * This file is licensed under the terms of the GNU General Public
++ * License version 2. This program is licensed "as is" without any
++ * warranty of any kind, whether express or implied.
++ *
++ * All the mvebu SoCs have information related to their variant and
++ * revision that can be read from the PCI control register. This is
++ * done before the PCI initialization to avoid any conflict. Once the
++ * ID and revision are retrieved, the mapping is freed.
++ */
++
++#define pr_fmt(fmt) "mvebu-soc-id: " fmt
++
++#include <linux/clk.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/kernel.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include "mvebu-soc-id.h"
++
++#define PCIE_DEV_ID_OFF 0x0
++#define PCIE_DEV_REV_OFF 0x8
++
++#define SOC_ID_MASK 0xFFFF0000
++#define SOC_REV_MASK 0xFF
++
++static u32 soc_dev_id;
++static u32 soc_rev;
++static bool is_id_valid;
++
++static const struct of_device_id mvebu_pcie_of_match_table[] = {
++ { .compatible = "marvell,armada-xp-pcie", },
++ { .compatible = "marvell,armada-370-pcie", },
++ {},
++};
++
++int mvebu_get_soc_id(u32 *dev, u32 *rev)
++{
++ if (is_id_valid) {
++ *dev = soc_dev_id;
++ *rev = soc_rev;
++ return 0;
++ } else
++ return -1;
++}
++
++static int __init mvebu_soc_id_init(void)
++{
++ struct device_node *np;
++ int ret = 0;
++ void __iomem *pci_base;
++ struct clk *clk;
++ struct device_node *child;
++
++ np = of_find_matching_node(NULL, mvebu_pcie_of_match_table);
++ if (!np)
++ return ret;
++
++ /*
++ * ID and revision are available from any port, so we
++ * just pick the first one
++ */
++ child = of_get_next_child(np, NULL);
++ if (child == NULL) {
++ pr_err("cannot get pci node\n");
++ ret = -ENOMEM;
++ goto clk_err;
++ }
++
++ clk = of_clk_get_by_name(child, NULL);
++ if (IS_ERR(clk)) {
++ pr_err("cannot get clock\n");
++ ret = -ENOMEM;
++ goto clk_err;
++ }
++
++ ret = clk_prepare_enable(clk);
++ if (ret) {
++ pr_err("cannot enable clock\n");
++ goto clk_err;
++ }
++
++ pci_base = of_iomap(child, 0);
++ if (IS_ERR(pci_base)) {
++ pr_err("cannot map registers\n");
++ ret = -ENOMEM;
++ goto res_ioremap;
++ }
++
++ /* SoC ID */
++ soc_dev_id = readl(pci_base + PCIE_DEV_ID_OFF) >> 16;
++
++ /* SoC revision */
++ soc_rev = readl(pci_base + PCIE_DEV_REV_OFF) & SOC_REV_MASK;
++
++ is_id_valid = true;
++
++ pr_info("MVEBU SoC ID=0x%X, Rev=0x%X\n", soc_dev_id, soc_rev);
++
++ iounmap(pci_base);
++
++res_ioremap:
++ clk_disable_unprepare(clk);
++
++clk_err:
++ of_node_put(child);
++ of_node_put(np);
++
++ return ret;
++}
++core_initcall(mvebu_soc_id_init);
++
+--- /dev/null
++++ b/arch/arm/mach-mvebu/mvebu-soc-id.h
+@@ -0,0 +1,32 @@
++/*
++ * Marvell EBU SoC ID and revision definitions.
++ *
++ * Copyright (C) 2014 Marvell Semiconductor
++ *
++ * This file is licensed under the terms of the GNU General Public
++ * License version 2. This program is licensed "as is" without any
++ * warranty of any kind, whether express or implied.
++ */
++
++#ifndef __LINUX_MVEBU_SOC_ID_H
++#define __LINUX_MVEBU_SOC_ID_H
++
++/* Armada XP ID */
++#define MV78230_DEV_ID 0x7823
++#define MV78260_DEV_ID 0x7826
++#define MV78460_DEV_ID 0x7846
++
++/* Armada XP Revision */
++#define MV78XX0_A0_REV 0x1
++#define MV78XX0_B0_REV 0x2
++
++#ifdef CONFIG_ARCH_MVEBU
++int mvebu_get_soc_id(u32 *dev, u32 *rev);
++#else
++static inline int mvebu_get_soc_id(u32 *dev, u32 *rev)
++{
++ return -1;
++}
++#endif
++
++#endif /* __LINUX_MVEBU_SOC_ID_H */
--- /dev/null
+From a96cc303e42ad7830dde929aad0046e448a05505 Mon Sep 17 00:00:00 2001
+From: Simon Guinot <simon.guinot@sequanux.org>
+Date: Tue, 14 Jan 2014 20:10:27 +0100
+Subject: ARM: mvebu: update the SATA compatible string for Armada 370/XP
+
+From: Simon Guinot <simon.guinot@sequanux.org>
+
+commit a96cc303e42ad7830dde929aad0046e448a05505 upstream.
+
+This patch updates the Armada 370/XP SATA node with the new compatible
+string "marvell,armada-370-sata".
+
+Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
+Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Cc: Jason Cooper <jason@lakedaemon.net>
+Cc: Andrew Lunn <andrew@lunn.ch>
+Cc: Gregory Clement <gregory.clement@free-electrons.com>
+Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
+Cc: Lior Amsalem <alior@marvell.com>
+Acked-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/armada-370-xp.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-370-xp.dtsi
++++ b/arch/arm/boot/dts/armada-370-xp.dtsi
+@@ -143,7 +143,7 @@
+ };
+
+ sata@a0000 {
+- compatible = "marvell,orion-sata";
++ compatible = "marvell,armada-370-sata";
+ reg = <0xa0000 0x5000>;
+ interrupts = <55>;
+ clocks = <&gateclk 15>, <&gateclk 30>;
--- /dev/null
+From e20970ada3f699c113fe64b04492af083d11a7d8 Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Wed, 8 Jan 2014 11:22:25 +0100
+Subject: ASoC: adau1701: Fix ADAU1701_SEROCTL_WORD_LEN_16 constant
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+commit e20970ada3f699c113fe64b04492af083d11a7d8 upstream.
+
+The driver defines ADAU1701_SEROCTL_WORD_LEN_16 as 0x10 while it should be b10,
+so 0x2. This patch fixes it.
+
+Reported-by: Magnus Reftel <magnus.reftel@lockless.no>
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/adau1701.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/adau1701.c
++++ b/sound/soc/codecs/adau1701.c
+@@ -71,7 +71,7 @@
+
+ #define ADAU1701_SEROCTL_WORD_LEN_24 0x0000
+ #define ADAU1701_SEROCTL_WORD_LEN_20 0x0001
+-#define ADAU1701_SEROCTL_WORD_LEN_16 0x0010
++#define ADAU1701_SEROCTL_WORD_LEN_16 0x0002
+ #define ADAU1701_SEROCTL_WORD_LEN_MASK 0x0003
+
+ #define ADAU1701_AUXNPOW_VBPD 0x40
--- /dev/null
+From 34354792432b6e0a3b156819a1a19716c50d3473 Mon Sep 17 00:00:00 2001
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Date: Tue, 21 Jan 2014 16:27:51 +0000
+Subject: ASoC: wm5110: Extend SYSCLK patch file for rev D
+
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+
+commit 34354792432b6e0a3b156819a1a19716c50d3473 upstream.
+
+Latest evaluation of the the device has given some patch file additions
+for improved performance.
+
+Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm5110.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
+
+--- a/sound/soc/codecs/wm5110.c
++++ b/sound/soc/codecs/wm5110.c
+@@ -43,6 +43,54 @@ static const struct reg_default wm5110_s
+ { 0x3133, 0x1201 },
+ { 0x3183, 0x1501 },
+ { 0x31D3, 0x1401 },
++ { 0x0049, 0x01ea },
++ { 0x004a, 0x01f2 },
++ { 0x0057, 0x01e7 },
++ { 0x0058, 0x01fb },
++ { 0x33ce, 0xc4f5 },
++ { 0x33cf, 0x1361 },
++ { 0x33d0, 0x0402 },
++ { 0x33d1, 0x4700 },
++ { 0x33d2, 0x026d },
++ { 0x33d3, 0xff00 },
++ { 0x33d4, 0x026d },
++ { 0x33d5, 0x0101 },
++ { 0x33d6, 0xc4f5 },
++ { 0x33d7, 0x0361 },
++ { 0x33d8, 0x0402 },
++ { 0x33d9, 0x6701 },
++ { 0x33da, 0xc4f5 },
++ { 0x33db, 0x136f },
++ { 0x33dc, 0xc4f5 },
++ { 0x33dd, 0x134f },
++ { 0x33de, 0xc4f5 },
++ { 0x33df, 0x131f },
++ { 0x33e0, 0x026d },
++ { 0x33e1, 0x4f01 },
++ { 0x33e2, 0x026d },
++ { 0x33e3, 0xf100 },
++ { 0x33e4, 0x026d },
++ { 0x33e5, 0x0001 },
++ { 0x33e6, 0xc4f5 },
++ { 0x33e7, 0x0361 },
++ { 0x33e8, 0x0402 },
++ { 0x33e9, 0x6601 },
++ { 0x33ea, 0xc4f5 },
++ { 0x33eb, 0x136f },
++ { 0x33ec, 0xc4f5 },
++ { 0x33ed, 0x134f },
++ { 0x33ee, 0xc4f5 },
++ { 0x33ef, 0x131f },
++ { 0x33f0, 0x026d },
++ { 0x33f1, 0x4e01 },
++ { 0x33f2, 0x026d },
++ { 0x33f3, 0xf000 },
++ { 0x33f6, 0xc4f5 },
++ { 0x33f7, 0x1361 },
++ { 0x33f8, 0x0402 },
++ { 0x33f9, 0x4600 },
++ { 0x33fa, 0x026d },
++ { 0x33fb, 0xfe00 },
+ };
+
+ static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w,
--- /dev/null
+From 9013d64e661fc2a37a1742670202171c27fef4b5 Mon Sep 17 00:00:00 2001
+From: Lior Amsalem <alior@marvell.com>
+Date: Tue, 14 Jan 2014 20:09:57 +0100
+Subject: ata: sata_mv: fix disk hotplug for Armada 370/XP SoCs
+
+From: Lior Amsalem <alior@marvell.com>
+
+commit 9013d64e661fc2a37a1742670202171c27fef4b5 upstream.
+
+On Armada 370/XP SoCs, once a disk is removed from a SATA port, then the
+re-plug events are not detected by the sata_mv driver. This patch fixes
+the issue by updating the PHY speed in the LP_PHY_CTL register (0x58)
+according to the SControl speed.
+
+Note that this fix is only applied if the compatible string
+"marvell,armada-370-sata" is found in the SATA DT node.
+
+Fixes: 9ae6f740b49f ("arm: mach-mvebu: add support for Armada 370 and Armada XP with DT")
+Signed-off-by: Lior Amsalem <alior@marvell.com>
+Signed-off-by: Nadav Haklai <nadavh@marvell.com>
+Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
+Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Cc: Jason Cooper <jason@lakedaemon.net>
+Cc: Andrew Lunn <andrew@lunn.ch>
+Cc: Gregory Clement <gregory.clement@free-electrons.com>
+Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
+Acked-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/ata/sata_mv.c | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+--- a/drivers/ata/sata_mv.c
++++ b/drivers/ata/sata_mv.c
+@@ -304,6 +304,7 @@ enum {
+ MV5_LTMODE = 0x30,
+ MV5_PHY_CTL = 0x0C,
+ SATA_IFCFG = 0x050,
++ LP_PHY_CTL = 0x058,
+
+ MV_M2_PREAMP_MASK = 0x7e0,
+
+@@ -431,6 +432,7 @@ enum {
+ MV_HP_CUT_THROUGH = (1 << 10), /* can use EDMA cut-through */
+ MV_HP_FLAG_SOC = (1 << 11), /* SystemOnChip, no PCI */
+ MV_HP_QUIRK_LED_BLINK_EN = (1 << 12), /* is led blinking enabled? */
++ MV_HP_FIX_LP_PHY_CTL = (1 << 13), /* fix speed in LP_PHY_CTL ? */
+
+ /* Port private flags (pp_flags) */
+ MV_PP_FLAG_EDMA_EN = (1 << 0), /* is EDMA engine enabled? */
+@@ -1358,6 +1360,7 @@ static int mv_scr_write(struct ata_link
+
+ if (ofs != 0xffffffffU) {
+ void __iomem *addr = mv_ap_base(link->ap) + ofs;
++ struct mv_host_priv *hpriv = link->ap->host->private_data;
+ if (sc_reg_in == SCR_CONTROL) {
+ /*
+ * Workaround for 88SX60x1 FEr SATA#26:
+@@ -1374,6 +1377,18 @@ static int mv_scr_write(struct ata_link
+ */
+ if ((val & 0xf) == 1 || (readl(addr) & 0xf) == 1)
+ val |= 0xf000;
++
++ if (hpriv->hp_flags & MV_HP_FIX_LP_PHY_CTL) {
++ void __iomem *lp_phy_addr =
++ mv_ap_base(link->ap) + LP_PHY_CTL;
++ /*
++ * Set PHY speed according to SControl speed.
++ */
++ if ((val & 0xf0) == 0x10)
++ writelfl(0x7, lp_phy_addr);
++ else
++ writelfl(0x227, lp_phy_addr);
++ }
+ }
+ writelfl(val, addr);
+ return 0;
+@@ -4110,6 +4125,15 @@ static int mv_platform_probe(struct plat
+ if (rc)
+ goto err;
+
++ /*
++ * To allow disk hotplug on Armada 370/XP SoCs, the PHY speed must be
++ * updated in the LP_PHY_CTL register.
++ */
++ if (pdev->dev.of_node &&
++ of_device_is_compatible(pdev->dev.of_node,
++ "marvell,armada-370-sata"))
++ hpriv->hp_flags |= MV_HP_FIX_LP_PHY_CTL;
++
+ /* initialize adapter */
+ rc = mv_init_host(host);
+ if (rc)
--- /dev/null
+From b1f5c73bd5a4752efb7d7af019034044b08aafe9 Mon Sep 17 00:00:00 2001
+From: Simon Guinot <simon.guinot@sequanux.org>
+Date: Tue, 14 Jan 2014 20:04:39 +0100
+Subject: ata: sata_mv: introduce compatible string "marvell, armada-370-sata"
+
+From: Simon Guinot <simon.guinot@sequanux.org>
+
+commit b1f5c73bd5a4752efb7d7af019034044b08aafe9 upstream.
+
+The sata_mv driver supports the SATA IP found in several Marvell SoCs.
+As some new SATA registers have been introduced with the Armada 370/XP
+SoCs, a way to identify them is needed.
+
+This patch introduces a new compatible string for the SATA IP found in
+Armada 370/XP SoCs.
+
+Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
+Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Cc: Jason Cooper <jason@lakedaemon.net>
+Cc: Andrew Lunn <andrew@lunn.ch>
+Cc: Gregory Clement <gregory.clement@free-electrons.com>
+Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
+Cc: Lior Amsalem <alior@marvell.com>
+Acked-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/ata/marvell.txt | 2 +-
+ drivers/ata/sata_mv.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+--- a/Documentation/devicetree/bindings/ata/marvell.txt
++++ b/Documentation/devicetree/bindings/ata/marvell.txt
+@@ -1,7 +1,7 @@
+ * Marvell Orion SATA
+
+ Required Properties:
+-- compatibility : "marvell,orion-sata"
++- compatibility : "marvell,orion-sata" or "marvell,armada-370-sata"
+ - reg : Address range of controller
+ - interrupts : Interrupt controller is using
+ - nr-ports : Number of SATA ports in use.
+--- a/drivers/ata/sata_mv.c
++++ b/drivers/ata/sata_mv.c
+@@ -4209,6 +4209,7 @@ static int mv_platform_resume(struct pla
+
+ #ifdef CONFIG_OF
+ static struct of_device_id mv_sata_dt_ids[] = {
++ { .compatible = "marvell,armada-370-sata", },
+ { .compatible = "marvell,orion-sata", },
+ {},
+ };
--- /dev/null
+From ef71ec00002d92a08eb27e9d036e3d48835b6597 Mon Sep 17 00:00:00 2001
+From: Kent Overstreet <kmo@daterainc.com>
+Date: Tue, 17 Dec 2013 17:51:02 -0800
+Subject: bcache: Data corruption fix
+
+From: Kent Overstreet <kmo@daterainc.com>
+
+commit ef71ec00002d92a08eb27e9d036e3d48835b6597 upstream.
+
+The code that handles overlapping extents that we've just read back in from disk
+was depending on the behaviour of the code that handles overlapping extents as
+we're inserting into a btree node in the case of an insert that forced an
+existing extent to be split: on insert, if we had to split we'd also insert a
+new extent to represent the top part of the old extent - and then that new
+extent would get written out.
+
+The code that read the extents back in thus not bother with splitting extents -
+if it saw an extent that ovelapped in the middle of an older extent, it would
+trim the old extent to only represent the bottom part, assuming that the
+original insert would've inserted a new extent to represent the top part.
+
+I still haven't figured out _how_ it can happen, but I'm now pretty convinced
+(and testing has confirmed) that there's some kind of an obscure corner case
+(probably involving extent merging, and multiple overwrites in different sets)
+that breaks this. The fix is to change the mergesort fixup code to split extents
+itself when required.
+
+Signed-off-by: Kent Overstreet <kmo@daterainc.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/md/bcache/bset.c | 26 ++++++++++++++++++++++----
+ 1 file changed, 22 insertions(+), 4 deletions(-)
+
+--- a/drivers/md/bcache/bset.c
++++ b/drivers/md/bcache/bset.c
+@@ -935,7 +935,7 @@ static void sort_key_next(struct btree_i
+ *i = iter->data[--iter->used];
+ }
+
+-static void btree_sort_fixup(struct btree_iter *iter)
++static struct bkey *btree_sort_fixup(struct btree_iter *iter, struct bkey *tmp)
+ {
+ while (iter->used > 1) {
+ struct btree_iter_set *top = iter->data, *i = top + 1;
+@@ -963,9 +963,22 @@ static void btree_sort_fixup(struct btre
+ } else {
+ /* can't happen because of comparison func */
+ BUG_ON(!bkey_cmp(&START_KEY(top->k), &START_KEY(i->k)));
+- bch_cut_back(&START_KEY(i->k), top->k);
++
++ if (bkey_cmp(i->k, top->k) < 0) {
++ bkey_copy(tmp, top->k);
++
++ bch_cut_back(&START_KEY(i->k), tmp);
++ bch_cut_front(i->k, top->k);
++ heap_sift(iter, 0, btree_iter_cmp);
++
++ return tmp;
++ } else {
++ bch_cut_back(&START_KEY(i->k), top->k);
++ }
+ }
+ }
++
++ return NULL;
+ }
+
+ static void btree_mergesort(struct btree *b, struct bset *out,
+@@ -973,15 +986,20 @@ static void btree_mergesort(struct btree
+ bool fixup, bool remove_stale)
+ {
+ struct bkey *k, *last = NULL;
++ BKEY_PADDED(k) tmp;
+ bool (*bad)(struct btree *, const struct bkey *) = remove_stale
+ ? bch_ptr_bad
+ : bch_ptr_invalid;
+
+ while (!btree_iter_end(iter)) {
+ if (fixup && !b->level)
+- btree_sort_fixup(iter);
++ k = btree_sort_fixup(iter, &tmp.k);
++ else
++ k = NULL;
++
++ if (!k)
++ k = bch_btree_iter_next(iter);
+
+- k = bch_btree_iter_next(iter);
+ if (bad(b, k))
+ continue;
+
--- /dev/null
+From 09c455aaa8f47a94d5bafaa23d58365768210507 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Tue, 7 Jan 2014 12:58:19 -0500
+Subject: ext4: avoid clearing beyond i_blocks when truncating an inline data file
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+commit 09c455aaa8f47a94d5bafaa23d58365768210507 upstream.
+
+A missing cast means that when we are truncating a file which is less
+than 60 bytes, we don't clear the correct area of memory, and in fact
+we can end up truncating the next inode in the inode table, or worse
+yet, some other kernel data structure.
+
+Addresses-Coverity-Id: #751987
+
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/inline.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/fs/ext4/inline.c
++++ b/fs/ext4/inline.c
+@@ -1925,9 +1925,11 @@ void ext4_inline_data_truncate(struct in
+ }
+
+ /* Clear the content within i_blocks. */
+- if (i_size < EXT4_MIN_INLINE_DATA_SIZE)
+- memset(ext4_raw_inode(&is.iloc)->i_block + i_size, 0,
+- EXT4_MIN_INLINE_DATA_SIZE - i_size);
++ if (i_size < EXT4_MIN_INLINE_DATA_SIZE) {
++ void *p = (void *) ext4_raw_inode(&is.iloc)->i_block;
++ memset(p + i_size, 0,
++ EXT4_MIN_INLINE_DATA_SIZE - i_size);
++ }
+
+ EXT4_I(inode)->i_inline_size = i_size <
+ EXT4_MIN_INLINE_DATA_SIZE ?
--- /dev/null
+From b0ad4ff35d479a46a3b995a299db9aeb097acfce Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 13 Jan 2014 12:32:44 +0100
+Subject: hp_accel: Add a new PnP ID HPQ6007 for new HP laptops
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit b0ad4ff35d479a46a3b995a299db9aeb097acfce upstream.
+
+The DriveGuard chips on the new HP laptops are with a new PnP ID
+"HPQ6007". It should be compatible with older chips.
+
+Acked-by: Éric Piel <eric.piel@tremplin-utc.net>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/platform/x86/hp_accel.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/platform/x86/hp_accel.c
++++ b/drivers/platform/x86/hp_accel.c
+@@ -77,6 +77,7 @@ static inline void delayed_sysfs_set(str
+ static struct acpi_device_id lis3lv02d_device_ids[] = {
+ {"HPQ0004", 0}, /* HP Mobile Data Protection System PNP */
+ {"HPQ6000", 0}, /* HP Mobile Data Protection System PNP */
++ {"HPQ6007", 0}, /* HP Mobile Data Protection System PNP */
+ {"", 0},
+ };
+ MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);
--- /dev/null
+From f8b94beb7e6a374cb0de531b72377c49857b35ca Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Date: Tue, 31 Dec 2013 17:07:35 +0100
+Subject: i2c: mv64xxx: Document the newly introduced Armada XP A0 compatible
+
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+
+commit f8b94beb7e6a374cb0de531b72377c49857b35ca upstream.
+
+The first variants of Armada XP SoCs (A0 stepping) have issues related
+to the i2c controller which prevent to use the offload mechanism and
+lead to a kernel hang during boot.
+
+The commit introduces a new the compatible string
+marvell,mv78230-a0-i2c for the i2c controller.
+
+Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+cc: devicetree@vger.kernel.org
+Fixes: 930ab3d403ae (i2c: mv64xxx: Add I2C Transaction Generator support)
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
++++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
+@@ -5,7 +5,11 @@ Required properties :
+
+ - reg : Offset and length of the register set for the device
+ - compatible : Should be "marvell,mv64xxx-i2c" or "allwinner,sun4i-i2c"
+- or "marvell,mv78230-i2c"
++ or "marvell,mv78230-i2c" or "marvell,mv78230-a0-i2c"
++ Note: Only use "marvell,mv78230-a0-i2c" for a very rare,
++ initial version of the SoC which had broken offload
++ support. Linux auto-detects this and sets it
++ appropriately.
+ - interrupts : The interrupt number
+
+ Optional properties :
--- /dev/null
+From 6cf70ae928bae17077efc0d528dec49bc380438b Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Date: Tue, 31 Dec 2013 16:59:33 +0100
+Subject: i2c: mv64xxx: Fix bus hang on A0 version of the Armada XP SoCs
+
+From: Gregory CLEMENT <gregory.clement@free-electrons.com>
+
+commit 6cf70ae928bae17077efc0d528dec49bc380438b upstream.
+
+The first variants of Armada XP SoCs (A0 stepping) have issues related
+to the i2c controller which prevent to use the offload mechanism and
+lead to a kernel hang during boot.
+
+The commit introduces a new the compatible string
+marvell,mv78230-a0-i2c for the i2c controller. When this compatible
+string is used the driver disables the offload mechanism and the
+kernel no more hangs on these SoCs.
+
+Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
+Reported-by: Andrew Lunn <andrew@lunn.ch>
+Acked-by: Wolfram Sang <wsa@the-dreams.de>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Fixes: 930ab3d403ae (i2c: mv64xxx: Add I2C Transaction Generator support)
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-mv64xxx.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/i2c/busses/i2c-mv64xxx.c
++++ b/drivers/i2c/busses/i2c-mv64xxx.c
+@@ -692,6 +692,7 @@ static const struct of_device_id mv64xxx
+ { .compatible = "allwinner,sun4i-i2c", .data = &mv64xxx_i2c_regs_sun4i},
+ { .compatible = "marvell,mv64xxx-i2c", .data = &mv64xxx_i2c_regs_mv64xxx},
+ { .compatible = "marvell,mv78230-i2c", .data = &mv64xxx_i2c_regs_mv64xxx},
++ { .compatible = "marvell,mv78230-a0-i2c", .data = &mv64xxx_i2c_regs_mv64xxx},
+ {}
+ };
+ MODULE_DEVICE_TABLE(of, mv64xxx_i2c_of_match_table);
+@@ -783,6 +784,10 @@ mv64xxx_of_config(struct mv64xxx_i2c_dat
+ drv_data->errata_delay = true;
+ }
+
++ if (of_device_is_compatible(np, "marvell,mv78230-a0-i2c")) {
++ drv_data->offload_enabled = false;
++ drv_data->errata_delay = true;
++ }
+ out:
+ return rc;
+ #endif
--- /dev/null
+From 032f708bc4f6da868ec49dac48ddf3670d8035d3 Mon Sep 17 00:00:00 2001
+From: Shane Huang <shane.huang@amd.com>
+Date: Wed, 22 Jan 2014 14:05:46 -0800
+Subject: i2c: piix4: Add support for AMD ML and CZ SMBus changes
+
+From: Shane Huang <shane.huang@amd.com>
+
+commit 032f708bc4f6da868ec49dac48ddf3670d8035d3 upstream.
+
+The locations of SMBus register base address and enablement bit are changed
+from AMD ML, which need this patch to be supported.
+
+Signed-off-by: Shane Huang <shane.huang@amd.com>
+Reviewed-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/i2c/busses/i2c-piix4 | 2 +-
+ drivers/i2c/busses/Kconfig | 1 +
+ drivers/i2c/busses/i2c-piix4.c | 28 +++++++++++++++++++++++-----
+ 3 files changed, 25 insertions(+), 6 deletions(-)
+
+--- a/Documentation/i2c/busses/i2c-piix4
++++ b/Documentation/i2c/busses/i2c-piix4
+@@ -13,7 +13,7 @@ Supported adapters:
+ * AMD SP5100 (SB700 derivative found on some server mainboards)
+ Datasheet: Publicly available at the AMD website
+ http://support.amd.com/us/Embedded_TechDocs/44413.pdf
+- * AMD Hudson-2, CZ
++ * AMD Hudson-2, ML, CZ
+ Datasheet: Not publicly available
+ * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
+ Datasheet: Publicly available at the SMSC website http://www.smsc.com
+--- a/drivers/i2c/busses/Kconfig
++++ b/drivers/i2c/busses/Kconfig
+@@ -151,6 +151,7 @@ config I2C_PIIX4
+ ATI SB700/SP5100
+ ATI SB800
+ AMD Hudson-2
++ AMD ML
+ AMD CZ
+ Serverworks OSB4
+ Serverworks CSB5
+--- a/drivers/i2c/busses/i2c-piix4.c
++++ b/drivers/i2c/busses/i2c-piix4.c
+@@ -22,7 +22,7 @@
+ Intel PIIX4, 440MX
+ Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100
+ ATI IXP200, IXP300, IXP400, SB600, SB700/SP5100, SB800
+- AMD Hudson-2, CZ
++ AMD Hudson-2, ML, CZ
+ SMSC Victory66
+
+ Note: we assume there can only be one device, with one or more
+@@ -235,7 +235,8 @@ static int piix4_setup_sb800(struct pci_
+ {
+ unsigned short piix4_smba;
+ unsigned short smba_idx = 0xcd6;
+- u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en;
++ u8 smba_en_lo, smba_en_hi, smb_en, smb_en_status;
++ u8 i2ccfg, i2ccfg_offset = 0x10;
+
+ /* SB800 and later SMBus does not support forcing address */
+ if (force || force_addr) {
+@@ -245,7 +246,15 @@ static int piix4_setup_sb800(struct pci_
+ }
+
+ /* Determine the address of the SMBus areas */
+- smb_en = (aux) ? 0x28 : 0x2c;
++ if ((PIIX4_dev->vendor == PCI_VENDOR_ID_AMD &&
++ PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS &&
++ PIIX4_dev->revision >= 0x41) ||
++ (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD &&
++ PIIX4_dev->device == 0x790b &&
++ PIIX4_dev->revision >= 0x49))
++ smb_en = 0x00;
++ else
++ smb_en = (aux) ? 0x28 : 0x2c;
+
+ if (!request_region(smba_idx, 2, "smba_idx")) {
+ dev_err(&PIIX4_dev->dev, "SMBus base address index region "
+@@ -258,13 +267,22 @@ static int piix4_setup_sb800(struct pci_
+ smba_en_hi = inb_p(smba_idx + 1);
+ release_region(smba_idx, 2);
+
+- if ((smba_en_lo & 1) == 0) {
++ if (!smb_en) {
++ smb_en_status = smba_en_lo & 0x10;
++ piix4_smba = smba_en_hi << 8;
++ if (aux)
++ piix4_smba |= 0x20;
++ } else {
++ smb_en_status = smba_en_lo & 0x01;
++ piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0;
++ }
++
++ if (!smb_en_status) {
+ dev_err(&PIIX4_dev->dev,
+ "Host SMBus controller not enabled!\n");
+ return -ENODEV;
+ }
+
+- piix4_smba = ((smba_en_hi << 8) | smba_en_lo) & 0xffe0;
+ if (acpi_check_region(piix4_smba, SMBIOSIZE, piix4_driver.name))
+ return -ENODEV;
+
--- /dev/null
+From ecd75ad514d73efc1bbcc5f10a13566c3ace5f53 Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Thu, 16 Jan 2014 09:47:17 -0500
+Subject: libata: disable LPM for some WD SATA-I devices
+
+From: Tejun Heo <tj@kernel.org>
+
+commit ecd75ad514d73efc1bbcc5f10a13566c3ace5f53 upstream.
+
+For some reason, some early WD drives spin up and down drives
+erratically when the link is put into slumber mode which can reduce
+the life expectancy of the device significantly. Unfortunately, we
+don't have full list of devices and given the nature of the issue it'd
+be better to err on the side of false positives than the other way
+around. Let's disable LPM on all WD devices which match one of the
+known problematic model prefixes and are SATA-I.
+
+As horkage list doesn't support matching SATA capabilities, this is
+implemented as two horkages - WD_BROKEN_LPM and NOLPM. The former is
+set for the known prefixes and sets the latter if the matched device
+is SATA-I.
+
+Note that this isn't optimal as this disables all LPM operations and
+partial link power state reportedly works fine on these; however, the
+way LPM is implemented in libata makes it difficult to precisely map
+libata LPM setting to specific link power state. Well, these devices
+are already fairly outdated. Let's just disable whole LPM for now.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Reported-and-tested-by: Nikos Barkas <levelwol@gmail.com>
+Reported-and-tested-by: Ioannis Barkas <risc4all@yahoo.com>
+References: https://bugzilla.kernel.org/show_bug.cgi?id=57211
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/ata/libata-core.c | 27 +++++++++++++++++++++++++++
+ drivers/ata/libata-scsi.c | 18 +++++++++++++++---
+ include/linux/libata.h | 2 ++
+ 3 files changed, 44 insertions(+), 3 deletions(-)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -2222,6 +2222,16 @@ int ata_dev_configure(struct ata_device
+ if (rc)
+ return rc;
+
++ /* some WD SATA-1 drives have issues with LPM, turn on NOLPM for them */
++ if ((dev->horkage & ATA_HORKAGE_WD_BROKEN_LPM) &&
++ (id[ATA_ID_SATA_CAPABILITY] & 0xe) == 0x2)
++ dev->horkage |= ATA_HORKAGE_NOLPM;
++
++ if (dev->horkage & ATA_HORKAGE_NOLPM) {
++ ata_dev_warn(dev, "LPM support broken, forcing max_power\n");
++ dev->link->ap->target_lpm_policy = ATA_LPM_MAX_POWER;
++ }
++
+ /* let ACPI work its magic */
+ rc = ata_acpi_on_devcfg(dev);
+ if (rc)
+@@ -4216,6 +4226,23 @@ static const struct ata_blacklist_entry
+ { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+ { "Crucial_CT???M500SSD1", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+
++ /*
++ * Some WD SATA-I drives spin up and down erratically when the link
++ * is put into the slumber mode. We don't have full list of the
++ * affected devices. Disable LPM if the device matches one of the
++ * known prefixes and is SATA-1. As a side effect LPM partial is
++ * lost too.
++ *
++ * https://bugzilla.kernel.org/show_bug.cgi?id=57211
++ */
++ { "WDC WD800JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
++ { "WDC WD1200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
++ { "WDC WD1600JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
++ { "WDC WD2000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
++ { "WDC WD2500JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
++ { "WDC WD3000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
++ { "WDC WD3200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM },
++
+ /* End Marker */
+ { }
+ };
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -111,12 +111,14 @@ static const char *ata_lpm_policy_names[
+ [ATA_LPM_MIN_POWER] = "min_power",
+ };
+
+-static ssize_t ata_scsi_lpm_store(struct device *dev,
++static ssize_t ata_scsi_lpm_store(struct device *device,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+ {
+- struct Scsi_Host *shost = class_to_shost(dev);
++ struct Scsi_Host *shost = class_to_shost(device);
+ struct ata_port *ap = ata_shost_to_port(shost);
++ struct ata_link *link;
++ struct ata_device *dev;
+ enum ata_lpm_policy policy;
+ unsigned long flags;
+
+@@ -132,10 +134,20 @@ static ssize_t ata_scsi_lpm_store(struct
+ return -EINVAL;
+
+ spin_lock_irqsave(ap->lock, flags);
++
++ ata_for_each_link(link, ap, EDGE) {
++ ata_for_each_dev(dev, &ap->link, ENABLED) {
++ if (dev->horkage & ATA_HORKAGE_NOLPM) {
++ count = -EOPNOTSUPP;
++ goto out_unlock;
++ }
++ }
++ }
++
+ ap->target_lpm_policy = policy;
+ ata_port_schedule_eh(ap);
++out_unlock:
+ spin_unlock_irqrestore(ap->lock, flags);
+-
+ return count;
+ }
+
+--- a/include/linux/libata.h
++++ b/include/linux/libata.h
+@@ -419,6 +419,8 @@ enum {
+ ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */
+ ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */
+ ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */
++ ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */
++ ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */
+
+ /* DMA mask for user DMA control: User visible values; DO NOT
+ renumber */
--- /dev/null
+From 74142ffc0b52cfe6f9d2f6f34a5f3eedbfe3ce51 Mon Sep 17 00:00:00 2001
+From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Date: Fri, 20 Dec 2013 10:35:07 +0100
+Subject: mfd: max77686: Fix regmap resource leak on driver remove
+
+From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+
+commit 74142ffc0b52cfe6f9d2f6f34a5f3eedbfe3ce51 upstream.
+
+The regmap used by max77686 MFD driver was not freed with regmap_exit()
+on driver exit. This lead to leak of resources.
+
+Replace regmap_init_i2c() call in driver probe with initialization of
+managed register map so the regmap will be properly freed by the device
+management code.
+
+Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mfd/max77686.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mfd/max77686.c
++++ b/drivers/mfd/max77686.c
+@@ -103,7 +103,7 @@ static int max77686_i2c_probe(struct i2c
+ max77686->irq_gpio = pdata->irq_gpio;
+ max77686->irq = i2c->irq;
+
+- max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
++ max77686->regmap = devm_regmap_init_i2c(i2c, &max77686_regmap_config);
+ if (IS_ERR(max77686->regmap)) {
+ ret = PTR_ERR(max77686->regmap);
+ dev_err(max77686->dev, "Failed to allocate register map: %d\n",
--- /dev/null
+From d6a484520c5572a4170fa915109ccfc0c38f5008 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Wed, 27 Nov 2013 17:43:43 +0100
+Subject: parport: parport_pc: remove double PCI ID for NetMos
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+commit d6a484520c5572a4170fa915109ccfc0c38f5008 upstream.
+
+In commit 85747f ("PATCH] parport: add NetMOS 9805 support") Max added
+the PCI ID for NetMOS 9805 based on a Debian bug report from 2k4 which
+was at the v2.4.26 time frame. The patch made into 2.6.14.
+Shortly before that patch akpm merged commit 296d3c783b ("[PATCH] Support
+NetMOS based PCI cards providing serial and parallel ports") which made
+into v2.6.9-rc1.
+Now we have two different entries for the same PCI id.
+I have here the NetMos 9805 which claims to support SPP/EPP/ECP mode.
+This patch takes Max's entry for titan_1284p1 (base != -1 specifies the
+ioport for ECP mode) and replaces akpm's entry for netmos_9805 which
+specified -1 (=none). Both share the same PCI-ID (my card has subsystem
+0x1000 / 0x0020 so it should match PCI_ANY).
+
+While here I also drop the entry for titan_1284p2 which is the same as
+netmos_9815.
+
+Cc: Maximilian Attems <maks@stro.at>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/parport/parport_pc.c | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+--- a/drivers/parport/parport_pc.c
++++ b/drivers/parport/parport_pc.c
+@@ -2596,8 +2596,6 @@ enum parport_pc_pci_cards {
+ syba_2p_epp,
+ syba_1p_ecp,
+ titan_010l,
+- titan_1284p1,
+- titan_1284p2,
+ avlab_1p,
+ avlab_2p,
+ oxsemi_952,
+@@ -2656,8 +2654,6 @@ static struct parport_pc_pci {
+ /* syba_2p_epp AP138B */ { 2, { { 0, 0x078 }, { 0, 0x178 }, } },
+ /* syba_1p_ecp W83787 */ { 1, { { 0, 0x078 }, } },
+ /* titan_010l */ { 1, { { 3, -1 }, } },
+- /* titan_1284p1 */ { 1, { { 0, 1 }, } },
+- /* titan_1284p2 */ { 2, { { 0, 1 }, { 2, 3 }, } },
+ /* avlab_1p */ { 1, { { 0, 1}, } },
+ /* avlab_2p */ { 2, { { 0, 1}, { 2, 3 },} },
+ /* The Oxford Semi cards are unusual: 954 doesn't support ECP,
+@@ -2673,8 +2669,8 @@ static struct parport_pc_pci {
+ /* netmos_9705 */ { 1, { { 0, -1 }, } },
+ /* netmos_9715 */ { 2, { { 0, 1 }, { 2, 3 },} },
+ /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} },
+- /* netmos_9805 */ { 1, { { 0, -1 }, } },
+- /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } },
++ /* netmos_9805 */ { 1, { { 0, 1 }, } },
++ /* netmos_9815 */ { 2, { { 0, 1 }, { 2, 3 }, } },
+ /* netmos_9901 */ { 1, { { 0, -1 }, } },
+ /* netmos_9865 */ { 1, { { 0, -1 }, } },
+ /* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
+@@ -2718,8 +2714,6 @@ static const struct pci_device_id parpor
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_1p_ecp },
+ { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_010L,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_010l },
+- { 0x9710, 0x9805, 0x1000, 0x0010, 0, 0, titan_1284p1 },
+- { 0x9710, 0x9815, 0x1000, 0x0020, 0, 0, titan_1284p2 },
+ /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
+ /* AFAVLAB_TK9902 */
+ { 0x14db, 0x2120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1p},
--- /dev/null
+From ad85ace07a05062ef6b59c35a5e80b6eaee1eee6 Mon Sep 17 00:00:00 2001
+From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
+Date: Fri, 20 Dec 2013 13:41:47 -0500
+Subject: perf kvm: Fix kvm report without guestmount.
+
+From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
+
+commit ad85ace07a05062ef6b59c35a5e80b6eaee1eee6 upstream.
+
+Currently, if we use perf kvm --guestkallsyms --guestmodules report, we
+can not get the perf information from perf data file. All sample are
+shown as unknown.
+
+Reproducing steps:
+ # perf kvm --guestkallsyms /tmp/kallsyms --guestmodules /tmp/modules record -a sleep 1
+ [ perf record: Woken up 1 times to write data ]
+ [ perf record: Captured and wrote 0.624 MB perf.data.guest (~27260 samples) ]
+ # perf kvm --guestkallsyms /tmp/kallsyms --guestmodules /tmp/modules report |grep %
+ 100.00% [guest/6471] [unknown] [g] 0xffffffff8164f330
+
+This bug was introduced by 207b57926 (perf kvm: Fix regression with guest machine creation).
+In original code, it uses perf_session__find_machine(), it means we deliver symbol to machine
+which has the same pid, if no machine found, deliver it to *default* guest. But if we use
+perf_session__findnew_machine() here, if no machine was found, new machine with pid will be built
+and added. Then the default guest which with pid == 0 will never get a symbol.
+
+And because the new machine initialized here has no kernel map created, the symbol delivered to
+it will be marked as "unknown".
+
+This patch here is to revert commit 207b57926 and fix the SEGFAULT bug in another way.
+
+Verification steps:
+ # ./perf kvm --guestkallsyms /home/kallsyms --guestmodules /home/modules record -a sleep 1
+ [ perf record: Woken up 1 times to write data ]
+ [ perf record: Captured and wrote 0.651 MB perf.data.guest (~28437 samples) ]
+ # ./perf kvm --guestkallsyms /home/kallsyms --guestmodules /home/modules report |grep %
+ 22.64% :6471 [guest.kernel.kallsyms] [g] update_rq_clock.part.70
+ 19.99% :6471 [guest.kernel.kallsyms] [g] d_free
+ 18.46% :6471 [guest.kernel.kallsyms] [g] bio_phys_segments
+ 16.25% :6471 [guest.kernel.kallsyms] [g] dequeue_task
+ 12.78% :6471 [guest.kernel.kallsyms] [g] __switch_to
+ 7.91% :6471 [guest.kernel.kallsyms] [g] scheduler_tick
+ 1.75% :6471 [guest.kernel.kallsyms] [g] native_apic_mem_write
+ 0.21% :6471 [guest.kernel.kallsyms] [g] apic_timer_interrupt
+
+Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
+Acked-by: David Ahern <dsahern@gmail.com>
+Cc: David Ahern <dsahern@gmail.com>
+Link: http://lkml.kernel.org/r/1387564907-3045-1-git-send-email-yangds.fnst@cn.fujitsu.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/perf/util/session.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/tools/perf/util/session.c
++++ b/tools/perf/util/session.c
+@@ -870,6 +870,7 @@ static struct machine *
+ struct perf_sample *sample)
+ {
+ const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
++ struct machine *machine;
+
+ if (perf_guest &&
+ ((cpumode == PERF_RECORD_MISC_GUEST_KERNEL) ||
+@@ -882,7 +883,11 @@ static struct machine *
+ else
+ pid = sample->pid;
+
+- return perf_session__findnew_machine(session, pid);
++ machine = perf_session__find_machine(session, pid);
++ if (!machine)
++ machine = perf_session__findnew_machine(session,
++ DEFAULT_GUEST_KERNEL_ID);
++ return machine;
+ }
+
+ return &session->machines.host;
--- /dev/null
+From fa8cf57c923e86a693a85aff1df579245a27cbb3 Mon Sep 17 00:00:00 2001
+From: Chen-Yu Tsai <wens@csie.org>
+Date: Thu, 16 Jan 2014 14:34:23 +0800
+Subject: pinctrl: sunxi: Honor GPIO output initial vaules
+
+From: Chen-Yu Tsai <wens@csie.org>
+
+commit fa8cf57c923e86a693a85aff1df579245a27cbb3 upstream.
+
+Some GPIO users, such as fixed-regulator, request GPIO output with
+initial value of 1. This was ignored by sunxi driver.
+
+Signed-off-by: Chen-Yu Tsai <wens@csie.org>
+Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/pinctrl-sunxi.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/pinctrl/pinctrl-sunxi.c
++++ b/drivers/pinctrl/pinctrl-sunxi.c
+@@ -469,12 +469,6 @@ static int sunxi_pinctrl_gpio_get(struct
+ return val;
+ }
+
+-static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
+- unsigned offset, int value)
+-{
+- return pinctrl_gpio_direction_output(chip->base + offset);
+-}
+-
+ static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
+ unsigned offset, int value)
+ {
+@@ -498,6 +492,13 @@ static void sunxi_pinctrl_gpio_set(struc
+ spin_unlock_irqrestore(&pctl->lock, flags);
+ }
+
++static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip,
++ unsigned offset, int value)
++{
++ sunxi_pinctrl_gpio_set(chip, offset, value);
++ return pinctrl_gpio_direction_output(chip->base + offset);
++}
++
+ static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
+ const struct of_phandle_args *gpiospec,
+ u32 *flags)
--- /dev/null
+From d5a1c7e3fc38d9c7d629e1e47f32f863acbdec3d Mon Sep 17 00:00:00 2001
+From: Borislav Petkov <bp@alien8.de>
+Date: Sat, 20 Jul 2013 19:00:23 +0200
+Subject: rtc-cmos: Add an alarm disable quirk
+
+From: Borislav Petkov <bp@alien8.de>
+
+commit d5a1c7e3fc38d9c7d629e1e47f32f863acbdec3d upstream.
+
+41c7f7424259f ("rtc: Disable the alarm in the hardware (v2)") added the
+functionality to disable the RTC wake alarm when shutting down the box.
+
+However, there are at least two b0rked BIOSes we know about:
+
+https://bugzilla.novell.com/show_bug.cgi?id=812592
+https://bugzilla.novell.com/show_bug.cgi?id=805740
+
+where, when wakeup alarm is enabled in the BIOS, the machine reboots
+automatically right after shutdown, regardless of what wakeup time is
+programmed.
+
+Bisecting the issue lead to this patch so disable its functionality with
+a DMI quirk only for those boxes.
+
+Cc: Brecht Machiels <brecht@mos6581.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: John Stultz <john.stultz@linaro.org>
+Cc: Rabin Vincent <rabin.vincent@stericsson.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+[jstultz: Changed variable name for clarity, added extra dmi entry]
+Tested-by: Brecht Machiels <brecht@mos6581.org>
+Tested-by: Borislav Petkov <bp@suse.de>
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-cmos.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 51 insertions(+), 1 deletion(-)
+
+--- a/drivers/rtc/rtc-cmos.c
++++ b/drivers/rtc/rtc-cmos.c
+@@ -34,11 +34,11 @@
+ #include <linux/interrupt.h>
+ #include <linux/spinlock.h>
+ #include <linux/platform_device.h>
+-#include <linux/mod_devicetable.h>
+ #include <linux/log2.h>
+ #include <linux/pm.h>
+ #include <linux/of.h>
+ #include <linux/of_platform.h>
++#include <linux/dmi.h>
+
+ /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */
+ #include <asm-generic/rtc.h>
+@@ -377,6 +377,51 @@ static int cmos_set_alarm(struct device
+ return 0;
+ }
+
++/*
++ * Do not disable RTC alarm on shutdown - workaround for b0rked BIOSes.
++ */
++static bool alarm_disable_quirk;
++
++static int __init set_alarm_disable_quirk(const struct dmi_system_id *id)
++{
++ alarm_disable_quirk = true;
++ pr_info("rtc-cmos: BIOS has alarm-disable quirk. ");
++ pr_info("RTC alarms disabled\n");
++ return 0;
++}
++
++static const struct dmi_system_id rtc_quirks[] __initconst = {
++ /* https://bugzilla.novell.com/show_bug.cgi?id=805740 */
++ {
++ .callback = set_alarm_disable_quirk,
++ .ident = "IBM Truman",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "4852570"),
++ },
++ },
++ /* https://bugzilla.novell.com/show_bug.cgi?id=812592 */
++ {
++ .callback = set_alarm_disable_quirk,
++ .ident = "Gigabyte GA-990XA-UD3",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR,
++ "Gigabyte Technology Co., Ltd."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "GA-990XA-UD3"),
++ },
++ },
++ /* http://permalink.gmane.org/gmane.linux.kernel/1604474 */
++ {
++ .callback = set_alarm_disable_quirk,
++ .ident = "Toshiba Satellite L300",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"),
++ },
++ },
++ {}
++};
++
+ static int cmos_alarm_irq_enable(struct device *dev, unsigned int enabled)
+ {
+ struct cmos_rtc *cmos = dev_get_drvdata(dev);
+@@ -385,6 +430,9 @@ static int cmos_alarm_irq_enable(struct
+ if (!is_valid_irq(cmos->irq))
+ return -EINVAL;
+
++ if (alarm_disable_quirk)
++ return 0;
++
+ spin_lock_irqsave(&rtc_lock, flags);
+
+ if (enabled)
+@@ -1158,6 +1206,8 @@ static int __init cmos_init(void)
+ platform_driver_registered = true;
+ }
+
++ dmi_check_system(rtc_quirks);
++
+ if (retval == 0)
+ return 0;
+
--- /dev/null
+From 75ea799df4cb07e505c91b4abaa87bc28aad3e66 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Thu, 23 Jan 2014 15:55:19 -0800
+Subject: rtc: max8907: weekday encoding fixes
+
+From: Stephen Warren <swarren@nvidia.com>
+
+commit 75ea799df4cb07e505c91b4abaa87bc28aad3e66 upstream.
+
+The current MAX8907 driver has two issues related to weekday value
+handling:
+
+1)
+
+The HW WEEKDAY register has range 0..6 rather than 1..7 as documented.
+Note that I validated the actual HW range by observing the HW register
+roll from 6->0 rather than 6->7->1 as would otherwise be expected.
+
+This matches Linux's tm_wday range of 0..6.
+
+When the CMOS RAM content is lost, the date returned from the device is
+2007-01-01 00:00:00, which is a Monday. The WEEKDAY register reads 1 in
+this case. This matches the numbering in Linux's tm_wday field.
+
+Hence we should write Linux's tm_wday value to the register without
+modifying it. Hence, remove the +1/-1 calculations for WEEKDAY/tm_wday.
+
+2)
+
+There's no need to make alarms match on the WEEKDAY register, since the
+other fields together uniquely define the alarm date/time. Ignoring the
+WEEKDAY value in the match isolates the driver from any incorrect value in
+the current time copy of the WEEKDAY register.
+
+Each change individually, or both together, solves an issue that I
+observed; "hwclock -r" would time out waiting for its alarm to fire if the
+CMOS RAM content had been lost, and hence the WEEKDAY register value
+mismatched what the driver expected it to be. "hwclock -w" would solve
+this by over-writing the HW default WEEKDAY register value with what the
+driver expected.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.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@linuxfoundation.org>
+
+---
+ drivers/rtc/rtc-max8907.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+--- a/drivers/rtc/rtc-max8907.c
++++ b/drivers/rtc/rtc-max8907.c
+@@ -51,7 +51,7 @@ static irqreturn_t max8907_irq_handler(i
+ {
+ struct max8907_rtc *rtc = data;
+
+- regmap_update_bits(rtc->regmap, MAX8907_REG_ALARM0_CNTL, 0x7f, 0);
++ regmap_write(rtc->regmap, MAX8907_REG_ALARM0_CNTL, 0);
+
+ rtc_update_irq(rtc->rtc_dev, 1, RTC_IRQF | RTC_AF);
+
+@@ -64,7 +64,7 @@ static void regs_to_tm(u8 *regs, struct
+ bcd2bin(regs[RTC_YEAR1]) - 1900;
+ tm->tm_mon = bcd2bin(regs[RTC_MONTH] & 0x1f) - 1;
+ tm->tm_mday = bcd2bin(regs[RTC_DATE] & 0x3f);
+- tm->tm_wday = (regs[RTC_WEEKDAY] & 0x07) - 1;
++ tm->tm_wday = (regs[RTC_WEEKDAY] & 0x07);
+ if (regs[RTC_HOUR] & HOUR_12) {
+ tm->tm_hour = bcd2bin(regs[RTC_HOUR] & 0x01f);
+ if (tm->tm_hour == 12)
+@@ -88,7 +88,7 @@ static void tm_to_regs(struct rtc_time *
+ regs[RTC_YEAR1] = bin2bcd(low);
+ regs[RTC_MONTH] = bin2bcd(tm->tm_mon + 1);
+ regs[RTC_DATE] = bin2bcd(tm->tm_mday);
+- regs[RTC_WEEKDAY] = tm->tm_wday + 1;
++ regs[RTC_WEEKDAY] = tm->tm_wday;
+ regs[RTC_HOUR] = bin2bcd(tm->tm_hour);
+ regs[RTC_MIN] = bin2bcd(tm->tm_min);
+ regs[RTC_SEC] = bin2bcd(tm->tm_sec);
+@@ -153,7 +153,7 @@ static int max8907_rtc_set_alarm(struct
+ tm_to_regs(&alrm->time, regs);
+
+ /* Disable alarm while we update the target time */
+- ret = regmap_update_bits(rtc->regmap, MAX8907_REG_ALARM0_CNTL, 0x7f, 0);
++ ret = regmap_write(rtc->regmap, MAX8907_REG_ALARM0_CNTL, 0);
+ if (ret < 0)
+ return ret;
+
+@@ -163,8 +163,7 @@ static int max8907_rtc_set_alarm(struct
+ return ret;
+
+ if (alrm->enabled)
+- ret = regmap_update_bits(rtc->regmap, MAX8907_REG_ALARM0_CNTL,
+- 0x7f, 0x7f);
++ ret = regmap_write(rtc->regmap, MAX8907_REG_ALARM0_CNTL, 0x77);
+
+ return ret;
+ }
kvm-s390-fix-diagnose-code-extraction.patch
kvm-s390-ioeventfd-ignore-leftmost-bits.patch
s390-uapi-fix-struct-statfs64-definition.patch
+parport-parport_pc-remove-double-pci-id-for-netmos.patch
+rtc-cmos-add-an-alarm-disable-quirk.patch
+rtc-max8907-weekday-encoding-fixes.patch
+pinctrl-sunxi-honor-gpio-output-initial-vaules.patch
+perf-kvm-fix-kvm-report-without-guestmount.patch
+mfd-max77686-fix-regmap-resource-leak-on-driver-remove.patch
+asoc-adau1701-fix-adau1701_seroctl_word_len_16-constant.patch
+asoc-wm5110-extend-sysclk-patch-file-for-rev-d.patch
+alsa-rme9652-fix-a-missing-comma-in-channel_map_9636_ds.patch
+alsa-hda-correct-ad1986a-3stack-pin-configs.patch
+alsa-hda-don-t-create-duplicated-ctls-for-loopback-paths.patch
+alsa-enable-config_zone_dma-for-smaller-pci-dma-masks.patch
+alsa-bits-vs-bytes-bug-in-snd_card_create.patch
+alsa-hda-fix-silent-output-on-macbook-air-1-1.patch
+tpm-tpm_i2c_stm_st33-check-return-code-of-get_burstcount.patch
+tpm-tpm_ppi-do-not-compare-strcmp-a-b-1.patch
+ata-sata_mv-introduce-compatible-string-marvell-armada-370-sata.patch
+ata-sata_mv-fix-disk-hotplug-for-armada-370-xp-socs.patch
+arm-mvebu-update-the-sata-compatible-string-for-armada-370-xp.patch
+libata-disable-lpm-for-some-wd-sata-i-devices.patch
+ext4-avoid-clearing-beyond-i_blocks-when-truncating-an-inline-data-file.patch
+vfs-remove-second-variable-named-error-in-__dentry_path.patch
+vfs-is-mounted-should-be-testing-mnt_ns-for-null-or-error.patch
+bcache-data-corruption-fix.patch
+zram-fix-race-between-reset-and-flushing-pending-work.patch
+hp_accel-add-a-new-pnp-id-hpq6007-for-new-hp-laptops.patch
+arm-mvebu-add-support-to-get-the-id-and-the-revision-of-a-soc.patch
+arm-mvebu-add-quirk-for-i2c-for-the-openblocks-ax3-4-board.patch
+i2c-mv64xxx-fix-bus-hang-on-a0-version-of-the-armada-xp-socs.patch
+i2c-mv64xxx-document-the-newly-introduced-armada-xp-a0-compatible.patch
+i2c-piix4-add-support-for-amd-ml-and-cz-smbus-changes.patch
--- /dev/null
+From 85c5e0d451125c6ddb78663972e40af810b83644 Mon Sep 17 00:00:00 2001
+From: Peter Huewe <PeterHuewe@gmx.de>
+Date: Wed, 30 Oct 2013 00:54:20 +0100
+Subject: tpm/tpm_i2c_stm_st33: Check return code of get_burstcount
+
+From: Peter Huewe <PeterHuewe@gmx.de>
+
+commit 85c5e0d451125c6ddb78663972e40af810b83644 upstream.
+
+The 'get_burstcount' function can in some circumstances 'return -EBUSY' which
+in tpm_stm_i2c_send is stored in an 'u32 burstcnt'
+thus converting the signed value into an unsigned value, resulting
+in 'burstcnt' being huge.
+Changing the type to u32 only does not solve the problem as the signed
+value is converted to an unsigned in I2C_WRITE_DATA, resulting in the
+same effect.
+
+Thus
+-> Change type of burstcnt to u32 (the return type of get_burstcount)
+-> Add a check for the return value of 'get_burstcount' and propagate a
+potential error.
+
+This makes also sense in the 'I2C_READ_DATA' case, where the there is no
+signed/unsigned conversion.
+
+found by coverity
+Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/char/tpm/tpm_i2c_stm_st33.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
++++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
+@@ -410,6 +410,8 @@ static int recv_data(struct tpm_chip *ch
+ &chip->vendor.read_queue)
+ == 0) {
+ burstcnt = get_burstcount(chip);
++ if (burstcnt < 0)
++ return burstcnt;
+ len = min_t(int, burstcnt, count - size);
+ I2C_READ_DATA(client, TPM_DATA_FIFO, buf + size, len);
+ size += len;
+@@ -451,7 +453,8 @@ static irqreturn_t tpm_ioserirq_handler(
+ static int tpm_stm_i2c_send(struct tpm_chip *chip, unsigned char *buf,
+ size_t len)
+ {
+- u32 status, burstcnt = 0, i, size;
++ u32 status, i, size;
++ int burstcnt = 0;
+ int ret;
+ u8 data;
+ struct i2c_client *client;
+@@ -482,6 +485,8 @@ static int tpm_stm_i2c_send(struct tpm_c
+
+ for (i = 0; i < len - 1;) {
+ burstcnt = get_burstcount(chip);
++ if (burstcnt < 0)
++ return burstcnt;
+ size = min_t(int, len - i - 1, burstcnt);
+ ret = I2C_WRITE_DATA(client, TPM_DATA_FIFO, buf, size);
+ if (ret < 0)
--- /dev/null
+From 747d35bd9bb4ae6bd74b19baa5bbe32f3e0cee11 Mon Sep 17 00:00:00 2001
+From: Peter Huewe <PeterHuewe@gmx.de>
+Date: Wed, 30 Oct 2013 20:46:55 +0100
+Subject: tpm/tpm_ppi: Do not compare strcmp(a,b) == -1
+
+From: Peter Huewe <PeterHuewe@gmx.de>
+
+commit 747d35bd9bb4ae6bd74b19baa5bbe32f3e0cee11 upstream.
+
+Depending on the implementation strcmp might return the difference between
+two strings not only -1,0,1 consequently
+ if (strcmp (a,b) == -1)
+might lead to taking the wrong branch
+
+-> compare with < 0 instead,
+which in any case is more canonical.
+
+Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/char/tpm/tpm_ppi.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/char/tpm/tpm_ppi.c
++++ b/drivers/char/tpm/tpm_ppi.c
+@@ -172,7 +172,7 @@ static ssize_t tpm_store_ppi_request(str
+ * is updated with function index from SUBREQ to SUBREQ2 since PPI
+ * version 1.1
+ */
+- if (strcmp(version, "1.1") == -1)
++ if (strcmp(version, "1.1") < 0)
+ params[2].integer.value = TPM_PPI_FN_SUBREQ;
+ else
+ params[2].integer.value = TPM_PPI_FN_SUBREQ2;
+@@ -182,7 +182,7 @@ static ssize_t tpm_store_ppi_request(str
+ * string/package type. For PPI version 1.0 and 1.1, use buffer type
+ * for compatibility, and use package type since 1.2 according to spec.
+ */
+- if (strcmp(version, "1.2") == -1) {
++ if (strcmp(version, "1.2") < 0) {
+ params[3].type = ACPI_TYPE_BUFFER;
+ params[3].buffer.length = sizeof(req);
+ sscanf(buf, "%d", &req);
+@@ -248,7 +248,7 @@ static ssize_t tpm_show_ppi_transition_a
+ * (e.g. Capella with PPI 1.0) need integer/string/buffer type, so for
+ * compatibility, define params[3].type as buffer, if PPI version < 1.2
+ */
+- if (strcmp(version, "1.2") == -1) {
++ if (strcmp(version, "1.2") < 0) {
+ params[3].type = ACPI_TYPE_BUFFER;
+ params[3].buffer.length = 0;
+ params[3].buffer.pointer = NULL;
+@@ -390,7 +390,7 @@ static ssize_t show_ppi_operations(char
+ kfree(output.pointer);
+ output.length = ACPI_ALLOCATE_BUFFER;
+ output.pointer = NULL;
+- if (strcmp(version, "1.2") == -1)
++ if (strcmp(version, "1.2") < 0)
+ return -EPERM;
+
+ params[2].integer.value = TPM_PPI_FN_GETOPR;
--- /dev/null
+From 260a459d2e39761fbd39803497205ce1690bc7b1 Mon Sep 17 00:00:00 2001
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+Date: Mon, 20 Jan 2014 15:26:15 -0800
+Subject: vfs: Is mounted should be testing mnt_ns for NULL or error.
+
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+
+commit 260a459d2e39761fbd39803497205ce1690bc7b1 upstream.
+
+A bug was introduced with the is_mounted helper function in
+commit f7a99c5b7c8bd3d3f533c8b38274e33f3da9096e
+Author: Al Viro <viro@zeniv.linux.org.uk>
+Date: Sat Jun 9 00:59:08 2012 -0400
+
+ get rid of ->mnt_longterm
+
+ it's enough to set ->mnt_ns of internal vfsmounts to something
+ distinct from all struct mnt_namespace out there; then we can
+ just use the check for ->mnt_ns != NULL in the fast path of
+ mntput_no_expire()
+
+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+
+The intent was to test if the real_mount(vfsmount)->mnt_ns was
+NULL_OR_ERR but the code is actually testing real_mount(vfsmount)
+and always returning true.
+
+The result is d_absolute_path returning paths it should be hiding.
+
+Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/mount.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/mount.h
++++ b/fs/mount.h
+@@ -73,7 +73,7 @@ static inline int mnt_has_parent(struct
+ static inline int is_mounted(struct vfsmount *mnt)
+ {
+ /* neither detached nor internal? */
+- return !IS_ERR_OR_NULL(real_mount(mnt));
++ return !IS_ERR_OR_NULL(real_mount(mnt)->mnt_ns);
+ }
+
+ extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
--- /dev/null
+From a8323da0366d3398eda62741d2ac1130c8a172ed Mon Sep 17 00:00:00 2001
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+Date: Mon, 20 Jan 2014 15:43:25 -0800
+Subject: vfs: Remove second variable named error in __dentry_path
+
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+
+commit a8323da0366d3398eda62741d2ac1130c8a172ed upstream.
+
+In commit 232d2d60aa5469bb097f55728f65146bd49c1d25
+Author: Waiman Long <Waiman.Long@hp.com>
+Date: Mon Sep 9 12:18:13 2013 -0400
+
+ dcache: Translating dentry into pathname without taking rename_lock
+
+The __dentry_path locking was changed and the variable error was
+intended to be moved outside of the loop. Unfortunately the inner
+declaration of error was not removed. Resulting in a version of
+__dentry_path that will never return an error.
+
+Remove the problematic inner declaration of error and allow
+__dentry_path to return errors once again.
+
+Cc: Waiman Long <Waiman.Long@hp.com>
+Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/dcache.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/fs/dcache.c
++++ b/fs/dcache.c
+@@ -3140,7 +3140,6 @@ restart:
+ read_seqbegin_or_lock(&rename_lock, &seq);
+ while (!IS_ROOT(dentry)) {
+ struct dentry *parent = dentry->d_parent;
+- int error;
+
+ prefetch(parent);
+ error = prepend_name(&end, &len, &dentry->d_name);
--- /dev/null
+From da4a04126baa3be03bc566d4a2ee0944c5e783d0 Mon Sep 17 00:00:00 2001
+From: Minchan Kim <minchan@kernel.org>
+Date: Thu, 30 Jan 2014 15:45:58 -0800
+Subject: zram: fix race between reset and flushing pending work
+
+From: Minchan Kim <minchan@kernel.org>
+
+commit da4a04126baa3be03bc566d4a2ee0944c5e783d0 upstream.
+
+Dan and Sergey reported that there is a racy between reset and flushing
+of pending work so that it could make oops by freeing zram->meta in
+reset while zram_slot_free can access zram->meta if new request is
+adding during the race window.
+
+This patch moves flush after taking init_lock so it prevents new request
+so that it closes the race.
+
+Signed-off-by: Minchan Kim <minchan@kernel.org>
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Cc: Nitin Gupta <ngupta@vflare.org>
+Cc: Jerome Marchand <jmarchan@redhat.com>
+Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.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@linuxfoundation.org>
+
+---
+ drivers/staging/zram/zram_drv.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/zram/zram_drv.c
++++ b/drivers/staging/zram/zram_drv.c
+@@ -552,14 +552,14 @@ static void zram_reset_device(struct zra
+ size_t index;
+ struct zram_meta *meta;
+
+- flush_work(&zram->free_work);
+-
+ down_write(&zram->init_lock);
+ if (!zram->init_done) {
+ up_write(&zram->init_lock);
+ return;
+ }
+
++ flush_work(&zram->free_work);
++
+ meta = zram->meta;
+ zram->init_done = 0;
+