stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.9 00/32] 4.9.49-stable review
@ 2017-09-08 13:19 Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 01/32] usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard Greg Kroah-Hartman
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 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 4.9.49 release.
There are 32 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 Sun Sep 10 13:18:28 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/v4.x/stable-review/patch-4.9.49-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-4.9.y
and the diffstat can be found below.

thanks,

greg k-h

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

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

John Stultz <john.stultz@linaro.org>
    drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()

John Stultz <john.stultz@linaro.org>
    drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context

Todd Poynor <toddpoynor@google.com>
    scsi: sg: recheck MMAP_IO request length with lock held

Todd Poynor <toddpoynor@google.com>
    scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE

Andrey Korolyov <andrey@xdel.ru>
    cs5536: add support for IDE controller variant

Ben Hutchings <ben@decadent.org.uk>
    workqueue: Fix flag collision

Ilia Mirkin <imirkin@alum.mit.edu>
    drm/nouveau/pci/msi: disable MSI on big-endian platforms by default

Christian Borntraeger <borntraeger@de.ibm.com>
    s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs

Michael Moese <michael.moese@men.de>
    MCB: add support for SC31 to mcb-lpc

Brian Norris <briannorris@chromium.org>
    mwifiex: correct channel stat buffer overflows

Edwin Török <edvin.torok@citrix.com>
    dlm: avoid double-free on error path in dlm_device_{register,unregister}

Luca Coelho <luciano.coelho@intel.com>
    iwlwifi: pci: add new PCI ID for 7265D

Dmitry Tunin <hanipouspilot@gmail.com>
    Bluetooth: Add support of 13d3:3494 RTL8723BE device

Malcolm Priestley <tvboxspy@gmail.com>
    rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter

Oscar Campos <oscar.campos@member.fsf.org>
    Input: trackpoint - assume 3 buttons when buttons detection fails

Rakesh Pillai <pillair@qti.qualcomm.com>
    ath10k: fix memory leak in rx ring buffer allocation

Alexander Shishkin <alexander.shishkin@linux.intel.com>
    intel_th: pci: Add Cannon Lake PCH-LP support

Alexander Shishkin <alexander.shishkin@linux.intel.com>
    intel_th: pci: Add Cannon Lake PCH-H support

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    driver core: bus: Fix a potential double free

Akinobu Mita <akinobu.mita@gmail.com>
    iio: adc: ti-ads1015: add adequate wait time to get correct conversion

Akinobu Mita <akinobu.mita@gmail.com>
    iio: adc: ti-ads1015: don't return invalid value from buffer setup callbacks

Akinobu Mita <akinobu.mita@gmail.com>
    iio: adc: ti-ads1015: avoid getting stale result after runtime resume

Akinobu Mita <akinobu.mita@gmail.com>
    iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set

Akinobu Mita <akinobu.mita@gmail.com>
    iio: adc: ti-ads1015: fix scale information for ADS1115

Akinobu Mita <akinobu.mita@gmail.com>
    iio: adc: ti-ads1015: fix incorrect data rate setting update

Colin Ian King <colin.king@canonical.com>
    staging/rts5208: fix incorrect shift to extract upper nybble

Douglas Anderson <dianders@chromium.org>
    USB: core: Avoid race of async_completed() w/ usbdev_release()

Johan Hovold <johan@kernel.org>
    USB: musb: fix external abort on suspend

Sandeep Singh <sandeep.singh@amd.com>
    usb:xhci:Fix regression when ATI chipsets detected

Dmitry Fleytman <dmitry@daynix.com>
    usb: Add device quirk for Logitech HD Pro Webcam C920-C

Maciej S. Szmigiero <mail@maciej.szmigiero.name>
    USB: serial: option: add support for D-Link DWM-157 C1

Kai-Heng Feng <kai.heng.feng@canonical.com>
    usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard


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

Diffstat:

 Makefile                                        |   4 +-
 arch/s390/include/asm/pgtable.h                 |   2 +-
 arch/s390/mm/gmap.c                             |  39 ++++++--
 drivers/ata/pata_amd.c                          |   1 +
 drivers/ata/pata_cs5536.c                       |   1 +
 drivers/base/bus.c                              |   2 +-
 drivers/bluetooth/btusb.c                       |   1 +
 drivers/gpu/drm/bridge/adv7511/adv7511.h        |   2 +
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c    |  25 ++++-
 drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c  |   4 +
 drivers/hwtracing/intel_th/pci.c                |  10 ++
 drivers/iio/adc/ti-ads1015.c                    | 123 ++++++++++++++----------
 drivers/input/mouse/trackpoint.c                |   4 +-
 drivers/mcb/mcb-lpc.c                           |  15 +++
 drivers/net/wireless/ath/ath10k/core.c          |  12 +--
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c   |   1 +
 drivers/net/wireless/marvell/mwifiex/cfg80211.c |   2 +-
 drivers/net/wireless/marvell/mwifiex/scan.c     |   6 ++
 drivers/net/wireless/realtek/rtlwifi/pci.c      |   4 +-
 drivers/scsi/sg.c                               |  19 +++-
 drivers/staging/rts5208/rtsx_scsi.c             |   2 +-
 drivers/usb/core/devio.c                        |   4 +-
 drivers/usb/core/quirks.c                       |   6 +-
 drivers/usb/host/pci-quirks.c                   |  35 +++----
 drivers/usb/musb/musb_core.c                    |  18 ++--
 drivers/usb/serial/option.c                     |   1 +
 fs/dlm/user.c                                   |   4 +
 include/linux/pci_ids.h                         |   1 +
 include/linux/workqueue.h                       |   2 +-
 29 files changed, 241 insertions(+), 109 deletions(-)

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

* [PATCH 4.9 01/32] usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 02/32] USB: serial: option: add support for D-Link DWM-157 C1 Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Kai-Heng Feng

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

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

From: Kai-Heng Feng <kai.heng.feng@canonical.com>

commit de3af5bf259d7a0bfaac70441c8568ab5998d80c upstream.

Corsair Strafe RGB keyboard has trouble to initialize:

[ 1.679455] usb 3-6: new full-speed USB device number 4 using xhci_hcd
[ 6.871136] usb 3-6: unable to read config index 0 descriptor/all
[ 6.871138] usb 3-6: can't read configurations, error -110
[ 6.991019] usb 3-6: new full-speed USB device number 5 using xhci_hcd
[ 12.246642] usb 3-6: unable to read config index 0 descriptor/all
[ 12.246644] usb 3-6: can't read configurations, error -110
[ 12.366555] usb 3-6: new full-speed USB device number 6 using xhci_hcd
[ 17.622145] usb 3-6: unable to read config index 0 descriptor/all
[ 17.622147] usb 3-6: can't read configurations, error -110
[ 17.742093] usb 3-6: new full-speed USB device number 7 using xhci_hcd
[ 22.997715] usb 3-6: unable to read config index 0 descriptor/all
[ 22.997716] usb 3-6: can't read configurations, error -110

Although it may work after several times unpluging/pluging:

[ 68.195240] usb 3-6: new full-speed USB device number 11 using xhci_hcd
[ 68.337459] usb 3-6: New USB device found, idVendor=1b1c, idProduct=1b20
[ 68.337463] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 68.337466] usb 3-6: Product: Corsair STRAFE RGB Gaming Keyboard
[ 68.337468] usb 3-6: Manufacturer: Corsair
[ 68.337470] usb 3-6: SerialNumber: 0F013021AEB8046755A93ED3F5001941

Tried three quirks: USB_QUIRK_DELAY_INIT, USB_QUIRK_NO_LPM and
USB_QUIRK_DEVICE_QUALIFIER, user confirmed that USB_QUIRK_DELAY_INIT alone
can workaround this issue. Hence add the quirk for Corsair Strafe RGB.

BugLink: https://bugs.launchpad.net/bugs/1678477
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -217,6 +217,9 @@ static const struct usb_device_id usb_qu
 	{ USB_DEVICE(0x1a0a, 0x0200), .driver_info =
 			USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
 
+	/* Corsair Strafe RGB */
+	{ USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT },
+
 	/* Acer C120 LED Projector */
 	{ USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM },
 

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

* [PATCH 4.9 02/32] USB: serial: option: add support for D-Link DWM-157 C1
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 01/32] usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 03/32] usb: Add device quirk for Logitech HD Pro Webcam C920-C Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Maciej S. Szmigiero, Johan Hovold

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

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

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

commit 169e86546f5712179709de23cd64bbb15f199fab upstream.

This commit adds support (an ID, really) for D-Link DWM-157 hardware
version C1 USB modem to option driver.

According to manufacturer-provided Windows INF file the device has four
serial ports:
"D-Link HSPA+DataCard Diagnostics Interface" (interface 2; modem port),
"D-Link HSPA+DataCard NMEA Device" (interface 3),
"D-Link HSPA+DataCard Speech Port" (interface 4),
"D-Link HSPA+DataCard Debug Port" (interface 5).

usb-devices output:
T:  Bus=05 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2001 ProdID=7d0e Rev=03.00
S:  Manufacturer=D-Link,Inc
S:  Product=D-Link DWM-157
C:  #Ifs= 7 Cfg#= 1 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=02 Prot=01 Driver=option
I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2023,6 +2023,7 @@ static const struct usb_device_id option
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) },			/* D-Link DWM-158 */
+	{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d0e, 0xff) },			/* D-Link DWM-157 C1 */
 	{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff),			/* D-Link DWM-221 B1 */
 	  .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff),			/* D-Link DWM-222 */

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

