All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.18 00/22] 3.18.61-stable review
@ 2017-07-13 15:42 Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 01/22] driver core: platform: fix race condition with driver_override Greg Kroah-Hartman
                   ` (17 more replies)
  0 siblings, 18 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuahkh, patches,
	ben.hutchings, stable

This is the start of the stable review cycle for the 3.18.61 release.
There are 22 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Sat Jul 15 15:39:17 UTC 2017.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.61-rc1.gz
or in the git tree and branch at:
  git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 3.18.61-rc1

Maciej S. Szmigiero <mail@maciej.szmigiero.name>
    saa7134: fix warm Medion 7134 EEPROM read

Ian Abbott <abbotti@mev.co.uk>
    staging: comedi: fix clean-up of comedi_class in comedi_init()

Malcolm Priestley <tvboxspy@gmail.com>
    staging: vt6556: vnt_start Fix missing call to vnt_key_init_table.

Jason Yan <yanaijie@huawei.com>
    md: fix super_offset endianness in super_1_rdev_size_change

Cong Wang <xiyou.wangcong@gmail.com>
    mqueue: fix a use-after-free in sys_mq_notify()

Dan Carpenter <dan.carpenter@oracle.com>
    KEYS: Fix an error code in request_master_key()

Bjørn Mork <bjorn@mork.no>
    USB: serial: qcserial: new Sierra Wireless EM7305 device ID

Johan Hovold <johan@kernel.org>
    USB: serial: option: add two Longcheer device ids

Geert Uytterhoeven <geert+renesas@glider.be>
    pinctrl: sh-pfc: Update info pointer after SoC-specific init

Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    pinctrl: mxs: atomically switch mux and drive strength config

Benjamin Herrenschmidt <benh@kernel.crashing.org>
    usb: Fix typo in the definition of Endpoint[out]Request

Michael Grzeschik <m.grzeschik@pengutronix.de>
    usb: usbip: set buffer pointers to NULL after free

Devin Heitmueller <dheitmueller@kernellabs.com>
    Add USB quirk for HVR-950q to avoid intermittent device resets

Jeremie Rapin <rapinj@gmail.com>
    USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick

Felipe Balbi <felipe.balbi@linux.intel.com>
    usb: dwc3: replace %p with %pK

Sabrina Dubroca <sd@queasysnail.net>
    tracing/kprobes: Allow to create probe with a module name starting with a digit

Jonas Gorski <jogo@openwrt.org>
    usb: ehci-orion: fix probe for !GENERIC_PHY

Rafał Miłecki <zajec5@gmail.com>
    bgmac: reset & enable Ethernet core before using it

Felix Fietkau <nbd@openwrt.org>
    bgmac: add check for oversized packets

Rafał Miłecki <zajec5@gmail.com>
    bgmac: fix device initialization on Northstar SoCs (condition typo)

Yousong Zhou <yszhou4tech@gmail.com>
    MIPS: UAPI: Ignore __arch_swab{16,32,64} when using MIPS16

Adrian Salido <salidoa@google.com>
    driver core: platform: fix race condition with driver_override


-------------

Diffstat:

 Makefile                                 |  4 ++--
 arch/mips/include/uapi/asm/swab.h        |  7 ++++---
 drivers/base/platform.c                  | 11 +++++++++--
 drivers/md/md.c                          |  2 +-
 drivers/media/pci/saa7134/saa7134-i2c.c  | 31 +++++++++++++++++++++++++++++++
 drivers/net/ethernet/broadcom/bgmac.c    | 17 +++++++++++++++--
 drivers/pinctrl/freescale/pinctrl-mxs.c  | 16 ++++++++++++----
 drivers/pinctrl/sh-pfc/core.c            |  3 +++
 drivers/staging/comedi/comedi_fops.c     |  1 +
 drivers/staging/vt6656/main_usb.c        |  3 +++
 drivers/usb/core/quirks.c                |  4 ++++
 drivers/usb/dwc3/dwc3-st.c               |  2 +-
 drivers/usb/dwc3/gadget.c                |  4 ++--
 drivers/usb/host/ehci-orion.c            |  3 ++-
 drivers/usb/serial/cp210x.c              |  1 +
 drivers/usb/serial/option.c              |  4 ++++
 drivers/usb/serial/qcserial.c            |  1 +
 drivers/usb/usbip/stub_main.c            |  4 ++++
 drivers/usb/usbip/stub_tx.c              |  4 ++++
 include/linux/usb/hcd.h                  |  4 ++--
 ipc/mqueue.c                             |  4 +++-
 kernel/trace/trace_kprobe.c              | 21 ++++++++-------------
 security/keys/encrypted-keys/encrypted.c |  2 +-
 23 files changed, 118 insertions(+), 35 deletions(-)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 01/22] driver core: platform: fix race condition with driver_override
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 02/22] MIPS: UAPI: Ignore __arch_swab{16,32,64} when using MIPS16 Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Adrian Salido

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Adrian Salido <salidoa@google.com>

commit 6265539776a0810b7ce6398c27866ddb9c6bd154 upstream.

The driver_override implementation is susceptible to race condition when
different threads are reading vs storing a different driver override.
Add locking to avoid race condition.

Fixes: 3d713e0e382e ("driver core: platform: add device binding path 'driver_override'")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Salido <salidoa@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/base/platform.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -727,7 +727,7 @@ static ssize_t driver_override_store(str
 				     const char *buf, size_t count)
 {
 	struct platform_device *pdev = to_platform_device(dev);
-	char *driver_override, *old = pdev->driver_override, *cp;
+	char *driver_override, *old, *cp;
 
 	if (count > PATH_MAX)
 		return -EINVAL;
@@ -740,12 +740,15 @@ static ssize_t driver_override_store(str
 	if (cp)
 		*cp = '\0';
 
+	device_lock(dev);
+	old = pdev->driver_override;
 	if (strlen(driver_override)) {
 		pdev->driver_override = driver_override;
 	} else {
 		kfree(driver_override);
 		pdev->driver_override = NULL;
 	}
+	device_unlock(dev);
 
 	kfree(old);
 
@@ -756,8 +759,12 @@ static ssize_t driver_override_show(stru
 				    struct device_attribute *attr, char *buf)
 {
 	struct platform_device *pdev = to_platform_device(dev);
+	ssize_t len;
 
-	return sprintf(buf, "%s\n", pdev->driver_override);
+	device_lock(dev);
+	len = sprintf(buf, "%s\n", pdev->driver_override);
+	device_unlock(dev);
+	return len;
 }
 static DEVICE_ATTR_RW(driver_override);
 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 02/22] MIPS: UAPI: Ignore __arch_swab{16,32,64} when using MIPS16
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 01/22] driver core: platform: fix race condition with driver_override Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 04/22] bgmac: add check for oversized packets Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Yousong Zhou, Maciej W. Rozycki,
	linux-mips, Ralf Baechle, Amit Pundir

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yousong Zhou <yszhou4tech@gmail.com>

commit 71a0a72456b48de972d7ed613b06a22a3aa9057f upstream.

Some GCC versions (e.g. 4.8.3) can incorrectly inline a function with
MIPS32 instructions into another function with MIPS16 code [1], causing
the assembler to genereate incorrect binary code or fail right away
complaining about unrecognized opcode.

In the case of __arch_swab{16,32}, when inlined by the compiler with
flags `-mips32r2 -mips16 -Os', the assembler can fail with the following
error.

    {standard input}:79: Error: unrecognized opcode `wsbh $2,$2'

For performance concerns and to workaround the issue already existing in
older compilers, just ignore these 2 functions when compiling with
mips16 enabled.

 [1] Inlining nomips16 function into mips16 function can result in
     undefined builtins, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55777

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11241/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/include/uapi/asm/swab.h |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/arch/mips/include/uapi/asm/swab.h
+++ b/arch/mips/include/uapi/asm/swab.h
@@ -13,8 +13,9 @@
 
 #define __SWAB_64_THRU_32__
 
-#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) ||		\
-    defined(_MIPS_ARCH_LOONGSON3A)
+#if !defined(__mips16) &&					\
+	((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) ||	\
+	 defined(_MIPS_ARCH_LOONGSON3A))
 
 static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
 {
@@ -65,5 +66,5 @@ static inline __attribute_const__ __u64
 }
 #define __arch_swab64 __arch_swab64
 #endif /* __mips64 */
-#endif /* MIPS R2 or newer or Loongson 3A */
+#endif /* (not __mips16) and (MIPS R2 or newer or Loongson 3A) */
 #endif /* _ASM_SWAB_H */

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 04/22] bgmac: add check for oversized packets
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 01/22] driver core: platform: fix race condition with driver_override Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 02/22] MIPS: UAPI: Ignore __arch_swab{16,32,64} when using MIPS16 Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 06/22] usb: ehci-orion: fix probe for !GENERIC_PHY Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Felix Fietkau, David S. Miller, Amit Pundir

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Felix Fietkau <nbd@openwrt.org>

commit 6a6c708469c9e10fd87adcc3abff164270538d62 upstream.

In very rare cases, the MAC can catch an internal buffer that is bigger
than it's supposed to be. Instead of crashing the kernel, simply pass
the buffer back to the hardware

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/ethernet/broadcom/bgmac.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -373,6 +373,13 @@ static int bgmac_dma_rx_read(struct bgma
 				break;
 			}
 
+			if (len > BGMAC_RX_ALLOC_SIZE) {
+				bgmac_err(bgmac, "Found oversized packet at slot %d, DMA issue!\n",
+					  ring->start);
+				put_page(virt_to_head_page(buf));
+				break;
+			}
+
 			/* Omit CRC. */
 			len -= ETH_FCS_LEN;
 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 06/22] usb: ehci-orion: fix probe for !GENERIC_PHY
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 04/22] bgmac: add check for oversized packets Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 07/22] tracing/kprobes: Allow to create probe with a module name starting with a digit Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jonas Gorski, Alan Stern, Amit Pundir

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jonas Gorski <jogo@openwrt.org>

commit db1319e166c5e872c4be54eac4e47454133708cf upstream.

Commit d445913ce0ab7f ("usb: ehci-orion: add optional PHY support")
added support for optional phys, but devm_phy_optional_get returns
-ENOSYS if GENERIC_PHY is not enabled.

This causes probe failures, even when there are no phys specified:

[    1.443365] orion-ehci f1058000.usb: init f1058000.usb fail, -38
[    1.449403] orion-ehci: probe of f1058000.usb failed with error -38

Similar to dwc3, treat -ENOSYS as no phy.

Fixes: d445913ce0ab7f ("usb: ehci-orion: add optional PHY support")

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/host/ehci-orion.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -226,7 +226,8 @@ static int ehci_orion_drv_probe(struct p
 	priv->phy = devm_phy_optional_get(&pdev->dev, "usb");
 	if (IS_ERR(priv->phy)) {
 		err = PTR_ERR(priv->phy);
-		goto err_phy_get;
+		if (err != -ENOSYS)
+			goto err_phy_get;
 	} else {
 		err = phy_init(priv->phy);
 		if (err)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 07/22] tracing/kprobes: Allow to create probe with a module name starting with a digit
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 06/22] usb: ehci-orion: fix probe for !GENERIC_PHY Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 08/22] usb: dwc3: replace %p with %pK Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Masami Hiramatsu, Sabrina Dubroca,
	Steven Rostedt (VMware)

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sabrina Dubroca <sd@queasysnail.net>

commit 9e52b32567126fe146f198971364f68d3bc5233f upstream.

Always try to parse an address, since kstrtoul() will safely fail when
given a symbol as input. If that fails (which will be the case for a
symbol), try to parse a symbol instead.

This allows creating a probe such as:

    p:probe/vlan_gro_receive 8021q:vlan_gro_receive+0

Which is necessary for this command to work:

    perf probe -m 8021q -a vlan_gro_receive

Link: http://lkml.kernel.org/r/fd72d666f45b114e2c5b9cf7e27b91de1ec966f1.1498122881.git.sd@queasysnail.net

Fixes: 413d37d1e ("tracing: Add kprobe-based event tracer")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/trace/trace_kprobe.c |   21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -671,30 +671,25 @@ static int create_trace_kprobe(int argc,
 		pr_info("Probe point is not specified.\n");
 		return -EINVAL;
 	}
-	if (isdigit(argv[1][0])) {
-		if (is_return) {
-			pr_info("Return probe point must be a symbol.\n");
-			return -EINVAL;
-		}
-		/* an address specified */
-		ret = kstrtoul(&argv[1][0], 0, (unsigned long *)&addr);
-		if (ret) {
-			pr_info("Failed to parse address.\n");
-			return ret;
-		}
-	} else {
+
+	/* try to parse an address. if that fails, try to read the
+	 * input as a symbol. */
+	if (kstrtoul(argv[1], 0, (unsigned long *)&addr)) {
 		/* a symbol specified */
 		symbol = argv[1];
 		/* TODO: support .init module functions */
 		ret = traceprobe_split_symbol_offset(symbol, &offset);
 		if (ret) {
-			pr_info("Failed to parse symbol.\n");
+			pr_info("Failed to parse either an address or a symbol.\n");
 			return ret;
 		}
 		if (offset && is_return) {
 			pr_info("Return probe must be used without offset.\n");
 			return -EINVAL;
 		}
+	} else if (is_return) {
+		pr_info("Return probe point must be a symbol.\n");
+		return -EINVAL;
 	}
 	argc -= 2; argv += 2;
 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 08/22] usb: dwc3: replace %p with %pK
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 07/22] tracing/kprobes: Allow to create probe with a module name starting with a digit Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 09/22] USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Felipe Balbi

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Felipe Balbi <felipe.balbi@linux.intel.com>

commit 04fb365c453e14ff9e8a28f1c46050d920a27a4a upstream.

%p will leak kernel pointers, so let's not expose the information on
dmesg and instead use %pK. %pK will only show the actual addresses if
explicitly enabled under /proc/sys/kernel/kptr_restrict.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/dwc3/dwc3-st.c |    2 +-
 drivers/usb/dwc3/gadget.c  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/usb/dwc3/dwc3-st.c
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -227,7 +227,7 @@ static int st_dwc3_probe(struct platform
 
 	dwc3_data->syscfg_reg_off = res->start;
 
-	dev_vdbg(&pdev->dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n",
+	dev_vdbg(&pdev->dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
 		 dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
 
 	dwc3_data->rstc_pwrdn = devm_reset_control_get(dev, "powerdown");
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1229,7 +1229,7 @@ static int dwc3_gadget_ep_dequeue(struct
 			dwc3_stop_active_transfer(dwc, dep->number, true);
 			goto out1;
 		}
-		dev_err(dwc->dev, "request %p was not queued to %s\n",
+		dev_err(dwc->dev, "request %pK was not queued to %s\n",
 				request, ep->name);
 		ret = -EINVAL;
 		goto out0;
@@ -1833,7 +1833,7 @@ static int __dwc3_cleanup_done_trbs(stru
 		 * would help. Lets hope that if this occurs, someone
 		 * fixes the root cause instead of looking away :)
 		 */
-		dev_err(dwc->dev, "%s's TRB (%p) still owned by HW\n",
+		dev_err(dwc->dev, "%s's TRB (%pK) still owned by HW\n",
 				dep->name, trb);
 
 	count = trb->size & DWC3_TRB_SIZE_MASK;

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 09/22] USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 08/22] usb: dwc3: replace %p with %pK Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 10/22] Add USB quirk for HVR-950q to avoid intermittent device resets Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jeremie Rapin, Johan Hovold

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jeremie Rapin <rapinj@gmail.com>

commit fd90f73a9925f248d696bde1cfc836d9fda5570d upstream.

Added the USB serial device ID for the CEL ZigBee EM3588
radio stick.

Signed-off-by: Jeremie Rapin <rapinj@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/cp210x.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -132,6 +132,7 @@ static const struct usb_device_id id_tab
 	{ USB_DEVICE(0x10C4, 0x8977) },	/* CEL MeshWorks DevKit Device */
 	{ USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */
 	{ USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */
+	{ USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */
 	{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
 	{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
 	{ USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 10/22] Add USB quirk for HVR-950q to avoid intermittent device resets
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 09/22] USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 11/22] usb: usbip: set buffer pointers to NULL after free Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Devin Heitmueller

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Devin Heitmueller <dheitmueller@kernellabs.com>

commit 6836796de4019944f4ba4c99a360e8250fd2e735 upstream.

The USB core and sysfs will attempt to enumerate certain parameters
which are unsupported by the au0828 - causing inconsistent behavior
and sometimes causing the chip to reset.  Avoid making these calls.

This problem manifested as intermittent cases where the au8522 would
be reset on analog video startup, in particular when starting up ALSA
audio streaming in parallel - the sysfs entries created by
snd-usb-audio on streaming startup would result in unsupported control
messages being sent during tuning which would put the chip into an
unknown state.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/core/quirks.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -216,6 +216,10 @@ static const struct usb_device_id usb_qu
 	/* Blackmagic Design UltraStudio SDI */
 	{ USB_DEVICE(0x1edb, 0xbd4f), .driver_info = USB_QUIRK_NO_LPM },
 
+	/* Hauppauge HVR-950q */
+	{ USB_DEVICE(0x2040, 0x7200), .driver_info =
+			USB_QUIRK_CONFIG_INTF_STRINGS },
+
 	/* INTEL VALUE SSD */
 	{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 11/22] usb: usbip: set buffer pointers to NULL after free
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 10/22] Add USB quirk for HVR-950q to avoid intermittent device resets Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 12/22] usb: Fix typo in the definition of Endpoint[out]Request Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Michael Grzeschik, Shuah Khan

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michael Grzeschik <m.grzeschik@pengutronix.de>

commit b3b51417d0af63fb9a06662dc292200aed9ea53f upstream.

The usbip stack dynamically allocates the transfer_buffer and
setup_packet of each urb that got generated by the tcp to usb stub code.
As these pointers are always used only once we will set them to NULL
after use. This is done likewise to the free_urb code in vudc_dev.c.
This patch fixes double kfree situations where the usbip remote side
added the URB_FREE_BUFFER.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/usbip/stub_main.c |    4 ++++
 drivers/usb/usbip/stub_tx.c   |    4 ++++
 2 files changed, 8 insertions(+)

--- a/drivers/usb/usbip/stub_main.c
+++ b/drivers/usb/usbip/stub_main.c
@@ -262,7 +262,11 @@ void stub_device_cleanup_urbs(struct stu
 		kmem_cache_free(stub_priv_cache, priv);
 
 		kfree(urb->transfer_buffer);
+		urb->transfer_buffer = NULL;
+
 		kfree(urb->setup_packet);
+		urb->setup_packet = NULL;
+
 		usb_free_urb(urb);
 	}
 }
--- a/drivers/usb/usbip/stub_tx.c
+++ b/drivers/usb/usbip/stub_tx.c
@@ -28,7 +28,11 @@ static void stub_free_priv_and_urb(struc
 	struct urb *urb = priv->urb;
 
 	kfree(urb->setup_packet);
+	urb->setup_packet = NULL;
+
 	kfree(urb->transfer_buffer);
+	urb->transfer_buffer = NULL;
+
 	list_del(&priv->list);
 	kmem_cache_free(stub_priv_cache, priv);
 	usb_free_urb(urb);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 12/22] usb: Fix typo in the definition of Endpoint[out]Request
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 11/22] usb: usbip: set buffer pointers to NULL after free Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 14/22] pinctrl: sh-pfc: Update info pointer after SoC-specific init Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Benjamin Herrenschmidt, Alan Stern

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

commit 7cf916bd639bd26db7214f2205bccdb4b9306256 upstream.

The current definition is wrong. This breaks my upcoming
Aspeed virtual hub driver.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/usb/hcd.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -545,9 +545,9 @@ extern void usb_ep0_reinit(struct usb_de
 	((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
 
 #define EndpointRequest \
-	((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
+	((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_ENDPOINT)<<8)
 #define EndpointOutRequest \
-	((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
+	((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_ENDPOINT)<<8)
 
 /* class requests from the USB 2.0 hub spec, table 11-15 */
 /* GetBusState and SetHubDescriptor are optional, omitted */

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 14/22] pinctrl: sh-pfc: Update info pointer after SoC-specific init
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 12/22] usb: Fix typo in the definition of Endpoint[out]Request Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 17/22] KEYS: Fix an error code in request_master_key() Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Geert Uytterhoeven

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geert Uytterhoeven <geert+renesas@glider.be>

commit 3091ae775fae17084013021d01513bc1ad274e6a upstream.

Update the sh_pfc_soc_info pointer after calling the SoC-specific
initialization function, as it may have been updated to e.g. handle
different SoC revisions.  This makes sure the correct subdriver name is
printed later.

Fixes: 0c151062f32c9db8 ("sh-pfc: Add support for SoC-specific initialization")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pinctrl/sh-pfc/core.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -529,6 +529,9 @@ static int sh_pfc_probe(struct platform_
 		ret = info->ops->init(pfc);
 		if (ret < 0)
 			return ret;
+
+		/* .init() may have overridden pfc->info */
+		info = pfc->info;
 	}
 
 	pinctrl_provide_dummies();

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 17/22] KEYS: Fix an error code in request_master_key()
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 14/22] pinctrl: sh-pfc: Update info pointer after SoC-specific init Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 18/22] mqueue: fix a use-after-free in sys_mq_notify() Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Mimi Zohar, James Morris

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 57cb17e764ba0aaa169d07796acce54ccfbc6cae upstream.

This function has two callers and neither are able to handle a NULL
return.  Really, -EINVAL is the correct thing return here anyway.  This
fixes some static checker warnings like:

	security/keys/encrypted-keys/encrypted.c:709 encrypted_key_decrypt()
	error: uninitialized symbol 'master_key'.

Fixes: 7e70cb497850 ("keys: add new key-type encrypted")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 security/keys/encrypted-keys/encrypted.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -428,7 +428,7 @@ static int init_blkcipher_desc(struct bl
 static struct key *request_master_key(struct encrypted_key_payload *epayload,
 				      u8 **master_key, size_t *master_keylen)
 {
-	struct key *mkey = NULL;
+	struct key *mkey = ERR_PTR(-EINVAL);
 
 	if (!strncmp(epayload->master_desc, KEY_TRUSTED_PREFIX,
 		     KEY_TRUSTED_PREFIX_LEN)) {

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 18/22] mqueue: fix a use-after-free in sys_mq_notify()
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 17/22] KEYS: Fix an error code in request_master_key() Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:42 ` [PATCH 3.18 19/22] md: fix super_offset endianness in super_1_rdev_size_change Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, GeneBlue, Cong Wang, Andrew Morton,
	Manfred Spraul, Linus Torvalds

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Cong Wang <xiyou.wangcong@gmail.com>

