--- /dev/null
+From 231f9415001138a000cd0f881c46654b7ea3f8c5 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Mon, 9 Jul 2018 14:03:55 +0200
+Subject: ACPI / PM: save NVS memory for ASUS 1025C laptop
+
+From: Willy Tarreau <w@1wt.eu>
+
+commit 231f9415001138a000cd0f881c46654b7ea3f8c5 upstream.
+
+Every time I tried to upgrade my laptop from 3.10.x to 4.x I faced an
+issue by which the fan would run at full speed upon resume. Bisecting
+it showed me the issue was introduced in 3.17 by commit 821d6f0359b0
+(ACPI / sleep: Do not save NVS for new machines to accelerate S3). This
+code only affects machines built starting as of 2012, but this Asus
+1025C laptop was made in 2012 and apparently needs the NVS data to be
+saved, otherwise the CPU's thermal state is not properly reported on
+resume and the fan runs at full speed upon resume.
+
+Here's a very simple way to check if such a machine is affected :
+
+ # cat /sys/class/thermal/thermal_zone0/temp
+ 55000
+
+ ( now suspend, wait one second and resume )
+
+ # cat /sys/class/thermal/thermal_zone0/temp
+ 0
+
+ (and after ~15 seconds the fan starts to spin)
+
+Let's apply the same quirk as commit cbc00c13 (ACPI: save NVS memory
+for Lenovo G50-45) and reuse the function it provides. Note that this
+commit was already backported to 4.9.x but not 4.4.x.
+
+Cc: 3.17+ <stable@vger.kernel.org> # 3.17+: requires cbc00c13
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/sleep.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/acpi/sleep.c
++++ b/drivers/acpi/sleep.c
+@@ -338,6 +338,14 @@ static const struct dmi_system_id acpisl
+ DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
+ },
+ },
++ {
++ .callback = init_nvs_save_s3,
++ .ident = "Asus 1025C",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "1025C"),
++ },
++ },
+ /*
+ * https://bugzilla.kernel.org/show_bug.cgi?id=189431
+ * Lenovo G50-45 is a platform later than 2012, but needs nvs memory
--- /dev/null
+From 69756930f2de0457d51db7d505a1e4f40e9fd116 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 25 Jul 2018 17:59:26 +0200
+Subject: ALSA: cs5535audio: Fix invalid endian conversion
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 69756930f2de0457d51db7d505a1e4f40e9fd116 upstream.
+
+One place in cs5535audio_build_dma_packets() does an extra conversion
+via cpu_to_le32(); namely jmpprd_addr is passed to setup_prd() ops,
+which writes the value via cs_writel(). That is, the callback does
+the conversion by itself, and we don't need to convert beforehand.
+
+This patch fixes that bogus conversion.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/cs5535audio/cs5535audio.h | 6 +++---
+ sound/pci/cs5535audio/cs5535audio_pcm.c | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+--- a/sound/pci/cs5535audio/cs5535audio.h
++++ b/sound/pci/cs5535audio/cs5535audio.h
+@@ -67,9 +67,9 @@ struct cs5535audio_dma_ops {
+ };
+
+ struct cs5535audio_dma_desc {
+- u32 addr;
+- u16 size;
+- u16 ctlreserved;
++ __le32 addr;
++ __le16 size;
++ __le16 ctlreserved;
+ };
+
+ struct cs5535audio_dma {
+--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
++++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
+@@ -158,8 +158,8 @@ static int cs5535audio_build_dma_packets
+ lastdesc->addr = cpu_to_le32((u32) dma->desc_buf.addr);
+ lastdesc->size = 0;
+ lastdesc->ctlreserved = cpu_to_le16(PRD_JMP);
+- jmpprd_addr = cpu_to_le32(lastdesc->addr +
+- (sizeof(struct cs5535audio_dma_desc)*periods));
++ jmpprd_addr = (u32)dma->desc_buf.addr +
++ sizeof(struct cs5535audio_dma_desc) * periods;
+
+ dma->substream = substream;
+ dma->period_bytes = period_bytes;
--- /dev/null
+From 8e82a728792bf66b9f0a29c9d4c4b0630f7b9c79 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Thu, 2 Aug 2018 14:04:45 +0200
+Subject: ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 8e82a728792bf66b9f0a29c9d4c4b0630f7b9c79 upstream.
+
+I added the subsys product-id for the HDMI HDA device rather then for
+the PCH one, this commit fixes this.
+
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104
+Cc: stable@vger.kernel.org
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/hda_intel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -2205,7 +2205,7 @@ out_free:
+ */
+ static struct snd_pci_quirk power_save_blacklist[] = {
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
+- SND_PCI_QUIRK(0x1849, 0x0c0c, "Asrock B85M-ITX", 0),
++ SND_PCI_QUIRK(0x1849, 0xc892, "Asrock B85M-ITX", 0),
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
+ SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0),
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
--- /dev/null
+From f59cf9a0551dd954ad8b752461cf19d9789f4b1d Mon Sep 17 00:00:00 2001
+From: Park Ju Hyung <qkrwngud825@gmail.com>
+Date: Sat, 28 Jul 2018 03:16:42 +0900
+Subject: ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs
+
+From: Park Ju Hyung <qkrwngud825@gmail.com>
+
+commit f59cf9a0551dd954ad8b752461cf19d9789f4b1d upstream.
+
+On rare occasions, we are still noticing that the internal speaker
+spitting out spurious noises even after adding the problematic codec
+to the list.
+
+Adding a 10ms artificial delay before rebooting fixes the issue entirely.
+
+Patch for Realtek codecs also adds the same amount of delay after
+entering D3.
+
+Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_conexant.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -225,6 +225,7 @@ static void cx_auto_reboot_notify(struct
+ snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
+ snd_hda_codec_write(codec, codec->core.afg, 0,
+ AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
++ msleep(10);
+ }
+
+ static void cx_auto_free(struct hda_codec *codec)
--- /dev/null
+From d77a4b4a5b0b2ebcbc9840995d91311ef28302ab Mon Sep 17 00:00:00 2001
+From: Park Ju Hyung <qkrwngud825@gmail.com>
+Date: Sat, 28 Jul 2018 03:16:21 +0900
+Subject: ALSA: hda - Turn CX8200 into D3 as well upon reboot
+
+From: Park Ju Hyung <qkrwngud825@gmail.com>
+
+commit d77a4b4a5b0b2ebcbc9840995d91311ef28302ab upstream.
+
+As an equivalent codec with CX20724,
+CX8200 is also subject to the reboot bug.
+
+Late 2017 and 2018 LG Gram and some HP Spectre laptops are known victims
+to this issue, causing extremely loud noises upon reboot.
+
+Now that we know that this bug is subject to multiple codecs,
+fix the comment as well.
+
+Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_conexant.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -211,6 +211,7 @@ static void cx_auto_reboot_notify(struct
+ struct conexant_spec *spec = codec->spec;
+
+ switch (codec->core.vendor_id) {
++ case 0x14f12008: /* CX8200 */
+ case 0x14f150f2: /* CX20722 */
+ case 0x14f150f4: /* CX20724 */
+ break;
+@@ -218,7 +219,7 @@ static void cx_auto_reboot_notify(struct
+ return;
+ }
+
+- /* Turn the CX20722 codec into D3 to avoid spurious noises
++ /* Turn the problematic codec into D3 to avoid spurious noises
+ from the internal speaker during (and after) reboot */
+ cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
+
--- /dev/null
+From dfef01e150824b0e6da750cacda8958188d29aea Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 19 Jul 2018 11:01:04 +0200
+Subject: ALSA: memalloc: Don't exceed over the requested size
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit dfef01e150824b0e6da750cacda8958188d29aea upstream.
+
+snd_dma_alloc_pages_fallback() tries to allocate pages again when the
+allocation fails with reduced size. But the first try actually
+*increases* the size to power-of-two, which may give back a larger
+chunk than the requested size. This confuses the callers, e.g. sgbuf
+assumes that the size is equal or less, and it may result in a bad
+loop due to the underflow and eventually lead to Oops.
+
+The code of this function seems incorrectly assuming the usage of
+get_order(). We need to decrease at first, then align to
+power-of-two.
+
+Reported-and-tested-by: he, bo <bo.he@intel.com>
+Reported-by: zhang jun <jun.zhang@intel.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/memalloc.c | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/sound/core/memalloc.c
++++ b/sound/core/memalloc.c
+@@ -242,16 +242,12 @@ int snd_dma_alloc_pages_fallback(int typ
+ int err;
+
+ while ((err = snd_dma_alloc_pages(type, device, size, dmab)) < 0) {
+- size_t aligned_size;
+ if (err != -ENOMEM)
+ return err;
+ if (size <= PAGE_SIZE)
+ return -ENOMEM;
+- aligned_size = PAGE_SIZE << get_order(size);
+- if (size != aligned_size)
+- size = aligned_size;
+- else
+- size >>= 1;
++ size >>= 1;
++ size = PAGE_SIZE << get_order(size);
+ }
+ if (! dmab->area)
+ return -ENOMEM;
--- /dev/null
+From a49a71f6e25da2acc637fcd31e73debd96ca18f8 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 25 Jul 2018 16:34:12 +0200
+Subject: ALSA: seq: Fix poll() error return
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit a49a71f6e25da2acc637fcd31e73debd96ca18f8 upstream.
+
+The sanity checks in ALSA sequencer and OSS sequencer emulation codes
+return falsely -ENXIO from poll callback. They should be EPOLLERR
+instead.
+
+This was caught thanks to the recent change to the return value.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/seq/oss/seq_oss.c | 2 +-
+ sound/core/seq/seq_clientmgr.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sound/core/seq/oss/seq_oss.c
++++ b/sound/core/seq/oss/seq_oss.c
+@@ -203,7 +203,7 @@ odev_poll(struct file *file, poll_table
+ struct seq_oss_devinfo *dp;
+ dp = file->private_data;
+ if (snd_BUG_ON(!dp))
+- return -ENXIO;
++ return EPOLLERR;
+ return snd_seq_oss_poll(dp, file, wait);
+ }
+
+--- a/sound/core/seq/seq_clientmgr.c
++++ b/sound/core/seq/seq_clientmgr.c
+@@ -1097,7 +1097,7 @@ static unsigned int snd_seq_poll(struct
+
+ /* check client structures are in place */
+ if (snd_BUG_ON(!client))
+- return -ENXIO;
++ return EPOLLERR;
+
+ if ((snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_INPUT) &&
+ client->data.user.fifo) {
--- /dev/null
+From 50e9ffb1996a5d11ff5040a266585bad4ceeca0a Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 26 Jul 2018 14:27:59 +0200
+Subject: ALSA: virmidi: Fix too long output trigger loop
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 50e9ffb1996a5d11ff5040a266585bad4ceeca0a upstream.
+
+The virmidi output trigger tries to parse the all available bytes and
+process sequencer events as much as possible. In a normal situation,
+this is supposed to be relatively short, but a program may give a huge
+buffer and it'll take a long time in a single spin lock, which may
+eventually lead to a soft lockup.
+
+This patch simply adds a workaround, a cond_resched() call in the loop
+if applicable. A better solution would be to move the event processor
+into a work, but let's put a duct-tape quickly at first.
+
+Reported-and-tested-by: Dae R. Jeong <threeearcat@gmail.com>
+Reported-by: syzbot+619d9f40141d826b097e@syzkaller.appspotmail.com
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/seq/seq_virmidi.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/sound/core/seq/seq_virmidi.c
++++ b/sound/core/seq/seq_virmidi.c
+@@ -163,6 +163,7 @@ static void snd_virmidi_output_trigger(s
+ int count, res;
+ unsigned char buf[32], *pbuf;
+ unsigned long flags;
++ bool check_resched = !in_atomic();
+
+ if (up) {
+ vmidi->trigger = 1;
+@@ -200,6 +201,15 @@ static void snd_virmidi_output_trigger(s
+ vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
+ }
+ }
++ if (!check_resched)
++ continue;
++ /* do temporary unlock & cond_resched() for avoiding
++ * CPU soft lockup, which may happen via a write from
++ * a huge rawmidi buffer
++ */
++ spin_unlock_irqrestore(&substream->runtime->lock, flags);
++ cond_resched();
++ spin_lock_irqsave(&substream->runtime->lock, flags);
+ }
+ out:
+ spin_unlock_irqrestore(&substream->runtime->lock, flags);
--- /dev/null
+From fff71a4c050ba46e305d910c837b99ba1728135e Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 25 Jul 2018 17:10:11 +0200
+Subject: ALSA: vx222: Fix invalid endian conversions
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit fff71a4c050ba46e305d910c837b99ba1728135e upstream.
+
+The endian conversions used in vx2_dma_read() and vx2_dma_write() are
+superfluous and even wrong on big-endian machines, as inl() and outl()
+already do conversions. Kill them.
+
+Spotted by sparse, a warning like:
+ sound/pci/vx222/vx222_ops.c:278:30: warning: incorrect type in argument 1 (different base types)
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/vx222/vx222_ops.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/sound/pci/vx222/vx222_ops.c
++++ b/sound/pci/vx222/vx222_ops.c
+@@ -275,7 +275,7 @@ static void vx2_dma_write(struct vx_core
+ length >>= 2; /* in 32bit words */
+ /* Transfer using pseudo-dma. */
+ for (; length > 0; length--) {
+- outl(cpu_to_le32(*addr), port);
++ outl(*addr, port);
+ addr++;
+ }
+ addr = (u32 *)runtime->dma_area;
+@@ -285,7 +285,7 @@ static void vx2_dma_write(struct vx_core
+ count >>= 2; /* in 32bit words */
+ /* Transfer using pseudo-dma. */
+ for (; count > 0; count--) {
+- outl(cpu_to_le32(*addr), port);
++ outl(*addr, port);
+ addr++;
+ }
+
+@@ -313,7 +313,7 @@ static void vx2_dma_read(struct vx_core
+ length >>= 2; /* in 32bit words */
+ /* Transfer using pseudo-dma. */
+ for (; length > 0; length--)
+- *addr++ = le32_to_cpu(inl(port));
++ *addr++ = inl(port);
+ addr = (u32 *)runtime->dma_area;
+ pipe->hw_ptr = 0;
+ }
+@@ -321,7 +321,7 @@ static void vx2_dma_read(struct vx_core
+ count >>= 2; /* in 32bit words */
+ /* Transfer using pseudo-dma. */
+ for (; count > 0; count--)
+- *addr++ = le32_to_cpu(inl(port));
++ *addr++ = inl(port);
+
+ vx2_release_pseudo_dma(chip);
+ }
--- /dev/null
+From 3acd3e3bab95ec3622ff98da313290ee823a0f68 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 25 Jul 2018 17:11:38 +0200
+Subject: ALSA: vxpocket: Fix invalid endian conversions
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 3acd3e3bab95ec3622ff98da313290ee823a0f68 upstream.
+
+The endian conversions used in vxp_dma_read() and vxp_dma_write() are
+superfluous and even wrong on big-endian machines, as inw() and outw()
+already do conversions. Kill them.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pcmcia/vx/vxp_ops.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/sound/pcmcia/vx/vxp_ops.c
++++ b/sound/pcmcia/vx/vxp_ops.c
+@@ -375,7 +375,7 @@ static void vxp_dma_write(struct vx_core
+ length >>= 1; /* in 16bit words */
+ /* Transfer using pseudo-dma. */
+ for (; length > 0; length--) {
+- outw(cpu_to_le16(*addr), port);
++ outw(*addr, port);
+ addr++;
+ }
+ addr = (unsigned short *)runtime->dma_area;
+@@ -385,7 +385,7 @@ static void vxp_dma_write(struct vx_core
+ count >>= 1; /* in 16bit words */
+ /* Transfer using pseudo-dma. */
+ for (; count > 0; count--) {
+- outw(cpu_to_le16(*addr), port);
++ outw(*addr, port);
+ addr++;
+ }
+ vx_release_pseudo_dma(chip);
+@@ -417,7 +417,7 @@ static void vxp_dma_read(struct vx_core
+ length >>= 1; /* in 16bit words */
+ /* Transfer using pseudo-dma. */
+ for (; length > 0; length--)
+- *addr++ = le16_to_cpu(inw(port));
++ *addr++ = inw(port);
+ addr = (unsigned short *)runtime->dma_area;
+ pipe->hw_ptr = 0;
+ }
+@@ -425,12 +425,12 @@ static void vxp_dma_read(struct vx_core
+ count >>= 1; /* in 16bit words */
+ /* Transfer using pseudo-dma. */
+ for (; count > 1; count--)
+- *addr++ = le16_to_cpu(inw(port));
++ *addr++ = inw(port);
+ /* Disable DMA */
+ pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK;
+ vx_outb(chip, DIALOG, pchip->regDIALOG);
+ /* Read the last word (16 bits) */
+- *addr = le16_to_cpu(inw(port));
++ *addr = inw(port);
+ /* Disable 16-bit accesses */
+ pchip->regDIALOG &= ~VXP_DLG_DMA16_SEL_MASK;
+ vx_outb(chip, DIALOG, pchip->regDIALOG);
--- /dev/null
+From f294d00961d1d869ecffa60e280eeeee1ccf9a49 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Tue, 3 Jul 2018 12:05:47 +0200
+Subject: misc: sram: fix resource leaks in probe error path
+
+From: Johan Hovold <johan@kernel.org>
+
+commit f294d00961d1d869ecffa60e280eeeee1ccf9a49 upstream.
+
+Make sure to disable clocks and deregister any exported partitions
+before returning on late probe errors.
+
+Note that since commit ee895ccdf776 ("misc: sram: fix enabled clock leak
+on error path"), partitions are deliberately exported before enabling
+the clock so we stick to that logic here. A follow up patch will address
+this.
+
+Cc: stable <stable@vger.kernel.org> # 4.9
+Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/sram.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/misc/sram.c
++++ b/drivers/misc/sram.c
+@@ -407,13 +407,20 @@ static int sram_probe(struct platform_de
+ if (init_func) {
+ ret = init_func();
+ if (ret)
+- return ret;
++ goto err_disable_clk;
+ }
+
+ dev_dbg(sram->dev, "SRAM pool: %zu KiB @ 0x%p\n",
+ gen_pool_size(sram->pool) / 1024, sram->virt_base);
+
+ return 0;
++
++err_disable_clk:
++ if (sram->clk)
++ clk_disable_unprepare(sram->clk);
++ sram_free_partitions(sram);
++
++ return ret;
+ }
+
+ static int sram_remove(struct platform_device *pdev)
--- /dev/null
+From 784c29eda5b4e28c3a56aa90b3815f9a1b0cfdc1 Mon Sep 17 00:00:00 2001
+From: Srinath Mannam <srinath.mannam@broadcom.com>
+Date: Sat, 28 Jul 2018 20:55:15 +0530
+Subject: serial: 8250_dw: Add ACPI support for uart on Broadcom SoC
+
+From: Srinath Mannam <srinath.mannam@broadcom.com>
+
+commit 784c29eda5b4e28c3a56aa90b3815f9a1b0cfdc1 upstream.
+
+Add ACPI identifier HID for UART DW 8250 on Broadcom SoCs
+to match the HID passed through ACPI tables to enable
+UART controller.
+
+Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
+Reviewed-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
+Tested-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_dw.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/tty/serial/8250/8250_dw.c
++++ b/drivers/tty/serial/8250/8250_dw.c
+@@ -672,6 +672,7 @@ static const struct acpi_device_id dw825
+ { "APMC0D08", 0},
+ { "AMD0020", 0 },
+ { "AMDI0020", 0 },
++ { "BRCM2032", 0 },
+ { "HISI0031", 0 },
+ { },
+ };
--- /dev/null
+From dfcab6ba573445c703235ab6c83758eec12d7f28 Mon Sep 17 00:00:00 2001
+From: Chen Hu <hu1.chen@intel.com>
+Date: Fri, 27 Jul 2018 18:32:41 +0800
+Subject: serial: 8250_dw: always set baud rate in dw8250_set_termios
+
+From: Chen Hu <hu1.chen@intel.com>
+
+commit dfcab6ba573445c703235ab6c83758eec12d7f28 upstream.
+
+dw8250_set_termios() doesn't set baud rate if the arg "old ktermios" is
+NULL. This happens during resume.
+Call Trace:
+...
+[ 54.928108] dw8250_set_termios+0x162/0x170
+[ 54.928114] serial8250_set_termios+0x17/0x20
+[ 54.928117] uart_change_speed+0x64/0x160
+[ 54.928119] uart_resume_port
+...
+
+So the baud rate is not restored after S3 and breaks the apps who use
+UART, for example, console and bluetooth etc.
+
+We address this issue by setting the baud rate irrespective of arg
+"old", just like the drivers for other 8250 IPs. This is tested with
+Intel Broxton platform.
+
+Signed-off-by: Chen Hu <hu1.chen@intel.com>
+Fixes: 4e26b134bd17 ("serial: 8250_dw: clock rate handling for all ACPI platforms")
+Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Cc: stable <stable@vger.kernel.org>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_dw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/8250/8250_dw.c
++++ b/drivers/tty/serial/8250/8250_dw.c
+@@ -260,7 +260,7 @@ static void dw8250_set_termios(struct ua
+ long rate;
+ int ret;
+
+- if (IS_ERR(d->clk) || !old)
++ if (IS_ERR(d->clk))
+ goto out;
+
+ clk_disable_unprepare(d->clk);
--- /dev/null
+From 60ab0fafc4b652fcaf7cbc3bb8555a0cf1149c28 Mon Sep 17 00:00:00 2001
+From: Aaron Sierra <asierra@xes-inc.com>
+Date: Tue, 24 Jul 2018 14:23:46 -0500
+Subject: serial: 8250_exar: Read INT0 from slave device, too
+
+From: Aaron Sierra <asierra@xes-inc.com>
+
+commit 60ab0fafc4b652fcaf7cbc3bb8555a0cf1149c28 upstream.
+
+The sleep wake-up refactoring that I introduced in
+
+ commit c7e1b4059075 ("tty: serial: exar: Relocate sleep wake-up handling")
+
+did not account for devices with a slave device on the expansion port.
+This patch pokes the INT0 register in the slave device, if present, in
+order to ensure that MSI interrupts don't get permanently "stuck"
+because of a sleep wake-up interrupt as described here:
+
+ commit 2c0ac5b48a35 ("serial: exar: Fix stuck MSIs")
+
+This also converts an ioread8() to readb() in order to provide visual
+consistency with the MMIO-only accessors used elsewhere in the driver.
+
+Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
+Fixes: c7e1b4059075 ("tty: serial: exar: Relocate sleep wake-up handling")
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_exar.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/8250/8250_exar.c
++++ b/drivers/tty/serial/8250/8250_exar.c
+@@ -436,7 +436,11 @@ static irqreturn_t exar_misc_handler(int
+ struct exar8250 *priv = data;
+
+ /* Clear all PCI interrupts by reading INT0. No effect on IIR */
+- ioread8(priv->virt + UART_EXAR_INT0);
++ readb(priv->virt + UART_EXAR_INT0);
++
++ /* Clear INT0 for Expansion Interface slave ports, too */
++ if (priv->board->num_ports > 8)
++ readb(priv->virt + 0x2000 + UART_EXAR_INT0);
+
+ return IRQ_HANDLED;
+ }
vhost-reset-metadata-cache-when-initializing-new-iotlb.patch
ip6_tunnel-use-the-right-value-for-ipv4-min-mtu-check-in-ip6_tnl_xmit.patch
net-aquantia-fix-iff_allmulti-flag-functionality.patch
+alsa-hda-sleep-for-10ms-after-entering-d3-on-conexant-codecs.patch
+alsa-hda-turn-cx8200-into-d3-as-well-upon-reboot.patch
+alsa-vx222-fix-invalid-endian-conversions.patch
+alsa-virmidi-fix-too-long-output-trigger-loop.patch
+alsa-cs5535audio-fix-invalid-endian-conversion.patch
+alsa-hda-correct-asrock-b85m-itx-power_save-blacklist-entry.patch
+alsa-memalloc-don-t-exceed-over-the-requested-size.patch
+alsa-vxpocket-fix-invalid-endian-conversions.patch
+alsa-seq-fix-poll-error-return.patch
+usb-serial-sierra-fix-potential-deadlock-at-close.patch
+usb-serial-pl2303-add-a-new-device-id-for-aten.patch
+usb-option-add-support-for-dw5821e.patch
+acpi-pm-save-nvs-memory-for-asus-1025c-laptop.patch
+tty-serial-8250-revert-nxp-sc16c2552-workaround.patch
+serial-8250_exar-read-int0-from-slave-device-too.patch
+serial-8250_dw-always-set-baud-rate-in-dw8250_set_termios.patch
+serial-8250_dw-add-acpi-support-for-uart-on-broadcom-soc.patch
+misc-sram-fix-resource-leaks-in-probe-error-path.patch
--- /dev/null
+From 47ac76662ca9c5852fd353093f19de3ae85f2e66 Mon Sep 17 00:00:00 2001
+From: Mark <dmarkh@cfl.rr.com>
+Date: Sun, 12 Aug 2018 11:47:16 -0400
+Subject: tty: serial: 8250: Revert NXP SC16C2552 workaround
+
+From: Mark <dmarkh@cfl.rr.com>
+
+commit 47ac76662ca9c5852fd353093f19de3ae85f2e66 upstream.
+
+Revert commit ecb988a3b7985913d1f0112f66667cdd15e40711: tty: serial:
+8250: 8250_core: NXP SC16C2552 workaround
+
+The above commit causes userland application to no longer write
+correctly its first write to a dumb terminal connected to /dev/ttyS0.
+This commit seems to be the culprit. It's as though the TX FIFO is being
+reset during that write. What should be displayed is:
+
+PSW 80000000 INST 00000000 HALT
+//
+
+What is displayed is some variation of:
+
+T 00000000 HAL//
+
+Reverting this commit via this patch fixes my problem.
+
+Signed-off-by: Mark Hounschell <dmarkh@cfl.rr.com>
+Fixes: ecb988a3b798 ("tty: serial: 8250: 8250_core: NXP SC16C2552 workaround")
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/8250/8250_port.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/tty/serial/8250/8250_port.c
++++ b/drivers/tty/serial/8250/8250_port.c
+@@ -94,8 +94,7 @@ static const struct serial8250_config ua
+ .name = "16550A",
+ .fifo_size = 16,
+ .tx_loadsz = 16,
+- .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10 |
+- UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT,
++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+ .rxtrig_bytes = {1, 4, 8, 14},
+ .flags = UART_CAP_FIFO,
+ },
--- /dev/null
+From 7bab01ecc6c43da882333c6db39741cb43677004 Mon Sep 17 00:00:00 2001
+From: Aleksander Morgado <aleksander@aleksander.es>
+Date: Tue, 24 Jul 2018 01:34:01 +0200
+Subject: USB: option: add support for DW5821e
+
+From: Aleksander Morgado <aleksander@aleksander.es>
+
+commit 7bab01ecc6c43da882333c6db39741cb43677004 upstream.
+
+The device exposes AT, NMEA and DIAG ports in both USB configurations.
+
+The patch explicitly ignores interfaces 0 and 1, as they're bound to
+other drivers already; and also interface 6, which is a GNSS interface
+for which we don't have a driver yet.
+
+T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 18 Spd=480 MxCh= 0
+D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 2
+P: Vendor=413c ProdID=81d7 Rev=03.18
+S: Manufacturer=DELL
+S: Product=DW5821e Snapdragon X20 LTE
+S: SerialNumber=0123456789ABCDEF
+C: #Ifs= 7 Cfg#= 2 Atr=a0 MxPwr=500mA
+I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
+I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
+I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
+I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
+I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
+I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
+I: If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
+
+T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0
+D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 2
+P: Vendor=413c ProdID=81d7 Rev=03.18
+S: Manufacturer=DELL
+S: Product=DW5821e Snapdragon X20 LTE
+S: SerialNumber=0123456789ABCDEF
+C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
+I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
+I: If#= 1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
+I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
+I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
+I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
+I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
+
+Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/option.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -199,6 +199,8 @@ static void option_instat_callback(struc
+ #define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */
+ #define DELL_PRODUCT_5804_MINICARD_ATT 0x819b /* Novatel E371 */
+
++#define DELL_PRODUCT_5821E 0x81d7
++
+ #define KYOCERA_VENDOR_ID 0x0c88
+ #define KYOCERA_PRODUCT_KPC650 0x17da
+ #define KYOCERA_PRODUCT_KPC680 0x180a
+@@ -1033,6 +1035,8 @@ static const struct usb_device_id option
+ { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) },
++ { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E),
++ .driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
+ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
+ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
+ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
--- /dev/null
+From 29c692c96b3a39cd1911fb79cd2505af8d070f07 Mon Sep 17 00:00:00 2001
+From: Movie Song <MovieSong@aten-itlab.cn>
+Date: Thu, 19 Jul 2018 02:20:48 +0800
+Subject: USB: serial: pl2303: add a new device id for ATEN
+
+From: Movie Song <MovieSong@aten-itlab.cn>
+
+commit 29c692c96b3a39cd1911fb79cd2505af8d070f07 upstream.
+
+Signed-off-by: Movie Song <MovieSong@aten-itlab.cn>
+Cc: Johan Hovold <johan@kernel.org>
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/pl2303.c | 2 ++
+ drivers/usb/serial/pl2303.h | 1 +
+ 2 files changed, 3 insertions(+)
+
+--- a/drivers/usb/serial/pl2303.c
++++ b/drivers/usb/serial/pl2303.c
+@@ -55,6 +55,8 @@ static const struct usb_device_id id_tab
+ .driver_info = PL2303_QUIRK_ENDPOINT_HACK },
+ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_UC485),
+ .driver_info = PL2303_QUIRK_ENDPOINT_HACK },
++ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_UC232B),
++ .driver_info = PL2303_QUIRK_ENDPOINT_HACK },
+ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID2) },
+ { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) },
+ { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) },
+--- a/drivers/usb/serial/pl2303.h
++++ b/drivers/usb/serial/pl2303.h
+@@ -29,6 +29,7 @@
+ #define ATEN_VENDOR_ID2 0x0547
+ #define ATEN_PRODUCT_ID 0x2008
+ #define ATEN_PRODUCT_UC485 0x2021
++#define ATEN_PRODUCT_UC232B 0x2022
+ #define ATEN_PRODUCT_ID2 0x2118
+
+ #define IODATA_VENDOR_ID 0x04bb
--- /dev/null
+From e60870012e5a35b1506d7b376fddfb30e9da0b27 Mon Sep 17 00:00:00 2001
+From: John Ogness <john.ogness@linutronix.de>
+Date: Sun, 24 Jun 2018 00:32:11 +0200
+Subject: USB: serial: sierra: fix potential deadlock at close
+
+From: John Ogness <john.ogness@linutronix.de>
+
+commit e60870012e5a35b1506d7b376fddfb30e9da0b27 upstream.
+
+The portdata spinlock can be taken in interrupt context (via
+sierra_outdat_callback()).
+Disable interrupts when taking the portdata spinlock when discarding
+deferred URBs during close to prevent a possible deadlock.
+
+Fixes: 014333f77c0b ("USB: sierra: fix urb and memory leak on disconnect")
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: John Ogness <john.ogness@linutronix.de>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+[ johan: amend commit message and add fixes and stable tags ]
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/serial/sierra.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/serial/sierra.c
++++ b/drivers/usb/serial/sierra.c
+@@ -773,9 +773,9 @@ static void sierra_close(struct usb_seri
+ kfree(urb->transfer_buffer);
+ usb_free_urb(urb);
+ usb_autopm_put_interface_async(serial->interface);
+- spin_lock(&portdata->lock);
++ spin_lock_irq(&portdata->lock);
+ portdata->outstanding_urbs--;
+- spin_unlock(&portdata->lock);
++ spin_unlock_irq(&portdata->lock);
+ }
+
+ sierra_stop_rx_urbs(port);