* [PATCH 4.9 03/32] usb: Add device quirk for Logitech HD Pro Webcam C920-C
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 01/32] usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 02/32] USB: serial: option: add support for D-Link DWM-157 C1 Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 04/32] usb:xhci:Fix regression when ATI chipsets detected Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Dmitry Fleytman

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

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

From: Dmitry Fleytman <dmitry@daynix.com>

commit a1279ef74eeeb5f627f091c71d80dd7ac766c99d upstream.

Commit e0429362ab15
("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e")
introduced quirk to workaround an issue with some Logitech webcams.

Apparently model C920-C has the same issue so applying
the same quirk as well.

See aforementioned commit message for detailed explanation of the problem.

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -57,8 +57,9 @@ static const struct usb_device_id usb_qu
 	/* Microsoft LifeCam-VX700 v2.0 */
 	{ USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
 
-	/* Logitech HD Pro Webcams C920 and C930e */
+	/* Logitech HD Pro Webcams C920, C920-C and C930e */
 	{ USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
+	{ USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
 	{ USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
 
 	/* Logitech ConferenceCam CC3000e */

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

* [PATCH 4.9 04/32] usb:xhci:Fix regression when ATI chipsets detected
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 03/32] usb: Add device quirk for Logitech HD Pro Webcam C920-C Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 05/32] USB: musb: fix external abort on suspend Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ben Hutchings, Nehal Shah,
	Sandeep Singh, Shyam Sundar S K

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

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

From: Sandeep Singh <sandeep.singh@amd.com>

commit e6b422b88b46353cf596e0db6dc0e39d50d90d6e upstream.

The following commit cause a regression on ATI chipsets.
'commit e788787ef4f9 ("usb:xhci:Add quirk for Certain
failing HP keyboard on reset after resume")'

This causes pinfo->smbus_dev to be wrongly set to NULL on
systems with the ATI chipset that this function checks for first.

Added conditional check for AMD chipsets to avoid the overwriting
pinfo->smbus_dev.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: e788787ef4f9 ("usb:xhci:Add quirk for Certain
failing HP keyboard on reset after resume")
cc: Nehal Shah <Nehal-bakulchandra.Shah@amd.com>
Signed-off-by: Sandeep Singh <Sandeep.Singh@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/host/pci-quirks.c |   35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -142,29 +142,30 @@ static int amd_chipset_sb_type_init(stru
 			pinfo->sb_type.gen = AMD_CHIPSET_SB700;
 		else if (rev >= 0x40 && rev <= 0x4f)
 			pinfo->sb_type.gen = AMD_CHIPSET_SB800;
-	}
-	pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
-					  0x145c, NULL);
-	if (pinfo->smbus_dev) {
-		pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN;
 	} else {
 		pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
 				PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL);
 
-		if (!pinfo->smbus_dev) {
-			pinfo->sb_type.gen = NOT_AMD_CHIPSET;
-			return 0;
+		if (pinfo->smbus_dev) {
+			rev = pinfo->smbus_dev->revision;
+			if (rev >= 0x11 && rev <= 0x14)
+				pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2;
+			else if (rev >= 0x15 && rev <= 0x18)
+				pinfo->sb_type.gen = AMD_CHIPSET_BOLTON;
+			else if (rev >= 0x39 && rev <= 0x3a)
+				pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE;
+		} else {
+			pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
+							  0x145c, NULL);
+			if (pinfo->smbus_dev) {
+				rev = pinfo->smbus_dev->revision;
+				pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN;
+			} else {
+				pinfo->sb_type.gen = NOT_AMD_CHIPSET;
+				return 0;
+			}
 		}
-
-		rev = pinfo->smbus_dev->revision;
-		if (rev >= 0x11 && rev <= 0x14)
-			pinfo->sb_type.gen = AMD_CHIPSET_HUDSON2;
-		else if (rev >= 0x15 && rev <= 0x18)
-			pinfo->sb_type.gen = AMD_CHIPSET_BOLTON;
-		else if (rev >= 0x39 && rev <= 0x3a)
-			pinfo->sb_type.gen = AMD_CHIPSET_YANGTZE;
 	}
-
 	pinfo->sb_type.rev = rev;
 	return 1;
 }

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

* [PATCH 4.9 05/32] USB: musb: fix external abort on suspend
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 04/32] usb:xhci:Fix regression when ATI chipsets detected Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 06/32] USB: core: Avoid race of async_completed() w/ usbdev_release() Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alan Stern, Daniel Mack, Dave Gerlach,
	Rafael J. Wysocki, Sebastian Andrzej Siewior, Tony Lindgren,
	Johan Hovold, Bin Liu

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

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

From: Johan Hovold <johan@kernel.org>

commit 082df8be455ade361748f0385aa6c9c8d07be167 upstream.

Make sure that the controller is runtime resumed when system suspending
to avoid an external abort when accessing the interrupt registers:

  Unhandled fault: external abort on non-linefetch (0x1008) at 0xd025840a
  ...
  [<c05481a4>] (musb_default_readb) from [<c0545abc>] (musb_disable_interrupts+0x84/0xa8)
  [<c0545abc>] (musb_disable_interrupts) from [<c0546b08>] (musb_suspend+0x38/0xb8)
  [<c0546b08>] (musb_suspend) from [<c04a57f8>] (platform_pm_suspend+0x3c/0x64)

This is easily reproduced on a BBB by enabling the peripheral port only
(as the host port may enable the shared clock) and keeping it
disconnected so that the controller is runtime suspended. (Well, you
would also need to the not-yet-merged am33xx-suspend patches by Dave
Gerlach to be able to suspend the BBB.)

This is a regression that was introduced by commit 1c4d0b4e1806 ("usb:
musb: Remove pm_runtime_set_irq_safe") which allowed the parent glue
device to runtime suspend and thereby exposed a couple of older issues:

Register accesses without explicitly making sure the controller is
runtime resumed during suspend was first introduced by commit c338412b5ded
("usb: musb: unconditionally save and restore the context on suspend")
in 3.14.

Commit a1fc1920aaaa ("usb: musb: core: make sure musb is in RPM_ACTIVE on
resume") later started setting the RPM status to active during resume,
and this was also implicitly relying on the parent always being active.
Since commit 71723f95463d ("PM / runtime: print error when activating a
child to unactive parent") this now also results in the following
warning:

  musb-hdrc musb-hdrc.0: runtime PM trying to activate child device
    musb-hdrc.0 but parent (47401400.usb) is not active

This patch has been verified on 4.13-rc2, 4.12 and 4.9 using a BBB
(the dsps glue would always be active also in 4.8).

Fixes: c338412b5ded ("usb: musb: unconditionally save and restore the context on suspend")
Fixes: a1fc1920aaaa ("usb: musb: core: make sure musb is in RPM_ACTIVE on resume")
Fixes: 1c4d0b4e1806 ("usb: musb: Remove pm_runtime_set_irq_safe")
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Dave Gerlach <d-gerlach@ti.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/musb/musb_core.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2655,6 +2655,13 @@ static int musb_suspend(struct device *d
 {
 	struct musb	*musb = dev_to_musb(dev);
 	unsigned long	flags;
+	int ret;
+
+	ret = pm_runtime_get_sync(dev);
+	if (ret < 0) {
+		pm_runtime_put_noidle(dev);
+		return ret;
+	}
 
 	musb_platform_disable(musb);
 	musb_generic_disable(musb);
@@ -2703,14 +2710,6 @@ static int musb_resume(struct device *de
 	if ((devctl & mask) != (musb->context.devctl & mask))
 		musb->port1_status = 0;
 
-	/*
-	 * The USB HUB code expects the device to be in RPM_ACTIVE once it came
-	 * out of suspend
-	 */
-	pm_runtime_disable(dev);
-	pm_runtime_set_active(dev);
-	pm_runtime_enable(dev);
-
 	musb_start(musb);
 
 	spin_lock_irqsave(&musb->lock, flags);
@@ -2720,6 +2719,9 @@ static int musb_resume(struct device *de
 			error);
 	spin_unlock_irqrestore(&musb->lock, flags);
 
+	pm_runtime_mark_last_busy(dev);
+	pm_runtime_put_autosuspend(dev);
+
 	return 0;
 }
 

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

* [PATCH 4.9 06/32] USB: core: Avoid race of async_completed() w/ usbdev_release()
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 05/32] USB: musb: fix external abort on suspend Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 07/32] staging/rts5208: fix incorrect shift to extract upper nybble Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Douglas Anderson, Alan Stern

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

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

From: Douglas Anderson <dianders@chromium.org>

commit ed62ca2f4f51c17841ea39d98c0c409cb53a3e10 upstream.

While running reboot tests w/ a specific set of USB devices (and
slub_debug enabled), I found that once every few hours my device would
be crashed with a stack that looked like this:

[   14.012445] BUG: spinlock bad magic on CPU#0, modprobe/2091
[   14.012460]  lock: 0xffffffc0cb055978, .magic: ffffffc0, .owner: cryption contexts: %lu/%lu
[   14.012460] /1025536097, .owner_cpu: 0
[   14.012466] CPU: 0 PID: 2091 Comm: modprobe Not tainted 4.4.79 #352
[   14.012468] Hardware name: Google Kevin (DT)
[   14.012471] Call trace:
[   14.012483] [<....>] dump_backtrace+0x0/0x160
[   14.012487] [<....>] show_stack+0x20/0x28
[   14.012494] [<....>] dump_stack+0xb4/0xf0
[   14.012500] [<....>] spin_dump+0x8c/0x98
[   14.012504] [<....>] spin_bug+0x30/0x3c
[   14.012508] [<....>] do_raw_spin_lock+0x40/0x164
[   14.012515] [<....>] _raw_spin_lock_irqsave+0x64/0x74
[   14.012521] [<....>] __wake_up+0x2c/0x60
[   14.012528] [<....>] async_completed+0x2d0/0x300
[   14.012534] [<....>] __usb_hcd_giveback_urb+0xc4/0x138
[   14.012538] [<....>] usb_hcd_giveback_urb+0x54/0xf0
[   14.012544] [<....>] xhci_irq+0x1314/0x1348
[   14.012548] [<....>] usb_hcd_irq+0x40/0x50
[   14.012553] [<....>] handle_irq_event_percpu+0x1b4/0x3f0
[   14.012556] [<....>] handle_irq_event+0x4c/0x7c
[   14.012561] [<....>] handle_fasteoi_irq+0x158/0x1c8
[   14.012564] [<....>] generic_handle_irq+0x30/0x44
[   14.012568] [<....>] __handle_domain_irq+0x90/0xbc
[   14.012572] [<....>] gic_handle_irq+0xcc/0x18c

Investigation using kgdb() found that the wait queue that was passed
into wake_up() had been freed (it was filled with slub_debug poison).

I analyzed and instrumented the code and reproduced.  My current
belief is that this is happening:

1. async_completed() is called (from IRQ).  Moves "as" onto the
   completed list.
2. On another CPU, proc_reapurbnonblock_compat() calls
   async_getcompleted().  Blocks on spinlock.
3. async_completed() releases the lock; keeps running; gets blocked
   midway through wake_up().
4. proc_reapurbnonblock_compat() => async_getcompleted() gets the
   lock; removes "as" from completed list and frees it.
5. usbdev_release() is called.  Frees "ps".
6. async_completed() finally continues running wake_up().  ...but
   wake_up() has a pointer to the freed "ps".

The instrumentation that led me to believe this was based on adding
some trace_printk() calls in a select few functions and then using
kdb's "ftdump" at crash time.  The trace follows (NOTE: in the trace
below I cheated a little bit and added a udelay(1000) in
async_completed() after releasing the spinlock because I wanted it to
trigger quicker):

<...>-2104   0d.h2 13759034us!: async_completed at start: as=ffffffc0cc638200
mtpd-2055    3.... 13759356us : async_getcompleted before spin_lock_irqsave
mtpd-2055    3d..1 13759362us : async_getcompleted after list_del_init: as=ffffffc0cc638200
mtpd-2055    3.... 13759371us+: proc_reapurbnonblock_compat: free_async(ffffffc0cc638200)
mtpd-2055    3.... 13759422us+: async_getcompleted before spin_lock_irqsave
mtpd-2055    3.... 13759479us : usbdev_release at start: ps=ffffffc0cc042080
mtpd-2055    3.... 13759487us : async_getcompleted before spin_lock_irqsave
mtpd-2055    3.... 13759497us!: usbdev_release after kfree(ps): ps=ffffffc0cc042080
<...>-2104   0d.h2 13760294us : async_completed before wake_up(): as=ffffffc0cc638200

To fix this problem we can just move the wake_up() under the ps->lock.
There should be no issues there that I'm aware of.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -629,6 +629,8 @@ static void async_completed(struct urb *
 	if (as->status < 0 && as->bulk_addr && as->status != -ECONNRESET &&
 			as->status != -ENOENT)
 		cancel_bulk_urbs(ps, as->bulk_addr);
+
+	wake_up(&ps->wait);
 	spin_unlock(&ps->lock);
 
 	if (signr) {
@@ -636,8 +638,6 @@ static void async_completed(struct urb *
 		put_pid(pid);
 		put_cred(cred);
 	}
-
-	wake_up(&ps->wait);
 }
 
 static void destroy_async(struct usb_dev_state *ps, struct list_head *list)

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

* [PATCH 4.9 07/32] staging/rts5208: fix incorrect shift to extract upper nybble
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 06/32] USB: core: Avoid race of async_completed() w/ usbdev_release() Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 08/32] iio: adc: ti-ads1015: fix incorrect data rate setting update Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Colin Ian King

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

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