commit f991af3daabaecff34684fd51fac80319d1baad1 upstream.

The retry logic for netlink_attachskb() inside sys_mq_notify()
is nasty and vulnerable:

1) The sock refcnt is already released when retry is needed
2) The fd is controllable by user-space because we already
   release the file refcnt

so we when retry but the fd has been just closed by user-space
during this small window, we end up calling netlink_detachskb()
on the error path which releases the sock again, later when
the user-space closes this socket a use-after-free could be
triggered.

Setting 'sock' to NULL here should be sufficient to fix it.

Reported-by: GeneBlue <geneblue.mail@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 ipc/mqueue.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1239,8 +1239,10 @@ retry:
 
 			timeo = MAX_SCHEDULE_TIMEOUT;
 			ret = netlink_attachskb(sock, nc, &timeo, NULL);
-			if (ret == 1)
+			if (ret == 1) {
+				sock = NULL;
 				goto retry;
+			}
 			if (ret) {
 				sock = NULL;
 				nc = NULL;

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 19/22] md: fix super_offset endianness in super_1_rdev_size_change
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 18/22] mqueue: fix a use-after-free in sys_mq_notify() Greg Kroah-Hartman
@ 2017-07-13 15:42 ` Greg Kroah-Hartman
  2017-07-13 15:43 ` [PATCH 3.18 20/22] staging: vt6556: vnt_start Fix missing call to vnt_key_init_table Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jason Yan, Shaohua Li

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Yan <yanaijie@huawei.com>

