All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.10 000/110] 4.10.10-stable review
@ 2017-04-10 16:41 Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 001/110] drm/vmwgfx: Type-check lookups of fence objects Greg Kroah-Hartman
                   ` (109 more replies)
  0 siblings, 110 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuahkh, patches,
	ben.hutchings, stable

This is the start of the stable review cycle for the 4.10.10 release.
There are 110 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 Wed Apr 12 16:41:40 UTC 2017.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.10.10-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.10.y
and the diffstat can be found below.

thanks,

greg k-h

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

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

Matjaz Hegedic <matjaz.hegedic@gmail.com>
    x86/reboot/quirks: Fix typo in ASUS EeeBook X205TA reboot quirk

Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
    usb-storage: Add ignore-residue quirk for Initio INIC-3619

Matjaz Hegedic <matjaz.hegedic@gmail.com>
    x86/reboot/quirks: Add ASUS EeeBook X205TA/W reboot quirk

Matjaz Hegedic <matjaz.hegedic@gmail.com>
    x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk

Len Brown <len.brown@intel.com>
    tools/power turbostat: dump Atom P-states correctly

Len Brown <len.brown@intel.com>
    tools/power turbostat: decode Baytrail CC6 and MC6 demotion configuration

João Paulo Rechi Vita <jprvita@gmail.com>
    platform/x86: asus-wmi: Detect quirk_no_rfkill from the DSDT

Krzysztof Kozlowski <krzk@kernel.org>
    watchdog: s3c2410: Fix infinite interrupt in soft mode

Sinan Kaya <okaya@codeaurora.org>
    PCI: Add ACS quirk for Qualcomm QDF2400 and QDF2432

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    PCI: Sort the list of devices with D3 delay quirk by ID

yangbo lu <yangbo.lu@nxp.com>
    mmc: sdhci-of-esdhc: remove default broken-cd for ARM

Dongdong Liu <liudongdong3@huawei.com>
    PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports

Jon Mason <jon.mason@broadcom.com>
    PCI: Add Broadcom Northstar2 PAXC quirk for device class and MPSS

Will Deacon <will.deacon@arm.com>
    ARM: smccc: Update HVC comment to describe new quirk parameter

Andy Gross <andy.gross@linaro.org>
    firmware: qcom: scm: Fix interrupted SCM calls

Andy Gross <andy.gross@linaro.org>
    arm: kernel: Add SMC structure parameter

Ping Cheng <pinglinux@gmail.com>
    HID: wacom: don't apply generic settings to old devices

Mylène Josserand <mylene.josserand@free-electrons.com>
    ASoC: sun4i-i2s: Add quirks to handle a31 compatible

Alexandre Bailon <abailon@baylibre.com>
    usb: musb: da8xx: Fix host mode suspend

Zhang Rui <rui.zhang@intel.com>
    ACPI: save NVS memory for Lenovo G50-45

Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support

Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection

Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    ASoC: Intel: Baytrail: add quirk for Lenovo Thinkpad 10

Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10

Lv Zheng <lv.zheng@intel.com>
    ACPI / button: Change default behavior to lid_init_state=open

Bartosz Golaszewski <bgolaszewski@baylibre.com>
    sata: ahci-da850: implement a workaround for the softreset quirk

Sean Young <sean@mess.org>
    rx51: broken build

Dan Carpenter <dan.carpenter@oracle.com>
    PCI: xgene: Fix double free on init error

Alex Williamson <alex.williamson@redhat.com>
    PCI: Add ACS quirk for Intel Union Point

Daniel Vetter <daniel.vetter@ffwll.ch>
    drm/mga: remove device_is_agp callback

Felipe Balbi <felipe.balbi@linux.intel.com>
    usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions

Felipe Balbi <balbi@ti.com>
    usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested

Felipe Balbi <balbi@ti.com>
    usb: xhci: add quirk flag for broken PED bits

Kevin Hilman <khilman@baylibre.com>
    ARM: davinci: add skeleton for pdata-quirks

Vignesh R <vigneshr@ti.com>
    serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x

Stephen Boyd <stephen.boyd@linaro.org>
    usb: chipidea: msm: Rely on core to override AHBBURST

Tony Lindgren <tony@atomide.com>
    ARM: OMAP2+: Fix init for multiple quirks for the same SoC

youling257 <youling257@gmail.com>
    ASoC: Intel: bytcr_rt5640: quirks for Insyde devices

Paulo Zanoni <paulo.r.zanoni@intel.com>
    drm/i915: actually drive the BDW reserved IDs

Paulo Zanoni <paulo.r.zanoni@intel.com>
    drm/i915: more .is_mobile cleanups for BDW

Paulo Zanoni <paulo.r.zanoni@intel.com>
    drm/i915: fix INTEL_BDW_IDS definition

Jani Nikula <jani.nikula@intel.com>
    drm/edid: constify edid quirk list

Yuta Kobayashi <alu.ula@outlook.com>
    HID: multitouch: enable the Surface 4 Type Cover Pro (JP) to report multitouch data

Paolo Bonzini <pbonzini@redhat.com>
    kvm: fix page struct leak in handle_vmon

Jason A. Donenfeld <Jason@zx2c4.com>
    random: use chacha20 for get_random_int/long

Chris Salls <salls@cs.ucsb.edu>
    mm/mempolicy.c: fix error handling in set_mempolicy and mbind.

Johan Hovold <johan@kernel.org>
    Documentation: stable-kernel-rules: fix stable-tag format

Janusz Dziedzic <januszx.dziedzic@intel.com>
    usb: dwc3: gadget: delay unmap of bounced requests

Changbin Du <changbin.du@intel.com>
    drm/i915/kvmgt: fix suspicious rcu dereference usage

Zhenyu Wang <zhenyuw@linux.intel.com>
    drm/i915/gvt: Fix gvt scheduler interval time

Huacai Chen <chenhc@lemote.com>
    MIPS: c-r4k: Fix Loongson-3's vcache/scache waysize calculation

Huacai Chen <chenhc@lemote.com>
    MIPS: Flush wrong invalid FTLB entry for huge page

Huacai Chen <chenhc@lemote.com>
    MIPS: Add MIPS_CPU_FTLB for Loongson-3A R2

Huacai Chen <chenhc@lemote.com>
    MIPS: Check TLB before handle_ri_rdhwr() for Loongson-3

Hauke Mehrtens <hauke@hauke-m.de>
    MIPS: Lantiq: fix missing xbar kernel panic

Paul Burton <paul.burton@imgtec.com>
    MIPS: End spinlocks with .insn

John Crispin <john@phrozen.org>
    MIPS: ralink: Fix typos in rt3883 pinctrl

James Hogan <james.hogan@imgtec.com>
    MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels

Heiko Carstens <heiko.carstens@de.ibm.com>
    s390/uaccess: get_user() should zero on failure (again)

Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
    s390/decompressor: fix initrd corruption caused by bss clear

Max Filippov <jcmvbkbc@gmail.com>
    xtensa: make __pa work with uncached KSEG addresses

Tobias Klauser <tklauser@distanz.ch>
    nios2: reserve boot memory for device tree

Andi Kleen <ak@linux.intel.com>
    x86/mce: Don't print MCEs when mcelog is active

Dmitry Bilunov <kmeaw@yandex-team.ru>
    dm raid: fix NULL pointer dereference for raid1 without bitmap

Michael Ellerman <mpe@ellerman.id.au>
    powerpc/crypto/crc32c-vpmsum: Fix missing preempt_disable()

Paul Mackerras <paulus@ozlabs.org>
    powerpc: Don't try to fix up misaligned load-with-reservation instructions

Oliver O'Halloran <oohall@gmail.com>
    powerpc/64: Fix flush_(d|i)cache_range() called from modules

Frederic Barrat <fbarrat@linux.vnet.ibm.com>
    powerpc/mm: Add missing global TLB invalidate if cxl is active

Benjamin Herrenschmidt <benh@kernel.crashing.org>
    powerpc: Disable HFSCR[TM] if TM is not supported

Arnd Bergmann <arnd@arndb.de>
    drm/msm: adreno: fix build error without debugfs

James Hogan <james.hogan@imgtec.com>
    metag/usercopy: Add missing fixups

James Hogan <james.hogan@imgtec.com>
    metag/usercopy: Fix src fixup in from user rapf loops

James Hogan <james.hogan@imgtec.com>
    metag/usercopy: Set flags before ADDZ

James Hogan <james.hogan@imgtec.com>
    metag/usercopy: Zero rest of buffer from copy_from_user

James Hogan <james.hogan@imgtec.com>
    metag/usercopy: Add early abort to copy_to_user

James Hogan <james.hogan@imgtec.com>
    metag/usercopy: Fix alignment error checking

James Hogan <james.hogan@imgtec.com>
    metag/usercopy: Drop unused macros

Arend Van Spriel <arend.vanspriel@broadcom.com>
    brcmfmac: use local iftype avoiding use-after-free of virtual interface

Johannes Berg <johannes.berg@intel.com>
    mac80211: unconditionally start new netdev queues with iTXQ support

Wei Yongjun <yongjun_wei@trendmicro.com.cn>
    ring-buffer: Fix return value check in test_ringbuffer()

Calvin Owens <calvinowens@fb.com>
    xfs: Honor FALLOC_FL_KEEP_SIZE when punching ends of files

Martin Brandenburg <martin@omnibond.com>
    orangefs: move features validation to fix filesystem hang

Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
    jump label: fix passing kbuild_cflags when checking for asm goto support

Arnd Bergmann <arnd@arndb.de>
    Kbuild: use cc-disable-warning consistently for maybe-uninitialized

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    ACPI / scan: Prefer devices without _HID for _ADR matching

Dmitry Torokhov <dmitry.torokhov@gmail.com>
    ACPI / gpio: do not fall back to parsing _CRS when we get a deferral

Sami Tolvanen <samitolvanen@google.com>
    dm verity fec: fix bufio leaks

Sami Tolvanen <samitolvanen@google.com>
    dm verity fec: limit error correction recursion

Ross Zwisler <ross.zwisler@linux.intel.com>
    dax: fix radix tree insertion race

bsegall@google.com <bsegall@google.com>
    ptrace: fix PTRACE_LISTEN race corrupting task->state

Alexander Polakov <apolyakov@beget.ru>
    mm/page_alloc.c: fix print order in show_free_areas()

Jan-Marek Glogowski <glogow@fbihome.de>
    Reset TreeId to zero on SMB2 TREE_CONNECT

Arend Van Spriel <arend.vanspriel@broadcom.com>
    cfg80211: check rdev resume callback only for registered wiphy

Victor Kamensky <kamensky@cisco.com>
    arm64: mm: unaligned access by user-land should be received as SIGBUS

Quentin Schulz <quentin.schulz@free-electrons.com>
    iio: bmg160: reset chip when probing

Shrirang Bagul <shrirang.bagul@canonical.com>
    iio: st_pressure: initialize lps22hb bootime

Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
    iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values

Suzuki K Poulose <suzuki.poulose@arm.com>
    kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd

Marc Zyngier <marc.zyngier@arm.com>
    arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region

Marc Zyngier <marc.zyngier@arm.com>
    arm/arm64: KVM: Take mmap_sem in stage2_unmap_vm

Shuxiao Zhang <zhangshuxiao@xiaomi.com>
    staging: android: ashmem: lseek failed due to no FMODE_LSEEK.

NeilBrown <neilb@suse.com>
    sysfs: be careful of error returns from ops->show()

Tomasz Nowicki <tn@semihalf.com>
    PCI: thunder-pem: Fix legacy firmware PEM-specific resources

Tomasz Nowicki <tn@semihalf.com>
    PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller

Li Qiang <liq3ea@gmail.com>
    drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl()

Thomas Hellstrom <thellstrom@vmware.com>
    drm/vmwgfx: Remove getparam error message

Thomas Hellstrom <thellstrom@vmware.com>
    drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces

Murray McAllister <murray.mcallister@insomniasec.com>
    drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl()

Murray McAllister <murray.mcallister@insomniasec.com>
    drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()

Thomas Hellstrom <thellstrom@vmware.com>
    drm/vmwgfx: Type-check lookups of fence objects


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

Diffstat:

 Documentation/devicetree/bindings/usb/usb-xhci.txt |   1 +
 .../devicetree/bindings/watchdog/samsung-wdt.txt   |   9 +-
 Documentation/process/stable-kernel-rules.rst      |   2 +-
 Makefile                                           |  18 +-
 arch/arm/kernel/armksyms.c                         |   4 +-
 arch/arm/kernel/smccc-call.S                       |  14 +-
 arch/arm/kvm/mmu.c                                 |  23 +-
 arch/arm/mach-davinci/Makefile                     |   2 +-
 arch/arm/mach-davinci/da8xx-dt.c                   |   1 +
 arch/arm/mach-davinci/include/mach/common.h        |   2 +
 arch/arm/mach-davinci/pdata-quirks.c               |  39 +++
 arch/arm/mach-omap2/pdata-quirks.c                 |   3 +-
 arch/arm64/kernel/arm64ksyms.c                     |   4 +-
 arch/arm64/kernel/asm-offsets.c                    |   7 +-
 arch/arm64/kernel/smccc-call.S                     |  23 +-
 arch/arm64/mm/fault.c                              |  42 +--
 arch/metag/include/asm/uaccess.h                   |  15 +-
 arch/metag/lib/usercopy.c                          | 312 ++++++++-------------
 arch/mips/Kconfig                                  |   2 +-
 arch/mips/include/asm/spinlock.h                   |   8 +-
 arch/mips/kernel/cpu-probe.c                       |   2 +-
 arch/mips/kernel/genex.S                           |   4 +-
 arch/mips/kernel/traps.c                           |  17 +-
 arch/mips/lantiq/xway/sysctrl.c                    |   2 +-
 arch/mips/mm/c-r4k.c                               |   2 +
 arch/mips/mm/tlbex.c                               |  25 +-
 arch/mips/ralink/rt3883.c                          |   4 +-
 arch/nios2/kernel/prom.c                           |   7 +
 arch/nios2/kernel/setup.c                          |   3 +
 arch/powerpc/crypto/crc32c-vpmsum_glue.c           |   3 +
 arch/powerpc/kernel/align.c                        |  27 +-
 arch/powerpc/kernel/misc_64.S                      |   4 +-
 arch/powerpc/kernel/setup_64.c                     |   9 +
 arch/powerpc/mm/hash_native_64.c                   |   7 +-
 arch/s390/boot/compressed/misc.c                   |  35 +--
 arch/s390/include/asm/uaccess.h                    |   2 +-
 arch/x86/kernel/cpu/mcheck/mce.c                   |   7 +-
 arch/x86/kernel/reboot.c                           |  16 ++
 arch/x86/kvm/vmx.c                                 |   9 +-
 arch/xtensa/include/asm/page.h                     |  13 +
 drivers/acpi/button.c                              |   2 +-
 drivers/acpi/glue.c                                |  12 +-
 drivers/acpi/sleep.c                               |  19 ++
 drivers/ata/ahci_da850.c                           |  33 ++-
 drivers/char/random.c                              |  84 +++---
 drivers/firmware/qcom_scm-64.c                     |  13 +-
 drivers/gpio/gpiolib-acpi.c                        |   4 +-
 drivers/gpu/drm/drm_edid.c                         |   6 +-
 drivers/gpu/drm/i915/gvt/kvmgt.c                   |   4 +-
 drivers/gpu/drm/i915/gvt/sched_policy.c            |   4 +-
 drivers/gpu/drm/i915/i915_pci.c                    |   1 +
 drivers/gpu/drm/mga/mga_dma.c                      |  20 +-
 drivers/gpu/drm/mga/mga_drv.c                      |  37 ---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c              |   2 +
 drivers/gpu/drm/ttm/ttm_object.c                   |  10 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c              |  79 ++++--
 drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c              |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c           |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c            |  31 +-
 drivers/hid/hid-core.c                             |   2 -
 drivers/hid/hid-ids.h                              |   1 -
 drivers/hid/hid-microsoft.c                        |   2 -
 drivers/hid/usbhid/hid-quirks.c                    |   1 -
 drivers/hid/wacom_wac.c                            |   3 +
 drivers/iio/gyro/bmg160_core.c                     |  12 +
 drivers/iio/industrialio-core.c                    |   7 +-
 drivers/iio/pressure/st_pressure_core.c            |   1 +
 drivers/md/dm-raid.c                               |   2 +-
 drivers/md/dm-verity-fec.c                         |  18 +-
 drivers/md/dm-verity-fec.h                         |   4 +
 drivers/mmc/host/sdhci-of-esdhc.c                  |  18 +-
 .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c |   8 +-
 drivers/pci/host/pci-thunder-pem.c                 |  62 +++-
 drivers/pci/host/pci-xgene.c                       |   7 +-
 drivers/pci/quirks.c                               |  99 +++++--
 drivers/platform/x86/asus-wmi.c                    |  23 +-
 drivers/staging/android/ashmem.c                   |   1 +
 drivers/tty/serial/8250/8250_omap.c                |   9 +-
 drivers/usb/chipidea/ci_hdrc_msm.c                 |   4 +-
 drivers/usb/dwc3/gadget.c                          |  21 +-
 drivers/usb/dwc3/host.c                            |  21 +-
 drivers/usb/host/xhci-hub.c                        |   6 +
 drivers/usb/host/xhci-plat.c                       |   3 +
 drivers/usb/host/xhci.h                            |   3 +
 drivers/usb/musb/da8xx.c                           |   2 +-
 drivers/usb/storage/unusual_devs.h                 |  14 +
 drivers/watchdog/s3c2410_wdt.c                     |  21 +-
 fs/cifs/smb2pdu.c                                  |   4 +
 fs/dax.c                                           |  35 ++-
 fs/orangefs/super.c                                |   9 +-
 fs/sysfs/file.c                                    |   6 +-
 fs/xfs/xfs_bmap_util.c                             |  10 +-
 include/drm/i915_pciids.h                          |  11 +-
 include/drm/ttm/ttm_object.h                       |   5 +-
 include/linux/arm-smccc.h                          |  52 +++-
 include/linux/pci_ids.h                            |   2 +
 include/linux/random.h                             |   1 -
 init/main.c                                        |   1 -
 kernel/ptrace.c                                    |  14 +-
 kernel/trace/ring_buffer.c                         |   8 +-
 mm/mempolicy.c                                     |  20 +-
 mm/page_alloc.c                                    |   2 +-
 net/mac80211/iface.c                               |   3 +-
 net/wireless/sysfs.c                               |  10 +-
 sound/soc/codecs/rt5670.c                          |   1 +
 sound/soc/intel/atom/sst/sst_acpi.c                |  37 ++-
 sound/soc/intel/boards/bytcr_rt5640.c              |  10 +
 sound/soc/intel/boards/cht_bsw_rt5645.c            |  98 ++++++-
 sound/soc/sunxi/sun4i-i2s.c                        |  57 +++-
 tools/power/x86/turbostat/turbostat.c              | 103 +++++++
 110 files changed, 1357 insertions(+), 615 deletions(-)

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

* [PATCH 4.10 001/110] drm/vmwgfx: Type-check lookups of fence objects
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 002/110] drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl() Greg Kroah-Hartman
                   ` (108 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Thomas Hellstrom, Sinclair Yeh

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

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

From: Thomas Hellstrom <thellstrom@vmware.com>

commit f7652afa8eadb416b23eb57dec6f158529942041 upstream.

A malicious caller could otherwise hand over handles to other objects
causing all sorts of interesting problems.

Testing done: Ran a Fedora 25 desktop using both Xorg and
gnome-shell/Wayland.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c |   75 ++++++++++++++++++++++------------
 1 file changed, 49 insertions(+), 26 deletions(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
@@ -538,7 +538,7 @@ int vmw_fence_create(struct vmw_fence_ma
 		     struct vmw_fence_obj **p_fence)
 {
 	struct vmw_fence_obj *fence;
-	int ret;
+ 	int ret;
 
 	fence = kzalloc(sizeof(*fence), GFP_KERNEL);
 	if (unlikely(fence == NULL))
@@ -701,6 +701,41 @@ void vmw_fence_fifo_up(struct vmw_fence_
 }
 
 
+/**
+ * vmw_fence_obj_lookup - Look up a user-space fence object
+ *
+ * @tfile: A struct ttm_object_file identifying the caller.
+ * @handle: A handle identifying the fence object.
+ * @return: A struct vmw_user_fence base ttm object on success or
+ * an error pointer on failure.
+ *
+ * The fence object is looked up and type-checked. The caller needs
+ * to have opened the fence object first, but since that happens on
+ * creation and fence objects aren't shareable, that's not an
+ * issue currently.
+ */
+static struct ttm_base_object *
+vmw_fence_obj_lookup(struct ttm_object_file *tfile, u32 handle)
+{
+	struct ttm_base_object *base = ttm_base_object_lookup(tfile, handle);
+
+	if (!base) {
+		pr_err("Invalid fence object handle 0x%08lx.\n",
+		       (unsigned long)handle);
+		return ERR_PTR(-EINVAL);
+	}
+
+	if (base->refcount_release != vmw_user_fence_base_release) {
+		pr_err("Invalid fence object handle 0x%08lx.\n",
+		       (unsigned long)handle);
+		ttm_base_object_unref(&base);
+		return ERR_PTR(-EINVAL);
+	}
+
+	return base;
+}
+
+
 int vmw_fence_obj_wait_ioctl(struct drm_device *dev, void *data,
 			     struct drm_file *file_priv)
 {
@@ -726,13 +761,9 @@ int vmw_fence_obj_wait_ioctl(struct drm_
 		arg->kernel_cookie = jiffies + wait_timeout;
 	}
 
-	base = ttm_base_object_lookup(tfile, arg->handle);
-	if (unlikely(base == NULL)) {
-		printk(KERN_ERR "Wait invalid fence object handle "
-		       "0x%08lx.\n",
-		       (unsigned long)arg->handle);
-		return -EINVAL;
-	}
+	base = vmw_fence_obj_lookup(tfile, arg->handle);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
 
 	fence = &(container_of(base, struct vmw_user_fence, base)->fence);
 
@@ -771,13 +802,9 @@ int vmw_fence_obj_signaled_ioctl(struct
 	struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile;
 	struct vmw_private *dev_priv = vmw_priv(dev);
 
-	base = ttm_base_object_lookup(tfile, arg->handle);
-	if (unlikely(base == NULL)) {
-		printk(KERN_ERR "Fence signaled invalid fence object handle "
-		       "0x%08lx.\n",
-		       (unsigned long)arg->handle);
-		return -EINVAL;
-	}
+	base = vmw_fence_obj_lookup(tfile, arg->handle);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
 
 	fence = &(container_of(base, struct vmw_user_fence, base)->fence);
 	fman = fman_from_fence(fence);
@@ -1024,6 +1051,7 @@ int vmw_fence_event_ioctl(struct drm_dev
 		(struct drm_vmw_fence_event_arg *) data;
 	struct vmw_fence_obj *fence = NULL;
 	struct vmw_fpriv *vmw_fp = vmw_fpriv(file_priv);
+	struct ttm_object_file *tfile = vmw_fp->tfile;
 	struct drm_vmw_fence_rep __user *user_fence_rep =
 		(struct drm_vmw_fence_rep __user *)(unsigned long)
 		arg->fence_rep;
@@ -1037,15 +1065,11 @@ int vmw_fence_event_ioctl(struct drm_dev
 	 */
 	if (arg->handle) {
 		struct ttm_base_object *base =
-			ttm_base_object_lookup_for_ref(dev_priv->tdev,
-						       arg->handle);
+			vmw_fence_obj_lookup(tfile, arg->handle);
+
+		if (IS_ERR(base))
+			return PTR_ERR(base);
 
-		if (unlikely(base == NULL)) {
-			DRM_ERROR("Fence event invalid fence object handle "
-				  "0x%08lx.\n",
-				  (unsigned long)arg->handle);
-			return -EINVAL;
-		}
 		fence = &(container_of(base, struct vmw_user_fence,
 				       base)->fence);
 		(void) vmw_fence_obj_reference(fence);
@@ -1053,7 +1077,7 @@ int vmw_fence_event_ioctl(struct drm_dev
 		if (user_fence_rep != NULL) {
 			bool existed;
 
-			ret = ttm_ref_object_add(vmw_fp->tfile, base,
+			ret = ttm_ref_object_add(tfile, base,
 						 TTM_REF_USAGE, &existed);
 			if (unlikely(ret != 0)) {
 				DRM_ERROR("Failed to reference a fence "
@@ -1097,8 +1121,7 @@ int vmw_fence_event_ioctl(struct drm_dev
 	return 0;
 out_no_create:
 	if (user_fence_rep != NULL)
-		ttm_ref_object_base_unref(vmw_fpriv(file_priv)->tfile,
-					  handle, TTM_REF_USAGE);
+		ttm_ref_object_base_unref(tfile, handle, TTM_REF_USAGE);
 out_no_ref_obj:
 	vmw_fence_obj_unreference(&fence);
 	return ret;

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

* [PATCH 4.10 002/110] drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl()
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 001/110] drm/vmwgfx: Type-check lookups of fence objects Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 003/110] drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl() Greg Kroah-Hartman
                   ` (107 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Murray McAllister, Sinclair Yeh

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

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

From: Murray McAllister <murray.mcallister@insomniasec.com>

commit 36274ab8c596f1240c606bb514da329add2a1bcd upstream.

Before memory allocations vmw_surface_define_ioctl() checks the
upper-bounds of a user-supplied size, but does not check if the
supplied size is 0.

Add check to avoid NULL pointer dereferences.

Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -716,8 +716,8 @@ int vmw_surface_define_ioctl(struct drm_
 	for (i = 0; i < DRM_VMW_MAX_SURFACE_FACES; ++i)
 		num_sizes += req->mip_levels[i];
 
-	if (num_sizes > DRM_VMW_MAX_SURFACE_FACES *
-	    DRM_VMW_MAX_MIP_LEVELS)
+	if (num_sizes > DRM_VMW_MAX_SURFACE_FACES * DRM_VMW_MAX_MIP_LEVELS ||
+	    num_sizes == 0)
 		return -EINVAL;
 
 	size = vmw_user_surface_size + 128 +

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

* [PATCH 4.10 003/110] drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl()
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 001/110] drm/vmwgfx: Type-check lookups of fence objects Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 002/110] drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl() Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 004/110] drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces Greg Kroah-Hartman
                   ` (106 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Murray McAllister, Sinclair Yeh

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

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

From: Murray McAllister <murray.mcallister@insomniasec.com>

commit 63774069d9527a1aeaa4aa20e929ef5e8e9ecc38 upstream.

In vmw_get_cap_3d_ioctl(), a user can supply 0 for a size that is
used in vzalloc(). This eventually calls dump_stack() (in warn_alloc()),
which can leak useful addresses to dmesg.

Add check to avoid a size of 0.

Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
@@ -186,7 +186,7 @@ int vmw_get_cap_3d_ioctl(struct drm_devi
 	bool gb_objects = !!(dev_priv->capabilities & SVGA_CAP_GBOBJECTS);
 	struct vmw_fpriv *vmw_fp = vmw_fpriv(file_priv);
 
-	if (unlikely(arg->pad64 != 0)) {
+	if (unlikely(arg->pad64 != 0 || arg->max_size == 0)) {
 		DRM_ERROR("Illegal GET_3D_CAP argument.\n");
 		return -EINVAL;
 	}

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

* [PATCH 4.10 004/110] drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2017-04-10 16:41 ` [PATCH 4.10 003/110] drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl() Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 005/110] drm/vmwgfx: Remove getparam error message Greg Kroah-Hartman
                   ` (105 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Thomas Hellstrom, Sinclair Yeh

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

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

From: Thomas Hellstrom <thellstrom@vmware.com>

commit fe25deb7737ce6c0879ccf79c99fa1221d428bf2 upstream.

Previously, when a surface was opened using a legacy (non prime) handle,
it was verified to have been created by a client in the same master realm.
Relax this so that opening is also allowed recursively if the client
already has the surface open.

This works around a regression in svga mesa where opening of a shared
surface is used recursively to obtain surface information.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/ttm/ttm_object.c         |   10 +++++++---
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c    |    6 ++----
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c |    4 ++--
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c  |   22 +++++++++-------------
 include/drm/ttm/ttm_object.h             |    5 ++++-
 5 files changed, 24 insertions(+), 23 deletions(-)

--- a/drivers/gpu/drm/ttm/ttm_object.c
+++ b/drivers/gpu/drm/ttm/ttm_object.c
@@ -179,7 +179,7 @@ int ttm_base_object_init(struct ttm_obje
 	if (unlikely(ret != 0))
 		goto out_err0;
 
-	ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL);
+	ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL, false);
 	if (unlikely(ret != 0))
 		goto out_err1;
 
@@ -318,7 +318,8 @@ EXPORT_SYMBOL(ttm_ref_object_exists);
 
 int ttm_ref_object_add(struct ttm_object_file *tfile,
 		       struct ttm_base_object *base,
-		       enum ttm_ref_type ref_type, bool *existed)
+		       enum ttm_ref_type ref_type, bool *existed,
+		       bool require_existed)
 {
 	struct drm_open_hash *ht = &tfile->ref_hash[ref_type];
 	struct ttm_ref_object *ref;
@@ -345,6 +346,9 @@ int ttm_ref_object_add(struct ttm_object
 		}
 
 		rcu_read_unlock();
+		if (require_existed)
+			return -EPERM;
+
 		ret = ttm_mem_global_alloc(mem_glob, sizeof(*ref),
 					   false, false);
 		if (unlikely(ret != 0))
@@ -635,7 +639,7 @@ int ttm_prime_fd_to_handle(struct ttm_ob
 	prime = (struct ttm_prime_object *) dma_buf->priv;
 	base = &prime->base;
 	*handle = base->hash.key;
-	ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL);
+	ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL, false);
 
 	dma_buf_put(dma_buf);
 
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
@@ -1075,10 +1075,8 @@ int vmw_fence_event_ioctl(struct drm_dev
 		(void) vmw_fence_obj_reference(fence);
 
 		if (user_fence_rep != NULL) {
-			bool existed;
-
-			ret = ttm_ref_object_add(tfile, base,
-						 TTM_REF_USAGE, &existed);
+			ret = ttm_ref_object_add(vmw_fp->tfile, base,
+						 TTM_REF_USAGE, NULL, false);
 			if (unlikely(ret != 0)) {
 				DRM_ERROR("Failed to reference a fence "
 					  "object.\n");
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -589,7 +589,7 @@ static int vmw_user_dmabuf_synccpu_grab(
 		return ret;
 
 	ret = ttm_ref_object_add(tfile, &user_bo->prime.base,
-				 TTM_REF_SYNCCPU_WRITE, &existed);
+				 TTM_REF_SYNCCPU_WRITE, &existed, false);
 	if (ret != 0 || existed)
 		ttm_bo_synccpu_write_release(&user_bo->dma.base);
 
@@ -773,7 +773,7 @@ int vmw_user_dmabuf_reference(struct ttm
 
 	*handle = user_bo->prime.base.hash.key;
 	return ttm_ref_object_add(tfile, &user_bo->prime.base,
-				  TTM_REF_USAGE, NULL);
+				  TTM_REF_USAGE, NULL, false);
 }
 
 /*
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -891,17 +891,16 @@ vmw_surface_handle_reference(struct vmw_
 	uint32_t handle;
 	struct ttm_base_object *base;
 	int ret;
+	bool require_exist = false;
 
 	if (handle_type == DRM_VMW_HANDLE_PRIME) {
 		ret = ttm_prime_fd_to_handle(tfile, u_handle, &handle);
 		if (unlikely(ret != 0))
 			return ret;
 	} else {
-		if (unlikely(drm_is_render_client(file_priv))) {
-			DRM_ERROR("Render client refused legacy "
-				  "surface reference.\n");
-			return -EACCES;
-		}
+		if (unlikely(drm_is_render_client(file_priv)))
+			require_exist = true;
+
 		if (ACCESS_ONCE(vmw_fpriv(file_priv)->locked_master)) {
 			DRM_ERROR("Locked master refused legacy "
 				  "surface reference.\n");
@@ -929,17 +928,14 @@ vmw_surface_handle_reference(struct vmw_
 
 		/*
 		 * Make sure the surface creator has the same
-		 * authenticating master.
+		 * authenticating master, or is already registered with us.
 		 */
 		if (drm_is_primary_client(file_priv) &&
-		    user_srf->master != file_priv->master) {
-			DRM_ERROR("Trying to reference surface outside of"
-				  " master domain.\n");
-			ret = -EACCES;
-			goto out_bad_resource;
-		}
+		    user_srf->master != file_priv->master)
+			require_exist = true;
 
-		ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL);
+		ret = ttm_ref_object_add(tfile, base, TTM_REF_USAGE, NULL,
+					 require_exist);
 		if (unlikely(ret != 0)) {
 			DRM_ERROR("Could not add a reference to a surface.\n");
 			goto out_bad_resource;
--- a/include/drm/ttm/ttm_object.h
+++ b/include/drm/ttm/ttm_object.h
@@ -229,6 +229,8 @@ extern void ttm_base_object_unref(struct
  * @ref_type: The type of reference.
  * @existed: Upon completion, indicates that an identical reference object
  * already existed, and the refcount was upped on that object instead.
+ * @require_existed: Fail with -EPERM if an identical ref object didn't
+ * already exist.
  *
  * Checks that the base object is shareable and adds a ref object to it.
  *
@@ -243,7 +245,8 @@ extern void ttm_base_object_unref(struct
  */
 extern int ttm_ref_object_add(struct ttm_object_file *tfile,
 			      struct ttm_base_object *base,
-			      enum ttm_ref_type ref_type, bool *existed);
+			      enum ttm_ref_type ref_type, bool *existed,
+			      bool require_existed);
 
 extern bool ttm_ref_object_exists(struct ttm_object_file *tfile,
 				  struct ttm_base_object *base);

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

* [PATCH 4.10 005/110] drm/vmwgfx: Remove getparam error message
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2017-04-10 16:41 ` [PATCH 4.10 004/110] drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 006/110] drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl() Greg Kroah-Hartman
                   ` (104 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Thomas Hellstrom, Brian Paul, Sinclair Yeh

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

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

From: Thomas Hellstrom <thellstrom@vmware.com>

commit 53e16798b0864464c5444a204e1bb93ae246c429 upstream.

The mesa winsys sometimes uses unimplemented parameter requests to
check for features. Remove the error message to avoid bloating the
kernel log.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c |    2 --
 1 file changed, 2 deletions(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
@@ -114,8 +114,6 @@ int vmw_getparam_ioctl(struct drm_device
 		param->value = dev_priv->has_dx;
 		break;
 	default:
-		DRM_ERROR("Illegal vmwgfx get param request: %d\n",
-			  param->param);
 		return -EINVAL;
 	}
 

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

* [PATCH 4.10 006/110] drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl()
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2017-04-10 16:41 ` [PATCH 4.10 005/110] drm/vmwgfx: Remove getparam error message Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 007/110] PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller Greg Kroah-Hartman
                   ` (103 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Li Qiang, Thomas Hellstrom

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

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

From: Li Qiang <liq3ea@gmail.com>

commit e7e11f99564222d82f0ce84bd521e57d78a6b678 upstream.

In vmw_surface_define_ioctl(), the 'num_sizes' is the sum of the
'req->mip_levels' array. This array can be assigned any value from
the user space. As both the 'num_sizes' and the array is uint32_t,
it is easy to make 'num_sizes' overflow. The later 'mip_levels' is
used as the loop count. This can lead an oob write. Add the check of
'req->mip_levels' to avoid this.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -713,8 +713,11 @@ int vmw_surface_define_ioctl(struct drm_
 			128;
 
 	num_sizes = 0;
-	for (i = 0; i < DRM_VMW_MAX_SURFACE_FACES; ++i)
+	for (i = 0; i < DRM_VMW_MAX_SURFACE_FACES; ++i) {
+		if (req->mip_levels[i] > DRM_VMW_MAX_MIP_LEVELS)
+			return -EINVAL;
 		num_sizes += req->mip_levels[i];
+	}
 
 	if (num_sizes > DRM_VMW_MAX_SURFACE_FACES * DRM_VMW_MAX_MIP_LEVELS ||
 	    num_sizes == 0)

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

* [PATCH 4.10 007/110] PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2017-04-10 16:41 ` [PATCH 4.10 006/110] drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl() Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:41 ` [PATCH 4.10 008/110] PCI: thunder-pem: Fix legacy firmware PEM-specific resources Greg Kroah-Hartman
                   ` (102 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Robert Richter, Tomasz Nowicki,
	Vadim Lomovtsev, Bjorn Helgaas

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

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

From: Tomasz Nowicki <tn@semihalf.com>

commit 9abb27c7594a62bbf6385e20b7f5a90b4eceae2f upstream.

During early days of PCI quirks support, ThunderX firmware did not provide
PNP0c02 node with PCI configuration space and PEM-specific register ranges.
This means that for legacy FW we are not reserving these resources and
cannot gather PEM-specific resources for further PEM initialization.

To support already deployed legacy FW, calculate PEM-specific ranges and
provide resources reservation as fallback scenario into PEM driver when we
could not gather PEM reg base from ACPI tables.

Tested-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pci/host/pci-thunder-pem.c |   56 +++++++++++++++++++++++++++++++++++--
 1 file changed, 54 insertions(+), 2 deletions(-)

--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -14,6 +14,7 @@
  * Copyright (C) 2015 - 2016 Cavium, Inc.
  */
 
+#include <linux/bitfield.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/of_address.h>
@@ -319,6 +320,50 @@ static int thunder_pem_init(struct devic
 
 #if defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS)
 
+#define PEM_RES_BASE		0x87e0c0000000UL
+#define PEM_NODE_MASK		GENMASK(45, 44)
+#define PEM_INDX_MASK		GENMASK(26, 24)
+#define PEM_MIN_DOM_IN_NODE	4
+#define PEM_MAX_DOM_IN_NODE	10
+
+static void thunder_pem_reserve_range(struct device *dev, int seg,
+				      struct resource *r)
+{
+	resource_size_t start = r->start, end = r->end;
+	struct resource *res;
+	const char *regionid;
+
+	regionid = kasprintf(GFP_KERNEL, "PEM RC:%d", seg);
+	if (!regionid)
+		return;
+
+	res = request_mem_region(start, end - start + 1, regionid);
+	if (res)
+		res->flags &= ~IORESOURCE_BUSY;
+	else
+		kfree(regionid);
+
+	dev_info(dev, "%pR %s reserved\n", r,
+		 res ? "has been" : "could not be");
+}
+
+static void thunder_pem_legacy_fw(struct acpi_pci_root *root,
+				 struct resource *res_pem)
+{
+	int node = acpi_get_node(root->device->handle);
+	int index;
+
+	if (node == NUMA_NO_NODE)
+		node = 0;
+
+	index = root->segment - PEM_MIN_DOM_IN_NODE;
+	index -= node * PEM_MAX_DOM_IN_NODE;
+	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
+					FIELD_PREP(PEM_INDX_MASK, index);
+	res_pem->end = res_pem->start + SZ_16M - 1;
+	res_pem->flags = IORESOURCE_MEM;
+}
+
 static int thunder_pem_acpi_init(struct pci_config_window *cfg)
 {
 	struct device *dev = cfg->parent;
@@ -332,9 +377,16 @@ static int thunder_pem_acpi_init(struct
 		return -ENOMEM;
 
 	ret = acpi_get_rc_resources(dev, "CAVA02B", root->segment, res_pem);
+
+	/*
+	 * If we fail to gather resources it means that we run with old
+	 * FW where we need to calculate PEM-specific resources manually.
+	 */
 	if (ret) {
-		dev_err(dev, "can't get rc base address\n");
-		return ret;
+		thunder_pem_legacy_fw(root, res_pem);
+		/* Reserve PEM-specific resources and PCI configuration space */
+		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
 	}
 
 	return thunder_pem_init(dev, cfg, res_pem);

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

* [PATCH 4.10 008/110] PCI: thunder-pem: Fix legacy firmware PEM-specific resources
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2017-04-10 16:41 ` [PATCH 4.10 007/110] PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller Greg Kroah-Hartman
@ 2017-04-10 16:41 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 009/110] sysfs: be careful of error returns from ops->show() Greg Kroah-Hartman
                   ` (101 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Tomasz Nowicki, Bjorn Helgaas

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

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

From: Tomasz Nowicki <tn@semihalf.com>

commit feb199ebef488a9f2c3550fb10524f3dac9d8abe upstream.

SZ_16M PEM resource size includes PEM-specific register and its children
resources. Reservation of the whole SZ_16M range leads to child device
driver failure when pcieport driver is requesting resources:

  pcieport 0004:1f:00.0: can't enable device: BAR 0 [mem 0x87e0c0f00000-0x87e0c0ffffff 64bit] not claimed

So we cannot reserve full 16M here and instead we want to reserve
PEM-specific register only which is SZ_64K.

At the end increase PEM resource to SZ_16M since this is what
thunder_pem_init() call expects for proper initialization.

Fixes: 9abb27c7594a ("PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller")
Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/pci/host/pci-thunder-pem.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/pci/host/pci-thunder-pem.c
+++ b/drivers/pci/host/pci-thunder-pem.c
@@ -360,7 +360,6 @@ static void thunder_pem_legacy_fw(struct
 	index -= node * PEM_MAX_DOM_IN_NODE;
 	res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) |
 					FIELD_PREP(PEM_INDX_MASK, index);
-	res_pem->end = res_pem->start + SZ_16M - 1;
 	res_pem->flags = IORESOURCE_MEM;
 }
 
@@ -384,8 +383,15 @@ static int thunder_pem_acpi_init(struct
 	 */
 	if (ret) {
 		thunder_pem_legacy_fw(root, res_pem);
-		/* Reserve PEM-specific resources and PCI configuration space */
+		/*
+		 * Reserve 64K size PEM specific resources. The full 16M range
+		 * size is required for thunder_pem_init() call.
+		 */
+		res_pem->end = res_pem->start + SZ_64K - 1;
 		thunder_pem_reserve_range(dev, root->segment, res_pem);
+		res_pem->end = res_pem->start + SZ_16M - 1;
+
+		/* Reserve PCI configuration space as well. */
 		thunder_pem_reserve_range(dev, root->segment, &cfg->res);
 	}
 

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

* [PATCH 4.10 009/110] sysfs: be careful of error returns from ops->show()
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2017-04-10 16:41 ` [PATCH 4.10 008/110] PCI: thunder-pem: Fix legacy firmware PEM-specific resources Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 010/110] staging: android: ashmem: lseek failed due to no FMODE_LSEEK Greg Kroah-Hartman
                   ` (100 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, NeilBrown, Tejun Heo

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

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

From: NeilBrown <neilb@suse.com>

commit c8a139d001a1aab1ea8734db14b22dac9dd143b6 upstream.

ops->show() can return a negative error code.
Commit 65da3484d9be ("sysfs: correctly handle short reads on PREALLOC attrs.")
(in v4.4) caused this to be stored in an unsigned 'size_t' variable, so errors
would look like large numbers.
As a result, if an error is returned, sysfs_kf_read() will return the
value of 'count', typically 4096.

Commit 17d0774f8068 ("sysfs: correctly handle read offset on PREALLOC attrs")
(in v4.8) extended this error to use the unsigned large 'len' as a size for
memmove().
Consequently, if ->show returns an error, then the first read() on the
sysfs file will return 4096 and could return uninitialized memory to
user-space.
If the application performs a subsequent read, this will trigger a memmove()
with extremely large count, and is likely to crash the machine is bizarre ways.

This bug can currently only be triggered by reading from an md
sysfs attribute declared with __ATTR_PREALLOC() during the
brief period between when mddev_put() deletes an mddev from
the ->all_mddevs list, and when mddev_delayed_delete() - which is
scheduled on a workqueue - completes.
Before this, an error won't be returned by the ->show()
After this, the ->show() won't be called.

I can reproduce it reliably only by putting delay like
	usleep_range(500000,700000);
early in mddev_delayed_delete(). Then after creating an
md device md0 run
  echo clear > /sys/block/md0/md/array_state; cat /sys/block/md0/md/array_state

The bug can be triggered without the usleep.

Fixes: 65da3484d9be ("sysfs: correctly handle short reads on PREALLOC attrs.")
Fixes: 17d0774f8068 ("sysfs: correctly handle read offset on PREALLOC attrs")
Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/sysfs/file.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -108,7 +108,7 @@ static ssize_t sysfs_kf_read(struct kern
 {
 	const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
 	struct kobject *kobj = of->kn->parent->priv;
-	size_t len;
+	ssize_t len;
 
 	/*
 	 * If buf != of->prealloc_buf, we don't know how
@@ -117,13 +117,15 @@ static ssize_t sysfs_kf_read(struct kern
 	if (WARN_ON_ONCE(buf != of->prealloc_buf))
 		return 0;
 	len = ops->show(kobj, of->kn->priv, buf);
+	if (len < 0)
+		return len;
 	if (pos) {
 		if (len <= pos)
 			return 0;
 		len -= pos;
 		memmove(buf, buf + pos, len);
 	}
-	return min(count, len);
+	return min_t(ssize_t, count, len);
 }
 
 /* kernfs write callback for regular sysfs files */

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

* [PATCH 4.10 010/110] staging: android: ashmem: lseek failed due to no FMODE_LSEEK.
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 009/110] sysfs: be careful of error returns from ops->show() Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 011/110] arm/arm64: KVM: Take mmap_sem in stage2_unmap_vm Greg Kroah-Hartman
                   ` (99 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Shuxiao Zhang, Greg Hackmann

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

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

From: Shuxiao Zhang <zhangshuxiao@xiaomi.com>

commit 97fbfef6bd597888485b653175fb846c6998b60c upstream.

vfs_llseek will check whether the file mode has
FMODE_LSEEK, no return failure. But ashmem can be
lseek, so add FMODE_LSEEK to ashmem file.

Comment From Greg Hackmann:
	ashmem_llseek() passes the llseek() call through to the backing
	shmem file.  91360b02ab48 ("ashmem: use vfs_llseek()") changed
	this from directly calling the file's llseek() op into a VFS
	layer call.  This also adds a check for the FMODE_LSEEK bit, so
	without that bit ashmem_llseek() now always fails with -ESPIPE.

Fixes: 91360b02ab48 ("ashmem: use vfs_llseek()")
Signed-off-by: Shuxiao Zhang <zhangshuxiao@xiaomi.com>
Tested-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/staging/android/ashmem.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -409,6 +409,7 @@ static int ashmem_mmap(struct file *file
 			ret = PTR_ERR(vmfile);
 			goto out;
 		}
+		vmfile->f_mode |= FMODE_LSEEK;
 		asma->file = vmfile;
 	}
 	get_file(asma->file);

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

* [PATCH 4.10 011/110] arm/arm64: KVM: Take mmap_sem in stage2_unmap_vm
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 010/110] staging: android: ashmem: lseek failed due to no FMODE_LSEEK Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 012/110] arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region Greg Kroah-Hartman
                   ` (98 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Christoffer Dall, Suzuki K Poulose,
	Marc Zyngier

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

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

From: Marc Zyngier <marc.zyngier@arm.com>

commit 90f6e150e44a0dc3883110eeb3ab35d1be42b6bb upstream.

We don't hold the mmap_sem while searching for the VMAs when
we try to unmap each memslot for a VM. Fix this properly to
avoid unexpected results.

Fixes: commit 957db105c997 ("arm/arm64: KVM: Introduce stage2_unmap_vm")
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/kvm/mmu.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -803,6 +803,7 @@ void stage2_unmap_vm(struct kvm *kvm)
 	int idx;
 
 	idx = srcu_read_lock(&kvm->srcu);
+	down_read(&current->mm->mmap_sem);
 	spin_lock(&kvm->mmu_lock);
 
 	slots = kvm_memslots(kvm);
@@ -810,6 +811,7 @@ void stage2_unmap_vm(struct kvm *kvm)
 		stage2_unmap_memslot(kvm, memslot);
 
 	spin_unlock(&kvm->mmu_lock);
+	up_read(&current->mm->mmap_sem);
 	srcu_read_unlock(&kvm->srcu, idx);
 }
 

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

* [PATCH 4.10 012/110] arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 011/110] arm/arm64: KVM: Take mmap_sem in stage2_unmap_vm Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 013/110] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd Greg Kroah-Hartman
                   ` (97 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ard Biesheuvel, Eric Auger,
	Christoffer Dall, Suzuki K Poulose, Marc Zyngier

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

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

From: Marc Zyngier <marc.zyngier@arm.com>

commit 72f310481a08db821b614e7b5d00febcc9064b36 upstream.

We don't hold the mmap_sem while searching for VMAs (via find_vma), in
kvm_arch_prepare_memory_region, which can end up in expected failures.

Fixes: commit 8eef91239e57 ("arm/arm64: KVM: map MMIO regions at creation time")
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Auger <eric.auger@rehat.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
[ Handle dirty page logging failure case ]
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/kvm/mmu.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -1806,6 +1806,7 @@ int kvm_arch_prepare_memory_region(struc
 	    (KVM_PHYS_SIZE >> PAGE_SHIFT))
 		return -EFAULT;
 
+	down_read(&current->mm->mmap_sem);
 	/*
 	 * A memory region could potentially cover multiple VMAs, and any holes
 	 * between them, so iterate over all of them to find out if we can map
@@ -1849,8 +1850,10 @@ int kvm_arch_prepare_memory_region(struc
 			pa += vm_start - vma->vm_start;
 
 			/* IO region dirty page logging not allowed */
-			if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES)
-				return -EINVAL;
+			if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES) {
+				ret = -EINVAL;
+				goto out;
+			}
 
 			ret = kvm_phys_addr_ioremap(kvm, gpa, pa,
 						    vm_end - vm_start,
@@ -1862,7 +1865,7 @@ int kvm_arch_prepare_memory_region(struc
 	} while (hva < reg_end);
 
 	if (change == KVM_MR_FLAGS_ONLY)
-		return ret;
+		goto out;
 
 	spin_lock(&kvm->mmu_lock);
 	if (ret)
@@ -1870,6 +1873,8 @@ int kvm_arch_prepare_memory_region(struc
 	else
 		stage2_flush_memslot(kvm, memslot);
 	spin_unlock(&kvm->mmu_lock);
+out:
+	up_read(&current->mm->mmap_sem);
 	return ret;
 }
 

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

* [PATCH 4.10 013/110] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 012/110] arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 014/110] iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values Greg Kroah-Hartman
                   ` (96 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Paolo Bonzini, Marc Zyngier,
	Christoffer Dall, Mark Rutland, Suzuki K Poulose,
	Christoffer Dall

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

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

From: Suzuki K Poulose <suzuki.poulose@arm.com>

commit 8b3405e345b5a098101b0c31b264c812bba045d9 upstream.

In kvm_free_stage2_pgd() we don't hold the kvm->mmu_lock while calling
unmap_stage2_range() on the entire memory range for the guest. This could
cause problems with other callers (e.g, munmap on a memslot) trying to
unmap a range. And since we have to unmap the entire Guest memory range
holding a spinlock, make sure we yield the lock if necessary, after we
unmap each PUD range.

Fixes: commit d5d8184d35c9 ("KVM: ARM: Memory virtualization setup")
Cc: Paolo Bonzini <pbonzin@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
[ Avoid vCPU starvation and lockup detector warnings ]
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/kvm/mmu.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -292,11 +292,18 @@ static void unmap_stage2_range(struct kv
 	phys_addr_t addr = start, end = start + size;
 	phys_addr_t next;
 
+	assert_spin_locked(&kvm->mmu_lock);
 	pgd = kvm->arch.pgd + stage2_pgd_index(addr);
 	do {
 		next = stage2_pgd_addr_end(addr, end);
 		if (!stage2_pgd_none(*pgd))
 			unmap_stage2_puds(kvm, pgd, addr, next);
+		/*
+		 * If the range is too large, release the kvm->mmu_lock
+		 * to prevent starvation and lockup detector warnings.
+		 */
+		if (next != end)
+			cond_resched_lock(&kvm->mmu_lock);
 	} while (pgd++, addr = next, addr != end);
 }
 
@@ -831,7 +838,10 @@ void kvm_free_stage2_pgd(struct kvm *kvm
 	if (kvm->arch.pgd == NULL)
 		return;
 
+	spin_lock(&kvm->mmu_lock);
 	unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
+	spin_unlock(&kvm->mmu_lock);
+
 	/* Free the HW pgd, one page at a time */
 	free_pages_exact(kvm->arch.pgd, S2_PGD_SIZE);
 	kvm->arch.pgd = NULL;

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

* [PATCH 4.10 014/110] iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 013/110] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 015/110] iio: st_pressure: initialize lps22hb bootime Greg Kroah-Hartman
                   ` (95 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Nikolaus Schulz, Lars-Peter Clausen,
	Jonathan Cameron

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

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

From: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>

commit 7fd6592d1287046f61bfd3cda3c03cd35be490f7 upstream.

Fix formatting of negative values of type IIO_VAL_FRACTIONAL_LOG2 by
switching from do_div(), which can't handle negative numbers, to
div_s64_rem().  Also use shift_right for shifting, which is safe with
negative values.

Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
Reviewed-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/iio/industrialio-core.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -608,10 +608,9 @@ static ssize_t __iio_format_value(char *
 		tmp0 = (int)div_s64_rem(tmp, 1000000000, &tmp1);
 		return snprintf(buf, len, "%d.%09u", tmp0, abs(tmp1));
 	case IIO_VAL_FRACTIONAL_LOG2:
-		tmp = (s64)vals[0] * 1000000000LL >> vals[1];
-		tmp1 = do_div(tmp, 1000000000LL);
-		tmp0 = tmp;
-		return snprintf(buf, len, "%d.%09u", tmp0, tmp1);
+		tmp = shift_right((s64)vals[0] * 1000000000LL, vals[1]);
+		tmp0 = (int)div_s64_rem(tmp, 1000000000LL, &tmp1);
+		return snprintf(buf, len, "%d.%09u", tmp0, abs(tmp1));
 	case IIO_VAL_INT_MULTIPLE:
 	{
 		int i;

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

* [PATCH 4.10 015/110] iio: st_pressure: initialize lps22hb bootime
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 014/110] iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 016/110] iio: bmg160: reset chip when probing Greg Kroah-Hartman
                   ` (94 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Shrirang Bagul, Jonathan Cameron

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

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

From: Shrirang Bagul <shrirang.bagul@canonical.com>

commit 51f528a1636f352ad776a912ac86026ac7a89a2a upstream.

This patch initializes the bootime in struct st_sensor_settings for
lps22hb sensor. Without this, sensor channels read from sysfs always
report stale values.

Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/pressure/st_pressure_core.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -455,6 +455,7 @@ static const struct st_sensor_settings s
 			.addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
 		},
 		.multi_read_bit = true,
+		.bootime = 2,
 	},
 };
 

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

* [PATCH 4.10 016/110] iio: bmg160: reset chip when probing
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 015/110] iio: st_pressure: initialize lps22hb bootime Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 017/110] arm64: mm: unaligned access by user-land should be received as SIGBUS Greg Kroah-Hartman
                   ` (93 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Quentin Schulz, Jonathan Cameron

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

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

From: Quentin Schulz <quentin.schulz@free-electrons.com>

commit 4bdc9029685ac03be50b320b29691766d2326c2b upstream.

The gyroscope chip might need to be reset to be used.

Without the chip being reset, the driver stopped at the first
regmap_read (to get the CHIP_ID) and failed to probe.

The datasheet of the gyroscope says that a minimum wait of 30ms after
the reset has to be done.

This patch has been checked on a BMX055 and the datasheet of the BMG160
and the BMI055 give the same reset register and bits.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/iio/gyro/bmg160_core.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/drivers/iio/gyro/bmg160_core.c
+++ b/drivers/iio/gyro/bmg160_core.c
@@ -27,6 +27,7 @@
 #include <linux/iio/trigger_consumer.h>
 #include <linux/iio/triggered_buffer.h>
 #include <linux/regmap.h>
+#include <linux/delay.h>
 #include "bmg160.h"
 
 #define BMG160_IRQ_NAME		"bmg160_event"
@@ -52,6 +53,9 @@
 #define BMG160_DEF_BW			100
 #define BMG160_REG_PMU_BW_RES		BIT(7)
 
+#define BMG160_GYRO_REG_RESET		0x14
+#define BMG160_GYRO_RESET_VAL		0xb6
+
 #define BMG160_REG_INT_MAP_0		0x17
 #define BMG160_INT_MAP_0_BIT_ANY	BIT(1)
 
@@ -236,6 +240,14 @@ static int bmg160_chip_init(struct bmg16
 	int ret;
 	unsigned int val;
 
+	/*
+	 * Reset chip to get it in a known good state. A delay of 30ms after
+	 * reset is required according to the datasheet.
+	 */
+	regmap_write(data->regmap, BMG160_GYRO_REG_RESET,
+		     BMG160_GYRO_RESET_VAL);
+	usleep_range(30000, 30700);
+
 	ret = regmap_read(data->regmap, BMG160_REG_CHIP_ID, &val);
 	if (ret < 0) {
 		dev_err(dev, "Error reading reg_chip_id\n");

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

* [PATCH 4.10 017/110] arm64: mm: unaligned access by user-land should be received as SIGBUS
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 016/110] iio: bmg160: reset chip when probing Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 018/110] cfg80211: check rdev resume callback only for registered wiphy Greg Kroah-Hartman
                   ` (92 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Victor Kamensky, Will Deacon

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

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

From: Victor Kamensky <kamensky@cisco.com>

commit 09a6adf53d42ca3088fa3fb41f40b768efc711ed upstream.

After 52d7523 (arm64: mm: allow the kernel to handle alignment faults on
user accesses) commit user-land accesses that produce unaligned exceptions
like in case of aarch32 ldm/stm/ldrd/strd instructions operating on
unaligned memory received by user-land as SIGSEGV. It is wrong, it should
be reported as SIGBUS as it was before 52d7523 commit.

Changed do_bad_area function to take signal and code parameters out of esr
value using fault_info table, so in case of do_alignment_fault fault
user-land will receive SIGBUS. Wrapped access to fault_info table into
esr_to_fault_info function.

Fixes: 52d7523 (arm64: mm: allow the kernel to handle alignment faults on user accesses)
Signed-off-by: Victor Kamensky <kamensky@cisco.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm64/mm/fault.c |   42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -41,7 +41,20 @@
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 
-static const char *fault_name(unsigned int esr);
+struct fault_info {
+	int	(*fn)(unsigned long addr, unsigned int esr,
+		      struct pt_regs *regs);
+	int	sig;
+	int	code;
+	const char *name;
+};
+
+static const struct fault_info fault_info[];
+
+static inline const struct fault_info *esr_to_fault_info(unsigned int esr)
+{
+	return fault_info + (esr & 63);
+}
 
 #ifdef CONFIG_KPROBES
 static inline int notify_page_fault(struct pt_regs *regs, unsigned int esr)
@@ -196,10 +209,12 @@ static void __do_user_fault(struct task_
 			    struct pt_regs *regs)
 {
 	struct siginfo si;
+	const struct fault_info *inf;
 
 	if (unhandled_signal(tsk, sig) && show_unhandled_signals_ratelimited()) {
+		inf = esr_to_fault_info(esr);
 		pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n",
-			tsk->comm, task_pid_nr(tsk), fault_name(esr), sig,
+			tsk->comm, task_pid_nr(tsk), inf->name, sig,
 			addr, esr);
 		show_pte(tsk->mm, addr);
 		show_regs(regs);
@@ -218,14 +233,16 @@ static void do_bad_area(unsigned long ad
 {
 	struct task_struct *tsk = current;
 	struct mm_struct *mm = tsk->active_mm;
+	const struct fault_info *inf;
 
 	/*
 	 * If we are in kernel mode at this point, we have no context to
 	 * handle this fault with.
 	 */
-	if (user_mode(regs))
-		__do_user_fault(tsk, addr, esr, SIGSEGV, SEGV_MAPERR, regs);
-	else
+	if (user_mode(regs)) {
+		inf = esr_to_fault_info(esr);
+		__do_user_fault(tsk, addr, esr, inf->sig, inf->code, regs);
+	} else
 		__do_kernel_fault(mm, addr, esr, regs);
 }
 
@@ -487,12 +504,7 @@ static int do_bad(unsigned long addr, un
 	return 1;
 }
 
-static const struct fault_info {
-	int	(*fn)(unsigned long addr, unsigned int esr, struct pt_regs *regs);
-	int	sig;
-	int	code;
-	const char *name;
-} fault_info[] = {
+static const struct fault_info fault_info[] = {
 	{ do_bad,		SIGBUS,  0,		"ttbr address size fault"	},
 	{ do_bad,		SIGBUS,  0,		"level 1 address size fault"	},
 	{ do_bad,		SIGBUS,  0,		"level 2 address size fault"	},
@@ -559,19 +571,13 @@ static const struct fault_info {
 	{ do_bad,		SIGBUS,  0,		"unknown 63"			},
 };
 
-static const char *fault_name(unsigned int esr)
-{
-	const struct fault_info *inf = fault_info + (esr & 63);
-	return inf->name;
-}
-
 /*
  * Dispatch a data abort to the relevant handler.
  */
 asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
 					 struct pt_regs *regs)
 {
-	const struct fault_info *inf = fault_info + (esr & 63);
+	const struct fault_info *inf = esr_to_fault_info(esr);
 	struct siginfo info;
 
 	if (!inf->fn(addr, esr, regs))

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

* [PATCH 4.10 018/110] cfg80211: check rdev resume callback only for registered wiphy
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 017/110] arm64: mm: unaligned access by user-land should be received as SIGBUS Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 019/110] Reset TreeId to zero on SMB2 TREE_CONNECT Greg Kroah-Hartman
                   ` (91 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel J Blueman, Hante Meuleman,
	Pieter-Paul Giesberts, Franky Lin, Arend van Spriel,
	Johannes Berg

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

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

From: Arend Van Spriel <arend.vanspriel@broadcom.com>

commit b3ef5520c1eabb56064474043c7c55a1a65b8708 upstream.

We got the following use-after-free KASAN report:

 BUG: KASAN: use-after-free in wiphy_resume+0x591/0x5a0 [cfg80211]
	 at addr ffff8803fc244090
 Read of size 8 by task kworker/u16:24/2587
 CPU: 6 PID: 2587 Comm: kworker/u16:24 Tainted: G    B 4.9.13-debug+
 Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 1.2.19 12/22/2016
 Workqueue: events_unbound async_run_entry_fn
  ffff880425d4f9d8 ffffffffaeedb541 ffff88042b80ef00 ffff8803fc244088
  ffff880425d4fa00 ffffffffae84d7a1 ffff880425d4fa98 ffff8803fc244080
  ffff88042b80ef00 ffff880425d4fa88 ffffffffae84da3a ffffffffc141f7d9
 Call Trace:
  [<ffffffffaeedb541>] dump_stack+0x85/0xc4
  [<ffffffffae84d7a1>] kasan_object_err+0x21/0x70
  [<ffffffffae84da3a>] kasan_report_error+0x1fa/0x500
  [<ffffffffc141f7d9>] ? cfg80211_bss_age+0x39/0xc0 [cfg80211]
  [<ffffffffc141f83a>] ? cfg80211_bss_age+0x9a/0xc0 [cfg80211]
  [<ffffffffae48d46d>] ? trace_hardirqs_on+0xd/0x10
  [<ffffffffc13fb1c0>] ? wiphy_suspend+0xc70/0xc70 [cfg80211]
  [<ffffffffae84def1>] __asan_report_load8_noabort+0x61/0x70
  [<ffffffffc13fb100>] ? wiphy_suspend+0xbb0/0xc70 [cfg80211]
  [<ffffffffc13fb751>] ? wiphy_resume+0x591/0x5a0 [cfg80211]
  [<ffffffffc13fb751>] wiphy_resume+0x591/0x5a0 [cfg80211]
  [<ffffffffc13fb1c0>] ? wiphy_suspend+0xc70/0xc70 [cfg80211]
  [<ffffffffaf3b206e>] dpm_run_callback+0x6e/0x4f0
  [<ffffffffaf3b31b2>] device_resume+0x1c2/0x670
  [<ffffffffaf3b367d>] async_resume+0x1d/0x50
  [<ffffffffae3ee84e>] async_run_entry_fn+0xfe/0x610
  [<ffffffffae3d0666>] process_one_work+0x716/0x1a50
  [<ffffffffae3d05c9>] ? process_one_work+0x679/0x1a50
  [<ffffffffafdd7b6d>] ? _raw_spin_unlock_irq+0x3d/0x60
  [<ffffffffae3cff50>] ? pwq_dec_nr_in_flight+0x2b0/0x2b0
  [<ffffffffae3d1a80>] worker_thread+0xe0/0x1460
  [<ffffffffae3d19a0>] ? process_one_work+0x1a50/0x1a50
  [<ffffffffae3e54c2>] kthread+0x222/0x2e0
  [<ffffffffae3e52a0>] ? kthread_park+0x80/0x80
  [<ffffffffae3e52a0>] ? kthread_park+0x80/0x80
  [<ffffffffae3e52a0>] ? kthread_park+0x80/0x80
  [<ffffffffafdd86aa>] ret_from_fork+0x2a/0x40
 Object at ffff8803fc244088, in cache kmalloc-1024 size: 1024
 Allocated:
 PID = 71
  save_stack_trace+0x1b/0x20
  save_stack+0x46/0xd0
  kasan_kmalloc+0xad/0xe0
  kasan_slab_alloc+0x12/0x20
  __kmalloc_track_caller+0x134/0x360
  kmemdup+0x20/0x50
  brcmf_cfg80211_attach+0x10b/0x3a90 [brcmfmac]
  brcmf_bus_start+0x19a/0x9a0 [brcmfmac]
  brcmf_pcie_setup+0x1f1a/0x3680 [brcmfmac]
  brcmf_fw_request_nvram_done+0x44c/0x11b0 [brcmfmac]
  request_firmware_work_func+0x135/0x280
  process_one_work+0x716/0x1a50
  worker_thread+0xe0/0x1460
  kthread+0x222/0x2e0
  ret_from_fork+0x2a/0x40
 Freed:
 PID = 2568
  save_stack_trace+0x1b/0x20
  save_stack+0x46/0xd0
  kasan_slab_free+0x71/0xb0
  kfree+0xe8/0x2e0
  brcmf_cfg80211_detach+0x62/0xf0 [brcmfmac]
  brcmf_detach+0x14a/0x2b0 [brcmfmac]
  brcmf_pcie_remove+0x140/0x5d0 [brcmfmac]
  brcmf_pcie_pm_leave_D3+0x198/0x2e0 [brcmfmac]
  pci_pm_resume+0x186/0x220
  dpm_run_callback+0x6e/0x4f0
  device_resume+0x1c2/0x670
  async_resume+0x1d/0x50
  async_run_entry_fn+0xfe/0x610
  process_one_work+0x716/0x1a50
  worker_thread+0xe0/0x1460
  kthread+0x222/0x2e0
  ret_from_fork+0x2a/0x40
 Memory state around the buggy address:
  ffff8803fc243f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
  ffff8803fc244000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 >ffff8803fc244080: fc fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                          ^
  ffff8803fc244100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8803fc244180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

What is happening is that brcmf_pcie_resume() detects a device that
is no longer responsive and it decides to unbind resulting in a
wiphy_unregister() and wiphy_free() call. Now the wiphy instance
remains allocated, because PM needs to call wiphy_resume() for it.
However, brcmfmac already does a kfree() for the struct
cfg80211_registered_device::ops field. Change the checks in
wiphy_resume() to only access the struct cfg80211_registered_device::ops
if the wiphy instance is still registered at this time.

Reported-by: Daniel J Blueman <daniel@quora.org>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/wireless/sysfs.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

--- a/net/wireless/sysfs.c
+++ b/net/wireless/sysfs.c
@@ -130,12 +130,10 @@ static int wiphy_resume(struct device *d
 	/* Age scan results with time spent in suspend */
 	cfg80211_bss_age(rdev, get_seconds() - rdev->suspend_at);
 
-	if (rdev->ops->resume) {
-		rtnl_lock();
-		if (rdev->wiphy.registered)
-			ret = rdev_resume(rdev);
-		rtnl_unlock();
-	}
+	rtnl_lock();
+	if (rdev->wiphy.registered && rdev->ops->resume)
+		ret = rdev_resume(rdev);
+	rtnl_unlock();
 
 	return ret;
 }

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

* [PATCH 4.10 019/110] Reset TreeId to zero on SMB2 TREE_CONNECT
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 018/110] cfg80211: check rdev resume callback only for registered wiphy Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 020/110] mm/page_alloc.c: fix print order in show_free_areas() Greg Kroah-Hartman
                   ` (90 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jan-Marek Glogowski, Aurelien Aptel,
	Steve French

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

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

From: Jan-Marek Glogowski <glogow@fbihome.de>

commit 806a28efe9b78ffae5e2757e1ee924b8e50c08ab upstream.

Currently the cifs module breaks the CIFS specs on reconnect as
described in http://msdn.microsoft.com/en-us/library/cc246529.aspx:

"TreeId (4 bytes): Uniquely identifies the tree connect for the
command. This MUST be 0 for the SMB2 TREE_CONNECT Request."

Signed-off-by: Jan-Marek Glogowski <glogow@fbihome.de>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Tested-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/cifs/smb2pdu.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1104,6 +1104,10 @@ SMB2_tcon(const unsigned int xid, struct
 		return -EINVAL;
 	}
 
+	/* SMB2 TREE_CONNECT request must be called with TreeId == 0 */
+	if (tcon)
+		tcon->tid = 0;
+
 	rc = small_smb2_init(SMB2_TREE_CONNECT, tcon, (void **) &req);
 	if (rc) {
 		kfree(unc_path);

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

* [PATCH 4.10 020/110] mm/page_alloc.c: fix print order in show_free_areas()
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 019/110] Reset TreeId to zero on SMB2 TREE_CONNECT Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 021/110] ptrace: fix PTRACE_LISTEN race corrupting task->state Greg Kroah-Hartman
                   ` (89 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alexander Polyakov, Michal Hocko,
	Mel Gorman, Vlastimil Babka, Andrew Morton, Linus Torvalds

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

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

From: Alexander Polakov <apolyakov@beget.ru>

commit 1f06b81aea5ecba2c1f8afd87e0ba1b9f8f90160 upstream.

Fixes: 11fb998986a72a ("mm: move most file-based accounting to the node")
Link: http://lkml.kernel.org/r/1490377730.30219.2.camel@beget.ru
Signed-off-by: Alexander Polyakov <apolyakov@beget.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
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/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4381,13 +4381,13 @@ void show_free_areas(unsigned int filter
 			K(node_page_state(pgdat, NR_FILE_MAPPED)),
 			K(node_page_state(pgdat, NR_FILE_DIRTY)),
 			K(node_page_state(pgdat, NR_WRITEBACK)),
+			K(node_page_state(pgdat, NR_SHMEM)),
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 			K(node_page_state(pgdat, NR_SHMEM_THPS) * HPAGE_PMD_NR),
 			K(node_page_state(pgdat, NR_SHMEM_PMDMAPPED)
 					* HPAGE_PMD_NR),
 			K(node_page_state(pgdat, NR_ANON_THPS) * HPAGE_PMD_NR),
 #endif
-			K(node_page_state(pgdat, NR_SHMEM)),
 			K(node_page_state(pgdat, NR_WRITEBACK_TEMP)),
 			K(node_page_state(pgdat, NR_UNSTABLE_NFS)),
 			node_page_state(pgdat, NR_PAGES_SCANNED),

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

* [PATCH 4.10 021/110] ptrace: fix PTRACE_LISTEN race corrupting task->state
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 020/110] mm/page_alloc.c: fix print order in show_free_areas() Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 022/110] dax: fix radix tree insertion race Greg Kroah-Hartman
                   ` (88 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ben Segall, Oleg Nesterov,
	Andrew Morton, Linus Torvalds

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

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

From: bsegall@google.com <bsegall@google.com>

commit 5402e97af667e35e54177af8f6575518bf251d51 upstream.

In PT_SEIZED + LISTEN mode STOP/CONT signals cause a wakeup against
__TASK_TRACED.  If this races with the ptrace_unfreeze_traced at the end
of a PTRACE_LISTEN, this can wake the task /after/ the check against
__TASK_TRACED, but before the reset of state to TASK_TRACED.  This
causes it to instead clobber TASK_WAKING, allowing a subsequent wakeup
against TRACED while the task is still on the rq wake_list, corrupting
it.

Oleg said:
 "The kernel can crash or this can lead to other hard-to-debug problems.
  In short, "task->state = TASK_TRACED" in ptrace_unfreeze_traced()
  assumes that nobody else can wake it up, but PTRACE_LISTEN breaks the
  contract. Obviusly it is very wrong to manipulate task->state if this
  task is already running, or WAKING, or it sleeps again"

[akpm@linux-foundation.org: coding-style fixes]
Fixes: 9899d11f ("ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL")
Link: http://lkml.kernel.org/r/xm26y3vfhmkp.fsf_-_@bsegall-linux.mtv.corp.google.com
Signed-off-by: Ben Segall <bsegall@google.com>
Acked-by: Oleg Nesterov <oleg@redhat.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>

---
 kernel/ptrace.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -181,11 +181,17 @@ static void ptrace_unfreeze_traced(struc
 
 	WARN_ON(!task->ptrace || task->parent != current);
 
+	/*
+	 * PTRACE_LISTEN can allow ptrace_trap_notify to wake us up remotely.
+	 * Recheck state under the lock to close this race.
+	 */
 	spin_lock_irq(&task->sighand->siglock);
-	if (__fatal_signal_pending(task))
-		wake_up_state(task, __TASK_TRACED);
-	else
-		task->state = TASK_TRACED;
+	if (task->state == __TASK_TRACED) {
+		if (__fatal_signal_pending(task))
+			wake_up_state(task, __TASK_TRACED);
+		else
+			task->state = TASK_TRACED;
+	}
 	spin_unlock_irq(&task->sighand->siglock);
 }
 

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

* [PATCH 4.10 022/110] dax: fix radix tree insertion race
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 021/110] ptrace: fix PTRACE_LISTEN race corrupting task->state Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 023/110] dm verity fec: limit error correction recursion Greg Kroah-Hartman
                   ` (87 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ross Zwisler, Darrick J. Wong,
	Alexander Viro, Christoph Hellwig, Dan Williams, Jan Kara,
	Matthew Wilcox, Andrew Morton, Linus Torvalds

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

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

From: Ross Zwisler <ross.zwisler@linux.intel.com>

commit e11f8b7b6c4ea13bf8af6b8f42b45e15b554a92b upstream.

While running generic/340 in my test setup I hit the following race.  It
can happen with kernels that support FS DAX PMDs, so v4.10 thru
v4.11-rc5.

Thread 1				Thread 2
--------				--------
dax_iomap_pmd_fault()
  grab_mapping_entry()
    spin_lock_irq()
    get_unlocked_mapping_entry()
    'entry' is NULL, can't call lock_slot()
    spin_unlock_irq()
    radix_tree_preload()
					dax_iomap_pmd_fault()
					  grab_mapping_entry()
					    spin_lock_irq()
					    get_unlocked_mapping_entry()
					    ...
					    lock_slot()
					    spin_unlock_irq()
					  dax_pmd_insert_mapping()
					    <inserts a PMD mapping>
    spin_lock_irq()
    __radix_tree_insert() fails with -EEXIST
    <fall back to 4k fault, and die horribly
     when inserting a 4k entry where a PMD exists>

The issue is that we have to drop mapping->tree_lock while calling
radix_tree_preload(), but since we didn't have a radix tree entry to
lock (unlike in the pmd_downgrade case) we have no protection against
Thread 2 coming along and inserting a PMD at the same index.  For 4k
entries we handled this with a special-case response to -EEXIST coming
from the __radix_tree_insert(), but this doesn't save us for PMDs
because the -EEXIST case can also mean that we collided with a 4k entry
in the radix tree at a different index, but one that is covered by our
PMD range.

So, correctly handle both the 4k and 2M collision cases by explicitly
re-checking the radix tree for an entry at our index once we reacquire
mapping->tree_lock.

This patch has made it through a clean xfstests run with the current
v4.11-rc5 based linux/master, and it also ran generic/340 500 times in a
loop.  It used to fail within the first 10 iterations.

Link: http://lkml.kernel.org/r/20170406212944.2866-1-ross.zwisler@linux.intel.com
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Matthew Wilcox <mawilcox@microsoft.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>

---
 fs/dax.c |   35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

--- a/fs/dax.c
+++ b/fs/dax.c
@@ -369,6 +369,22 @@ restart:
 		}
 		spin_lock_irq(&mapping->tree_lock);
 
+		if (!entry) {
+			/*
+			 * We needed to drop the page_tree lock while calling
+			 * radix_tree_preload() and we didn't have an entry to
+			 * lock.  See if another thread inserted an entry at
+			 * our index during this time.
+			 */
+			entry = __radix_tree_lookup(&mapping->page_tree, index,
+					NULL, &slot);
+			if (entry) {
+				radix_tree_preload_end();
+				spin_unlock_irq(&mapping->tree_lock);
+				goto restart;
+			}
+		}
+
 		if (pmd_downgrade) {
 			radix_tree_delete(&mapping->page_tree, index);
 			mapping->nrexceptional--;
@@ -384,19 +400,12 @@ restart:
 		if (err) {
 			spin_unlock_irq(&mapping->tree_lock);
 			/*
-			 * Someone already created the entry?  This is a
-			 * normal failure when inserting PMDs in a range
-			 * that already contains PTEs.  In that case we want
-			 * to return -EEXIST immediately.
-			 */
-			if (err == -EEXIST && !(size_flag & RADIX_DAX_PMD))
-				goto restart;
-			/*
-			 * Our insertion of a DAX PMD entry failed, most
-			 * likely because it collided with a PTE sized entry
-			 * at a different index in the PMD range.  We haven't
-			 * inserted anything into the radix tree and have no
-			 * waiters to wake.
+			 * Our insertion of a DAX entry failed, most likely
+			 * because we were inserting a PMD entry and it
+			 * collided with a PTE sized entry at a different
+			 * index in the PMD range.  We haven't inserted
+			 * anything into the radix tree and have no waiters to
+			 * wake.
 			 */
 			return ERR_PTR(err);
 		}

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

* [PATCH 4.10 023/110] dm verity fec: limit error correction recursion
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 022/110] dax: fix radix tree insertion race Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 024/110] dm verity fec: fix bufio leaks Greg Kroah-Hartman
                   ` (86 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Sami Tolvanen, Mike Snitzer

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

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

From: Sami Tolvanen <samitolvanen@google.com>

commit f1a880a93baaadb14c10a348fd199f1cdb6bcccd upstream.

If the hash tree itself is sufficiently corrupt in addition to data blocks,
it's possible for error correction to end up in a deep recursive loop,
which eventually causes a kernel panic.  This change limits the
recursion to a reasonable level during a single I/O operation.

Fixes: a739ff3f543a ("dm verity: add support for forward error correction")
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/dm-verity-fec.c |   12 +++++++++++-
 drivers/md/dm-verity-fec.h |    4 ++++
 2 files changed, 15 insertions(+), 1 deletion(-)

--- a/drivers/md/dm-verity-fec.c
+++ b/drivers/md/dm-verity-fec.c
@@ -439,6 +439,13 @@ int verity_fec_decode(struct dm_verity *
 	if (!verity_fec_is_enabled(v))
 		return -EOPNOTSUPP;
 
+	if (fio->level >= DM_VERITY_FEC_MAX_RECURSION) {
+		DMWARN_LIMIT("%s: FEC: recursion too deep", v->data_dev->name);
+		return -EIO;
+	}
+
+	fio->level++;
+
 	if (type == DM_VERITY_BLOCK_TYPE_METADATA)
 		block += v->data_blocks;
 
@@ -470,7 +477,7 @@ int verity_fec_decode(struct dm_verity *
 	if (r < 0) {
 		r = fec_decode_rsb(v, io, fio, rsb, offset, true);
 		if (r < 0)
-			return r;
+			goto done;
 	}
 
 	if (dest)
@@ -480,6 +487,8 @@ int verity_fec_decode(struct dm_verity *
 		r = verity_for_bv_block(v, io, iter, fec_bv_copy);
 	}
 
+done:
+	fio->level--;
 	return r;
 }
 
@@ -520,6 +529,7 @@ void verity_fec_init_io(struct dm_verity
 	memset(fio->bufs, 0, sizeof(fio->bufs));
 	fio->nbufs = 0;
 	fio->output = NULL;
+	fio->level = 0;
 }
 
 /*
--- a/drivers/md/dm-verity-fec.h
+++ b/drivers/md/dm-verity-fec.h
@@ -27,6 +27,9 @@
 #define DM_VERITY_FEC_BUF_MAX \
 	(1 << (PAGE_SHIFT - DM_VERITY_FEC_BUF_RS_BITS))
 
+/* maximum recursion level for verity_fec_decode */
+#define DM_VERITY_FEC_MAX_RECURSION	4
+
 #define DM_VERITY_OPT_FEC_DEV		"use_fec_from_device"
 #define DM_VERITY_OPT_FEC_BLOCKS	"fec_blocks"
 #define DM_VERITY_OPT_FEC_START		"fec_start"
@@ -58,6 +61,7 @@ struct dm_verity_fec_io {
 	unsigned nbufs;		/* number of buffers allocated */
 	u8 *output;		/* buffer for corrected output */
 	size_t output_pos;
+	unsigned level;		/* recursion level */
 };
 
 #ifdef CONFIG_DM_VERITY_FEC

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

* [PATCH 4.10 024/110] dm verity fec: fix bufio leaks
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 023/110] dm verity fec: limit error correction recursion Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 025/110] ACPI / gpio: do not fall back to parsing _CRS when we get a deferral Greg Kroah-Hartman
                   ` (85 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Sami Tolvanen, Mike Snitzer

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

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

From: Sami Tolvanen <samitolvanen@google.com>

commit 86e3e83b443669dd2bcc5c8a83b23e3aa0694c0d upstream.

Buffers read through dm_bufio_read() were not released in all code paths.

Fixes: a739ff3f543a ("dm verity: add support for forward error correction")
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/dm-verity-fec.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/md/dm-verity-fec.c
+++ b/drivers/md/dm-verity-fec.c
@@ -146,8 +146,6 @@ static int fec_decode_bufs(struct dm_ver
 		block = fec_buffer_rs_block(v, fio, n, i);
 		res = fec_decode_rs8(v, fio, block, &par[offset], neras);
 		if (res < 0) {
-			dm_bufio_release(buf);
-
 			r = res;
 			goto error;
 		}
@@ -172,6 +170,8 @@ static int fec_decode_bufs(struct dm_ver
 done:
 	r = corrected;
 error:
+	dm_bufio_release(buf);
+
 	if (r < 0 && neras)
 		DMERR_LIMIT("%s: FEC %llu: failed to correct: %d",
 			    v->data_dev->name, (unsigned long long)rsb, r);
@@ -269,7 +269,7 @@ static int fec_read_bufs(struct dm_verit
 					  &is_zero) == 0) {
 			/* skip known zero blocks entirely */
 			if (is_zero)
-				continue;
+				goto done;
 
 			/*
 			 * skip if we have already found the theoretical

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

* [PATCH 4.10 025/110] ACPI / gpio: do not fall back to parsing _CRS when we get a deferral
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 024/110] dm verity fec: fix bufio leaks Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 026/110] ACPI / scan: Prefer devices without _HID for _ADR matching Greg Kroah-Hartman
                   ` (84 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dmitry Torokhov, Mika Westerberg,
	Linus Walleij

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

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

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

commit 693bdaa164b40b7aa6018b98af6f7e40dbd52457 upstream.

If, while locating GPIOs by name, we get probe deferral, we should
immediately report it to caller rather than trying to fall back to parsing
unnamed GPIOs from _CRS block.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-and-Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpio/gpiolib-acpi.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -572,8 +572,10 @@ struct gpio_desc *acpi_find_gpio(struct
 		}
 
 		desc = acpi_get_gpiod_by_index(adev, propname, idx, &info);
-		if (!IS_ERR(desc) || (PTR_ERR(desc) == -EPROBE_DEFER))
+		if (!IS_ERR(desc))
 			break;
+		if (PTR_ERR(desc) == -EPROBE_DEFER)
+			return ERR_CAST(desc);
 	}
 
 	/* Then from plain _CRS GPIOs */

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

* [PATCH 4.10 026/110] ACPI / scan: Prefer devices without _HID for _ADR matching
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 025/110] ACPI / gpio: do not fall back to parsing _CRS when we get a deferral Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 027/110] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Greg Kroah-Hartman
                   ` (83 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Hans de Goede, Rafael J. Wysocki

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

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

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

commit fdad4e7a876a2cb3d2c1f04e5418c324e79fffef upstream.

Commit c2a6bbaf0c5f (ACPI / scan: Prefer devices without _HID/_CID
for _ADR matching) added a list_empty(&adev->pnp.ids) check to
find_child_checks() so as to catch situations in which the ACPI
core attempts to decode _ADR for a device having a _HID too which
is strictly against the spec.  However, it overlooked the fact that
the adev->pnp.ids list for the devices taken into account by
find_child_checks() may contain device IDs set internally by the
kernel, like "LNXVIDEO" (thanks to Zhang Rui for that realization),
and it broke the enumeration of those devices as a result.

To unbreak it, replace the overly coarse grained list_empty()
check with a much more precise check against the pnp.type.platform_id
flag which is only set for devices having a _HID (that's how it
should be done from the start, as having both _ADR and _CID is
actually permitted).

Fixes: c2a6bbaf0c5f (ACPI / scan: Prefer devices without _HID/_CID for _ADR matching)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=194889
Reported-and-tested-by: Mike <mike@mikewilson.me.uk>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/glue.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -99,13 +99,13 @@ static int find_child_checks(struct acpi
 		return -ENODEV;
 
 	/*
-	 * If the device has a _HID (or _CID) returning a valid ACPI/PNP
-	 * device ID, it is better to make it look less attractive here, so that
-	 * the other device with the same _ADR value (that may not have a valid
-	 * device ID) can be matched going forward.  [This means a second spec
-	 * violation in a row, so whatever we do here is best effort anyway.]
+	 * If the device has a _HID returning a valid ACPI/PNP device ID, it is
+	 * better to make it look less attractive here, so that the other device
+	 * with the same _ADR value (that may not have a valid device ID) can be
+	 * matched going forward.  [This means a second spec violation in a row,
+	 * so whatever we do here is best effort anyway.]
 	 */
-	return sta_present && list_empty(&adev->pnp.ids) ?
+	return sta_present && !adev->pnp.type.platform_id ?
 			FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE;
 }
 

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

* [PATCH 4.10 027/110] Kbuild: use cc-disable-warning consistently for maybe-uninitialized
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 026/110] ACPI / scan: Prefer devices without _HID for _ADR matching Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 028/110] jump label: fix passing kbuild_cflags when checking for asm goto support Greg Kroah-Hartman
                   ` (82 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, kbuild test robot, Arnd Bergmann,
	Masahiro Yamada

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit b334e19ae9381f12a7521976883022385d2b7eef upstream.

In commit a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning
for "make W=1""), I reverted another change that happened to fix a problem
with old compilers, and now we get this report again with old compilers
(prior to gcc-4.8) and GCOV enabled:

   cc1: warnings being treated as errors
   drivers/gpu/drm/i915/intel_ringbuffer.c: In function 'intel_ring_setup_status_page':
   drivers/gpu/drm/i915/intel_ringbuffer.c:438: error: 'mmio.reg' may be used uninitialized in this function
   At top level:
>> cc1: error: unrecognized command line option "-Wno-maybe-uninitialized"

The problem is that we turn off the warning conditionally in a number
of places as we should, but one of them does it unconditionally.
Instead, change it to call cc-disable-warning as we do elsewhere.

The original patch that caused it was merged into linux-4.7, then
4.8 removed the change and 4.9 brought it back, so we probably want
a backport to 4.9 once this is merged.

Use a ':=' assignment instead of '=' to force the cc-disable-warning
call to only be evaluated once instead of every time.

Fixes: a76bcf557ef4 ("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"")
Fixes: e72e2dfe7c16 ("gcov: disable -Wmaybe-uninitialized warning")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/Makefile
+++ b/Makefile
@@ -370,7 +370,7 @@ LDFLAGS_MODULE  =
 CFLAGS_KERNEL	=
 AFLAGS_KERNEL	=
 LDFLAGS_vmlinux =
-CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
+CFLAGS_GCOV	:= -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
 CFLAGS_KCOV	:= $(call cc-option,-fsanitize-coverage=trace-pc,)
 
 

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

* [PATCH 4.10 028/110] jump label: fix passing kbuild_cflags when checking for asm goto support
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 027/110] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 029/110] orangefs: move features validation to fix filesystem hang Greg Kroah-Hartman
                   ` (81 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Anton V. Boyarshinov,
	Gleb Fotengauer-Malinovskiy, Dmitry V. Levin,
	Steven Rostedt (VMware),
	David Lin, Masahiro Yamada

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

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

From: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>

commit 7292ae3d5a18fb922be496e6bb687647193569b4 upstream.

The latest change of asm goto support check added passing of KBUILD_CFLAGS
to compiler.  When these flags reference gcc plugins that are not built yet,
the check fails.

When one runs "make bzImage" followed by "make modules", the kernel is always
built with HAVE_JUMP_LABEL disabled, while the modules are built depending on
CONFIG_JUMP_LABEL.  If HAVE_JUMP_LABEL macro happens to be different, modules
are built with undefined references, e.g.:

ERROR: "static_key_slow_inc" [net/netfilter/xt_TEE.ko] undefined!
ERROR: "static_key_slow_dec" [net/netfilter/xt_TEE.ko] undefined!
ERROR: "static_key_slow_dec" [net/netfilter/nft_meta.ko] undefined!
ERROR: "static_key_slow_inc" [net/netfilter/nft_meta.ko] undefined!
ERROR: "nf_hooks_needed" [net/netfilter/ipvs/ip_vs.ko] undefined!
ERROR: "nf_hooks_needed" [net/ipv6/ipv6.ko] undefined!
ERROR: "static_key_count" [net/ipv6/ipv6.ko] undefined!
ERROR: "static_key_slow_inc" [net/ipv6/ipv6.ko] undefined!

This change moves the check before all these references are added
to KBUILD_CFLAGS.  This is correct because subsequent KBUILD_CFLAGS
modifications are not relevant to this check.

Reported-by: Anton V. Boyarshinov <boyarsh@altlinux.org>
Fixes: 35f860f9ba6a ("jump label: pass kbuild_cflags when checking for asm goto support")
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: David Lin <dtwlin@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 Makefile |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/Makefile
+++ b/Makefile
@@ -651,6 +651,12 @@ KBUILD_CFLAGS += $(call cc-ifversion, -l
 # Tell gcc to never replace conditional load with a non-conditional one
 KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
 
+# check for 'asm goto'
+ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
+	KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
+	KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
+endif
+
 include scripts/Makefile.gcc-plugins
 
 ifdef CONFIG_READABLE_ASM
@@ -796,12 +802,6 @@ KBUILD_CFLAGS   += $(call cc-option,-Wer
 # use the deterministic mode of AR if available
 KBUILD_ARFLAGS := $(call ar-option,D)
 
-# check for 'asm goto'
-ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
-	KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
-	KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
-endif
-
 include scripts/Makefile.kasan
 include scripts/Makefile.extrawarn
 include scripts/Makefile.ubsan

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

* [PATCH 4.10 029/110] orangefs: move features validation to fix filesystem hang
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 028/110] jump label: fix passing kbuild_cflags when checking for asm goto support Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 030/110] xfs: Honor FALLOC_FL_KEEP_SIZE when punching ends of files Greg Kroah-Hartman
                   ` (80 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Martin Brandenburg, Mike Marshall,
	Linus Torvalds

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

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

From: Martin Brandenburg <martin@omnibond.com>

commit cefdc26e86728812aea54248a534fd4a5da2a43d upstream.

Without this fix (and another to the userspace component itself
described later), the kernel will be unable to process any OrangeFS
requests after the userspace component is restarted (due to a crash or
at the administrator's behest).

The bug here is that inside orangefs_remount, the orangefs_request_mutex
is locked.  When the userspace component restarts while the filesystem
is mounted, it sends a ORANGEFS_DEV_REMOUNT_ALL ioctl to the device,
which causes the kernel to send it a few requests aimed at synchronizing
the state between the two.  While this is happening the
orangefs_request_mutex is locked to prevent any other requests going
through.

This is only half of the bugfix.  The other half is in the userspace
component which outright ignores(!) requests made before it considers
the filesystem remounted, which is after the ioctl returns.  Of course
the ioctl doesn't return until after the userspace component responds to
the request it ignores.  The userspace component has been changed to
allow ORANGEFS_VFS_OP_FEATURES regardless of the mount status.

Mike Marshall says:
 "I've tested this patch against the fixed userspace part. This patch is
  real important, I hope it can make it into 4.11...

  Here's what happens when the userspace daemon is restarted, without
  the patch:

    =============================================
    [ INFO: possible recursive locking detected ]
    [   4.10.0-00007-ge98bdb3 #1 Not tainted    ]
    ---------------------------------------------
    pvfs2-client-co/29032 is trying to acquire lock:
     (orangefs_request_mutex){+.+.+.}, at: service_operation+0x3c7/0x7b0 [orangefs]
                  but task is already holding lock:
     (orangefs_request_mutex){+.+.+.}, at: dispatch_ioctl_command+0x1bf/0x330 [orangefs]

    CPU: 0 PID: 29032 Comm: pvfs2-client-co Not tainted 4.10.0-00007-ge98bdb3 #1
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-1.fc25 04/01/2014
    Call Trace:
     __lock_acquire+0x7eb/0x1290
     lock_acquire+0xe8/0x1d0
     mutex_lock_killable_nested+0x6f/0x6e0
     service_operation+0x3c7/0x7b0 [orangefs]
     orangefs_remount+0xea/0x150 [orangefs]
     dispatch_ioctl_command+0x227/0x330 [orangefs]
     orangefs_devreq_ioctl+0x29/0x70 [orangefs]
     do_vfs_ioctl+0xa3/0x6e0
     SyS_ioctl+0x79/0x90"

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Acked-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/orangefs/super.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/fs/orangefs/super.c
+++ b/fs/orangefs/super.c
@@ -263,8 +263,13 @@ int orangefs_remount(struct orangefs_sb_
 		if (!new_op)
 			return -ENOMEM;
 		new_op->upcall.req.features.features = 0;
-		ret = service_operation(new_op, "orangefs_features", 0);
-		orangefs_features = new_op->downcall.resp.features.features;
+		ret = service_operation(new_op, "orangefs_features",
+		    ORANGEFS_OP_PRIORITY | ORANGEFS_OP_NO_MUTEX);
+		if (!ret)
+			orangefs_features =
+			    new_op->downcall.resp.features.features;
+		else
+			orangefs_features = 0;
 		op_release(new_op);
 	} else {
 		orangefs_features = 0;

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

* [PATCH 4.10 030/110] xfs: Honor FALLOC_FL_KEEP_SIZE when punching ends of files
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 029/110] orangefs: move features validation to fix filesystem hang Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 031/110] ring-buffer: Fix return value check in test_ringbuffer() Greg Kroah-Hartman
                   ` (79 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Aaron Gao, Christoph Hellwig,
	Brian Foster, Calvin Owens, Darrick J. Wong

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

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

From: Calvin Owens <calvinowens@fb.com>

commit 3dd09d5a8589c640abb49cfcf92b4ed669eafad1 upstream.

When punching past EOF on XFS, fallocate(mode=PUNCH_HOLE|KEEP_SIZE) will
round the file size up to the nearest multiple of PAGE_SIZE:

  calvinow@vm-disks/generic-xfs-1 ~$ dd if=/dev/urandom of=test bs=2048 count=1
  calvinow@vm-disks/generic-xfs-1 ~$ stat test
    Size: 2048            Blocks: 8          IO Block: 4096   regular file
  calvinow@vm-disks/generic-xfs-1 ~$ fallocate -n -l 2048 -o 2048 -p test
  calvinow@vm-disks/generic-xfs-1 ~$ stat test
    Size: 4096            Blocks: 8          IO Block: 4096   regular file

Commit 3c2bdc912a1cc050 ("xfs: kill xfs_zero_remaining_bytes") replaced
xfs_zero_remaining_bytes() with calls to iomap helpers. The new helpers
don't enforce that [pos,offset) lies strictly on [0,i_size) when being
called from xfs_free_file_space(), so by "leaking" these ranges into
xfs_zero_range() we get this buggy behavior.

Fix this by reintroducing the checks xfs_zero_remaining_bytes() did
against i_size at the bottom of xfs_free_file_space().

Reported-by: Aaron Gao <gzh@fb.com>
Fixes: 3c2bdc912a1cc050 ("xfs: kill xfs_zero_remaining_bytes")
Cc: Christoph Hellwig <hch@lst.de>
Cc: Brian Foster <bfoster@redhat.com>
Signed-off-by: Calvin Owens <calvinowens@fb.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/xfs/xfs_bmap_util.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1318,8 +1318,16 @@ xfs_free_file_space(
 	/*
 	 * Now that we've unmap all full blocks we'll have to zero out any
 	 * partial block at the beginning and/or end.  xfs_zero_range is
-	 * smart enough to skip any holes, including those we just created.
+	 * smart enough to skip any holes, including those we just created,
+	 * but we must take care not to zero beyond EOF and enlarge i_size.
 	 */
+
+	if (offset >= XFS_ISIZE(ip))
+		return 0;
+
+	if (offset + len > XFS_ISIZE(ip))
+		len = XFS_ISIZE(ip) - offset;
+
 	return xfs_zero_range(ip, offset, len, NULL);
 }
 

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

* [PATCH 4.10 031/110] ring-buffer: Fix return value check in test_ringbuffer()
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 030/110] xfs: Honor FALLOC_FL_KEEP_SIZE when punching ends of files Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 032/110] mac80211: unconditionally start new netdev queues with iTXQ support Greg Kroah-Hartman
                   ` (78 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Wei Yongjun, Steven Rostedt (VMware)

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

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

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

commit 62277de758b155dc04b78f195a1cb5208c37b2df upstream.

In case of error, the function kthread_run() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Link: http://lkml.kernel.org/r/1466184839-14927-1-git-send-email-weiyj_lk@163.com

Fixes: 6c43e554a ("ring-buffer: Add ring buffer startup selftest")
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/trace/ring_buffer.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -4825,9 +4825,9 @@ static __init int test_ringbuffer(void)
 		rb_data[cpu].cnt = cpu;
 		rb_threads[cpu] = kthread_create(rb_test, &rb_data[cpu],
 						 "rbtester/%d", cpu);
-		if (WARN_ON(!rb_threads[cpu])) {
+		if (WARN_ON(IS_ERR(rb_threads[cpu]))) {
 			pr_cont("FAILED\n");
-			ret = -1;
+			ret = PTR_ERR(rb_threads[cpu]);
 			goto out_free;
 		}
 
@@ -4837,9 +4837,9 @@ static __init int test_ringbuffer(void)
 
 	/* Now create the rb hammer! */
 	rb_hammer = kthread_run(rb_hammer_test, NULL, "rbhammer");
-	if (WARN_ON(!rb_hammer)) {
+	if (WARN_ON(IS_ERR(rb_hammer))) {
 		pr_cont("FAILED\n");
-		ret = -1;
+		ret = PTR_ERR(rb_hammer);
 		goto out_free;
 	}
 

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

* [PATCH 4.10 032/110] mac80211: unconditionally start new netdev queues with iTXQ support
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 031/110] ring-buffer: Fix return value check in test_ringbuffer() Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 033/110] brcmfmac: use local iftype avoiding use-after-free of virtual interface Greg Kroah-Hartman
                   ` (77 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Johannes Berg

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

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

From: Johannes Berg <johannes.berg@intel.com>

commit 7d65f82954dadbbe7b6e1aec7e07ad17bc6d958b upstream.

When internal mac80211 TXQs aren't supported, netdev queues must
always started out started even when driver queues are stopped
while the interface is added. This is necessary because with the
internal TXQ support netdev queues are never stopped and packet
scheduling/dropping is done in mac80211.

Fixes: 80a83cfc434b1 ("mac80211: skip netdev queue control with software queuing")
Reported-and-tested-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/mac80211/iface.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -718,7 +718,8 @@ int ieee80211_do_open(struct wireless_de
 	ieee80211_recalc_ps(local);
 
 	if (sdata->vif.type == NL80211_IFTYPE_MONITOR ||
-	    sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
+	    sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
+	    local->ops->wake_tx_queue) {
 		/* XXX: for AP_VLAN, actually track AP queues */
 		netif_tx_start_all_queues(dev);
 	} else if (dev) {

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

* [PATCH 4.10 033/110] brcmfmac: use local iftype avoiding use-after-free of virtual interface
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 032/110] mac80211: unconditionally start new netdev queues with iTXQ support Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 034/110] metag/usercopy: Drop unused macros Greg Kroah-Hartman
                   ` (76 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel J Blueman, Hante Meuleman,
	Pieter-Paul Giesberts, Franky Lin, Arend van Spriel, Kalle Valo

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

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

From: Arend Van Spriel <arend.vanspriel@broadcom.com>

commit d77facb88448cdeaaa3adba5b9704a48ac2ac8d6 upstream.

A use-after-free was found using KASAN. In brcmf_p2p_del_if() the virtual
interface is removed using call to brcmf_remove_interface(). After that
the virtual interface instance has been freed and should not be referenced.
Solve this by storing the nl80211 iftype in local variable, which is used
in a couple of places anyway.

Reported-by: Daniel J Blueman <daniel@quora.org>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -2238,14 +2238,16 @@ int brcmf_p2p_del_vif(struct wiphy *wiph
 	struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy);
 	struct brcmf_p2p_info *p2p = &cfg->p2p;
 	struct brcmf_cfg80211_vif *vif;
+	enum nl80211_iftype iftype;
 	bool wait_for_disable = false;
 	int err;
 
 	brcmf_dbg(TRACE, "delete P2P vif\n");
 	vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev);
 
+	iftype = vif->wdev.iftype;
 	brcmf_cfg80211_arm_vif_event(cfg, vif);
-	switch (vif->wdev.iftype) {
+	switch (iftype) {
 	case NL80211_IFTYPE_P2P_CLIENT:
 		if (test_bit(BRCMF_VIF_STATUS_DISCONNECTING, &vif->sme_state))
 			wait_for_disable = true;
@@ -2275,7 +2277,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiph
 					    BRCMF_P2P_DISABLE_TIMEOUT);
 
 	err = 0;
-	if (vif->wdev.iftype != NL80211_IFTYPE_P2P_DEVICE) {
+	if (iftype != NL80211_IFTYPE_P2P_DEVICE) {
 		brcmf_vif_clear_mgmt_ies(vif);
 		err = brcmf_p2p_release_p2p_if(vif);
 	}
@@ -2291,7 +2293,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiph
 	brcmf_remove_interface(vif->ifp, true);
 
 	brcmf_cfg80211_arm_vif_event(cfg, NULL);
-	if (vif->wdev.iftype != NL80211_IFTYPE_P2P_DEVICE)
+	if (iftype != NL80211_IFTYPE_P2P_DEVICE)
 		p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL;
 
 	return err;

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

* [PATCH 4.10 034/110] metag/usercopy: Drop unused macros
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (32 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 033/110] brcmfmac: use local iftype avoiding use-after-free of virtual interface Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 035/110] metag/usercopy: Fix alignment error checking Greg Kroah-Hartman
                   ` (75 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, James Hogan, Al Viro, linux-metag

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

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

From: James Hogan <james.hogan@imgtec.com>

commit ef62a2d81f73d9cddef14bc3d9097a57010d551c upstream.

Metag's lib/usercopy.c has a bunch of copy_from_user macros for larger
copies between 5 and 16 bytes which are completely unused. Before fixing
zeroing lets drop these macros so there is less to fix.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/lib/usercopy.c |  113 ----------------------------------------------
 1 file changed, 113 deletions(-)

--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -651,119 +651,6 @@ EXPORT_SYMBOL(__copy_user);
 #define __asm_copy_from_user_4(to, from, ret) \
 	__asm_copy_from_user_4x_cont(to, from, ret, "", "", "")
 
-#define __asm_copy_from_user_5(to, from, ret) \
-	__asm_copy_from_user_4x_cont(to, from, ret,	\
-		"	GETB D1Ar1,[%1++]\n"		\
-		"4:	SETB [%0++],D1Ar1\n",		\
-		"5:	ADD  %2,%2,#1\n"		\
-		"	SETB [%0++],D1Ar1\n",		\
-		"	.long 4b,5b\n")
-
-#define __asm_copy_from_user_6x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
-	__asm_copy_from_user_4x_cont(to, from, ret,	\
-		"	GETW D1Ar1,[%1++]\n"		\
-		"4:	SETW [%0++],D1Ar1\n" COPY,	\
-		"5:	ADD  %2,%2,#2\n"		\
-		"	SETW [%0++],D1Ar1\n" FIXUP,	\
-		"	.long 4b,5b\n" TENTRY)
-
-#define __asm_copy_from_user_6(to, from, ret) \
-	__asm_copy_from_user_6x_cont(to, from, ret, "", "", "")
-
-#define __asm_copy_from_user_7(to, from, ret) \
-	__asm_copy_from_user_6x_cont(to, from, ret,	\
-		"	GETB D1Ar1,[%1++]\n"		\
-		"6:	SETB [%0++],D1Ar1\n",		\
-		"7:	ADD  %2,%2,#1\n"		\
-		"	SETB [%0++],D1Ar1\n",		\
-		"	.long 6b,7b\n")
-
-#define __asm_copy_from_user_8x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
-	__asm_copy_from_user_4x_cont(to, from, ret,	\
-		"	GETD D1Ar1,[%1++]\n"		\
-		"4:	SETD [%0++],D1Ar1\n" COPY,	\
-		"5:	ADD  %2,%2,#4\n"			\
-		"	SETD [%0++],D1Ar1\n" FIXUP,		\
-		"	.long 4b,5b\n" TENTRY)
-
-#define __asm_copy_from_user_8(to, from, ret) \
-	__asm_copy_from_user_8x_cont(to, from, ret, "", "", "")
-
-#define __asm_copy_from_user_9(to, from, ret) \
-	__asm_copy_from_user_8x_cont(to, from, ret,	\
-		"	GETB D1Ar1,[%1++]\n"		\
-		"6:	SETB [%0++],D1Ar1\n",		\
-		"7:	ADD  %2,%2,#1\n"		\
-		"	SETB [%0++],D1Ar1\n",		\
-		"	.long 6b,7b\n")
-
-#define __asm_copy_from_user_10x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
-	__asm_copy_from_user_8x_cont(to, from, ret,	\
-		"	GETW D1Ar1,[%1++]\n"		\
-		"6:	SETW [%0++],D1Ar1\n" COPY,	\
-		"7:	ADD  %2,%2,#2\n"		\
-		"	SETW [%0++],D1Ar1\n" FIXUP,	\
-		"	.long 6b,7b\n" TENTRY)
-
-#define __asm_copy_from_user_10(to, from, ret) \
-	__asm_copy_from_user_10x_cont(to, from, ret, "", "", "")
-
-#define __asm_copy_from_user_11(to, from, ret)		\
-	__asm_copy_from_user_10x_cont(to, from, ret,	\
-		"	GETB D1Ar1,[%1++]\n"		\
-		"8:	SETB [%0++],D1Ar1\n",		\
-		"9:	ADD  %2,%2,#1\n"		\
-		"	SETB [%0++],D1Ar1\n",		\
-		"	.long 8b,9b\n")
-
-#define __asm_copy_from_user_12x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
-	__asm_copy_from_user_8x_cont(to, from, ret,	\
-		"	GETD D1Ar1,[%1++]\n"		\
-		"6:	SETD [%0++],D1Ar1\n" COPY,	\
-		"7:	ADD  %2,%2,#4\n"		\
-		"	SETD [%0++],D1Ar1\n" FIXUP,	\
-		"	.long 6b,7b\n" TENTRY)
-
-#define __asm_copy_from_user_12(to, from, ret) \
-	__asm_copy_from_user_12x_cont(to, from, ret, "", "", "")
-
-#define __asm_copy_from_user_13(to, from, ret) \
-	__asm_copy_from_user_12x_cont(to, from, ret,	\
-		"	GETB D1Ar1,[%1++]\n"		\
-		"8:	SETB [%0++],D1Ar1\n",		\
-		"9:	ADD  %2,%2,#1\n"		\
-		"	SETB [%0++],D1Ar1\n",		\
-		"	.long 8b,9b\n")
-
-#define __asm_copy_from_user_14x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
-	__asm_copy_from_user_12x_cont(to, from, ret,	\
-		"	GETW D1Ar1,[%1++]\n"		\
-		"8:	SETW [%0++],D1Ar1\n" COPY,	\
-		"9:	ADD  %2,%2,#2\n"		\
-		"	SETW [%0++],D1Ar1\n" FIXUP,	\
-		"	.long 8b,9b\n" TENTRY)
-
-#define __asm_copy_from_user_14(to, from, ret) \
-	__asm_copy_from_user_14x_cont(to, from, ret, "", "", "")
-
-#define __asm_copy_from_user_15(to, from, ret) \
-	__asm_copy_from_user_14x_cont(to, from, ret,	\
-		"	GETB D1Ar1,[%1++]\n"		\
-		"10:	SETB [%0++],D1Ar1\n",		\
-		"11:	ADD  %2,%2,#1\n"		\
-		"	SETB [%0++],D1Ar1\n",		\
-		"	.long 10b,11b\n")
-
-#define __asm_copy_from_user_16x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
-	__asm_copy_from_user_12x_cont(to, from, ret,	\
-		"	GETD D1Ar1,[%1++]\n"		\
-		"8:	SETD [%0++],D1Ar1\n" COPY,	\
-		"9:	ADD  %2,%2,#4\n"		\
-		"	SETD [%0++],D1Ar1\n" FIXUP,	\
-		"	.long 8b,9b\n" TENTRY)
-
-#define __asm_copy_from_user_16(to, from, ret) \
-	__asm_copy_from_user_16x_cont(to, from, ret, "", "", "")
 
 #define __asm_copy_from_user_8x64(to, from, ret) \
 	asm volatile (				\

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

* [PATCH 4.10 035/110] metag/usercopy: Fix alignment error checking
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (33 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 034/110] metag/usercopy: Drop unused macros Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 036/110] metag/usercopy: Add early abort to copy_to_user Greg Kroah-Hartman
                   ` (74 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, James Hogan, linux-metag

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

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

From: James Hogan <james.hogan@imgtec.com>

commit 2257211942bbbf6c798ab70b487d7e62f7835a1a upstream.

Fix the error checking of the alignment adjustment code in
raw_copy_from_user(), which mistakenly considers it safe to skip the
error check when aligning the source buffer on a 2 or 4 byte boundary.

If the destination buffer was unaligned it may have started to copy
using byte or word accesses, which could well be at the start of a new
(valid) source page. This would result in it appearing to have copied 1
or 2 bytes at the end of the first (invalid) page rather than none at
all.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/lib/usercopy.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -717,6 +717,8 @@ unsigned long __copy_user_zeroing(void *
 	if ((unsigned long) src & 1) {
 		__asm_copy_from_user_1(dst, src, retn);
 		n--;
+		if (retn)
+			goto copy_exception_bytes;
 	}
 	if ((unsigned long) dst & 1) {
 		/* Worst case - byte copy */
@@ -730,6 +732,8 @@ unsigned long __copy_user_zeroing(void *
 	if (((unsigned long) src & 2) && n >= 2) {
 		__asm_copy_from_user_2(dst, src, retn);
 		n -= 2;
+		if (retn)
+			goto copy_exception_bytes;
 	}
 	if ((unsigned long) dst & 2) {
 		/* Second worst case - word copy */
@@ -741,12 +745,6 @@ unsigned long __copy_user_zeroing(void *
 		}
 	}
 
-	/* We only need one check after the unalignment-adjustments,
-	   because if both adjustments were done, either both or
-	   neither reference had an exception.  */
-	if (retn != 0)
-		goto copy_exception_bytes;
-
 #ifdef USE_RAPF
 	/* 64 bit copy loop */
 	if (!(((unsigned long) src | (unsigned long) dst) & 7)) {

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

* [PATCH 4.10 036/110] metag/usercopy: Add early abort to copy_to_user
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (34 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 035/110] metag/usercopy: Fix alignment error checking Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 037/110] metag/usercopy: Zero rest of buffer from copy_from_user Greg Kroah-Hartman
                   ` (73 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Al Viro, James Hogan, linux-metag

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

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

From: James Hogan <james.hogan@imgtec.com>

commit fb8ea062a8f2e85256e13f55696c5c5f0dfdcc8b upstream.

When copying to userland on Meta, if any faults are encountered
immediately abort the copy instead of continuing on and repeatedly
faulting, and worse potentially copying further bytes successfully to
subsequent valid pages.

Fixes: 373cd784d0fc ("metag: Memory handling")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/lib/usercopy.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -538,23 +538,31 @@ unsigned long __copy_user(void __user *p
 	if ((unsigned long) src & 1) {
 		__asm_copy_to_user_1(dst, src, retn);
 		n--;
+		if (retn)
+			return retn + n;
 	}
 	if ((unsigned long) dst & 1) {
 		/* Worst case - byte copy */
 		while (n > 0) {
 			__asm_copy_to_user_1(dst, src, retn);
 			n--;
+			if (retn)
+				return retn + n;
 		}
 	}
 	if (((unsigned long) src & 2) && n >= 2) {
 		__asm_copy_to_user_2(dst, src, retn);
 		n -= 2;
+		if (retn)
+			return retn + n;
 	}
 	if ((unsigned long) dst & 2) {
 		/* Second worst case - word copy */
 		while (n >= 2) {
 			__asm_copy_to_user_2(dst, src, retn);
 			n -= 2;
+			if (retn)
+				return retn + n;
 		}
 	}
 
@@ -569,6 +577,8 @@ unsigned long __copy_user(void __user *p
 		while (n >= 8) {
 			__asm_copy_to_user_8x64(dst, src, retn);
 			n -= 8;
+			if (retn)
+				return retn + n;
 		}
 	}
 	if (n >= RAPF_MIN_BUF_SIZE) {
@@ -581,6 +591,8 @@ unsigned long __copy_user(void __user *p
 		while (n >= 8) {
 			__asm_copy_to_user_8x64(dst, src, retn);
 			n -= 8;
+			if (retn)
+				return retn + n;
 		}
 	}
 #endif
@@ -588,11 +600,15 @@ unsigned long __copy_user(void __user *p
 	while (n >= 16) {
 		__asm_copy_to_user_16(dst, src, retn);
 		n -= 16;
+		if (retn)
+			return retn + n;
 	}
 
 	while (n >= 4) {
 		__asm_copy_to_user_4(dst, src, retn);
 		n -= 4;
+		if (retn)
+			return retn + n;
 	}
 
 	switch (n) {
@@ -609,6 +625,10 @@ unsigned long __copy_user(void __user *p
 		break;
 	}
 
+	/*
+	 * If we get here, retn correctly reflects the number of failing
+	 * bytes.
+	 */
 	return retn;
 }
 EXPORT_SYMBOL(__copy_user);

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

* [PATCH 4.10 037/110] metag/usercopy: Zero rest of buffer from copy_from_user
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (35 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 036/110] metag/usercopy: Add early abort to copy_to_user Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42   ` Greg Kroah-Hartman
                   ` (72 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Al Viro, James Hogan, linux-metag

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

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

From: James Hogan <james.hogan@imgtec.com>

commit 563ddc1076109f2b3f88e6d355eab7b6fd4662cb upstream.

Currently we try to zero the destination for a failed read from userland
in fixup code in the usercopy.c macros. The rest of the destination
buffer is then zeroed from __copy_user_zeroing(), which is used for both
copy_from_user() and __copy_from_user().

Unfortunately we fail to zero in the fixup code as D1Ar1 is set to 0
before the fixup code entry labels, and __copy_from_user() shouldn't even
be zeroing the rest of the buffer.

Move the zeroing out into copy_from_user() and rename
__copy_user_zeroing() to raw_copy_from_user() since it no longer does
any zeroing. This also conveniently matches the name needed for
RAW_COPY_USER support in a later patch.

Fixes: 373cd784d0fc ("metag: Memory handling")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/include/asm/uaccess.h |   15 +++++-----
 arch/metag/lib/usercopy.c        |   57 ++++++++++++---------------------------
 2 files changed, 26 insertions(+), 46 deletions(-)

--- a/arch/metag/include/asm/uaccess.h
+++ b/arch/metag/include/asm/uaccess.h
@@ -197,20 +197,21 @@ extern long __must_check strnlen_user(co
 
 #define strlen_user(str) strnlen_user(str, 32767)
 
-extern unsigned long __must_check __copy_user_zeroing(void *to,
-						      const void __user *from,
-						      unsigned long n);
+extern unsigned long raw_copy_from_user(void *to, const void __user *from,
+					unsigned long n);
 
 static inline unsigned long
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {
+	unsigned long res = n;
 	if (likely(access_ok(VERIFY_READ, from, n)))
-		return __copy_user_zeroing(to, from, n);
-	memset(to, 0, n);
-	return n;
+		res = raw_copy_from_user(to, from, n);
+	if (unlikely(res))
+		memset(to + (n - res), 0, res);
+	return res;
 }
 
-#define __copy_from_user(to, from, n) __copy_user_zeroing(to, from, n)
+#define __copy_from_user(to, from, n) raw_copy_from_user(to, from, n)
 #define __copy_from_user_inatomic __copy_from_user
 
 extern unsigned long __must_check __copy_user(void __user *to,
--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -29,7 +29,6 @@
 		COPY						 \
 		"1:\n"						 \
 		"	.section .fixup,\"ax\"\n"		 \
-		"	MOV D1Ar1,#0\n"				 \
 		FIXUP						 \
 		"	MOVT    D1Ar1,#HI(1b)\n"		 \
 		"	JUMP    D1Ar1,#LO(1b)\n"		 \
@@ -637,16 +636,14 @@ EXPORT_SYMBOL(__copy_user);
 	__asm_copy_user_cont(to, from, ret,	\
 		"	GETB D1Ar1,[%1++]\n"	\
 		"2:	SETB [%0++],D1Ar1\n",	\
-		"3:	ADD  %2,%2,#1\n"	\
-		"	SETB [%0++],D1Ar1\n",	\
+		"3:	ADD  %2,%2,#1\n",	\
 		"	.long 2b,3b\n")
 
 #define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
 	__asm_copy_user_cont(to, from, ret,		\
 		"	GETW D1Ar1,[%1++]\n"		\
 		"2:	SETW [%0++],D1Ar1\n" COPY,	\
-		"3:	ADD  %2,%2,#2\n"		\
-		"	SETW [%0++],D1Ar1\n" FIXUP,	\
+		"3:	ADD  %2,%2,#2\n" FIXUP,		\
 		"	.long 2b,3b\n" TENTRY)
 
 #define __asm_copy_from_user_2(to, from, ret) \
@@ -656,32 +653,26 @@ EXPORT_SYMBOL(__copy_user);
 	__asm_copy_from_user_2x_cont(to, from, ret,	\
 		"	GETB D1Ar1,[%1++]\n"		\
 		"4:	SETB [%0++],D1Ar1\n",		\
-		"5:	ADD  %2,%2,#1\n"		\
-		"	SETB [%0++],D1Ar1\n",		\
+		"5:	ADD  %2,%2,#1\n",		\
 		"	.long 4b,5b\n")
 
 #define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
 	__asm_copy_user_cont(to, from, ret,		\
 		"	GETD D1Ar1,[%1++]\n"		\
 		"2:	SETD [%0++],D1Ar1\n" COPY,	\
-		"3:	ADD  %2,%2,#4\n"		\
-		"	SETD [%0++],D1Ar1\n" FIXUP,	\
+		"3:	ADD  %2,%2,#4\n" FIXUP,		\
 		"	.long 2b,3b\n" TENTRY)
 
 #define __asm_copy_from_user_4(to, from, ret) \
 	__asm_copy_from_user_4x_cont(to, from, ret, "", "", "")
 
-
 #define __asm_copy_from_user_8x64(to, from, ret) \
 	asm volatile (				\
 		"	GETL D0Ar2,D1Ar1,[%1++]\n"	\
 		"2:	SETL [%0++],D0Ar2,D1Ar1\n"	\
 		"1:\n"					\
 		"	.section .fixup,\"ax\"\n"	\
-		"	MOV D1Ar1,#0\n"			\
-		"	MOV D0Ar2,#0\n"			\
 		"3:	ADD  %2,%2,#8\n"		\
-		"	SETL [%0++],D0Ar2,D1Ar1\n"	\
 		"	MOVT    D0Ar2,#HI(1b)\n"	\
 		"	JUMP    D0Ar2,#LO(1b)\n"	\
 		"	.previous\n"			\
@@ -721,11 +712,12 @@ EXPORT_SYMBOL(__copy_user);
 		"SUB	%1, %1, #4\n")
 
 
-/* Copy from user to kernel, zeroing the bytes that were inaccessible in
-   userland.  The return-value is the number of bytes that were
-   inaccessible.  */
-unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc,
-				  unsigned long n)
+/*
+ * Copy from user to kernel. The return-value is the number of bytes that were
+ * inaccessible.
+ */
+unsigned long raw_copy_from_user(void *pdst, const void __user *psrc,
+				 unsigned long n)
 {
 	register char *dst asm ("A0.2") = pdst;
 	register const char __user *src asm ("A1.2") = psrc;
@@ -738,7 +730,7 @@ unsigned long __copy_user_zeroing(void *
 		__asm_copy_from_user_1(dst, src, retn);
 		n--;
 		if (retn)
-			goto copy_exception_bytes;
+			return retn + n;
 	}
 	if ((unsigned long) dst & 1) {
 		/* Worst case - byte copy */
@@ -746,14 +738,14 @@ unsigned long __copy_user_zeroing(void *
 			__asm_copy_from_user_1(dst, src, retn);
 			n--;
 			if (retn)
-				goto copy_exception_bytes;
+				return retn + n;
 		}
 	}
 	if (((unsigned long) src & 2) && n >= 2) {
 		__asm_copy_from_user_2(dst, src, retn);
 		n -= 2;
 		if (retn)
-			goto copy_exception_bytes;
+			return retn + n;
 	}
 	if ((unsigned long) dst & 2) {
 		/* Second worst case - word copy */
@@ -761,7 +753,7 @@ unsigned long __copy_user_zeroing(void *
 			__asm_copy_from_user_2(dst, src, retn);
 			n -= 2;
 			if (retn)
-				goto copy_exception_bytes;
+				return retn + n;
 		}
 	}
 
@@ -777,7 +769,7 @@ unsigned long __copy_user_zeroing(void *
 			__asm_copy_from_user_8x64(dst, src, retn);
 			n -= 8;
 			if (retn)
-				goto copy_exception_bytes;
+				return retn + n;
 		}
 	}
 
@@ -793,7 +785,7 @@ unsigned long __copy_user_zeroing(void *
 			__asm_copy_from_user_8x64(dst, src, retn);
 			n -= 8;
 			if (retn)
-				goto copy_exception_bytes;
+				return retn + n;
 		}
 	}
 #endif
@@ -803,7 +795,7 @@ unsigned long __copy_user_zeroing(void *
 		n -= 4;
 
 		if (retn)
-			goto copy_exception_bytes;
+			return retn + n;
 	}
 
 	/* If we get here, there were no memory read faults.  */
@@ -829,21 +821,8 @@ unsigned long __copy_user_zeroing(void *
 	/* If we get here, retn correctly reflects the number of failing
 	   bytes.  */
 	return retn;
-
- copy_exception_bytes:
-	/* We already have "retn" bytes cleared, and need to clear the
-	   remaining "n" bytes.  A non-optimized simple byte-for-byte in-line
-	   memset is preferred here, since this isn't speed-critical code and
-	   we'd rather have this a leaf-function than calling memset.  */
-	{
-		char *endp;
-		for (endp = dst + n; dst < endp; dst++)
-			*dst = 0;
-	}
-
-	return retn + n;
 }
-EXPORT_SYMBOL(__copy_user_zeroing);
+EXPORT_SYMBOL(raw_copy_from_user);
 
 #define __asm_clear_8x64(to, ret) \
 	asm volatile (					\

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

* [PATCH 4.10 038/110] metag/usercopy: Set flags before ADDZ
@ 2017-04-10 16:42   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, James Hogan, linux-metag

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

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

From: James Hogan <james.hogan@imgtec.com>

commit fd40eee1290ad7add7aa665e3ce6b0f9fe9734b4 upstream.

The fixup code for the copy_to_user rapf loops reads TXStatus.LSM_STEP
to decide how far to rewind the source pointer. There is a special case
for the last execution of an MGETL/MGETD, since it leaves LSM_STEP=0
even though the number of MGETLs/MGETDs attempted was 4. This uses ADDZ
which is conditional upon the Z condition flag, but the AND instruction
which masked the TXStatus.LSM_STEP field didn't set the condition flags
based on the result.

Fix that now by using ANDS which does set the flags, and also marking
the condition codes as clobbered by the inline assembly.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/lib/usercopy.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -315,7 +315,7 @@
 		"	.previous\n"					\
 		: "=r" (to), "=r" (from), "=r" (ret), "=d" (n)		\
 		: "0" (to), "1" (from), "2" (ret), "3" (n)		\
-		: "D1Ar1", "D0Ar2", "memory")
+		: "D1Ar1", "D0Ar2", "cc", "memory")
 
 /*	rewind 'to' and 'from'  pointers when a fault occurs
  *
@@ -341,7 +341,7 @@
 #define __asm_copy_to_user_64bit_rapf_loop(to,	from, ret, n, id)\
 	__asm_copy_user_64bit_rapf_loop(to, from, ret, n, id,		\
 		"LSR	D0Ar2, D0Ar2, #8\n"				\
-		"AND	D0Ar2, D0Ar2, #0x7\n"				\
+		"ANDS	D0Ar2, D0Ar2, #0x7\n"				\
 		"ADDZ	D0Ar2, D0Ar2, #4\n"				\
 		"SUB	D0Ar2, D0Ar2, #1\n"				\
 		"MOV	D1Ar1, #4\n"					\
@@ -486,7 +486,7 @@
 		"	.previous\n"					\
 		: "=r" (to), "=r" (from), "=r" (ret), "=d" (n)		\
 		: "0" (to), "1" (from), "2" (ret), "3" (n)		\
-		: "D1Ar1", "D0Ar2", "memory")
+		: "D1Ar1", "D0Ar2", "cc", "memory")
 
 /*	rewind 'to' and 'from'  pointers when a fault occurs
  *
@@ -512,7 +512,7 @@
 #define __asm_copy_to_user_32bit_rapf_loop(to, from, ret, n, id)\
 	__asm_copy_user_32bit_rapf_loop(to, from, ret, n, id,		\
 		"LSR	D0Ar2, D0Ar2, #8\n"				\
-		"AND	D0Ar2, D0Ar2, #0x7\n"				\
+		"ANDS	D0Ar2, D0Ar2, #0x7\n"				\
 		"ADDZ	D0Ar2, D0Ar2, #4\n"				\
 		"SUB	D0Ar2, D0Ar2, #1\n"				\
 		"MOV	D1Ar1, #4\n"					\

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

* [PATCH 4.10 038/110] metag/usercopy: Set flags before ADDZ
@ 2017-04-10 16:42   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Greg Kroah-Hartman, stable-u79uwXL29TY76Z2rM5mHXA, James Hogan,
	linux-metag-u79uwXL29TY76Z2rM5mHXA

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

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

From: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>

commit fd40eee1290ad7add7aa665e3ce6b0f9fe9734b4 upstream.

The fixup code for the copy_to_user rapf loops reads TXStatus.LSM_STEP
to decide how far to rewind the source pointer. There is a special case
for the last execution of an MGETL/MGETD, since it leaves LSM_STEP=0
even though the number of MGETLs/MGETDs attempted was 4. This uses ADDZ
which is conditional upon the Z condition flag, but the AND instruction
which masked the TXStatus.LSM_STEP field didn't set the condition flags
based on the result.

Fix that now by using ANDS which does set the flags, and also marking
the condition codes as clobbered by the inline assembly.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>

---
 arch/metag/lib/usercopy.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -315,7 +315,7 @@
 		"	.previous\n"					\
 		: "=r" (to), "=r" (from), "=r" (ret), "=d" (n)		\
 		: "0" (to), "1" (from), "2" (ret), "3" (n)		\
-		: "D1Ar1", "D0Ar2", "memory")
+		: "D1Ar1", "D0Ar2", "cc", "memory")
 
 /*	rewind 'to' and 'from'  pointers when a fault occurs
  *
@@ -341,7 +341,7 @@
 #define __asm_copy_to_user_64bit_rapf_loop(to,	from, ret, n, id)\
 	__asm_copy_user_64bit_rapf_loop(to, from, ret, n, id,		\
 		"LSR	D0Ar2, D0Ar2, #8\n"				\
-		"AND	D0Ar2, D0Ar2, #0x7\n"				\
+		"ANDS	D0Ar2, D0Ar2, #0x7\n"				\
 		"ADDZ	D0Ar2, D0Ar2, #4\n"				\
 		"SUB	D0Ar2, D0Ar2, #1\n"				\
 		"MOV	D1Ar1, #4\n"					\
@@ -486,7 +486,7 @@
 		"	.previous\n"					\
 		: "=r" (to), "=r" (from), "=r" (ret), "=d" (n)		\
 		: "0" (to), "1" (from), "2" (ret), "3" (n)		\
-		: "D1Ar1", "D0Ar2", "memory")
+		: "D1Ar1", "D0Ar2", "cc", "memory")
 
 /*	rewind 'to' and 'from'  pointers when a fault occurs
  *
@@ -512,7 +512,7 @@
 #define __asm_copy_to_user_32bit_rapf_loop(to, from, ret, n, id)\
 	__asm_copy_user_32bit_rapf_loop(to, from, ret, n, id,		\
 		"LSR	D0Ar2, D0Ar2, #8\n"				\
-		"AND	D0Ar2, D0Ar2, #0x7\n"				\
+		"ANDS	D0Ar2, D0Ar2, #0x7\n"				\
 		"ADDZ	D0Ar2, D0Ar2, #4\n"				\
 		"SUB	D0Ar2, D0Ar2, #1\n"				\
 		"MOV	D1Ar1, #4\n"					\


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

* [PATCH 4.10 039/110] metag/usercopy: Fix src fixup in from user rapf loops
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (37 preceding siblings ...)
  2017-04-10 16:42   ` Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 040/110] metag/usercopy: Add missing fixups Greg Kroah-Hartman
                   ` (70 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, James Hogan, linux-metag

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

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

From: James Hogan <james.hogan@imgtec.com>

commit 2c0b1df88b987a12d95ea1d6beaf01894f3cc725 upstream.

The fixup code to rewind the source pointer in
__asm_copy_from_user_{32,64}bit_rapf_loop() always rewound the source by
a single unit (4 or 8 bytes), however this is insufficient if the fault
didn't occur on the first load in the loop, as the source pointer will
have been incremented but nothing will have been stored until all 4
register [pairs] are loaded.

Read the LSM_STEP field of TXSTATUS (which is already loaded into a
register), a bit like the copy_to_user versions, to determine how many
iterations of MGET[DL] have taken place, all of which need rewinding.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/lib/usercopy.c |   36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -687,29 +687,49 @@ EXPORT_SYMBOL(__copy_user);
  *
  *	Rationale:
  *		A fault occurs while reading from user buffer, which is the
- *		source. Since the fault is at a single address, we only
- *		need to rewind by 8 bytes.
+ *		source.
  *		Since we don't write to kernel buffer until we read first,
  *		the kernel buffer is at the right state and needn't be
- *		corrected.
+ *		corrected, but the source must be rewound to the beginning of
+ *		the block, which is LSM_STEP*8 bytes.
+ *		LSM_STEP is bits 10:8 in TXSTATUS which is already read
+ *		and stored in D0Ar2
+ *
+ *		NOTE: If a fault occurs at the last operation in M{G,S}ETL
+ *			LSM_STEP will be 0. ie: we do 4 writes in our case, if
+ *			a fault happens at the 4th write, LSM_STEP will be 0
+ *			instead of 4. The code copes with that.
  */
 #define __asm_copy_from_user_64bit_rapf_loop(to, from, ret, n, id)	\
 	__asm_copy_user_64bit_rapf_loop(to, from, ret, n, id,		\
-		"SUB	%1, %1, #8\n")
+		"LSR	D0Ar2, D0Ar2, #5\n"				\
+		"ANDS	D0Ar2, D0Ar2, #0x38\n"				\
+		"ADDZ	D0Ar2, D0Ar2, #32\n"				\
+		"SUB	%1, %1, D0Ar2\n")
 
 /*	rewind 'from' pointer when a fault occurs
  *
  *	Rationale:
  *		A fault occurs while reading from user buffer, which is the
- *		source. Since the fault is at a single address, we only
- *		need to rewind by 4 bytes.
+ *		source.
  *		Since we don't write to kernel buffer until we read first,
  *		the kernel buffer is at the right state and needn't be
- *		corrected.
+ *		corrected, but the source must be rewound to the beginning of
+ *		the block, which is LSM_STEP*4 bytes.
+ *		LSM_STEP is bits 10:8 in TXSTATUS which is already read
+ *		and stored in D0Ar2
+ *
+ *		NOTE: If a fault occurs at the last operation in M{G,S}ETL
+ *			LSM_STEP will be 0. ie: we do 4 writes in our case, if
+ *			a fault happens at the 4th write, LSM_STEP will be 0
+ *			instead of 4. The code copes with that.
  */
 #define __asm_copy_from_user_32bit_rapf_loop(to, from, ret, n, id)	\
 	__asm_copy_user_32bit_rapf_loop(to, from, ret, n, id,		\
-		"SUB	%1, %1, #4\n")
+		"LSR	D0Ar2, D0Ar2, #6\n"				\
+		"ANDS	D0Ar2, D0Ar2, #0x1c\n"				\
+		"ADDZ	D0Ar2, D0Ar2, #16\n"				\
+		"SUB	%1, %1, D0Ar2\n")
 
 
 /*

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

* [PATCH 4.10 040/110] metag/usercopy: Add missing fixups
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (38 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 039/110] metag/usercopy: Fix src fixup in from user rapf loops Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 041/110] drm/msm: adreno: fix build error without debugfs Greg Kroah-Hartman
                   ` (69 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, James Hogan, linux-metag

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

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

From: James Hogan <james.hogan@imgtec.com>

commit b884a190afcecdbef34ca508ea5ee88bb7c77861 upstream.

The rapf copy loops in the Meta usercopy code is missing some extable
entries for HTP cores with unaligned access checking enabled, where
faults occur on the instruction immediately after the faulting access.

Add the fixup labels and extable entries for these cases so that corner
case user copy failures don't cause kernel crashes.

Fixes: 373cd784d0fc ("metag: Memory handling")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/metag/lib/usercopy.c |   72 ++++++++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 24 deletions(-)

--- a/arch/metag/lib/usercopy.c
+++ b/arch/metag/lib/usercopy.c
@@ -259,27 +259,31 @@
 		"MGETL	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
 		"22:\n"							\
 		"MSETL	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
-		"SUB	%3, %3, #32\n"					\
 		"23:\n"							\
-		"MGETL	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
+		"SUB	%3, %3, #32\n"					\
 		"24:\n"							\
+		"MGETL	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
+		"25:\n"							\
 		"MSETL	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"26:\n"							\
 		"SUB	%3, %3, #32\n"					\
 		"DCACHE	[%1+#-64], D0Ar6\n"				\
 		"BR	$Lloop"id"\n"					\
 									\
 		"MOV	RAPF, %1\n"					\
-		"25:\n"							\
+		"27:\n"							\
 		"MGETL	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"26:\n"							\
+		"28:\n"							\
 		"MSETL	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"29:\n"							\
 		"SUB	%3, %3, #32\n"					\
-		"27:\n"							\
+		"30:\n"							\
 		"MGETL	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"28:\n"							\
+		"31:\n"							\
 		"MSETL	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"32:\n"							\
 		"SUB	%0, %0, #8\n"					\
-		"29:\n"							\
+		"33:\n"							\
 		"SETL	[%0++], D0.7, D1.7\n"				\
 		"SUB	%3, %3, #32\n"					\
 		"1:"							\
@@ -311,7 +315,11 @@
 		"	.long 26b,3b\n"					\
 		"	.long 27b,3b\n"					\
 		"	.long 28b,3b\n"					\
-		"	.long 29b,4b\n"					\
+		"	.long 29b,3b\n"					\
+		"	.long 30b,3b\n"					\
+		"	.long 31b,3b\n"					\
+		"	.long 32b,3b\n"					\
+		"	.long 33b,4b\n"					\
 		"	.previous\n"					\
 		: "=r" (to), "=r" (from), "=r" (ret), "=d" (n)		\
 		: "0" (to), "1" (from), "2" (ret), "3" (n)		\
@@ -402,47 +410,55 @@
 		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
 		"22:\n"							\
 		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
-		"SUB	%3, %3, #16\n"					\
 		"23:\n"							\
-		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"24:\n"							\
-		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
 		"SUB	%3, %3, #16\n"					\
-		"25:\n"							\
+		"24:\n"							\
 		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"26:\n"							\
+		"25:\n"							\
 		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"26:\n"							\
 		"SUB	%3, %3, #16\n"					\
 		"27:\n"							\
 		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
 		"28:\n"							\
 		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"29:\n"							\
+		"SUB	%3, %3, #16\n"					\
+		"30:\n"							\
+		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
+		"31:\n"							\
+		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"32:\n"							\
 		"SUB	%3, %3, #16\n"					\
 		"DCACHE	[%1+#-64], D0Ar6\n"				\
 		"BR	$Lloop"id"\n"					\
 									\
 		"MOV	RAPF, %1\n"					\
-		"29:\n"							\
+		"33:\n"							\
 		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"30:\n"							\
+		"34:\n"							\
 		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"35:\n"							\
 		"SUB	%3, %3, #16\n"					\
-		"31:\n"							\
+		"36:\n"							\
 		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"32:\n"							\
+		"37:\n"							\
 		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"38:\n"							\
 		"SUB	%3, %3, #16\n"					\
-		"33:\n"							\
+		"39:\n"							\
 		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"34:\n"							\
+		"40:\n"							\
 		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"41:\n"							\
 		"SUB	%3, %3, #16\n"					\
-		"35:\n"							\
+		"42:\n"							\
 		"MGETD	D0FrT, D0.5, D0.6, D0.7, [%1++]\n"		\
-		"36:\n"							\
+		"43:\n"							\
 		"MSETD	[%0++], D0FrT, D0.5, D0.6, D0.7\n"		\
+		"44:\n"							\
 		"SUB	%0, %0, #4\n"					\
-		"37:\n"							\
+		"45:\n"							\
 		"SETD	[%0++], D0.7\n"					\
 		"SUB	%3, %3, #16\n"					\
 		"1:"							\
@@ -482,7 +498,15 @@
 		"	.long 34b,3b\n"					\
 		"	.long 35b,3b\n"					\
 		"	.long 36b,3b\n"					\
-		"	.long 37b,4b\n"					\
+		"	.long 37b,3b\n"					\
+		"	.long 38b,3b\n"					\
+		"	.long 39b,3b\n"					\
+		"	.long 40b,3b\n"					\
+		"	.long 41b,3b\n"					\
+		"	.long 42b,3b\n"					\
+		"	.long 43b,3b\n"					\
+		"	.long 44b,3b\n"					\
+		"	.long 45b,4b\n"					\
 		"	.previous\n"					\
 		: "=r" (to), "=r" (from), "=r" (ret), "=d" (n)		\
 		: "0" (to), "1" (from), "2" (ret), "3" (n)		\

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

* [PATCH 4.10 041/110] drm/msm: adreno: fix build error without debugfs
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (39 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 040/110] metag/usercopy: Add missing fixups Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 042/110] powerpc: Disable HFSCR[TM] if TM is not supported Greg Kroah-Hartman
                   ` (68 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Arnd Bergmann, Rob Clark

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit 280489daa68bd20364b322c11e3f429a0212c611 upstream.

The newly added a5xx support fails to build when debugfs is diabled:

drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:4: error: 'struct msm_gpu_funcs' has no member named 'show'
drivers/gpu/drm/msm/adreno/a5xx_gpu.c:849:11: error: 'a5xx_show' undeclared here (not in a function); did you mean 'a5xx_irq'?

This adds a missing #ifdef.

Fixes: b5f103ab98c7 ("drm/msm: gpu: Add A5XX target support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -846,7 +846,9 @@ static const struct adreno_gpu_funcs fun
 		.idle = a5xx_idle,
 		.irq = a5xx_irq,
 		.destroy = a5xx_destroy,
+#ifdef CONFIG_DEBUG_FS
 		.show = a5xx_show,
+#endif
 	},
 	.get_timestamp = a5xx_get_timestamp,
 };

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

* [PATCH 4.10 042/110] powerpc: Disable HFSCR[TM] if TM is not supported
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (40 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 041/110] drm/msm: adreno: fix build error without debugfs Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 043/110] powerpc/mm: Add missing global TLB invalidate if cxl is active Greg Kroah-Hartman
                   ` (67 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Benjamin Herrenschmidt, Sam Bobroff,
	Michael Ellerman

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

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

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

commit 7ed23e1bae8bf7e37fd555066550a00b95a3a98b upstream.

On Power8 & Power9 the early CPU inititialisation in __init_HFSCR()
turns on HFSCR[TM] (Hypervisor Facility Status and Control Register
[Transactional Memory]), but that doesn't take into account that TM
might be disabled by CPU features, or disabled by the kernel being built
with CONFIG_PPC_TRANSACTIONAL_MEM=n.

So later in boot, when we have setup the CPU features, clear HSCR[TM] if
the TM CPU feature has been disabled. We use CPU_FTR_TM_COMP to account
for the CONFIG_PPC_TRANSACTIONAL_MEM=n case.

Without this a KVM guest might try use TM, even if told not to, and
cause an oops in the host kernel. Typically the oops is seen in
__kvmppc_vcore_entry() and may or may not be fatal to the host, but is
always bad news.

In practice all shipping CPU revisions do support TM, and all host
kernels we are aware of build with TM support enabled, so no one should
actually be able to hit this in the wild.

Fixes: 2a3563b023e5 ("powerpc: Setup in HFSCR for POWER8")
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
[mpe: Rewrite change log with input from Sam, add Fixes/stable]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/setup_64.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -245,6 +245,15 @@ static void cpu_ready_for_interrupts(voi
 		mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
 	}
 
+	/*
+	 * Fixup HFSCR:TM based on CPU features. The bit is set by our
+	 * early asm init because at that point we haven't updated our
+	 * CPU features from firmware and device-tree. Here we have,
+	 * so let's do it.
+	 */
+	if (cpu_has_feature(CPU_FTR_HVMODE) && !cpu_has_feature(CPU_FTR_TM_COMP))
+		mtspr(SPRN_HFSCR, mfspr(SPRN_HFSCR) & ~HFSCR_TM);
+
 	/* Set IR and DR in PACA MSR */
 	get_paca()->kernel_msr = MSR_KERNEL;
 }

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

* [PATCH 4.10 043/110] powerpc/mm: Add missing global TLB invalidate if cxl is active
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (41 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 042/110] powerpc: Disable HFSCR[TM] if TM is not supported Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 044/110] powerpc/64: Fix flush_(d|i)cache_range() called from modules Greg Kroah-Hartman
                   ` (66 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Frederic Barrat, Aneesh Kumar K.V,
	Michael Ellerman

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

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

From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>

commit 88b1bf7268f56887ca88eb09c6fb0f4fc970121a upstream.

Commit 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl") converted local
TLB invalidates to global if the cxl driver is active. This is necessary
because the CAPP snoops invalidations to forward them to the PSL on the
cxl adapter. However one path was forgotten. native_flush_hash_range()
still does local TLB invalidates, as found out the hard way recently.

This patch fixes it by following the same logic as previously: if the
cxl driver is active, the local TLB invalidates are 'upgraded' to
global.

Fixes: 4c6d9acce1f4 ("powerpc/mm: Add hooks for cxl")
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/mm/hash_native_64.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -638,6 +638,10 @@ static void native_flush_hash_range(unsi
 	unsigned long psize = batch->psize;
 	int ssize = batch->ssize;
 	int i;
+	unsigned int use_local;
+
+	use_local = local && mmu_has_feature(MMU_FTR_TLBIEL) &&
+		mmu_psize_defs[psize].tlbiel && !cxl_ctx_in_use();
 
 	local_irq_save(flags);
 
@@ -667,8 +671,7 @@ static void native_flush_hash_range(unsi
 		} pte_iterate_hashed_end();
 	}
 
-	if (mmu_has_feature(MMU_FTR_TLBIEL) &&
-	    mmu_psize_defs[psize].tlbiel && local) {
+	if (use_local) {
 		asm volatile("ptesync":::"memory");
 		for (i = 0; i < number; i++) {
 			vpn = batch->vpn[i];

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

* [PATCH 4.10 044/110] powerpc/64: Fix flush_(d|i)cache_range() called from modules
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (42 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 043/110] powerpc/mm: Add missing global TLB invalidate if cxl is active Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 045/110] powerpc: Dont try to fix up misaligned load-with-reservation instructions Greg Kroah-Hartman
                   ` (65 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Oliver OHalloran, Michael Ellerman

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

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

From: Oliver O'Halloran <oohall@gmail.com>

commit 8f5f525d5b83f7d76a6baf9c4e94d4bf312ea7f6 upstream.

When the kernel is compiled to use 64bit ABIv2 the _GLOBAL() macro does
not include a global entry point. A function's global entry point is
used when the function is called from a different TOC context and in the
kernel this typically means a call from a module into the vmlinux (or
vice-versa).

There are a few exported asm functions declared with _GLOBAL() and
calling them from a module will likely crash the kernel since any TOC
relative load will yield garbage.

flush_icache_range() and flush_dcache_range() are both exported to
modules, and use the TOC, so must use _GLOBAL_TOC().

Fixes: 721aeaa9fdf3 ("powerpc: Build little endian ppc64 kernel with ABIv2")
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/misc_64.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -67,7 +67,7 @@ PPC64_CACHES:
  *   flush all bytes from start through stop-1 inclusive
  */
 
-_GLOBAL(flush_icache_range)
+_GLOBAL_TOC(flush_icache_range)
 BEGIN_FTR_SECTION
 	PURGE_PREFETCHED_INS
 	blr
@@ -120,7 +120,7 @@ EXPORT_SYMBOL(flush_icache_range)
  *
  *    flush all bytes from start to stop-1 inclusive
  */
-_GLOBAL(flush_dcache_range)
+_GLOBAL_TOC(flush_dcache_range)
 
 /*
  * Flush the data cache to memory 

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

* [PATCH 4.10 045/110] powerpc: Dont try to fix up misaligned load-with-reservation instructions
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (43 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 044/110] powerpc/64: Fix flush_(d|i)cache_range() called from modules Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 046/110] powerpc/crypto/crc32c-vpmsum: Fix missing preempt_disable() Greg Kroah-Hartman
                   ` (64 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Paul Mackerras, Michael Ellerman

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

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

From: Paul Mackerras <paulus@ozlabs.org>

commit 48fe9e9488743eec9b7c1addd3c93f12f2123d54 upstream.

In the past, there was only one load-with-reservation instruction,
lwarx, and if a program attempted a lwarx on a misaligned address, it
would take an alignment interrupt and the kernel handler would emulate
it as though it was lwzx, which was not really correct, but benign since
it is loading the right amount of data, and the lwarx should be paired
with a stwcx. to the same address, which would also cause an alignment
interrupt which would result in a SIGBUS being delivered to the process.

We now have 5 different sizes of load-with-reservation instruction. Of
those, lharx and ldarx cause an immediate SIGBUS by luck since their
entries in aligninfo[] overlap instructions which were not fixed up, but
lqarx overlaps with lhz and will be emulated as such. lbarx can never
generate an alignment interrupt since it only operates on 1 byte.

To straighten this out and fix the lqarx case, this adds code to detect
the l[hwdq]arx instructions and return without fixing them up, resulting
in a SIGBUS being delivered to the process.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/align.c |   27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -807,14 +807,25 @@ int fix_alignment(struct pt_regs *regs)
 	nb = aligninfo[instr].len;
 	flags = aligninfo[instr].flags;
 
-	/* ldbrx/stdbrx overlap lfs/stfs in the DSISR unfortunately */
-	if (IS_XFORM(instruction) && ((instruction >> 1) & 0x3ff) == 532) {
-		nb = 8;
-		flags = LD+SW;
-	} else if (IS_XFORM(instruction) &&
-		   ((instruction >> 1) & 0x3ff) == 660) {
-		nb = 8;
-		flags = ST+SW;
+	/*
+	 * Handle some cases which give overlaps in the DSISR values.
+	 */
+	if (IS_XFORM(instruction)) {
+		switch (get_xop(instruction)) {
+		case 532:	/* ldbrx */
+			nb = 8;
+			flags = LD+SW;
+			break;
+		case 660:	/* stdbrx */
+			nb = 8;
+			flags = ST+SW;
+			break;
+		case 20:	/* lwarx */
+		case 84:	/* ldarx */
+		case 116:	/* lharx */
+		case 276:	/* lqarx */
+			return 0;	/* not emulated ever */
+		}
 	}
 
 	/* Byteswap little endian loads and stores */

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

* [PATCH 4.10 046/110] powerpc/crypto/crc32c-vpmsum: Fix missing preempt_disable()
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (44 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 045/110] powerpc: Dont try to fix up misaligned load-with-reservation instructions Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 048/110] x86/mce: Dont print MCEs when mcelog is active Greg Kroah-Hartman
                   ` (63 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Michael Ellerman

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

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

From: Michael Ellerman <mpe@ellerman.id.au>

commit 4749228f022893faf54a3dbc70796f78b7d4f342 upstream.

In crc32c_vpmsum() we call enable_kernel_altivec() without first
disabling preemption, which is not allowed:

  WARNING: CPU: 9 PID: 2949 at ../arch/powerpc/kernel/process.c:277 enable_kernel_altivec+0x100/0x120
  Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_bufio libcrc32c vmx_crypto ...
  CPU: 9 PID: 2949 Comm: docker Not tainted 4.11.0-rc5-compiler_gcc-6.3.1-00033-g308ac7563944 #381
  ...
  NIP [c00000000001e320] enable_kernel_altivec+0x100/0x120
  LR [d000000003df0910] crc32c_vpmsum+0x108/0x150 [crc32c_vpmsum]
  Call Trace:
    0xc138fd09 (unreliable)
    crc32c_vpmsum+0x108/0x150 [crc32c_vpmsum]
    crc32c_vpmsum_update+0x3c/0x60 [crc32c_vpmsum]
    crypto_shash_update+0x88/0x1c0
    crc32c+0x64/0x90 [libcrc32c]
    dm_bm_checksum+0x48/0x80 [dm_persistent_data]
    sb_check+0x84/0x120 [dm_thin_pool]
    dm_bm_validate_buffer.isra.0+0xc0/0x1b0 [dm_persistent_data]
    dm_bm_read_lock+0x80/0xf0 [dm_persistent_data]
    __create_persistent_data_objects+0x16c/0x810 [dm_thin_pool]
    dm_pool_metadata_open+0xb0/0x1a0 [dm_thin_pool]
    pool_ctr+0x4cc/0xb60 [dm_thin_pool]
    dm_table_add_target+0x16c/0x3c0
    table_load+0x184/0x400
    ctl_ioctl+0x2f0/0x560
    dm_ctl_ioctl+0x38/0x50
    do_vfs_ioctl+0xd8/0x920
    SyS_ioctl+0x68/0xc0
    system_call+0x38/0xfc

It used to be sufficient just to call pagefault_disable(), because that
also disabled preemption. But the two were decoupled in commit 8222dbe21e79
("sched/preempt, mm/fault: Decouple preemption from the page fault
logic") in mid 2015.

So add the missing preempt_disable/enable(). We should also call
disable_kernel_fp(), although it does nothing by default, there is a
debug switch to make it active and all enables should be paired with
disables.

Fixes: 6dd7a82cc54e ("crypto: powerpc - Add POWER8 optimised crc32c")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/crypto/crc32c-vpmsum_glue.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/powerpc/crypto/crc32c-vpmsum_glue.c
+++ b/arch/powerpc/crypto/crc32c-vpmsum_glue.c
@@ -33,10 +33,13 @@ static u32 crc32c_vpmsum(u32 crc, unsign
 	}
 
 	if (len & ~VMX_ALIGN_MASK) {
+		preempt_disable();
 		pagefault_disable();
 		enable_kernel_altivec();
 		crc = __crc32c_vpmsum(crc, p, len & ~VMX_ALIGN_MASK);
+		disable_kernel_altivec();
 		pagefault_enable();
+		preempt_enable();
 	}
 
 	tail = len & VMX_ALIGN_MASK;

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

* [PATCH 4.10 048/110] x86/mce: Dont print MCEs when mcelog is active
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (45 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 046/110] powerpc/crypto/crc32c-vpmsum: Fix missing preempt_disable() Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 049/110] nios2: reserve boot memory for device tree Greg Kroah-Hartman
                   ` (62 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andi Kleen, Borislav Petkov,
	Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Tony Luck,
	linux-edac, Ingo Molnar

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

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

From: Andi Kleen <ak@linux.intel.com>

commit cc66afea58f858ff6da7f79b8a595a67bbb4f9a9 upstream.

Since:

  cd9c57cad3fe ("x86/MCE: Dump MCE to dmesg if no consumers")

all MCEs are printed even when mcelog is running. Fix the regression to
not print to dmesg when mcelog is running as it is a consumer too.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
[ Massage commit message. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Fixes: cd9c57cad3fe ("x86/MCE: Dump MCE to dmesg if no consumers")
Link: http://lkml.kernel.org/r/20170327093304.10683-2-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kernel/cpu/mcheck/mce.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -54,6 +54,8 @@
 
 static DEFINE_MUTEX(mce_chrdev_read_mutex);
 
+static int mce_chrdev_open_count;	/* #times opened */
+
 #define mce_log_get_idx_check(p) \
 ({ \
 	RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \
@@ -601,6 +603,10 @@ static int mce_default_notifier(struct n
 	if (atomic_read(&num_notifiers) > 2)
 		return NOTIFY_DONE;
 
+	/* Don't print when mcelog is running */
+	if (mce_chrdev_open_count > 0)
+		return NOTIFY_DONE;
+
 	__print_mce(m);
 
 	return NOTIFY_DONE;
@@ -1871,7 +1877,6 @@ void mcheck_cpu_clear(struct cpuinfo_x86
  */
 
 static DEFINE_SPINLOCK(mce_chrdev_state_lock);
-static int mce_chrdev_open_count;	/* #times opened */
 static int mce_chrdev_open_exclu;	/* already open exclusive? */
 
 static int mce_chrdev_open(struct inode *inode, struct file *file)

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

* [PATCH 4.10 049/110] nios2: reserve boot memory for device tree
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (46 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 048/110] x86/mce: Dont print MCEs when mcelog is active Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 050/110] xtensa: make __pa work with uncached KSEG addresses Greg Kroah-Hartman
                   ` (61 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Guenter Roeck, Tobias Klauser, Ley Foon Tan

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

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

From: Tobias Klauser <tklauser@distanz.ch>

commit 921d701e6f31e1ffaca3560416af1aa04edb4c4f upstream.

Make sure to reserve the boot memory for the flattened device tree.
Otherwise it might get overwritten, e.g. when initial_boot_params is
copied, leading to a corrupted FDT and a boot hang/crash:

  bootconsole [early0] enabled
  Early console on uart16650 initialized at 0xf8001600
  OF: fdt: Error -11 processing FDT
  Kernel panic - not syncing: setup_cpuinfo: No CPU found in devicetree!

  ---[ end Kernel panic - not syncing: setup_cpuinfo: No CPU found in devicetree!

Guenter Roeck says:

> I think I found the problem. In unflatten_and_copy_device_tree(), with added
> debug information:
>
> OF: fdt: initial_boot_params=c861e400, dt=c861f000 size=28874 (0x70ca)
>
> ... and then initial_boot_params is copied to dt, which results in corrupted
> fdt since the memory overlaps. Looks like the initial_boot_params memory
> is not reserved and (re-)allocated by early_init_dt_alloc_memory_arch().

Reported-by: Guenter Roeck <linux@roeck-us.net>
Reference: http://lkml.kernel.org/r/20170226210338.GA19476@roeck-us.net
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/nios2/kernel/prom.c  |    7 +++++++
 arch/nios2/kernel/setup.c |    3 +++
 2 files changed, 10 insertions(+)

--- a/arch/nios2/kernel/prom.c
+++ b/arch/nios2/kernel/prom.c
@@ -48,6 +48,13 @@ void * __init early_init_dt_alloc_memory
 	return alloc_bootmem_align(size, align);
 }
 
+int __init early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size,
+					     bool nomap)
+{
+	reserve_bootmem(base, size, BOOTMEM_DEFAULT);
+	return 0;
+}
+
 void __init early_init_devtree(void *params)
 {
 	__be32 *dtb = (u32 *)__dtb_start;
--- a/arch/nios2/kernel/setup.c
+++ b/arch/nios2/kernel/setup.c
@@ -200,6 +200,9 @@ void __init setup_arch(char **cmdline_p)
 	}
 #endif /* CONFIG_BLK_DEV_INITRD */
 
+	early_init_fdt_reserve_self();
+	early_init_fdt_scan_reserved_mem();
+
 	unflatten_and_copy_device_tree();
 
 	setup_cpuinfo();

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

* [PATCH 4.10 050/110] xtensa: make __pa work with uncached KSEG addresses
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (47 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 049/110] nios2: reserve boot memory for device tree Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 051/110] s390/decompressor: fix initrd corruption caused by bss clear Greg Kroah-Hartman
                   ` (60 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Boris Brezillon, Max Filippov

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

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

From: Max Filippov <jcmvbkbc@gmail.com>

commit 2b83878dd74a7c73bedcb6600663c1c46836e8af upstream.

When __pa is applied to virtual address in uncached KSEG region the
result is incorrect. Fix it by checking if the original address is in
the uncached KSEG and adjusting the result. It looks better than masking
off bits because pfn_valid would correctly work with new __pa results
and it may be made working in noMMU case, once we get definition for
uncached memory view.

This is required for the dma_common_mmap and DMA debug code to work
correctly: they both indirectly use __pa with coherent DMA addresses.
In case of DMA debug the visible effect is false reports that an address
mapped for DMA is accessed by CPU.

Tested-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/xtensa/include/asm/page.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- a/arch/xtensa/include/asm/page.h
+++ b/arch/xtensa/include/asm/page.h
@@ -164,8 +164,21 @@ void copy_user_highpage(struct page *to,
 
 #define ARCH_PFN_OFFSET		(PHYS_OFFSET >> PAGE_SHIFT)
 
+#ifdef CONFIG_MMU
+static inline unsigned long ___pa(unsigned long va)
+{
+	unsigned long off = va - PAGE_OFFSET;
+
+	if (off >= XCHAL_KSEG_SIZE)
+		off -= XCHAL_KSEG_SIZE;
+
+	return off + PHYS_OFFSET;
+}
+#define __pa(x)	___pa((unsigned long)(x))
+#else
 #define __pa(x)	\
 	((unsigned long) (x) - PAGE_OFFSET + PHYS_OFFSET)
+#endif
 #define __va(x)	\
 	((void *)((unsigned long) (x) - PHYS_OFFSET + PAGE_OFFSET))
 #define pfn_valid(pfn) \

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

* [PATCH 4.10 051/110] s390/decompressor: fix initrd corruption caused by bss clear
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (48 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 050/110] xtensa: make __pa work with uncached KSEG addresses Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 052/110] s390/uaccess: get_user() should zero on failure (again) Greg Kroah-Hartman
                   ` (59 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Joy Latten, Vineetha HariPai,
	Marcelo Henrique Cerri, Heiko Carstens, Martin Schwidefsky

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

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

From: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>

commit d82c0d12c92705ef468683c9b7a8298dd61ed191 upstream.

Reorder the operations in decompress_kernel() to ensure initrd is moved
to a safe location before the bss section is zeroed.

During decompression bss can overlap with the initrd and this can
corrupt the initrd contents depending on the size of the compressed
kernel (which affects where the initrd is placed by the bootloader) and
the size of the bss section of the decompressor.

Also use the correct initrd size when checking for overlaps with
parmblock.

Fixes: 06c0dd72aea3 ([S390] fix boot failures with compressed kernels)
Reviewed-by: Joy Latten <joy.latten@canonical.com>
Reviewed-by: Vineetha HariPai <vineetha.hari.pai@canonical.com>
Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
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/boot/compressed/misc.c |   35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

--- a/arch/s390/boot/compressed/misc.c
+++ b/arch/s390/boot/compressed/misc.c
@@ -141,31 +141,34 @@ static void check_ipl_parmblock(void *st
 
 unsigned long decompress_kernel(void)
 {
-	unsigned long output_addr;
-	unsigned char *output;
+	void *output, *kernel_end;
 
-	output_addr = ((unsigned long) &_end + HEAP_SIZE + 4095UL) & -4096UL;
-	check_ipl_parmblock((void *) 0, output_addr + SZ__bss_start);
-	memset(&_bss, 0, &_ebss - &_bss);
-	free_mem_ptr = (unsigned long)&_end;
-	free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
-	output = (unsigned char *) output_addr;
+	output = (void *) ALIGN((unsigned long) &_end + HEAP_SIZE, PAGE_SIZE);
+	kernel_end = output + SZ__bss_start;
+	check_ipl_parmblock((void *) 0, (unsigned long) kernel_end);
 
 #ifdef CONFIG_BLK_DEV_INITRD
 	/*
 	 * Move the initrd right behind the end of the decompressed
-	 * kernel image.
+	 * kernel image. This also prevents initrd corruption caused by
+	 * bss clearing since kernel_end will always be located behind the
+	 * current bss section..
 	 */
-	if (INITRD_START && INITRD_SIZE &&
-	    INITRD_START < (unsigned long) output + SZ__bss_start) {
-		check_ipl_parmblock(output + SZ__bss_start,
-				    INITRD_START + INITRD_SIZE);
-		memmove(output + SZ__bss_start,
-			(void *) INITRD_START, INITRD_SIZE);
-		INITRD_START = (unsigned long) output + SZ__bss_start;
+	if (INITRD_START && INITRD_SIZE && kernel_end > (void *) INITRD_START) {
+		check_ipl_parmblock(kernel_end, INITRD_SIZE);
+		memmove(kernel_end, (void *) INITRD_START, INITRD_SIZE);
+		INITRD_START = (unsigned long) kernel_end;
 	}
 #endif
 
+	/*
+	 * Clear bss section. free_mem_ptr and free_mem_end_ptr need to be
+	 * initialized afterwards since they reside in bss.
+	 */
+	memset(&_bss, 0, &_ebss - &_bss);
+	free_mem_ptr = (unsigned long) &_end;
+	free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
+
 	puts("Uncompressing Linux... ");
 	__decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error);
 	puts("Ok, booting the kernel.\n");

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

* [PATCH 4.10 052/110] s390/uaccess: get_user() should zero on failure (again)
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (49 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 051/110] s390/decompressor: fix initrd corruption caused by bss clear Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 053/110] MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels Greg Kroah-Hartman
                   ` (58 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Al Viro, Heiko Carstens, Martin Schwidefsky

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

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

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

commit d09c5373e8e4eaaa09233552cbf75dc4c4f21203 upstream.

Commit fd2d2b191fe7 ("s390: get_user() should zero on failure")
intended to fix s390's get_user() implementation which did not zero
the target operand if the read from user space faulted. Unfortunately
the patch has no effect: the corresponding inline assembly specifies
that the operand is only written to ("=") and the previous value is
discarded.

Therefore the compiler is free to and actually does omit the zero
initialization.

To fix this simply change the contraint modifier to "+", so the
compiler cannot omit the initialization anymore.

Fixes: c9ca78415ac1 ("s390/uaccess: provide inline variants of get_user/put_user")
Fixes: fd2d2b191fe7 ("s390: get_user() should zero on failure")
Cc: Al Viro <viro@zeniv.linux.org.uk>
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/uaccess.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -144,7 +144,7 @@ unsigned long __must_check __copy_to_use
 		"	jg	2b\n"				\
 		".popsection\n"					\
 		EX_TABLE(0b,3b) EX_TABLE(1b,3b)			\
-		: "=d" (__rc), "=Q" (*(to))			\
+		: "=d" (__rc), "+Q" (*(to))			\
 		: "d" (size), "Q" (*(from)),			\
 		  "d" (__reg0), "K" (-EFAULT)			\
 		: "cc");					\

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

* [PATCH 4.10 053/110] MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (50 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 052/110] s390/uaccess: get_user() should zero on failure (again) Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 054/110] MIPS: ralink: Fix typos in rt3883 pinctrl Greg Kroah-Hartman
                   ` (57 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, James Hogan, Paul Burton,
	Ralf Baechle, linux-mips

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

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

From: James Hogan <james.hogan@imgtec.com>

commit 2e6c7747730296a6d4fd700894286db1132598c4 upstream.

When a 32-bit kernel is configured to support MIPS64r6 (CPU_MIPS64_R6),
MIPS_O32_FP64_SUPPORT won't be selected as it should be because
MIPS32_O32 is disabled (o32 is already the default ABI available on
32-bit kernels).

This results in userland FP breakage as CP0_Status.FR is read-only 1
since r6 (when an FPU is present) so __enable_fpu() will fail to clear
FR. This causes the FPU emulator to get used which will incorrectly
emulate 32-bit FPU registers.

Force o32 fp64 support in this case by also selecting
MIPS_O32_FP64_SUPPORT from CPU_MIPS64_R6 if 32BIT.

Fixes: 4e9d324d4288 ("MIPS: Require O32 FP64 support for MIPS64 with O32 compat")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Paul Burton <paul.burton@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15310/
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1526,7 +1526,7 @@ config CPU_MIPS64_R6
 	select CPU_SUPPORTS_HIGHMEM
 	select CPU_SUPPORTS_MSA
 	select GENERIC_CSUM
-	select MIPS_O32_FP64_SUPPORT if MIPS32_O32
+	select MIPS_O32_FP64_SUPPORT if 32BIT || MIPS32_O32
 	select HAVE_KVM
 	help
 	  Choose this option to build a kernel for release 6 or later of the

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

* [PATCH 4.10 054/110] MIPS: ralink: Fix typos in rt3883 pinctrl
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (51 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 053/110] MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 055/110] MIPS: End spinlocks with .insn Greg Kroah-Hartman
                   ` (56 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, John Crispin, Daniel Golle,
	linux-mips, James Hogan

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

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

From: John Crispin <john@phrozen.org>

commit 7c5a3d813050ee235817b0220dd8c42359a9efd8 upstream.

There are two copy & paste errors in the definition of the 5GHz LNA and
second ethernet pinmux.

Fixes: f576fb6a0700 ("MIPS: ralink: cleanup the soc specific pinmux data")
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15328/
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/ralink/rt3883.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/mips/ralink/rt3883.c
+++ b/arch/mips/ralink/rt3883.c
@@ -36,7 +36,7 @@ static struct rt2880_pmx_func uartlite_f
 static struct rt2880_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 5) };
 static struct rt2880_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) };
 static struct rt2880_pmx_func lna_a_func[] = { FUNC("lna a", 0, 32, 3) };
-static struct rt2880_pmx_func lna_g_func[] = { FUNC("lna a", 0, 35, 3) };
+static struct rt2880_pmx_func lna_g_func[] = { FUNC("lna g", 0, 35, 3) };
 static struct rt2880_pmx_func pci_func[] = {
 	FUNC("pci-dev", 0, 40, 32),
 	FUNC("pci-host2", 1, 40, 32),
@@ -44,7 +44,7 @@ static struct rt2880_pmx_func pci_func[]
 	FUNC("pci-fnc", 3, 40, 32)
 };
 static struct rt2880_pmx_func ge1_func[] = { FUNC("ge1", 0, 72, 12) };
-static struct rt2880_pmx_func ge2_func[] = { FUNC("ge1", 0, 84, 12) };
+static struct rt2880_pmx_func ge2_func[] = { FUNC("ge2", 0, 84, 12) };
 
 static struct rt2880_pmx_group rt3883_pinmux_data[] = {
 	GRP("i2c", i2c_func, 1, RT3883_GPIO_MODE_I2C),

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

* [PATCH 4.10 055/110] MIPS: End spinlocks with .insn
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (52 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 054/110] MIPS: ralink: Fix typos in rt3883 pinctrl Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 056/110] MIPS: Lantiq: fix missing xbar kernel panic Greg Kroah-Hartman
                   ` (55 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Paul Burton, James Hogan,
	Maciej W. Rozycki, Ralf Baechle, Peter Zijlstra, Ingo Molnar,
	linux-mips

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

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

From: Paul Burton <paul.burton@imgtec.com>

commit 4b5347a24a0f2d3272032c120664b484478455de upstream.

When building for microMIPS we need to ensure that the assembler always
knows that there is code at the target of a branch or jump. Recent
toolchains will fail to link a microMIPS kernel when this isn't the case
due to what it thinks is a branch to non-microMIPS code.

mips-mti-linux-gnu-ld kernel/built-in.o: .spinlock.text+0x2fc: Unsupported branch between ISA modes.
mips-mti-linux-gnu-ld final link failed: Bad value

This is due to inline assembly labels in spinlock.h not being followed
by an instruction mnemonic, either due to a .subsection pseudo-op or the
end of the inline asm block.

Fix this with a .insn direction after such labels.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Maciej W. Rozycki <macro@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15325/
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/include/asm/spinlock.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/arch/mips/include/asm/spinlock.h
+++ b/arch/mips/include/asm/spinlock.h
@@ -127,7 +127,7 @@ static inline void arch_spin_lock(arch_s
 		"	andi	%[ticket], %[ticket], 0xffff		\n"
 		"	bne	%[ticket], %[my_ticket], 4f		\n"
 		"	 subu	%[ticket], %[my_ticket], %[ticket]	\n"
-		"2:							\n"
+		"2:	.insn						\n"
 		"	.subsection 2					\n"
 		"4:	andi	%[ticket], %[ticket], 0xffff		\n"
 		"	sll	%[ticket], 5				\n"
@@ -202,7 +202,7 @@ static inline unsigned int arch_spin_try
 		"	sc	%[ticket], %[ticket_ptr]		\n"
 		"	beqz	%[ticket], 1b				\n"
 		"	 li	%[ticket], 1				\n"
-		"2:							\n"
+		"2:	.insn						\n"
 		"	.subsection 2					\n"
 		"3:	b	2b					\n"
 		"	 li	%[ticket], 0				\n"
@@ -382,7 +382,7 @@ static inline int arch_read_trylock(arch
 		"	.set	reorder					\n"
 		__WEAK_LLSC_MB
 		"	li	%2, 1					\n"
-		"2:							\n"
+		"2:	.insn						\n"
 		: "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp), "=&r" (ret)
 		: GCC_OFF_SMALL_ASM() (rw->lock)
 		: "memory");
@@ -422,7 +422,7 @@ static inline int arch_write_trylock(arc
 			"	lui	%1, 0x8000			\n"
 			"	sc	%1, %0				\n"
 			"	li	%2, 1				\n"
-			"2:						\n"
+			"2:	.insn					\n"
 			: "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp),
 			  "=&r" (ret)
 			: GCC_OFF_SMALL_ASM() (rw->lock)

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

* [PATCH 4.10 056/110] MIPS: Lantiq: fix missing xbar kernel panic
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (53 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 055/110] MIPS: End spinlocks with .insn Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 057/110] MIPS: Check TLB before handle_ri_rdhwr() for Loongson-3 Greg Kroah-Hartman
                   ` (54 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Hauke Mehrtens, John Crispin,
	james.hogan, arnd, sergei.shtylyov, linux-mips, Ralf Baechle

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

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

From: Hauke Mehrtens <hauke@hauke-m.de>

commit 6ef90877eee63a0d03e83183bb44b64229b624e6 upstream.

Commit 08b3c894e565 ("MIPS: lantiq: Disable xbar fpi burst mode")
accidentally requested the resources from the pmu address region
instead of the xbar registers region, but the check for the return
value of request_mem_region() was wrong. Commit 98ea51cb0c8c ("MIPS:
Lantiq: Fix another request_mem_region() return code check") fixed the
check of the return value of request_mem_region() which made the kernel
panics.
This patch now makes use of the correct memory region for the cross bar.

Fixes: 08b3c894e565 ("MIPS: lantiq: Disable xbar fpi burst mode")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: John Crispin <john@phrozen.org>
Cc: james.hogan@imgtec.com
Cc: arnd@arndb.de
Cc: sergei.shtylyov@cogentembedded.com
Cc: john@phrozen.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15751
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/lantiq/xway/sysctrl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/mips/lantiq/xway/sysctrl.c
+++ b/arch/mips/lantiq/xway/sysctrl.c
@@ -467,7 +467,7 @@ void __init ltq_soc_init(void)
 
 		if (!np_xbar)
 			panic("Failed to load xbar nodes from devicetree");
-		if (of_address_to_resource(np_pmu, 0, &res_xbar))
+		if (of_address_to_resource(np_xbar, 0, &res_xbar))
 			panic("Failed to get xbar resources");
 		if (request_mem_region(res_xbar.start, resource_size(&res_xbar),
 			res_xbar.name) < 0)

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

* [PATCH 4.10 057/110] MIPS: Check TLB before handle_ri_rdhwr() for Loongson-3
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (54 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 056/110] MIPS: Lantiq: fix missing xbar kernel panic Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 058/110] MIPS: Add MIPS_CPU_FTLB for Loongson-3A R2 Greg Kroah-Hartman
                   ` (53 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Huacai Chen, Rui Wang, John Crispin,
	Steven J . Hill, Fuxin Zhang, Zhangjin Wu, linux-mips,
	Ralf Baechle

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

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

From: Huacai Chen <chenhc@lemote.com>

commit 5a34133167dce36666ea054e30a561b7f4413b7f upstream.

Loongson-3's micro TLB (ITLB) is not strictly a subset of JTLB. That
means: when a JTLB entry is replaced by hardware, there may be an old
valid entry exists in ITLB. So, a TLB miss exception may occur while
handle_ri_rdhwr() is running because it try to access EPC's content.
However, handle_ri_rdhwr() doesn't clear EXL, which makes a TLB Refill
exception be treated as a TLB Invalid exception and tlbp may fail. In
this case, if FTLB (which is usually set-associative instead of set-
associative) is enabled, a tlbp failure will cause an invalid tlbwi,
which will hang the whole system.

This patch rename handle_ri_rdhwr_vivt to handle_ri_rdhwr_tlbp and use
it for Loongson-3. It try to solve the same problem described as below,
but more straightforwards.

https://patchwork.linux-mips.org/patch/12591/

I think Loongson-2 has the same problem, but it has no FTLB, so we just
keep it as is.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: Rui Wang <wangr@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15753/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/kernel/genex.S |    4 ++--
 arch/mips/kernel/traps.c |   17 +++++++++++++----
 2 files changed, 15 insertions(+), 6 deletions(-)

--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -448,7 +448,7 @@ NESTED(nmi_handler, PT_SIZE, sp)
 	BUILD_HANDLER reserved reserved sti verbose	/* others */
 
 	.align	5
-	LEAF(handle_ri_rdhwr_vivt)
+	LEAF(handle_ri_rdhwr_tlbp)
 	.set	push
 	.set	noat
 	.set	noreorder
@@ -467,7 +467,7 @@ NESTED(nmi_handler, PT_SIZE, sp)
 	.set	pop
 	bltz	k1, handle_ri	/* slow path */
 	/* fall thru */
-	END(handle_ri_rdhwr_vivt)
+	END(handle_ri_rdhwr_tlbp)
 
 	LEAF(handle_ri_rdhwr)
 	.set	push
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -81,7 +81,7 @@ extern asmlinkage void handle_dbe(void);
 extern asmlinkage void handle_sys(void);
 extern asmlinkage void handle_bp(void);
 extern asmlinkage void handle_ri(void);
-extern asmlinkage void handle_ri_rdhwr_vivt(void);
+extern asmlinkage void handle_ri_rdhwr_tlbp(void);
 extern asmlinkage void handle_ri_rdhwr(void);
 extern asmlinkage void handle_cpu(void);
 extern asmlinkage void handle_ov(void);
@@ -2352,9 +2352,18 @@ void __init trap_init(void)
 
 	set_except_vector(EXCCODE_SYS, handle_sys);
 	set_except_vector(EXCCODE_BP, handle_bp);
-	set_except_vector(EXCCODE_RI, rdhwr_noopt ? handle_ri :
-			  (cpu_has_vtag_icache ?
-			   handle_ri_rdhwr_vivt : handle_ri_rdhwr));
+
+	if (rdhwr_noopt)
+		set_except_vector(EXCCODE_RI, handle_ri);
+	else {
+		if (cpu_has_vtag_icache)
+			set_except_vector(EXCCODE_RI, handle_ri_rdhwr_tlbp);
+		else if (current_cpu_type() == CPU_LOONGSON3)
+			set_except_vector(EXCCODE_RI, handle_ri_rdhwr_tlbp);
+		else
+			set_except_vector(EXCCODE_RI, handle_ri_rdhwr);
+	}
+
 	set_except_vector(EXCCODE_CPU, handle_cpu);
 	set_except_vector(EXCCODE_OV, handle_ov);
 	set_except_vector(EXCCODE_TR, handle_tr);

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

* [PATCH 4.10 058/110] MIPS: Add MIPS_CPU_FTLB for Loongson-3A R2
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (55 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 057/110] MIPS: Check TLB before handle_ri_rdhwr() for Loongson-3 Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 059/110] MIPS: Flush wrong invalid FTLB entry for huge page Greg Kroah-Hartman
                   ` (52 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Huacai Chen, John Crispin,
	Steven J . Hill, Fuxin Zhang, Zhangjin Wu, linux-mips,
	Ralf Baechle

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

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

From: Huacai Chen <chenhc@lemote.com>

commit 033cffeedbd11c140952b98e8639bf652091a17d upstream.

Loongson-3A R2 and newer CPU have FTLB, but Config0.MT is 1, so add
MIPS_CPU_FTLB to the CPU options.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15752/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/kernel/cpu-probe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1824,7 +1824,7 @@ static inline void cpu_probe_loongson(st
 		}
 
 		decode_configs(c);
-		c->options |= MIPS_CPU_TLBINV | MIPS_CPU_LDPTE;
+		c->options |= MIPS_CPU_FTLB | MIPS_CPU_TLBINV | MIPS_CPU_LDPTE;
 		c->writecombine = _CACHE_UNCACHED_ACCELERATED;
 		break;
 	default:

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

* [PATCH 4.10 059/110] MIPS: Flush wrong invalid FTLB entry for huge page
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (56 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 058/110] MIPS: Add MIPS_CPU_FTLB for Loongson-3A R2 Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 060/110] MIPS: c-r4k: Fix Loongson-3s vcache/scache waysize calculation Greg Kroah-Hartman
                   ` (51 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Rui Wang, Huacai Chen, John Crispin,
	Steven J . Hill, Fuxin Zhang, Zhangjin Wu, linux-mips,
	Ralf Baechle

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

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

From: Huacai Chen <chenhc@lemote.com>

commit 0115f6cbf26663c86496bc56eeea293f85b77897 upstream.

On VTLB+FTLB platforms (such as Loongson-3A R2), FTLB's pagesize is
usually configured the same as PAGE_SIZE. In such a case, Huge page
entry is not suitable to write in FTLB.

Unfortunately, when a huge page is created, its page table entries
haven't created immediately. Then the TLB refill handler will fetch an
invalid page table entry which has no "HUGE" bit, and this entry may be
written to FTLB. Since it is invalid, TLB load/store handler will then
use tlbwi to write the valid entry at the same place. However, the
valid entry is a huge page entry which isn't suitable for FTLB.

Our solution is to modify build_huge_handler_tail. Flush the invalid
old entry (whether it is in FTLB or VTLB, this is in order to reduce
branches) and use tlbwr to write the valid new entry.

Signed-off-by: Rui Wang <wangr@lemote.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15754/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/mm/tlbex.c |   25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -762,7 +762,8 @@ static void build_huge_update_entries(u3
 static void build_huge_handler_tail(u32 **p, struct uasm_reloc **r,
 				    struct uasm_label **l,
 				    unsigned int pte,
-				    unsigned int ptr)
+				    unsigned int ptr,
+				    unsigned int flush)
 {
 #ifdef CONFIG_SMP
 	UASM_i_SC(p, pte, 0, ptr);
@@ -771,6 +772,22 @@ static void build_huge_handler_tail(u32
 #else
 	UASM_i_SW(p, pte, 0, ptr);
 #endif
+	if (cpu_has_ftlb && flush) {
+		BUG_ON(!cpu_has_tlbinv);
+
+		UASM_i_MFC0(p, ptr, C0_ENTRYHI);
+		uasm_i_ori(p, ptr, ptr, MIPS_ENTRYHI_EHINV);
+		UASM_i_MTC0(p, ptr, C0_ENTRYHI);
+		build_tlb_write_entry(p, l, r, tlb_indexed);
+
+		uasm_i_xori(p, ptr, ptr, MIPS_ENTRYHI_EHINV);
+		UASM_i_MTC0(p, ptr, C0_ENTRYHI);
+		build_huge_update_entries(p, pte, ptr);
+		build_huge_tlb_write_entry(p, l, r, pte, tlb_random, 0);
+
+		return;
+	}
+
 	build_huge_update_entries(p, pte, ptr);
 	build_huge_tlb_write_entry(p, l, r, pte, tlb_indexed, 0);
 }
@@ -2197,7 +2214,7 @@ static void build_r4000_tlb_load_handler
 		uasm_l_tlbl_goaround2(&l, p);
 	}
 	uasm_i_ori(&p, wr.r1, wr.r1, (_PAGE_ACCESSED | _PAGE_VALID));
-	build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2);
+	build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2, 1);
 #endif
 
 	uasm_l_nopage_tlbl(&l, p);
@@ -2252,7 +2269,7 @@ static void build_r4000_tlb_store_handle
 	build_tlb_probe_entry(&p);
 	uasm_i_ori(&p, wr.r1, wr.r1,
 		   _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY);
-	build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2);
+	build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2, 1);
 #endif
 
 	uasm_l_nopage_tlbs(&l, p);
@@ -2308,7 +2325,7 @@ static void build_r4000_tlb_modify_handl
 	build_tlb_probe_entry(&p);
 	uasm_i_ori(&p, wr.r1, wr.r1,
 		   _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY);
-	build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2);
+	build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2, 0);
 #endif
 
 	uasm_l_nopage_tlbm(&l, p);

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

* [PATCH 4.10 060/110] MIPS: c-r4k: Fix Loongson-3s vcache/scache waysize calculation
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (57 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 059/110] MIPS: Flush wrong invalid FTLB entry for huge page Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 061/110] drm/i915/gvt: Fix gvt scheduler interval time Greg Kroah-Hartman
                   ` (50 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Huacai Chen, John Crispin,
	Steven J . Hill, Fuxin Zhang, Zhangjin Wu, linux-mips,
	Ralf Baechle

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

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

From: Huacai Chen <chenhc@lemote.com>

commit 0be032c190abcdcfa948082b6a1e0d461184ba4d upstream.

If scache.waysize is 0, r4k___flush_cache_all() will do nothing and
then cause bugs. BTW, though vcache.waysize isn't being used by now,
we also fix its calculation.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@caviumnetworks.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15756/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/mm/c-r4k.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1558,6 +1558,7 @@ static void probe_vcache(void)
 	vcache_size = c->vcache.sets * c->vcache.ways * c->vcache.linesz;
 
 	c->vcache.waybit = 0;
+	c->vcache.waysize = vcache_size / c->vcache.ways;
 
 	pr_info("Unified victim cache %ldkB %s, linesize %d bytes.\n",
 		vcache_size >> 10, way_string[c->vcache.ways], c->vcache.linesz);
@@ -1660,6 +1661,7 @@ static void __init loongson3_sc_init(voi
 	/* Loongson-3 has 4 cores, 1MB scache for each. scaches are shared */
 	scache_size *= 4;
 	c->scache.waybit = 0;
+	c->scache.waysize = scache_size / c->scache.ways;
 	pr_info("Unified secondary cache %ldkB %s, linesize %d bytes.\n",
 	       scache_size >> 10, way_string[c->scache.ways], c->scache.linesz);
 	if (scache_size)

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

* [PATCH 4.10 061/110] drm/i915/gvt: Fix gvt scheduler interval time
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (58 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 060/110] MIPS: c-r4k: Fix Loongson-3s vcache/scache waysize calculation Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 062/110] drm/i915/kvmgt: fix suspicious rcu dereference usage Greg Kroah-Hartman
                   ` (49 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Zhi Wang, Chuanxiao Dong, Zhenyu Wang

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

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

From: Zhenyu Wang <zhenyuw@linux.intel.com>

commit 2958b9013fcbabeeba221161d0712f5259f1e15d upstream.

Fix to correctly assign 1ms for gvt scheduler interval time,
as previous code using HZ is pretty broken. And use no delay
for start gvt scheduler function.

Fixes: 4b63960ebd3f ("drm/i915/gvt: vGPU schedule policy framework")
Cc: Zhi Wang <zhi.a.wang@intel.com>
Acked-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/gpu/drm/i915/gvt/sched_policy.c
+++ b/drivers/gpu/drm/i915/gvt/sched_policy.c
@@ -101,7 +101,7 @@ struct tbs_sched_data {
 	struct list_head runq_head;
 };
 
-#define GVT_DEFAULT_TIME_SLICE (1 * HZ / 1000)
+#define GVT_DEFAULT_TIME_SLICE (msecs_to_jiffies(1))
 
 static void tbs_sched_func(struct work_struct *work)
 {
@@ -224,7 +224,7 @@ static void tbs_sched_start_schedule(str
 		return;
 
 	list_add_tail(&vgpu_data->list, &sched_data->runq_head);
-	schedule_delayed_work(&sched_data->work, sched_data->period);
+	schedule_delayed_work(&sched_data->work, 0);
 }
 
 static void tbs_sched_stop_schedule(struct intel_vgpu *vgpu)

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

* [PATCH 4.10 062/110] drm/i915/kvmgt: fix suspicious rcu dereference usage
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (59 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 061/110] drm/i915/gvt: Fix gvt scheduler interval time Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 063/110] usb: dwc3: gadget: delay unmap of bounced requests Greg Kroah-Hartman
                   ` (48 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Changbin Du, Xiao Guangrong,
	Jike Song, Zhenyu Wang

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

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

From: Changbin Du <changbin.du@intel.com>

commit 5180edc2421117766fcb9c2d2dc6bfaeefdeb709 upstream.

The srcu read lock must be held while accessing kvm memslots.
This patch fix below warning for function kvmgt_rw_gpa().

[  165.345093] [ ERR: suspicious RCU usage.  ]
[  165.416538] Call Trace:
[  165.418989]  dump_stack+0x85/0xc2
[  165.422310]  lockdep_rcu_suspicious+0xd7/0x110
[  165.426769]  kvm_read_guest_page+0x195/0x1b0 [kvm]
[  165.431574]  kvm_read_guest+0x50/0x90 [kvm]
[  165.440492]  kvmgt_rw_gpa+0x43/0xa0 [kvmgt]
[  165.444683]  kvmgt_read_gpa+0x11/0x20 [kvmgt]
[  165.449061]  gtt_get_entry64+0x4d/0xc0 [i915]
[  165.453438]  ppgtt_populate_shadow_page_by_guest_entry+0x380/0xdc0 [i915]
[  165.460254]  shadow_mm+0xd1/0x460 [i915]
[  165.472488]  intel_vgpu_create_mm+0x1ab/0x210 [i915]
[  165.477472]  intel_vgpu_g2v_create_ppgtt_mm+0x5f/0xc0 [i915]
[  165.483154]  pvinfo_mmio_write+0x19b/0x1d0 [i915]
[  165.499068]  intel_vgpu_emulate_mmio_write+0x3f9/0x600 [i915]
[  165.504827]  intel_vgpu_rw+0x114/0x150 [kvmgt]
[  165.509281]  intel_vgpu_write+0x16f/0x1a0 [kvmgt]
[  165.513993]  vfio_mdev_write+0x20/0x30 [vfio_mdev]
[  165.518793]  vfio_device_fops_write+0x24/0x30 [vfio]
[  165.523770]  __vfs_write+0x28/0x120
[  165.540529]  vfs_write+0xce/0x1f0

v2: fix Cc format for stable

Signed-off-by: Changbin Du <changbin.du@intel.com>
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Jike Song <jike.song@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/gvt/kvmgt.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -1422,7 +1422,7 @@ static int kvmgt_rw_gpa(unsigned long ha
 {
 	struct kvmgt_guest_info *info;
 	struct kvm *kvm;
-	int ret;
+	int idx, ret;
 	bool kthread = current->mm == NULL;
 
 	if (!handle_valid(handle))
@@ -1434,8 +1434,10 @@ static int kvmgt_rw_gpa(unsigned long ha
 	if (kthread)
 		use_mm(kvm->mm);
 
+	idx = srcu_read_lock(&kvm->srcu);
 	ret = write ? kvm_write_guest(kvm, gpa, buf, len) :
 		      kvm_read_guest(kvm, gpa, buf, len);
+	srcu_read_unlock(&kvm->srcu, idx);
 
 	if (kthread)
 		unuse_mm(kvm->mm);

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

* [PATCH 4.10 063/110] usb: dwc3: gadget: delay unmap of bounced requests
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (60 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 062/110] drm/i915/kvmgt: fix suspicious rcu dereference usage Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 064/110] Documentation: stable-kernel-rules: fix stable-tag format Greg Kroah-Hartman
                   ` (47 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Janusz Dziedzic, Felipe Balbi

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

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

From: Janusz Dziedzic <januszx.dziedzic@intel.com>

commit de288e36fe33f7e06fa272bc8e2f85aa386d99aa upstream.

In the case of bounced ep0 requests, we must delay DMA operation until
after ->complete() otherwise we might overwrite contents of req->buf.

This caused problems with RNDIS gadget.

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

---
 drivers/usb/dwc3/gadget.c |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -171,6 +171,7 @@ void dwc3_gadget_giveback(struct dwc3_ep
 		int status)
 {
 	struct dwc3			*dwc = dep->dwc;
+	unsigned int			unmap_after_complete = false;
 
 	req->started = false;
 	list_del(&req->list);
@@ -180,11 +181,19 @@ void dwc3_gadget_giveback(struct dwc3_ep
 	if (req->request.status == -EINPROGRESS)
 		req->request.status = status;
 
-	if (dwc->ep0_bounced && dep->number <= 1)
+	/*
+	 * NOTICE we don't want to unmap before calling ->complete() if we're
+	 * dealing with a bounced ep0 request. If we unmap it here, we would end
+	 * up overwritting the contents of req->buf and this could confuse the
+	 * gadget driver.
+	 */
+	if (dwc->ep0_bounced && dep->number <= 1) {
 		dwc->ep0_bounced = false;
-
-	usb_gadget_unmap_request_by_dev(dwc->sysdev,
-			&req->request, req->direction);
+		unmap_after_complete = true;
+	} else {
+		usb_gadget_unmap_request_by_dev(dwc->sysdev,
+				&req->request, req->direction);
+	}
 
 	trace_dwc3_gadget_giveback(req);
 
@@ -192,6 +201,10 @@ void dwc3_gadget_giveback(struct dwc3_ep
 	usb_gadget_giveback_request(&dep->endpoint, &req->request);
 	spin_lock(&dwc->lock);
 
+	if (unmap_after_complete)
+		usb_gadget_unmap_request_by_dev(dwc->sysdev,
+				&req->request, req->direction);
+
 	if (dep->number > 1)
 		pm_runtime_put(dwc->dev);
 }

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

* [PATCH 4.10 064/110] Documentation: stable-kernel-rules: fix stable-tag format
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (61 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 063/110] usb: dwc3: gadget: delay unmap of bounced requests Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 065/110] mm/mempolicy.c: fix error handling in set_mempolicy and mbind Greg Kroah-Hartman
                   ` (46 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Johan Hovold

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

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

From: Johan Hovold <johan@kernel.org>

commit cf903e9d3a97f89b224d2d07be37c0f160db8192 upstream.

A patch documenting how to specify which kernels a particular fix should
be backported to (seemingly) inadvertently added a minus sign after the
kernel version. This particular stable-tag format had never been used
prior to this patch, and was neither present when the patch in question
was first submitted (it was added in v2 without any comment).

Drop the minus sign to avoid any confusion.

Fixes: fdc81b7910ad ("stable_kernel_rules: Add clause about specification of kernel versions to patch.")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 Documentation/process/stable-kernel-rules.rst |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/Documentation/process/stable-kernel-rules.rst
+++ b/Documentation/process/stable-kernel-rules.rst
@@ -124,7 +124,7 @@ specified in the following format in the
 
 .. code-block:: none
 
-     Cc: <stable@vger.kernel.org> # 3.3.x-
+     Cc: <stable@vger.kernel.org> # 3.3.x
 
 The tag has the meaning of:
 

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

* [PATCH 4.10 065/110] mm/mempolicy.c: fix error handling in set_mempolicy and mbind.
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (62 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 064/110] Documentation: stable-kernel-rules: fix stable-tag format Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 066/110] random: use chacha20 for get_random_int/long Greg Kroah-Hartman
                   ` (45 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Chris Salls, Linus Torvalds

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

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

From: Chris Salls <salls@cs.ucsb.edu>

commit cf01fb9985e8deb25ccf0ea54d916b8871ae0e62 upstream.

In the case that compat_get_bitmap fails we do not want to copy the
bitmap to the user as it will contain uninitialized stack data and leak
sensitive data.

Signed-off-by: Chris Salls <salls@cs.ucsb.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/mempolicy.c |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1526,7 +1526,6 @@ COMPAT_SYSCALL_DEFINE5(get_mempolicy, in
 COMPAT_SYSCALL_DEFINE3(set_mempolicy, int, mode, compat_ulong_t __user *, nmask,
 		       compat_ulong_t, maxnode)
 {
-	long err = 0;
 	unsigned long __user *nm = NULL;
 	unsigned long nr_bits, alloc_size;
 	DECLARE_BITMAP(bm, MAX_NUMNODES);
@@ -1535,14 +1534,13 @@ COMPAT_SYSCALL_DEFINE3(set_mempolicy, in
 	alloc_size = ALIGN(nr_bits, BITS_PER_LONG) / 8;
 
 	if (nmask) {
-		err = compat_get_bitmap(bm, nmask, nr_bits);
+		if (compat_get_bitmap(bm, nmask, nr_bits))
+			return -EFAULT;
 		nm = compat_alloc_user_space(alloc_size);
-		err |= copy_to_user(nm, bm, alloc_size);
+		if (copy_to_user(nm, bm, alloc_size))
+			return -EFAULT;
 	}
 
-	if (err)
-		return -EFAULT;
-
 	return sys_set_mempolicy(mode, nm, nr_bits+1);
 }
 
@@ -1550,7 +1548,6 @@ COMPAT_SYSCALL_DEFINE6(mbind, compat_ulo
 		       compat_ulong_t, mode, compat_ulong_t __user *, nmask,
 		       compat_ulong_t, maxnode, compat_ulong_t, flags)
 {
-	long err = 0;
 	unsigned long __user *nm = NULL;
 	unsigned long nr_bits, alloc_size;
 	nodemask_t bm;
@@ -1559,14 +1556,13 @@ COMPAT_SYSCALL_DEFINE6(mbind, compat_ulo
 	alloc_size = ALIGN(nr_bits, BITS_PER_LONG) / 8;
 
 	if (nmask) {
-		err = compat_get_bitmap(nodes_addr(bm), nmask, nr_bits);
+		if (compat_get_bitmap(nodes_addr(bm), nmask, nr_bits))
+			return -EFAULT;
 		nm = compat_alloc_user_space(alloc_size);
-		err |= copy_to_user(nm, nodes_addr(bm), alloc_size);
+		if (copy_to_user(nm, nodes_addr(bm), alloc_size))
+			return -EFAULT;
 	}
 
-	if (err)
-		return -EFAULT;
-
 	return sys_mbind(start, len, mode, nm, nr_bits+1, flags);
 }
 

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

* [PATCH 4.10 066/110] random: use chacha20 for get_random_int/long
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (63 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 065/110] mm/mempolicy.c: fix error handling in set_mempolicy and mbind Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 067/110] kvm: fix page struct leak in handle_vmon Greg Kroah-Hartman
                   ` (44 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jason A. Donenfeld, Theodore Tso,
	Hannes Frederic Sowa, Andy Lutomirski

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

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

From: Jason A. Donenfeld <Jason@zx2c4.com>

commit f5b98461cb8167ba362ad9f74c41d126b7becea7 upstream.

Now that our crng uses chacha20, we can rely on its speedy
characteristics for replacing MD5, while simultaneously achieving a
higher security guarantee. Before the idea was to use these functions if
you wanted random integers that aren't stupidly insecure but aren't
necessarily secure either, a vague gray zone, that hopefully was "good
enough" for its users. With chacha20, we can strengthen this claim,
since either we're using an rdrand-like instruction, or we're using the
same crng as /dev/urandom. And it's faster than what was before.

We could have chosen to replace this with a SipHash-derived function,
which might be slightly faster, but at the cost of having yet another
RNG construction in the kernel. By moving to chacha20, we have a single
RNG to analyze and verify, and we also already get good performance
improvements on all platforms.

Implementation-wise, rather than use a generic buffer for both
get_random_int/long and memcpy based on the size needs, we use a
specific buffer for 32-bit reads and for 64-bit reads. This way, we're
guaranteed to always have aligned accesses on all platforms. While
slightly more verbose in C, the assembly this generates is a lot
simpler than otherwise.

Finally, on 32-bit platforms where longs and ints are the same size,
we simply alias get_random_int to get_random_long.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Suggested-by: Theodore Ts'o <tytso@mit.edu>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/char/random.c  |   84 +++++++++++++++++++++++++------------------------
 include/linux/random.h |    1 
 init/main.c            |    1 
 3 files changed, 43 insertions(+), 43 deletions(-)

--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -2042,63 +2042,65 @@ struct ctl_table random_table[] = {
 };
 #endif 	/* CONFIG_SYSCTL */
 
-static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned;
-
-int random_int_secret_init(void)
-{
-	get_random_bytes(random_int_secret, sizeof(random_int_secret));
-	return 0;
-}
-
-static DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash)
-		__aligned(sizeof(unsigned long));
+struct batched_entropy {
+	union {
+		unsigned long entropy_long[CHACHA20_BLOCK_SIZE / sizeof(unsigned long)];
+		unsigned int entropy_int[CHACHA20_BLOCK_SIZE / sizeof(unsigned int)];
+	};
+	unsigned int position;
+};
 
 /*
- * Get a random word for internal kernel use only. Similar to urandom but
- * with the goal of minimal entropy pool depletion. As a result, the random
- * value is not cryptographically secure but for several uses the cost of
- * depleting entropy is too high
+ * Get a random word for internal kernel use only. The quality of the random
+ * number is either as good as RDRAND or as good as /dev/urandom, with the
+ * goal of being quite fast and not depleting entropy.
  */
-unsigned int get_random_int(void)
+static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_long);
+unsigned long get_random_long(void)
 {
-	__u32 *hash;
-	unsigned int ret;
+	unsigned long ret;
+	struct batched_entropy *batch;
 
-	if (arch_get_random_int(&ret))
+	if (arch_get_random_long(&ret))
 		return ret;
 
-	hash = get_cpu_var(get_random_int_hash);
-
-	hash[0] += current->pid + jiffies + random_get_entropy();
-	md5_transform(hash, random_int_secret);
-	ret = hash[0];
-	put_cpu_var(get_random_int_hash);
-
+	batch = &get_cpu_var(batched_entropy_long);
+	if (batch->position % ARRAY_SIZE(batch->entropy_long) == 0) {
+		extract_crng((u8 *)batch->entropy_long);
+		batch->position = 0;
+	}
+	ret = batch->entropy_long[batch->position++];
+	put_cpu_var(batched_entropy_long);
 	return ret;
 }
-EXPORT_SYMBOL(get_random_int);
+EXPORT_SYMBOL(get_random_long);
 
-/*
- * Same as get_random_int(), but returns unsigned long.
- */
-unsigned long get_random_long(void)
+#if BITS_PER_LONG == 32
+unsigned int get_random_int(void)
 {
-	__u32 *hash;
-	unsigned long ret;
+	return get_random_long();
+}
+#else
+static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_int);
+unsigned int get_random_int(void)
+{
+	unsigned int ret;
+	struct batched_entropy *batch;
 
-	if (arch_get_random_long(&ret))
+	if (arch_get_random_int(&ret))
 		return ret;
 
-	hash = get_cpu_var(get_random_int_hash);
-
-	hash[0] += current->pid + jiffies + random_get_entropy();
-	md5_transform(hash, random_int_secret);
-	ret = *(unsigned long *)hash;
-	put_cpu_var(get_random_int_hash);
-
+	batch = &get_cpu_var(batched_entropy_int);
+	if (batch->position % ARRAY_SIZE(batch->entropy_int) == 0) {
+		extract_crng((u8 *)batch->entropy_int);
+		batch->position = 0;
+	}
+	ret = batch->entropy_int[batch->position++];
+	put_cpu_var(batched_entropy_int);
 	return ret;
 }
-EXPORT_SYMBOL(get_random_long);
+#endif
+EXPORT_SYMBOL(get_random_int);
 
 /**
  * randomize_page - Generate a random, page aligned address
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -37,7 +37,6 @@ extern void get_random_bytes(void *buf,
 extern int add_random_ready_callback(struct random_ready_callback *rdy);
 extern void del_random_ready_callback(struct random_ready_callback *rdy);
 extern void get_random_bytes_arch(void *buf, int nbytes);
-extern int random_int_secret_init(void);
 
 #ifndef MODULE
 extern const struct file_operations random_fops, urandom_fops;
--- a/init/main.c
+++ b/init/main.c
@@ -879,7 +879,6 @@ static void __init do_basic_setup(void)
 	do_ctors();
 	usermodehelper_enable();
 	do_initcalls();
-	random_int_secret_init();
 }
 
 static void __init do_pre_smp_initcalls(void)

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

* [PATCH 4.10 067/110] kvm: fix page struct leak in handle_vmon
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (64 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 066/110] random: use chacha20 for get_random_int/long Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:42 ` [PATCH 4.10 068/110] HID: multitouch: enable the Surface 4 Type Cover Pro (JP) to report multitouch data Greg Kroah-Hartman
                   ` (43 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dmitry Vyukov, Paolo Bonzini,
	Charles (Chas) Williams

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

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

From: Paolo Bonzini <pbonzini@redhat.com>

commit 06ce521af9558814b8606c0476c54497cf83a653 upstream.

handle_vmon gets a reference on VMXON region page,
but does not release it. Release the reference.

Found by syzkaller; based on a patch by Dmitry.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Charles (Chas) Williams" <ciwillia@brocade.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kvm/vmx.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7086,13 +7086,18 @@ static int nested_vmx_check_vmptr(struct
 		}
 
 		page = nested_get_page(vcpu, vmptr);
-		if (page == NULL ||
-		    *(u32 *)kmap(page) != VMCS12_REVISION) {
+		if (page == NULL) {
 			nested_vmx_failInvalid(vcpu);
+			return kvm_skip_emulated_instruction(vcpu);
+		}
+		if (*(u32 *)kmap(page) != VMCS12_REVISION) {
 			kunmap(page);
+			nested_release_page_clean(page);
+			nested_vmx_failInvalid(vcpu);
 			return kvm_skip_emulated_instruction(vcpu);
 		}
 		kunmap(page);
+		nested_release_page_clean(page);
 		vmx->nested.vmxon_ptr = vmptr;
 		break;
 	case EXIT_REASON_VMCLEAR:

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

* [PATCH 4.10 068/110] HID: multitouch: enable the Surface 4 Type Cover Pro (JP) to report multitouch data
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (65 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 067/110] kvm: fix page struct leak in handle_vmon Greg Kroah-Hartman
@ 2017-04-10 16:42 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 069/110] drm/edid: constify edid quirk list Greg Kroah-Hartman
                   ` (42 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Yuta Kobayashi, Benjamin Tissoires,
	Jiri Kosina, Sasha Levin

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

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

From: Yuta Kobayashi <alu.ula@outlook.com>

[ Upstream commit 4fed0231994b27b3896bc63885ac66d02fff625b ]

Since commit 8fe89ef076fa1 ("HID: multitouch: enable the Surface 3 Type
Cover to report multitouch data"), the TypeCover can be properly handled
by hid-multitouch and don't require any special quirk in the kernel.

Remove the support of the Surface 4 Type Cover Pro (JP) from
hid-microsoft so it can properly report multitouch from the touchpad.

Signed-off-by: Yuta Kobayashi <alu.ula@outlook.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hid/hid-core.c          |    2 --
 drivers/hid/hid-ids.h           |    1 -
 drivers/hid/hid-microsoft.c     |    2 --
 drivers/hid/usbhid/hid-quirks.c |    1 -
 4 files changed, 6 deletions(-)

--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -729,7 +729,6 @@ static void hid_scan_collection(struct h
 	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP ||
 	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_4 ||
 	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2 ||
-	     hid->product == USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP ||
 	     hid->product == USB_DEVICE_ID_MS_POWER_COVER) &&
 	    hid->group == HID_GROUP_MULTITOUCH)
 		hid->group = HID_GROUP_GENERIC;
@@ -1990,7 +1989,6 @@ static const struct hid_device_id hid_ha
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_7K) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_600) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1) },
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -730,7 +730,6 @@
 #define USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP 0x07dd
 #define USB_DEVICE_ID_MS_TYPE_COVER_PRO_4 0x07e4
 #define USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2 0x07e8
-#define USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP 0x07e9
 #define USB_DEVICE_ID_MS_POWER_COVER     0x07da
 
 #define USB_VENDOR_ID_MOJO		0x8282
--- a/drivers/hid/hid-microsoft.c
+++ b/drivers/hid/hid-microsoft.c
@@ -284,8 +284,6 @@ static const struct hid_device_id ms_dev
 		.driver_data = MS_HIDINPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2),
 		.driver_data = MS_HIDINPUT },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP),
-		.driver_data = MS_HIDINPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER),
 		.driver_data = MS_HIDINPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_KEYBOARD),
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -108,7 +108,6 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_3_JP, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_2, HID_QUIRK_NO_INIT_REPORTS },
-	{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_PRO_4_JP, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_NEXIO, USB_DEVICE_ID_NEXIO_MULTITOUCH_PTI0750, HID_QUIRK_NO_INIT_REPORTS },

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

* [PATCH 4.10 069/110] drm/edid: constify edid quirk list
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (66 preceding siblings ...)
  2017-04-10 16:42 ` [PATCH 4.10 068/110] HID: multitouch: enable the Surface 4 Type Cover Pro (JP) to report multitouch data Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 070/110] drm/i915: fix INTEL_BDW_IDS definition Greg Kroah-Hartman
                   ` (41 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Vetter, Jani Nikula, Sasha Levin

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

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

From: Jani Nikula <jani.nikula@intel.com>

[ Upstream commit 23c4cfbdab494568600ae6073a2bf02be4b10f4e ]

No reason not to be const.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1482923186-22430-1-git-send-email-jani.nikula@intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/drm_edid.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -90,7 +90,7 @@ struct detailed_mode_closure {
 #define LEVEL_GTF2	2
 #define LEVEL_CVT	3
 
-static struct edid_quirk {
+static const struct edid_quirk {
 	char vendor[4];
 	int product_id;
 	u32 quirks;
@@ -1480,7 +1480,7 @@ EXPORT_SYMBOL(drm_edid_duplicate);
  *
  * Returns true if @vendor is in @edid, false otherwise
  */
-static bool edid_vendor(struct edid *edid, char *vendor)
+static bool edid_vendor(struct edid *edid, const char *vendor)
 {
 	char edid_vendor[3];
 
@@ -1500,7 +1500,7 @@ static bool edid_vendor(struct edid *edi
  */
 static u32 edid_get_quirks(struct edid *edid)
 {
-	struct edid_quirk *quirk;
+	const struct edid_quirk *quirk;
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) {

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

* [PATCH 4.10 070/110] drm/i915: fix INTEL_BDW_IDS definition
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (67 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 069/110] drm/edid: constify edid quirk list Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 071/110] drm/i915: more .is_mobile cleanups for BDW Greg Kroah-Hartman
                   ` (40 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Carlos Santa, Rodrigo Vivi,
	Paulo Zanoni, Sasha Levin

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

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

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

[ Upstream commit 7fbd995ce4241e98d30859405504c3fb279c4ccb ]

Remove duplicated IDs from the list. Currently, this definition is
only used by early-quirks.c. From my understanding of the code, having
duplicated IDs shouldn't be causing any bugs.

Fixes: 8d9c20e1d1e3 ("drm/i915: Remove .is_mobile field from platform struct")
Cc: Carlos Santa <carlos.santa@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1483473860-17644-1-git-send-email-paulo.r.zanoni@intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/drm/i915_pciids.h |    2 --
 1 file changed, 2 deletions(-)

--- a/include/drm/i915_pciids.h
+++ b/include/drm/i915_pciids.h
@@ -240,8 +240,6 @@
 	INTEL_BDW_GT12_IDS(info), \
 	INTEL_BDW_GT3_IDS(info), \
 	INTEL_BDW_RSVDM_IDS(info), \
-	INTEL_BDW_GT12_IDS(info), \
-	INTEL_BDW_GT3_IDS(info), \
 	INTEL_BDW_RSVDD_IDS(info)
 
 #define INTEL_CHV_IDS(info) \

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

* [PATCH 4.10 071/110] drm/i915: more .is_mobile cleanups for BDW
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (68 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 070/110] drm/i915: fix INTEL_BDW_IDS definition Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 072/110] drm/i915: actually drive the BDW reserved IDs Greg Kroah-Hartman
                   ` (39 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Carlos Santa, Rodrigo Vivi,
	Paulo Zanoni, Sasha Levin

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

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

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

[ Upstream commit 0784bc624ae9be4269f8129572ee164ca680ca7c ]

Commit 8d9c20e1d1e3 ("drm/i915: Remove .is_mobile field from platform
struct") removed mobile vs desktop differences for HSW+, but forgot
the Broadwell reserved IDs, so do it now.

It's interesting to notice that these IDs are used by early-quirks.c
but are *not* used by i915_pci.c.

Cc: Carlos Santa <carlos.santa@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1483473860-17644-2-git-send-email-paulo.r.zanoni@intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/drm/i915_pciids.h |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/include/drm/i915_pciids.h
+++ b/include/drm/i915_pciids.h
@@ -226,21 +226,18 @@
 	INTEL_VGA_DEVICE(0x162A, info), /* Server */ \
 	INTEL_VGA_DEVICE(0x162D, info)  /* Workstation */
 
-#define INTEL_BDW_RSVDM_IDS(info) \
+#define INTEL_BDW_RSVD_IDS(info) \
 	INTEL_VGA_DEVICE(0x1632, info), /* ULT */ \
 	INTEL_VGA_DEVICE(0x1636, info), /* ULT */ \
 	INTEL_VGA_DEVICE(0x163B, info), /* Iris */ \
-	INTEL_VGA_DEVICE(0x163E, info)  /* ULX */
-
-#define INTEL_BDW_RSVDD_IDS(info) \
+	INTEL_VGA_DEVICE(0x163E, info), /* ULX */ \
 	INTEL_VGA_DEVICE(0x163A, info), /* Server */ \
 	INTEL_VGA_DEVICE(0x163D, info)  /* Workstation */
 
 #define INTEL_BDW_IDS(info) \
 	INTEL_BDW_GT12_IDS(info), \
 	INTEL_BDW_GT3_IDS(info), \
-	INTEL_BDW_RSVDM_IDS(info), \
-	INTEL_BDW_RSVDD_IDS(info)
+	INTEL_BDW_RSVD_IDS(info)
 
 #define INTEL_CHV_IDS(info) \
 	INTEL_VGA_DEVICE(0x22b0, info), \

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

* [PATCH 4.10 072/110] drm/i915: actually drive the BDW reserved IDs
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (69 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 071/110] drm/i915: more .is_mobile cleanups for BDW Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 073/110] ASoC: Intel: bytcr_rt5640: quirks for Insyde devices Greg Kroah-Hartman
                   ` (38 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Rodrigo Vivi, Ben Widawsky,
	Jani Nikula, Paulo Zanoni, Sasha Levin

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

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

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

[ Upstream commit 98b2f01c8dfc8922a2af1fe82a1c40cac4911634 ]

Back in 2014, commit fb7023e0e248 ("drm/i915: BDW: Adding Reserved PCI
IDs.") added the reserved PCI IDs in order to try to make sure we had
working drivers in case we ever released products using these IDs
(since we had instances of this type of problem in the past). The
problem is that the patch only touched the macros used by
early-quirks.c and by the user space components that rely on
i915_pciids.h, it didn't touch the macros used by i915_pci.c. So we
correctly handled the stolen memory for these theoretical IDs, but we
didn't actually drive the devices from i915.ko.

So this patch fixes the original commit by actually making i915.ko
drive these IDs, which was the goal. There's no information on what
would be the GT count on these IDs, so we just go with the safer
intel_broadwell_info, at the risk of ignoring a possibly inexistent
BSD2_RING.

I did some checking, and it seems that these IDs are driven by
intel-gpu-tools, xf86-video-intel and libdrm (since they contain old
copies of i915_pciids.h), but they are not checked by mesa.

The alternative to this patch would be to just assume we're actually
never going to use these IDs, and then remove them from our ID lists
and make sure our user space components sync the latest i915_pciids.h
copy. I'm fine with either approaches, as long as we make sure that
every component tries to drive the same list of PCI IDs.

Fixes: fb7023e0e248 ("drm/i915: BDW: Adding Reserved PCI IDs.")
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1483473860-17644-3-git-send-email-paulo.r.zanoni@intel.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/i915/i915_pci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -421,6 +421,7 @@ static const struct pci_device_id pciidl
 	INTEL_VLV_IDS(&intel_valleyview_info),
 	INTEL_BDW_GT12_IDS(&intel_broadwell_info),
 	INTEL_BDW_GT3_IDS(&intel_broadwell_gt3_info),
+	INTEL_BDW_RSVD_IDS(&intel_broadwell_info),
 	INTEL_CHV_IDS(&intel_cherryview_info),
 	INTEL_SKL_GT1_IDS(&intel_skylake_info),
 	INTEL_SKL_GT2_IDS(&intel_skylake_info),

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

* [PATCH 4.10 073/110] ASoC: Intel: bytcr_rt5640: quirks for Insyde devices
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (70 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 072/110] drm/i915: actually drive the BDW reserved IDs Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 074/110] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Greg Kroah-Hartman
                   ` (37 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, youling257, Pierre-Louis Bossart,
	Mark Brown, Sasha Levin

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

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

From: youling257 <youling257@gmail.com>

[ Upstream commit 571800487837263e914ef68681e4ad6a57d49c7f ]

There are literally dozens of Insyde devices with a different
name but with the same audio routing. Use a generic quirk to
match on vendor name only to avoid recurring edits of the
same thing.

Signed-off-by: youling257 <youling257@gmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/soc/intel/boards/bytcr_rt5640.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -387,6 +387,16 @@ static const struct dmi_system_id byt_rt
 						 BYT_RT5640_SSP0_AIF1),
 
 	},
+	{
+		.callback = byt_rt5640_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
+		},
+		.driver_data = (unsigned long *)(BYT_RT5640_IN3_MAP |
+						 BYT_RT5640_MCLK_EN |
+						 BYT_RT5640_SSP0_AIF1),
+
+	},
 	{}
 };
 

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

* [PATCH 4.10 074/110] ARM: OMAP2+: Fix init for multiple quirks for the same SoC
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (71 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 073/110] ASoC: Intel: bytcr_rt5640: quirks for Insyde devices Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 075/110] usb: chipidea: msm: Rely on core to override AHBBURST Greg Kroah-Hartman
                   ` (36 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Tony Lindgren, Sasha Levin

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

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

From: Tony Lindgren <tony@atomide.com>

[ Upstream commit 6e613ebf4405fc09e2a8c16ed193b47f80a3cbed ]

It's possible that there are multiple quirks that need to be initialized
for the same SoC. Fix the issue by not returning on the first match.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/mach-omap2/pdata-quirks.c |    1 -
 1 file changed, 1 deletion(-)

--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -599,7 +599,6 @@ static void pdata_quirks_check(struct pd
 		if (of_machine_is_compatible(quirks->compatible)) {
 			if (quirks->fn)
 				quirks->fn();
-			break;
 		}
 		quirks++;
 	}

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

* [PATCH 4.10 075/110] usb: chipidea: msm: Rely on core to override AHBBURST
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (72 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 074/110] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 076/110] serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x Greg Kroah-Hartman
                   ` (35 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Peter Chen, Stephen Boyd, Sasha Levin

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

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

From: Stephen Boyd <stephen.boyd@linaro.org>

[ Upstream commit dd3749099cfa2c80039193c438b90f3160eaf7f9 ]

The core framework already handles setting this parameter with a
platform quirk. Add the appropriate flag so that we always set
AHBBURST to 0. Technically DT should be doing this, but we always
do it for msm chipidea devices so setting the flag in the driver
works just as well. If the burst needs to be anything besides 0,
we expect the 'ahb-burst-config' dts property to be present.

Acked-by: Peter Chen <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/chipidea/ci_hdrc_msm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -24,7 +24,6 @@ static void ci_hdrc_msm_notify_event(str
 	switch (event) {
 	case CI_HDRC_CONTROLLER_RESET_EVENT:
 		dev_dbg(dev, "CI_HDRC_CONTROLLER_RESET_EVENT received\n");
-		writel(0, USB_AHBBURST);
 		/* use AHB transactor, allow posted data writes */
 		writel(0x8, USB_AHBMODE);
 		usb_phy_init(ci->usb_phy);
@@ -47,7 +46,8 @@ static struct ci_hdrc_platform_data ci_h
 	.name			= "ci_hdrc_msm",
 	.capoffset		= DEF_CAPOFFSET,
 	.flags			= CI_HDRC_REGS_SHARED |
-				  CI_HDRC_DISABLE_STREAMING,
+				  CI_HDRC_DISABLE_STREAMING |
+				  CI_HDRC_OVERRIDE_AHB_BURST,
 
 	.notify_event		= ci_hdrc_msm_notify_event,
 };

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

* [PATCH 4.10 076/110] serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (73 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 075/110] usb: chipidea: msm: Rely on core to override AHBBURST Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks Greg Kroah-Hartman
                   ` (34 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Vignesh R, Tony Lindgren, Sasha Levin

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

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

From: Vignesh R <vigneshr@ti.com>

[ Upstream commit b6ffcf21082300519bc4f9c3d24f61207cc9eae4 ]

UART uses as EDMA as dma engine on AM437x SoC and therefore, requires
OMAP_DMA_TX_KICK quirk just like AM33xx. So, enable OMAP_DMA_TX_KICK
quirk for AM437x platform as well. While at that, drop use of
of_machine_is_compatible() and instead pass quirks via device data.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/8250/8250_omap.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1075,15 +1075,15 @@ static int omap8250_no_handle_irq(struct
 }
 
 static const u8 am3352_habit = OMAP_DMA_TX_KICK | UART_ERRATA_CLOCK_DISABLE;
-static const u8 am4372_habit = UART_ERRATA_CLOCK_DISABLE;
+static const u8 dra742_habit = UART_ERRATA_CLOCK_DISABLE;
 
 static const struct of_device_id omap8250_dt_ids[] = {
 	{ .compatible = "ti,omap2-uart" },
 	{ .compatible = "ti,omap3-uart" },
 	{ .compatible = "ti,omap4-uart" },
 	{ .compatible = "ti,am3352-uart", .data = &am3352_habit, },
-	{ .compatible = "ti,am4372-uart", .data = &am4372_habit, },
-	{ .compatible = "ti,dra742-uart", .data = &am4372_habit, },
+	{ .compatible = "ti,am4372-uart", .data = &am3352_habit, },
+	{ .compatible = "ti,dra742-uart", .data = &dra742_habit, },
 	{},
 };
 MODULE_DEVICE_TABLE(of, omap8250_dt_ids);
@@ -1218,9 +1218,6 @@ static int omap8250_probe(struct platfor
 			priv->omap8250_dma.rx_size = RX_TRIGGER;
 			priv->omap8250_dma.rxconf.src_maxburst = RX_TRIGGER;
 			priv->omap8250_dma.txconf.dst_maxburst = TX_TRIGGER;
-
-			if (of_machine_is_compatible("ti,am33xx"))
-				priv->habit |= OMAP_DMA_TX_KICK;
 			/*
 			 * pause is currently not supported atleast on omap-sdma
 			 * and edma on most earlier kernels.

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

* [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (74 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 076/110] serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-11  8:13   ` Sekhar Nori
  2017-04-10 16:43 ` [PATCH 4.10 079/110] usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  109 siblings, 1 reply; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Kevin Hilman, Sekhar Nori, Sasha Levin

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

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

From: Kevin Hilman <khilman@baylibre.com>

[ Upstream commit 9c9b1bc25291e275b04f758f2549c81e092954f5 ]

Add skeleton pdata-quirks for davinci.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
[nsekhar@ti.com: move changes to build pdata-quirks.c and call
		 to pdata_quirks_init() to this patch]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/mach-davinci/Makefile              |    2 -
 arch/arm/mach-davinci/da8xx-dt.c            |    1 
 arch/arm/mach-davinci/include/mach/common.h |    2 +
 arch/arm/mach-davinci/pdata-quirks.c        |   39 ++++++++++++++++++++++++++++
 4 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-davinci/pdata-quirks.c

--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC)			+= irq.o
 obj-$(CONFIG_CP_INTC)			+= cp_intc.o
 
 # Board specific
-obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o
+obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o pdata-quirks.o
 obj-$(CONFIG_MACH_DAVINCI_EVM)  	+= board-dm644x-evm.o
 obj-$(CONFIG_MACH_SFFSDR)		+= board-sffsdr.o
 obj-$(CONFIG_MACH_NEUROS_OSD2)		+= board-neuros-osd2.o
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -62,6 +62,7 @@ static void __init da850_init_machine(vo
 
 	of_platform_default_populate(NULL, da850_auxdata_lookup, NULL);
 	davinci_pm_init();
+	pdata_quirks_init();
 }
 
 static const char *const da850_boards_compat[] __initconst = {
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -102,6 +102,8 @@ int davinci_pm_init(void);
 static inline int davinci_pm_init(void) { return 0; }
 #endif
 
+void __init pdata_quirks_init(void);
+
 #define SRAM_SIZE	SZ_128K
 
 #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
--- /dev/null
+++ b/arch/arm/mach-davinci/pdata-quirks.c
@@ -0,0 +1,39 @@
+/*
+ * Legacy platform_data quirks
+ *
+ * Copyright (C) 2016 BayLibre, Inc
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+
+#include <mach/common.h>
+
+struct pdata_init {
+	const char *compatible;
+	void (*fn)(void);
+};
+
+static void pdata_quirks_check(struct pdata_init *quirks)
+{
+	while (quirks->compatible) {
+		if (of_machine_is_compatible(quirks->compatible)) {
+			if (quirks->fn)
+				quirks->fn();
+			break;
+		}
+		quirks++;
+	}
+}
+
+static struct pdata_init pdata_quirks[] __initdata = {
+	{ /* sentinel */ },
+};
+
+void __init pdata_quirks_init(void)
+{
+	pdata_quirks_check(pdata_quirks);
+}

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

* [PATCH 4.10 079/110] usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (75 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 080/110] usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Felipe Balbi, Roger Quadros,
	Mathias Nyman, Sasha Levin

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

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

From: Felipe Balbi <balbi@ti.com>

[ Upstream commit 21939f003ad09355d9c975735750bb22aa37d8de ]

In case 'quirk-broken-port-ped' property is passed in via device property,
we should enable the corresponding BROKEN_PED quirk flag for XHCI core.

[rogerq@ti.com] Updated code from platform data to device property
and added DT binding.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 Documentation/devicetree/bindings/usb/usb-xhci.txt |    1 +
 drivers/usb/host/xhci-plat.c                       |    3 +++
 2 files changed, 4 insertions(+)

--- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
+++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt
@@ -27,6 +27,7 @@ Required properties:
 Optional properties:
   - clocks: reference to a clock
   - usb3-lpm-capable: determines if platform is USB3 LPM capable
+  - quirk-broken-port-ped: set if the controller has broken port disable mechanism
 
 Example:
 	usb@f0931000 {
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -232,6 +232,9 @@ static int xhci_plat_probe(struct platfo
 	if (device_property_read_bool(&pdev->dev, "usb3-lpm-capable"))
 		xhci->quirks |= XHCI_LPM_SUPPORT;
 
+	if (device_property_read_bool(&pdev->dev, "quirk-broken-port-ped"))
+		xhci->quirks |= XHCI_BROKEN_PORT_PED;
+
 	hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
 	if (IS_ERR(hcd->usb_phy)) {
 		ret = PTR_ERR(hcd->usb_phy);

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

* [PATCH 4.10 080/110] usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (76 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 079/110] usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 081/110] drm/mga: remove device_is_agp callback Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Roger Quadros, Felipe Balbi, Sasha Levin

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

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

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

[ Upstream commit e42a5dbb8a3d14f5a35bffa3bf7dcb87883f767a ]

dwc3 revisions <=3.00a have a limitation where Port Disable command
doesn't work. Set the quirk-broken-port-ped property for such
controllers so XHCI core can do the necessary workaround.

[rogerq@ti.com] Updated code from platform data to device property.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc3/host.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -54,11 +54,12 @@ out:
 
 int dwc3_host_init(struct dwc3 *dwc)
 {
-	struct property_entry	props[2];
+	struct property_entry	props[3];
 	struct platform_device	*xhci;
 	int			ret, irq;
 	struct resource		*res;
 	struct platform_device	*dwc3_pdev = to_platform_device(dwc->dev);
+	int			prop_idx = 0;
 
 	irq = dwc3_host_get_irq(dwc);
 	if (irq < 0)
@@ -97,8 +98,22 @@ int dwc3_host_init(struct dwc3 *dwc)
 
 	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
 
-	if (dwc->usb3_lpm_capable) {
-		props[0].name = "usb3-lpm-capable";
+	if (dwc->usb3_lpm_capable)
+		props[prop_idx++].name = "usb3-lpm-capable";
+
+	/**
+	 * WORKAROUND: dwc3 revisions <=3.00a have a limitation
+	 * where Port Disable command doesn't work.
+	 *
+	 * The suggested workaround is that we avoid Port Disable
+	 * completely.
+	 *
+	 * This following flag tells XHCI to do just that.
+	 */
+	if (dwc->revision <= DWC3_REVISION_300A)
+		props[prop_idx++].name = "quirk-broken-port-ped";
+
+	if (prop_idx) {
 		ret = platform_device_add_properties(xhci, props);
 		if (ret) {
 			dev_err(dwc->dev, "failed to add properties to xHCI\n");

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

* [PATCH 4.10 081/110] drm/mga: remove device_is_agp callback
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (77 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 080/110] usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 082/110] PCI: Add ACS quirk for Intel Union Point Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alex Deucher, Daniel Vetter, Sasha Levin

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

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

[ Upstream commit 858b2c1bf820ebfba89c5e2867ab882bdb5b2f5a ]

It's only for a device quirk, and we might as well do that in the load
callback.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-10-daniel.vetter@ffwll.ch
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/mga/mga_dma.c |   20 +++++++++++++++++++-
 drivers/gpu/drm/mga/mga_drv.c |   37 -------------------------------------
 2 files changed, 19 insertions(+), 38 deletions(-)

--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -392,6 +392,24 @@ int mga_driver_load(struct drm_device *d
 	drm_mga_private_t *dev_priv;
 	int ret;
 
+	/* There are PCI versions of the G450.  These cards have the
+	 * same PCI ID as the AGP G450, but have an additional PCI-to-PCI
+	 * bridge chip.  We detect these cards, which are not currently
+	 * supported by this driver, by looking at the device ID of the
+	 * bus the "card" is on.  If vendor is 0x3388 (Hint Corp) and the
+	 * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
+	 * device.
+	 */
+	if ((dev->pdev->device == 0x0525) && dev->pdev->bus->self
+	    && (dev->pdev->bus->self->vendor == 0x3388)
+	    && (dev->pdev->bus->self->device == 0x0021)
+	    && dev->agp) {
+		/* FIXME: This should be quirked in the pci core, but oh well
+		 * the hw probably stopped existing. */
+		arch_phys_wc_del(dev->agp->agp_mtrr);
+		kfree(dev->agp);
+		dev->agp = NULL;
+	}
 	dev_priv = kzalloc(sizeof(drm_mga_private_t), GFP_KERNEL);
 	if (!dev_priv)
 		return -ENOMEM;
@@ -698,7 +716,7 @@ static int mga_do_pci_dma_bootstrap(stru
 static int mga_do_dma_bootstrap(struct drm_device *dev,
 				drm_mga_dma_bootstrap_t *dma_bs)
 {
-	const int is_agp = (dma_bs->agp_mode != 0) && drm_pci_device_is_agp(dev);
+	const int is_agp = (dma_bs->agp_mode != 0) && dev->agp;
 	int err;
 	drm_mga_private_t *const dev_priv =
 	    (drm_mga_private_t *) dev->dev_private;
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -37,8 +37,6 @@
 
 #include <drm/drm_pciids.h>
 
-static int mga_driver_device_is_agp(struct drm_device *dev);
-
 static struct pci_device_id pciidlist[] = {
 	mga_PCI_IDS
 };
@@ -66,7 +64,6 @@ static struct drm_driver driver = {
 	.lastclose = mga_driver_lastclose,
 	.set_busid = drm_pci_set_busid,
 	.dma_quiescent = mga_driver_dma_quiescent,
-	.device_is_agp = mga_driver_device_is_agp,
 	.get_vblank_counter = mga_get_vblank_counter,
 	.enable_vblank = mga_enable_vblank,
 	.disable_vblank = mga_disable_vblank,
@@ -107,37 +104,3 @@ module_exit(mga_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL and additional rights");
-
-/**
- * Determine if the device really is AGP or not.
- *
- * In addition to the usual tests performed by \c drm_device_is_agp, this
- * function detects PCI G450 cards that appear to the system exactly like
- * AGP G450 cards.
- *
- * \param dev   The device to be tested.
- *
- * \returns
- * If the device is a PCI G450, zero is returned.  Otherwise 2 is returned.
- */
-static int mga_driver_device_is_agp(struct drm_device *dev)
-{
-	const struct pci_dev *const pdev = dev->pdev;
-
-	/* There are PCI versions of the G450.  These cards have the
-	 * same PCI ID as the AGP G450, but have an additional PCI-to-PCI
-	 * bridge chip.  We detect these cards, which are not currently
-	 * supported by this driver, by looking at the device ID of the
-	 * bus the "card" is on.  If vendor is 0x3388 (Hint Corp) and the
-	 * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
-	 * device.
-	 */
-
-	if ((pdev->device == 0x0525) && pdev->bus->self
-	    && (pdev->bus->self->vendor == 0x3388)
-	    && (pdev->bus->self->device == 0x0021)) {
-		return 0;
-	}
-
-	return 2;
-}

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

* [PATCH 4.10 082/110] PCI: Add ACS quirk for Intel Union Point
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (78 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 081/110] drm/mga: remove device_is_agp callback Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 083/110] PCI: xgene: Fix double free on init error Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alex Williamson, Bjorn Helgaas, Sasha Levin

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

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

From: Alex Williamson <alex.williamson@redhat.com>

[ Upstream commit 7184f5b451cf3dc61de79091d235b5d2bba2782d ]

Intel 200-series chipsets have the same errata as 100-series: the ACS
capability doesn't follow the PCIe spec, the capability and control
registers are dwords rather than words.  Add PCIe root port device IDs to
existing quirk.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/quirks.c |   28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4151,15 +4151,35 @@ static int pci_quirk_intel_pch_acs(struc
  *
  * N.B. This doesn't fix what lspci shows.
  *
+ * The 100 series chipset specification update includes this as errata #23[3].
+ *
+ * The 200 series chipset (Union Point) has the same bug according to the
+ * specification update (Intel 200 Series Chipset Family Platform Controller
+ * Hub, Specification Update, January 2017, Revision 001, Document# 335194-001,
+ * Errata 22)[4].  Per the datasheet[5], root port PCI Device IDs for this
+ * chipset include:
+ *
+ * 0xa290-0xa29f PCI Express Root port #{0-16}
+ * 0xa2e7-0xa2ee PCI Express Root port #{17-24}
+ *
  * [1] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-2.html
  * [2] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-datasheet-vol-1.html
+ * [3] http://www.intel.com/content/www/us/en/chipsets/100-series-chipset-spec-update.html
+ * [4] http://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-spec-update.html
+ * [5] http://www.intel.com/content/www/us/en/chipsets/200-series-chipset-pch-datasheet-vol-1.html
  */
 static bool pci_quirk_intel_spt_pch_acs_match(struct pci_dev *dev)
 {
-	return pci_is_pcie(dev) &&
-		pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT &&
-		((dev->device & ~0xf) == 0xa110 ||
-		 (dev->device >= 0xa167 && dev->device <= 0xa16a));
+	if (!pci_is_pcie(dev) || pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT)
+		return false;
+
+	switch (dev->device) {
+	case 0xa110 ... 0xa11f: case 0xa167 ... 0xa16a: /* Sunrise Point */
+	case 0xa290 ... 0xa29f: case 0xa2e7 ... 0xa2ee: /* Union Point */
+		return true;
+	}
+
+	return false;
 }
 
 #define INTEL_SPT_ACS_CTRL (PCI_ACS_CAP + 4)

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

* [PATCH 4.10 083/110] PCI: xgene: Fix double free on init error
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (79 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 082/110] PCI: Add ACS quirk for Intel Union Point Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 084/110] [media] rx51: broken build Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dan Carpenter, Bjorn Helgaas,
	Tanmay Inamdar, Sasha Levin

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

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

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

[ Upstream commit 1ded56df3247d358390ae6dc09ccee620262ac5f ]

The "port" variable was allocated with devm_kzalloc() so if we free it with
kfree() it will be freed twice.  Also I changed it to propogate the error
from devm_ioremap_resource() instead of returning -ENOMEM.

Fixes: c5d460396100 ("PCI: Add MCFG quirks for X-Gene host controller")
Also-posted-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tanmay Inamdar <tinamdar@apm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/host/pci-xgene.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -246,14 +246,11 @@ static int xgene_pcie_ecam_init(struct p
 	ret = xgene_get_csr_resource(adev, &csr);
 	if (ret) {
 		dev_err(dev, "can't get CSR resource\n");
-		kfree(port);
 		return ret;
 	}
 	port->csr_base = devm_ioremap_resource(dev, &csr);
-	if (IS_ERR(port->csr_base)) {
-		kfree(port);
-		return -ENOMEM;
-	}
+	if (IS_ERR(port->csr_base))
+		return PTR_ERR(port->csr_base);
 
 	port->cfg_base = cfg->win;
 	port->version = ipversion;

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

* [PATCH 4.10 084/110] [media] rx51: broken build
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (80 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 083/110] PCI: xgene: Fix double free on init error Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-11 11:44   ` Sean Young
  2017-04-10 16:43 ` [PATCH 4.10 085/110] sata: ahci-da850: implement a workaround for the softreset quirk Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  109 siblings, 1 reply; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, kbuild test robot, Sean Young,
	Mauro Carvalho Chehab, Sasha Levin

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

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

From: Sean Young <sean@mess.org>

[ Upstream commit 922ee72da7c739157ed02ea04a5c100d19f67226 ]

As reported by kernel build test:

   In file included from arch/arm/mach-omap2/pdata-quirks.c:15:0:
>> arch/arm/mach-omap2/pdata-quirks.c:536:49: error: 'rx51_lirc_data' undeclared here (not in a function)
     OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
                                                    ^
   include/linux/of_platform.h:52:21: note: in definition of macro 'OF_DEV_AUXDATA'
       .platform_data = _pdata }
                        ^~~~~~

Since "a92def1 [media] ir-rx51: port to rc-core" the build fails on
some arm configurations.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/mach-omap2/pdata-quirks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -533,7 +533,7 @@ static struct of_dev_auxdata omap_auxdat
 		       &omap3_iommu_pdata),
 	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
 	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
-	OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
+	OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_ir_data),
 	/* Only on am3517 */
 	OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
 	OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",

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

* [PATCH 4.10 085/110] sata: ahci-da850: implement a workaround for the softreset quirk
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (81 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 084/110] [media] rx51: broken build Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 086/110] ACPI / button: Change default behavior to lid_init_state=open Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Bartosz Golaszewski, Tejun Heo,
	Sekhar Nori, Sasha Levin

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

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

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

[ Upstream commit f4d435f3265661d04e5290a0a0450e3a38898128 ]

There's an issue with the da850 SATA controller: if port multiplier
support is compiled in, but we're connecting the drive directly to
the SATA port on the board, the drive can't be detected.

To make SATA work on the da850-lcdk board: first try to softreset
with pmp - if the operation fails with -EBUSY, retry without pmp.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/ata/ahci_da850.c |   33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

--- a/drivers/ata/ahci_da850.c
+++ b/drivers/ata/ahci_da850.c
@@ -54,11 +54,42 @@ static void da850_sata_init(struct devic
 	writel(val, ahci_base + SATA_P0PHYCR_REG);
 }
 
+static int ahci_da850_softreset(struct ata_link *link,
+				unsigned int *class, unsigned long deadline)
+{
+	int pmp, ret;
+
+	pmp = sata_srst_pmp(link);
+
+	/*
+	 * There's an issue with the SATA controller on da850 SoCs: if we
+	 * enable Port Multiplier support, but the drive is connected directly
+	 * to the board, it can't be detected. As a workaround: if PMP is
+	 * enabled, we first call ahci_do_softreset() and pass it the result of
+	 * sata_srst_pmp(). If this call fails, we retry with pmp = 0.
+	 */
+	ret = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
+	if (pmp && ret == -EBUSY)
+		return ahci_do_softreset(link, class, 0,
+					 deadline, ahci_check_ready);
+
+	return ret;
+}
+
+static struct ata_port_operations ahci_da850_port_ops = {
+	.inherits = &ahci_platform_ops,
+	.softreset = ahci_da850_softreset,
+	/*
+	 * No need to override .pmp_softreset - it's only used for actual
+	 * PMP-enabled ports.
+	 */
+};
+
 static const struct ata_port_info ahci_da850_port_info = {
 	.flags		= AHCI_FLAG_COMMON,
 	.pio_mask	= ATA_PIO4,
 	.udma_mask	= ATA_UDMA6,
-	.port_ops	= &ahci_platform_ops,
+	.port_ops	= &ahci_da850_port_ops,
 };
 
 static struct scsi_host_template ahci_platform_sht = {

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

* [PATCH 4.10 086/110] ACPI / button: Change default behavior to lid_init_state=open
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (82 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 085/110] sata: ahci-da850: implement a workaround for the softreset quirk Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 087/110] ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10 Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Lv Zheng, Rafael J. Wysocki, Sasha Levin

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

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

From: Lv Zheng <lv.zheng@intel.com>

[ Upstream commit 77e9a4aa9de10cc1418bf9a892366988802a8025 ]

More and more platforms need the button.lid_init_state=open quirk. This
patch sets it the default behavior.

If a platform doesn't send lid open event or lid open event is lost due to
the underlying system problems, then we can compare various combinations:
1. systemd/acpid is used to suspend system or not, systemd has a special
   logic forcing open event after resuming;
2. _LID returns a cached value or not.

The result is as follows:

 1. lid_init_state=method
   1. cached
      1. resumed by lid:
         (x) event=close
         (x) systemd=suspends again
         (x) acpid=suspends again
         (x) state=close
      2. resumed by other:
         (o) event=close
         (x) systemd=suspends again
         (x) acpid=suspends again
         (o) state=close
   2. non-cached
      1. resumed by lid:
         (o) event=open
         (o) systemd=resumes
         (o) acpid=resumes
         (o) state=open
      2. resumed by other:
         (o) event=close
         (x) systemd=suspends again
         (x) acpid=suspends again
         (o) state=close
 2. lid_init_state=open
   1. cached
      1. resumed by lid:
         (o) event=open
         (o) systemd=resumes
         (o) acpid=resumes
         (x) state=close
      2. resumed by other:
         (x) event=open
         (o) systemd=resumes
         (o) acpid=resumes
         (o) state=close
   2. non-cached
      1. resumed by lid:
         (o) event=open
         (o) systemd=resumes
         (o) acpid=resumes
         (o) state=open
      2. resumed by other:
         (x) event=open
         (o) systemd=resumes
         (o) acpid=resumes
         (o) state=close
 3. lid_init_state=ignore
   1. cached
      1. resumed by lid:
         (o) event=none
         (x) systemd=suspends again
         (o) acpid=resumes
         (x) state=close
      2. resumed by other:
         (o) event=none
         (x) systemd=suspends again
         (o) acpid=resumes
         (o) state=close
   2. non-cached
      1. resumed by lid:
         (o) event=none
         (x) systemd=suspends again
         (o) acpid=resumes
         (o) state=open
      2. resumed by other:
         (o) event=none
         (x) systemd=suspends again
         (o) acpid=resumes
         (o) state=close

As a conclusion:
 1. With systemd changed, lid_init_state=ignore has only one problem and the
    problem comes from an underlying issue, not userspace and kernel lid
    handling.
 2. Without systemd changed, lid_init_state=open can be the default
    behavior as the pass ratio is not much worse than lid_init_state=ignore.
 3. lid_init_state=method is buggy, we can have a separate patch to make it
    deprectated.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=187271
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/acpi/button.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -113,7 +113,7 @@ struct acpi_button {
 
 static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier);
 static struct acpi_device *lid_device;
-static u8 lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
+static u8 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
 
 static unsigned long lid_report_interval __read_mostly = 500;
 module_param(lid_report_interval, ulong, 0644);

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

* [PATCH 4.10 087/110] ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (83 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 086/110] ACPI / button: Change default behavior to lid_init_state=open Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 088/110] ASoC: Intel: Baytrail: " Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Pierre-Louis Bossart, Mark Brown,
	Sasha Levin

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

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

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit 93ffeaa8ee3f10a0628ad135b552a2497e0bef2c ]

the BIOS incorrectly reports this codec as 5640 but it is
really a rt5670

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/soc/codecs/rt5670.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/soc/codecs/rt5670.c
+++ b/sound/soc/codecs/rt5670.c
@@ -2814,6 +2814,7 @@ MODULE_DEVICE_TABLE(i2c, rt5670_i2c_id);
 static const struct acpi_device_id rt5670_acpi_match[] = {
 	{ "10EC5670", 0},
 	{ "10EC5672", 0},
+	{ "10EC5640", 0}, /* quirk */
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, rt5670_acpi_match);

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

* [PATCH 4.10 088/110] ASoC: Intel: Baytrail: add quirk for Lenovo Thinkpad 10
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (84 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 087/110] ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10 Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 089/110] ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Pierre-Louis Bossart, Mark Brown,
	Sasha Levin

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

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

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit fd0138dc5d17c636477b371d99265c406437c583 ]

the BIOS reports this codec as RT5640 but it's a rt5670. Use the
quirk mechanism to use the cht_bsw_rt5672 machine driver

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/soc/intel/atom/sst/sst_acpi.c |   37 +++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -400,6 +400,7 @@ static int sst_acpi_remove(struct platfo
 static unsigned long cht_machine_id;
 
 #define CHT_SURFACE_MACH 1
+#define BYT_THINKPAD_10  2
 
 static int cht_surface_quirk_cb(const struct dmi_system_id *id)
 {
@@ -407,6 +408,23 @@ static int cht_surface_quirk_cb(const st
 	return 1;
 }
 
+static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id)
+{
+	cht_machine_id = BYT_THINKPAD_10;
+	return 1;
+}
+
+
+static const struct dmi_system_id byt_table[] = {
+	{
+		.callback = byt_thinkpad10_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "20C3001VHH"),
+		},
+	},
+	{ }
+};
 
 static const struct dmi_system_id cht_table[] = {
 	{
@@ -424,6 +442,10 @@ static struct sst_acpi_mach cht_surface_
 	"10EC5640", "cht-bsw-rt5645", "intel/fw_sst_22a8.bin", "cht-bsw", NULL,
 								&chv_platform_data };
 
+static struct sst_acpi_mach byt_thinkpad_10 = {
+	"10EC5640", "cht-bsw-rt5672", "intel/fw_sst_0f28.bin", "cht-bsw", NULL,
+	                                                        &byt_rvp_platform_data };
+
 static struct sst_acpi_mach *cht_quirk(void *arg)
 {
 	struct sst_acpi_mach *mach = arg;
@@ -436,8 +458,21 @@ static struct sst_acpi_mach *cht_quirk(v
 		return mach;
 }
 
+static struct sst_acpi_mach *byt_quirk(void *arg)
+{
+	struct sst_acpi_mach *mach = arg;
+
+	dmi_check_system(byt_table);
+
+	if (cht_machine_id == BYT_THINKPAD_10)
+		return &byt_thinkpad_10;
+	else
+		return mach;
+}
+
+
 static struct sst_acpi_mach sst_acpi_bytcr[] = {
-	{"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL,
+	{"10EC5640", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", byt_quirk,
 						&byt_rvp_platform_data },
 	{"10EC5642", "bytcr_rt5640", "intel/fw_sst_0f28.bin", "bytcr_rt5640", NULL,
 						&byt_rvp_platform_data },

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

* [PATCH 4.10 089/110] ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (85 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 088/110] ASoC: Intel: Baytrail: " Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 090/110] ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Pierre-Louis Bossart, Mark Brown,
	Sasha Levin

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

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

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit 42648c2270ca0c96935dfc5d0f5c4f8d2406cf75 ]

Fix classic issue of having multiple codecs listed in DSDT
but a single one actually enabled. The previous code did
not handle such errors and could also lead to uninitalized
configurations

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/soc/intel/boards/cht_bsw_rt5645.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -358,22 +358,32 @@ static int snd_cht_mc_probe(struct platf
 	struct sst_acpi_mach *mach;
 	const char *i2c_name = NULL;
 	int dai_index = 0;
+	bool found = false;
 
 	drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_ATOMIC);
 	if (!drv)
 		return -ENOMEM;
 
+	mach = (&pdev->dev)->platform_data;
+
 	for (i = 0; i < ARRAY_SIZE(snd_soc_cards); i++) {
-		if (acpi_dev_found(snd_soc_cards[i].codec_id)) {
+		if (acpi_dev_found(snd_soc_cards[i].codec_id) &&
+			(!strncmp(snd_soc_cards[i].codec_id, mach->id, 8))) {
 			dev_dbg(&pdev->dev,
 				"found codec %s\n", snd_soc_cards[i].codec_id);
 			card = snd_soc_cards[i].soc_card;
 			drv->acpi_card = &snd_soc_cards[i];
+			found = true;
 			break;
 		}
 	}
+
+	if (!found) {
+		dev_err(&pdev->dev, "No matching HID found in supported list\n");
+		return -ENODEV;
+	}
+
 	card->dev = &pdev->dev;
-	mach = card->dev->platform_data;
 	sprintf(drv->codec_name, "i2c-%s:00", drv->acpi_card->codec_id);
 
 	/* set correct codec name */

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

* [PATCH 4.10 090/110] ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (86 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 089/110] ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 091/110] ACPI: save NVS memory for Lenovo G50-45 Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Pierre-Louis Bossart, Mark Brown,
	Sasha Levin

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

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

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

[ Upstream commit a50477e55fff69e1028f25624ee9fc9182d59b1f ]

The existing code assumes a 19.2 MHz MCLK as the default
hardware configuration. This is valid for CherryTrail but
not for Baytrail.

Add explicit MCLK configuration to set the 19.2 clock on/off
depending on DAPM events.

This is a prerequisite step to enable devices with Baytrail
and RT5645 such as Asus X205TA

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/soc/intel/boards/cht_bsw_rt5645.c |   84 +++++++++++++++++++++++++++-----
 1 file changed, 71 insertions(+), 13 deletions(-)

--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -24,6 +24,9 @@
 #include <linux/acpi.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <asm/cpu_device_id.h>
+#include <asm/platform_sst_audio.h>
+#include <linux/clk.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
@@ -45,6 +48,7 @@ struct cht_mc_private {
 	struct snd_soc_jack jack;
 	struct cht_acpi_card *acpi_card;
 	char codec_name[16];
+	struct clk *mclk;
 };
 
 static inline struct snd_soc_dai *cht_get_codec_dai(struct snd_soc_card *card)
@@ -65,6 +69,7 @@ static int platform_clock_control(struct
 	struct snd_soc_dapm_context *dapm = w->dapm;
 	struct snd_soc_card *card = dapm->card;
 	struct snd_soc_dai *codec_dai;
+	struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
 	int ret;
 
 	codec_dai = cht_get_codec_dai(card);
@@ -73,19 +78,30 @@ static int platform_clock_control(struct
 		return -EIO;
 	}
 
-	if (!SND_SOC_DAPM_EVENT_OFF(event))
-		return 0;
+	if (SND_SOC_DAPM_EVENT_ON(event)) {
+		if (ctx->mclk) {
+			ret = clk_prepare_enable(ctx->mclk);
+			if (ret < 0) {
+				dev_err(card->dev,
+					"could not configure MCLK state");
+				return ret;
+			}
+		}
+	} else {
+		/* Set codec sysclk source to its internal clock because codec PLL will
+		 * be off when idle and MCLK will also be off when codec is
+		 * runtime suspended. Codec needs clock for jack detection and button
+		 * press. MCLK is turned off with clock framework or ACPI.
+		 */
+		ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_RCCLK,
+					48000 * 512, SND_SOC_CLOCK_IN);
+		if (ret < 0) {
+			dev_err(card->dev, "can't set codec sysclk: %d\n", ret);
+			return ret;
+		}
 
-	/* Set codec sysclk source to its internal clock because codec PLL will
-	 * be off when idle and MCLK will also be off by ACPI when codec is
-	 * runtime suspended. Codec needs clock for jack detection and button
-	 * press.
-	 */
-	ret = snd_soc_dai_set_sysclk(codec_dai, RT5645_SCLK_S_RCCLK,
-			0, SND_SOC_CLOCK_IN);
-	if (ret < 0) {
-		dev_err(card->dev, "can't set codec sysclk: %d\n", ret);
-		return ret;
+		if (ctx->mclk)
+			clk_disable_unprepare(ctx->mclk);
 	}
 
 	return 0;
@@ -97,7 +113,7 @@ static const struct snd_soc_dapm_widget
 	SND_SOC_DAPM_MIC("Int Mic", NULL),
 	SND_SOC_DAPM_SPK("Ext Spk", NULL),
 	SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0,
-			platform_clock_control, SND_SOC_DAPM_POST_PMD),
+			platform_clock_control, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
 };
 
 static const struct snd_soc_dapm_route cht_rt5645_audio_map[] = {
@@ -225,6 +241,26 @@ static int cht_codec_init(struct snd_soc
 
 	rt5645_set_jack_detect(codec, &ctx->jack, &ctx->jack, &ctx->jack);
 
+	if (ctx->mclk) {
+		/*
+		 * The firmware might enable the clock at
+		 * boot (this information may or may not
+		 * be reflected in the enable clock register).
+		 * To change the rate we must disable the clock
+		 * first to cover these cases. Due to common
+		 * clock framework restrictions that do not allow
+		 * to disable a clock that has not been enabled,
+		 * we need to enable the clock first.
+		 */
+		ret = clk_prepare_enable(ctx->mclk);
+		if (!ret)
+			clk_disable_unprepare(ctx->mclk);
+
+		ret = clk_set_rate(ctx->mclk, CHT_PLAT_CLK_3_HZ);
+
+		if (ret)
+			dev_err(runtime->dev, "unable to set MCLK rate\n");
+	}
 	return ret;
 }
 
@@ -349,6 +385,18 @@ static struct cht_acpi_card snd_soc_card
 
 static char cht_rt5640_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */
 
+static bool is_valleyview(void)
+{
+	static const struct x86_cpu_id cpu_ids[] = {
+		{ X86_VENDOR_INTEL, 6, 55 }, /* Valleyview, Bay Trail */
+		{}
+	};
+
+	if (!x86_match_cpu(cpu_ids))
+		return false;
+	return true;
+}
+
 static int snd_cht_mc_probe(struct platform_device *pdev)
 {
 	int ret_val = 0;
@@ -401,6 +449,16 @@ static int snd_cht_mc_probe(struct platf
 		cht_dailink[dai_index].codec_name = cht_rt5640_codec_name;
 	}
 
+	if (is_valleyview()) {
+		drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
+		if (IS_ERR(drv->mclk)) {
+			dev_err(&pdev->dev,
+				"Failed to get MCLK from pmc_plt_clk_3: %ld\n",
+				PTR_ERR(drv->mclk));
+			return PTR_ERR(drv->mclk);
+		}
+	}
+
 	snd_soc_card_set_drvdata(card, drv);
 	ret_val = devm_snd_soc_register_card(&pdev->dev, card);
 	if (ret_val) {

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

* [PATCH 4.10 091/110] ACPI: save NVS memory for Lenovo G50-45
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (87 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 090/110] ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 092/110] usb: musb: da8xx: Fix host mode suspend Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Przemek, Zhang Rui,
	Rafael J. Wysocki, Sasha Levin

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

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

From: Zhang Rui <rui.zhang@intel.com>

[ Upstream commit cbc00c1310d34139a63946482b40a6b261a03fb9 ]

In commit 821d6f0359b0 (ACPI / sleep: Do not save NVS for new machines to
accelerate S3), to optimize S3 suspend/resume speed, code is introduced
to ignore NVS memory saving during S3 for all the platforms later than
2012.

But, Lenovo G50-45, a platform released in 2015, still needs NVS memory
saving during S3. A quirk is introduced for this platform.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=189431
Tested-by: Przemek <soprwa@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[ rjw: Drop unnecessary code ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/acpi/sleep.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -130,6 +130,12 @@ void __init acpi_nvs_nosave_s3(void)
 	nvs_nosave_s3 = true;
 }
 
+static int __init init_nvs_save_s3(const struct dmi_system_id *d)
+{
+	nvs_nosave_s3 = false;
+	return 0;
+}
+
 /*
  * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
  * user to request that behavior by using the 'acpi_old_suspend_ordering'
@@ -324,6 +330,19 @@ static struct dmi_system_id acpisleep_dm
 		DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
 		},
 	},
+	/*
+	 * https://bugzilla.kernel.org/show_bug.cgi?id=189431
+	 * Lenovo G50-45 is a platform later than 2012, but needs nvs memory
+	 * saving during S3.
+	 */
+	{
+	.callback = init_nvs_save_s3,
+	.ident = "Lenovo G50-45",
+	.matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
+		},
+	},
 	{},
 };
 

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

* [PATCH 4.10 092/110] usb: musb: da8xx: Fix host mode suspend
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (88 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 091/110] ACPI: save NVS memory for Lenovo G50-45 Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 094/110] HID: wacom: dont apply generic settings to old devices Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alexandre Bailon, Bin Liu, Sasha Levin

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

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

From: Alexandre Bailon <abailon@baylibre.com>

[ Upstream commit 486fc20ac8391338a42b015801b846acda4db7b7 ]

On da8xx, VBUS is not maintained during suspend when musb is in host mode.
On resume, all the connected devices will be disconnected and then will
be enumerated again.
This happens because MUSB_DEVCTL is cleared during suspend.

Use the quirk MUSB_PRESERVE_SESSION to preseve MUSB_DEVCTL during suspend.

Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/musb/da8xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -458,7 +458,7 @@ static inline u8 get_vbus_power(struct d
 }
 
 static const struct musb_platform_ops da8xx_ops = {
-	.quirks		= MUSB_INDEXED_EP,
+	.quirks		= MUSB_INDEXED_EP | MUSB_PRESERVE_SESSION,
 	.init		= da8xx_musb_init,
 	.exit		= da8xx_musb_exit,
 

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

* [PATCH 4.10 094/110] HID: wacom: dont apply generic settings to old devices
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (89 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 092/110] usb: musb: da8xx: Fix host mode suspend Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 095/110] arm: kernel: Add SMC structure parameter Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ping Cheng, Jason Gerecke,
	Jiri Kosina, Sasha Levin

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

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

From: Ping Cheng <pinglinux@gmail.com>

[ Upstream commit e7deb1570a527d3c74be4e21a72b1b459605c501 ]

Non-generic devices have numbered_buttons set for both pen and
touch interfaces by default. The actual number of buttons on the
interface is normally manually decided later, which is different
from what those HID generic devices are processed, where number
of buttons are directly retrieved from HID descriptors.

This patch adds the missed HID_GENERIC check and moves the statement
to wacom_setup_pad_input_capabilities since it's not a quirk anymore.

Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hid/wacom_wac.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -3290,6 +3290,9 @@ int wacom_setup_pad_input_capabilities(s
 {
 	struct wacom_features *features = &wacom_wac->features;
 
+	if ((features->type == HID_GENERIC) && features->numbered_buttons > 0)
+		features->device_type |= WACOM_DEVICETYPE_PAD;
+
 	if (!(features->device_type & WACOM_DEVICETYPE_PAD))
 		return -ENODEV;
 

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

* [PATCH 4.10 095/110] arm: kernel: Add SMC structure parameter
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (90 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 094/110] HID: wacom: dont apply generic settings to old devices Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 096/110] firmware: qcom: scm: Fix interrupted SCM calls Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andy Gross, Will Deacon, Sasha Levin

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

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

From: Andy Gross <andy.gross@linaro.org>

[ Upstream commit 680a0873e193bae666439f4b5e32c758e68f114c ]

This patch adds a quirk parameter to the arm_smccc_(smc/hvc) calls.
The quirk structure allows for specialized SMC operations due to SoC
specific requirements.  The current arm_smccc_(smc/hvc) is renamed and
macros are used instead to specify the standard arm_smccc_(smc/hvc) or
the arm_smccc_(smc/hvc)_quirk function.

This patch and partial implementation was suggested by Will Deacon.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/kernel/armksyms.c      |    4 ++--
 arch/arm/kernel/smccc-call.S    |   14 ++++++++------
 arch/arm64/kernel/arm64ksyms.c  |    4 ++--
 arch/arm64/kernel/asm-offsets.c |    7 +++++--
 arch/arm64/kernel/smccc-call.S  |   14 ++++++++------
 include/linux/arm-smccc.h       |   40 ++++++++++++++++++++++++++++++++--------
 6 files changed, 57 insertions(+), 26 deletions(-)

--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -178,6 +178,6 @@ EXPORT_SYMBOL(__pv_offset);
 #endif
 
 #ifdef CONFIG_HAVE_ARM_SMCCC
-EXPORT_SYMBOL(arm_smccc_smc);
-EXPORT_SYMBOL(arm_smccc_hvc);
+EXPORT_SYMBOL(__arm_smccc_smc);
+EXPORT_SYMBOL(__arm_smccc_hvc);
 #endif
--- a/arch/arm/kernel/smccc-call.S
+++ b/arch/arm/kernel/smccc-call.S
@@ -46,17 +46,19 @@ UNWIND(	.fnend)
 /*
  * void smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
  *		  unsigned long a3, unsigned long a4, unsigned long a5,
- *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
+ *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
+ *		  struct arm_smccc_quirk *quirk)
  */
-ENTRY(arm_smccc_smc)
+ENTRY(__arm_smccc_smc)
 	SMCCC SMCCC_SMC
-ENDPROC(arm_smccc_smc)
+ENDPROC(__arm_smccc_smc)
 
 /*
  * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
  *		  unsigned long a3, unsigned long a4, unsigned long a5,
- *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
+ *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
+ *		  struct arm_smccc_quirk *quirk)
  */
-ENTRY(arm_smccc_hvc)
+ENTRY(__arm_smccc_hvc)
 	SMCCC SMCCC_HVC
-ENDPROC(arm_smccc_hvc)
+ENDPROC(__arm_smccc_hvc)
--- a/arch/arm64/kernel/arm64ksyms.c
+++ b/arch/arm64/kernel/arm64ksyms.c
@@ -73,5 +73,5 @@ NOKPROBE_SYMBOL(_mcount);
 #endif
 
 	/* arm-smccc */
-EXPORT_SYMBOL(arm_smccc_smc);
-EXPORT_SYMBOL(arm_smccc_hvc);
+EXPORT_SYMBOL(__arm_smccc_smc);
+EXPORT_SYMBOL(__arm_smccc_hvc);
--- a/arch/arm64/kernel/asm-offsets.c
+++ b/arch/arm64/kernel/asm-offsets.c
@@ -143,8 +143,11 @@ int main(void)
   DEFINE(SLEEP_STACK_DATA_SYSTEM_REGS,	offsetof(struct sleep_stack_data, system_regs));
   DEFINE(SLEEP_STACK_DATA_CALLEE_REGS,	offsetof(struct sleep_stack_data, callee_saved_regs));
 #endif
-  DEFINE(ARM_SMCCC_RES_X0_OFFS,	offsetof(struct arm_smccc_res, a0));
-  DEFINE(ARM_SMCCC_RES_X2_OFFS,	offsetof(struct arm_smccc_res, a2));
+  DEFINE(ARM_SMCCC_RES_X0_OFFS,		offsetof(struct arm_smccc_res, a0));
+  DEFINE(ARM_SMCCC_RES_X2_OFFS,		offsetof(struct arm_smccc_res, a2));
+  DEFINE(ARM_SMCCC_QUIRK_ID_OFFS,	offsetof(struct arm_smccc_quirk, id));
+  DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS,	offsetof(struct arm_smccc_quirk, state));
+
   BLANK();
   DEFINE(HIBERN_PBE_ORIG,	offsetof(struct pbe, orig_address));
   DEFINE(HIBERN_PBE_ADDR,	offsetof(struct pbe, address));
--- a/arch/arm64/kernel/smccc-call.S
+++ b/arch/arm64/kernel/smccc-call.S
@@ -27,17 +27,19 @@
 /*
  * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
  *		  unsigned long a3, unsigned long a4, unsigned long a5,
- *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
+ *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
+ *		  struct arm_smccc_quirk *quirk)
  */
-ENTRY(arm_smccc_smc)
+ENTRY(__arm_smccc_smc)
 	SMCCC	smc
-ENDPROC(arm_smccc_smc)
+ENDPROC(__arm_smccc_smc)
 
 /*
  * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
  *		  unsigned long a3, unsigned long a4, unsigned long a5,
- *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
+ *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
+ *		  struct arm_smccc_quirk *quirk)
  */
-ENTRY(arm_smccc_hvc)
+ENTRY(__arm_smccc_hvc)
 	SMCCC	hvc
-ENDPROC(arm_smccc_hvc)
+ENDPROC(__arm_smccc_hvc)
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -72,33 +72,57 @@ struct arm_smccc_res {
 };
 
 /**
- * arm_smccc_smc() - make SMC calls
+ * struct arm_smccc_quirk - Contains quirk information
+ * @id: quirk identification
+ * @state: quirk specific information
+ * @a6: Qualcomm quirk entry for returning post-smc call contents of a6
+ */
+struct arm_smccc_quirk {
+	int	id;
+	union {
+		unsigned long a6;
+	} state;
+};
+
+/**
+ * __arm_smccc_smc() - make SMC calls
  * @a0-a7: arguments passed in registers 0 to 7
  * @res: result values from registers 0 to 3
+ * @quirk: points to an arm_smccc_quirk, or NULL when no quirks are required.
  *
  * This function is used to make SMC calls following SMC Calling Convention.
  * The content of the supplied param are copied to registers 0 to 7 prior
  * to the SMC instruction. The return values are updated with the content
- * from register 0 to 3 on return from the SMC instruction.
+ * from register 0 to 3 on return from the SMC instruction.  An optional
+ * quirk structure provides vendor specific behavior.
  */
-asmlinkage void arm_smccc_smc(unsigned long a0, unsigned long a1,
+asmlinkage void __arm_smccc_smc(unsigned long a0, unsigned long a1,
 			unsigned long a2, unsigned long a3, unsigned long a4,
 			unsigned long a5, unsigned long a6, unsigned long a7,
-			struct arm_smccc_res *res);
+			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk);
 
 /**
- * arm_smccc_hvc() - make HVC calls
+ * __arm_smccc_hvc() - make HVC calls
  * @a0-a7: arguments passed in registers 0 to 7
  * @res: result values from registers 0 to 3
  *
  * This function is used to make HVC calls following SMC Calling
  * Convention.  The content of the supplied param are copied to registers 0
  * to 7 prior to the HVC instruction. The return values are updated with
- * the content from register 0 to 3 on return from the HVC instruction.
+ * the content from register 0 to 3 on return from the HVC instruction.  An
+ * optional quirk structure provides vendor specific behavior.
  */
-asmlinkage void arm_smccc_hvc(unsigned long a0, unsigned long a1,
+asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
 			unsigned long a2, unsigned long a3, unsigned long a4,
 			unsigned long a5, unsigned long a6, unsigned long a7,
-			struct arm_smccc_res *res);
+			struct arm_smccc_res *res, struct arm_smccc_quirk *quirk);
+
+#define arm_smccc_smc(...) __arm_smccc_smc(__VA_ARGS__, NULL)
+
+#define arm_smccc_smc_quirk(...) __arm_smccc_smc(__VA_ARGS__)
+
+#define arm_smccc_hvc(...) __arm_smccc_hvc(__VA_ARGS__, NULL)
+
+#define arm_smccc_hvc_quirk(...) __arm_smccc_hvc(__VA_ARGS__)
 
 #endif /*__LINUX_ARM_SMCCC_H*/

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

* [PATCH 4.10 096/110] firmware: qcom: scm: Fix interrupted SCM calls
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (91 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 095/110] arm: kernel: Add SMC structure parameter Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 097/110] ARM: smccc: Update HVC comment to describe new quirk parameter Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andy Gross, Will Deacon, Sasha Levin

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

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

From: Andy Gross <andy.gross@linaro.org>

[ Upstream commit 82bcd087029f6056506ea929f11af02622230901 ]

This patch adds a Qualcomm specific quirk to the arm_smccc_smc call.

On Qualcomm ARM64 platforms, the SMC call can return before it has
completed.  If this occurs, the call can be restarted, but it requires
using the returned session ID value from the interrupted SMC call.

The quirk stores off the session ID from the interrupted call in the
quirk structure so that it can be used by the caller.

This patch folds in a fix given by Sricharan R:
https://lkml.org/lkml/2016/9/28/272

Signed-off-by: Andy Gross <andy.gross@linaro.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/kernel/smccc-call.S |    9 ++++++++-
 drivers/firmware/qcom_scm-64.c |   13 ++++++++++---
 include/linux/arm-smccc.h      |   11 ++++++++---
 3 files changed, 26 insertions(+), 7 deletions(-)

--- a/arch/arm64/kernel/smccc-call.S
+++ b/arch/arm64/kernel/smccc-call.S
@@ -12,6 +12,7 @@
  *
  */
 #include <linux/linkage.h>
+#include <linux/arm-smccc.h>
 #include <asm/asm-offsets.h>
 
 	.macro SMCCC instr
@@ -20,7 +21,13 @@
 	ldr	x4, [sp]
 	stp	x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
 	stp	x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
-	ret
+	ldr	x4, [sp, #8]
+	cbz	x4, 1f /* no quirk structure */
+	ldr	x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
+	cmp	x9, #ARM_SMCCC_QUIRK_QCOM_A6
+	b.ne	1f
+	str	x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
+1:	ret
 	.cfi_endproc
 	.endm
 
--- a/drivers/firmware/qcom_scm-64.c
+++ b/drivers/firmware/qcom_scm-64.c
@@ -91,6 +91,7 @@ static int qcom_scm_call(struct device *
 	dma_addr_t args_phys = 0;
 	void *args_virt = NULL;
 	size_t alloc_len;
+	struct arm_smccc_quirk quirk = {.id = ARM_SMCCC_QUIRK_QCOM_A6};
 
 	if (unlikely(arglen > N_REGISTER_ARGS)) {
 		alloc_len = N_EXT_QCOM_SCM_ARGS * sizeof(u64);
@@ -131,10 +132,16 @@ static int qcom_scm_call(struct device *
 					 qcom_smccc_convention,
 					 ARM_SMCCC_OWNER_SIP, fn_id);
 
+		quirk.state.a6 = 0;
+
 		do {
-			arm_smccc_smc(cmd, desc->arginfo, desc->args[0],
-				      desc->args[1], desc->args[2], x5, 0, 0,
-				      res);
+			arm_smccc_smc_quirk(cmd, desc->arginfo, desc->args[0],
+				      desc->args[1], desc->args[2], x5,
+				      quirk.state.a6, 0, res, &quirk);
+
+			if (res->a0 == QCOM_SCM_INTERRUPTED)
+				cmd = res->a0;
+
 		} while (res->a0 == QCOM_SCM_INTERRUPTED);
 
 		mutex_unlock(&qcom_scm_lock);
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -14,9 +14,6 @@
 #ifndef __LINUX_ARM_SMCCC_H
 #define __LINUX_ARM_SMCCC_H
 
-#include <linux/linkage.h>
-#include <linux/types.h>
-
 /*
  * This file provides common defines for ARM SMC Calling Convention as
  * specified in
@@ -60,6 +57,13 @@
 #define ARM_SMCCC_OWNER_TRUSTED_OS	50
 #define ARM_SMCCC_OWNER_TRUSTED_OS_END	63
 
+#define ARM_SMCCC_QUIRK_NONE		0
+#define ARM_SMCCC_QUIRK_QCOM_A6		1 /* Save/restore register a6 */
+
+#ifndef __ASSEMBLY__
+
+#include <linux/linkage.h>
+#include <linux/types.h>
 /**
  * struct arm_smccc_res - Result from SMC/HVC call
  * @a0-a3 result values from registers 0 to 3
@@ -125,4 +129,5 @@ asmlinkage void __arm_smccc_hvc(unsigned
 
 #define arm_smccc_hvc_quirk(...) __arm_smccc_hvc(__VA_ARGS__)
 
+#endif /*__ASSEMBLY__*/
 #endif /*__LINUX_ARM_SMCCC_H*/

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

* [PATCH 4.10 097/110] ARM: smccc: Update HVC comment to describe new quirk parameter
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (92 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 096/110] firmware: qcom: scm: Fix interrupted SCM calls Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 098/110] PCI: Add Broadcom Northstar2 PAXC quirk for device class and MPSS Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Will Deacon, Sasha Levin

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

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

From: Will Deacon <will.deacon@arm.com>

[ Upstream commit 3046ec674d441562c6bb3e4284cd866743042ef3 ]

Commit 680a0873e193 ("arm: kernel: Add SMC structure parameter") added
a new "quirk" parameter to the SMC and HVC SMCCC backends, but only
updated the comment for the SMC version. This patch adds the new
paramater to the comment describing the HVC version too.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/arm-smccc.h |    1 +
 1 file changed, 1 insertion(+)

--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -109,6 +109,7 @@ asmlinkage void __arm_smccc_smc(unsigned
  * __arm_smccc_hvc() - make HVC calls
  * @a0-a7: arguments passed in registers 0 to 7
  * @res: result values from registers 0 to 3
+ * @quirk: points to an arm_smccc_quirk, or NULL when no quirks are required.
  *
  * This function is used to make HVC calls following SMC Calling
  * Convention.  The content of the supplied param are copied to registers 0

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

* [PATCH 4.10 098/110] PCI: Add Broadcom Northstar2 PAXC quirk for device class and MPSS
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (93 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 097/110] ARM: smccc: Update HVC comment to describe new quirk parameter Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 099/110] PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jon Mason, Bjorn Helgaas, Sasha Levin

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

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

From: Jon Mason <jon.mason@broadcom.com>

[ Upstream commit ce709f86501a013e941e9986cb072eae375ddf3e ]

The Broadcom Northstar2 SoC has a number of quirks for the PAXC
(internal/fake) PCI bus.  Specifically, the PCI config space is shared
between the root port and the first PF (ie., PF0), and a number of fields
are tied to zero (thus preventing them from being set).  These cannot be
"fixed" in device firmware, so we must fix them with a quirk.

Signed-off-by: Jon Mason <jon.mason@broadcom.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/quirks.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2240,6 +2240,27 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_B
 			 PCI_DEVICE_ID_TIGON3_5719,
 			 quirk_brcm_5719_limit_mrrs);
 
+#ifdef CONFIG_PCIE_IPROC_PLATFORM
+static void quirk_paxc_bridge(struct pci_dev *pdev)
+{
+	/* The PCI config space is shared with the PAXC root port and the first
+	 * Ethernet device.  So, we need to workaround this by telling the PCI
+	 * code that the bridge is not an Ethernet device.
+	 */
+	if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE)
+		pdev->class = PCI_CLASS_BRIDGE_PCI << 8;
+
+	/* MPSS is not being set properly (as it is currently 0).  This is
+	 * because that area of the PCI config space is hard coded to zero, and
+	 * is not modifiable by firmware.  Set this to 2 (e.g., 512 byte MPS)
+	 * so that the MPS can be set to the real max value.
+	 */
+	pdev->pcie_mpss = 2;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16cd, quirk_paxc_bridge);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge);
+#endif
+
 /* Originally in EDAC sources for i82875P:
  * Intel tells BIOS developers to hide device 6 which
  * configures the overflow device access containing

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

* [PATCH 4.10 099/110] PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (94 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 098/110] PCI: Add Broadcom Northstar2 PAXC quirk for device class and MPSS Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 100/110] mmc: sdhci-of-esdhc: remove default broken-cd for ARM Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dongdong Liu, Bjorn Helgaas,
	Gabriele Paoloni, Zhou Wang, Sasha Levin

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

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

From: Dongdong Liu <liudongdong3@huawei.com>

[ Upstream commit 72f2ff0deb870145a5a2d24cd75b4f9936159a62 ]

The PCIe Root Port in Hip06/Hip07 SoCs advertises an MSI capability, but it
cannot generate MSIs.  It can transfer MSI/MSI-X from downstream devices,
but does not support MSI/MSI-X itself.

Add a quirk to prevent use of MSI/MSI-X by the Root Port.

[bhelgaas: changelog, sort vendor ID #define, drop device ID #define]
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/quirks.c    |    1 +
 include/linux/pci_ids.h |    2 ++
 2 files changed, 3 insertions(+)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1634,6 +1634,7 @@ static void quirk_pcie_mch(struct pci_de
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7520_MCH,	quirk_pcie_mch);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7320_MCH,	quirk_pcie_mch);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7525_MCH,	quirk_pcie_mch);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_HUAWEI,	0x1610,	quirk_pcie_mch);
 
 
 /*
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2516,6 +2516,8 @@
 #define PCI_DEVICE_ID_KORENIX_JETCARDF2	0x1700
 #define PCI_DEVICE_ID_KORENIX_JETCARDF3	0x17ff
 
+#define PCI_VENDOR_ID_HUAWEI         	0x19e5
+
 #define PCI_VENDOR_ID_NETRONOME		0x19ee
 #define PCI_DEVICE_ID_NETRONOME_NFP3200	0x3200
 #define PCI_DEVICE_ID_NETRONOME_NFP3240	0x3240

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

* [PATCH 4.10 100/110] mmc: sdhci-of-esdhc: remove default broken-cd for ARM
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (95 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 099/110] PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 101/110] PCI: Sort the list of devices with D3 delay quirk by ID Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Yangbo Lu, Adrian Hunter,
	Ulf Hansson, Sasha Levin

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

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

From: yangbo lu <yangbo.lu@nxp.com>

[ Upstream commit e9acc77dd046b22c7ebf70e35f68968978445f8b ]

Initially all QorIQ platforms were PowerPC architecture and they didn't
support card detection except several platforms. The driver added the
quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION as default and this made broken-cd
property in dts node didn't work. Now QorIQ platform turns to ARM
architecture and most of them could support card detection. However it's
a large number of dts trees that need to be fixed with broken-cd if we
remove the default SDHCI_QUIRK_BROKEN_CARD_DETECTION in driver. And the
users don't want to see this. So this patch is to remove this default
quirk just for ARM and keep it for PowerPC.(Note, QorIQ PowerPC platform
only has big-endian eSDHC while QorIQ ARM platform has big-endian or
little-endian eSDHC) This makes broken-cd property work again for ARM.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/mmc/host/sdhci-of-esdhc.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -569,16 +569,19 @@ static const struct sdhci_ops sdhci_esdh
 };
 
 static const struct sdhci_pltfm_data sdhci_esdhc_be_pdata = {
-	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
-		| SDHCI_QUIRK_NO_CARD_NO_RESET
-		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+	.quirks = ESDHC_DEFAULT_QUIRKS |
+#ifdef CONFIG_PPC
+		  SDHCI_QUIRK_BROKEN_CARD_DETECTION |
+#endif
+		  SDHCI_QUIRK_NO_CARD_NO_RESET |
+		  SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
 	.ops = &sdhci_esdhc_be_ops,
 };
 
 static const struct sdhci_pltfm_data sdhci_esdhc_le_pdata = {
-	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
-		| SDHCI_QUIRK_NO_CARD_NO_RESET
-		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+	.quirks = ESDHC_DEFAULT_QUIRKS |
+		  SDHCI_QUIRK_NO_CARD_NO_RESET |
+		  SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
 	.ops = &sdhci_esdhc_le_ops,
 };
 
@@ -643,8 +646,7 @@ static int sdhci_esdhc_probe(struct plat
 	    of_device_is_compatible(np, "fsl,p5020-esdhc") ||
 	    of_device_is_compatible(np, "fsl,p4080-esdhc") ||
 	    of_device_is_compatible(np, "fsl,p1020-esdhc") ||
-	    of_device_is_compatible(np, "fsl,t1040-esdhc") ||
-	    of_device_is_compatible(np, "fsl,ls1021a-esdhc"))
+	    of_device_is_compatible(np, "fsl,t1040-esdhc"))
 		host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
 
 	if (of_device_is_compatible(np, "fsl,ls1021a-esdhc"))

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

* [PATCH 4.10 101/110] PCI: Sort the list of devices with D3 delay quirk by ID
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (96 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 100/110] mmc: sdhci-of-esdhc: remove default broken-cd for ARM Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 102/110] PCI: Add ACS quirk for Qualcomm QDF2400 and QDF2432 Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Andy Shevchenko, Bjorn Helgaas, Sasha Levin

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

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

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

[ Upstream commit cd3e2eb8905d14fe28a2fc75362b8ecec16f0fb6 ]

Sort the list of Intel devices that have no PCI D3 delay by ID.  Add a
comment for group of devices that had not been marked yet.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/quirks.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3136,30 +3136,32 @@ static void quirk_remove_d3_delay(struct
 {
 	dev->d3_delay = 0;
 }
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0c00, quirk_remove_d3_delay);
+/* C600 Series devices do not need 10ms d3_delay */
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0412, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0c00, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0c0c, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c31, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c3a, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c3d, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c2d, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c20, quirk_remove_d3_delay);
+/* Lynxpoint-H PCH devices do not need 10ms d3_delay */
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c02, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c18, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c1c, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c20, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c22, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c26, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c2d, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c31, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c3a, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c3d, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c4e, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c02, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c22, quirk_remove_d3_delay);
 /* Intel Cherrytrail devices do not need 10ms d3_delay */
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2280, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2298, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x229c, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22b0, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22b5, quirk_remove_d3_delay);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22b7, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22b8, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22d8, quirk_remove_d3_delay);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22dc, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22b5, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x22b7, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2298, quirk_remove_d3_delay);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x229c, quirk_remove_d3_delay);
 
 /*
  * Some devices may pass our check in pci_intx_mask_supported() if

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

* [PATCH 4.10 102/110] PCI: Add ACS quirk for Qualcomm QDF2400 and QDF2432
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (97 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 101/110] PCI: Sort the list of devices with D3 delay quirk by ID Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 103/110] watchdog: s3c2410: Fix infinite interrupt in soft mode Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sinan Kaya, Bjorn Helgaas,
	Alex Williamson, Sasha Levin

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

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

From: Sinan Kaya <okaya@codeaurora.org>

[ Upstream commit 33be632b8443b6ac74aa293504f430604fb9abeb ]

The Qualcomm QDF2xxx root ports don't advertise an ACS capability, but they
do provide ACS-like features to disable peer transactions and validate bus
numbers in requests.

To be specific:
* Hardware supports source validation but it will report the issue as
Completer Abort instead of ACS Violation.

* Hardware doesn't support peer-to-peer and each root port is a root
complex with unique segment numbers.

* It is not possible for one root port to pass traffic to the other root
port.  All PCIe transactions are terminated inside the root port.

Add an ACS quirk for the QDF2400 and QDF2432 products.

[bhelgaas: changelog]
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/quirks.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4161,6 +4161,26 @@ static int pci_quirk_intel_pch_acs(struc
 }
 
 /*
+ * These QCOM root ports do provide ACS-like features to disable peer
+ * transactions and validate bus numbers in requests, but do not provide an
+ * actual PCIe ACS capability.  Hardware supports source validation but it
+ * will report the issue as Completer Abort instead of ACS Violation.
+ * Hardware doesn't support peer-to-peer and each root port is a root
+ * complex with unique segment numbers.  It is not possible for one root
+ * port to pass traffic to another root port.  All PCIe transactions are
+ * terminated inside the root port.
+ */
+static int pci_quirk_qcom_rp_acs(struct pci_dev *dev, u16 acs_flags)
+{
+	u16 flags = (PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF | PCI_ACS_SV);
+	int ret = acs_flags & ~flags ? 0 : 1;
+
+	dev_info(&dev->dev, "Using QCOM ACS Quirk (%d)\n", ret);
+
+	return ret;
+}
+
+/*
  * Sunrise Point PCH root ports implement ACS, but unfortunately as shown in
  * the datasheet (Intel 100 Series Chipset Family PCH Datasheet, Vol. 2,
  * 12.1.46, 12.1.47)[1] this chipset uses dwords for the ACS capability and
@@ -4316,6 +4336,9 @@ static const struct pci_dev_acs_enabled
 	/* I219 */
 	{ PCI_VENDOR_ID_INTEL, 0x15b7, pci_quirk_mf_endpoint_acs },
 	{ PCI_VENDOR_ID_INTEL, 0x15b8, pci_quirk_mf_endpoint_acs },
+	/* QCOM QDF2xxx root ports */
+	{ 0x17cb, 0x400, pci_quirk_qcom_rp_acs },
+	{ 0x17cb, 0x401, pci_quirk_qcom_rp_acs },
 	/* Intel PCH root ports */
 	{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs },
 	{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_spt_pch_acs },

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

* [PATCH 4.10 103/110] watchdog: s3c2410: Fix infinite interrupt in soft mode
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (98 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 102/110] PCI: Add ACS quirk for Qualcomm QDF2400 and QDF2432 Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 105/110] tools/power turbostat: decode Baytrail CC6 and MC6 demotion configuration Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Krzysztof Kozlowski, Guenter Roeck,
	Sasha Levin

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

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

From: Krzysztof Kozlowski <krzk@kernel.org>

[ Upstream commit 0b445549ea6f91ffea78a976fe89b932db6e077a ]

In soft (no-reboot) mode, the driver self-pings watchdog upon expiration
of an interrupt.  However the interrupt itself was not cleared thus on
first hit, the system enters infinite interrupt handling loop.

On Odroid U3 (Exynos4412), when booted with s3c2410_wdt.soft_noboot=1
argument the console is flooded:
	# killall -9 watchdog
	[   60.523760] s3c2410-wdt 10060000.watchdog: watchdog timer expired (irq)
	[   60.536744] s3c2410-wdt 10060000.watchdog: watchdog timer expired (irq)

Fix this by writing something to the WTCLRINT register to clear the
interrupt.  The register WTCLRINT however appeared in S3C6410 so a new
watchdog quirk and flavor are needed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 Documentation/devicetree/bindings/watchdog/samsung-wdt.txt |    9 +++--
 drivers/watchdog/s3c2410_wdt.c                             |   21 +++++++++++--
 2 files changed, 23 insertions(+), 7 deletions(-)

--- a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt
@@ -6,10 +6,11 @@ occurred.
 
 Required properties:
 - compatible : should be one among the following
-	(a) "samsung,s3c2410-wdt" for Exynos4 and previous SoCs
-	(b) "samsung,exynos5250-wdt" for Exynos5250
-	(c) "samsung,exynos5420-wdt" for Exynos5420
-	(c) "samsung,exynos7-wdt" for Exynos7
+	- "samsung,s3c2410-wdt" for S3C2410
+	- "samsung,s3c6410-wdt" for S3C6410, S5PV210 and Exynos4
+	- "samsung,exynos5250-wdt" for Exynos5250
+	- "samsung,exynos5420-wdt" for Exynos5420
+	- "samsung,exynos7-wdt" for Exynos7
 
 - reg : base physical address of the controller and length of memory mapped
 	region.
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -46,6 +46,7 @@
 #define S3C2410_WTCON		0x00
 #define S3C2410_WTDAT		0x04
 #define S3C2410_WTCNT		0x08
+#define S3C2410_WTCLRINT	0x0c
 
 #define S3C2410_WTCNT_MAXCNT	0xffff
 
@@ -72,6 +73,7 @@
 #define EXYNOS5_WDT_MASK_RESET_REG_OFFSET	0x040c
 #define QUIRK_HAS_PMU_CONFIG			(1 << 0)
 #define QUIRK_HAS_RST_STAT			(1 << 1)
+#define QUIRK_HAS_WTCLRINT_REG			(1 << 2)
 
 /* These quirks require that we have a PMU register map */
 #define QUIRKS_HAVE_PMUREG			(QUIRK_HAS_PMU_CONFIG | \
@@ -143,13 +145,18 @@ static const struct s3c2410_wdt_variant
 };
 
 #ifdef CONFIG_OF
+static const struct s3c2410_wdt_variant drv_data_s3c6410 = {
+	.quirks = QUIRK_HAS_WTCLRINT_REG,
+};
+
 static const struct s3c2410_wdt_variant drv_data_exynos5250  = {
 	.disable_reg = EXYNOS5_WDT_DISABLE_REG_OFFSET,
 	.mask_reset_reg = EXYNOS5_WDT_MASK_RESET_REG_OFFSET,
 	.mask_bit = 20,
 	.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
 	.rst_stat_bit = 20,
-	.quirks = QUIRK_HAS_PMU_CONFIG | QUIRK_HAS_RST_STAT,
+	.quirks = QUIRK_HAS_PMU_CONFIG | QUIRK_HAS_RST_STAT \
+		  | QUIRK_HAS_WTCLRINT_REG,
 };
 
 static const struct s3c2410_wdt_variant drv_data_exynos5420 = {
@@ -158,7 +165,8 @@ static const struct s3c2410_wdt_variant
 	.mask_bit = 0,
 	.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
 	.rst_stat_bit = 9,
-	.quirks = QUIRK_HAS_PMU_CONFIG | QUIRK_HAS_RST_STAT,
+	.quirks = QUIRK_HAS_PMU_CONFIG | QUIRK_HAS_RST_STAT \
+		  | QUIRK_HAS_WTCLRINT_REG,
 };
 
 static const struct s3c2410_wdt_variant drv_data_exynos7 = {
@@ -167,12 +175,15 @@ static const struct s3c2410_wdt_variant
 	.mask_bit = 23,
 	.rst_stat_reg = EXYNOS5_RST_STAT_REG_OFFSET,
 	.rst_stat_bit = 23,	/* A57 WDTRESET */
-	.quirks = QUIRK_HAS_PMU_CONFIG | QUIRK_HAS_RST_STAT,
+	.quirks = QUIRK_HAS_PMU_CONFIG | QUIRK_HAS_RST_STAT \
+		  | QUIRK_HAS_WTCLRINT_REG,
 };
 
 static const struct of_device_id s3c2410_wdt_match[] = {
 	{ .compatible = "samsung,s3c2410-wdt",
 	  .data = &drv_data_s3c2410 },
+	{ .compatible = "samsung,s3c6410-wdt",
+	  .data = &drv_data_s3c6410 },
 	{ .compatible = "samsung,exynos5250-wdt",
 	  .data = &drv_data_exynos5250 },
 	{ .compatible = "samsung,exynos5420-wdt",
@@ -418,6 +429,10 @@ static irqreturn_t s3c2410wdt_irq(int ir
 	dev_info(wdt->dev, "watchdog timer expired (irq)\n");
 
 	s3c2410wdt_keepalive(&wdt->wdt_device);
+
+	if (wdt->drv_data->quirks & QUIRK_HAS_WTCLRINT_REG)
+		writel(0x1, wdt->reg_base + S3C2410_WTCLRINT);
+
 	return IRQ_HANDLED;
 }
 

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

* [PATCH 4.10 105/110] tools/power turbostat: decode Baytrail CC6 and MC6 demotion configuration
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (99 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 103/110] watchdog: s3c2410: Fix infinite interrupt in soft mode Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 106/110] tools/power turbostat: dump Atom P-states correctly Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Len Brown, Sasha Levin

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

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

From: Len Brown <len.brown@intel.com>

[ Upstream commit 71616c8e936a6dd541f0627d7bf4ff09971d8ccb ]

with --debug, see:

cpu0: MSR_CC6_DEMOTION_POLICY_CONFIG: 0x00000000 (DISable-CC6-Demotion)
cpu0: MSR_MC6_DEMOTION_POLICY_CONFIG: 0x00000000 (DISable-MC6-Demotion)

Note that the hardware default is to enable demotion,
and Linux started clearing these registers in 3.17.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 tools/power/x86/turbostat/turbostat.c |   42 ++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -3097,6 +3097,27 @@ int has_snb_msrs(unsigned int family, un
 }
 
 /*
+ * SLV client has supporet for unique MSRs:
+ *
+ * MSR_CC6_DEMOTION_POLICY_CONFIG
+ * MSR_MC6_DEMOTION_POLICY_CONFIG
+ */
+
+int has_slv_msrs(unsigned int family, unsigned int model)
+{
+	if (!genuine_intel)
+		return 0;
+
+	switch (model) {
+	case INTEL_FAM6_ATOM_SILVERMONT1:
+	case INTEL_FAM6_ATOM_MERRIFIELD:
+	case INTEL_FAM6_ATOM_MOOREFIELD:
+		return 1;
+	}
+	return 0;
+}
+
+/*
  * HSW adds support for additional MSRs:
  *
  * MSR_PKG_C8_RESIDENCY		0x00000630
@@ -3327,6 +3348,24 @@ void decode_misc_pwr_mgmt_msr(void)
 			msr & (1 << 1) ? "EN" : "DIS",
 			msr & (1 << 8) ? "EN" : "DIS");
 }
+/*
+ * Decode MSR_CC6_DEMOTION_POLICY_CONFIG, MSR_MC6_DEMOTION_POLICY_CONFIG
+ *
+ * This MSRs are present on Silvermont processors,
+ * Intel Atom processor E3000 series (Baytrail), and friends.
+ */
+void decode_c6_demotion_policy_msr(void)
+{
+	unsigned long long msr;
+
+	if (!get_msr(base_cpu, MSR_CC6_DEMOTION_POLICY_CONFIG, &msr))
+		fprintf(outf, "cpu%d: MSR_CC6_DEMOTION_POLICY_CONFIG: 0x%08llx (%sable-CC6-Demotion)\n",
+			base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS");
+
+	if (!get_msr(base_cpu, MSR_MC6_DEMOTION_POLICY_CONFIG, &msr))
+		fprintf(outf, "cpu%d: MSR_MC6_DEMOTION_POLICY_CONFIG: 0x%08llx (%sable-MC6-Demotion)\n",
+			base_cpu, msr, msr & (1 << 0) ? "EN" : "DIS");
+}
 
 void process_cpuid()
 {
@@ -3509,6 +3548,9 @@ void process_cpuid()
 	if (debug)
 		decode_misc_pwr_mgmt_msr();
 
+	if (debug && has_slv_msrs(family, model))
+		decode_c6_demotion_policy_msr();
+
 	rapl_probe(family, model);
 	perf_limit_reasons_probe(family, model);
 

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

* [PATCH 4.10 106/110] tools/power turbostat: dump Atom P-states correctly
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (100 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 105/110] tools/power turbostat: decode Baytrail CC6 and MC6 demotion configuration Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 107/110] x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Len Brown, Sasha Levin

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

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

From: Len Brown <len.brown@intel.com>

[ Upstream commit 0f7887c49b0c454aef9936a6eadabe1c91b5af55 ]

Turbostat dumps MSR_TURBO_RATIO_LIMIT on Core Architecture.
But Atom Architecture uses MSR_ATOM_CORE_RATIOS and
MSR_ATOM_CORE_TURBO_RATIOS.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 tools/power/x86/turbostat/turbostat.c |  103 +++++++++++++++++++++++++++-------
 1 file changed, 82 insertions(+), 21 deletions(-)

--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -1598,6 +1598,54 @@ dump_nhm_turbo_ratio_limits(void)
 }
 
 static void
+dump_atom_turbo_ratio_limits(void)
+{
+	unsigned long long msr;
+	unsigned int ratio;
+
+	get_msr(base_cpu, MSR_ATOM_CORE_RATIOS, &msr);
+	fprintf(outf, "cpu%d: MSR_ATOM_CORE_RATIOS: 0x%08llx\n", base_cpu, msr & 0xFFFFFFFF);
+
+	ratio = (msr >> 0) & 0x3F;
+	if (ratio)
+		fprintf(outf, "%d * %.1f = %.1f MHz minimum operating frequency\n",
+			ratio, bclk, ratio * bclk);
+
+	ratio = (msr >> 8) & 0x3F;
+	if (ratio)
+		fprintf(outf, "%d * %.1f = %.1f MHz low frequency mode (LFM)\n",
+			ratio, bclk, ratio * bclk);
+
+	ratio = (msr >> 16) & 0x3F;
+	if (ratio)
+		fprintf(outf, "%d * %.1f = %.1f MHz base frequency\n",
+			ratio, bclk, ratio * bclk);
+
+	get_msr(base_cpu, MSR_ATOM_CORE_TURBO_RATIOS, &msr);
+	fprintf(outf, "cpu%d: MSR_ATOM_CORE_TURBO_RATIOS: 0x%08llx\n", base_cpu, msr & 0xFFFFFFFF);
+
+	ratio = (msr >> 24) & 0x3F;
+	if (ratio)
+		fprintf(outf, "%d * %.1f = %.1f MHz max turbo 4 active cores\n",
+			ratio, bclk, ratio * bclk);
+
+	ratio = (msr >> 16) & 0x3F;
+	if (ratio)
+		fprintf(outf, "%d * %.1f = %.1f MHz max turbo 3 active cores\n",
+			ratio, bclk, ratio * bclk);
+
+	ratio = (msr >> 8) & 0x3F;
+	if (ratio)
+		fprintf(outf, "%d * %.1f = %.1f MHz max turbo 2 active cores\n",
+			ratio, bclk, ratio * bclk);
+
+	ratio = (msr >> 0) & 0x3F;
+	if (ratio)
+		fprintf(outf, "%d * %.1f = %.1f MHz max turbo 1 active core\n",
+			ratio, bclk, ratio * bclk);
+}
+
+static void
 dump_knl_turbo_ratio_limits(void)
 {
 	const unsigned int buckets_no = 7;
@@ -2368,8 +2416,32 @@ int probe_nhm_msrs(unsigned int family,
 	has_base_hz = 1;
 	return 1;
 }
+/*
+ * SLV client has supporet for unique MSRs:
+ *
+ * MSR_CC6_DEMOTION_POLICY_CONFIG
+ * MSR_MC6_DEMOTION_POLICY_CONFIG
+ */
+
+int has_slv_msrs(unsigned int family, unsigned int model)
+{
+	if (!genuine_intel)
+		return 0;
+
+	switch (model) {
+	case INTEL_FAM6_ATOM_SILVERMONT1:
+	case INTEL_FAM6_ATOM_MERRIFIELD:
+	case INTEL_FAM6_ATOM_MOOREFIELD:
+		return 1;
+	}
+	return 0;
+}
+
 int has_nhm_turbo_ratio_limit(unsigned int family, unsigned int model)
 {
+	if (has_slv_msrs(family, model))
+		return 0;
+
 	switch (model) {
 	/* Nehalem compatible, but do not include turbo-ratio limit support */
 	case INTEL_FAM6_NEHALEM_EX:	/* Nehalem-EX Xeon - Beckton */
@@ -2381,6 +2453,13 @@ int has_nhm_turbo_ratio_limit(unsigned i
 		return 1;
 	}
 }
+int has_atom_turbo_ratio_limit(unsigned int family, unsigned int model)
+{
+	if (has_slv_msrs(family, model))
+		return 1;
+
+	return 0;
+}
 int has_ivt_turbo_ratio_limit(unsigned int family, unsigned int model)
 {
 	if (!genuine_intel)
@@ -2478,6 +2557,9 @@ dump_cstate_pstate_config_info(unsigned
 	if (has_nhm_turbo_ratio_limit(family, model))
 		dump_nhm_turbo_ratio_limits();
 
+	if (has_atom_turbo_ratio_limit(family, model))
+		dump_atom_turbo_ratio_limits();
+
 	if (has_knl_turbo_ratio_limit(family, model))
 		dump_knl_turbo_ratio_limits();
 
@@ -3094,27 +3176,6 @@ int has_snb_msrs(unsigned int family, un
 		return 1;
 	}
 	return 0;
-}
-
-/*
- * SLV client has supporet for unique MSRs:
- *
- * MSR_CC6_DEMOTION_POLICY_CONFIG
- * MSR_MC6_DEMOTION_POLICY_CONFIG
- */
-
-int has_slv_msrs(unsigned int family, unsigned int model)
-{
-	if (!genuine_intel)
-		return 0;
-
-	switch (model) {
-	case INTEL_FAM6_ATOM_SILVERMONT1:
-	case INTEL_FAM6_ATOM_MERRIFIELD:
-	case INTEL_FAM6_ATOM_MOOREFIELD:
-		return 1;
-	}
-	return 0;
 }
 
 /*

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

* [PATCH 4.10 107/110] x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (101 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 106/110] tools/power turbostat: dump Atom P-states correctly Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 108/110] x86/reboot/quirks: Add ASUS EeeBook X205TA/W " Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Matjaz Hegedic, Andy Lutomirski,
	Borislav Petkov, Brian Gerst, Denys Vlasenko, H. Peter Anvin,
	Josh Poimboeuf, Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, Sasha Levin

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

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

From: Matjaz Hegedic <matjaz.hegedic@gmail.com>

[ Upstream commit 90b28ded88dda8bea82b4a86923e73ba0746d884 ]

Without the parameter reboot=a, ASUS EeeBook X205TA will hang when it should reboot.

This adds the appropriate quirk, thus fixing the problem.

Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kernel/reboot.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -223,6 +223,14 @@ static struct dmi_system_id __initdata r
 			DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
 		},
 	},
+	{	/* Handle problems with rebooting on ASUS EeeBook X205TA */
+		.callback = set_acpi_reboot,
+		.ident = "ASUS EeeBook X205TA",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "X205TAW"),
+		},
+	},
 
 	/* Certec */
 	{       /* Handle problems with rebooting on Certec BPC600 */

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

* [PATCH 4.10 108/110] x86/reboot/quirks: Add ASUS EeeBook X205TA/W reboot quirk
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (102 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 107/110] x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 109/110] usb-storage: Add ignore-residue quirk for Initio INIC-3619 Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Matjaz Hegedic, Thomas Gleixner, Sasha Levin

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

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

From: Matjaz Hegedic <matjaz.hegedic@gmail.com>

[ Upstream commit 3b3e78552d3077ec70d2640e629e07e3ab416a6a ]

Without the parameter reboot=a, ASUS EeeBook X205TA/W will hang
when it should reboot. This adds the appropriate quirk, thus
fixing the problem.

Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
Link: http://lkml.kernel.org/r/1488737804-20681-1-git-send-email-matjaz.hegedic@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kernel/reboot.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -231,6 +231,14 @@ static struct dmi_system_id __initdata r
 			DMI_MATCH(DMI_PRODUCT_NAME, "X205TAW"),
 		},
 	},
+	{	/* Handle problems with rebooting on ASUS EeeBook X205TAW */
+		.callback = set_acpi_reboot,
+		.ident = "ASUS EeeBook X205TAW",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "X205TAW"),
+		},
+	},
 
 	/* Certec */
 	{       /* Handle problems with rebooting on Certec BPC600 */

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

* [PATCH 4.10 109/110] usb-storage: Add ignore-residue quirk for Initio INIC-3619
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (103 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 108/110] x86/reboot/quirks: Add ASUS EeeBook X205TA/W " Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 16:43 ` [PATCH 4.10 110/110] x86/reboot/quirks: Fix typo in ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Tobias Jakobi, Alan Stern, Sasha Levin

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

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

From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>

[ Upstream commit d595259fbb7a7afed241b1afb2c4fe4b47de47fa ]

This USB-SATA bridge chip is used in a StarTech enclosure for
optical drives.

Without the quirk MakeMKV fails during the key exchange with an
installed BluRay drive:
> Error 'Scsi error - ILLEGAL REQUEST:COPY PROTECTION KEY EXCHANGE FAILURE - KEY NOT ESTABLISHED'
> occurred while issuing SCSI command AD010..080002400 to device 'SG:dev_11:2'

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/storage/unusual_devs.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -2071,6 +2071,20 @@ UNUSUAL_DEV(  0x1370, 0x6828, 0x0110, 0x
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_IGNORE_RESIDUE ),
 
+/*
+ * Reported by Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
+ * The INIC-3619 bridge is used in the StarTech SLSODDU33B
+ * SATA-USB enclosure for slimline optical drives.
+ *
+ * The quirk enables MakeMKV to properly exchange keys with
+ * an installed BD drive.
+ */
+UNUSUAL_DEV(  0x13fd, 0x3609, 0x0209, 0x0209,
+		"Initio Corporation",
+		"INIC-3619",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_IGNORE_RESIDUE ),
+
 /* Reported by Qinglin Ye <yestyle@gmail.com> */
 UNUSUAL_DEV(  0x13fe, 0x3600, 0x0100, 0x0100,
 		"Kingston",

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

* [PATCH 4.10 110/110] x86/reboot/quirks: Fix typo in ASUS EeeBook X205TA reboot quirk
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (104 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 109/110] usb-storage: Add ignore-residue quirk for Initio INIC-3619 Greg Kroah-Hartman
@ 2017-04-10 16:43 ` Greg Kroah-Hartman
  2017-04-10 20:39 ` [PATCH 4.10 000/110] 4.10.10-stable review Shuah Khan
                   ` (3 subsequent siblings)
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-10 16:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Matjaz Hegedic, Thomas Gleixner, Sasha Levin

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

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

From: Matjaz Hegedic <matjaz.hegedic@gmail.com>

[ Upstream commit bba8376aea1dcbbe22bbda118c52abee317c7609 ]

The reboot quirk for ASUS EeeBook X205TA contains a typo in
DMI_PRODUCT_NAME, improperly referring to X205TAW instead of
X205TA, which prevents the quirk from being triggered. The
model X205TAW already has a reboot quirk of its own.

This fix simply removes the inappropriate final letter W.

Fixes: 90b28ded88dd ("x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk")
Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
Link: http://lkml.kernel.org/r/1489064417-7445-1-git-send-email-matjaz.hegedic@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kernel/reboot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -228,7 +228,7 @@ static struct dmi_system_id __initdata r
 		.ident = "ASUS EeeBook X205TA",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "X205TAW"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "X205TA"),
 		},
 	},
 	{	/* Handle problems with rebooting on ASUS EeeBook X205TAW */

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (105 preceding siblings ...)
  2017-04-10 16:43 ` [PATCH 4.10 110/110] x86/reboot/quirks: Fix typo in ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
@ 2017-04-10 20:39 ` Shuah Khan
  2017-04-11  4:58   ` Greg Kroah-Hartman
  2017-04-10 23:58 ` Andre Tomt
                   ` (2 subsequent siblings)
  109 siblings, 1 reply; 120+ messages in thread
From: Shuah Khan @ 2017-04-10 20:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, patches, ben.hutchings, stable, Shuah Khan

On 04/10/2017 10:41 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.10.10 release.
> There are 110 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 Wed Apr 12 16:41:40 UTC 2017.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.10.10-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.10.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

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

thanks,
-- Shuah

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (106 preceding siblings ...)
  2017-04-10 20:39 ` [PATCH 4.10 000/110] 4.10.10-stable review Shuah Khan
@ 2017-04-10 23:58 ` Andre Tomt
  2017-04-11  4:55   ` Greg Kroah-Hartman
  2017-04-11  3:17 ` Guenter Roeck
  2017-04-11  5:02 ` Greg Kroah-Hartman
  109 siblings, 1 reply; 120+ messages in thread
From: Andre Tomt @ 2017-04-10 23:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, stable

On 10. april 2017 18:41, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.10.10 release.
> There are 110 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.

turbostat is no longer building:

make[2]: Entering directory 
'/build/data/linux/linux-4.10/build/4.10-1/tools/power/x86/turbostat'
gcc -Wall -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' 
-DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"' 
turbostat.c -o 
/build/data/linux/linux-4.10/build/4.10-1/tools/power/x86/turbostat/turbostat
turbostat.c: In function ‘dump_atom_turbo_ratio_limits’:
turbostat.c:1606:20: error: ‘MSR_ATOM_CORE_RATIOS’ undeclared (first use 
in this function)
   get_msr(base_cpu, MSR_ATOM_CORE_RATIOS, &msr);
                     ^~~~~~~~~~~~~~~~~~~~
turbostat.c:1606:20: note: each undeclared identifier is reported only 
once for each function it appears in
turbostat.c:1624:20: error: ‘MSR_ATOM_CORE_TURBO_RATIOS’ undeclared 
(first use in this function)
   get_msr(base_cpu, MSR_ATOM_CORE_TURBO_RATIOS, &msr);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:16: recipe for target 'turbostat' failed

This is caused by upstream commit 
0f7887c49b0c454aef9936a6eadabe1c91b5af55 and can be fixed by adding 
upstream commit 8a34fd0226eaae64d61ff9a113d276e28acb6b5c which only adds 
the missing defines.

I did not try to build in 4.9, but given it has the same commits it 
should be needed there too.

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (107 preceding siblings ...)
  2017-04-10 23:58 ` Andre Tomt
@ 2017-04-11  3:17 ` Guenter Roeck
  2017-04-11  4:48   ` Greg Kroah-Hartman
  2017-04-11  5:02 ` Greg Kroah-Hartman
  109 siblings, 1 reply; 120+ messages in thread
From: Guenter Roeck @ 2017-04-11  3:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, shuahkh, patches, ben.hutchings, stable

On 04/10/2017 09:41 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.10.10 release.
> There are 110 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 Wed Apr 12 16:41:40 UTC 2017.
> Anything received after that time might be too late.
>

Build results:
	total: 149 pass: 146 fail: 3
Failed builds:
	arm:allmodconfig
	arm:omap2plus_defconfig
	arm:davinci_all_defconfig

Qemu test results:
	total: 122 pass: 107 fail: 15
Failed tests:
	arm:beagle:multi_v7_defconfig:omap3-beagle
	arm:beaglexm:multi_v7_defconfig:omap3-beagle-xm
	arm:overo:multi_v7_defconfig:omap3-overo-tobi
	arm:sabrelite:multi_v7_defconfig:imx6dl-sabrelite
	arm:vexpress-a9:multi_v7_defconfig:vexpress-v2p-ca9
	arm:vexpress-a15:multi_v7_defconfig:vexpress-v2p-ca15-tc1
	arm:vexpress-a15-a7:multi_v7_defconfig:vexpress-v2p-ca15_a7
	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zc702
	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zc706
	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zed
	arm:midway:multi_v7_defconfig:ecx-2000
	arm:smdkc210:multi_v7_defconfig:exynos4210-smdkv310
	arm:beagle:omap2plus_defconfig:omap3-beagle
	arm:beaglexm:omap2plus_defconfig:omap3-beagle-xm
	arm:overo:omap2plus_defconfig:omap3-overo-tobi

For arm, same problem as with v4.9.

Building arm:allmodconfig ... failed
--------------
Error log:
In file included from /opt/buildbot/slave/stable-queue-4.10/build/arch/arm/mach-omap2/pdata-quirks.c:15:0:
/opt/buildbot/slave/stable-queue-4.10/build/arch/arm/mach-omap2/pdata-quirks.c:536:49: error: 'rx51_ir_data' undeclared here (not in a function)
   OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_ir_data),

but also:

Building arm:davinci_all_defconfig ... failed
--------------
Error log:
/opt/buildbot/slave/stable-queue-4.10/build/drivers/usb/musb/da8xx.c:461:31: error: 'MUSB_PRESERVE_SESSION' undeclared here (not in a function)
   .quirks  = MUSB_INDEXED_EP | MUSB_PRESERVE_SESSION,
                                ^
make[4]: *** [drivers/usb/musb/da8xx.o] Error 1

This is due to
	8425a79bcbfe usb: musb: da8xx: Fix host mode suspend

which does not apply to 4.10 since MUSB_PRESERVE_SESSION is indeed not available in 4.10.
The flag was introduced with
	a926ed11e7b4 usb: musb: Add a quirk to preserve the session during suspend

so it is either both patches or none of them.

Detailed logs are available at http://kerneltests.org/builders.

Guenter

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-11  3:17 ` Guenter Roeck
@ 2017-04-11  4:48   ` Greg Kroah-Hartman
  2017-04-11  5:04     ` Guenter Roeck
  0 siblings, 1 reply; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-11  4:48 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-kernel, torvalds, akpm, shuahkh, patches, ben.hutchings, stable

On Mon, Apr 10, 2017 at 08:17:16PM -0700, Guenter Roeck wrote:
> On 04/10/2017 09:41 AM, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 4.10.10 release.
> > There are 110 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 Wed Apr 12 16:41:40 UTC 2017.
> > Anything received after that time might be too late.
> > 
> 
> Build results:
> 	total: 149 pass: 146 fail: 3
> Failed builds:
> 	arm:allmodconfig
> 	arm:omap2plus_defconfig
> 	arm:davinci_all_defconfig
> 
> Qemu test results:
> 	total: 122 pass: 107 fail: 15
> Failed tests:
> 	arm:beagle:multi_v7_defconfig:omap3-beagle
> 	arm:beaglexm:multi_v7_defconfig:omap3-beagle-xm
> 	arm:overo:multi_v7_defconfig:omap3-overo-tobi
> 	arm:sabrelite:multi_v7_defconfig:imx6dl-sabrelite
> 	arm:vexpress-a9:multi_v7_defconfig:vexpress-v2p-ca9
> 	arm:vexpress-a15:multi_v7_defconfig:vexpress-v2p-ca15-tc1
> 	arm:vexpress-a15-a7:multi_v7_defconfig:vexpress-v2p-ca15_a7
> 	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zc702
> 	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zc706
> 	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zed
> 	arm:midway:multi_v7_defconfig:ecx-2000
> 	arm:smdkc210:multi_v7_defconfig:exynos4210-smdkv310
> 	arm:beagle:omap2plus_defconfig:omap3-beagle
> 	arm:beaglexm:omap2plus_defconfig:omap3-beagle-xm
> 	arm:overo:omap2plus_defconfig:omap3-overo-tobi
> 
> For arm, same problem as with v4.9.
> 
> Building arm:allmodconfig ... failed
> --------------
> Error log:
> In file included from /opt/buildbot/slave/stable-queue-4.10/build/arch/arm/mach-omap2/pdata-quirks.c:15:0:
> /opt/buildbot/slave/stable-queue-4.10/build/arch/arm/mach-omap2/pdata-quirks.c:536:49: error: 'rx51_ir_data' undeclared here (not in a function)
>   OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_ir_data),

Now dropped, thanks.

> but also:
> 
> Building arm:davinci_all_defconfig ... failed
> --------------
> Error log:
> /opt/buildbot/slave/stable-queue-4.10/build/drivers/usb/musb/da8xx.c:461:31: error: 'MUSB_PRESERVE_SESSION' undeclared here (not in a function)
>   .quirks  = MUSB_INDEXED_EP | MUSB_PRESERVE_SESSION,
>                                ^
> make[4]: *** [drivers/usb/musb/da8xx.o] Error 1
> 
> This is due to
> 	8425a79bcbfe usb: musb: da8xx: Fix host mode suspend
> 
> which does not apply to 4.10 since MUSB_PRESERVE_SESSION is indeed not available in 4.10.
> The flag was introduced with
> 	a926ed11e7b4 usb: musb: Add a quirk to preserve the session during suspend
> 
> so it is either both patches or none of them.

I'll drop it as well.  Odd that this isn't showing up as a 4.9 build
error, it should, and I'll go drop it there too.

Ugh, what a mess...

thanks for the help, much appreciated.

greg k-h

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-10 23:58 ` Andre Tomt
@ 2017-04-11  4:55   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-11  4:55 UTC (permalink / raw)
  To: Andre Tomt; +Cc: stable

On Tue, Apr 11, 2017 at 01:58:28AM +0200, Andre Tomt wrote:
> On 10. april 2017 18:41, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 4.10.10 release.
> > There are 110 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.
> 
> turbostat is no longer building:
> 
> make[2]: Entering directory
> '/build/data/linux/linux-4.10/build/4.10-1/tools/power/x86/turbostat'
> gcc -Wall -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
> -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"'
> turbostat.c -o
> /build/data/linux/linux-4.10/build/4.10-1/tools/power/x86/turbostat/turbostat
> turbostat.c: In function ‘dump_atom_turbo_ratio_limits’:
> turbostat.c:1606:20: error: ‘MSR_ATOM_CORE_RATIOS’ undeclared (first use in
> this function)
>   get_msr(base_cpu, MSR_ATOM_CORE_RATIOS, &msr);
>                     ^~~~~~~~~~~~~~~~~~~~
> turbostat.c:1606:20: note: each undeclared identifier is reported only once
> for each function it appears in
> turbostat.c:1624:20: error: ‘MSR_ATOM_CORE_TURBO_RATIOS’ undeclared (first
> use in this function)
>   get_msr(base_cpu, MSR_ATOM_CORE_TURBO_RATIOS, &msr);
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
> Makefile:16: recipe for target 'turbostat' failed
> 
> This is caused by upstream commit 0f7887c49b0c454aef9936a6eadabe1c91b5af55
> and can be fixed by adding upstream commit
> 8a34fd0226eaae64d61ff9a113d276e28acb6b5c which only adds the missing
> defines.
> 
> I did not try to build in 4.9, but given it has the same commits it should
> be needed there too.

Thanks for letting me know, I've queued up the missing patch now.

greg k-h

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-10 20:39 ` [PATCH 4.10 000/110] 4.10.10-stable review Shuah Khan
@ 2017-04-11  4:58   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-11  4:58 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux-kernel, torvalds, akpm, linux, patches, ben.hutchings, stable

On Mon, Apr 10, 2017 at 02:39:37PM -0600, Shuah Khan wrote:
> On 04/10/2017 10:41 AM, Greg Kroah-Hartman wrote:
> > This is the start of the stable review cycle for the 4.10.10 release.
> > There are 110 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 Wed Apr 12 16:41:40 UTC 2017.
> > Anything received after that time might be too late.
> > 
> > The whole patch series can be found in one patch at:
> > 	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.10.10-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.10.y
> > and the diffstat can be found below.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> Compiled and booted on my test system. No dmesg regressions.

Thanks for testing all of these and letting me know.

greg k-h

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
                   ` (108 preceding siblings ...)
  2017-04-11  3:17 ` Guenter Roeck
@ 2017-04-11  5:02 ` Greg Kroah-Hartman
  109 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-11  5:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: torvalds, akpm, linux, shuahkh, patches, ben.hutchings, stable

On Mon, Apr 10, 2017 at 06:41:51PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.10.10 release.
> There are 110 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 Wed Apr 12 16:41:40 UTC 2017.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.10.10-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.10.y
> and the diffstat can be found below.

Ok, that blew up into lots of tiny pieces :(

Let's try this again...

I've released a -rc2 now:

	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.10.10-rc2.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.10.y

Hopefully this should be a lot better, sorry about that.

greg k-h

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

* Re: [PATCH 4.10 000/110] 4.10.10-stable review
  2017-04-11  4:48   ` Greg Kroah-Hartman
@ 2017-04-11  5:04     ` Guenter Roeck
  0 siblings, 0 replies; 120+ messages in thread
From: Guenter Roeck @ 2017-04-11  5:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, torvalds, akpm, shuahkh, patches, ben.hutchings, stable

On 04/10/2017 09:48 PM, Greg Kroah-Hartman wrote:
> On Mon, Apr 10, 2017 at 08:17:16PM -0700, Guenter Roeck wrote:
>> On 04/10/2017 09:41 AM, Greg Kroah-Hartman wrote:
>>> This is the start of the stable review cycle for the 4.10.10 release.
>>> There are 110 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 Wed Apr 12 16:41:40 UTC 2017.
>>> Anything received after that time might be too late.
>>>
>>
>> Build results:
>> 	total: 149 pass: 146 fail: 3
>> Failed builds:
>> 	arm:allmodconfig
>> 	arm:omap2plus_defconfig
>> 	arm:davinci_all_defconfig
>>
>> Qemu test results:
>> 	total: 122 pass: 107 fail: 15
>> Failed tests:
>> 	arm:beagle:multi_v7_defconfig:omap3-beagle
>> 	arm:beaglexm:multi_v7_defconfig:omap3-beagle-xm
>> 	arm:overo:multi_v7_defconfig:omap3-overo-tobi
>> 	arm:sabrelite:multi_v7_defconfig:imx6dl-sabrelite
>> 	arm:vexpress-a9:multi_v7_defconfig:vexpress-v2p-ca9
>> 	arm:vexpress-a15:multi_v7_defconfig:vexpress-v2p-ca15-tc1
>> 	arm:vexpress-a15-a7:multi_v7_defconfig:vexpress-v2p-ca15_a7
>> 	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zc702
>> 	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zc706
>> 	arm:xilinx-zynq-a9:multi_v7_defconfig:zynq-zed
>> 	arm:midway:multi_v7_defconfig:ecx-2000
>> 	arm:smdkc210:multi_v7_defconfig:exynos4210-smdkv310
>> 	arm:beagle:omap2plus_defconfig:omap3-beagle
>> 	arm:beaglexm:omap2plus_defconfig:omap3-beagle-xm
>> 	arm:overo:omap2plus_defconfig:omap3-overo-tobi
>>
>> For arm, same problem as with v4.9.
>>
>> Building arm:allmodconfig ... failed
>> --------------
>> Error log:
>> In file included from /opt/buildbot/slave/stable-queue-4.10/build/arch/arm/mach-omap2/pdata-quirks.c:15:0:
>> /opt/buildbot/slave/stable-queue-4.10/build/arch/arm/mach-omap2/pdata-quirks.c:536:49: error: 'rx51_ir_data' undeclared here (not in a function)
>>   OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_ir_data),
>
> Now dropped, thanks.
>
>> but also:
>>
>> Building arm:davinci_all_defconfig ... failed
>> --------------
>> Error log:
>> /opt/buildbot/slave/stable-queue-4.10/build/drivers/usb/musb/da8xx.c:461:31: error: 'MUSB_PRESERVE_SESSION' undeclared here (not in a function)
>>   .quirks  = MUSB_INDEXED_EP | MUSB_PRESERVE_SESSION,
>>                                ^
>> make[4]: *** [drivers/usb/musb/da8xx.o] Error 1
>>
>> This is due to
>> 	8425a79bcbfe usb: musb: da8xx: Fix host mode suspend
>>
>> which does not apply to 4.10 since MUSB_PRESERVE_SESSION is indeed not available in 4.10.
>> The flag was introduced with
>> 	a926ed11e7b4 usb: musb: Add a quirk to preserve the session during suspend
>>
>> so it is either both patches or none of them.
>
> I'll drop it as well.  Odd that this isn't showing up as a 4.9 build
> error, it should, and I'll go drop it there too.
>

I don't build with -i, so maybe the build didn't get to that point.

> Ugh, what a mess...

:-)

>
> thanks for the help, much appreciated.
>

My pleasure. I'll let you know when I have new results.

Guenter

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

* Re: [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks
  2017-04-10 16:43 ` [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks Greg Kroah-Hartman
@ 2017-04-11  8:13   ` Sekhar Nori
  2017-04-11 14:41     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 120+ messages in thread
From: Sekhar Nori @ 2017-04-11  8:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel; +Cc: stable, Kevin Hilman, Sasha Levin

Hi Greg,

On Monday 10 April 2017 10:13 PM, Greg Kroah-Hartman wrote:
> 4.10-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Kevin Hilman <khilman@baylibre.com>
> 
> [ Upstream commit 9c9b1bc25291e275b04f758f2549c81e092954f5 ]
> 
> Add skeleton pdata-quirks for davinci.
> 
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> [nsekhar@ti.com: move changes to build pdata-quirks.c and call
> 		 to pdata_quirks_init() to this patch]
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Can you drop this for v4.10 stable too? By itself it does not enable any
new functionality or fix any issue.

Thanks,
Sekhar

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

* Re: [PATCH 4.10 084/110] [media] rx51: broken build
  2017-04-10 16:43 ` [PATCH 4.10 084/110] [media] rx51: broken build Greg Kroah-Hartman
@ 2017-04-11 11:44   ` Sean Young
  2017-04-11 14:42     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 120+ messages in thread
From: Sean Young @ 2017-04-11 11:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, stable, kbuild test robot, Mauro Carvalho Chehab,
	Sasha Levin

On Mon, Apr 10, 2017 at 06:43:15PM +0200, Greg Kroah-Hartman wrote:
> 4.10-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Sean Young <sean@mess.org>
> 
> [ Upstream commit 922ee72da7c739157ed02ea04a5c100d19f67226 ]
> 
> As reported by kernel build test:
> 
>    In file included from arch/arm/mach-omap2/pdata-quirks.c:15:0:
> >> arch/arm/mach-omap2/pdata-quirks.c:536:49: error: 'rx51_lirc_data' undeclared here (not in a function)
>      OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
>                                                     ^
>    include/linux/of_platform.h:52:21: note: in definition of macro 'OF_DEV_AUXDATA'
>        .platform_data = _pdata }
>                         ^~~~~~
> 
> Since "a92def1 [media] ir-rx51: port to rc-core" the build fails on
> some arm configurations.

This commit is not in v4.10, so this patch does not apply to v4.10 just
like does not apply to v4.9.


Sean

> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Sean Young <sean@mess.org>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  arch/arm/mach-omap2/pdata-quirks.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -533,7 +533,7 @@ static struct of_dev_auxdata omap_auxdat
>  		       &omap3_iommu_pdata),
>  	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
>  	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
> -	OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
> +	OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_ir_data),
>  	/* Only on am3517 */
>  	OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
>  	OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
> 

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

* Re: [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks
  2017-04-11  8:13   ` Sekhar Nori
@ 2017-04-11 14:41     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-11 14:41 UTC (permalink / raw)
  To: Sekhar Nori; +Cc: linux-kernel, stable, Kevin Hilman, Sasha Levin

On Tue, Apr 11, 2017 at 01:43:01PM +0530, Sekhar Nori wrote:
> Hi Greg,
> 
> On Monday 10 April 2017 10:13 PM, Greg Kroah-Hartman wrote:
> > 4.10-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Kevin Hilman <khilman@baylibre.com>
> > 
> > [ Upstream commit 9c9b1bc25291e275b04f758f2549c81e092954f5 ]
> > 
> > Add skeleton pdata-quirks for davinci.
> > 
> > Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> > [nsekhar@ti.com: move changes to build pdata-quirks.c and call
> > 		 to pdata_quirks_init() to this patch]
> > Signed-off-by: Sekhar Nori <nsekhar@ti.com>
> > Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Can you drop this for v4.10 stable too? By itself it does not enable any
> new functionality or fix any issue.

Now dropped, thanks.

greg k-h

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

* Re: [PATCH 4.10 084/110] [media] rx51: broken build
  2017-04-11 11:44   ` Sean Young
@ 2017-04-11 14:42     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 120+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-11 14:42 UTC (permalink / raw)
  To: Sean Young
  Cc: linux-kernel, stable, kbuild test robot, Mauro Carvalho Chehab,
	Sasha Levin

On Tue, Apr 11, 2017 at 12:44:58PM +0100, Sean Young wrote:
> On Mon, Apr 10, 2017 at 06:43:15PM +0200, Greg Kroah-Hartman wrote:
> > 4.10-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Sean Young <sean@mess.org>
> > 
> > [ Upstream commit 922ee72da7c739157ed02ea04a5c100d19f67226 ]
> > 
> > As reported by kernel build test:
> > 
> >    In file included from arch/arm/mach-omap2/pdata-quirks.c:15:0:
> > >> arch/arm/mach-omap2/pdata-quirks.c:536:49: error: 'rx51_lirc_data' undeclared here (not in a function)
> >      OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
> >                                                     ^
> >    include/linux/of_platform.h:52:21: note: in definition of macro 'OF_DEV_AUXDATA'
> >        .platform_data = _pdata }
> >                         ^~~~~~
> > 
> > Since "a92def1 [media] ir-rx51: port to rc-core" the build fails on
> > some arm configurations.
> 
> This commit is not in v4.10, so this patch does not apply to v4.10 just
> like does not apply to v4.9.

Yes, already dropped, thanks.

greg k-h

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

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

Thread overview: 120+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 001/110] drm/vmwgfx: Type-check lookups of fence objects Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 002/110] drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl() Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 003/110] drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl() Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 004/110] drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 005/110] drm/vmwgfx: Remove getparam error message Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 006/110] drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl() Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 007/110] PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 008/110] PCI: thunder-pem: Fix legacy firmware PEM-specific resources Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 009/110] sysfs: be careful of error returns from ops->show() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 010/110] staging: android: ashmem: lseek failed due to no FMODE_LSEEK Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 011/110] arm/arm64: KVM: Take mmap_sem in stage2_unmap_vm Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 012/110] arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 013/110] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 014/110] iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 015/110] iio: st_pressure: initialize lps22hb bootime Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 016/110] iio: bmg160: reset chip when probing Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 017/110] arm64: mm: unaligned access by user-land should be received as SIGBUS Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 018/110] cfg80211: check rdev resume callback only for registered wiphy Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 019/110] Reset TreeId to zero on SMB2 TREE_CONNECT Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 020/110] mm/page_alloc.c: fix print order in show_free_areas() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 021/110] ptrace: fix PTRACE_LISTEN race corrupting task->state Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 022/110] dax: fix radix tree insertion race Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 023/110] dm verity fec: limit error correction recursion Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 024/110] dm verity fec: fix bufio leaks Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 025/110] ACPI / gpio: do not fall back to parsing _CRS when we get a deferral Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 026/110] ACPI / scan: Prefer devices without _HID for _ADR matching Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 027/110] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 028/110] jump label: fix passing kbuild_cflags when checking for asm goto support Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 029/110] orangefs: move features validation to fix filesystem hang Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 030/110] xfs: Honor FALLOC_FL_KEEP_SIZE when punching ends of files Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 031/110] ring-buffer: Fix return value check in test_ringbuffer() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 032/110] mac80211: unconditionally start new netdev queues with iTXQ support Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 033/110] brcmfmac: use local iftype avoiding use-after-free of virtual interface Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 034/110] metag/usercopy: Drop unused macros Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 035/110] metag/usercopy: Fix alignment error checking Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 036/110] metag/usercopy: Add early abort to copy_to_user Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 037/110] metag/usercopy: Zero rest of buffer from copy_from_user Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 038/110] metag/usercopy: Set flags before ADDZ Greg Kroah-Hartman
2017-04-10 16:42   ` Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 039/110] metag/usercopy: Fix src fixup in from user rapf loops Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 040/110] metag/usercopy: Add missing fixups Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 041/110] drm/msm: adreno: fix build error without debugfs Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 042/110] powerpc: Disable HFSCR[TM] if TM is not supported Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 043/110] powerpc/mm: Add missing global TLB invalidate if cxl is active Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 044/110] powerpc/64: Fix flush_(d|i)cache_range() called from modules Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 045/110] powerpc: Dont try to fix up misaligned load-with-reservation instructions Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 046/110] powerpc/crypto/crc32c-vpmsum: Fix missing preempt_disable() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 048/110] x86/mce: Dont print MCEs when mcelog is active Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 049/110] nios2: reserve boot memory for device tree Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 050/110] xtensa: make __pa work with uncached KSEG addresses Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 051/110] s390/decompressor: fix initrd corruption caused by bss clear Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 052/110] s390/uaccess: get_user() should zero on failure (again) Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 053/110] MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 054/110] MIPS: ralink: Fix typos in rt3883 pinctrl Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 055/110] MIPS: End spinlocks with .insn Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 056/110] MIPS: Lantiq: fix missing xbar kernel panic Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 057/110] MIPS: Check TLB before handle_ri_rdhwr() for Loongson-3 Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 058/110] MIPS: Add MIPS_CPU_FTLB for Loongson-3A R2 Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 059/110] MIPS: Flush wrong invalid FTLB entry for huge page Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 060/110] MIPS: c-r4k: Fix Loongson-3s vcache/scache waysize calculation Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 061/110] drm/i915/gvt: Fix gvt scheduler interval time Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 062/110] drm/i915/kvmgt: fix suspicious rcu dereference usage Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 063/110] usb: dwc3: gadget: delay unmap of bounced requests Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 064/110] Documentation: stable-kernel-rules: fix stable-tag format Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 065/110] mm/mempolicy.c: fix error handling in set_mempolicy and mbind Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 066/110] random: use chacha20 for get_random_int/long Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 067/110] kvm: fix page struct leak in handle_vmon Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 068/110] HID: multitouch: enable the Surface 4 Type Cover Pro (JP) to report multitouch data Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 069/110] drm/edid: constify edid quirk list Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 070/110] drm/i915: fix INTEL_BDW_IDS definition Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 071/110] drm/i915: more .is_mobile cleanups for BDW Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 072/110] drm/i915: actually drive the BDW reserved IDs Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 073/110] ASoC: Intel: bytcr_rt5640: quirks for Insyde devices Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 074/110] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 075/110] usb: chipidea: msm: Rely on core to override AHBBURST Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 076/110] serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks Greg Kroah-Hartman
2017-04-11  8:13   ` Sekhar Nori
2017-04-11 14:41     ` Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 079/110] usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 080/110] usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 081/110] drm/mga: remove device_is_agp callback Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 082/110] PCI: Add ACS quirk for Intel Union Point Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 083/110] PCI: xgene: Fix double free on init error Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 084/110] [media] rx51: broken build Greg Kroah-Hartman
2017-04-11 11:44   ` Sean Young
2017-04-11 14:42     ` Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 085/110] sata: ahci-da850: implement a workaround for the softreset quirk Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 086/110] ACPI / button: Change default behavior to lid_init_state=open Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 087/110] ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 088/110] ASoC: Intel: Baytrail: " Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 089/110] ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 090/110] ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 091/110] ACPI: save NVS memory for Lenovo G50-45 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 092/110] usb: musb: da8xx: Fix host mode suspend Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 094/110] HID: wacom: dont apply generic settings to old devices Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 095/110] arm: kernel: Add SMC structure parameter Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 096/110] firmware: qcom: scm: Fix interrupted SCM calls Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 097/110] ARM: smccc: Update HVC comment to describe new quirk parameter Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 098/110] PCI: Add Broadcom Northstar2 PAXC quirk for device class and MPSS Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 099/110] PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 100/110] mmc: sdhci-of-esdhc: remove default broken-cd for ARM Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 101/110] PCI: Sort the list of devices with D3 delay quirk by ID Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 102/110] PCI: Add ACS quirk for Qualcomm QDF2400 and QDF2432 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 103/110] watchdog: s3c2410: Fix infinite interrupt in soft mode Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 105/110] tools/power turbostat: decode Baytrail CC6 and MC6 demotion configuration Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 106/110] tools/power turbostat: dump Atom P-states correctly Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 107/110] x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 108/110] x86/reboot/quirks: Add ASUS EeeBook X205TA/W " Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 109/110] usb-storage: Add ignore-residue quirk for Initio INIC-3619 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 110/110] x86/reboot/quirks: Fix typo in ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
2017-04-10 20:39 ` [PATCH 4.10 000/110] 4.10.10-stable review Shuah Khan
2017-04-11  4:58   ` Greg Kroah-Hartman
2017-04-10 23:58 ` Andre Tomt
2017-04-11  4:55   ` Greg Kroah-Hartman
2017-04-11  3:17 ` Guenter Roeck
2017-04-11  4:48   ` Greg Kroah-Hartman
2017-04-11  5:04     ` Guenter Roeck
2017-04-11  5:02 ` Greg Kroah-Hartman

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