From: Colin Ian King <colin.king@canonical.com>

commit 34ff1bf4920471cff66775dc39537b15c5f0feff upstream.

The mask of sns_key_info1 suggests the upper nybble is being extracted
however the following shift of 8 bits is too large and always results in
0.  Fix this by shifting only by 4 bits to correctly get the upper nybble.

Detected by CoverityScan, CID#142891 ("Operands don't affect result")

Fixes: fa590c222fba ("staging: rts5208: add support for rts5208 and rts5288")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/staging/rts5208/rtsx_scsi.c
+++ b/drivers/staging/rts5208/rtsx_scsi.c
@@ -414,7 +414,7 @@ void set_sense_data(struct rtsx_chip *ch
 	sense->ascq = ascq;
 	if (sns_key_info0 != 0) {
 		sense->sns_key_info[0] = SKSV | sns_key_info0;
-		sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 8;
+		sense->sns_key_info[1] = (sns_key_info1 & 0xf0) >> 4;
 		sense->sns_key_info[2] = sns_key_info1 & 0x0f;
 	}
 }

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

* [PATCH 4.9 08/32] iio: adc: ti-ads1015: fix incorrect data rate setting update
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 07/32] staging/rts5208: fix incorrect shift to extract upper nybble Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 09/32] iio: adc: ti-ads1015: fix scale information for ADS1115 Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Baluta, Akinobu Mita,
	Jonathan Cameron

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

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

From: Akinobu Mita <akinobu.mita@gmail.com>

commit 0d106b74c558e3000aa0e058b4725cacb70ce77a upstream.

The ti-ads1015 driver has eight iio voltage channels and each iio channel
can hold own sampling frequency information.

The ADS1015 device only have a single config register which contains an
input multiplexer selection, PGA and data rate settings.  So the driver
should load the correct settings when the input multiplexer selection is
changed.

However, regardless of which channlel is currently selected, changing any
iio channel's sampling frequency information immediately overwrites the
current data rate setting in the config register.

It breaks the current data rate setting if the different channel's sampling
frequency information is changed because the data rate setting is not
reloaded when the input multiplexer is switched.

This removes the unexpected config register update and correctly load the
data rate setting before getting adc result.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/ti-ads1015.c |   27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -251,9 +251,11 @@ int ads1015_get_adc_result(struct ads101
 
 	ret = regmap_update_bits_check(data->regmap, ADS1015_CFG_REG,
 				       ADS1015_CFG_MUX_MASK |
-				       ADS1015_CFG_PGA_MASK,
+				       ADS1015_CFG_PGA_MASK |
+				       ADS1015_CFG_DR_MASK,
 				       chan << ADS1015_CFG_MUX_SHIFT |
-				       pga << ADS1015_CFG_PGA_SHIFT,
+				       pga << ADS1015_CFG_PGA_SHIFT |
+				       dr << ADS1015_CFG_DR_SHIFT,
 				       &change);
 	if (ret < 0)
 		return ret;
@@ -324,25 +326,16 @@ static int ads1015_set_scale(struct ads1
 
 static int ads1015_set_data_rate(struct ads1015_data *data, int chan, int rate)
 {
-	int i, ret, rindex = -1;
+	int i;
 
-	for (i = 0; i < ARRAY_SIZE(ads1015_data_rate); i++)
+	for (i = 0; i < ARRAY_SIZE(ads1015_data_rate); i++) {
 		if (data->data_rate[i] == rate) {
-			rindex = i;
-			break;
+			data->channel_data[chan].data_rate = i;
+			return 0;
 		}
-	if (rindex < 0)
-		return -EINVAL;
-
-	ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG,
-				 ADS1015_CFG_DR_MASK,
-				 rindex << ADS1015_CFG_DR_SHIFT);
-	if (ret < 0)
-		return ret;
-
-	data->channel_data[chan].data_rate = rindex;
+	}
 
-	return 0;
+	return -EINVAL;
 }
 
 static int ads1015_read_raw(struct iio_dev *indio_dev,

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

* [PATCH 4.9 09/32] iio: adc: ti-ads1015: fix scale information for ADS1115
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 08/32] iio: adc: ti-ads1015: fix incorrect data rate setting update Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 10/32] iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Baluta, Akinobu Mita,
	Jonathan Cameron

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

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

From: Akinobu Mita <akinobu.mita@gmail.com>

commit 8d0e8e795623bd6229cf48bb7777a1c456c370ed upstream.

The ti-ads1015 driver supports ADS1015 and ADS1115 devices.  The same
scale information is used for both devices in this driver, however they
have actually different values and the ADS1115's one is not correct.

These devices have the same full-scale input voltage range for each PGA
selection.  So instead of adding another hardcoded scale information,
compute a correct scale on demand from each device's resolution.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/ti-ads1015.c |   48 +++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -80,18 +80,12 @@ static const unsigned int ads1115_data_r
 	8, 16, 32, 64, 128, 250, 475, 860
 };
 
-static const struct {
-	int scale;
-	int uscale;
-} ads1015_scale[] = {
-	{3, 0},
-	{2, 0},
-	{1, 0},
-	{0, 500000},
-	{0, 250000},
-	{0, 125000},
-	{0, 125000},
-	{0, 125000},
+/*
+ * Translation from PGA bits to full-scale positive and negative input voltage
+ * range in mV
+ */
+static int ads1015_fullscale_range[] = {
+	6144, 4096, 2048, 1024, 512, 256, 256, 256
 };
 
 #define ADS1015_V_CHAN(_chan, _addr) {				\
@@ -299,17 +293,20 @@ err:
 	return IRQ_HANDLED;
 }
 