commit 3fb632e40d7667d8bedfabc28850ac06d5493f54 upstream.

The sb->super_offset should be big-endian, but the rdev->sb_start is in
host byte order, so fix this by adding cpu_to_le64.

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/md.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1829,7 +1829,7 @@ super_1_rdev_size_change(struct md_rdev
 	}
 	sb = page_address(rdev->sb_page);
 	sb->data_size = cpu_to_le64(num_sectors);
-	sb->super_offset = rdev->sb_start;
+	sb->super_offset = cpu_to_le64(rdev->sb_start);
 	sb->sb_csum = calc_sb_1_csum(sb);
 	md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
 		       rdev->sb_page);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 20/22] staging: vt6556: vnt_start Fix missing call to vnt_key_init_table.
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2017-07-13 15:42 ` [PATCH 3.18 19/22] md: fix super_offset endianness in super_1_rdev_size_change Greg Kroah-Hartman
@ 2017-07-13 15:43 ` Greg Kroah-Hartman
  2017-07-13 15:43 ` [PATCH 3.18 21/22] staging: comedi: fix clean-up of comedi_class in comedi_init() Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Malcolm Priestley

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <tvboxspy@gmail.com>

commit dc32190f2cd41c7dba25363ea7d618d4f5172b4e upstream.

The key table is not intialized correctly without this call.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/vt6656/main_usb.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -539,6 +539,9 @@ static int vnt_start(struct ieee80211_hw
 		goto free_all;
 	}
 
+	if (vnt_key_init_table(priv))
+		goto free_all;
+
 	priv->int_interval = 1;  /* bInterval is set to 1 */
 
 	vnt_int_start_interrupt(priv);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 21/22] staging: comedi: fix clean-up of comedi_class in comedi_init()
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2017-07-13 15:43 ` [PATCH 3.18 20/22] staging: vt6556: vnt_start Fix missing call to vnt_key_init_table Greg Kroah-Hartman
@ 2017-07-13 15:43 ` Greg Kroah-Hartman
  2017-07-13 15:43 ` [PATCH 3.18 22/22] [media] saa7134: fix warm Medion 7134 EEPROM read Greg Kroah-Hartman
  2017-07-14  1:26 ` [PATCH 3.18 00/22] 3.18.61-stable review Guenter Roeck
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ian Abbott

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Abbott <abbotti@mev.co.uk>

commit a9332e9ad09c2644c99058fcf6ae2f355e93ce74 upstream.

There is a clean-up bug in the core comedi module initialization
functions, `comedi_init()`.  If the `comedi_num_legacy_minors` module
parameter is non-zero (and valid), it creates that many "legacy" devices
and registers them in SysFS.  A failure causes the function to clean up
and return an error.  Unfortunately, it fails to destroy the "comedi"
class that was created earlier.  Fix it by adding a call to
`class_destroy(comedi_class)` at the appropriate place in the clean-up
sequence.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/comedi_fops.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2600,6 +2600,7 @@ static int __init comedi_init(void)
 		dev = comedi_alloc_board_minor(NULL);
 		if (IS_ERR(dev)) {
 			comedi_cleanup_board_minors();
+			class_destroy(comedi_class);
 			cdev_del(&comedi_cdev);
 			unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0),
 						 COMEDI_NUM_MINORS);

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3.18 22/22] [media] saa7134: fix warm Medion 7134 EEPROM read
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2017-07-13 15:43 ` [PATCH 3.18 21/22] staging: comedi: fix clean-up of comedi_class in comedi_init() Greg Kroah-Hartman
@ 2017-07-13 15:43 ` Greg Kroah-Hartman
  2017-07-14  1:26 ` [PATCH 3.18 00/22] 3.18.61-stable review Guenter Roeck
  17 siblings, 0 replies; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-13 15:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Maciej S. Szmigiero,
	Mauro Carvalho Chehab, Oliver Hartkopp

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Maciej S. Szmigiero <mail@maciej.szmigiero.name>

