--- /dev/null
+From 07cd7be3d92eeeae1f92a017f2cfe4fdd9256526 Mon Sep 17 00:00:00 2001
+From: Tomas Winkler <tomas.winkler@intel.com>
+Date: Mon, 12 May 2014 12:19:40 +0300
+Subject: mei: me: drop harmful wait optimization
+
+From: Tomas Winkler <tomas.winkler@intel.com>
+
+commit 07cd7be3d92eeeae1f92a017f2cfe4fdd9256526 upstream.
+
+It my take time till ME_RDY will be cleared after the reset,
+so we cannot check the bit before we got the interrupt
+
+Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
+Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/mei/hw-me.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/drivers/misc/mei/hw-me.c
++++ b/drivers/misc/mei/hw-me.c
+@@ -186,6 +186,7 @@ static int mei_me_hw_reset(struct mei_de
+ else
+ hcsr &= ~H_IE;
+
++ dev->recvd_hw_ready = false;
+ mei_me_reg_write(hw, H_CSR, hcsr);
+
+ if (intr_enable == false)
+@@ -237,10 +238,7 @@ static bool mei_me_hw_is_ready(struct me
+ static int mei_me_hw_ready_wait(struct mei_device *dev)
+ {
+ int err;
+- if (mei_me_hw_is_ready(dev))
+- return 0;
+
+- dev->recvd_hw_ready = false;
+ mutex_unlock(&dev->device_lock);
+ err = wait_event_interruptible_timeout(dev->wait_hw_ready,
+ dev->recvd_hw_ready,
--- /dev/null
+From b04ada92ffaabb868497a1fce8e4f6bf74e5488f Mon Sep 17 00:00:00 2001
+From: Tomas Winkler <tomas.winkler@intel.com>
+Date: Mon, 12 May 2014 12:19:39 +0300
+Subject: mei: me: fix hw ready reset flow
+
+From: Tomas Winkler <tomas.winkler@intel.com>
+
+commit b04ada92ffaabb868497a1fce8e4f6bf74e5488f upstream.
+
+We cleared H_RST for H_CSR on spurious interrupt generated when ME_RDY
+while cleared and not while ME_RDY is set. The spurious interrupt
+is not delivered on all platforms in this case the
+driver may fail to initialize.
+
+Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
+Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/mei/hw-me.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/misc/mei/hw-me.c
++++ b/drivers/misc/mei/hw-me.c
+@@ -164,6 +164,9 @@ static void mei_me_hw_reset_release(stru
+ hcsr |= H_IG;
+ hcsr &= ~H_RST;
+ mei_hcsr_set(hw, hcsr);
++
++ /* complete this write before we set host ready on another CPU */
++ mmiowb();
+ }
+ /**
+ * mei_me_hw_reset - resets fw via mei csr register.
+@@ -201,6 +204,7 @@ static int mei_me_hw_reset(struct mei_de
+ static void mei_me_host_set_ready(struct mei_device *dev)
+ {
+ struct mei_me_hw *hw = to_me_hw(dev);
++ hw->host_hw_state = mei_hcsr_read(hw);
+ hw->host_hw_state |= H_IE | H_IG | H_RDY;
+ mei_hcsr_set(hw, hw->host_hw_state);
+ }
+@@ -491,14 +495,13 @@ irqreturn_t mei_me_irq_thread_handler(in
+ /* check if we need to start the dev */
+ if (!mei_host_is_ready(dev)) {
+ if (mei_hw_is_ready(dev)) {
++ mei_me_hw_reset_release(dev);
+ dev_dbg(&dev->pdev->dev, "we need to start the dev.\n");
+
+ dev->recvd_hw_ready = true;
+ wake_up_interruptible(&dev->wait_hw_ready);
+ } else {
+-
+- dev_dbg(&dev->pdev->dev, "Reset Completed.\n");
+- mei_me_hw_reset_release(dev);
++ dev_dbg(&dev->pdev->dev, "Spurious Interrupt\n");
+ }
+ goto end;
+ }
--- /dev/null
+From c40765d919d25d2d44d99c4ce39e48808f137e1e Mon Sep 17 00:00:00 2001
+From: Tomas Winkler <tomas.winkler@intel.com>
+Date: Mon, 12 May 2014 12:19:41 +0300
+Subject: mei: me: read H_CSR after asserting reset
+
+From: Tomas Winkler <tomas.winkler@intel.com>
+
+commit c40765d919d25d2d44d99c4ce39e48808f137e1e upstream.
+
+According the spec the host should read H_CSR again
+after asserting reset H_RST to ensure that reset was
+read by the firmware
+
+Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
+Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/mei/hw-me.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/drivers/misc/mei/hw-me.c
++++ b/drivers/misc/mei/hw-me.c
+@@ -189,6 +189,18 @@ static int mei_me_hw_reset(struct mei_de
+ dev->recvd_hw_ready = false;
+ mei_me_reg_write(hw, H_CSR, hcsr);
+
++ /*
++ * Host reads the H_CSR once to ensure that the
++ * posted write to H_CSR completes.
++ */
++ hcsr = mei_hcsr_read(hw);
++
++ if ((hcsr & H_RST) == 0)
++ dev_warn(&dev->pdev->dev, "H_RST is not set = 0x%08X", hcsr);
++
++ if ((hcsr & H_RDY) == H_RDY)
++ dev_warn(&dev->pdev->dev, "H_RDY is not cleared 0x%08X", hcsr);
++
+ if (intr_enable == false)
+ mei_me_hw_reset_release(dev);
+
--- /dev/null
+From b701c0b1fe819a2083fc6ec5332e0e4492b9516d Mon Sep 17 00:00:00 2001
+From: Alexei Starovoitov <ast@plumgrid.com>
+Date: Wed, 4 Jun 2014 15:49:50 -0700
+Subject: PCI/MSI: Fix memory leak in free_msi_irqs()
+
+From: Alexei Starovoitov <ast@plumgrid.com>
+
+commit b701c0b1fe819a2083fc6ec5332e0e4492b9516d upstream.
+
+free_msi_irqs() is leaking memory, since list_for_each_entry(entry,
+&dev->msi_list, list) {...} is never executed, because dev->msi_list is
+made empty by the loop just above this one.
+
+Fix it by relying on zero termination of attribute array like
+populate_msi_sysfs() does.
+
+Fixes: 1c51b50c2995 ("PCI/MSI: Export MSI mode using attributes, not kobjects")
+Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Acked-by: Neil Horman <nhorman@tuxdriver.com>
+Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pci/msi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/pci/msi.c
++++ b/drivers/pci/msi.c
+@@ -414,7 +414,7 @@ static void free_msi_irqs(struct pci_dev
+ if (dev->msi_irq_groups) {
+ sysfs_remove_groups(&dev->dev.kobj, dev->msi_irq_groups);
+ msi_attrs = dev->msi_irq_groups[0]->attrs;
+- list_for_each_entry(entry, &dev->msi_list, list) {
++ while (msi_attrs[count]) {
+ dev_attr = container_of(msi_attrs[count],
+ struct device_attribute, attr);
+ kfree(dev_attr->attr.name);
--- /dev/null
+From 9ca24ae4083665bda38da45f4b5dc9bbaf936bc0 Mon Sep 17 00:00:00 2001
+From: Brian Healy <healybrian@gmail.com>
+Date: Sun, 4 May 2014 18:43:39 -0300
+Subject: [media] rtl28xxu: add 1b80:d395 Peak DVB-T USB
+
+From: Brian Healy <healybrian@gmail.com>
+
+commit 9ca24ae4083665bda38da45f4b5dc9bbaf936bc0 upstream.
+
+Add USB ID for Peak DVB-T USB.
+
+[crope@iki.fi: fix Brian email address and indentation]
+Signed-off-by: Brian Healy <healybrian@gmail.com>
+Signed-off-by: Antti Palosaari <crope@iki.fi>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+
+---
+ drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
++++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+@@ -1537,6 +1537,8 @@ static const struct usb_device_id rtl28x
+ &rtl2832u_props, "Crypto ReDi PC 50 A", NULL) },
+ { DVB_USB_DEVICE(USB_VID_KYE, 0x707f,
+ &rtl2832u_props, "Genius TVGo DVB-T03", NULL) },
++ { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd395,
++ &rtl2832u_props, "Peak DVB-T USB", NULL) },
+
+ /* RTL2832P devices: */
+ { DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131,
--- /dev/null
+From f27f5b0ee4967babfb8b03511f5e76b79d781014 Mon Sep 17 00:00:00 2001
+From: Alessandro Miceli <angelofsky1980@gmail.com>
+Date: Sun, 4 May 2014 07:37:15 -0300
+Subject: [media] rtl28xxu: add [1b80:d39d] Sveon STV20
+
+From: Alessandro Miceli <angelofsky1980@gmail.com>
+
+commit f27f5b0ee4967babfb8b03511f5e76b79d781014 upstream.
+
+Added Sveon STV20 device based on Realtek RTL2832U and FC0012 tuner
+
+Signed-off-by: Alessandro Miceli <angelofsky1980@gmail.com>
+Signed-off-by: Antti Palosaari <crope@iki.fi>
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/dvb-core/dvb-usb-ids.h | 1 +
+ drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 2 ++
+ 2 files changed, 3 insertions(+)
+
+--- a/drivers/media/dvb-core/dvb-usb-ids.h
++++ b/drivers/media/dvb-core/dvb-usb-ids.h
+@@ -361,6 +361,7 @@
+ #define USB_PID_FRIIO_WHITE 0x0001
+ #define USB_PID_TVWAY_PLUS 0x0002
+ #define USB_PID_SVEON_STV20 0xe39d
++#define USB_PID_SVEON_STV20_RTL2832U 0xd39d
+ #define USB_PID_SVEON_STV22 0xe401
+ #define USB_PID_SVEON_STV22_IT9137 0xe411
+ #define USB_PID_AZUREWAVE_AZ6027 0x3275
+--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
++++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+@@ -1539,6 +1539,8 @@ static const struct usb_device_id rtl28x
+ &rtl2832u_props, "Genius TVGo DVB-T03", NULL) },
+ { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd395,
+ &rtl2832u_props, "Peak DVB-T USB", NULL) },
++ { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV20_RTL2832U,
++ &rtl2832u_props, "Sveon STV20", NULL) },
+
+ /* RTL2832P devices: */
+ { DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131,
--- /dev/null
+From 74a86272f05c3dae40f2d7b17ff09a0608cf3304 Mon Sep 17 00:00:00 2001
+From: Alessandro Miceli <angelofsky1980@gmail.com>
+Date: Sun, 4 May 2014 07:50:31 -0300
+Subject: [media] rtl28xxu: add [1b80:d3af] Sveon STV27
+
+From: Alessandro Miceli <angelofsky1980@gmail.com>
+
+commit 74a86272f05c3dae40f2d7b17ff09a0608cf3304 upstream.
+
+Added support for Sveon STV27 device (rtl2832u + FC0013 tuner)
+
+Signed-off-by: Alessandro Miceli <angelofsky1980@gmail.com>
+Signed-off-by: Antti Palosaari <crope@iki.fi>
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/dvb-core/dvb-usb-ids.h | 1 +
+ drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 2 ++
+ 2 files changed, 3 insertions(+)
+
+--- a/drivers/media/dvb-core/dvb-usb-ids.h
++++ b/drivers/media/dvb-core/dvb-usb-ids.h
+@@ -376,4 +376,5 @@
+ #define USB_PID_CTVDIGDUAL_V2 0xe410
+ #define USB_PID_PCTV_2002E 0x025c
+ #define USB_PID_PCTV_2002E_SE 0x025d
++#define USB_PID_SVEON_STV27 0xd3af
+ #endif
+--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
++++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+@@ -1541,6 +1541,8 @@ static const struct usb_device_id rtl28x
+ &rtl2832u_props, "Peak DVB-T USB", NULL) },
+ { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV20_RTL2832U,
+ &rtl2832u_props, "Sveon STV20", NULL) },
++ { DVB_USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV27,
++ &rtl2832u_props, "Sveon STV27", NULL) },
+
+ /* RTL2832P devices: */
+ { DVB_USB_DEVICE(USB_VID_HANFTEK, 0x0131,
fs-userns-change-inode_capable-to-capable_wrt_inode_uidgid.patch
lock_parent-don-t-step-on-stale-d_parent-of-all-but-freed-one.patch
auditsc-audit_krule-mask-accesses-need-bounds-checking.patch
+pci-msi-fix-memory-leak-in-free_msi_irqs.patch
+mei-me-fix-hw-ready-reset-flow.patch
+mei-me-drop-harmful-wait-optimization.patch
+mei-me-read-h_csr-after-asserting-reset.patch
+rtl28xxu-add-1b80-d395-peak-dvb-t-usb.patch
+rtl28xxu-add-sveon-stv20.patch
+rtl28xxu-add-sveon-stv27.patch