-static int ads1015_set_scale(struct ads1015_data *data, int chan,
+static int ads1015_set_scale(struct ads1015_data *data,
+			     struct iio_chan_spec const *chan,
 			     int scale, int uscale)
 {
 	int i, ret, rindex = -1;
+	int fullscale = div_s64((scale * 1000000LL + uscale) <<
+				(chan->scan_type.realbits - 1), 1000000);
 
-	for (i = 0; i < ARRAY_SIZE(ads1015_scale); i++)
-		if (ads1015_scale[i].scale == scale &&
-		    ads1015_scale[i].uscale == uscale) {
+	for (i = 0; i < ARRAY_SIZE(ads1015_fullscale_range); i++) {
+		if (ads1015_fullscale_range[i] == fullscale) {
 			rindex = i;
 			break;
 		}
+	}
 	if (rindex < 0)
 		return -EINVAL;
 
@@ -319,7 +316,7 @@ static int ads1015_set_scale(struct ads1
 	if (ret < 0)
 		return ret;
 
-	data->channel_data[chan].pga = rindex;
+	data->channel_data[chan->address].pga = rindex;
 
 	return 0;
 }
@@ -377,9 +374,9 @@ static int ads1015_read_raw(struct iio_d
 	}
 	case IIO_CHAN_INFO_SCALE:
 		idx = data->channel_data[chan->address].pga;
-		*val = ads1015_scale[idx].scale;
-		*val2 = ads1015_scale[idx].uscale;
-		ret = IIO_VAL_INT_PLUS_MICRO;
+		*val = ads1015_fullscale_range[idx];
+		*val2 = chan->scan_type.realbits - 1;
+		ret = IIO_VAL_FRACTIONAL_LOG2;
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
 		idx = data->channel_data[chan->address].data_rate;
@@ -406,7 +403,7 @@ static int ads1015_write_raw(struct iio_
 	mutex_lock(&data->lock);
 	switch (mask) {
 	case IIO_CHAN_INFO_SCALE:
-		ret = ads1015_set_scale(data, chan->address, val, val2);
+		ret = ads1015_set_scale(data, chan, val, val2);
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
 		ret = ads1015_set_data_rate(data, chan->address, val);
@@ -438,7 +435,10 @@ static const struct iio_buffer_setup_ops
 	.validate_scan_mask = &iio_validate_scan_mask_onehot,
 };
 
-static IIO_CONST_ATTR(scale_available, "3 2 1 0.5 0.25 0.125");
+static IIO_CONST_ATTR_NAMED(ads1015_scale_available, scale_available,
+	"3 2 1 0.5 0.25 0.125");
+static IIO_CONST_ATTR_NAMED(ads1115_scale_available, scale_available,
+	"0.1875 0.125 0.0625 0.03125 0.015625 0.007813");
 
 static IIO_CONST_ATTR_NAMED(ads1015_sampling_frequency_available,
 	sampling_frequency_available, "128 250 490 920 1600 2400 3300");
@@ -446,7 +446,7 @@ static IIO_CONST_ATTR_NAMED(ads1115_samp
 	sampling_frequency_available, "8 16 32 64 128 250 475 860");
 
 static struct attribute *ads1015_attributes[] = {
-	&iio_const_attr_scale_available.dev_attr.attr,
+	&iio_const_attr_ads1015_scale_available.dev_attr.attr,
 	&iio_const_attr_ads1015_sampling_frequency_available.dev_attr.attr,
 	NULL,
 };
@@ -456,7 +456,7 @@ static const struct attribute_group ads1
 };
 
 static struct attribute *ads1115_attributes[] = {
-	&iio_const_attr_scale_available.dev_attr.attr,
+	&iio_const_attr_ads1115_scale_available.dev_attr.attr,
 	&iio_const_attr_ads1115_sampling_frequency_available.dev_attr.attr,
 	NULL,
 };

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

* [PATCH 4.9 10/32] iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 09/32] iio: adc: ti-ads1015: fix scale information for ADS1115 Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 11/32] iio: adc: ti-ads1015: avoid getting stale result after runtime resume Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Baluta, Akinobu Mita,
	Jonathan Cameron

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

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

From: Akinobu Mita <akinobu.mita@gmail.com>

commit e8245c68350104b6022b6783719e843d69ea7c43 upstream.

The ADS1015 device have two operating modes, continuous conversion mode
and single-shot mode.  This driver assumes that the continuous conversion
mode is selected by runtime resume callback when the ADC result is
requested.

If CONFIG_PM is disabled, the device is always in the default single-shot
mode and no one begins a single conversion.  So the conversion register
doesn't contain valid ADC result.  Fix it by changing the continuous mode
in probe function.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/ti-ads1015.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -617,6 +617,13 @@ static int ads1015_probe(struct i2c_clie
 		dev_err(&client->dev, "iio triggered buffer setup failed\n");
 		return ret;
 	}
+
+	ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG,
+				ADS1015_CFG_MOD_MASK,
+				ADS1015_CONTINUOUS << ADS1015_CFG_MOD_SHIFT);
+	if (ret)
+		return ret;
+
 	ret = pm_runtime_set_active(&client->dev);
 	if (ret)
 		goto err_buffer_cleanup;

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

* [PATCH 4.9 11/32] iio: adc: ti-ads1015: avoid getting stale result after runtime resume
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 10/32] iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 12/32] iio: adc: ti-ads1015: dont return invalid value from buffer setup callbacks Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Baluta, Akinobu Mita,
	Jonathan Cameron

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

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

From: Akinobu Mita <akinobu.mita@gmail.com>

commit 73e3e3fc50de50cfd68e945d85679c983ed31bd9 upstream.

This driver assumes that the device is operating in the continuous
conversion mode which performs the conversion continuously.  So this driver
doesn't insert a wait time before reading the conversion register if the
configuration is not changed from a previous request.

This assumption is broken if the device is runtime suspended and entered
a power-down state.  The forthcoming request causes reading a stale result
from the conversion register as the device is runtime resumed just before.

Fix it by adding a flag to detect that condition and insert a necessary
wait time.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/ti-ads1015.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -176,6 +176,12 @@ struct ads1015_data {
 	struct ads1015_channel_data channel_data[ADS1015_CHANNELS];
 
 	unsigned int *data_rate;
+	/*
+	 * Set to true when the ADC is switched to the continuous-conversion
+	 * mode and exits from a power-down state.  This flag is used to avoid
+	 * getting the stale result from the conversion register.
+	 */
+	bool conv_invalid;
 };
 
 static bool ads1015_is_writeable_reg(struct device *dev, unsigned int reg)
@@ -254,9 +260,10 @@ int ads1015_get_adc_result(struct ads101
 	if (ret < 0)
 		return ret;
 
-	if (change) {
+	if (change || data->conv_invalid) {
 		conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]);
 		usleep_range(conv_time, conv_time + 1);
+		data->conv_invalid = false;
 	}
 
 	return regmap_read(data->regmap, ADS1015_CONV_REG, val);
@@ -624,6 +631,8 @@ static int ads1015_probe(struct i2c_clie
 	if (ret)
 		return ret;
 
+	data->conv_invalid = true;
+
 	ret = pm_runtime_set_active(&client->dev);
 	if (ret)
 		goto err_buffer_cleanup;
@@ -679,10 +688,15 @@ static int ads1015_runtime_resume(struct
 {
 	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
 	struct ads1015_data *data = iio_priv(indio_dev);
+	int ret;
 
-	return regmap_update_bits(data->regmap, ADS1015_CFG_REG,
+	ret = regmap_update_bits(data->regmap, ADS1015_CFG_REG,
 				  ADS1015_CFG_MOD_MASK,
 				  ADS1015_CONTINUOUS << ADS1015_CFG_MOD_SHIFT);
+	if (!ret)
+		data->conv_invalid = true;
+
+	return ret;
 }
 #endif
 

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

* [PATCH 4.9 12/32] iio: adc: ti-ads1015: dont return invalid value from buffer setup callbacks
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 11/32] iio: adc: ti-ads1015: avoid getting stale result after runtime resume Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 13/32] iio: adc: ti-ads1015: add adequate wait time to get correct conversion Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Baluta, Akinobu Mita,
	Jonathan Cameron

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

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

From: Akinobu Mita <akinobu.mita@gmail.com>

commit a6fe5e52d5ecfc98530034d6c9db73777cf41ede upstream.

pm_runtime_get_sync() and pm_runtime_put_autosuspend() return 0 on
success, 1 if the device's runtime PM status was already requested status
or error code on failure.  So a positive return value doesn't indicate an
error condition.

However, any non-zero return values from buffer preenable and postdisable
callbacks are recognized as an error and this driver reuses the return
value from pm_runtime_get_sync() and pm_runtime_put_autosuspend() in
these callbacks.  This change fixes the false error detections.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/ti-ads1015.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -234,7 +234,7 @@ static int ads1015_set_power_state(struc
 		ret = pm_runtime_put_autosuspend(dev);
 	}
 
-	return ret;
+	return ret < 0 ? ret : 0;
 }
 
 static

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

* [PATCH 4.9 13/32] iio: adc: ti-ads1015: add adequate wait time to get correct conversion
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 12/32] iio: adc: ti-ads1015: dont return invalid value from buffer setup callbacks Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 14/32] driver core: bus: Fix a potential double free Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Baluta, Akinobu Mita,
	Jonathan Cameron

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

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

From: Akinobu Mita <akinobu.mita@gmail.com>

commit 4744d4e2afebf9644a439da9ca73d822fdd67bd9 upstream.

This driver assumes that the device is operating in the continuous
conversion mode which performs the conversion continuously.  So this driver
inserts a wait time before reading the conversion register if the
configuration is changed from a previous request.