commit 5a91206ff0d0548939f3e85a65fb76b400fb0e89 upstream.

When saa7134 module driving a Medion 7134 card is reloaded reads of this
card EEPROM (required for automatic detection of tuner model) will be
corrupted due to I2C gate in DVB-T demod being left closed.
This sometimes also happens on first saa7134 module load after a warm
reboot.

Fix this by opening this I2C gate before doing EEPROM read during i2c
initialization.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/pci/saa7134/saa7134-i2c.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

--- a/drivers/media/pci/saa7134/saa7134-i2c.c
+++ b/drivers/media/pci/saa7134/saa7134-i2c.c
@@ -350,12 +350,43 @@ static struct i2c_client saa7134_client_
 
 /* ----------------------------------------------------------- */
 
+/* On Medion 7134 reading EEPROM needs DVB-T demod i2c gate open */
+static void saa7134_i2c_eeprom_md7134_gate(struct saa7134_dev *dev)
+{
+	u8 subaddr = 0x7, dmdregval;
+	u8 data[2];
+	int ret;
+	struct i2c_msg i2cgatemsg_r[] = { {.addr = 0x08, .flags = 0,
+					   .buf = &subaddr, .len = 1},
+					  {.addr = 0x08,
+					   .flags = I2C_M_RD,
+					   .buf = &dmdregval, .len = 1}
+					};
+	struct i2c_msg i2cgatemsg_w[] = { {.addr = 0x08, .flags = 0,
+					   .buf = data, .len = 2} };
+
+	ret = i2c_transfer(&dev->i2c_adap, i2cgatemsg_r, 2);
+	if ((ret == 2) && (dmdregval & 0x2)) {
+		pr_debug("%s: DVB-T demod i2c gate was left closed\n",
+			 dev->name);
+
+		data[0] = subaddr;
+		data[1] = (dmdregval & ~0x2);
+		if (i2c_transfer(&dev->i2c_adap, i2cgatemsg_w, 1) != 1)
+			pr_err("%s: EEPROM i2c gate open failure\n",
+			  dev->name);
+	}
+}
+
 static int
 saa7134_i2c_eeprom(struct saa7134_dev *dev, unsigned char *eedata, int len)
 {
 	unsigned char buf;
 	int i,err;
 
+	if (dev->board == SAA7134_BOARD_MD7134)
+		saa7134_i2c_eeprom_md7134_gate(dev);
+
 	dev->i2c_client.addr = 0xa0 >> 1;
 	buf = 0;
 	if (1 != (err = i2c_master_send(&dev->i2c_client,&buf,1))) {

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3.18 00/22] 3.18.61-stable review
  2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2017-07-13 15:43 ` [PATCH 3.18 22/22] [media] saa7134: fix warm Medion 7134 EEPROM read Greg Kroah-Hartman
@ 2017-07-14  1:26 ` Guenter Roeck
  2017-07-14  9:31   ` Greg Kroah-Hartman
  17 siblings, 1 reply; 21+ messages in thread
From: Guenter Roeck @ 2017-07-14  1:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, shuahkh, patches, ben.hutchings, stable

On 07/13/2017 08:42 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.18.61 release.
> There are 22 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Sat Jul 15 15:39:17 UTC 2017.
> Anything received after that time might be too late.
> 

Build results:
	total: 136 pass: 135 fail: 1
Failed builds:
	mips:bcm47xx_defconfig
Qemu test results:
	total: 111 pass: 111 fail: 0

Build failure:

drivers/net/ethernet/broadcom/bgmac.c: In function ‘bgmac_dma_rx_read’:
drivers/net/ethernet/broadcom/bgmac.c:376:14: error: 'BGMAC_RX_ALLOC_SIZE’ undeclared
drivers/net/ethernet/broadcom/bgmac.c:379:32: error: ‘buf’ undeclared

Details are available at http://kerneltests.org/builders.

Guenter

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3.18 00/22] 3.18.61-stable review
  2017-07-14  1:26 ` [PATCH 3.18 00/22] 3.18.61-stable review Guenter Roeck
@ 2017-07-14  9:31   ` Greg Kroah-Hartman
  2017-07-14 11:43     ` Amit Pundir
  0 siblings, 1 reply; 21+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-14  9:31 UTC (permalink / raw)
  To: Guenter Roeck, Amit Pundir
  Cc: linux-kernel, torvalds, akpm, shuahkh, patches, ben.hutchings, stable

On Thu, Jul 13, 2017 at 06:26:28PM -0700, Guenter Roeck wrote:
> On 07/13/2017 08:42 AM, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 3.18.61 release.
> > There are 22 patches in this series, all will be posted as a response
> > to this one.  If anyone has any issues with these being applied, please
> > let me know.
> > 
> > Responses should be made by Sat Jul 15 15:39:17 UTC 2017.
> > Anything received after that time might be too late.
> > 
> 
> Build results:
> 	total: 136 pass: 135 fail: 1
> Failed builds:
> 	mips:bcm47xx_defconfig
> Qemu test results:
> 	total: 111 pass: 111 fail: 0
> 
> Build failure:
> 
> drivers/net/ethernet/broadcom/bgmac.c: In function ‘bgmac_dma_rx_read’:
> drivers/net/ethernet/broadcom/bgmac.c:376:14: error: 'BGMAC_RX_ALLOC_SIZE’ undeclared
> drivers/net/ethernet/broadcom/bgmac.c:379:32: error: ‘buf’ undeclared
> 
> Details are available at http://kerneltests.org/builders.

Ick, problem is in patch bgmac-add-check-for-oversized-packets.patch
from Amit.

Amit, how did you test this it obviously doesn't build :(

I'm dropping it from the tree now...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3.18 00/22] 3.18.61-stable review
  2017-07-14  9:31   ` Greg Kroah-Hartman
@ 2017-07-14 11:43     ` Amit Pundir
  0 siblings, 0 replies; 21+ messages in thread
From: Amit Pundir @ 2017-07-14 11:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Guenter Roeck, lkml, Linus Torvalds, Andrew Morton, shuahkh,
	patches, Ben Hutchings, stable

On 14 July 2017 at 15:01, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Thu, Jul 13, 2017 at 06:26:28PM -0700, Guenter Roeck wrote:
>> On 07/13/2017 08:42 AM, Greg Kroah-Hartman wrote:
>> > This is the start of the stable review cycle for the 3.18.61 release.
>> > There are 22 patches in this series, all will be posted as a response
>> > to this one.  If anyone has any issues with these being applied, please
>> > let me know.
>> >
>> > Responses should be made by Sat Jul 15 15:39:17 UTC 2017.
>> > Anything received after that time might be too late.
>> >
>>
>> Build results:
>>       total: 136 pass: 135 fail: 1
>> Failed builds:
>>       mips:bcm47xx_defconfig
>> Qemu test results:
>>       total: 111 pass: 111 fail: 0
>>
>> Build failure:
>>
>> drivers/net/ethernet/broadcom/bgmac.c: In function ‘bgmac_dma_rx_read’:
>> drivers/net/ethernet/broadcom/bgmac.c:376:14: error: 'BGMAC_RX_ALLOC_SIZE’ undeclared
>> drivers/net/ethernet/broadcom/bgmac.c:379:32: error: ‘buf’ undeclared
>>
>> Details are available at http://kerneltests.org/builders.
>
> Ick, problem is in patch bgmac-add-check-for-oversized-packets.patch
> from Amit.
>
> Amit, how did you test this it obviously doesn't build :(

argh.. ARCH=mips allmodconfig didn't catch that. I'm sorry about that.
I'll be more careful next time and build test relevant defconfigs as well.

Regards,
Amit Pundir

>
> I'm dropping it from the tree now...
>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-07-14 11:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-13 15:42 [PATCH 3.18 00/22] 3.18.61-stable review Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 01/22] driver core: platform: fix race condition with driver_override Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 02/22] MIPS: UAPI: Ignore __arch_swab{16,32,64} when using MIPS16 Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 04/22] bgmac: add check for oversized packets Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 06/22] usb: ehci-orion: fix probe for !GENERIC_PHY Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 07/22] tracing/kprobes: Allow to create probe with a module name starting with a digit Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 08/22] usb: dwc3: replace %p with %pK Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 09/22] USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 10/22] Add USB quirk for HVR-950q to avoid intermittent device resets Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 11/22] usb: usbip: set buffer pointers to NULL after free Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 12/22] usb: Fix typo in the definition of Endpoint[out]Request Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 14/22] pinctrl: sh-pfc: Update info pointer after SoC-specific init Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 17/22] KEYS: Fix an error code in request_master_key() Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 18/22] mqueue: fix a use-after-free in sys_mq_notify() Greg Kroah-Hartman
2017-07-13 15:42 ` [PATCH 3.18 19/22] md: fix super_offset endianness in super_1_rdev_size_change Greg Kroah-Hartman
2017-07-13 15:43 ` [PATCH 3.18 20/22] staging: vt6556: vnt_start Fix missing call to vnt_key_init_table Greg Kroah-Hartman
2017-07-13 15:43 ` [PATCH 3.18 21/22] staging: comedi: fix clean-up of comedi_class in comedi_init() Greg Kroah-Hartman
2017-07-13 15:43 ` [PATCH 3.18 22/22] [media] saa7134: fix warm Medion 7134 EEPROM read Greg Kroah-Hartman
2017-07-14  1:26 ` [PATCH 3.18 00/22] 3.18.61-stable review Guenter Roeck
2017-07-14  9:31   ` Greg Kroah-Hartman
2017-07-14 11:43     ` Amit Pundir

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.