--- /dev/null
+From ed697e1aaf7237b1a62af39f64463b05c262808d Mon Sep 17 00:00:00 2001
+From: JongHo Kim <furmuwon@gmail.com>
+Date: Tue, 17 Dec 2013 23:02:24 +0900
+Subject: ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function
+
+From: JongHo Kim <furmuwon@gmail.com>
+
+commit ed697e1aaf7237b1a62af39f64463b05c262808d upstream.
+
+When the process is sleeping at the SNDRV_PCM_STATE_PAUSED
+state from the wait_for_avail function, the sleep process will be woken by
+timeout(10 seconds). Even if the sleep process wake up by timeout, by this
+patch, the process will continue with sleep and wait for the other state.
+
+Signed-off-by: JongHo Kim <furmuwon@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/pcm_lib.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/sound/core/pcm_lib.c
++++ b/sound/core/pcm_lib.c
+@@ -1937,6 +1937,8 @@ static int wait_for_avail(struct snd_pcm
+ case SNDRV_PCM_STATE_DISCONNECTED:
+ err = -EBADFD;
+ goto _endloop;
++ case SNDRV_PCM_STATE_PAUSED:
++ continue;
+ }
+ if (!tout) {
+ snd_printd("%s write error (DMA or IRQ trouble?)\n",
--- /dev/null
+From 241bf43321a10815225f477bba96a42285a2da73 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@nvidia.com>
+Date: Fri, 6 Dec 2013 13:34:50 -0700
+Subject: ASoC: tegra: fix uninitialized variables in set_fmt
+
+From: Stephen Warren <swarren@nvidia.com>
+
+commit 241bf43321a10815225f477bba96a42285a2da73 upstream.
+
+In tegra*_i2s_set_fmt(), in the (fmt == SND_SOC_DAIFMT_CBM_CFM) case,
+"val" is never assigned to, but left uninitialized. The other case does
+initialized it. Fix this by initializing val at the start of the
+function, and only ever ORing into it.
+
+Update the handling of "mask" so it works the same way for consistency.
+
+Update tegra20_spdif.c to use the same code-style for consistency, even
+though it doesn't happen to suffer from the same problem at present.
+
+Signed-off-by: Stephen Warren <swarren@nvidia.com>
+Reviewed-by: Thierry Reding <treding@nvidia.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Fixes: 0f163546a772 ("ASoC: tegra: use regmap more directly")
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/tegra/tegra20_i2s.c | 6 +++---
+ sound/soc/tegra/tegra20_spdif.c | 10 +++++-----
+ sound/soc/tegra/tegra30_i2s.c | 6 +++---
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+--- a/sound/soc/tegra/tegra20_i2s.c
++++ b/sound/soc/tegra/tegra20_i2s.c
+@@ -74,7 +74,7 @@ static int tegra20_i2s_set_fmt(struct sn
+ unsigned int fmt)
+ {
+ struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+- unsigned int mask, val;
++ unsigned int mask = 0, val = 0;
+
+ switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+ case SND_SOC_DAIFMT_NB_NF:
+@@ -83,10 +83,10 @@ static int tegra20_i2s_set_fmt(struct sn
+ return -EINVAL;
+ }
+
+- mask = TEGRA20_I2S_CTRL_MASTER_ENABLE;
++ mask |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBS_CFS:
+- val = TEGRA20_I2S_CTRL_MASTER_ENABLE;
++ val |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
+ break;
+ case SND_SOC_DAIFMT_CBM_CFM:
+ break;
+--- a/sound/soc/tegra/tegra20_spdif.c
++++ b/sound/soc/tegra/tegra20_spdif.c
+@@ -67,15 +67,15 @@ static int tegra20_spdif_hw_params(struc
+ {
+ struct device *dev = dai->dev;
+ struct tegra20_spdif *spdif = snd_soc_dai_get_drvdata(dai);
+- unsigned int mask, val;
++ unsigned int mask = 0, val = 0;
+ int ret, spdifclock;
+
+- mask = TEGRA20_SPDIF_CTRL_PACK |
+- TEGRA20_SPDIF_CTRL_BIT_MODE_MASK;
++ mask |= TEGRA20_SPDIF_CTRL_PACK |
++ TEGRA20_SPDIF_CTRL_BIT_MODE_MASK;
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+- val = TEGRA20_SPDIF_CTRL_PACK |
+- TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT;
++ val |= TEGRA20_SPDIF_CTRL_PACK |
++ TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT;
+ break;
+ default:
+ return -EINVAL;
+--- a/sound/soc/tegra/tegra30_i2s.c
++++ b/sound/soc/tegra/tegra30_i2s.c
+@@ -117,7 +117,7 @@ static int tegra30_i2s_set_fmt(struct sn
+ unsigned int fmt)
+ {
+ struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+- unsigned int mask, val;
++ unsigned int mask = 0, val = 0;
+
+ switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+ case SND_SOC_DAIFMT_NB_NF:
+@@ -126,10 +126,10 @@ static int tegra30_i2s_set_fmt(struct sn
+ return -EINVAL;
+ }
+
+- mask = TEGRA30_I2S_CTRL_MASTER_ENABLE;
++ mask |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBS_CFS:
+- val = TEGRA30_I2S_CTRL_MASTER_ENABLE;
++ val |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
+ break;
+ case SND_SOC_DAIFMT_CBM_CFM:
+ break;
--- /dev/null
+From 280484e708a3cc38fe6807718caa460e744c0b20 Mon Sep 17 00:00:00 2001
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Date: Tue, 17 Dec 2013 13:16:16 +0000
+Subject: ASoC: wm5110: Correct HPOUT3 DAPM route typo
+
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+
+commit 280484e708a3cc38fe6807718caa460e744c0b20 upstream.
+
+Reported-by: Kyung-Kwee Ryu <kyung-kwee.ryu@wolfsonmicro.com>
+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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/wm5110.c
++++ b/sound/soc/codecs/wm5110.c
+@@ -1031,7 +1031,7 @@ static const struct snd_soc_dapm_route w
+ { "HPOUT2R", NULL, "OUT2R" },
+
+ { "HPOUT3L", NULL, "OUT3L" },
+- { "HPOUT3R", NULL, "OUT3L" },
++ { "HPOUT3R", NULL, "OUT3R" },
+
+ { "SPKOUTLN", NULL, "OUT4L" },
+ { "SPKOUTLP", NULL, "OUT4L" },
--- /dev/null
+From f0199bc5e3a3ec13f9bc938556517ec430b36437 Mon Sep 17 00:00:00 2001
+From: Bo Shen <voice.shen@atmel.com>
+Date: Wed, 18 Dec 2013 11:26:23 +0800
+Subject: ASoC: wm8904: fix DSP mode B configuration
+
+From: Bo Shen <voice.shen@atmel.com>
+
+commit f0199bc5e3a3ec13f9bc938556517ec430b36437 upstream.
+
+When wm8904 work in DSP mode B, we still need to configure it to
+work in DSP mode. Or else, it will work in Right Justified mode.
+
+Signed-off-by: Bo Shen <voice.shen@atmel.com>
+Acked-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/wm8904.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/wm8904.c
++++ b/sound/soc/codecs/wm8904.c
+@@ -1443,7 +1443,7 @@ static int wm8904_set_fmt(struct snd_soc
+
+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+ case SND_SOC_DAIFMT_DSP_B:
+- aif1 |= WM8904_AIF_LRCLK_INV;
++ aif1 |= 0x3 | WM8904_AIF_LRCLK_INV;
+ case SND_SOC_DAIFMT_DSP_A:
+ aif1 |= 0x3;
+ break;
--- /dev/null
+From 939fd1e8d9deff206f12bd9d4e54aa7a4bd0ffd6 Mon Sep 17 00:00:00 2001
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Date: Wed, 18 Dec 2013 09:25:49 +0000
+Subject: ASoC: wm_adsp: Add small delay while polling DSP RAM start
+
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+
+commit 939fd1e8d9deff206f12bd9d4e54aa7a4bd0ffd6 upstream.
+
+Some devices are getting very close to the limit whilst polling the RAM
+start, this patch adds a small delay to this loop to give a longer
+startup timeout.
+
+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/wm_adsp.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/sound/soc/codecs/wm_adsp.c
++++ b/sound/soc/codecs/wm_adsp.c
+@@ -1466,13 +1466,17 @@ static int wm_adsp2_ena(struct wm_adsp *
+ return ret;
+
+ /* Wait for the RAM to start, should be near instantaneous */
+- count = 0;
+- do {
++ for (count = 0; count < 10; ++count) {
+ ret = regmap_read(dsp->regmap, dsp->base + ADSP2_STATUS1,
+ &val);
+ if (ret != 0)
+ return ret;
+- } while (!(val & ADSP2_RAM_RDY) && ++count < 10);
++
++ if (val & ADSP2_RAM_RDY)
++ break;
++
++ msleep(1);
++ }
+
+ if (!(val & ADSP2_RAM_RDY)) {
+ adsp_err(dsp, "Failed to start DSP RAM\n");
--- /dev/null
+From c97102ba96324da330078ad8619ba4dfe840dbe3 Mon Sep 17 00:00:00 2001
+From: Vivek Goyal <vgoyal@redhat.com>
+Date: Wed, 18 Dec 2013 17:08:31 -0800
+Subject: kexec: migrate to reboot cpu
+
+From: Vivek Goyal <vgoyal@redhat.com>
+
+commit c97102ba96324da330078ad8619ba4dfe840dbe3 upstream.
+
+Commit 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic
+kernel") moved reboot= handling to generic code. In the process it also
+removed the code in native_machine_shutdown() which are moving reboot
+process to reboot_cpu/cpu0.
+
+I guess that thought must have been that all reboot paths are calling
+migrate_to_reboot_cpu(), so we don't need this special handling. But
+kexec reboot path (kernel_kexec()) is not calling
+migrate_to_reboot_cpu() so above change broke kexec. Now reboot can
+happen on non-boot cpu and when INIT is sent in second kerneo to bring
+up BP, it brings down the machine.
+
+So start calling migrate_to_reboot_cpu() in kexec reboot path to avoid
+this problem.
+
+Bisected by WANG Chao.
+
+Reported-by: Matthew Whitehead <mwhitehe@redhat.com>
+Reported-by: Dave Young <dyoung@redhat.com>
+Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
+Tested-by: Baoquan He <bhe@redhat.com>
+Tested-by: WANG Chao <chaowang@redhat.com>
+Acked-by: H. Peter Anvin <hpa@linux.intel.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>
+
+---
+ include/linux/reboot.h | 1 +
+ kernel/kexec.c | 1 +
+ kernel/reboot.c | 2 +-
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+
+--- a/include/linux/reboot.h
++++ b/include/linux/reboot.h
+@@ -43,6 +43,7 @@ extern int unregister_reboot_notifier(st
+ * Architecture-specific implementations of sys_reboot commands.
+ */
+
++extern void migrate_to_reboot_cpu(void);
+ extern void machine_restart(char *cmd);
+ extern void machine_halt(void);
+ extern void machine_power_off(void);
+--- a/kernel/kexec.c
++++ b/kernel/kexec.c
+@@ -1680,6 +1680,7 @@ int kernel_kexec(void)
+ {
+ kexec_in_progress = true;
+ kernel_restart_prepare(NULL);
++ migrate_to_reboot_cpu();
+ printk(KERN_EMERG "Starting new kernel\n");
+ machine_shutdown();
+ }
+--- a/kernel/reboot.c
++++ b/kernel/reboot.c
+@@ -104,7 +104,7 @@ int unregister_reboot_notifier(struct no
+ }
+ EXPORT_SYMBOL(unregister_reboot_notifier);
+
+-static void migrate_to_reboot_cpu(void)
++void migrate_to_reboot_cpu(void)
+ {
+ /* The boot cpu is always logical cpu 0 */
+ int cpu = reboot_cpu;
tty-fix-hang-at-ldsem_down_read.patch
n_tty-fix-apparent-order-of-echoed-output.patch
tty-pmac_zilog-check-existence-of-ports-in-pmz_console_init.patch
+staging-comedi-8255_pci-fix-for-newer-pci-dio48h.patch
+staging-comedi-drivers-fix-return-value-of-comedi_load_firmware.patch
+kexec-migrate-to-reboot-cpu.patch
+asoc-tegra-fix-uninitialized-variables-in-set_fmt.patch
+asoc-wm8904-fix-dsp-mode-b-configuration.patch
+asoc-wm_adsp-add-small-delay-while-polling-dsp-ram-start.patch
+asoc-wm5110-correct-hpout3-dapm-route-typo.patch
+alsa-add-sndrv_pcm_state_paused-case-in-wait_for_avail-function.patch
--- /dev/null
+From 0283f7a100882684ad32b768f9f1ad81658a0b92 Mon Sep 17 00:00:00 2001
+From: Ian Abbott <abbotti@mev.co.uk>
+Date: Fri, 13 Dec 2013 12:00:30 +0000
+Subject: staging: comedi: 8255_pci: fix for newer PCI-DIO48H
+
+From: Ian Abbott <abbotti@mev.co.uk>
+
+commit 0283f7a100882684ad32b768f9f1ad81658a0b92 upstream.
+
+At some point, Measurement Computing / ComputerBoards redesigned the
+PCI-DIO48H to use a PLX PCI interface chip instead of an AMCC chip.
+This meant they had to put their hardware registers in the PCI BAR 2
+region instead of PCI BAR 1. Unfortunately, they kept the same PCI
+device ID for the new design. This means the driver recognizes the
+newer cards, but doesn't work (and is likely to screw up the local
+configuration registers of the PLX chip) because it's using the wrong
+region.
+
+Since the PCI subvendor and subdevice IDs were both zero on the old
+design, but are the same as the vendor and device on the new design, we
+can tell the old design and new design apart easily enough. Split the
+existing entry for the PCI-DIO48H in `pci_8255_boards[]` into two new
+entries, referenced by different entries in the PCI device ID table
+`pci_8255_pci_table[]`. Use the same board name for both entries.
+
+Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
+Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/drivers/8255_pci.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+--- a/drivers/staging/comedi/drivers/8255_pci.c
++++ b/drivers/staging/comedi/drivers/8255_pci.c
+@@ -63,7 +63,8 @@ enum pci_8255_boardid {
+ BOARD_ADLINK_PCI7296,
+ BOARD_CB_PCIDIO24,
+ BOARD_CB_PCIDIO24H,
+- BOARD_CB_PCIDIO48H,
++ BOARD_CB_PCIDIO48H_OLD,
++ BOARD_CB_PCIDIO48H_NEW,
+ BOARD_CB_PCIDIO96H,
+ BOARD_NI_PCIDIO96,
+ BOARD_NI_PCIDIO96B,
+@@ -106,11 +107,16 @@ static const struct pci_8255_boardinfo p
+ .dio_badr = 2,
+ .n_8255 = 1,
+ },
+- [BOARD_CB_PCIDIO48H] = {
++ [BOARD_CB_PCIDIO48H_OLD] = {
+ .name = "cb_pci-dio48h",
+ .dio_badr = 1,
+ .n_8255 = 2,
+ },
++ [BOARD_CB_PCIDIO48H_NEW] = {
++ .name = "cb_pci-dio48h",
++ .dio_badr = 2,
++ .n_8255 = 2,
++ },
+ [BOARD_CB_PCIDIO96H] = {
+ .name = "cb_pci-dio96h",
+ .dio_badr = 2,
+@@ -263,7 +269,10 @@ static DEFINE_PCI_DEVICE_TABLE(pci_8255_
+ { PCI_VDEVICE(ADLINK, 0x7296), BOARD_ADLINK_PCI7296 },
+ { PCI_VDEVICE(CB, 0x0028), BOARD_CB_PCIDIO24 },
+ { PCI_VDEVICE(CB, 0x0014), BOARD_CB_PCIDIO24H },
+- { PCI_VDEVICE(CB, 0x000b), BOARD_CB_PCIDIO48H },
++ { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, 0x0000, 0x0000),
++ .driver_data = BOARD_CB_PCIDIO48H_OLD },
++ { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, PCI_VENDOR_ID_CB, 0x000b),
++ .driver_data = BOARD_CB_PCIDIO48H_NEW },
+ { PCI_VDEVICE(CB, 0x0017), BOARD_CB_PCIDIO96H },
+ { PCI_VDEVICE(NI, 0x0160), BOARD_NI_PCIDIO96 },
+ { PCI_VDEVICE(NI, 0x1630), BOARD_NI_PCIDIO96B },
--- /dev/null
+From c6236c0ce39c809c336ca929f68cf8ad02cf94e0 Mon Sep 17 00:00:00 2001
+From: H Hartley Sweeten <hsweeten@visionengravers.com>
+Date: Tue, 10 Dec 2013 16:31:25 -0700
+Subject: staging: comedi: drivers: fix return value of comedi_load_firmware()
+
+From: H Hartley Sweeten <hsweeten@visionengravers.com>
+
+commit c6236c0ce39c809c336ca929f68cf8ad02cf94e0 upstream.
+
+Some of the callback functions that upload the firmware in the comedi
+drivers return a positive value indicating the number of bytes sent
+to the device. Detect this condition and just return '0' to indicate
+a successful upload.
+
+Reported-by: Bernd Porr <mail@berndporr.me.uk>
+Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
+Acked-by: Ian Abbott <abbotti@mev.co.uk>
+Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/comedi/drivers.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/comedi/drivers.c
++++ b/drivers/staging/comedi/drivers.c
+@@ -417,7 +417,7 @@ int comedi_load_firmware(struct comedi_d
+ release_firmware(fw);
+ }
+
+- return ret;
++ return ret < 0 ? ret : 0;
+ }
+ EXPORT_SYMBOL_GPL(comedi_load_firmware);
+