Currently, the wait time is only the period required for a single
conversion that is calculated as the reciprocal of the sampling frequency.
However we also need to wait for the the previous conversion to complete.
Otherwise we probably get the conversion result for the previous
configuration when the sampling frequency is lower.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/adc/ti-ads1015.c |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -241,27 +241,34 @@ static
 int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val)
 {
 	int ret, pga, dr, conv_time;
-	bool change;
+	unsigned int old, mask, cfg;
 
 	if (chan < 0 || chan >= ADS1015_CHANNELS)
 		return -EINVAL;
 
+	ret = regmap_read(data->regmap, ADS1015_CFG_REG, &old);
+	if (ret)
+		return ret;
+
 	pga = data->channel_data[chan].pga;
 	dr = data->channel_data[chan].data_rate;
+	mask = ADS1015_CFG_MUX_MASK | ADS1015_CFG_PGA_MASK |
+		ADS1015_CFG_DR_MASK;
+	cfg = chan << ADS1015_CFG_MUX_SHIFT | pga << ADS1015_CFG_PGA_SHIFT |
+		dr << ADS1015_CFG_DR_SHIFT;
 
-	ret = regmap_update_bits_check(data->regmap, ADS1015_CFG_REG,
-				       ADS1015_CFG_MUX_MASK |
-				       ADS1015_CFG_PGA_MASK |
-				       ADS1015_CFG_DR_MASK,
-				       chan << ADS1015_CFG_MUX_SHIFT |
-				       pga << ADS1015_CFG_PGA_SHIFT |
-				       dr << ADS1015_CFG_DR_SHIFT,
-				       &change);
-	if (ret < 0)
+	cfg = (old & ~mask) | (cfg & mask);
+
+	ret = regmap_write(data->regmap, ADS1015_CFG_REG, cfg);
+	if (ret)
 		return ret;
 
-	if (change || data->conv_invalid) {
-		conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]);
+	if (old != cfg || data->conv_invalid) {
+		int dr_old = (old & ADS1015_CFG_DR_MASK) >>
+				ADS1015_CFG_DR_SHIFT;
+
+		conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr_old]);
+		conv_time += DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]);
 		usleep_range(conv_time, conv_time + 1);
 		data->conv_invalid = false;
 	}

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

* [PATCH 4.9 14/32] driver core: bus: Fix a potential double free
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 13/32] iio: adc: ti-ads1015: add adequate wait time to get correct conversion Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 15/32] intel_th: pci: Add Cannon Lake PCH-H support Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Christophe JAILLET

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

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

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

commit 0f9b011d3321ca1079c7a46c18cb1956fbdb7bcb upstream.

The .release function of driver_ktype is 'driver_release()'.
This function frees the container_of this kobject.

So, this memory must not be freed explicitly in the error handling path of
'bus_add_driver()'. Otherwise a double free will occur.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -736,7 +736,7 @@ int bus_add_driver(struct device_driver
 
 out_unregister:
 	kobject_put(&priv->kobj);
-	kfree(drv->p);
+	/* drv->p is freed in driver_release()  */
 	drv->p = NULL;
 out_put_bus:
 	bus_put(bus);

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

* [PATCH 4.9 15/32] intel_th: pci: Add Cannon Lake PCH-H support
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 14/32] driver core: bus: Fix a potential double free Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 16/32] intel_th: pci: Add Cannon Lake PCH-LP support Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Alexander Shishkin

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

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

From: Alexander Shishkin <alexander.shishkin@linux.intel.com>

commit 84331e1390b6378a5129a3678c87a42c6f697d29 upstream.

This adds Intel(R) Trace Hub PCI ID for Cannon Lake PCH-H.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hwtracing/intel_th/pci.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -85,6 +85,11 @@ static const struct pci_device_id intel_
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa2a6),
 		.driver_data = (kernel_ulong_t)0,
 	},
+	{
+		/* Cannon Lake H */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa326),
+		.driver_data = (kernel_ulong_t)0,
+	},
 	{ 0 },
 };
 

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

* [PATCH 4.9 16/32] intel_th: pci: Add Cannon Lake PCH-LP support
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 15/32] intel_th: pci: Add Cannon Lake PCH-H support Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 17/32] ath10k: fix memory leak in rx ring buffer allocation Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Alexander Shishkin

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

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

From: Alexander Shishkin <alexander.shishkin@linux.intel.com>

commit efb3669e14fe17d0ec4ecf57d0365039fe726f59 upstream.

This adds Intel(R) Trace Hub PCI ID for Cannon Lake PCH-LP.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hwtracing/intel_th/pci.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -90,6 +90,11 @@ static const struct pci_device_id intel_
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa326),
 		.driver_data = (kernel_ulong_t)0,
 	},
+	{
+		/* Cannon Lake LP */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9da6),
+		.driver_data = (kernel_ulong_t)0,
+	},
 	{ 0 },
 };
 

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

* [PATCH 4.9 17/32] ath10k: fix memory leak in rx ring buffer allocation
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 16/32] intel_th: pci: Add Cannon Lake PCH-LP support Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 18/32] Input: trackpoint - assume 3 buttons when buttons detection fails Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Rakesh Pillai, Kalle Valo,
	Christian Lamparter

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

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

From: Rakesh Pillai <pillair@qti.qualcomm.com>

commit f35a7f91f66af528b3ee1921de16bea31d347ab0 upstream.

The rx ring buffers are added to a hash table if
firmware support full rx reorder. If the full rx
reorder support flag is not set before allocating
the rx ring buffers, none of the buffers are added
to the hash table.

There is a race condition between rx ring refill and
rx buffer replenish from napi poll. The interrupts are
enabled in hif start, before the rx ring is refilled during init.
We replenish buffers from napi poll due to the interrupts which
get enabled after hif start. Hence before the entire rx ring is
refilled during the init, the napi poll replenishes a few buffers
in steps of 100 buffers per attempt. During this rx ring replenish
from napi poll, the rx reorder flag has not been set due to which
the replenished buffers are not added to the hash table

Set the rx full reorder support flag before we allocate
the rx ring buffer to avoid the memory leak.

Signed-off-by: Rakesh Pillai <pillair@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/ath/ath10k/core.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1852,6 +1852,12 @@ int ath10k_core_start(struct ath10k *ar,
 		goto err_wmi_detach;
 	}
 
+	/* If firmware indicates Full Rx Reorder support it must be used in a
+	 * slightly different manner. Let HTT code know.
+	 */
+	ar->htt.rx_ring.in_ord_rx = !!(test_bit(WMI_SERVICE_RX_FULL_REORDER,
+						ar->wmi.svc_map));
+
 	status = ath10k_htt_rx_alloc(&ar->htt);
 	if (status) {
 		ath10k_err(ar, "failed to alloc htt rx: %d\n", status);
@@ -1964,12 +1970,6 @@ int ath10k_core_start(struct ath10k *ar,
 		}
 	}
 
-	/* If firmware indicates Full Rx Reorder support it must be used in a
-	 * slightly different manner. Let HTT code know.
-	 */
-	ar->htt.rx_ring.in_ord_rx = !!(test_bit(WMI_SERVICE_RX_FULL_REORDER,
-						ar->wmi.svc_map));
-
 	status = ath10k_htt_rx_ring_refill(ar);
 	if (status) {
 		ath10k_err(ar, "failed to refill htt rx ring: %d\n", status);

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

* [PATCH 4.9 18/32] Input: trackpoint - assume 3 buttons when buttons detection fails
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 17/32] ath10k: fix memory leak in rx ring buffer allocation Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 19/32] rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Oscar Campos, Peter Hutterer,
	Dmitry Torokhov, Aaron Ma

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

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

From: Oscar Campos <oscar.campos@member.fsf.org>

commit 293b915fd9bebf33cdc906516fb28d54649a25ac upstream.

Trackpoint buttons detection fails on ThinkPad 570 and 470 series,
this makes the middle button of the trackpoint to not being recogized.
As I don't believe there is any trackpoint with less than 3 buttons this
patch just assumes three buttons when the extended button information
read fails.

Signed-off-by: Oscar Campos <oscar.campos@member.fsf.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/input/mouse/trackpoint.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/input/mouse/trackpoint.c
+++ b/drivers/input/mouse/trackpoint.c
@@ -381,8 +381,8 @@ int trackpoint_detect(struct psmouse *ps
 		return 0;
 
 	if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) {
-		psmouse_warn(psmouse, "failed to get extended button data\n");
-		button_info = 0;
+		psmouse_warn(psmouse, "failed to get extended button data, assuming 3 buttons\n");
+		button_info = 0x33;
 	}
 
 	psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);

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

* [PATCH 4.9 19/32] rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 18/32] Input: trackpoint - assume 3 buttons when buttons detection fails Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 20/32] Bluetooth: Add support of 13d3:3494 RTL8723BE device Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Malcolm Priestley, Kalle Valo

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

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

From: Malcolm Priestley <tvboxspy@gmail.com>

commit fc81bab5eeb103711925d7510157cf5cd2b153f4 upstream.

_rtl_pci_find_adapter fail path will jump to label fail3 for
unsupported adapter types.

However, on course for fail3 there will be call rtl_deinit_core
before rtl_init_core.

For the inclusion of checking pci_iounmap this fail can be moved to
fail2.

Fixes
[    4.492963] BUG: unable to handle kernel NULL pointer dereference at           (null)
[    4.493067] IP: rtl_deinit_core+0x31/0x90 [rtlwifi]

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

---
 drivers/net/wireless/realtek/rtlwifi/pci.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -2269,7 +2269,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	/* find adapter */
 	if (!_rtl_pci_find_adapter(pdev, hw)) {
 		err = -ENODEV;
-		goto fail3;
+		goto fail2;
 	}
 
 	/* Init IO handler */
@@ -2339,10 +2339,10 @@ fail3:
 	pci_set_drvdata(pdev, NULL);
 	rtl_deinit_core(hw);
 
