--- /dev/null
+From b450b17c156e264bc44a198046d3ebaaef5a041d Mon Sep 17 00:00:00 2001
+From: Harsha Priya <harshapriya.n@intel.com>
+Date: Thu, 9 Oct 2014 11:04:56 +0000
+Subject: ALSA: ALC283 codec - Avoid pop noise on headphones during suspend/resume
+
+From: Harsha Priya <harshapriya.n@intel.com>
+
+commit b450b17c156e264bc44a198046d3ebaaef5a041d upstream.
+
+This patch sets the headphones mode to default before suspending
+which helps avoid the pop noise on headphones
+
+Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -3103,6 +3103,9 @@ static void alc283_shutup(struct hda_cod
+
+ alc_write_coef_idx(codec, 0x43, 0x9004);
+
++ /*depop hp during suspend*/
++ alc_write_coef_idx(codec, 0x06, 0x2100);
++
+ snd_hda_codec_write(codec, hp_pin, 0,
+ AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+
--- /dev/null
+From 3f4032861cfbff0b9134bf94c5c92e2146d1f068 Mon Sep 17 00:00:00 2001
+From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+Date: Fri, 10 Oct 2014 23:32:49 +0900
+Subject: ALSA: bebob: Fix failure to detect source of clock for Terratec Phase 88
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+
+commit 3f4032861cfbff0b9134bf94c5c92e2146d1f068 upstream.
+
+This patch fixes a failure to open PCM device with -ENOSYS in
+Terratec Phase 88.
+
+Terratec Phase 88 has two Selector Function Blocks of AVC Audio subunit
+to switch source of clock. One is to switch internal/external for the
+source and another is to switch word/spdif for the external clock.
+
+The IDs for these Selector Function Blocks are 9 and 8. But in current
+implementation they're 0 and 0.
+
+Reported-by: András Murányi <muranyia@gmail.com>
+Tested-by: András Murányi <muranyia@gmail.com>
+Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/firewire/bebob/bebob_terratec.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/firewire/bebob/bebob_terratec.c
++++ b/sound/firewire/bebob/bebob_terratec.c
+@@ -17,10 +17,10 @@ phase88_rack_clk_src_get(struct snd_bebo
+ unsigned int enable_ext, enable_word;
+ int err;
+
+- err = avc_audio_get_selector(bebob->unit, 0, 0, &enable_ext);
++ err = avc_audio_get_selector(bebob->unit, 0, 9, &enable_ext);
+ if (err < 0)
+ goto end;
+- err = avc_audio_get_selector(bebob->unit, 0, 0, &enable_word);
++ err = avc_audio_get_selector(bebob->unit, 0, 8, &enable_word);
+ if (err < 0)
+ goto end;
+
--- /dev/null
+From 95926035b187cc9fee6fb61385b7da9c28123f74 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 13 Oct 2014 23:18:02 +0200
+Subject: ALSA: emu10k1: Fix deadlock in synth voice lookup
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 95926035b187cc9fee6fb61385b7da9c28123f74 upstream.
+
+The emu10k1 voice allocator takes voice_lock spinlock. When there is
+no empty stream available, it tries to release a voice used by synth,
+and calls get_synth_voice. The callback function,
+snd_emu10k1_synth_get_voice(), however, also takes the voice_lock,
+thus it deadlocks.
+
+The fix is simply removing the voice_lock holds in
+snd_emu10k1_synth_get_voice(), as this is always called in the
+spinlock context.
+
+Reported-and-tested-by: Arthur Marsh <arthur.marsh@internode.on.net>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/emu10k1/emu10k1_callback.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/sound/pci/emu10k1/emu10k1_callback.c
++++ b/sound/pci/emu10k1/emu10k1_callback.c
+@@ -85,6 +85,8 @@ snd_emu10k1_ops_setup(struct snd_emux *e
+ * get more voice for pcm
+ *
+ * terminate most inactive voice and give it as a pcm voice.
++ *
++ * voice_lock is already held.
+ */
+ int
+ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
+@@ -92,12 +94,10 @@ snd_emu10k1_synth_get_voice(struct snd_e
+ struct snd_emux *emu;
+ struct snd_emux_voice *vp;
+ struct best_voice best[V_END];
+- unsigned long flags;
+ int i;
+
+ emu = hw->synth;
+
+- spin_lock_irqsave(&emu->voice_lock, flags);
+ lookup_voices(emu, hw, best, 1); /* no OFF voices */
+ for (i = 0; i < V_END; i++) {
+ if (best[i].voice >= 0) {
+@@ -113,11 +113,9 @@ snd_emu10k1_synth_get_voice(struct snd_e
+ vp->emu->num_voices--;
+ vp->ch = -1;
+ vp->state = SNDRV_EMUX_ST_OFF;
+- spin_unlock_irqrestore(&emu->voice_lock, flags);
+ return ch;
+ }
+ }
+- spin_unlock_irqrestore(&emu->voice_lock, flags);
+
+ /* not found */
+ return -ENOMEM;
--- /dev/null
+From fb54a645b2739fb196446ffbbbe3f3589d117b55 Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Fri, 24 Oct 2014 10:00:38 +0200
+Subject: ALSA: hda - Add missing terminating entry to SND_HDA_PIN_QUIRK macro
+
+From: David Henningsson <david.henningsson@canonical.com>
+
+commit fb54a645b2739fb196446ffbbbe3f3589d117b55 upstream.
+
+Without this terminating entry, the pin matching would continue
+across random memory until a zero or a non-matching entry was found.
+
+The result being that in some cases, the pin quirk would not be
+applied correctly.
+
+Signed-off-by: David Henningsson <david.henningsson@canonical.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_local.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/hda_local.h
++++ b/sound/pci/hda/hda_local.h
+@@ -424,7 +424,7 @@ struct snd_hda_pin_quirk {
+ .subvendor = _subvendor,\
+ .name = _name,\
+ .value = _value,\
+- .pins = (const struct hda_pintbl[]) { _pins } \
++ .pins = (const struct hda_pintbl[]) { _pins, {0, 0}} \
+ }
+ #else
+
+@@ -432,7 +432,7 @@ struct snd_hda_pin_quirk {
+ { .codec = _codec,\
+ .subvendor = _subvendor,\
+ .value = _value,\
+- .pins = (const struct hda_pintbl[]) { _pins } \
++ .pins = (const struct hda_pintbl[]) { _pins, {0, 0}} \
+ }
+
+ #endif
--- /dev/null
+From b1974f965a506c131b60cd3e483340884e831920 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 20 Oct 2014 11:26:57 +0200
+Subject: ALSA: hda - Fix inverted LED gpio setup for Lenovo Ideapad
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit b1974f965a506c131b60cd3e483340884e831920 upstream.
+
+We implemented in a wrong way for mute LED on Lenovo Ideapad; the bit
+must be flipped.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16373
+Fixes: 3e887f379d8a ('ALSA: hda - Add mute LED support to Lenovo Ideapad')
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -5578,9 +5578,9 @@ static void alc662_led_gpio1_mute_hook(v
+ unsigned int oldval = spec->gpio_led;
+
+ if (enabled)
+- spec->gpio_led &= ~0x01;
+- else
+ spec->gpio_led |= 0x01;
++ else
++ spec->gpio_led &= ~0x01;
+ if (spec->gpio_led != oldval)
+ snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
+ spec->gpio_led);
--- /dev/null
+From 6acce400d9daf1353fbf497302670c90a3205e1d Mon Sep 17 00:00:00 2001
+From: Anssi Hannula <anssi.hannula@iki.fi>
+Date: Sun, 19 Oct 2014 19:25:19 +0300
+Subject: ALSA: hda - hdmi: Fix missing ELD change event on plug/unplug
+
+From: Anssi Hannula <anssi.hannula@iki.fi>
+
+commit 6acce400d9daf1353fbf497302670c90a3205e1d upstream.
+
+The ELD ALSA control change event is sent by hdmi_present_sense() when
+eld_changed is true.
+
+Currently, it is only true when the ELD buffer contents have been
+modified. However, the user-visible ELD controls also change to a
+zero-length value and back when eld_valid is unset/set, and no event is
+currently sent in such cases (such as when unplugging or replugging a
+sink).
+
+Fix the code to always set eld_changed if eld_valid value is changed,
+and therefore to always send the change event when the user-visible
+value changes.
+
+Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
+Cc: David Henningsson <david.henningsson@canonical.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_hdmi.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1574,19 +1574,22 @@ static bool hdmi_present_sense(struct hd
+ }
+ }
+
+- if (pin_eld->eld_valid && !eld->eld_valid) {
+- update_eld = true;
++ if (pin_eld->eld_valid != eld->eld_valid)
+ eld_changed = true;
+- }
++
++ if (pin_eld->eld_valid && !eld->eld_valid)
++ update_eld = true;
++
+ if (update_eld) {
+ bool old_eld_valid = pin_eld->eld_valid;
+ pin_eld->eld_valid = eld->eld_valid;
+- eld_changed = pin_eld->eld_size != eld->eld_size ||
++ if (pin_eld->eld_size != eld->eld_size ||
+ memcmp(pin_eld->eld_buffer, eld->eld_buffer,
+- eld->eld_size) != 0;
+- if (eld_changed)
++ eld->eld_size) != 0) {
+ memcpy(pin_eld->eld_buffer, eld->eld_buffer,
+ eld->eld_size);
++ eld_changed = true;
++ }
+ pin_eld->eld_size = eld->eld_size;
+ pin_eld->info = eld->info;
+
--- /dev/null
+From a011e213f3700233ed2a676f1ef0a74a052d7162 Mon Sep 17 00:00:00 2001
+From: Anatol Pomozov <anatol.pomozov@gmail.com>
+Date: Fri, 17 Oct 2014 12:43:34 -0700
+Subject: ALSA: pcm: use the same dma mmap codepath both for arm and arm64
+
+From: Anatol Pomozov <anatol.pomozov@gmail.com>
+
+commit a011e213f3700233ed2a676f1ef0a74a052d7162 upstream.
+
+This avoids following kernel crash when try to playback on arm64
+
+[ 107.497203] [<ffffffc00046b310>] snd_pcm_mmap_data_fault+0x90/0xd4
+[ 107.503405] [<ffffffc0001541ac>] __do_fault+0xb0/0x498
+[ 107.508565] [<ffffffc0001576a0>] handle_mm_fault+0x224/0x7b0
+[ 107.514246] [<ffffffc000092640>] do_page_fault+0x11c/0x310
+[ 107.519738] [<ffffffc000081100>] do_mem_abort+0x38/0x98
+
+Tested: backported to 3.14 and tried to playback on arm64 machine
+
+Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/pcm_native.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/core/pcm_native.c
++++ b/sound/core/pcm_native.c
+@@ -3190,7 +3190,7 @@ static const struct vm_operations_struct
+
+ #ifndef ARCH_HAS_DMA_MMAP_COHERENT
+ /* This should be defined / handled globally! */
+-#ifdef CONFIG_ARM
++#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+ #define ARCH_HAS_DMA_MMAP_COHERENT
+ #endif
+ #endif
--- /dev/null
+From f0b127fbfdc8756eba7437ab668f3169280bd358 Mon Sep 17 00:00:00 2001
+From: Vlad Catoi <vladcatoi@gmail.com>
+Date: Sat, 18 Oct 2014 17:45:41 -0500
+Subject: ALSA: usb-audio: Add support for Steinberg UR22 USB interface
+
+From: Vlad Catoi <vladcatoi@gmail.com>
+
+commit f0b127fbfdc8756eba7437ab668f3169280bd358 upstream.
+
+Adding support for Steinberg UR22 USB interface via quirks table patch
+
+See Ubuntu bug report:
+https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1317244
+Also see threads:
+http://linux-audio.4202.n7.nabble.com/Support-for-Steinberg-UR22-Yamaha-USB-chipset-0499-1509-tc82888.html#a82917
+http://www.steinberg.net/forums/viewtopic.php?t=62290
+
+Tested by at least 4 people judging by the threads.
+Did not test MIDI interface, but audio output and capture both are
+functional. Built 3.17 kernel with this driver on Ubuntu 14.04 & tested with mpg123
+Patch applied to 3.13 Ubuntu kernel works well enough for daily use.
+
+Signed-off-by: Vlad Catoi <vladcatoi@gmail.com>
+Acked-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/quirks-table.h | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+--- a/sound/usb/quirks-table.h
++++ b/sound/usb/quirks-table.h
+@@ -385,6 +385,36 @@ YAMAHA_DEVICE(0x105d, NULL),
+ }
+ },
+ {
++ USB_DEVICE(0x0499, 0x1509),
++ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
++ /* .vendor_name = "Yamaha", */
++ /* .product_name = "Steinberg UR22", */
++ .ifnum = QUIRK_ANY_INTERFACE,
++ .type = QUIRK_COMPOSITE,
++ .data = (const struct snd_usb_audio_quirk[]) {
++ {
++ .ifnum = 1,
++ .type = QUIRK_AUDIO_STANDARD_INTERFACE
++ },
++ {
++ .ifnum = 2,
++ .type = QUIRK_AUDIO_STANDARD_INTERFACE
++ },
++ {
++ .ifnum = 3,
++ .type = QUIRK_MIDI_YAMAHA
++ },
++ {
++ .ifnum = 4,
++ .type = QUIRK_IGNORE_INTERFACE
++ },
++ {
++ .ifnum = -1
++ }
++ }
++ }
++},
++{
+ USB_DEVICE(0x0499, 0x150a),
+ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
+ /* .vendor_name = "Yamaha", */
--- /dev/null
+From 0a51d644c20f5c88fd3a659119d1903f74927082 Mon Sep 17 00:00:00 2001
+From: David Dueck <davidcdueck@googlemail.com>
+Date: Wed, 17 Sep 2014 10:33:32 +0200
+Subject: ARM: at91/dt: Fix typo regarding can0_clk
+
+From: David Dueck <davidcdueck@googlemail.com>
+
+commit 0a51d644c20f5c88fd3a659119d1903f74927082 upstream.
+
+Otherwise the clock for can0 will never get enabled.
+
+Signed-off-by: David Dueck <davidcdueck@googlemail.com>
+Signed-off-by: Anthony Harivel <anthony.harivel@emtrion.de>
+Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
+Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/sama5d3_can.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/sama5d3_can.dtsi
++++ b/arch/arm/boot/dts/sama5d3_can.dtsi
+@@ -40,7 +40,7 @@
+ atmel,clk-output-range = <0 66000000>;
+ };
+
+- can1_clk: can0_clk {
++ can1_clk: can1_clk {
+ #clock-cells = <0>;
+ reg = <41>;
+ atmel,clk-output-range = <0 66000000>;
--- /dev/null
+From b65e0fb3d046cc65d0a3c45d43de351fb363271b Mon Sep 17 00:00:00 2001
+From: Andreas Henriksson <andreas.henriksson@endian.se>
+Date: Tue, 23 Sep 2014 17:12:52 +0200
+Subject: ARM: at91: fix at91sam9263ek DT mmc pinmuxing settings
+
+From: Andreas Henriksson <andreas.henriksson@endian.se>
+
+commit b65e0fb3d046cc65d0a3c45d43de351fb363271b upstream.
+
+As discovered on a custom board similar to at91sam9263ek and basing
+its devicetree on that one apparently the pin muxing doesn't get
+set up properly. This was discovered since the custom boards u-boot
+does funky stuff with the pin muxing and leaved it set to SPI
+which made the MMC driver not work under Linux.
+The fix is simply to define the given configuration as the default.
+This probably worked by pure luck before, but it's better to
+make the muxing explicitly set.
+
+Signed-off-by: Andreas Henriksson <andreas.henriksson@endian.se>
+Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
+Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/at91sam9263.dtsi | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/arm/boot/dts/at91sam9263.dtsi
++++ b/arch/arm/boot/dts/at91sam9263.dtsi
+@@ -535,6 +535,7 @@
+ compatible = "atmel,hsmci";
+ reg = <0xfff80000 0x600>;
+ interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
++ pinctrl-names = "default";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+@@ -544,6 +545,7 @@
+ compatible = "atmel,hsmci";
+ reg = <0xfff84000 0x600>;
+ interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>;
++ pinctrl-names = "default";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
--- /dev/null
+From cfa1950e6c6b72251e80adc736af3c3d2907ab0e Mon Sep 17 00:00:00 2001
+From: Ludovic Desroches <ludovic.desroches@atmel.com>
+Date: Mon, 22 Sep 2014 15:51:33 +0200
+Subject: ARM: at91/PMC: don't forget to write PMC_PCDR register to disable clocks
+
+From: Ludovic Desroches <ludovic.desroches@atmel.com>
+
+commit cfa1950e6c6b72251e80adc736af3c3d2907ab0e upstream.
+
+When introducing support for sama5d3, the write to PMC_PCDR register has
+been accidentally removed.
+
+Reported-by: Nathalie Cyrille <nathalie.cyrille@atmel.com>
+Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
+Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/mach-at91/clock.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/arm/mach-at91/clock.c
++++ b/arch/arm/mach-at91/clock.c
+@@ -962,6 +962,7 @@ static int __init at91_clock_reset(void)
+ }
+
+ at91_pmc_write(AT91_PMC_SCDR, scdr);
++ at91_pmc_write(AT91_PMC_PCDR, pcdr);
+ if (cpu_is_sama5d3())
+ at91_pmc_write(AT91_PMC_PCDR1, pcdr1);
+
--- /dev/null
+From d1e61eb443dc7512885dfe89ee2f2a1c29fcb1da Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <fabio.estevam@freescale.com>
+Date: Mon, 20 Oct 2014 11:08:01 -0200
+Subject: ARM: dts: imx28-evk: Let i2c0 run at 100kHz
+
+From: Fabio Estevam <fabio.estevam@freescale.com>
+
+commit d1e61eb443dc7512885dfe89ee2f2a1c29fcb1da upstream.
+
+Commit 78b81f4666fb ("ARM: dts: imx28-evk: Run I2C0 at 400kHz") caused issues
+when doing the following sequence in loop:
+
+- Boot the kernel
+- Perform audio playback
+- Reboot the system via 'reboot' command
+
+In many times the audio card cannot be probed, which causes playback to fail.
+
+After restoring to the original i2c0 frequency of 100kHz there is no such
+problem anymore.
+
+This reverts commit 78b81f4666fbb22a20b1e63e5baf197ad2e90e88.
+
+Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
+Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/imx28-evk.dts | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/arch/arm/boot/dts/imx28-evk.dts
++++ b/arch/arm/boot/dts/imx28-evk.dts
+@@ -193,7 +193,6 @@
+ i2c0: i2c@80058000 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c0_pins_a>;
+- clock-frequency = <400000>;
+ status = "okay";
+
+ sgtl5000: codec@0a {
--- /dev/null
+From 4f5e01e96d424b54f5f0e89ee1ba9ccca03a3941 Mon Sep 17 00:00:00 2001
+From: Andrew Lunn <andrew@lunn.ch>
+Date: Mon, 1 Sep 2014 19:35:41 +0200
+Subject: ARM: Kirkwood: Fix DT based DSA.
+
+From: Andrew Lunn <andrew@lunn.ch>
+
+commit 4f5e01e96d424b54f5f0e89ee1ba9ccca03a3941 upstream.
+
+During the conversion of boards to use DT to instantiate Distributed
+Switch Architecture, nobody volunteered to test. As to be expected,
+the conversion was flawed. Testers and access to hardware has now
+become available, and this patch hopefully fixes the problems.
+
+dsa,mii-bus must be a phandle to the top level mdio node, not the port
+specific subnode of the mdio device.
+
+dsa,ethernet must be a phandle to the port subnode within the ethernet
+DT node, not the ethernet node.
+
+Don't pinctrl hog the card detect gpio for mvsdio.
+
+Rename the .dts files to make it clearer which file is for the Z0
+stepping and which for the A0 or later stepping.
+
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Cc: seugene@marvell.com
+Tested-by: Eugene Sanivsky <seugene@marvell.com>
+Fixes: e2eaa339af44: ("ARM: Kirkwood: convert rd88f6281-setup.c to DT.")
+Fixes: e7c8f3808be8: ("ARM: kirkwood: Convert mv88f6281gtw_ge switch setup to DT")
+Link: https://lkml.kernel.org/r/1409592941-22244-1-git-send-email-andrew@lunn.ch
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/Makefile | 4 +-
+ arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | 16 +++------
+ arch/arm/boot/dts/kirkwood-rd88f6281-a.dts | 43 +++++++++++++++++++++++++
+ arch/arm/boot/dts/kirkwood-rd88f6281-a0.dts | 26 ---------------
+ arch/arm/boot/dts/kirkwood-rd88f6281-a1.dts | 31 ------------------
+ arch/arm/boot/dts/kirkwood-rd88f6281-z0.dts | 35 ++++++++++++++++++++
+ arch/arm/boot/dts/kirkwood-rd88f6281.dtsi | 27 ++-------------
+ arch/arm/boot/dts/kirkwood.dtsi | 4 +-
+ 8 files changed, 93 insertions(+), 93 deletions(-)
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -137,8 +137,8 @@ kirkwood := \
+ kirkwood-openrd-client.dtb \
+ kirkwood-openrd-ultimate.dtb \
+ kirkwood-rd88f6192.dtb \
+- kirkwood-rd88f6281-a0.dtb \
+- kirkwood-rd88f6281-a1.dtb \
++ kirkwood-rd88f6281-z0.dtb \
++ kirkwood-rd88f6281-a.dtb \
+ kirkwood-rs212.dtb \
+ kirkwood-rs409.dtb \
+ kirkwood-rs411.dtb \
+--- a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
++++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
+@@ -123,11 +123,11 @@
+
+ dsa@0 {
+ compatible = "marvell,dsa";
+- #address-cells = <2>;
++ #address-cells = <1>;
+ #size-cells = <0>;
+
+- dsa,ethernet = <ð0>;
+- dsa,mii-bus = <ðphy0>;
++ dsa,ethernet = <ð0port>;
++ dsa,mii-bus = <&mdio>;
+
+ switch@0 {
+ #address-cells = <1>;
+@@ -169,17 +169,13 @@
+
+ &mdio {
+ status = "okay";
+-
+- ethphy0: ethernet-phy@ff {
+- reg = <0xff>; /* No phy attached */
+- speed = <1000>;
+- duplex = <1>;
+- };
+ };
+
+ ð0 {
+ status = "okay";
++
+ ethernet0-port@0 {
+- phy-handle = <ðphy0>;
++ speed = <1000>;
++ duplex = <1>;
+ };
+ };
+--- /dev/null
++++ b/arch/arm/boot/dts/kirkwood-rd88f6281-a.dts
+@@ -0,0 +1,43 @@
++/*
++ * Marvell RD88F6181 A Board descrition
++ *
++ * Andrew Lunn <andrew@lunn.ch>
++ *
++ * 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.
++ *
++ * This file contains the definitions for the board with the A0 or
++ * higher stepping of the SoC. The ethernet switch does not have a
++ * "wan" port.
++ */
++
++/dts-v1/;
++#include "kirkwood-rd88f6281.dtsi"
++
++/ {
++ model = "Marvell RD88f6281 Reference design, with A0 or higher SoC";
++ compatible = "marvell,rd88f6281-a", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood";
++
++ dsa@0 {
++ switch@0 {
++ reg = <10 0>; /* MDIO address 10, switch 0 in tree */
++ };
++ };
++};
++
++&mdio {
++ status = "okay";
++
++ ethphy1: ethernet-phy@11 {
++ reg = <11>;
++ };
++};
++
++ð1 {
++ status = "okay";
++
++ ethernet1-port@0 {
++ phy-handle = <ðphy1>;
++ };
++};
+--- a/arch/arm/boot/dts/kirkwood-rd88f6281-a0.dts
++++ /dev/null
+@@ -1,26 +0,0 @@
+-/*
+- * Marvell RD88F6181 A0 Board descrition
+- *
+- * Andrew Lunn <andrew@lunn.ch>
+- *
+- * 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.
+- *
+- * This file contains the definitions for the board with the A0 variant of
+- * the SoC. The ethernet switch does not have a "wan" port.
+- */
+-
+-/dts-v1/;
+-#include "kirkwood-rd88f6281.dtsi"
+-
+-/ {
+- model = "Marvell RD88f6281 Reference design, with A0 SoC";
+- compatible = "marvell,rd88f6281-a0", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood";
+-
+- dsa@0 {
+- switch@0 {
+- reg = <10 0>; /* MDIO address 10, switch 0 in tree */
+- };
+- };
+-};
+\ No newline at end of file
+--- a/arch/arm/boot/dts/kirkwood-rd88f6281-a1.dts
++++ /dev/null
+@@ -1,31 +0,0 @@
+-/*
+- * Marvell RD88F6181 A1 Board descrition
+- *
+- * Andrew Lunn <andrew@lunn.ch>
+- *
+- * 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.
+- *
+- * This file contains the definitions for the board with the A1 variant of
+- * the SoC. The ethernet switch has a "wan" port.
+- */
+-
+-/dts-v1/;
+-
+-#include "kirkwood-rd88f6281.dtsi"
+-
+-/ {
+- model = "Marvell RD88f6281 Reference design, with A1 SoC";
+- compatible = "marvell,rd88f6281-a1", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood";
+-
+- dsa@0 {
+- switch@0 {
+- reg = <0 0>; /* MDIO address 0, switch 0 in tree */
+- port@4 {
+- reg = <4>;
+- label = "wan";
+- };
+- };
+- };
+-};
+\ No newline at end of file
+--- /dev/null
++++ b/arch/arm/boot/dts/kirkwood-rd88f6281-z0.dts
+@@ -0,0 +1,35 @@
++/*
++ * Marvell RD88F6181 Z0 stepping descrition
++ *
++ * Andrew Lunn <andrew@lunn.ch>
++ *
++ * 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.
++ *
++ * This file contains the definitions for the board using the Z0
++ * stepping of the SoC. The ethernet switch has a "wan" port.
++*/
++
++/dts-v1/;
++
++#include "kirkwood-rd88f6281.dtsi"
++
++/ {
++ model = "Marvell RD88f6281 Reference design, with Z0 SoC";
++ compatible = "marvell,rd88f6281-z0", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood";
++
++ dsa@0 {
++ switch@0 {
++ reg = <0 0>; /* MDIO address 0, switch 0 in tree */
++ port@4 {
++ reg = <4>;
++ label = "wan";
++ };
++ };
++ };
++};
++
++ð1 {
++ status = "disabled";
++};
+--- a/arch/arm/boot/dts/kirkwood-rd88f6281.dtsi
++++ b/arch/arm/boot/dts/kirkwood-rd88f6281.dtsi
+@@ -37,7 +37,6 @@
+
+ ocp@f1000000 {
+ pinctrl: pin-controller@10000 {
+- pinctrl-0 = <&pmx_sdio_cd>;
+ pinctrl-names = "default";
+
+ pmx_sdio_cd: pmx-sdio-cd {
+@@ -69,8 +68,8 @@
+ #address-cells = <2>;
+ #size-cells = <0>;
+
+- dsa,ethernet = <ð0>;
+- dsa,mii-bus = <ðphy1>;
++ dsa,ethernet = <ð0port>;
++ dsa,mii-bus = <&mdio>;
+
+ switch@0 {
+ #address-cells = <1>;
+@@ -119,35 +118,19 @@
+ };
+
+ partition@300000 {
+- label = "data";
++ label = "rootfs";
+ reg = <0x0300000 0x500000>;
+ };
+ };
+
+ &mdio {
+ status = "okay";
+-
+- ethphy0: ethernet-phy@0 {
+- reg = <0>;
+- };
+-
+- ethphy1: ethernet-phy@ff {
+- reg = <0xff>; /* No PHY attached */
+- speed = <1000>;
+- duple = <1>;
+- };
+ };
+
+ ð0 {
+ status = "okay";
+ ethernet0-port@0 {
+- phy-handle = <ðphy0>;
+- };
+-};
+-
+-ð1 {
+- status = "okay";
+- ethernet1-port@0 {
+- phy-handle = <ðphy1>;
++ speed = <1000>;
++ duplex = <1>;
+ };
+ };
+--- a/arch/arm/boot/dts/kirkwood.dtsi
++++ b/arch/arm/boot/dts/kirkwood.dtsi
+@@ -309,7 +309,7 @@
+ marvell,tx-checksum-limit = <1600>;
+ status = "disabled";
+
+- ethernet0-port@0 {
++ eth0port: ethernet0-port@0 {
+ compatible = "marvell,kirkwood-eth-port";
+ reg = <0>;
+ interrupts = <11>;
+@@ -342,7 +342,7 @@
+ pinctrl-names = "default";
+ status = "disabled";
+
+- ethernet1-port@0 {
++ eth1port: ethernet1-port@0 {
+ compatible = "marvell,kirkwood-eth-port";
+ reg = <0>;
+ interrupts = <15>;
--- /dev/null
+From ace8578182dc347b043c0825b9873f62fdaa5b77 Mon Sep 17 00:00:00 2001
+From: "klightspeed@killerwolves.net" <klightspeed@killerwolves.net>
+Date: Wed, 10 Sep 2014 18:55:41 +1000
+Subject: ARM: mvebu: Netgear RN102: Use Hardware BCH ECC
+
+From: "klightspeed@killerwolves.net" <klightspeed@killerwolves.net>
+
+commit ace8578182dc347b043c0825b9873f62fdaa5b77 upstream.
+
+The bootloader on the Netgear ReadyNAS RN102 uses Hardware BCH ECC
+(strength = 4), while the pxa3xx NAND driver by default uses
+Hamming ECC (strength = 1).
+
+This patch changes the ECC mode on these machines to match that
+of the bootloader and of the stock firmware. That way, it is
+now possible to update the kernel from userland (e.g. using
+standard tools from mtd-utils package); u-boot will happily
+load and boot it.
+
+Fixes: 92beaccd8b49 ("ARM: mvebu: Enable NAND controller in ReadyNAS 102 .dts file")
+Signed-off-by: Ben Peddell <klightspeed@killerwolves.net>
+Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
+Tested-by: Arnaud Ebalard <arno@natisbad.org>
+Link: https://lkml.kernel.org/r/1410339341-3372-1-git-send-email-klightspeed@killerwolves.net
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/armada-370-netgear-rn102.dts | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-370-netgear-rn102.dts
++++ b/arch/arm/boot/dts/armada-370-netgear-rn102.dts
+@@ -143,6 +143,10 @@
+ marvell,nand-enable-arbiter;
+ nand-on-flash-bbt;
+
++ /* Use Hardware BCH ECC */
++ nand-ecc-strength = <4>;
++ nand-ecc-step-size = <512>;
++
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0000000 0x180000>; /* 1.5MB */
--- /dev/null
+From 225b94cdf719d0bc522a354bdafc18e5da5ff83b Mon Sep 17 00:00:00 2001
+From: Arnaud Ebalard <arno@natisbad.org>
+Date: Sat, 6 Sep 2014 22:49:25 +0200
+Subject: ARM: mvebu: Netgear RN104: Use Hardware BCH ECC
+
+From: Arnaud Ebalard <arno@natisbad.org>
+
+commit 225b94cdf719d0bc522a354bdafc18e5da5ff83b upstream.
+
+The bootloader on the Netgear ReadyNAS RN104 uses Hardware BCH
+ECC (strength = 4), while the pxa3xx NAND driver by default uses
+Hamming ECC (strength = 1).
+
+This patch changes the ECC mode on these machines to match that
+of the bootloader and of the stock firmware. That way, it is
+now possible to update the kernel from userland (e.g. using
+standard tools from mtd-utils package); u-boot will happily
+load and boot it.
+
+The issue was initially reported and fixed by Ben Pedell for
+RN102. The RN104 shares the same Hynix H27U1G8F2BTR NAND
+flash and setup. This patch is based on Ben's fix for RN102.
+
+Fixes: 0373a558bd79 ("ARM: mvebu: Enable NAND controller in ReadyNAS 104 .dts file")
+Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
+Link: https://lkml.kernel.org/r/920c7e7169dc6aaaa3eb4bced2336d38e77b8864.1410035142.git.arno@natisbad.org
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/armada-370-netgear-rn104.dts | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-370-netgear-rn104.dts
++++ b/arch/arm/boot/dts/armada-370-netgear-rn104.dts
+@@ -145,6 +145,10 @@
+ marvell,nand-enable-arbiter;
+ nand-on-flash-bbt;
+
++ /* Use Hardware BCH ECC */
++ nand-ecc-strength = <4>;
++ nand-ecc-step-size = <512>;
++
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0000000 0x180000>; /* 1.5MB */
--- /dev/null
+From 500abb6ccb9e3f8d638a7f422443a8549245ef90 Mon Sep 17 00:00:00 2001
+From: Arnaud Ebalard <arno@natisbad.org>
+Date: Sat, 6 Sep 2014 22:49:38 +0200
+Subject: ARM: mvebu: Netgear RN2120: Use Hardware BCH ECC
+
+From: Arnaud Ebalard <arno@natisbad.org>
+
+commit 500abb6ccb9e3f8d638a7f422443a8549245ef90 upstream.
+
+The bootloader on the Netgear ReadyNAS RN2120 uses Hardware BCH
+ECC (strength = 4), while the pxa3xx NAND driver by default uses
+Hamming ECC (strength = 1).
+
+This patch changes the ECC mode on these machines to match that
+of the bootloader and of the stock firmware. That way, it is
+now possible to update the kernel from userland (e.g. using
+standard tools from mtd-utils package); u-boot will happily
+load and boot it.
+
+The issue was initially reported and fixed by Ben Pedell for
+RN102. The RN2120 shares the same Hynix H27U1G8F2BTR NAND
+flash and setup. This patch is based on Ben's fix for RN102.
+
+Fixes: ad51eddd95ad ("ARM: mvebu: Enable NAND controller in ReadyNAS 2120 .dts file")
+Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
+Link: https://lkml.kernel.org/r/61f6a1b7ad0adc57a0e201b9680bc2e5f214a317.1410035142.git.arno@natisbad.org
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
++++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
+@@ -223,6 +223,10 @@
+ marvell,nand-enable-arbiter;
+ nand-on-flash-bbt;
+
++ /* Use Hardware BCH ECC */
++ nand-ecc-strength = <4>;
++ nand-ecc-step-size = <512>;
++
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0000000 0x180000>; /* 1.5MB */
--- /dev/null
+From 971a5b6fe634bb7b617d8c5f25b6a3ddbc600194 Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <victor.kamensky@linaro.org>
+Date: Tue, 14 Oct 2014 06:55:05 +0100
+Subject: arm64: compat: fix compat types affecting struct
+ compat_elf_prpsinfo
+
+From: Victor Kamensky <victor.kamensky@linaro.org>
+
+commit 971a5b6fe634bb7b617d8c5f25b6a3ddbc600194 upstream.
+
+The compat_elf_prpsinfo structure does not match the arch/arm struct
+elf_pspsinfo definition. As result NT_PRPSINFO note in core file
+created by arm64 kernel for aarch32 (compat) process has wrong size.
+So gdb cannot display command that caused process crash.
+
+Fix is to change size of __compat_uid_t, __compat_gid_t so it would
+match size of similar fields in arch/arm case.
+
+Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm64/include/asm/compat.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/arm64/include/asm/compat.h
++++ b/arch/arm64/include/asm/compat.h
+@@ -37,8 +37,8 @@ typedef s32 compat_ssize_t;
+ typedef s32 compat_time_t;
+ typedef s32 compat_clock_t;
+ typedef s32 compat_pid_t;
+-typedef u32 __compat_uid_t;
+-typedef u32 __compat_gid_t;
++typedef u16 __compat_uid_t;
++typedef u16 __compat_gid_t;
+ typedef u16 __compat_uid16_t;
+ typedef u16 __compat_gid16_t;
+ typedef u32 __compat_uid32_t;
--- /dev/null
+From 35425ea2492175fd39f6116481fe98b2b3ddd4ca Mon Sep 17 00:00:00 2001
+From: Chao Yu <chao2.yu@samsung.com>
+Date: Thu, 24 Jul 2014 17:25:42 +0800
+Subject: ecryptfs: avoid to access NULL pointer when write metadata in xattr
+
+From: Chao Yu <chao2.yu@samsung.com>
+
+commit 35425ea2492175fd39f6116481fe98b2b3ddd4ca upstream.
+
+Christopher Head 2014-06-28 05:26:20 UTC described:
+"I tried to reproduce this on 3.12.21. Instead, when I do "echo hello > foo"
+in an ecryptfs mount with ecryptfs_xattr specified, I get a kernel crash:
+
+BUG: unable to handle kernel NULL pointer dereference at (null)
+IP: [<ffffffff8110eb39>] fsstack_copy_attr_all+0x2/0x61
+PGD d7840067 PUD b2c3c067 PMD 0
+Oops: 0002 [#1] SMP
+Modules linked in: nvidia(PO)
+CPU: 3 PID: 3566 Comm: bash Tainted: P O 3.12.21-gentoo-r1 #2
+Hardware name: ASUSTek Computer Inc. G60JX/G60JX, BIOS 206 03/15/2010
+task: ffff8801948944c0 ti: ffff8800bad70000 task.ti: ffff8800bad70000
+RIP: 0010:[<ffffffff8110eb39>] [<ffffffff8110eb39>] fsstack_copy_attr_all+0x2/0x61
+RSP: 0018:ffff8800bad71c10 EFLAGS: 00010246
+RAX: 00000000000181a4 RBX: ffff880198648480 RCX: 0000000000000000
+RDX: 0000000000000004 RSI: ffff880172010450 RDI: 0000000000000000
+RBP: ffff880198490e40 R08: 0000000000000000 R09: 0000000000000000
+R10: ffff880172010450 R11: ffffea0002c51e80 R12: 0000000000002000
+R13: 000000000000001a R14: 0000000000000000 R15: ffff880198490e40
+FS: 00007ff224caa700(0000) GS:ffff88019fcc0000(0000) knlGS:0000000000000000
+CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 0000000000000000 CR3: 00000000bb07f000 CR4: 00000000000007e0
+Stack:
+ffffffff811826e8 ffff8800a39d8000 0000000000000000 000000000000001a
+ffff8800a01d0000 ffff8800a39d8000 ffffffff81185fd5 ffffffff81082c2c
+00000001a39d8000 53d0abbc98490e40 0000000000000037 ffff8800a39d8220
+Call Trace:
+[<ffffffff811826e8>] ? ecryptfs_setxattr+0x40/0x52
+[<ffffffff81185fd5>] ? ecryptfs_write_metadata+0x1b3/0x223
+[<ffffffff81082c2c>] ? should_resched+0x5/0x23
+[<ffffffff8118322b>] ? ecryptfs_initialize_file+0xaf/0xd4
+[<ffffffff81183344>] ? ecryptfs_create+0xf4/0x142
+[<ffffffff810f8c0d>] ? vfs_create+0x48/0x71
+[<ffffffff810f9c86>] ? do_last.isra.68+0x559/0x952
+[<ffffffff810f7ce7>] ? link_path_walk+0xbd/0x458
+[<ffffffff810fa2a3>] ? path_openat+0x224/0x472
+[<ffffffff810fa7bd>] ? do_filp_open+0x2b/0x6f
+[<ffffffff81103606>] ? __alloc_fd+0xd6/0xe7
+[<ffffffff810ee6ab>] ? do_sys_open+0x65/0xe9
+[<ffffffff8157d022>] ? system_call_fastpath+0x16/0x1b
+RIP [<ffffffff8110eb39>] fsstack_copy_attr_all+0x2/0x61
+RSP <ffff8800bad71c10>
+CR2: 0000000000000000
+---[ end trace df9dba5f1ddb8565 ]---"
+
+If we create a file when we mount with ecryptfs_xattr_metadata option, we will
+encounter a crash in this path:
+->ecryptfs_create
+ ->ecryptfs_initialize_file
+ ->ecryptfs_write_metadata
+ ->ecryptfs_write_metadata_to_xattr
+ ->ecryptfs_setxattr
+ ->fsstack_copy_attr_all
+It's because our dentry->d_inode used in fsstack_copy_attr_all is NULL, and it
+will be initialized when ecryptfs_initialize_file finish.
+
+So we should skip copying attr from lower inode when the value of ->d_inode is
+invalid.
+
+Signed-off-by: Chao Yu <chao2.yu@samsung.com>
+Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ecryptfs/inode.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/ecryptfs/inode.c
++++ b/fs/ecryptfs/inode.c
+@@ -1039,7 +1039,7 @@ ecryptfs_setxattr(struct dentry *dentry,
+ }
+
+ rc = vfs_setxattr(lower_dentry, name, value, size, flags);
+- if (!rc)
++ if (!rc && dentry->d_inode)
+ fsstack_copy_attr_all(dentry->d_inode, lower_dentry->d_inode);
+ out:
+ return rc;
powerpc-eeh-clear-frozen-device-state-in-time.patch
ima-fix-fallback-to-use-new_sync_read.patch
ima-provide-flag-to-identify-new-empty-files.patch
+arm64-compat-fix-compat-types-affecting-struct.patch
+alsa-pcm-use-the-same-dma-mmap-codepath-both-for-arm-and-arm64.patch
+alsa-bebob-fix-failure-to-detect-source-of-clock-for-terratec-phase-88.patch
+alsa-emu10k1-fix-deadlock-in-synth-voice-lookup.patch
+alsa-alc283-codec-avoid-pop-noise-on-headphones-during-suspend-resume.patch
+alsa-usb-audio-add-support-for-steinberg-ur22-usb-interface.patch
+alsa-hda-hdmi-fix-missing-eld-change-event-on-plug-unplug.patch
+alsa-hda-fix-inverted-led-gpio-setup-for-lenovo-ideapad.patch
+alsa-hda-add-missing-terminating-entry-to-snd_hda_pin_quirk-macro.patch
+arm-at91-dt-fix-typo-regarding-can0_clk.patch
+arm-at91-fix-at91sam9263ek-dt-mmc-pinmuxing-settings.patch
+arm-at91-pmc-don-t-forget-to-write-pmc_pcdr-register-to-disable-clocks.patch
+arm-kirkwood-fix-dt-based-dsa.patch
+arm-mvebu-netgear-rn104-use-hardware-bch-ecc.patch
+arm-mvebu-netgear-rn2120-use-hardware-bch-ecc.patch
+arm-mvebu-netgear-rn102-use-hardware-bch-ecc.patch
+arm-dts-imx28-evk-let-i2c0-run-at-100khz.patch
+ecryptfs-avoid-to-access-null-pointer-when-write-metadata-in-xattr.patch
+xfs-ensure-wb_sync_all-writeback-handles-partial-pages-correctly.patch
--- /dev/null
+From 0d085a529b427d97710e6a41f8a4f23e1757cd12 Mon Sep 17 00:00:00 2001
+From: Dave Chinner <dchinner@redhat.com>
+Date: Tue, 23 Sep 2014 15:36:27 +1000
+Subject: xfs: ensure WB_SYNC_ALL writeback handles partial pages correctly
+
+From: Dave Chinner <dchinner@redhat.com>
+
+commit 0d085a529b427d97710e6a41f8a4f23e1757cd12 upstream.
+
+XFS has been having trouble with stray delayed allocation extents
+beyond EOF for a long time. Recent changes to the collapse range
+code has triggered erroneous EBUSY errors on page invalidtion for
+block size smaller than page size filesystems. These
+have been caused by dirty buffers beyond EOF on a partial page which
+do not get written to disk during a sync.
+
+The issue is that write-ahead in xfs_cluster_write() finds such a
+partial page and handles it by leaving the page dirty but pushing it
+into a writeback state. This used to work just fine, as the
+write_cache_pages() code would then find the dirty partial page in
+the next mapping tree lookup as the dirty tag is still set.
+
+Unfortunately, when we moved to a mark and sweep approach to
+writeback to fix other writeback sync issues, we broken this. THe
+act of marking the page as under writeback now clears the TOWRITE
+tag in the radix tree, even though the page is still dirty. This
+causes the TOWRITE tag to be cleared, and hence the next lookup on
+the mapping tree does not find the dirty partial page and so doesn't
+try to write it again.
+
+This same writeback bug was found recently in ext4 and fixed in
+commit 1c8349a ("ext4: fix data integrity sync in ordered mode")
+without communication to the wider filesystem community. We can use
+exactly the same fix here so the TOWRITE flag is not cleared on
+partial page writes.
+
+cc: stable@vger.kernel.org # dependent on 1c8349a17137b93f0a83f276c764a6df1b9a116e
+Root-cause-found-by: Brian Foster <bfoster@redhat.com>
+Signed-off-by: Dave Chinner <dchinner@redhat.com>
+Reviewed-by: Brian Foster <bfoster@redhat.com>
+Signed-off-by: Dave Chinner <david@fromorbit.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/xfs/xfs_aops.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+--- a/fs/xfs/xfs_aops.c
++++ b/fs/xfs/xfs_aops.c
+@@ -434,10 +434,22 @@ xfs_start_page_writeback(
+ {
+ ASSERT(PageLocked(page));
+ ASSERT(!PageWriteback(page));
+- if (clear_dirty)
++
++ /*
++ * if the page was not fully cleaned, we need to ensure that the higher
++ * layers come back to it correctly. That means we need to keep the page
++ * dirty, and for WB_SYNC_ALL writeback we need to ensure the
++ * PAGECACHE_TAG_TOWRITE index mark is not removed so another attempt to
++ * write this page in this writeback sweep will be made.
++ */
++ if (clear_dirty) {
+ clear_page_dirty_for_io(page);
+- set_page_writeback(page);
++ set_page_writeback(page);
++ } else
++ set_page_writeback_keepwrite(page);
++
+ unlock_page(page);
++
+ /* If no buffers on the page are to be written, finish it here */
+ if (!buffers)
+ end_page_writeback(page);