+fail2:
 	if (rtlpriv->io.pci_mem_start != 0)
 		pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start);
 
-fail2:
 	pci_release_regions(pdev);
 	complete(&rtlpriv->firmware_loading_complete);
 

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

* [PATCH 4.9 20/32] Bluetooth: Add support of 13d3:3494 RTL8723BE device
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 19/32] rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 21/32] iwlwifi: pci: add new PCI ID for 7265D Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Dmitry Tunin, Marcel Holtmann

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

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

From: Dmitry Tunin <hanipouspilot@gmail.com>

commit a81d72d2002d6a932bd83022cbf8c442b1b97512 upstream.

T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 2.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=13d3 ProdID=3494 Rev= 2.00
S: Manufacturer=Realtek
S: Product=Bluetooth Radio
S: SerialNumber=00e04c000001
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/bluetooth/btusb.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -342,6 +342,7 @@ static const struct usb_device_id blackl
 	{ USB_DEVICE(0x13d3, 0x3410), .driver_info = BTUSB_REALTEK },
 	{ USB_DEVICE(0x13d3, 0x3416), .driver_info = BTUSB_REALTEK },
 	{ USB_DEVICE(0x13d3, 0x3459), .driver_info = BTUSB_REALTEK },
+	{ USB_DEVICE(0x13d3, 0x3494), .driver_info = BTUSB_REALTEK },
 
 	/* Additional Realtek 8821AE Bluetooth devices */
 	{ USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK },

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

* [PATCH 4.9 21/32] iwlwifi: pci: add new PCI ID for 7265D
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 20/32] Bluetooth: Add support of 13d3:3494 RTL8723BE device Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 23/32] mwifiex: correct channel stat buffer overflows Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Luca Coelho

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

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

From: Luca Coelho <luciano.coelho@intel.com>

commit 3f7a5e13e85026b6e460bbd6e87f87379421d272 upstream.

We have a new PCI subsystem ID for 7265D.  Add it to the list.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -429,6 +429,7 @@ static const struct pci_device_id iwl_hw
 	{IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)},
 	{IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)},
 	{IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)},
+	{IWL_PCI_DEVICE(0x095A, 0x9E10, iwl7265_2ac_cfg)},
 
 /* 8000 Series */
 	{IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)},

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

* [PATCH 4.9 23/32] mwifiex: correct channel stat buffer overflows
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 21/32] iwlwifi: pci: add new PCI ID for 7265D Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 24/32] MCB: add support for SC31 to mcb-lpc Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Avinash Patil, Xinming Hu,
	Brian Norris, Dmitry Torokhov, Ganapathi Bhat, Kalle Valo

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

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

From: Brian Norris <briannorris@chromium.org>

commit 4b5dde2d6234ff5bc68e97e6901d1f2a0a7f3749 upstream.

mwifiex records information about various channels as it receives scan
information. It does this by appending to a buffer that was sized
to the max number of supported channels on any band, but there are
numerous problems:

(a) scans can return info from more than one band (e.g., both 2.4 and 5
    GHz), so the determined "max" is not large enough
(b) some firmware appears to return multiple results for a given
    channel, so the max *really* isn't large enough
(c) there is no bounds checking when stashing these stats, so problems
    (a) and (b) can easily lead to buffer overflows

Let's patch this by setting a slightly-more-correct max (that accounts
for a combination of both 2.4G and 5G bands) and adding a bounds check
when writing to our statistics buffer.

Due to problem (b), we still might not properly report all known survey
information (e.g., with "iw <dev> survey dump"), since duplicate results
(or otherwise "larger than expected" results) will cause some
truncation. But that's a problem for a future bugfix.

(And because of this known deficiency, only log the excess at the WARN
level, since that isn't visible by default in this driver and would
otherwise be a bit too noisy.)

Fixes: bf35443314ac ("mwifiex: channel statistics support for mwifiex")
Cc: Avinash Patil <patila@marvell.com>
Cc: Xinming Hu <huxm@marvell.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c |    2 +-
 drivers/net/wireless/marvell/mwifiex/scan.c     |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4188,7 +4188,7 @@ int mwifiex_init_channel_scan_gap(struct
 	if (adapter->config_bands & BAND_A)
 		n_channels_a = mwifiex_band_5ghz.n_channels;
 
-	adapter->num_in_chan_stats = max_t(u32, n_channels_bg, n_channels_a);
+	adapter->num_in_chan_stats = n_channels_bg + n_channels_a;
 	adapter->chan_stats = vmalloc(sizeof(*adapter->chan_stats) *
 				      adapter->num_in_chan_stats);
 
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -2479,6 +2479,12 @@ mwifiex_update_chan_statistics(struct mw
 					      sizeof(struct mwifiex_chan_stats);
 
 	for (i = 0 ; i < num_chan; i++) {
+		if (adapter->survey_idx >= adapter->num_in_chan_stats) {
+			mwifiex_dbg(adapter, WARN,
+				    "FW reported too many channel results (max %d)\n",
+				    adapter->num_in_chan_stats);
+			return;
+		}
 		chan_stats.chan_num = fw_chan_stats->chan_num;
 		chan_stats.bandcfg = fw_chan_stats->bandcfg;
 		chan_stats.flags = fw_chan_stats->flags;

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

* [PATCH 4.9 24/32] MCB: add support for SC31 to mcb-lpc
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 23/32] mwifiex: correct channel stat buffer overflows Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 25/32] s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Michael Moese, Johannes Thumshirn

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

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

From: Michael Moese <michael.moese@men.de>

commit acf5e051ac44d5dc60b21bc4734ef1b844d55551 upstream.

This patch adds the resources and DMI ID's for the MEN SC31,
which uses a different address region to map the LPC bus than
the one used for the existing SC24.

Signed-off-by: Michael Moese <michael.moese@men.de>
[jth add stable tag]
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mcb/mcb-lpc.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- a/drivers/mcb/mcb-lpc.c
+++ b/drivers/mcb/mcb-lpc.c
@@ -114,6 +114,12 @@ static struct resource sc24_fpga_resourc
 	.flags = IORESOURCE_MEM,
 };
 
+static struct resource sc31_fpga_resource = {
+	.start = 0xf000e000,
+	.end = 0xf000e000 + CHAM_HEADER_SIZE,
+	.flags = IORESOURCE_MEM,
+};
+
 static struct platform_driver mcb_lpc_driver = {
 	.driver		= {
 		.name = "mcb-lpc",
@@ -132,6 +138,15 @@ static const struct dmi_system_id mcb_lp
 		.driver_data = (void *)&sc24_fpga_resource,
 		.callback = mcb_lpc_create_platform_device,
 	},
+	{
+		.ident = "SC31",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "MEN"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "14SC31"),
+		},
+		.driver_data = (void *)&sc31_fpga_resource,
+		.callback = mcb_lpc_create_platform_device,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(dmi, mcb_lpc_dmi_table);

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

* [PATCH 4.9 25/32] s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 24/32] MCB: add support for SC31 to mcb-lpc Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 26/32] drm/nouveau/pci/msi: disable MSI on big-endian platforms by default Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Christian Borntraeger, Janosch Frank,
	Martin Schwidefsky

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

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

From: Christian Borntraeger <borntraeger@de.ibm.com>

commit fa41ba0d08de7c975c3e94d0067553f9b934221f upstream.

Right now there is a potential hang situation for postcopy migrations,
if the guest is enabling storage keys on the target system during the
postcopy process.

For storage key virtualization, we have to forbid the empty zero page as
the storage key is a property of the physical page frame.  As we enable
storage key handling lazily we then drop all mappings for empty zero
pages for lazy refaulting later on.

This does not work with the postcopy migration, which relies on the
empty zero page never triggering a fault again in the future. The reason
is that postcopy migration will simply read a page on the target system
if that page is a known zero page to fault in an empty zero page.  At
the same time postcopy remembers that this page was already transferred
- so any future userfault on that page will NOT be retransmitted again
to avoid races.

If now the guest enters the storage key mode while in postcopy, we will
break this assumption of postcopy.

The solution is to disable the empty zero page for KVM guests early on
and not during storage key enablement. With this change, the postcopy
migration process is guaranteed to start after no zero pages are left.

As guest pages are very likely not empty zero pages anyway the memory
overhead is also pretty small.

While at it this also adds proper page table locking to the zero page
removal.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/s390/include/asm/pgtable.h |    2 +-
 arch/s390/mm/gmap.c             |   39 ++++++++++++++++++++++++++++++++-------
 2 files changed, 33 insertions(+), 8 deletions(-)

--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -480,7 +480,7 @@ static inline int mm_alloc_pgste(struct
  * In the case that a guest uses storage keys
  * faults should no longer be backed by zero pages
  */
-#define mm_forbids_zeropage mm_use_skey
+#define mm_forbids_zeropage mm_has_pgste
 static inline int mm_use_skey(struct mm_struct *mm)
 {
 #ifdef CONFIG_PGSTE
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -2125,6 +2125,37 @@ static inline void thp_split_mm(struct m
 }
 
 /*
+ * Remove all empty zero pages from the mapping for lazy refaulting
+ * - This must be called after mm->context.has_pgste is set, to avoid
+ *   future creation of zero pages
+ * - This must be called after THP was enabled
+ */
+static int __zap_zero_pages(pmd_t *pmd, unsigned long start,
+			   unsigned long end, struct mm_walk *walk)
+{
+	unsigned long addr;
+
+	for (addr = start; addr != end; addr += PAGE_SIZE) {
+		pte_t *ptep;
+		spinlock_t *ptl;
+
+		ptep = pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
+		if (is_zero_pfn(pte_pfn(*ptep)))
+			ptep_xchg_direct(walk->mm, addr, ptep, __pte(_PAGE_INVALID));
+		pte_unmap_unlock(ptep, ptl);
+	}
+	return 0;
+}
+
+static inline void zap_zero_pages(struct mm_struct *mm)
+{
+	struct mm_walk walk = { .pmd_entry = __zap_zero_pages };
+
+	walk.mm = mm;
+	walk_page_range(0, TASK_SIZE, &walk);
+}
+
+/*
  * switch on pgstes for its userspace process (for kvm)
  */
 int s390_enable_sie(void)
@@ -2141,6 +2172,7 @@ int s390_enable_sie(void)
 	mm->context.has_pgste = 1;
 	/* split thp mappings and disable thp for future mappings */
 	thp_split_mm(mm);
+	zap_zero_pages(mm);
 	up_write(&mm->mmap_sem);
 	return 0;
 }
@@ -2153,13 +2185,6 @@ EXPORT_SYMBOL_GPL(s390_enable_sie);
 static int __s390_enable_skey(pte_t *pte, unsigned long addr,
 			      unsigned long next, struct mm_walk *walk)
 {
-	/*
-	 * Remove all zero page mappings,
-	 * after establishing a policy to forbid zero page mappings
-	 * following faults for that page will get fresh anonymous pages
-	 */
-	if (is_zero_pfn(pte_pfn(*pte)))
-		ptep_xchg_direct(walk->mm, addr, pte, __pte(_PAGE_INVALID));
 	/* Clear storage key */
 	ptep_zap_key(walk->mm, addr, pte);
 	return 0;

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

* [PATCH 4.9 26/32] drm/nouveau/pci/msi: disable MSI on big-endian platforms by default
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 25/32] s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 27/32] workqueue: Fix flag collision Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ilia Mirkin, Ben Skeggs

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

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

From: Ilia Mirkin <imirkin@alum.mit.edu>

commit bc60c90f472b6e762ea96ef384072145adc8d4af upstream.

It appears that MSI does not work on either G5 PPC nor on a E5500-based
platform, where other hardware is reported to work fine with MSI.

Both tests were conducted with NV4x hardware, so perhaps other (or even
this) hardware can be made to work. It's still possible to force-enable
with config=NvMSI=1 on load.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c
@@ -192,6 +192,10 @@ nvkm_pci_new_(const struct nvkm_pci_func
 		}
 	}
 
+#ifdef __BIG_ENDIAN
+	pci->msi = false;
+#endif
+
 	pci->msi = nvkm_boolopt(device->cfgopt, "NvMSI", pci->msi);
 	if (pci->msi && func->msi_rearm) {
 		pci->msi = pci_enable_msi(pci->pdev) == 0;

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

* [PATCH 4.9 27/32] workqueue: Fix flag collision
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 26/32] drm/nouveau/pci/msi: disable MSI on big-endian platforms by default Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 28/32] cs5536: add support for IDE controller variant Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ben Hutchings, Tejun Heo

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

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

From: Ben Hutchings <ben@decadent.org.uk>

commit fbf1c41fc0f4d3574ac2377245efd666c1fa3075 upstream.

Commit 0a94efb5acbb ("workqueue: implicit ordered attribute should be
overridable") introduced a __WQ_ORDERED_EXPLICIT flag but gave it the
same value as __WQ_LEGACY.  I don't believe these were intended to
mean the same thing, so renumber __WQ_ORDERED_EXPLICIT.

Fixes: 0a94efb5acbb ("workqueue: implicit ordered attribute should be ...")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/workqueue.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -311,8 +311,8 @@ enum {
 
 	__WQ_DRAINING		= 1 << 16, /* internal: workqueue is draining */
 	__WQ_ORDERED		= 1 << 17, /* internal: workqueue is ordered */
-	__WQ_ORDERED_EXPLICIT	= 1 << 18, /* internal: alloc_ordered_workqueue() */
 	__WQ_LEGACY		= 1 << 18, /* internal: create*_workqueue() */
+	__WQ_ORDERED_EXPLICIT	= 1 << 19, /* internal: alloc_ordered_workqueue() */
 
 	WQ_MAX_ACTIVE		= 512,	  /* I like 512, better ideas? */
 	WQ_MAX_UNBOUND_PER_CPU	= 4,	  /* 4 * #cpus for unbound wq */

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

* [PATCH 4.9 28/32] cs5536: add support for IDE controller variant
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 27/32] workqueue: Fix flag collision Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 29/32] scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Andrey Korolyov, Tejun Heo

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

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

From: Andrey Korolyov <andrey@xdel.ru>

commit 591b6bb605785c12a21e8b07a08a277065b655a5 upstream.

Several legacy devices such as Geode-based Cisco ASA appliances
and DB800 development board do possess CS5536 IDE controller
with different PCI id than existing one. Using pata_generic is
not always feasible as at least DB800 requires MSR quirk from
pata_cs5536 to be used with vendor firmware.

Signed-off-by: Andrey Korolyov <andrey@xdel.ru>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/pata_amd.c    |    1 +
 drivers/ata/pata_cs5536.c |    1 +
 include/linux/pci_ids.h   |    1 +
 3 files changed, 3 insertions(+)

--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -616,6 +616,7 @@ static const struct pci_device_id amd[]
 	{ PCI_VDEVICE(NVIDIA,	PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE),	8 },
 	{ PCI_VDEVICE(NVIDIA,	PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE),	8 },
 	{ PCI_VDEVICE(AMD,	PCI_DEVICE_ID_AMD_CS5536_IDE),		9 },
+	{ PCI_VDEVICE(AMD,	PCI_DEVICE_ID_AMD_CS5536_DEV_IDE),	9 },
 
 	{ },
 };
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -289,6 +289,7 @@ static int cs5536_init_one(struct pci_de
 
 static const struct pci_device_id cs5536[] = {
 	{ PCI_VDEVICE(AMD,	PCI_DEVICE_ID_AMD_CS5536_IDE), },
+	{ PCI_VDEVICE(AMD,	PCI_DEVICE_ID_AMD_CS5536_DEV_IDE), },
 	{ },
 };
 
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -574,6 +574,7 @@
 #define PCI_DEVICE_ID_AMD_CS5536_EHC    0x2095
 #define PCI_DEVICE_ID_AMD_CS5536_UDC    0x2096
 #define PCI_DEVICE_ID_AMD_CS5536_UOC    0x2097
+#define PCI_DEVICE_ID_AMD_CS5536_DEV_IDE    0x2092
 #define PCI_DEVICE_ID_AMD_CS5536_IDE    0x209A
 #define PCI_DEVICE_ID_AMD_LX_VIDEO  0x2081
 #define PCI_DEVICE_ID_AMD_LX_AES    0x2082

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

* [PATCH 4.9 29/32] scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 28/32] cs5536: add support for IDE controller variant Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 30/32] scsi: sg: recheck MMAP_IO request length with lock held Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Todd Poynor, Douglas Gilbert,
	Martin K. Petersen

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

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

From: Todd Poynor <toddpoynor@google.com>

commit 6a8dadcca81fceff9976e8828cceb072873b7bd5 upstream.

Take f_mutex around mmap() processing to protect against races with the
SG_SET_RESERVED_SIZE ioctl.  Ensure the reserve buffer length remains
consistent during the mapping operation, and set the "mmap called" flag
to prevent further changes to the reserved buffer size as an atomic
operation with the mapping.

[mkp: fixed whitespace]

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/sg.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1244,6 +1244,7 @@ sg_mmap(struct file *filp, struct vm_are
 	unsigned long req_sz, len, sa;
 	Sg_scatter_hold *rsv_schp;
 	int k, length;
+	int ret = 0;
 
 	if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data)))
 		return -ENXIO;
@@ -1254,8 +1255,11 @@ sg_mmap(struct file *filp, struct vm_are
 	if (vma->vm_pgoff)
 		return -EINVAL;	/* want no offset */
 	rsv_schp = &sfp->reserve;
-	if (req_sz > rsv_schp->bufflen)
-		return -ENOMEM;	/* cannot map more than reserved buffer */
+	mutex_lock(&sfp->f_mutex);
+	if (req_sz > rsv_schp->bufflen) {
+		ret = -ENOMEM;	/* cannot map more than reserved buffer */
+		goto out;
+	}
 
 	sa = vma->vm_start;
 	length = 1 << (PAGE_SHIFT + rsv_schp->page_order);
@@ -1269,7 +1273,9 @@ sg_mmap(struct file *filp, struct vm_are
 	vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
 	vma->vm_private_data = sfp;
 	vma->vm_ops = &sg_mmap_vm_ops;
-	return 0;
+out:
+	mutex_unlock(&sfp->f_mutex);
+	return ret;
 }
 
 static void

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

* [PATCH 4.9 30/32] scsi: sg: recheck MMAP_IO request length with lock held
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 29/32] scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 31/32] drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Todd Poynor, Douglas Gilbert,
	Martin K. Petersen

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

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

From: Todd Poynor <toddpoynor@google.com>

commit 8d26f491116feaa0b16de370b6a7ba40a40fa0b4 upstream.

Commit 1bc0eb044615 ("scsi: sg: protect accesses to 'reserved' page
array") adds needed concurrency protection for the "reserve" buffer.
Some checks that are initially made outside the lock are replicated once
the lock is taken to ensure the checks and resulting decisions are made
using consistent state.

The check that a request with flag SG_FLAG_MMAP_IO set fits in the
reserve buffer also needs to be performed again under the lock to ensure
the reserve buffer length compared against matches the value in effect
when the request is linked to the reserve buffer.  An -ENOMEM should be
returned in this case, instead of switching over to an indirect buffer
as for non-MMAP_IO requests.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/sg.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1747,9 +1747,12 @@ sg_start_req(Sg_request *srp, unsigned c
 		    !sfp->res_in_use) {
 			sfp->res_in_use = 1;
 			sg_link_reserve(sfp, srp, dxfer_len);
-		} else if ((hp->flags & SG_FLAG_MMAP_IO) && sfp->res_in_use) {
+		} else if (hp->flags & SG_FLAG_MMAP_IO) {
+			res = -EBUSY; /* sfp->res_in_use == 1 */
+			if (dxfer_len > rsv_schp->bufflen)
+				res = -ENOMEM;
 			mutex_unlock(&sfp->f_mutex);
-			return -EBUSY;
+			return res;
 		} else {
 			res = sg_build_indirect(req_schp, sfp, dxfer_len);
 			if (res) {

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

* [PATCH 4.9 31/32] drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 30/32] scsi: sg: recheck MMAP_IO request length with lock held Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 13:19 ` [PATCH 4.9 32/32] drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event() Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, David Airlie, Archit Taneja,
	Wolfram Sang, Lars-Peter Clausen, Laurent Pinchart, dri-devel,
	John Stultz, Thong Ho, Nhan Nguyen

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

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

From: John Stultz <john.stultz@linaro.org>

commit 518cb7057a59b9441336d2e88a396d52b6ab0cce upstream.

I was recently seeing issues with EDID probing, where
the logic to wait for the EDID read bit to be set by the
IRQ wasn't happening and the code would time out and fail.

Digging deeper, I found this was due to the fact that
IRQs were disabled as we were running in IRQ context from
the HPD signal.

Thus this patch changes the logic to handle the HPD signal
via a work_struct so we can be out of irq context.

With this patch, the EDID probing on hotplug does not time
out.

Cc: David Airlie <airlied@linux.ie>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Thong Ho <thong.ho.px@rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/bridge/adv7511/adv7511.h     |    2 ++
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c |   11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
@@ -315,6 +315,8 @@ struct adv7511 {
 	bool edid_read;
 
 	wait_queue_head_t wq;
+	struct work_struct hpd_work;
+
 	struct drm_bridge bridge;
 	struct drm_connector connector;
 
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -402,6 +402,13 @@ static bool adv7511_hpd(struct adv7511 *
 	return false;
 }
 
+static void adv7511_hpd_work(struct work_struct *work)
+{
+	struct adv7511 *adv7511 = container_of(work, struct adv7511, hpd_work);
+
+	drm_helper_hpd_irq_event(adv7511->connector.dev);
+}
+
 static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)
 {
 	unsigned int irq0, irq1;
@@ -419,7 +426,7 @@ static int adv7511_irq_process(struct ad
 	regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1);
 
 	if (process_hpd && irq0 & ADV7511_INT0_HPD && adv7511->bridge.encoder)
-		drm_helper_hpd_irq_event(adv7511->connector.dev);
+		schedule_work(&adv7511->hpd_work);
 
 	if (irq0 & ADV7511_INT0_EDID_READY || irq1 & ADV7511_INT1_DDC_ERROR) {
 		adv7511->edid_read = true;
@@ -1006,6 +1013,8 @@ static int adv7511_probe(struct i2c_clie
 			goto err_i2c_unregister_edid;
 	}
 
+	INIT_WORK(&adv7511->hpd_work, adv7511_hpd_work);
+
 	if (i2c->irq) {
 		init_waitqueue_head(&adv7511->wq);
 

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

* [PATCH 4.9 32/32] drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event()
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 31/32] drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context Greg Kroah-Hartman
@ 2017-09-08 13:19 ` Greg Kroah-Hartman
  2017-09-08 18:33 ` [PATCH 4.9 00/32] 4.9.49-stable review Shuah Khan
  2017-09-09 13:47 ` Guenter Roeck
  32 siblings, 0 replies; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-08 13:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, David Airlie, Archit Taneja,
	Wolfram Sang, Lars-Peter Clausen, Laurent Pinchart, dri-devel,
	John Stultz, Thong Ho, Nhan Nguyen

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

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

From: John Stultz <john.stultz@linaro.org>

commit 6d5104c5a6b56385426e15047050584794bb6254 upstream.

In chasing down a previous issue with EDID probing from calling
drm_helper_hpd_irq_event() from irq context, Laurent noticed
that the DRM documentation suggests that
drm_kms_helper_hotplug_event() should be used instead.

Thus this patch replaces drm_helper_hpd_irq_event() with
drm_kms_helper_hotplug_event(), which requires we update the
connector.status entry and only call _hotplug_event() when the
status changes.

Cc: David Airlie <airlied@linux.ie>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-3-git-send-email-john.stultz@linaro.org
Signed-off-by: Thong Ho <thong.ho.px@rvc.renesas.com>
Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -405,8 +405,22 @@ static bool adv7511_hpd(struct adv7511 *
 static void adv7511_hpd_work(struct work_struct *work)
 {
 	struct adv7511 *adv7511 = container_of(work, struct adv7511, hpd_work);
+	enum drm_connector_status status;
+	unsigned int val;
+	int ret;
 
-	drm_helper_hpd_irq_event(adv7511->connector.dev);
+	ret = regmap_read(adv7511->regmap, ADV7511_REG_STATUS, &val);
+	if (ret < 0)
+		status = connector_status_disconnected;
+	else if (val & ADV7511_STATUS_HPD)
+		status = connector_status_connected;
+	else
+		status = connector_status_disconnected;
+
+	if (adv7511->connector.status != status) {
+		adv7511->connector.status = status;
+		drm_kms_helper_hotplug_event(adv7511->connector.dev);
+	}
 }
 
 static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)

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

* Re: [PATCH 4.9 00/32] 4.9.49-stable review
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2017-09-08 13:19 ` [PATCH 4.9 32/32] drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event() Greg Kroah-Hartman
@ 2017-09-08 18:33 ` Shuah Khan
  2017-09-09 13:47 ` Guenter Roeck
  32 siblings, 0 replies; 34+ messages in thread
From: Shuah Khan @ 2017-09-08 18:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, patches, ben.hutchings, stable, Shuah Khan

On 09/08/2017 07:19 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.9.49 release.
> There are 32 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 Sun Sep 10 13:18:28 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/v4.x/stable-review/patch-4.9.49-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-4.9.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

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

* Re: [PATCH 4.9 00/32] 4.9.49-stable review
  2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2017-09-08 18:33 ` [PATCH 4.9 00/32] 4.9.49-stable review Shuah Khan
@ 2017-09-09 13:47 ` Guenter Roeck
  32 siblings, 0 replies; 34+ messages in thread
From: Guenter Roeck @ 2017-09-09 13:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, shuahkh, patches, ben.hutchings, stable

On 09/08/2017 06:19 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.9.49 release.
> There are 32 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 Sun Sep 10 13:18:28 UTC 2017.
> Anything received after that time might be too late.
> 

Build results:
	total: 145 pass: 145 fail: 0
Qemu test results:
	total: 122 pass: 122 fail: 0

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

Guenter

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

end of thread, other threads:[~2017-09-09 13:47 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-08 13:19 [PATCH 4.9 00/32] 4.9.49-stable review Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 01/32] usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 02/32] USB: serial: option: add support for D-Link DWM-157 C1 Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 03/32] usb: Add device quirk for Logitech HD Pro Webcam C920-C Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 04/32] usb:xhci:Fix regression when ATI chipsets detected Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 05/32] USB: musb: fix external abort on suspend Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 06/32] USB: core: Avoid race of async_completed() w/ usbdev_release() Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 07/32] staging/rts5208: fix incorrect shift to extract upper nybble Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 08/32] iio: adc: ti-ads1015: fix incorrect data rate setting update Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 09/32] iio: adc: ti-ads1015: fix scale information for ADS1115 Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 10/32] iio: adc: ti-ads1015: enable conversion when CONFIG_PM is not set Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 11/32] iio: adc: ti-ads1015: avoid getting stale result after runtime resume Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 12/32] iio: adc: ti-ads1015: dont return invalid value from buffer setup callbacks Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 13/32] iio: adc: ti-ads1015: add adequate wait time to get correct conversion Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 14/32] driver core: bus: Fix a potential double free Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 15/32] intel_th: pci: Add Cannon Lake PCH-H support Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 16/32] intel_th: pci: Add Cannon Lake PCH-LP support Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 17/32] ath10k: fix memory leak in rx ring buffer allocation Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 18/32] Input: trackpoint - assume 3 buttons when buttons detection fails Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 19/32] rtlwifi: rtl_pci_probe: Fix fail path of _rtl_pci_find_adapter Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 20/32] Bluetooth: Add support of 13d3:3494 RTL8723BE device Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 21/32] iwlwifi: pci: add new PCI ID for 7265D Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 23/32] mwifiex: correct channel stat buffer overflows Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 24/32] MCB: add support for SC31 to mcb-lpc Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 25/32] s390/mm: avoid empty zero pages for KVM guests to avoid postcopy hangs Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 26/32] drm/nouveau/pci/msi: disable MSI on big-endian platforms by default Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 27/32] workqueue: Fix flag collision Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 28/32] cs5536: add support for IDE controller variant Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 29/32] scsi: sg: protect against races between mmap() and SG_SET_RESERVED_SIZE Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 30/32] scsi: sg: recheck MMAP_IO request length with lock held Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 31/32] drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context Greg Kroah-Hartman
2017-09-08 13:19 ` [PATCH 4.9 32/32] drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event() Greg Kroah-Hartman
2017-09-08 18:33 ` [PATCH 4.9 00/32] 4.9.49-stable review Shuah Khan
2017-09-09 13:47 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).