All of lore.kernel.org
 help / color / mirror / Atom feed
* [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review
@ 2014-12-15 14:24 Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 001/168] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Luis Henriques
                   ` (167 more replies)
  0 siblings, 168 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Luis Henriques

This is the start of the review cycle for the Linux 3.16.7-ckt3 stable kernel.

This version contains 168 new patches, summarized below.  The new patches are
posted as replies to this message and also available in this git branch:

http://kernel.ubuntu.com/git?p=ubuntu/linux.git;h=linux-3.16.y-review;a=shortlog

git://kernel.ubuntu.com/ubuntu/linux.git  linux-3.16.y-review

The review period for version 3.16.7-ckt3 will be open for the next three days.
To report a problem, please reply to the relevant follow-up patch message.

For more information about the Linux 3.16.y-ckt extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Luis

--
 .../bindings/interrupt-controller/interrupts.txt   |   4 -
 arch/arm/Kconfig.debug                             |   2 +-
 arch/arm/include/asm/pgtable-3level-hwdef.h        |   3 +-
 arch/arm/include/asm/pgtable-3level.h              |  49 ++++++----
 arch/arm/include/asm/pgtable.h                     |  18 ++--
 arch/arm/include/asm/thread_info.h                 |  11 ---
 arch/arm/kernel/traps.c                            |  31 +-----
 arch/arm/mach-mvebu/coherency.c                    |   2 +
 arch/arm/mach-pxa/include/mach/addr-map.h          |   5 +
 arch/arm/mm/dump.c                                 |   4 +-
 arch/arm/mm/proc-v7-3level.S                       |   9 +-
 arch/arm/mm/proc-v7.S                              |   2 -
 arch/arm/mm/proc-xscale.S                          |   4 +-
 arch/arm64/crypto/Makefile                         |   2 +-
 arch/mips/include/asm/mipsregs.h                   |   2 +
 arch/mips/include/asm/r4kcache.h                   |   4 +
 arch/mips/include/asm/uaccess.h                    |   7 +-
 arch/mips/kernel/cpu-probe.c                       |  33 ++++++-
 arch/mips/kernel/signal.c                          |   8 +-
 arch/mips/lib/memcpy.S                             |   1 +
 arch/mips/loongson/common/Makefile                 |   3 +-
 arch/mips/net/bpf_jit.c                            |   4 +-
 arch/mips/oprofile/backtrace.c                     |   2 +-
 arch/mips/sgi-ip27/ip27-memory.c                   |   1 +
 arch/powerpc/kernel/vdso32/getcpu.S                |   4 +-
 arch/powerpc/platforms/powernv/pci-ioda.c          |   5 +-
 arch/powerpc/platforms/powernv/pci.c               |   3 +-
 arch/powerpc/platforms/pseries/msi.c               |   2 +-
 arch/powerpc/xmon/xmon.c                           |   6 +-
 arch/sparc/include/uapi/asm/swab.h                 |  12 +--
 arch/x86/boot/compressed/Makefile                  |   2 +-
 arch/x86/include/asm/cpufeature.h                  |   1 +
 arch/x86/include/asm/kvm_para.h                    |  10 +-
 arch/x86/include/asm/page_32_types.h               |   1 -
 arch/x86/include/asm/page_64_types.h               |  11 +--
 arch/x86/include/asm/thread_info.h                 |   2 +-
 arch/x86/include/asm/traps.h                       |   1 +
 arch/x86/kernel/cpu/amd.c                          |   7 ++
 arch/x86/kernel/cpu/common.c                       |   2 +
 arch/x86/kernel/dumpstack_64.c                     |   1 -
 arch/x86/kernel/entry_64.S                         |  81 +++++-----------
 arch/x86/kernel/traps.c                            |  74 ++++++++++----
 arch/x86/mm/init_64.c                              |  11 ++-
 arch/x86/tools/calc_run_size.pl                    |  11 ++-
 drivers/acpi/device_pm.c                           |   2 +-
 drivers/ata/ahci.c                                 |   4 +
 drivers/ata/sata_fsl.c                             |   2 +-
 drivers/bluetooth/ath3k.c                          |  33 ++++---
 drivers/bluetooth/btmrvl_main.c                    |   5 +
 drivers/bluetooth/btusb.c                          |  27 +++++-
 drivers/clk/clk-divider.c                          |  18 ++--
 drivers/clocksource/sun4i_timer.c                  |  12 +--
 drivers/gpu/drm/i915/i915_dma.c                    |  22 +++--
 drivers/gpu/drm/i915/intel_display.c               |   6 +-
 drivers/gpu/drm/i915/intel_lvds.c                  |  22 ++---
 drivers/gpu/drm/i915/intel_pm.c                    |   5 -
 drivers/gpu/drm/nouveau/core/engine/device/nvc0.c  |   1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c              |   2 +-
 drivers/gpu/drm/radeon/r600_dpm.c                  |   2 +-
 drivers/gpu/drm/radeon/radeon_connectors.c         |  13 ++-
 drivers/gpu/drm/radeon/radeon_cs.c                 |   9 +-
 drivers/gpu/drm/radeon/radeon_irq_kms.c            |  10 ++
 drivers/gpu/drm/radeon/radeon_kms.c                |   2 +
 drivers/hid/usbhid/hid-core.c                      |   6 +-
 drivers/i2c/busses/i2c-cadence.c                   |  11 +++
 drivers/i2c/busses/i2c-davinci.c                   |   8 +-
 drivers/i2c/busses/i2c-omap.c                      |  10 +-
 drivers/iio/adc/men_z188_adc.c                     |   1 +
 drivers/infiniband/ulp/isert/ib_isert.c            |  44 ++++++---
 drivers/infiniband/ulp/srpt/ib_srpt.c              |   8 ++
 drivers/input/evdev.c                              |   2 +-
 drivers/input/joystick/xpad.c                      |  51 +++++++++-
 drivers/input/mouse/synaptics.c                    |   4 +
 drivers/input/serio/serio.c                        |   4 +-
 drivers/media/i2c/smiapp/smiapp-core.c             |   2 +-
 drivers/media/usb/s2255/s2255drv.c                 |   2 +-
 drivers/net/bonding/bond_main.c                    |   4 +-
 drivers/net/bonding/bond_netlink.c                 |   7 +-
 drivers/net/can/dev.c                              |   2 +-
 drivers/net/can/usb/esd_usb2.c                     |   1 +
 drivers/net/ethernet/allwinner/sun4i-emac.c        |   6 +-
 drivers/net/ethernet/broadcom/tg3.c                |   3 +-
 drivers/net/ethernet/intel/igb/igb_main.c          |   2 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |  12 ++-
 drivers/net/ethernet/marvell/mvneta.c              |   5 +-
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c     |  28 ++++--
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  |   2 +-
 drivers/net/ieee802154/fakehard.c                  |  13 ++-
 drivers/net/macvtap.c                              |   3 +
 drivers/net/ppp/pptp.c                             |   4 +-
 drivers/net/tun.c                                  |   6 +-
 drivers/net/usb/qmi_wwan.c                         |   1 +
 drivers/net/vxlan.c                                |  10 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c        |  13 +++
 drivers/net/wireless/ath/ath9k/hw.c                |  13 ---
 drivers/net/wireless/rt2x00/rt2x00queue.c          |  50 +++-------
 drivers/net/xen-netfront.c                         |   5 -
 drivers/of/address.c                               |  19 +++-
 drivers/of/fdt.c                                   |   4 +-
 drivers/pci/hotplug/pciehp_core.c                  |   7 ++
 drivers/pci/msi.c                                  |  26 +++++
 drivers/pci/probe.c                                |  28 +++---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c                  |   7 ++
 drivers/scsi/scsi_devinfo.c                        |   1 +
 drivers/spi/spi-dw.c                               |   6 +-
 drivers/spi/spi-sirf.c                             |   4 +-
 drivers/spi/spi.c                                  |   6 +-
 drivers/staging/rtl8188eu/os_dep/usb_intf.c        |   1 +
 drivers/target/target_core_transport.c             |   2 +-
 drivers/usb/core/quirks.c                          |   6 ++
 drivers/usb/host/xhci-hub.c                        |   5 +-
 drivers/usb/host/xhci-pci.c                        |   2 +-
 drivers/usb/host/xhci-plat.c                       |  10 +-
 drivers/usb/host/xhci-ring.c                       |  43 +++------
 drivers/usb/host/xhci.c                            | 107 +++++++++++----------
 drivers/usb/host/xhci.h                            |   2 +-
 drivers/usb/serial/cp210x.c                        |   1 +
 drivers/usb/serial/ftdi_sio.c                      |  33 +++++++
 drivers/usb/serial/ftdi_sio_ids.h                  |  39 +++++++-
 drivers/usb/serial/keyspan.c                       |  97 +++++++++++--------
 drivers/usb/serial/ssu100.c                        |  11 +--
 drivers/usb/storage/unusual_uas.h                  |   7 ++
 drivers/vhost/scsi.c                               |  24 +++++
 fs/aio.c                                           |  21 ++--
 fs/btrfs/compression.c                             |  33 ++++++-
 fs/btrfs/compression.h                             |   4 +-
 fs/btrfs/ctree.c                                   |  14 +--
 fs/btrfs/locking.c                                 |  24 ++++-
 fs/btrfs/locking.h                                 |   2 +
 fs/btrfs/lzo.c                                     |  15 +++
 fs/btrfs/zlib.c                                    |  20 +++-
 fs/dcache.c                                        |  32 +++---
 fs/nfs/pagelist.c                                  |   2 +-
 fs/nfsd/nfs4callback.c                             |   8 +-
 fs/nfsd/nfsd.h                                     |   9 +-
 include/linux/bitops.h                             |   7 +-
 include/linux/clk-provider.h                       |   1 -
 include/linux/iio/events.h                         |   2 +-
 include/linux/inetdevice.h                         |   2 +-
 include/linux/pci.h                                |   1 +
 include/net/ipv6.h                                 |   2 +
 include/sound/soc-dpcm.h                           |   2 +
 kernel/events/uprobes.c                            |   1 -
 mm/frontswap.c                                     |   4 +-
 mm/memory.c                                        |  26 ++---
 mm/mmap.c                                          |  10 +-
 mm/rmap.c                                          |   6 +-
 mm/slab.c                                          |   2 +-
 mm/vmpressure.c                                    |   8 +-
 net/core/rtnetlink.c                               |   1 +
 net/ipv4/fib_rules.c                               |   4 +
 net/ipv4/gre_offload.c                             |   3 +
 net/ipv4/ip_vti.c                                  |   1 +
 net/ipv4/ping.c                                    |   2 +
 net/ipv6/ip6_gre.c                                 |   4 +-
 net/ipv6/ip6_vti.c                                 |  11 +++
 net/ipv6/output_core.c                             |  34 +++++++
 net/ipx/af_ipx.c                                   |   6 +-
 net/mac80211/aes_ccm.c                             |   3 +
 net/sctp/output.c                                  |   4 +-
 net/sunrpc/svcsock.c                               |  27 +++---
 sound/pci/hda/hda_intel.c                          |  32 +++++-
 sound/pci/hda/hda_priv.h                           |   1 +
 sound/pci/hda/patch_realtek.c                      |   2 +
 sound/soc/codecs/cs42l51-i2c.c                     |   1 +
 sound/soc/codecs/cs42l51.c                         |   4 +-
 sound/soc/codecs/cs42l51.h                         |   1 +
 sound/soc/codecs/sgtl5000.c                        |   3 +-
 sound/soc/codecs/sgtl5000.h                        |   2 +-
 sound/soc/codecs/wm_adsp.c                         |   1 +
 sound/soc/samsung/snow.c                           |   1 +
 sound/soc/sh/fsi.c                                 |   3 +-
 sound/soc/sh/rcar/core.c                           |   3 +-
 sound/soc/soc-pcm.c                                |  72 +++++++++++---
 sound/usb/quirks.c                                 |  14 +++
 175 files changed, 1314 insertions(+), 680 deletions(-)

Aaro Koskinen (2):
      MIPS: oprofile: Fix backtrace on 64-bit kernel
      MIPS: Loongson: Make platform serial setup always built-in.

Alex Deucher (2):
      drm/radeon: fix endian swapping in vbios fetch for tdp table
      drm/radeon: report disconnected for LVDS/eDP with PX if ddc fails

Alexander Kochetkov (2):
      i2c: omap: fix NACK and Arbitration Lost irq handling
      i2c: omap: fix i207 errata handling

Alexey Khoroshilov (2):
      ieee802154: fix error handling in ieee802154fake_probe()
      can: esd_usb2: fix memory leak on disconnect

Anantha Krishnan (1):
      Bluetooth: Add support for Acer [13D3:3432]

Anatol Pomozov (1):
      Bluetooth: Fix crash in the Marvell driver initialization codepath

Andreas Färber (1):
      ASoC: samsung: Add MODULE_DEVICE_TABLE for Snow

Andreas Noever (1):
      PCI: pciehp: Prevent NULL dereference during probe

Andreas Schwab (1):
      arm64/crypto: fix makefile rule for aes-glue-%.o

Andrew Morton (2):
      mm/vmpressure.c: fix race in vmpressure_work_fn()
      drivers/input/evdev.c: don't kfree() a vmalloc address

Andy Lutomirski (5):
      x86_64, traps: Stop using IST for #SS
      uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME
      x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
      x86_64, traps: Rework bad_iret
      x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs

Anton Blanchard (1):
      powerpc: 32 bit getcpu VDSO function uses 64 bit instructions

Axel Lin (1):
      iio: adc: men_z188_adc: Add terminating entry for men_z188_ids

Bart Van Assche (1):
      srp-target: Retry when QP creation fails with ENOMEM

Ben Hutchings (1):
      drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets

Ben Sagal (1):
      Input: synaptics - adjust min/max on Thinkpad E540

Benjamin Herrenschmidt (6):
      of/base: Fix PowerPC address parsing hack
      PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
      gpu/radeon: Set flag to indicate broken 64-bit MSI
      sound/radeon: Move 64-bit MSI quirk from arch to driver
      powerpc/pseries: Honor the generic "no_64bit_msi" flag
      powerpc/powernv: Honor the generic "no_64bit_msi" flag

Benjamin Valentin (1):
      Input: xpad - sync device IDs with xboxdrv

Bjorn Helgaas (1):
      of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text

Charles Keepax (2):
      ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use
      spi: Fix mapping from vmalloc-ed buffer to scatter list

Chris Clayton (1):
      x86: Use $(OBJDUMP) instead of plain objdump

Chris Mason (2):
      btrfs: fix lockups from btrfs_clear_path_blocking
      btrfs: zero out left over bytes after processing compression streams

Chris Moore (1):
      IB/isert: Adjust CQ size to HW limits

Chris Wilson (1):
      drm/i915: Handle failure to kick out a conflicting fb driver

Christian König (1):
      drm/radeon: sync all BOs involved in a CS v2

Christian Sünkenberg (1):
      scsi: add Intel Multi-Flex to scsi scan blacklist

Christoph Hellwig (1):
      nfsd: correctly define v4.2 support attributes

Cristina Ciocan (1):
      iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask

Daniel Borkmann (2):
      ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe
      net: sctp: use MAX_HEADER for headroom reserve in output path

Daniel Forrest (1):
      mm: fix anon_vma_clone() error treatment

Daniel Vetter (4):
      drm/i915: drop WaSetupGtModeTdRowDispatch:snb
      drm/i915: Kick fbdev before vgacon
      drm/i915: More cautious with pch fifo underruns
      drm/i915: Unlock panel even when LVDS is disabled

Dave Airlie (1):
      nouveau: move the hotplug ignore to correct place.

Dave Hansen (1):
      x86: Require exact match for 'noxsave' command line option

David Jeffery (1):
      nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait

David S. Miller (1):
      sparc64: Fix constraints on swab helpers.

Denis Kirjanov (1):
      mips: bpf: Fix broken BPF_MOD

Devin Ryles (2):
      ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP
      AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller

Dmitry Eremin-Solenikov (1):
      ARM: 8216/1: xscale: correct auxiliary register in suspend/resume

Dmitry Torokhov (1):
      sata_fsl: fix error handling of irq_of_parse_and_map

Eric Dumazet (1):
      net: mvneta: fix race condition in mvneta_tx()

Fabio Estevam (1):
      ASoC: sgtl5000: Fix SMALL_POP bit definition

Frank Razenberg (1):
      Input: xpad - add VID/PID for Razer Sabertooth

Gavin Shan (1):
      powerpc/powernv: Replace OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE

Greg Kroah-Hartman (1):
      Input: xpad - use proper endpoint type

Grygorii Strashko (1):
      i2c: davinci: generate STP always when NACK is received

Gu Zheng (1):
      aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer

Hans de Goede (2):
      USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012
      usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000

Hugh Dickins (1):
      mm: fix swapoff hang after page migration and fork

Ian Campbell (1):
      of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap

Ilia Mirkin (1):
      drm/nouveau/gf116: remove copy1 engine

Jack Morgenstein (1):
      net/mlx4_core: Limit count field to 24 bits in qp_alloc_res

James Cowgill (1):
      MIPS: IP27: Fix __node_distances undefined error

James Hogan (1):
      clk-divider: Fix READ_ONLY when divider > 1

James Ralston (1):
      ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH

Jane Zhou (1):
      net/ping: handle protocol mismatching scenario

Jiri Bohac (1):
      ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg

Johan Hovold (3):
      USB: keyspan: fix tty line-status reporting
      USB: keyspan: fix overrun-error reporting
      USB: ssu100: fix overrun-error reporting

Joonyoung Shim (1):
      USB: add reset resume quirk for usb3503

Jurgen Kramer (1):
      ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices

Kailang Yang (1):
      ALSA: hda/realtek - Add headset Mic support for new Dell machine

Kees Cook (2):
      x86, mm: Set NX across entire PMD at boot
      x86, kaslr: Handle Gold linker for finding bss/brk

Kevin Cernekee (1):
      of: Fix crash if an earlycon driver is not found

Kuninori Morimoto (2):
      ASoC: fsi: remove unsupported PAUSE flag
      ASoC: rsnd: remove unsupported PAUSE flag

Larry Finger (1):
      staging: r8188eu: Add new device ID for DLink GO-USB-N150

Laurent Dufour (1):
      powerpc/pseries: Fix endiannes issue in RTAS call from xmon

Linus Torvalds (1):
      fold swapping ->d_name.hash into switch_names()

Lu Baolu (2):
      Revert "xhci: clear root port wake on bits if controller isn't wake-up capable"
      usb: xhci: rework root port wake bits if controller isn't allowed to wakeup

Marc Zyngier (1):
      net: sun4i-emac: fix memory leak on bad packet

Marcel Holtmann (5):
      Bluetooth: Add support for Intel bootloader devices
      Bluetooth: Handle Intel USB bootloader with buggy interrupt
      Bluetooth: Ignore isochronous endpoints for Intel USB bootloader
      Bluetooth: Fix endian and alignment issue with ath3k version handling
      Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard

Marcelo Leitner (1):
      Fix race condition between vxlan_sock_add and vxlan_sock_release

Mark Rustad (1):
      ixgbe: Fix possible null-dereference in error path

Markos Chandras (4):
      MIPS: asm: uaccess: Add v1 register to clobber list on EVA
      MIPS: lib: memcpy: Restore NOP on delay slot before returning to caller
      MIPS: r4kcache: Add EVA case for protected_writeback_dcache_line
      MIPS: cpu-probe: Set the FTLB probability bit on supported cores

Martin Hauke (1):
      qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem

Mathias Krause (1):
      pptp: fix stack info leak in pptp_getname()

Mathias Nyman (2):
      USB: xhci: don't start a halted endpoint before its new dequeue is set
      USB: xhci: Reset a halted endpoint immediately when we encounter a stall.

Maurizio Lombardi (1):
      bnx2fc: do not add shared skbs to the fcoe_rx_list

Maxime COQUELIN (1):
      bitops: Fix shift overflow in GENMASK macros

Maxime Ripard (1):
      clockevent: sun4i: Fix race condition in the probe code

Miaoqing Pan (1):
      ath9k: Fix RTC_DERIVED_CLK usage

Mikhail Efremov (1):
      vfs: Don't exchange "short" filenames unconditionally.

Nicholas Bellinger (1):
      vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT

Nicolas Dichtel (1):
      rtnetlink: release net refcnt on error in do_setlink()

Nikolay Aleksandrov (1):
      bonding: fix curr_active_slave/carrier with loadbalance arp monitoring

Or Gerlitz (3):
      net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
      net/mlx4_en: Advertize encapsulation offloads features only when VXLAN tunnel is set
      ib_isert: Add max_send_sge=2 minimum for control PDU responses

Panu Matilainen (1):
      ipv4: Fix incorrect error code when adding an unreachable route

Paolo Bonzini (1):
      x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only

Paul Burton (1):
      MIPS: fix EVA & non-SMP non-FPU FP context signal handling

Paul Mackerras (1):
      slab: fix nodeid bounds check for non-contiguous node IDs

Petr Mladek (1):
      drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6

Preston Fick (1):
      USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick

Qipan Li (1):
      spi: sirf: fix word width configuration

Rafael J. Wysocki (1):
      ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up

Reyad Attiyat (1):
      HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed

Richard Leitner (1):
      Input: serio - avoid negative serio device numbers

Robert Jarzmik (1):
      ARM: pxa: fix hang on startup with DEBUG_LL

Roland Dreier (1):
      target: Don't call TFO->write_pending if data_length == 0

Ronald Wahl (1):
      mac80211: Fix regression that triggers a kernel BUG with CCMP

Sagi Grimberg (1):
      iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly

Sakari Ailus (1):
      [media] smiapp: Only some selection targets are settable

Seth Forshee (1):
      xen-netfront: Remove BUGs on paged skb data which crosses a page boundary

Stanislaw Gruszka (1):
      rt2x00: do not align payload on modern H/W

Steven Capper (2):
      ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear
      ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE

Takashi Iwai (2):
      ASoC: dpcm: Fix race between FE/BE updates and trigger
      ALSA: hda - Limit 40bit DMA for AMD HDMI controllers

Tejun Heo (1):
      ahci: disable MSI on SAMSUNG 0xa800 SSD

Thadeu Lima de Souza Cascardo (1):
      tg3: fix ring init when there are more TX than RX channels

Thomas Graf (1):
      bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes

Thomas Körper (1):
      can: dev: avoid calling kfree_skb() from interrupt context

Thomas Petazzoni (3):
      ASoC: cs42l51: re-hook of_match_table pointer
      ARM: mvebu: add missing of_node_put() call in coherency.c
      ARM: 8222/1: mvebu: enable strex backoff delay

Thor Thayer (1):
      spi: dw: Fix dynamic speed change.

Todd Fujinaka (1):
      igb: bring link up when PHY is powered up

Tom Herbert (1):
      gre: Set inner mac header in gro complete

Tommi Rantala (1):
      Input: xpad - add USB ID for Thrustmaster Ferrari 458 Racing Wheel

Trond Myklebust (2):
      SUNRPC: Fix locking around callback channel reply receive
      nfsd: Fix slot wake up race in the nfsv4.1 callback code

Troy Clark (1):
      usb: serial: ftdi_sio: add PIDs for Matrix Orbital products

Ville Syrjälä (1):
      drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset

Vincent BENAYOUN (1):
      inetdevice: fixed signed integer overflow

Vincent Zwanenburg (1):
      Add a new PID/VID 0227/0930 for AR3012.

Vishnu Motghare (1):
      i2c: cadence: Set the hardware time-out register to maximum value

Vlad Yasevich (1):
      ixgbe: Correctly disable VLAN filter in promiscuous mode

Vladimir Murzin (1):
      ARM: 8226/1: cacheflush: get rid of restarting block

Weijie Yang (1):
      mm: frontswap: invalidate expired data on a dup-store failure

Yinghai Lu (1):
      PCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t

Yuri Chislov (1):
      ipv6: gre: fix wrong skb->protocol in WCCP

lucien (1):
      ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic

sensoray-dev (1):
      [media] s2255drv: fix payload size for JPG, MJPEG

willy tarreau (1):
      net: mvneta: fix Tx interrupt delay

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

* [PATCH 3.16.y-ckt 001/168] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 002/168] sparc64: Fix constraints on swab helpers Luis Henriques
                   ` (166 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Paolo Bonzini,
	Chris J Arges, Luis Henriques

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

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

From: Paolo Bonzini <pbonzini@redhat.com>

commit c1118b3602c2329671ad5ec8bdf8e374323d6343 upstream.

On x86_64, kernel text mappings are mapped read-only with CONFIG_DEBUG_RODATA.
In that case, KVM will fail to patch VMCALL instructions to VMMCALL
as required on AMD processors.

The failure mode is currently a divide-by-zero exception, which obviously
is a KVM bug that has to be fixed.  However, picking the right instruction
between VMCALL and VMMCALL will be faster and will help if you cannot upgrade
the hypervisor.

Reported-by: Chris Webb <chris@arachsys.com>
Tested-by: Chris Webb <chris@arachsys.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Chris J Arges <chris.j.arges@canonical.com>
[ luis: used Chris backport to 3.16 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/include/asm/cpufeature.h |  1 +
 arch/x86/include/asm/kvm_para.h   | 10 ++++++++--
 arch/x86/kernel/cpu/amd.c         |  7 +++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index e265ff95d16d..51f75503541d 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -203,6 +203,7 @@
 #define X86_FEATURE_DECODEASSISTS (8*32+12) /* AMD Decode Assists support */
 #define X86_FEATURE_PAUSEFILTER (8*32+13) /* AMD filtered pause intercept */
 #define X86_FEATURE_PFTHRESHOLD (8*32+14) /* AMD pause filter threshold */
+#define X86_FEATURE_VMMCALL     ( 8*32+15) /* Prefer vmmcall to vmcall */
 
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index c7678e43465b..e62cf897f781 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -2,6 +2,7 @@
 #define _ASM_X86_KVM_PARA_H
 
 #include <asm/processor.h>
+#include <asm/alternative.h>
 #include <uapi/asm/kvm_para.h>
 
 extern void kvmclock_init(void);
@@ -16,10 +17,15 @@ static inline bool kvm_check_and_clear_guest_paused(void)
 }
 #endif /* CONFIG_KVM_GUEST */
 
-/* This instruction is vmcall.  On non-VT architectures, it will generate a
- * trap that we will then rewrite to the appropriate instruction.
+#ifdef CONFIG_DEBUG_RODATA
+#define KVM_HYPERCALL \
+        ALTERNATIVE(".byte 0x0f,0x01,0xc1", ".byte 0x0f,0x01,0xd9", X86_FEATURE_VMMCALL)
+#else
+/* On AMD processors, vmcall will generate a trap that we will
+ * then rewrite to the appropriate instruction.
  */
 #define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1"
+#endif
 
 /* For KVM hypercalls, a three-byte sequence of either the vmcall or the vmmcall
  * instruction.  The hypervisor may replace it with something else but only the
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index ce8b8ff0e0ef..edefacacc2cc 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -506,6 +506,13 @@ static void early_init_amd(struct cpuinfo_x86 *c)
 	}
 #endif
 
+	/*
+	 * This is only needed to tell the kernel whether to use VMCALL
+	 * and VMMCALL.  VMMCALL is never executed except under virt, so
+	 * we can set it unconditionally.
+	 */
+	set_cpu_cap(c, X86_FEATURE_VMMCALL);
+
 	/* F16h erratum 793, CVE-2013-6885 */
 	if (c->x86 == 0x16 && c->x86_model <= 0xf)
 		msr_set_bit(MSR_AMD64_LS_CFG, 15);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 002/168] sparc64: Fix constraints on swab helpers.
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 001/168] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 003/168] inetdevice: fixed signed integer overflow Luis Henriques
                   ` (165 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Luis Henriques

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

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

From: "David S. Miller" <davem@davemloft.net>

commit 5a2b59d3993e8ca4f7788a48a23e5cb303f26954 upstream.

We are reading the memory location, so we have to have a memory
constraint in there purely for the sake of showing the data flow
to the compiler.

Reported-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/sparc/include/uapi/asm/swab.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/sparc/include/uapi/asm/swab.h b/arch/sparc/include/uapi/asm/swab.h
index a34ad079487e..4c7c12d69bea 100644
--- a/arch/sparc/include/uapi/asm/swab.h
+++ b/arch/sparc/include/uapi/asm/swab.h
@@ -9,9 +9,9 @@ static inline __u16 __arch_swab16p(const __u16 *addr)
 {
 	__u16 ret;
 
-	__asm__ __volatile__ ("lduha [%1] %2, %0"
+	__asm__ __volatile__ ("lduha [%2] %3, %0"
 			      : "=r" (ret)
-			      : "r" (addr), "i" (ASI_PL));
+			      : "m" (*addr), "r" (addr), "i" (ASI_PL));
 	return ret;
 }
 #define __arch_swab16p __arch_swab16p
@@ -20,9 +20,9 @@ static inline __u32 __arch_swab32p(const __u32 *addr)
 {
 	__u32 ret;
 
-	__asm__ __volatile__ ("lduwa [%1] %2, %0"
+	__asm__ __volatile__ ("lduwa [%2] %3, %0"
 			      : "=r" (ret)
-			      : "r" (addr), "i" (ASI_PL));
+			      : "m" (*addr), "r" (addr), "i" (ASI_PL));
 	return ret;
 }
 #define __arch_swab32p __arch_swab32p
@@ -31,9 +31,9 @@ static inline __u64 __arch_swab64p(const __u64 *addr)
 {
 	__u64 ret;
 
-	__asm__ __volatile__ ("ldxa [%1] %2, %0"
+	__asm__ __volatile__ ("ldxa [%2] %3, %0"
 			      : "=r" (ret)
-			      : "r" (addr), "i" (ASI_PL));
+			      : "m" (*addr), "r" (addr), "i" (ASI_PL));
 	return ret;
 }
 #define __arch_swab64p __arch_swab64p
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 003/168] inetdevice: fixed signed integer overflow
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 001/168] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 002/168] sparc64: Fix constraints on swab helpers Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 004/168] ipv4: Fix incorrect error code when adding an unreachable route Luis Henriques
                   ` (164 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vincent BENAYOUN, David S. Miller, Luis Henriques

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

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

From: Vincent BENAYOUN <vincent.benayoun@trust-in-soft.com>

commit 84bc88688e3f6ef843aa8803dbcd90168bb89faf upstream.

There could be a signed overflow in the following code.

The expression, (32-logmask) is comprised between 0 and 31 included.
It may be equal to 31.
In such a case the left shift will produce a signed integer overflow.
According to the C99 Standard, this is an undefined behavior.
A simple fix is to replace the signed int 1 with the unsigned int 1U.

Signed-off-by: Vincent BENAYOUN <vincent.benayoun@trust-in-soft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/inetdevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 0068708161ff..0a21fbefdfbe 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -242,7 +242,7 @@ static inline void in_dev_put(struct in_device *idev)
 static __inline__ __be32 inet_make_mask(int logmask)
 {
 	if (logmask)
-		return htonl(~((1<<(32-logmask))-1));
+		return htonl(~((1U<<(32-logmask))-1));
 	return 0;
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 004/168] ipv4: Fix incorrect error code when adding an unreachable route
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (2 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 003/168] inetdevice: fixed signed integer overflow Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 005/168] ieee802154: fix error handling in ieee802154fake_probe() Luis Henriques
                   ` (163 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Panu Matilainen, David S. Miller, Luis Henriques

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

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

From: Panu Matilainen <pmatilai@redhat.com>

commit 49dd18ba4615eaa72f15c9087dea1c2ab4744cf5 upstream.

Trying to add an unreachable route incorrectly returns -ESRCH if
if custom FIB rules are present:

[root@localhost ~]# ip route add 74.125.31.199 dev eth0 via 1.2.3.4
RTNETLINK answers: Network is unreachable
[root@localhost ~]# ip rule add to 55.66.77.88 table 200
[root@localhost ~]# ip route add 74.125.31.199 dev eth0 via 1.2.3.4
RTNETLINK answers: No such process
[root@localhost ~]#

Commit 83886b6b636173b206f475929e58fac75c6f2446 ("[NET]: Change "not found"
return value for rule lookup") changed fib_rules_lookup()
to use -ESRCH as a "not found" code internally, but for user space it
should be translated into -ENETUNREACH. Handle the translation centrally in
ipv4-specific fib_lookup(), leaving the DECnet case alone.

On a related note, commit b7a71b51ee37d919e4098cd961d59a883fd272d8
("ipv4: removed redundant conditional") removed a similar translation from
ip_route_input_slow() prematurely AIUI.

Fixes: b7a71b51ee37 ("ipv4: removed redundant conditional")
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/fib_rules.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index f2e15738534d..8f7bd56955b0 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -62,6 +62,10 @@ int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
 	else
 		res->tclassid = 0;
 #endif
+
+	if (err == -ESRCH)
+		err = -ENETUNREACH;
+
 	return err;
 }
 EXPORT_SYMBOL_GPL(__fib_lookup);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 005/168] ieee802154: fix error handling in ieee802154fake_probe()
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (3 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 004/168] ipv4: Fix incorrect error code when adding an unreachable route Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 006/168] qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Luis Henriques
                   ` (162 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexey Khoroshilov, David S. Miller, Luis Henriques

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

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

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

commit 8c2dd54485ccee7fc4086611e188478584758c8d upstream.

In case of any failure ieee802154fake_probe() just calls unregister_netdev().
But it does not look safe to unregister netdevice before it was registered.

The patch implements straightforward resource deallocation in case of
failure in ieee802154fake_probe().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ieee802154/fakehard.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c
index 78f18be3bbf2..c6aaa3d9de63 100644
--- a/drivers/net/ieee802154/fakehard.c
+++ b/drivers/net/ieee802154/fakehard.c
@@ -376,17 +376,20 @@ static int ieee802154fake_probe(struct platform_device *pdev)
 
 	err = wpan_phy_register(phy);
 	if (err)
-		goto out;
+		goto err_phy_reg;
 
 	err = register_netdev(dev);
-	if (err < 0)
-		goto out;
+	if (err)
+		goto err_netdev_reg;
 
 	dev_info(&pdev->dev, "Added ieee802154 HardMAC hardware\n");
 	return 0;
 
-out:
-	unregister_netdev(dev);
+err_netdev_reg:
+	wpan_phy_unregister(phy);
+err_phy_reg:
+	free_netdev(dev);
+	wpan_phy_free(phy);
 	return err;
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 006/168] qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (4 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 005/168] ieee802154: fix error handling in ieee802154fake_probe() Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 007/168] bonding: fix curr_active_slave/carrier with loadbalance arp monitoring Luis Henriques
                   ` (161 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Martin Hauke, David S. Miller, Luis Henriques

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

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

From: Martin Hauke <mardnh@gmx.de>

commit bb2bdeb83fb125c95e47fc7eca2a3e8f868e2a74 upstream.

Added the USB VID/PID for the HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e)

Signed-off-by: Martin Hauke <mardnh@gmx.de>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 22756db53dca..b8a82b86f909 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -780,6 +780,7 @@ static const struct usb_device_id products[] = {
 	{QMI_FIXED_INTF(0x413c, 0x81a4, 8)},	/* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
 	{QMI_FIXED_INTF(0x413c, 0x81a8, 8)},	/* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */
 	{QMI_FIXED_INTF(0x413c, 0x81a9, 8)},	/* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */
+	{QMI_FIXED_INTF(0x03f0, 0x581d, 4)},	/* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */
 
 	/* 4. Gobi 1000 devices */
 	{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)},	/* Acer Gobi Modem Device */
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 007/168] bonding: fix curr_active_slave/carrier with loadbalance arp monitoring
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (5 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 006/168] qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 008/168] pptp: fix stack info leak in pptp_getname() Luis Henriques
                   ` (160 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Veaceslav Falico, Jay Vosburgh, Andy Gospodarek, Ding Tianhong,
	Nikolay Aleksandrov, David S. Miller, Luis Henriques

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

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

From: Nikolay Aleksandrov <nikolay@redhat.com>

commit b8e4500f42fe4464a33a887579147050bed8fcef upstream.

Since commit 6fde8f037e60 ("bonding: fix locking in
bond_loadbalance_arp_mon()") we can have a stale bond carrier state and
stale curr_active_slave when using arp monitoring in loadbalance modes. The
reason is that in bond_loadbalance_arp_mon() we can't have
do_failover == true but slave_state_changed == false, whenever do_failover
is true then slave_state_changed is also true. Then the following piece
from bond_loadbalance_arp_mon():
                if (slave_state_changed) {
                        bond_slave_state_change(bond);
                        if (BOND_MODE(bond) == BOND_MODE_XOR)
                                bond_update_slave_arr(bond, NULL);
                } else if (do_failover) {
                        block_netpoll_tx();
                        bond_select_active_slave(bond);
                        unblock_netpoll_tx();
                }

will execute only the first branch, always and regardless of do_failover.
Since these two events aren't related in such way, we need to decouple and
consider them separately.

For example this issue could lead to the following result:
Bonding Mode: load balancing (round-robin)
*MII Status: down*
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 100
ARP IP target/s (n.n.n.n form): 192.168.9.2

Slave Interface: ens12
*MII Status: up*
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:0f:53:01:42:2c
Slave queue ID: 0

Slave Interface: eth1
*MII Status: up*
Speed: Unknown
Duplex: Unknown
Link Failure Count: 70
Permanent HW addr: 52:54:00:2f:0f:8e
Slave queue ID: 0

Since some interfaces are up, then the status of the bond should also be
up, but it will never change unless something invokes bond_set_carrier()
(i.e. enslave, bond_select_active_slave etc). Now, if I force the
calling of bond_select_active_slave via for example changing
primary_reselect (it can change in any mode), then the MII status goes to
"up" because it calls bond_select_active_slave() which should've been done
from bond_loadbalance_arp_mon() itself.

CC: Veaceslav Falico <vfalico@gmail.com>
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: Ding Tianhong <dingtianhong@huawei.com>

Fixes: 6fde8f037e60 ("bonding: fix locking in bond_loadbalance_arp_mon()")
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Veaceslav Falico <vfalico@gmail.com>
Acked-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Acked-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: used davem's backport to 3.17 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/bonding/bond_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5f29c9a9a316..6c795cfd6bbc 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2505,9 +2505,9 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
 		if (!rtnl_trylock())
 			goto re_arm;
 
-		if (slave_state_changed) {
+		if (slave_state_changed)
 			bond_slave_state_change(bond);
-		} else if (do_failover) {
+		if (do_failover) {
 			/* the bond_select_active_slave must hold RTNL
 			 * and curr_slave_lock for write.
 			 */
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 008/168] pptp: fix stack info leak in pptp_getname()
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (6 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 007/168] bonding: fix curr_active_slave/carrier with loadbalance arp monitoring Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 009/168] ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg Luis Henriques
                   ` (159 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dmitry Kozlov, Mathias Krause, David S. Miller, Luis Henriques

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

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

From: Mathias Krause <minipli@googlemail.com>

commit a5f6fc28d6e6cc379c6839f21820e62262419584 upstream.

pptp_getname() only partially initializes the stack variable sa,
particularly only fills the pptp part of the sa_addr union. The code
thereby discloses 16 bytes of kernel stack memory via getsockname().

Fix this by memset(0)'ing the union before.

Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ppp/pptp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 1aff970be33e..1dc628ffce2b 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -506,7 +506,9 @@ static int pptp_getname(struct socket *sock, struct sockaddr *uaddr,
 	int len = sizeof(struct sockaddr_pppox);
 	struct sockaddr_pppox sp;
 
-	sp.sa_family	  = AF_PPPOX;
+	memset(&sp.sa_addr, 0, sizeof(sp.sa_addr));
+
+	sp.sa_family    = AF_PPPOX;
 	sp.sa_protocol  = PX_PROTO_PPTP;
 	sp.sa_addr.pptp = pppox_sk(sock->sk)->proto.pptp.src_addr;
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 009/168] ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (7 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 008/168] pptp: fix stack info leak in pptp_getname() Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 010/168] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too Luis Henriques
                   ` (158 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jiri Bohac, David S. Miller, Luis Henriques

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

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

From: Jiri Bohac <jbohac@suse.cz>

commit 01462405f0c093b2f8dfddafcadcda6c9e4c5cdf upstream.

This fixes an old regression introduced by commit
b0d0d915 (ipx: remove the BKL).

When a recvmsg syscall blocks waiting for new data, no data can be sent on the
same socket with sendmsg because ipx_recvmsg() sleeps with the socket locked.

This breaks mars-nwe (NetWare emulator):
- the ncpserv process reads the request using recvmsg
- ncpserv forks and spawns nwconn
- ncpserv calls a (blocking) recvmsg and waits for new requests
- nwconn deadlocks in sendmsg on the same socket

Commit b0d0d915 has simply replaced BKL locking with
lock_sock/release_sock. Unlike now, BKL got unlocked while
sleeping, so a blocking recvmsg did not block a concurrent
sendmsg.

Only keep the socket locked while actually working with the socket data and
release it prior to calling skb_recv_datagram().

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipx/af_ipx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 91729b807c7d..1b095ca37aa4 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -1764,6 +1764,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
 	struct ipxhdr *ipx = NULL;
 	struct sk_buff *skb;
 	int copied, rc;
+	bool locked = true;
 
 	lock_sock(sk);
 	/* put the autobinding in */
@@ -1790,6 +1791,8 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
 	if (sock_flag(sk, SOCK_ZAPPED))
 		goto out;
 
+	release_sock(sk);
+	locked = false;
 	skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
 				flags & MSG_DONTWAIT, &rc);
 	if (!skb) {
@@ -1826,7 +1829,8 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
 out_free:
 	skb_free_datagram(sk, skb);
 out:
-	release_sock(sk);
+	if (locked)
+		release_sock(sk);
 	return rc;
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 010/168] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (8 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 009/168] ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 011/168] net/mlx4_en: Advertize encapsulation offloads features only when VXLAN tunnel is set Luis Henriques
                   ` (157 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Or Gerlitz, David S. Miller, Luis Henriques

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

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

From: Or Gerlitz <ogerlitz@mellanox.com>

commit 9737c6ab7afbc950e997ef80cba2c40dbbd16ea4 upstream.

This is currently missing, which results in a crash when one attempts
to set VXLAN tunnel over the mlx4_en when acting as PF.

	[ 2408.785472] BUG: unable to handle kernel NULL pointer dereference at (null)
	[...]
	[ 2408.994104] Call Trace:
	[ 2408.996584]  [<ffffffffa021f7f5>] ? vxlan_get_rx_port+0xd6/0x103 [vxlan]
	[ 2409.003316]  [<ffffffffa021f71f>] ? vxlan_lowerdev_event+0xf2/0xf2 [vxlan]
	[ 2409.010225]  [<ffffffffa0630358>] mlx4_en_start_port+0x862/0x96a [mlx4_en]
	[ 2409.017132]  [<ffffffffa063070f>] mlx4_en_open+0x17f/0x1b8 [mlx4_en]

While here, make sure to invoke vxlan_get_rx_port() only when VXLAN
offloads are actually enabled and not when they are only supported.

Reported-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: used davem's backport to 3.17 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 7345c43b019e..128f0728d97d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1724,7 +1724,7 @@ int mlx4_en_start_port(struct net_device *dev)
 	mlx4_set_stats_bitmap(mdev->dev, &priv->stats_bitmap);
 
 #ifdef CONFIG_MLX4_EN_VXLAN
-	if (priv->mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS)
+	if (priv->mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
 		vxlan_get_rx_port(dev);
 #endif
 	priv->port_up = true;
@@ -2434,6 +2434,10 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
 	.ndo_rx_flow_steer	= mlx4_en_filter_rfs,
 #endif
 	.ndo_get_phys_port_id	= mlx4_en_get_phys_port_id,
+#ifdef CONFIG_MLX4_EN_VXLAN
+	.ndo_add_vxlan_port	= mlx4_en_add_vxlan_port,
+	.ndo_del_vxlan_port	= mlx4_en_del_vxlan_port,
+#endif
 };
 
 int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 011/168] net/mlx4_en: Advertize encapsulation offloads features only when VXLAN tunnel is set
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (9 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 010/168] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 012/168] target: Don't call TFO->write_pending if data_length == 0 Luis Henriques
                   ` (156 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Or Gerlitz, David S. Miller, Luis Henriques

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

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

From: Or Gerlitz <ogerlitz@mellanox.com>

commit f4a1edd56120249198073aa4a373b77e3700ac8f upstream.

Currenly we only support Large-Send and TX checksum offloads for
encapsulated traffic of type VXLAN. We must make sure to advertize
these offloads up to the stack only when VXLAN tunnel is set.

Failing to do so, would mislead the the networking stack to assume
that the driver can offload the internal TX checksum for GRE packets
and other buggy schemes.

Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 128f0728d97d..04b2d8e117cb 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2312,8 +2312,16 @@ static void mlx4_en_add_vxlan_offloads(struct work_struct *work)
 	ret = mlx4_SET_PORT_VXLAN(priv->mdev->dev, priv->port,
 				  VXLAN_STEER_BY_OUTER_MAC, 1);
 out:
-	if (ret)
+	if (ret) {
 		en_err(priv, "failed setting L2 tunnel configuration ret %d\n", ret);
+		return;
+	}
+
+	/* set offloads */
+	priv->dev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
+				      NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL;
+	priv->dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
+	priv->dev->features    |= NETIF_F_GSO_UDP_TUNNEL;
 }
 
 static void mlx4_en_del_vxlan_offloads(struct work_struct *work)
@@ -2321,6 +2329,11 @@ static void mlx4_en_del_vxlan_offloads(struct work_struct *work)
 	int ret;
 	struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv,
 						 vxlan_del_task);
+	/* unset offloads */
+	priv->dev->hw_enc_features &= ~(NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
+				      NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL);
+	priv->dev->hw_features &= ~NETIF_F_GSO_UDP_TUNNEL;
+	priv->dev->features    &= ~NETIF_F_GSO_UDP_TUNNEL;
 
 	ret = mlx4_SET_PORT_VXLAN(priv->mdev->dev, priv->port,
 				  VXLAN_STEER_BY_OUTER_MAC, 0);
@@ -2601,13 +2614,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 	if (mdev->dev->caps.steering_mode != MLX4_STEERING_MODE_A0)
 		dev->priv_flags |= IFF_UNICAST_FLT;
 
-	if (mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) {
-		dev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM |
-					NETIF_F_TSO | NETIF_F_GSO_UDP_TUNNEL;
-		dev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
-		dev->features    |= NETIF_F_GSO_UDP_TUNNEL;
-	}
-
 	mdev->pndev[port] = dev;
 
 	netif_carrier_off(dev);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 012/168] target: Don't call TFO->write_pending if data_length == 0
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (10 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 011/168] net/mlx4_en: Advertize encapsulation offloads features only when VXLAN tunnel is set Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 013/168] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Luis Henriques
                   ` (155 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Roland Dreier, Nicholas Bellinger, Luis Henriques

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

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

From: Roland Dreier <roland@purestorage.com>

commit 885e7b0e181c14e4d0ddd26c688bad2b84c1ada9 upstream.

If an initiator sends a zero-length command (e.g. TEST UNIT READY) but
sets the transfer direction in the transport layer to indicate a
data-out phase, we still shouldn't try to transfer data.  At best it's
a NOP, and depending on the transport, we might crash on an
uninitialized sg list.

Reported-by: Craig Watson <craig.watson@vanguard-rugged.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/target/target_core_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index ab610146681d..a9c77b5116e3 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2295,7 +2295,7 @@ transport_generic_new_cmd(struct se_cmd *cmd)
 	 * and let it call back once the write buffers are ready.
 	 */
 	target_add_to_state_list(cmd);
-	if (cmd->data_direction != DMA_TO_DEVICE) {
+	if (cmd->data_direction != DMA_TO_DEVICE || cmd->data_length == 0) {
 		target_execute_cmd(cmd);
 		return 0;
 	}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 013/168] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (11 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 012/168] target: Don't call TFO->write_pending if data_length == 0 Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 014/168] srp-target: Retry when QP creation fails with ENOMEM Luis Henriques
                   ` (154 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michael S. Tsirkin, Paolo Bonzini, Stefan Hajnoczi,
	Nicholas Bellinger, Luis Henriques

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

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

From: Nicholas Bellinger <nab@linux-iscsi.org>

commit ab8edab132829b26dd13db6caca3c242cce35dc1 upstream.

This patch addresses a bug where individual vhost-scsi configfs endpoint
groups can be removed from below while active exports to QEMU userspace
still exist, resulting in an OOPs.

It adds a configfs_depend_item() in vhost_scsi_set_endpoint() to obtain
an explicit dependency on se_tpg->tpg_group in order to prevent individual
vhost-scsi WWPN endpoints from being released via normal configfs methods
while an QEMU ioctl reference still exists.

Also, add matching configfs_undepend_item() in vhost_scsi_clear_endpoint()
to release the dependency, once QEMU's reference to the individual group
at /sys/kernel/config/target/vhost/$WWPN/$TPGT is released.

(Fix up vhost_scsi_clear_endpoint() error path - DanC)

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/vhost/scsi.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 69906cacd04f..a17f11850669 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1312,6 +1312,7 @@ static int
 vhost_scsi_set_endpoint(struct vhost_scsi *vs,
 			struct vhost_scsi_target *t)
 {
+	struct se_portal_group *se_tpg;
 	struct tcm_vhost_tport *tv_tport;
 	struct tcm_vhost_tpg *tpg;
 	struct tcm_vhost_tpg **vs_tpg;
@@ -1359,6 +1360,21 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
 				ret = -EEXIST;
 				goto out;
 			}
+			/*
+			 * In order to ensure individual vhost-scsi configfs
+			 * groups cannot be removed while in use by vhost ioctl,
+			 * go ahead and take an explicit se_tpg->tpg_group.cg_item
+			 * dependency now.
+			 */
+			se_tpg = &tpg->se_tpg;
+			ret = configfs_depend_item(se_tpg->se_tpg_tfo->tf_subsys,
+						   &se_tpg->tpg_group.cg_item);
+			if (ret) {
+				pr_warn("configfs_depend_item() failed: %d\n", ret);
+				kfree(vs_tpg);
+				mutex_unlock(&tpg->tv_tpg_mutex);
+				goto out;
+			}
 			tpg->tv_tpg_vhost_count++;
 			tpg->vhost_scsi = vs;
 			vs_tpg[tpg->tport_tpgt] = tpg;
@@ -1401,6 +1417,7 @@ static int
 vhost_scsi_clear_endpoint(struct vhost_scsi *vs,
 			  struct vhost_scsi_target *t)
 {
+	struct se_portal_group *se_tpg;
 	struct tcm_vhost_tport *tv_tport;
 	struct tcm_vhost_tpg *tpg;
 	struct vhost_virtqueue *vq;
@@ -1449,6 +1466,13 @@ vhost_scsi_clear_endpoint(struct vhost_scsi *vs,
 		vs->vs_tpg[target] = NULL;
 		match = true;
 		mutex_unlock(&tpg->tv_tpg_mutex);
+		/*
+		 * Release se_tpg->tpg_group.cg_item configfs dependency now
+		 * to allow vhost-scsi WWPN se_tpg->tpg_group shutdown to occur.
+		 */
+		se_tpg = &tpg->se_tpg;
+		configfs_undepend_item(se_tpg->se_tpg_tfo->tf_subsys,
+				       &se_tpg->tpg_group.cg_item);
 	}
 	if (match) {
 		for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 014/168] srp-target: Retry when QP creation fails with ENOMEM
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (12 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 013/168] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 015/168] ASoC: fsi: remove unsupported PAUSE flag Luis Henriques
                   ` (153 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bart Van Assche, Sagi Grimberg, Nicholas Bellinger, Luis Henriques

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

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

From: Bart Van Assche <bvanassche@acm.org>

commit ab477c1ff5e0a744c072404bf7db51bfe1f05b6e upstream.

It is not guaranteed to that srp_sq_size is supported
by the HCA. So if we failed to create the QP with ENOMEM,
try with a smaller srp_sq_size. Keep it up until we hit
MIN_SRPT_SQ_SIZE, then fail the connection.

Reported-by: Mark Lehrer <lehrer@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index fe09f2788b15..3ffaf4e6c671 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2091,6 +2091,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 	if (!qp_init)
 		goto out;
 
+retry:
 	ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch,
 			      ch->rq_size + srp_sq_size, 0);
 	if (IS_ERR(ch->cq)) {
@@ -2114,6 +2115,13 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 	ch->qp = ib_create_qp(sdev->pd, qp_init);
 	if (IS_ERR(ch->qp)) {
 		ret = PTR_ERR(ch->qp);
+		if (ret == -ENOMEM) {
+			srp_sq_size /= 2;
+			if (srp_sq_size >= MIN_SRPT_SQ_SIZE) {
+				ib_destroy_cq(ch->cq);
+				goto retry;
+			}
+		}
 		printk(KERN_ERR "failed to create_qp ret= %d\n", ret);
 		goto err_destroy_cq;
 	}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 015/168] ASoC: fsi: remove unsupported PAUSE flag
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (13 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 014/168] srp-target: Retry when QP creation fails with ENOMEM Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 016/168] ASoC: rsnd: " Luis Henriques
                   ` (152 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kuninori Morimoto, Mark Brown, Luis Henriques

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

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

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

commit c1b9b9b1ad2df6144ca3fbe6989f7bd9ea5c5562 upstream.

FSI doesn't support PAUSE.
Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/sh/fsi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 710a079a7377..8889179c4d7a 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1785,8 +1785,7 @@ static const struct snd_soc_dai_ops fsi_dai_ops = {
 static struct snd_pcm_hardware fsi_pcm_hardware = {
 	.info =		SNDRV_PCM_INFO_INTERLEAVED	|
 			SNDRV_PCM_INFO_MMAP		|
-			SNDRV_PCM_INFO_MMAP_VALID	|
-			SNDRV_PCM_INFO_PAUSE,
+			SNDRV_PCM_INFO_MMAP_VALID,
 	.buffer_bytes_max	= 64 * 1024,
 	.period_bytes_min	= 32,
 	.period_bytes_max	= 8192,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 016/168] ASoC: rsnd: remove unsupported PAUSE flag
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (14 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 015/168] ASoC: fsi: remove unsupported PAUSE flag Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 017/168] ib_isert: Add max_send_sge=2 minimum for control PDU responses Luis Henriques
                   ` (151 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kuninori Morimoto, Mark Brown, Luis Henriques

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

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

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

commit 706c66213e5e623e23f521b1acbd8171af7a3549 upstream.

R-Car sound doesn't support PAUSE.
Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/sh/rcar/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 4e86265f625c..97b5fb5c0d4c 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -891,8 +891,7 @@ static int rsnd_dai_probe(struct platform_device *pdev,
 static struct snd_pcm_hardware rsnd_pcm_hardware = {
 	.info =		SNDRV_PCM_INFO_INTERLEAVED	|
 			SNDRV_PCM_INFO_MMAP		|
-			SNDRV_PCM_INFO_MMAP_VALID	|
-			SNDRV_PCM_INFO_PAUSE,
+			SNDRV_PCM_INFO_MMAP_VALID,
 	.buffer_bytes_max	= 64 * 1024,
 	.period_bytes_min	= 32,
 	.period_bytes_max	= 8192,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 017/168] ib_isert: Add max_send_sge=2 minimum for control PDU responses
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (15 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 016/168] ASoC: rsnd: " Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 018/168] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly Luis Henriques
                   ` (150 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Or Gerlitz, Nicholas Bellinger, Luis Henriques

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

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

From: Or Gerlitz <ogerlitz@mellanox.com>

commit f57915cfa5b2b14c1cffa2e83c034f55e3f0e70d upstream.

This patch adds a max_send_sge=2 minimum in isert_conn_setup_qp()
to ensure outgoing control PDU responses with tx_desc->num_sge=2
are able to function correctly.

This addresses a bug with RDMA hardware using dev_attr.max_sge=3,
that in the original code with the ConnectX-2 work-around would
result in isert_conn->max_sge=1 being negotiated.

Originally reported by Chris with ocrdma driver.

Reported-by: Chris Moore <Chris.Moore@emulex.com>
Tested-by: Chris Moore <Chris.Moore@emulex.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 676013a9dd94..33556f980b45 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -115,9 +115,12 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id,
 	attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS;
 	/*
 	 * FIXME: Use devattr.max_sge - 2 for max_send_sge as
-	 * work-around for RDMA_READ..
+	 * work-around for RDMA_READs with ConnectX-2.
+	 *
+	 * Also, still make sure to have at least two SGEs for
+	 * outgoing control PDU responses.
 	 */
-	attr.cap.max_send_sge = device->dev_attr.max_sge - 2;
+	attr.cap.max_send_sge = max(2, device->dev_attr.max_sge - 2);
 	isert_conn->max_sge = attr.cap.max_send_sge;
 
 	attr.cap.max_recv_sge = 1;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 018/168] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (16 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 017/168] ib_isert: Add max_send_sge=2 minimum for control PDU responses Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 019/168] ASoC: dpcm: Fix race between FE/BE updates and trigger Luis Henriques
                   ` (149 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sagi Grimberg, Nicholas Bellinger, Luis Henriques

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

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

From: Sagi Grimberg <sagig@dev.mellanox.co.il>

commit 3b726ae2de02a406cc91903f80132daee37b6f1b upstream.

In this case the cm_id->context is the isert_np, and the cm_id->qp
is NULL, so use that to distinct the cases.

Since we don't expect any other events on this cm_id we can
just return -1 for explicit termination of the cm_id by the
cma layer.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 33556f980b45..1e2c7ad50992 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -804,14 +804,25 @@ wake_up:
 	complete(&isert_conn->conn_wait);
 }
 
-static void
+static int
 isert_disconnected_handler(struct rdma_cm_id *cma_id, bool disconnect)
 {
-	struct isert_conn *isert_conn = (struct isert_conn *)cma_id->context;
+	struct isert_conn *isert_conn;
+
+	if (!cma_id->qp) {
+		struct isert_np *isert_np = cma_id->context;
+
+		isert_np->np_cm_id = NULL;
+		return -1;
+	}
+
+	isert_conn = (struct isert_conn *)cma_id->context;
 
 	isert_conn->disconnect = disconnect;
 	INIT_WORK(&isert_conn->conn_logout_work, isert_disconnect_work);
 	schedule_work(&isert_conn->conn_logout_work);
+
+	return 0;
 }
 
 static int
@@ -826,6 +837,9 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 	switch (event->event) {
 	case RDMA_CM_EVENT_CONNECT_REQUEST:
 		ret = isert_connect_request(cma_id, event);
+		if (ret)
+			pr_err("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n",
+				event->event, ret);
 		break;
 	case RDMA_CM_EVENT_ESTABLISHED:
 		isert_connected_handler(cma_id);
@@ -835,7 +849,7 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 	case RDMA_CM_EVENT_DEVICE_REMOVAL: /* FALLTHRU */
 		disconnect = true;
 	case RDMA_CM_EVENT_TIMEWAIT_EXIT:  /* FALLTHRU */
-		isert_disconnected_handler(cma_id, disconnect);
+		ret = isert_disconnected_handler(cma_id, disconnect);
 		break;
 	case RDMA_CM_EVENT_CONNECT_ERROR:
 	default:
@@ -843,12 +857,6 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 		break;
 	}
 
-	if (ret != 0) {
-		pr_err("isert_cma_handler failed RDMA_CM_EVENT: 0x%08x %d\n",
-		       event->event, ret);
-		dump_stack();
-	}
-
 	return ret;
 }
 
@@ -3205,7 +3213,8 @@ isert_free_np(struct iscsi_np *np)
 {
 	struct isert_np *isert_np = (struct isert_np *)np->np_context;
 
-	rdma_destroy_id(isert_np->np_cm_id);
+	if (isert_np->np_cm_id)
+		rdma_destroy_id(isert_np->np_cm_id);
 
 	np->np_context = NULL;
 	kfree(isert_np);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 019/168] ASoC: dpcm: Fix race between FE/BE updates and trigger
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (17 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 018/168] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 020/168] ASoC: samsung: Add MODULE_DEVICE_TABLE for Snow Luis Henriques
                   ` (148 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Takashi Iwai, Mark Brown, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit ea9d0d771fcd32cd56070819749477d511ec9117 upstream.

DPCM can update the FE/BE connection states totally asynchronously
from the FE's PCM state.  Most of FE/BE state changes are protected by
mutex, so that they won't race, but there are still some actions that
are uncovered.  For example, suppose to switch a BE while a FE's
stream is running.  This would call soc_dpcm_runtime_update(), which
sets FE's runtime_update flag, then sets up and starts BEs, and clears
FE's runtime_update flag again.

When a device emits XRUN during this operation, the PCM core triggers
snd_pcm_stop(XRUN).  Since the trigger action is an atomic ops, this
isn't blocked by the mutex, thus it kicks off DPCM's trigger action.
It eventually updates and clears FE's runtime_update flag while
soc_dpcm_runtime_update() is running concurrently, and it results in
confusion.

Usually, for avoiding such a race, we take a lock.  There is a PCM
stream lock for that purpose.  However, as already mentioned, the
trigger action is atomic, and we can't take the lock for the whole
soc_dpcm_runtime_update() or other operations that include the lengthy
jobs like hw_params or prepare.

This patch provides an alternative solution.  This adds a way to defer
the conflicting trigger callback to be executed at the end of FE/BE
state changes.  For doing it, two things are introduced:

- Each runtime_update state change of FEs is protected via PCM stream
  lock.
- The FE's trigger callback checks the runtime_update flag.  If it's
  not set, the trigger action is executed there.  If set, mark the
  pending trigger action and returns immediately.
- At the exit of runtime_update state change, it checks whether the
  pending trigger is present.  If yes, it executes the trigger action
  at this point.

Reported-and-tested-by: Qiao Zhou <zhouqiao@marvell.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/sound/soc-dpcm.h |  2 ++
 sound/soc/soc-pcm.c      | 72 +++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 58 insertions(+), 16 deletions(-)

diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 2883a7a6f9f3..98f2ade0266e 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -102,6 +102,8 @@ struct snd_soc_dpcm_runtime {
 	/* state and update */
 	enum snd_soc_dpcm_update runtime_update;
 	enum snd_soc_dpcm_state state;
+
+	int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */
 };
 
 /* can this BE stop and free */
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 4ea656770d65..61378f135075 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1316,13 +1316,36 @@ static void dpcm_set_fe_runtime(struct snd_pcm_substream *substream)
 		dpcm_init_runtime_hw(runtime, &cpu_dai_drv->capture);
 }
 
+static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd);
+
+/* Set FE's runtime_update state; the state is protected via PCM stream lock
+ * for avoiding the race with trigger callback.
+ * If the state is unset and a trigger is pending while the previous operation,
+ * process the pending trigger action here.
+ */
+static void dpcm_set_fe_update_state(struct snd_soc_pcm_runtime *fe,
+				     int stream, enum snd_soc_dpcm_update state)
+{
+	struct snd_pcm_substream *substream =
+		snd_soc_dpcm_get_substream(fe, stream);
+
+	snd_pcm_stream_lock_irq(substream);
+	if (state == SND_SOC_DPCM_UPDATE_NO && fe->dpcm[stream].trigger_pending) {
+		dpcm_fe_dai_do_trigger(substream,
+				       fe->dpcm[stream].trigger_pending - 1);
+		fe->dpcm[stream].trigger_pending = 0;
+	}
+	fe->dpcm[stream].runtime_update = state;
+	snd_pcm_stream_unlock_irq(substream);
+}
+
 static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream)
 {
 	struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
 	struct snd_pcm_runtime *runtime = fe_substream->runtime;
 	int stream = fe_substream->stream, ret = 0;
 
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
 
 	ret = dpcm_be_dai_startup(fe, fe_substream->stream);
 	if (ret < 0) {
@@ -1344,13 +1367,13 @@ static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream)
 	dpcm_set_fe_runtime(fe_substream);
 	snd_pcm_limit_hw_rates(runtime);
 
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 	return 0;
 
 unwind:
 	dpcm_be_dai_startup_unwind(fe, fe_substream->stream);
 be_err:
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 	return ret;
 }
 
@@ -1397,7 +1420,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
 	struct snd_soc_pcm_runtime *fe = substream->private_data;
 	int stream = substream->stream;
 
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
 
 	/* shutdown the BEs */
 	dpcm_be_dai_shutdown(fe, substream->stream);
@@ -1411,7 +1434,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream)
 	dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP);
 
 	fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE;
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 	return 0;
 }
 
@@ -1459,7 +1482,7 @@ static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream)
 	int err, stream = substream->stream;
 
 	mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
 
 	dev_dbg(fe->dev, "ASoC: hw_free FE %s\n", fe->dai_link->name);
 
@@ -1474,7 +1497,7 @@ static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream)
 	err = dpcm_be_dai_hw_free(fe, stream);
 
 	fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE;
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 
 	mutex_unlock(&fe->card->mutex);
 	return 0;
@@ -1567,7 +1590,7 @@ static int dpcm_fe_dai_hw_params(struct snd_pcm_substream *substream,
 	int ret, stream = substream->stream;
 
 	mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
 
 	memcpy(&fe->dpcm[substream->stream].hw_params, params,
 			sizeof(struct snd_pcm_hw_params));
@@ -1590,7 +1613,7 @@ static int dpcm_fe_dai_hw_params(struct snd_pcm_substream *substream,
 		fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS;
 
 out:
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 	mutex_unlock(&fe->card->mutex);
 	return ret;
 }
@@ -1704,7 +1727,7 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
 }
 EXPORT_SYMBOL_GPL(dpcm_be_dai_trigger);
 
-static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd)
+static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)
 {
 	struct snd_soc_pcm_runtime *fe = substream->private_data;
 	int stream = substream->stream, ret;
@@ -1778,6 +1801,23 @@ out:
 	return ret;
 }
 
+static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+	struct snd_soc_pcm_runtime *fe = substream->private_data;
+	int stream = substream->stream;
+
+	/* if FE's runtime_update is already set, we're in race;
+	 * process this trigger later at exit
+	 */
+	if (fe->dpcm[stream].runtime_update != SND_SOC_DPCM_UPDATE_NO) {
+		fe->dpcm[stream].trigger_pending = cmd + 1;
+		return 0; /* delayed, assuming it's successful */
+	}
+
+	/* we're alone, let's trigger */
+	return dpcm_fe_dai_do_trigger(substream, cmd);
+}
+
 int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream)
 {
 	struct snd_soc_dpcm *dpcm;
@@ -1821,7 +1861,7 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
 
 	dev_dbg(fe->dev, "ASoC: prepare FE %s\n", fe->dai_link->name);
 
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE);
 
 	/* there is no point preparing this FE if there are no BEs */
 	if (list_empty(&fe->dpcm[stream].be_clients)) {
@@ -1848,7 +1888,7 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
 	fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE;
 
 out:
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 	mutex_unlock(&fe->card->mutex);
 
 	return ret;
@@ -1995,11 +2035,11 @@ static int dpcm_run_new_update(struct snd_soc_pcm_runtime *fe, int stream)
 {
 	int ret;
 
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE);
 	ret = dpcm_run_update_startup(fe, stream);
 	if (ret < 0)
 		dev_err(fe->dev, "ASoC: failed to startup some BEs\n");
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 
 	return ret;
 }
@@ -2008,11 +2048,11 @@ static int dpcm_run_old_update(struct snd_soc_pcm_runtime *fe, int stream)
 {
 	int ret;
 
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE);
 	ret = dpcm_run_update_shutdown(fe, stream);
 	if (ret < 0)
 		dev_err(fe->dev, "ASoC: failed to shutdown some BEs\n");
-	fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
+	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 
 	return ret;
 }
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 020/168] ASoC: samsung: Add MODULE_DEVICE_TABLE for Snow
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (18 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 019/168] ASoC: dpcm: Fix race between FE/BE updates and trigger Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 021/168] mac80211: Fix regression that triggers a kernel BUG with CCMP Luis Henriques
                   ` (147 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andreas Färber, Mark Brown, Luis Henriques

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

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

From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>

commit 62e6a3b6f4e1f9b96fa66ab1cdf2ffd8594df9e9 upstream.

This enables the snd_soc_snow module to be auto-loaded.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/samsung/snow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c
index 014c177840ba..d9c6c8f82006 100644
--- a/sound/soc/samsung/snow.c
+++ b/sound/soc/samsung/snow.c
@@ -106,6 +106,7 @@ static const struct of_device_id snow_of_match[] = {
 	{ .compatible = "google,snow-audio-max98095", },
 	{},
 };
+MODULE_DEVICE_TABLE(of, snow_of_match);
 
 static struct platform_driver snow_driver = {
 	.driver = {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 021/168] mac80211: Fix regression that triggers a kernel BUG with CCMP
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (19 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 020/168] ASoC: samsung: Add MODULE_DEVICE_TABLE for Snow Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 022/168] rt2x00: do not align payload on modern H/W Luis Henriques
                   ` (146 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ronald Wahl, Johannes Berg, Luis Henriques

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

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

From: Ronald Wahl <ronald.wahl@raritan.com>

commit 4f031fa9f188b2b0641ac20087d9e16bcfb4e49d upstream.

Commit 7ec7c4a9a686c608315739ab6a2b0527a240883c (mac80211: port CCMP to
cryptoapi's CCM driver) introduced a regression when decrypting empty
packets (data_len == 0). This will lead to backtraces like:

(scatterwalk_start) from [<c01312f4>] (scatterwalk_map_and_copy+0x2c/0xa8)
(scatterwalk_map_and_copy) from [<c013a5a0>] (crypto_ccm_decrypt+0x7c/0x25c)
(crypto_ccm_decrypt) from [<c032886c>] (ieee80211_aes_ccm_decrypt+0x160/0x170)
(ieee80211_aes_ccm_decrypt) from [<c031c628>] (ieee80211_crypto_ccmp_decrypt+0x1ac/0x238)
(ieee80211_crypto_ccmp_decrypt) from [<c032ef28>] (ieee80211_rx_handlers+0x870/0x1d24)
(ieee80211_rx_handlers) from [<c0330c7c>] (ieee80211_prepare_and_rx_handle+0x8a0/0x91c)
(ieee80211_prepare_and_rx_handle) from [<c0331260>] (ieee80211_rx+0x568/0x730)
(ieee80211_rx) from [<c01d3054>] (__carl9170_rx+0x94c/0xa20)
(__carl9170_rx) from [<c01d3324>] (carl9170_rx_stream+0x1fc/0x320)
(carl9170_rx_stream) from [<c01cbccc>] (carl9170_usb_tasklet+0x80/0xc8)
(carl9170_usb_tasklet) from [<c00199dc>] (tasklet_hi_action+0x88/0xcc)
(tasklet_hi_action) from [<c00193c8>] (__do_softirq+0xcc/0x200)
(__do_softirq) from [<c0019734>] (irq_exit+0x80/0xe0)
(irq_exit) from [<c0009c10>] (handle_IRQ+0x64/0x80)
(handle_IRQ) from [<c000c3a0>] (__irq_svc+0x40/0x4c)
(__irq_svc) from [<c0009d44>] (arch_cpu_idle+0x2c/0x34)

Such packets can appear for example when using the carl9170 wireless driver
because hardware sometimes generates garbage when the internal FIFO overruns.

This patch adds an additional length check.

Fixes: 7ec7c4a9a686 ("mac80211: port CCMP to cryptoapi's CCM driver")
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/mac80211/aes_ccm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mac80211/aes_ccm.c b/net/mac80211/aes_ccm.c
index ec24378caaaf..09d9caaec591 100644
--- a/net/mac80211/aes_ccm.c
+++ b/net/mac80211/aes_ccm.c
@@ -53,6 +53,9 @@ int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
 		__aligned(__alignof__(struct aead_request));
 	struct aead_request *aead_req = (void *) aead_req_data;
 
+	if (data_len == 0)
+		return -EINVAL;
+
 	memset(aead_req, 0, sizeof(aead_req_data));
 
 	sg_init_one(&pt, data, data_len);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 022/168] rt2x00: do not align payload on modern H/W
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (20 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 021/168] mac80211: Fix regression that triggers a kernel BUG with CCMP Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 023/168] ath9k: Fix RTC_DERIVED_CLK usage Luis Henriques
                   ` (145 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Stanislaw Gruszka, John W. Linville, Luis Henriques

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

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

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit cfd9167af14eb4ec21517a32911d460083ee3d59 upstream.

RT2800 and newer hardware require padding between header and payload if
header length is not multiple of 4.

For historical reasons we also align payload to to 4 bytes boundary, but
such alignment is not needed on modern H/W.

Patch fixes skb_under_panic problems reported from time to time:

https://bugzilla.kernel.org/show_bug.cgi?id=84911
https://bugzilla.kernel.org/show_bug.cgi?id=72471
http://marc.info/?l=linux-wireless&m=139108549530402&w=2
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1087591

Panic happened because we eat 4 bytes of skb headroom on each
(re)transmission when sending frame without the payload and the header
length not being multiple of 4 (i.e. QoS header has 26 bytes). On such
case because paylad_aling=2 is bigger than header_align=0 we increase
header_align by 4 bytes. To prevent that we could change the check to:

	if (payload_length && payload_align > header_align)
		header_align += 4;

but not aligning payload at all is more effective and alignment is not
really needed by H/W (that has been tested on OpenWrt project for few
years now).

Reported-and-tested-by: Antti S. Lankila <alankila@bel.fi>
Debugged-by: Antti S. Lankila <alankila@bel.fi>
Reported-by: Henrik Asp <solenskiner@gmail.com>
Originally-From: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rt2x00/rt2x00queue.c | 50 ++++++++-----------------------
 1 file changed, 12 insertions(+), 38 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 5642ccceca7c..22d49d575d3f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -158,55 +158,29 @@ void rt2x00queue_align_frame(struct sk_buff *skb)
 	skb_trim(skb, frame_length);
 }
 
-void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
+/*
+ * H/W needs L2 padding between the header and the paylod if header size
+ * is not 4 bytes aligned.
+ */
+void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int hdr_len)
 {
-	unsigned int payload_length = skb->len - header_length;
-	unsigned int header_align = ALIGN_SIZE(skb, 0);
-	unsigned int payload_align = ALIGN_SIZE(skb, header_length);
-	unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0;
+	unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;
 
-	/*
-	 * Adjust the header alignment if the payload needs to be moved more
-	 * than the header.
-	 */
-	if (payload_align > header_align)
-		header_align += 4;
-
-	/* There is nothing to do if no alignment is needed */
-	if (!header_align)
+	if (!l2pad)
 		return;
 
-	/* Reserve the amount of space needed in front of the frame */
-	skb_push(skb, header_align);
-
-	/*
-	 * Move the header.
-	 */
-	memmove(skb->data, skb->data + header_align, header_length);
-
-	/* Move the payload, if present and if required */
-	if (payload_length && payload_align)
-		memmove(skb->data + header_length + l2pad,
-			skb->data + header_length + l2pad + payload_align,
-			payload_length);
-
-	/* Trim the skb to the correct size */
-	skb_trim(skb, header_length + l2pad + payload_length);
+	skb_push(skb, l2pad);
+	memmove(skb->data, skb->data + l2pad, hdr_len);
 }
 
-void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length)
+void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int hdr_len)
 {
-	/*
-	 * L2 padding is only present if the skb contains more than just the
-	 * IEEE 802.11 header.
-	 */
-	unsigned int l2pad = (skb->len > header_length) ?
-				L2PAD_SIZE(header_length) : 0;
+	unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;
 
 	if (!l2pad)
 		return;
 
-	memmove(skb->data + l2pad, skb->data, header_length);
+	memmove(skb->data + l2pad, skb->data, hdr_len);
 	skb_pull(skb, l2pad);
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 023/168] ath9k: Fix RTC_DERIVED_CLK usage
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (21 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 022/168] rt2x00: do not align payload on modern H/W Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 024/168] ASoC: cs42l51: re-hook of_match_table pointer Luis Henriques
                   ` (144 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Miaoqing Pan, Sujith Manoharan, John W. Linville, Luis Henriques

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

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

From: Miaoqing Pan <miaoqing@qca.qualcomm.com>

commit 4e6ce4dc7ce71d0886908d55129d5d6482a27ff9 upstream.

Based on the reference clock, which could be 25MHz or 40MHz,
AR_RTC_DERIVED_CLK is programmed differently for AR9340 and AR9550.
But, when a chip reset is done, processing the initvals
sets the register back to the default value.

Fix this by moving the code in ath9k_hw_init_pll() to
ar9003_hw_override_ini(). Also, do this override for AR9531.

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_phy.c | 13 +++++++++++++
 drivers/net/wireless/ath/ath9k/hw.c         | 13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 8927fc34d84c..b81f885aa68c 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -647,6 +647,19 @@ static void ar9003_hw_override_ini(struct ath_hw *ah)
 		ah->enabled_cals |= TX_CL_CAL;
 	else
 		ah->enabled_cals &= ~TX_CL_CAL;
+
+	if (AR_SREV_9340(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah)) {
+		if (ah->is_clk_25mhz) {
+			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
+			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
+			REG_WRITE(ah, AR_SLP32_INC, 0x0001e7ae);
+		} else {
+			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
+			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
+			REG_WRITE(ah, AR_SLP32_INC, 0x0001e800);
+		}
+		udelay(100);
+	}
 }
 
 static void ar9003_hw_prog_ini(struct ath_hw *ah,
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 2a8ed8375ec0..e1e2bf3b0051 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -858,19 +858,6 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 	udelay(RTC_PLL_SETTLE_DELAY);
 
 	REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_FORCE_DERIVED_CLK);
-
-	if (AR_SREV_9340(ah) || AR_SREV_9550(ah)) {
-		if (ah->is_clk_25mhz) {
-			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
-			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
-			REG_WRITE(ah,  AR_SLP32_INC, 0x0001e7ae);
-		} else {
-			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
-			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
-			REG_WRITE(ah,  AR_SLP32_INC, 0x0001e800);
-		}
-		udelay(100);
-	}
 }
 
 static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 024/168] ASoC: cs42l51: re-hook of_match_table pointer
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (22 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 023/168] ath9k: Fix RTC_DERIVED_CLK usage Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 025/168] ASoC: sgtl5000: Fix SMALL_POP bit definition Luis Henriques
                   ` (143 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Petazzoni, Mark Brown, Luis Henriques

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

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

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

commit 2cb1e0259f50c7be88eb277c7442fa74a3ce7c57 upstream.

In commit a1253ef6d3fa ("ASoC: cs42l51: split i2c from codec driver"),
the I2C part of the CS42L51 was moved to a separate file, but the
definition of the of_device_id array was left in the driver file
itself, no longer connected to the platform_driver structure using the
.of_match_table pointer.

This commit exports the of_device_id array in cs42l51, and uses it as
.of_match_able in cs42l51-i2c.c. This solution was suggested by Brian
Austin.

Fixes: a1253ef6d3fa ("ASoC: cs42l51: split i2c from codec driver")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/cs42l51-i2c.c | 1 +
 sound/soc/codecs/cs42l51.c     | 4 +++-
 sound/soc/codecs/cs42l51.h     | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs42l51-i2c.c b/sound/soc/codecs/cs42l51-i2c.c
index cee51ae177c1..c40428f25ba5 100644
--- a/sound/soc/codecs/cs42l51-i2c.c
+++ b/sound/soc/codecs/cs42l51-i2c.c
@@ -46,6 +46,7 @@ static struct i2c_driver cs42l51_i2c_driver = {
 	.driver = {
 		.name = "cs42l51",
 		.owner = THIS_MODULE,
+		.of_match_table = cs42l51_of_match,
 	},
 	.probe = cs42l51_i2c_probe,
 	.remove = cs42l51_i2c_remove,
diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
index 09488d97de60..669c38fc3034 100644
--- a/sound/soc/codecs/cs42l51.c
+++ b/sound/soc/codecs/cs42l51.c
@@ -558,11 +558,13 @@ error:
 }
 EXPORT_SYMBOL_GPL(cs42l51_probe);
 
-static const struct of_device_id cs42l51_of_match[] = {
+const struct of_device_id cs42l51_of_match[] = {
 	{ .compatible = "cirrus,cs42l51", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, cs42l51_of_match);
+EXPORT_SYMBOL_GPL(cs42l51_of_match);
+
 MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
 MODULE_DESCRIPTION("Cirrus Logic CS42L51 ALSA SoC Codec Driver");
 MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/cs42l51.h b/sound/soc/codecs/cs42l51.h
index 8c55bf384bc6..0ca805492ac4 100644
--- a/sound/soc/codecs/cs42l51.h
+++ b/sound/soc/codecs/cs42l51.h
@@ -22,6 +22,7 @@ struct device;
 
 extern const struct regmap_config cs42l51_regmap;
 int cs42l51_probe(struct device *dev, struct regmap *regmap);
+extern const struct of_device_id cs42l51_of_match[];
 
 #define CS42L51_CHIP_ID			0x1B
 #define CS42L51_CHIP_REV_A		0x00
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 025/168] ASoC: sgtl5000: Fix SMALL_POP bit definition
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (23 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 024/168] ASoC: cs42l51: re-hook of_match_table pointer Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 026/168] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices Luis Henriques
                   ` (142 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Fabio Estevam, Mark Brown, Luis Henriques

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

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

From: Fabio Estevam <fabio.estevam@freescale.com>

commit c251ea7bd7a04f1f2575467e0de76e803cf59149 upstream.

On a mx28evk with a sgtl5000 codec we notice a loud 'click' sound  to happen
5 seconds after the end of a playback.

The SMALL_POP bit should fix this, but its definition is incorrect:
according to the sgtl5000 manual it is bit 0 of CHIP_REF_CTRL register, not
bit 1.

Fix the definition accordingly and enable the bit as intended per the code
comment.

After applying this change, no loud 'click' sound is heard after playback

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/sgtl5000.c | 3 +--
 sound/soc/codecs/sgtl5000.h | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 3d39f0b5b4a8..f039d668266e 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1315,8 +1315,7 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
 
 	/* enable small pop, introduce 400ms delay in turning off */
 	snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL,
-				SGTL5000_SMALL_POP,
-				SGTL5000_SMALL_POP);
+				SGTL5000_SMALL_POP, 1);
 
 	/* disable short cut detector */
 	snd_soc_write(codec, SGTL5000_CHIP_SHORT_CTRL, 0);
diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h
index 2f8c88931f69..bd7a344bf8c5 100644
--- a/sound/soc/codecs/sgtl5000.h
+++ b/sound/soc/codecs/sgtl5000.h
@@ -275,7 +275,7 @@
 #define SGTL5000_BIAS_CTRL_MASK			0x000e
 #define SGTL5000_BIAS_CTRL_SHIFT		1
 #define SGTL5000_BIAS_CTRL_WIDTH		3
-#define SGTL5000_SMALL_POP			0x0001
+#define SGTL5000_SMALL_POP			0
 
 /*
  * SGTL5000_CHIP_MIC_CTRL
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 026/168] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (24 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 025/168] ASoC: sgtl5000: Fix SMALL_POP bit definition Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 027/168] bitops: Fix shift overflow in GENMASK macros Luis Henriques
                   ` (141 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jurgen Kramer, Takashi Iwai, Luis Henriques

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

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

From: Jurgen Kramer <gtmkramer@xs4all.nl>

commit 6e84a8d7ac3ba246ef44e313e92bc16a1da1b04a upstream.

This patch adds a USB control message delay quirk for a few specific Marantz/Denon
devices. Without the delay the DACs will not work properly and produces the
following type of messages:

Nov 15 10:09:21 orwell kernel: [   91.342880] usb 3-13: clock source 41 is not valid, cannot use
Nov 15 10:09:21 orwell kernel: [   91.343775] usb 3-13: clock source 41 is not valid, cannot use

There are likely other Marantz/Denon devices using the same USB module which exhibit the
same problems. But as this cannot be verified I limited the patch to the devices
I could test.

The following two devices are covered by this path:
- Marantz SA-14S1
- Marantz HD-DAC1

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/usb/quirks.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 19a921eb75f1..337067cce251 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1146,6 +1146,20 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
 	if ((le16_to_cpu(dev->descriptor.idVendor) == 0x23ba) &&
 	    (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
 		mdelay(20);
+
+	/* Marantz/Denon devices with USB DAC functionality need a delay
+	 * after each class compliant request
+	 */
+	if ((le16_to_cpu(dev->descriptor.idVendor) == 0x154e) &&
+	    (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) {
+
+		switch (le16_to_cpu(dev->descriptor.idProduct)) {
+		case 0x3005: /* Marantz HD-DAC1 */
+		case 0x3006: /* Marantz SA-14S1 */
+			mdelay(20);
+			break;
+		}
+	}
 }
 
 /*
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 027/168] bitops: Fix shift overflow in GENMASK macros
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (25 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 026/168] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 028/168] x86: Require exact match for 'noxsave' command line option Luis Henriques
                   ` (140 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Maxime Coquelin, Peter Zijlstra (Intel),
	linux, gong.chen, John Sullivan, Linus Torvalds,
	Paul E. McKenney, Theodore Ts'o, Ingo Molnar, Luis Henriques

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

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

From: Maxime COQUELIN <maxime.coquelin@st.com>

commit 00b4d9a14125f1e51874def2b9de6092e007412d upstream.

On some 32 bits architectures, including x86, GENMASK(31, 0) returns 0
instead of the expected ~0UL.

This is the same on some 64 bits architectures with GENMASK_ULL(63, 0).

This is due to an overflow in the shift operand, 1 << 32 for GENMASK,
1 << 64 for GENMASK_ULL.

Reported-by: Eric Paire <eric.paire@st.com>
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: linux@rasmusvillemoes.dk
Cc: gong.chen@linux.intel.com
Cc: John Sullivan <jsrhbz@kanargh.force9.co.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Fixes: 10ef6b0dffe4 ("bitops: Introduce a more generic BITMASK macro")
Link: http://lkml.kernel.org/r/1415267659-10563-1-git-send-email-maxime.coquelin@st.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/bitops.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index cbc5833fb221..38b5f5c88c18 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -18,8 +18,11 @@
  * position @h. For example
  * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
  */
-#define GENMASK(h, l)		(((U32_C(1) << ((h) - (l) + 1)) - 1) << (l))
-#define GENMASK_ULL(h, l)	(((U64_C(1) << ((h) - (l) + 1)) - 1) << (l))
+#define GENMASK(h, l) \
+	(((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
+
+#define GENMASK_ULL(h, l) \
+	(((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
 
 extern unsigned int __sw_hweight8(unsigned int w);
 extern unsigned int __sw_hweight16(unsigned int w);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 028/168] x86: Require exact match for 'noxsave' command line option
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (26 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 027/168] bitops: Fix shift overflow in GENMASK macros Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 029/168] drm/i915: drop WaSetupGtModeTdRowDispatch:snb Luis Henriques
                   ` (139 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dave Hansen, Dave Hansen, Fenghua Yu, x86, Thomas Gleixner,
	Luis Henriques

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

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

From: Dave Hansen <dave.hansen@linux.intel.com>

commit 2cd3949f702692cf4c5d05b463f19cd706a92dd3 upstream.

We have some very similarly named command-line options:

arch/x86/kernel/cpu/common.c:__setup("noxsave", x86_xsave_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaveopt", x86_xsaveopt_setup);
arch/x86/kernel/cpu/common.c:__setup("noxsaves", x86_xsaves_setup);

__setup() is designed to match options that take arguments, like
"foo=bar" where you would have:

	__setup("foo", x86_foo_func...);

The problem is that "noxsave" actually _matches_ "noxsaves" in
the same way that "foo" matches "foo=bar".  If you boot an old
kernel that does not know about "noxsaves" with "noxsaves" on the
command line, it will interpret the argument as "noxsave", which
is not what you want at all.

This makes the "noxsave" handler only return success when it finds
an *exact* match.

[ tglx: We really need to make __setup() more robust. ]

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/20141111220133.FE053984@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/cpu/common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index ae52a082a01c..1f3a8885f836 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -146,6 +146,8 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
 
 static int __init x86_xsave_setup(char *s)
 {
+	if (strlen(s))
+		return 0;
 	setup_clear_cpu_cap(X86_FEATURE_XSAVE);
 	setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT);
 	setup_clear_cpu_cap(X86_FEATURE_AVX);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 029/168] drm/i915: drop WaSetupGtModeTdRowDispatch:snb
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (27 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 028/168] x86: Require exact match for 'noxsave' command line option Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver Luis Henriques
                   ` (138 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Vetter, Jani Nikula, Luis Henriques

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

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 2208d655a91f9879bd9a39ff9df05dd668b3512c upstream.

This reverts the regressing

commit 6547fbdbfff62c99e4f7b4f985ff8b3454f33b0f
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Dec 14 23:38:29 2012 +0100

    drm/i915: Implement WaSetupGtModeTdRowDispatch

that causes GPU hangs immediately on boot.

Reported-by: Leo Wolf <jclw@ymail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79996
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
[Jani: amended the commit message slightly.]
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index ee72807069e4..e6f131db18cc 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4942,11 +4942,6 @@ static void gen6_init_clock_gating(struct drm_device *dev)
 	I915_WRITE(_3D_CHICKEN,
 		   _MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB));
 
-	/* WaSetupGtModeTdRowDispatch:snb */
-	if (IS_SNB_GT1(dev))
-		I915_WRITE(GEN6_GT_MODE,
-			   _MASKED_BIT_ENABLE(GEN6_TD_FOUR_ROW_DISPATCH_DISABLE));
-
 	/* WaDisable_RenderCache_OperationalFlush:snb */
 	I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (28 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 029/168] drm/i915: drop WaSetupGtModeTdRowDispatch:snb Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2015-01-11 21:49   ` Ben Hutchings
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 031/168] drm/i915: Kick fbdev before vgacon Luis Henriques
                   ` (137 subsequent siblings)
  167 siblings, 1 reply; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Daniel Vetter, Luis Henriques

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

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

From: Chris Wilson <chris@chris-wilson.co.uk>

commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index d44344140627..0663fb4fa606 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
 }
 
 #if IS_ENABLED(CONFIG_FB)
-static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
+static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
 {
 	struct apertures_struct *ap;
 	struct pci_dev *pdev = dev_priv->dev->pdev;
 	bool primary;
+	int ret;
 
 	ap = alloc_apertures(1);
 	if (!ap)
-		return;
+		return -ENOMEM;
 
 	ap->ranges[0].base = dev_priv->gtt.mappable_base;
 	ap->ranges[0].size = dev_priv->gtt.mappable_end;
@@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
 	primary =
 		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 
-	remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
+	ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
 
 	kfree(ap);
+
+	return ret;
 }
 #else
-static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
+static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
 {
+	return 0;
 }
 #endif
 
@@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 			goto out_gtt;
 		}
 
-		i915_kick_out_firmware_fb(dev_priv);
+		ret = i915_kick_out_firmware_fb(dev_priv);
+		if (ret) {
+			DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
+			goto out_gtt;
+		}
 	}
 
 	pci_set_master(dev->pdev);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 031/168] drm/i915: Kick fbdev before vgacon
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (29 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 032/168] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use Luis Henriques
                   ` (136 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Vetter, Jani Nikula, Luis Henriques

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

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit 0485c9dc24ec0939b42ca5104c0373297506b555 upstream.

It's magic, but it seems to work.

This fixes a regression introduced in

commit 1bb9e632a0aeee1121e652ee4dc80e5e6f14bcd2
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Tue Jul 8 10:02:43 2014 +0200

    drm/i915: Only unbind vgacon, not other console drivers

My best guess is that the vga fbdev driver falls over if we rip out
parts of vgacon. Hooray.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82439
Reported-and-tested-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/i915_dma.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 0663fb4fa606..646b68a58979 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1662,15 +1662,17 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 		goto out_regs;
 
 	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
-		ret = i915_kick_out_vgacon(dev_priv);
+		/* WARNING: Apparently we must kick fbdev drivers before vgacon,
+		 * otherwise the vga fbdev driver falls over. */
+		ret = i915_kick_out_firmware_fb(dev_priv);
 		if (ret) {
-			DRM_ERROR("failed to remove conflicting VGA console\n");
+			DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
 			goto out_gtt;
 		}
 
-		ret = i915_kick_out_firmware_fb(dev_priv);
+		ret = i915_kick_out_vgacon(dev_priv);
 		if (ret) {
-			DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
+			DRM_ERROR("failed to remove conflicting VGA console\n");
 			goto out_gtt;
 		}
 	}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 032/168] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (30 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 031/168] drm/i915: Kick fbdev before vgacon Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 033/168] can: dev: avoid calling kfree_skb() from interrupt context Luis Henriques
                   ` (135 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Charles Keepax, Mark Brown, Luis Henriques

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

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

From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

commit 9da7a5a9fdeeb76b2243f6b473363a7e6147ab6f upstream.

We should not free any buffers associated with writing out coefficients
to the DSP until all the async writes have completed. This patch updates
the out of memory path when allocating a new buffer to include a call to
regmap_async_complete.

Reported-by: JS Park <aitdark.park@samsung.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/wm_adsp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 2537725dd53f..051350052d62 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1355,6 +1355,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
 			  file, blocks, pos - firmware->size);
 
 out_fw:
+	regmap_async_complete(regmap);
 	release_firmware(firmware);
 	wm_adsp_buf_free(&buf_list);
 out:
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 033/168] can: dev: avoid calling kfree_skb() from interrupt context
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (31 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 032/168] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 034/168] can: esd_usb2: fix memory leak on disconnect Luis Henriques
                   ` (134 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Körper, Marc Kleine-Budde, Luis Henriques

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

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

From: =?UTF-8?q?Thomas=20K=C3=B6rper?= <thomas.koerper@esd.eu>

commit 5247a589c24022ab34e780039cc8000c48f2035e upstream.

ikfree_skb() is Called in can_free_echo_skb(), which might be called from (TX
Error) interrupt, which triggers the folloing warning:

[ 1153.360705] ------------[ cut here ]------------
[ 1153.360715] WARNING: CPU: 0 PID: 31 at net/core/skbuff.c:563 skb_release_head_state+0xb9/0xd0()
[ 1153.360772] Call Trace:
[ 1153.360778]  [<c167906f>] dump_stack+0x41/0x52
[ 1153.360782]  [<c105bb7e>] warn_slowpath_common+0x7e/0xa0
[ 1153.360784]  [<c158b909>] ? skb_release_head_state+0xb9/0xd0
[ 1153.360786]  [<c158b909>] ? skb_release_head_state+0xb9/0xd0
[ 1153.360788]  [<c105bc42>] warn_slowpath_null+0x22/0x30
[ 1153.360791]  [<c158b909>] skb_release_head_state+0xb9/0xd0
[ 1153.360793]  [<c158be90>] skb_release_all+0x10/0x30
[ 1153.360795]  [<c158bf06>] kfree_skb+0x36/0x80
[ 1153.360799]  [<f8486938>] ? can_free_echo_skb+0x28/0x40 [can_dev]
[ 1153.360802]  [<f8486938>] can_free_echo_skb+0x28/0x40 [can_dev]
[ 1153.360805]  [<f849a12c>] esd_pci402_interrupt+0x34c/0x57a [esd402]
[ 1153.360809]  [<c10a75b5>] handle_irq_event_percpu+0x35/0x180
[ 1153.360811]  [<c10a7623>] ? handle_irq_event_percpu+0xa3/0x180
[ 1153.360813]  [<c10a7731>] handle_irq_event+0x31/0x50
[ 1153.360816]  [<c10a9c7f>] handle_fasteoi_irq+0x6f/0x120
[ 1153.360818]  [<c10a9c10>] ? handle_edge_irq+0x110/0x110
[ 1153.360822]  [<c1011b61>] handle_irq+0x71/0x90
[ 1153.360823]  <IRQ>  [<c168152c>] do_IRQ+0x3c/0xd0
[ 1153.360829]  [<c1680b6c>] common_interrupt+0x2c/0x34
[ 1153.360834]  [<c107d277>] ? finish_task_switch+0x47/0xf0
[ 1153.360836]  [<c167c27b>] __schedule+0x35b/0x7e0
[ 1153.360839]  [<c10a5334>] ? console_unlock+0x2c4/0x4d0
[ 1153.360842]  [<c13df500>] ? n_tty_receive_buf_common+0x890/0x890
[ 1153.360845]  [<c10707b6>] ? process_one_work+0x196/0x370
[ 1153.360847]  [<c167c723>] schedule+0x23/0x60
[ 1153.360849]  [<c1070de1>] worker_thread+0x161/0x460
[ 1153.360852]  [<c1090fcf>] ? __wake_up_locked+0x1f/0x30
[ 1153.360854]  [<c1070c80>] ? rescuer_thread+0x2f0/0x2f0
[ 1153.360856]  [<c1074f01>] kthread+0xa1/0xc0
[ 1153.360859]  [<c1680401>] ret_from_kernel_thread+0x21/0x30
[ 1153.360861]  [<c1074e60>] ? kthread_create_on_node+0x110/0x110
[ 1153.360863] ---[ end trace 5ff83639cbb74b35 ]---

This patch replaces the kfree_skb() by dev_kfree_skb_any().

Signed-off-by: Thomas Körper <thomas.koerper@esd.eu>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/can/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index e318e87e2bfc..4e3f7ea6d52d 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -383,7 +383,7 @@ void can_free_echo_skb(struct net_device *dev, unsigned int idx)
 	BUG_ON(idx >= priv->echo_skb_max);
 
 	if (priv->echo_skb[idx]) {
-		kfree_skb(priv->echo_skb[idx]);
+		dev_kfree_skb_any(priv->echo_skb[idx]);
 		priv->echo_skb[idx] = NULL;
 	}
 }
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 034/168] can: esd_usb2: fix memory leak on disconnect
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (32 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 033/168] can: dev: avoid calling kfree_skb() from interrupt context Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 035/168] x86, mm: Set NX across entire PMD at boot Luis Henriques
                   ` (133 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexey Khoroshilov, Marc Kleine-Budde, Luis Henriques

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

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

From: Alexey Khoroshilov <khoroshilov@ispras.ru>

commit efbd50d2f62fc1f69a3dcd153e63ba28cc8eb27f upstream.

It seems struct esd_usb2 dev is not deallocated on disconnect. The patch adds
the missing deallocation.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/can/usb/esd_usb2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index b7c9e8b11460..7a90075529c3 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -1143,6 +1143,7 @@ static void esd_usb2_disconnect(struct usb_interface *intf)
 			}
 		}
 		unlink_all_urbs(dev);
+		kfree(dev);
 	}
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 035/168] x86, mm: Set NX across entire PMD at boot
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (33 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 034/168] can: esd_usb2: fix memory leak on disconnect Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 036/168] x86, kaslr: Handle Gold linker for finding bss/brk Luis Henriques
                   ` (132 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kees Cook, Andy Lutomirski, Toshi Kani, Yasuaki Ishimatsu,
	David Vrabel, Wang Nan, Yinghai Lu, Thomas Gleixner,
	Luis Henriques

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

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

From: Kees Cook <keescook@chromium.org>

commit 45e2a9d4701d8c624d4a4bcdd1084eae31e92f58 upstream.

When setting up permissions on kernel memory at boot, the end of the
PMD that was split from bss remained executable. It should be NX like
the rest. This performs a PMD alignment instead of a PAGE alignment to
get the correct span of memory.

Before:
---[ High Kernel Mapping ]---
...
0xffffffff8202d000-0xffffffff82200000  1868K     RW       GLB NX pte
0xffffffff82200000-0xffffffff82c00000    10M     RW   PSE GLB NX pmd
0xffffffff82c00000-0xffffffff82df5000  2004K     RW       GLB NX pte
0xffffffff82df5000-0xffffffff82e00000    44K     RW       GLB x  pte
0xffffffff82e00000-0xffffffffc0000000   978M                     pmd

After:
---[ High Kernel Mapping ]---
...
0xffffffff8202d000-0xffffffff82200000  1868K     RW       GLB NX pte
0xffffffff82200000-0xffffffff82e00000    12M     RW   PSE GLB NX pmd
0xffffffff82e00000-0xffffffffc0000000   978M                     pmd

[ tglx: Changed it to roundup(_brk_end, PMD_SIZE) and added a comment.
        We really should unmap the reminder along with the holes
        caused by init,initdata etc. but thats a different issue ]

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/20141114194737.GA3091@www.outflux.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/mm/init_64.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index df1a9927ad29..5146f4652092 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1110,7 +1110,7 @@ void mark_rodata_ro(void)
 	unsigned long end = (unsigned long) &__end_rodata_hpage_align;
 	unsigned long text_end = PFN_ALIGN(&__stop___ex_table);
 	unsigned long rodata_end = PFN_ALIGN(&__end_rodata);
-	unsigned long all_end = PFN_ALIGN(&_end);
+	unsigned long all_end;
 
 	printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
 	       (end - start) >> 10);
@@ -1121,7 +1121,16 @@ void mark_rodata_ro(void)
 	/*
 	 * The rodata/data/bss/brk section (but not the kernel text!)
 	 * should also be not-executable.
+	 *
+	 * We align all_end to PMD_SIZE because the existing mapping
+	 * is a full PMD. If we would align _brk_end to PAGE_SIZE we
+	 * split the PMD and the reminder between _brk_end and the end
+	 * of the PMD will remain mapped executable.
+	 *
+	 * Any PMD which was setup after the one which covers _brk_end
+	 * has been zapped already via cleanup_highmem().
 	 */
+	all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
 	set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
 
 	rodata_test();
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 036/168] x86, kaslr: Handle Gold linker for finding bss/brk
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (34 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 035/168] x86, mm: Set NX across entire PMD at boot Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 037/168] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text Luis Henriques
                   ` (131 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kees Cook, Junjie Mao, Thomas Gleixner, Luis Henriques

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

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

From: Kees Cook <keescook@chromium.org>

commit 70b61e362187b5fccac206506d402f3424e3e749 upstream.

When building with the Gold linker, the .bss and .brk areas of vmlinux
are shown as consecutive instead of having the same file offset. Allow
for either state, as long as things add up correctly.

Fixes: e6023367d779 ("x86, kaslr: Prevent .bss from overlaping initrd")
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Junjie Mao <eternal.n08@gmail.com>
Link: http://lkml.kernel.org/r/20141118001604.GA25045@www.outflux.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/tools/calc_run_size.pl | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/tools/calc_run_size.pl b/arch/x86/tools/calc_run_size.pl
index 0b0b124d3ece..23210baade2d 100644
--- a/arch/x86/tools/calc_run_size.pl
+++ b/arch/x86/tools/calc_run_size.pl
@@ -19,7 +19,16 @@ while (<>) {
 		if ($file_offset == 0) {
 			$file_offset = $offset;
 		} elsif ($file_offset != $offset) {
-			die ".bss and .brk lack common file offset\n";
+			# BFD linker shows the same file offset in ELF.
+			# Gold linker shows them as consecutive.
+			next if ($file_offset + $mem_size == $offset + $size);
+
+			printf STDERR "file_offset: 0x%lx\n", $file_offset;
+			printf STDERR "mem_size: 0x%lx\n", $mem_size;
+			printf STDERR "offset: 0x%lx\n", $offset;
+			printf STDERR "size: 0x%lx\n", $size;
+
+			die ".bss and .brk are non-contiguous\n";
 		}
 	}
 }
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 037/168] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (35 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 036/168] x86, kaslr: Handle Gold linker for finding bss/brk Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 038/168] of: Fix crash if an earlycon driver is not found Luis Henriques
                   ` (130 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bjorn Helgaas, Rob Herring, Luis Henriques

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

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

From: Bjorn Helgaas <bhelgaas@google.com>

commit 66865de4314caca30598244b86817e774c188afa upstream.

a9ecdc0fdc54 ("of/irq: Fix lookup to use 'interrupts-extended' property
first") updated the description to say that:

  - Both 'interrupts' and 'interrupts-extended' may be present
  - Software should prefer 'interrupts-extended'
  - Software that doesn't comprehend 'interrupts-extended' may use
    'interrupts'

But there is still a paragraph at the end that prohibits having both and
says 'interrupts' should be preferred.

Remove the contradictory text.

Fixes: a9ecdc0fdc54 ("of/irq: Fix lookup to use 'interrupts-extended' property first")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 Documentation/devicetree/bindings/interrupt-controller/interrupts.txt | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
index ce6a1a072028..8a3c40829899 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
@@ -30,10 +30,6 @@ should only be used when a device has multiple interrupt parents.
   Example:
 	interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;
 
-A device node may contain either "interrupts" or "interrupts-extended", but not
-both. If both properties are present, then the operating system should log an
-error and use only the data in "interrupts".
-
 2) Interrupt controller nodes
 -----------------------------
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 038/168] of: Fix crash if an earlycon driver is not found
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (36 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 037/168] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 039/168] of/base: Fix PowerPC address parsing hack Luis Henriques
                   ` (129 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kevin Cernekee, Rob Herring, Luis Henriques

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

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

From: Kevin Cernekee <cernekee@gmail.com>

commit ab74d00a39f70e1bc34a01322bb59f3750ca7a8c upstream.

__earlycon_of_table_sentinel.compatible is a char[128], not a pointer, so
it will never be NULL.  Checking it against NULL causes the match loop to
run past the end of the array, and eventually match a bogus entry, under
the following conditions:

 - Kernel command line specifies "earlycon" with no parameters
 - DT has a stdout-path pointing to a UART node
 - The UART driver doesn't use OF_EARLYCON_DECLARE (or maybe the console
   driver is compiled out)

Fix this by checking to see if match->compatible is a non-empty string.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 379ad4fa9665..f2da1750a597 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -773,7 +773,7 @@ int __init early_init_dt_scan_chosen_serial(void)
 	if (offset < 0)
 		return -ENODEV;
 
-	while (match->compatible) {
+	while (match->compatible[0]) {
 		unsigned long addr;
 		if (fdt_node_check_compatible(fdt, offset, match->compatible)) {
 			match++;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 039/168] of/base: Fix PowerPC address parsing hack
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (37 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 038/168] of: Fix crash if an earlycon driver is not found Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 040/168] clockevent: sun4i: Fix race condition in the probe code Luis Henriques
                   ` (128 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Benjamin Herrenschmidt, Rob Herring, Luis Henriques

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

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

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

commit 746c9e9f92dde2789908e51a354ba90a1962a2eb upstream.

We have a historical hack that treats missing ranges properties as the
equivalent of an empty one. This is needed for ancient PowerMac "bad"
device-trees, and shouldn't be enabled for any other PowerPC platform,
otherwise we get some nasty layout of devices in sysfs or even
duplication when a set of otherwise identically named devices is
created multiple times under a different parent node with no ranges
property.

This fix is needed for the PowerNV i2c busses to be exposed properly
and will fix a number of other embedded cases.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/of/address.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/of/address.c b/drivers/of/address.c
index 5edfcb0da37d..22ce1572af38 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -403,6 +403,21 @@ static struct of_bus *of_match_bus(struct device_node *np)
 	return NULL;
 }
 
+static int of_empty_ranges_quirk(void)
+{
+	if (IS_ENABLED(CONFIG_PPC)) {
+		/* To save cycles, we cache the result */
+		static int quirk_state = -1;
+
+		if (quirk_state < 0)
+			quirk_state =
+				of_machine_is_compatible("Power Macintosh") ||
+				of_machine_is_compatible("MacRISC");
+		return quirk_state;
+	}
+	return false;
+}
+
 static int of_translate_one(struct device_node *parent, struct of_bus *bus,
 			    struct of_bus *pbus, __be32 *addr,
 			    int na, int ns, int pna, const char *rprop)
@@ -428,12 +443,10 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
 	 * This code is only enabled on powerpc. --gcl
 	 */
 	ranges = of_get_property(parent, rprop, &rlen);
-#if !defined(CONFIG_PPC)
-	if (ranges == NULL) {
+	if (ranges == NULL && !of_empty_ranges_quirk()) {
 		pr_err("OF: no ranges; cannot translate\n");
 		return 1;
 	}
-#endif /* !defined(CONFIG_PPC) */
 	if (ranges == NULL || rlen == 0) {
 		offset = of_read_number(addr, na);
 		memset(addr, 0, pna * 4);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 040/168] clockevent: sun4i: Fix race condition in the probe code
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (38 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 039/168] of/base: Fix PowerPC address parsing hack Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 041/168] MIPS: IP27: Fix __node_distances undefined error Luis Henriques
                   ` (127 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Maxime Ripard, Daniel Lezcano, Luis Henriques

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

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

From: Maxime Ripard <maxime.ripard@free-electrons.com>

commit 6bab4a8a1888729f17f4923cc5867e4674f66333 upstream.

The interrupts were activated and the handler registered before the clockevent
was registered in the probe function.

The interrupt handler, however, was making the assumption that the clockevent
device was registered.

That could cause a null pointer dereference if the timer interrupt was firing
during this narrow window.

Fix that by moving the clockevent registration before the interrupt is enabled.

Reported-by: Roman Byshko <rbyshko@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/clocksource/sun4i_timer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/clocksource/sun4i_timer.c b/drivers/clocksource/sun4i_timer.c
index efb17c3ee120..f4a9c0058b4d 100644
--- a/drivers/clocksource/sun4i_timer.c
+++ b/drivers/clocksource/sun4i_timer.c
@@ -182,6 +182,12 @@ static void __init sun4i_timer_init(struct device_node *node)
 	/* Make sure timer is stopped before playing with interrupts */
 	sun4i_clkevt_time_stop(0);
 
+	sun4i_clockevent.cpumask = cpu_possible_mask;
+	sun4i_clockevent.irq = irq;
+
+	clockevents_config_and_register(&sun4i_clockevent, rate,
+					TIMER_SYNC_TICKS, 0xffffffff);
+
 	ret = setup_irq(irq, &sun4i_timer_irq);
 	if (ret)
 		pr_warn("failed to setup irq %d\n", irq);
@@ -189,12 +195,6 @@ static void __init sun4i_timer_init(struct device_node *node)
 	/* Enable timer0 interrupt */
 	val = readl(timer_base + TIMER_IRQ_EN_REG);
 	writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
-
-	sun4i_clockevent.cpumask = cpu_possible_mask;
-	sun4i_clockevent.irq = irq;
-
-	clockevents_config_and_register(&sun4i_clockevent, rate,
-					TIMER_SYNC_TICKS, 0xffffffff);
 }
 CLOCKSOURCE_OF_DECLARE(sun4i, "allwinner,sun4i-a10-timer",
 		       sun4i_timer_init);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 041/168] MIPS: IP27: Fix __node_distances undefined error
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (39 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 040/168] clockevent: sun4i: Fix race condition in the probe code Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 042/168] MIPS: oprofile: Fix backtrace on 64-bit kernel Luis Henriques
                   ` (126 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: James Cowgill, Ralf Baechle, Luis Henriques

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

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

From: James Cowgill <James.Cowgill@imgtec.com>

commit 5829b0ecc584d15ae4eeabe69f2ab554bdec4689 upstream.

export the __node_distances symbol in the ip27 memory code to fix the
build error:

  Building modules, stage 2.
  MODPOST 311 modules
ERROR: "__node_distances" [drivers/block/nvme.ko] undefined!
scripts/Makefile.modpost:90: recipe for target '__modpost' failed

when building the kernel with:
 CONFIG_SGI_IP27=y
 CONFIG_BLK_DEV_NVME=m

Signed-off-by: James Cowgill <James.Cowgill@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/sgi-ip27/ip27-memory.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index a95c00f5fb96..a304bcc37e4f 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -107,6 +107,7 @@ static void router_recurse(klrou_t *router_a, klrou_t *router_b, int depth)
 }
 
 unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
+EXPORT_SYMBOL(__node_distances);
 
 static int __init compute_node_distance(nasid_t nasid_a, nasid_t nasid_b)
 {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 042/168] MIPS: oprofile: Fix backtrace on 64-bit kernel
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (40 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 041/168] MIPS: IP27: Fix __node_distances undefined error Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 043/168] MIPS: asm: uaccess: Add v1 register to clobber list on EVA Luis Henriques
                   ` (125 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aaro Koskinen, linux-mips, Ralf Baechle, Luis Henriques

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

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

From: Aaro Koskinen <aaro.koskinen@nsn.com>

commit bbaf113a481b6ce32444c125807ad3618643ce57 upstream.

Fix incorrect cast that always results in wrong address for the new
frame on 64-bit kernels.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8110/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/oprofile/backtrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/oprofile/backtrace.c b/arch/mips/oprofile/backtrace.c
index 6854ed5097d2..83a1dfd8f0e3 100644
--- a/arch/mips/oprofile/backtrace.c
+++ b/arch/mips/oprofile/backtrace.c
@@ -92,7 +92,7 @@ static inline int unwind_user_frame(struct stackframe *old_frame,
 				/* This marks the end of the previous function,
 				   which means we overran. */
 				break;
-			stack_size = (unsigned) stack_adjustment;
+			stack_size = (unsigned long) stack_adjustment;
 		} else if (is_ra_save_ins(&ip)) {
 			int ra_slot = ip.i_format.simmediate;
 			if (ra_slot < 0)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 043/168] MIPS: asm: uaccess: Add v1 register to clobber list on EVA
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (41 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 042/168] MIPS: oprofile: Fix backtrace on 64-bit kernel Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 044/168] MIPS: lib: memcpy: Restore NOP on delay slot before returning to caller Luis Henriques
                   ` (124 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Markos Chandras, linux-mips, Ralf Baechle, Luis Henriques

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

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

From: Markos Chandras <markos.chandras@imgtec.com>

commit 58563817cfed0432e9a54476d5fc6c3aeba475e4 upstream.

When EVA is turned on and prefetching is being used in memcpy.S,
the v1 register is being used as a helper register to the PREFE
instruction. However, v1 ($3) was not in the clobber list, which
means that the compiler did not preserve it across function calls,
and that could corrupt the value of the register leading to all
sorts of userland crashes. We fix this problem by using the
DADDI_SCRATCH macro to define the clobbered register when
CONFIG_EVA && CONFIG_CPU_HAS_PREFETCH are enabled.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8510/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/include/asm/uaccess.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
index a10951090234..b9ab717e3619 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -773,10 +773,11 @@ extern void __put_user_unaligned_unknown(void);
 	"jal\t" #destination "\n\t"
 #endif
 
-#ifndef CONFIG_CPU_DADDI_WORKAROUNDS
-#define DADDI_SCRATCH "$0"
-#else
+#if defined(CONFIG_CPU_DADDI_WORKAROUNDS) || (defined(CONFIG_EVA) &&	\
+					      defined(CONFIG_CPU_HAS_PREFETCH))
 #define DADDI_SCRATCH "$3"
+#else
+#define DADDI_SCRATCH "$0"
 #endif
 
 extern size_t __copy_user(void *__to, const void *__from, size_t __n);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 044/168] MIPS: lib: memcpy: Restore NOP on delay slot before returning to caller
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (42 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 043/168] MIPS: asm: uaccess: Add v1 register to clobber list on EVA Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 045/168] btrfs: fix lockups from btrfs_clear_path_blocking Luis Henriques
                   ` (123 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Markos Chandras, linux-mips, Ralf Baechle, Luis Henriques

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

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

From: Markos Chandras <markos.chandras@imgtec.com>

commit 51b1029d9966060c6ad02030e6f251425b4f06c1 upstream.

Commit cf62a8b8134dd3 ("MIPS: lib: memcpy: Use macro to build the
copy_user code") switched to a macro in order to build the memcpy
symbols in preparation for the EVA support. However, this commit
also removed the NOP instruction after the 'jr ra' when returning
back to the caller. This had no visible side-effects since the next
instruction was a load to the t0 register which was already in the
clobbered list, but it may have undesired effects in the future
if some other code is introduced in between the .Ldone and
the .Ll_exc_copy labels.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8512/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/lib/memcpy.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index c17ef80cf65a..5d3238af9b5c 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -503,6 +503,7 @@
 	STOREB(t0, NBYTES-2(dst), .Ls_exc_p1\@)
 .Ldone\@:
 	jr	ra
+	 nop
 	.if __memcpy == 1
 	END(memcpy)
 	.set __memcpy, 0
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 045/168] btrfs: fix lockups from btrfs_clear_path_blocking
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (43 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 044/168] MIPS: lib: memcpy: Restore NOP on delay slot before returning to caller Luis Henriques
@ 2014-12-15 14:24 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 046/168] PCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t Luis Henriques
                   ` (122 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:24 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Mason, Josef Bacik, Luis Henriques

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

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

From: Chris Mason <clm@fb.com>

commit f82c458a2c3ffb94b431fc6ad791a79df1b3713e upstream.

The fair reader/writer locks mean that btrfs_clear_path_blocking needs
to strictly follow lock ordering rules even when we already have
blocking locks on a given path.

Before we can clear a blocking lock on the path, we need to make sure
all of the locks have been converted to blocking.  This will remove lock
inversions against anyone spinning in write_lock() against the buffers
we're trying to get read locks on.  These inversions didn't exist before
the fair read/writer locks, but now we need to be more careful.

We papered over this deadlock in the past by changing
btrfs_try_read_lock() to be a true trylock against both the spinlock and
the blocking lock.  This was slower, and not sufficient to fix all the
deadlocks.  This patch adds a btrfs_tree_read_lock_atomic(), which
basically means get the spinlock but trylock on the blocking lock.

Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Reported-by: Patrick Schmid <schmid@phys.ethz.ch>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/btrfs/ctree.c   | 14 ++------------
 fs/btrfs/locking.c | 24 +++++++++++++++++++++---
 fs/btrfs/locking.h |  2 ++
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index aeab453b8e24..0e4361805944 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -80,13 +80,6 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p,
 {
 	int i;
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-	/* lockdep really cares that we take all of these spinlocks
-	 * in the right order.  If any of the locks in the path are not
-	 * currently blocking, it is going to complain.  So, make really
-	 * really sure by forcing the path to blocking before we clear
-	 * the path blocking.
-	 */
 	if (held) {
 		btrfs_set_lock_blocking_rw(held, held_rw);
 		if (held_rw == BTRFS_WRITE_LOCK)
@@ -95,7 +88,6 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p,
 			held_rw = BTRFS_READ_LOCK_BLOCKING;
 	}
 	btrfs_set_path_blocking(p);
-#endif
 
 	for (i = BTRFS_MAX_LEVEL - 1; i >= 0; i--) {
 		if (p->nodes[i] && p->locks[i]) {
@@ -107,10 +99,8 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p,
 		}
 	}
 
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
 	if (held)
 		btrfs_clear_lock_blocking_rw(held, held_rw);
-#endif
 }
 
 /* this also releases the path */
@@ -2902,7 +2892,7 @@ cow_done:
 					}
 					p->locks[level] = BTRFS_WRITE_LOCK;
 				} else {
-					err = btrfs_try_tree_read_lock(b);
+					err = btrfs_tree_read_lock_atomic(b);
 					if (!err) {
 						btrfs_set_path_blocking(p);
 						btrfs_tree_read_lock(b);
@@ -3034,7 +3024,7 @@ again:
 			}
 
 			level = btrfs_header_level(b);
-			err = btrfs_try_tree_read_lock(b);
+			err = btrfs_tree_read_lock_atomic(b);
 			if (!err) {
 				btrfs_set_path_blocking(p);
 				btrfs_tree_read_lock(b);
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
index 5665d2149249..f8229ef1b46d 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -128,6 +128,26 @@ again:
 }
 
 /*
+ * take a spinning read lock.
+ * returns 1 if we get the read lock and 0 if we don't
+ * this won't wait for blocking writers
+ */
+int btrfs_tree_read_lock_atomic(struct extent_buffer *eb)
+{
+	if (atomic_read(&eb->blocking_writers))
+		return 0;
+
+	read_lock(&eb->lock);
+	if (atomic_read(&eb->blocking_writers)) {
+		read_unlock(&eb->lock);
+		return 0;
+	}
+	atomic_inc(&eb->read_locks);
+	atomic_inc(&eb->spinning_readers);
+	return 1;
+}
+
+/*
  * returns 1 if we get the read lock and 0 if we don't
  * this won't wait for blocking writers
  */
@@ -158,9 +178,7 @@ int btrfs_try_tree_write_lock(struct extent_buffer *eb)
 	    atomic_read(&eb->blocking_readers))
 		return 0;
 
-	if (!write_trylock(&eb->lock))
-		return 0;
-
+	write_lock(&eb->lock);
 	if (atomic_read(&eb->blocking_writers) ||
 	    atomic_read(&eb->blocking_readers)) {
 		write_unlock(&eb->lock);
diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h
index b81e0e9a4894..c44a9d5f5362 100644
--- a/fs/btrfs/locking.h
+++ b/fs/btrfs/locking.h
@@ -35,6 +35,8 @@ void btrfs_clear_lock_blocking_rw(struct extent_buffer *eb, int rw);
 void btrfs_assert_tree_locked(struct extent_buffer *eb);
 int btrfs_try_tree_read_lock(struct extent_buffer *eb);
 int btrfs_try_tree_write_lock(struct extent_buffer *eb);
+int btrfs_tree_read_lock_atomic(struct extent_buffer *eb);
+
 
 static inline void btrfs_tree_unlock_rw(struct extent_buffer *eb, int rw)
 {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 046/168] PCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (44 preceding siblings ...)
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 045/168] btrfs: fix lockups from btrfs_clear_path_blocking Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 047/168] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up Luis Henriques
                   ` (121 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yinghai Lu, Bjorn Helgaas, Luis Henriques

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

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

From: Yinghai Lu <yinghai@kernel.org>

commit 7fc986d8a9727e5d40da3c2c1c343da6142e82a9 upstream.

Aaron reported that a 32-bit x86 kernel with Physical Address Extension
(PAE) support complains about bridge prefetchable memory windows above 4GB:

  pci_bus 0000:00: root bus resource [mem 0x380000000000-0x383fffffffff]
  ...
  pci 0000:03:00.0: reg 0x10: [mem 0x383fffc00000-0x383fffdfffff 64bit pref]
  pci 0000:03:00.0: reg 0x20: [mem 0x383fffe04000-0x383fffe07fff 64bit pref]
  pci 0000:03:00.1: reg 0x10: [mem 0x383fffa00000-0x383fffbfffff 64bit pref]
  pci 0000:03:00.1: reg 0x20: [mem 0x383fffe00000-0x383fffe03fff 64bit pref]
  pci 0000:00:02.2: PCI bridge to [bus 03-04]
  pci 0000:00:02.2:   bridge window [io  0x1000-0x1fff]
  pci 0000:00:02.2:   bridge window [mem 0x91900000-0x91cfffff]
  pci 0000:00:02.2: can't handle 64-bit address space for bridge

In this kernel, unsigned long is 32 bits and dma_addr_t is 64 bits.
Previously we used "unsigned long" to hold the bridge window address.  But
this is a bus address, so we should use dma_addr_t instead.

Use dma_addr_t to hold the bridge window base and limit.

The question of whether the CPU can actually *address* the window is
separate and depends on what the physical address space of the CPU is and
whether the host bridge does any address translation.

[bhelgaas: fix "shift count > width of type", changelog, stable tag]
Fixes: d56dbf5bab8c ("PCI: Allocate 64-bit BARs above 4G when possible")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=88131
Reported-by: Aaron Ma <mapengyu@gmail.com>
Tested-by: Aaron Ma <mapengyu@gmail.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/pci/probe.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4170113cde61..9cce960029aa 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -406,15 +406,16 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child)
 {
 	struct pci_dev *dev = child->self;
 	u16 mem_base_lo, mem_limit_lo;
-	unsigned long base, limit;
+	u64 base64, limit64;
+	dma_addr_t base, limit;
 	struct pci_bus_region region;
 	struct resource *res;
 
 	res = child->resource[2];
 	pci_read_config_word(dev, PCI_PREF_MEMORY_BASE, &mem_base_lo);
 	pci_read_config_word(dev, PCI_PREF_MEMORY_LIMIT, &mem_limit_lo);
-	base = ((unsigned long) mem_base_lo & PCI_PREF_RANGE_MASK) << 16;
-	limit = ((unsigned long) mem_limit_lo & PCI_PREF_RANGE_MASK) << 16;
+	base64 = (mem_base_lo & PCI_PREF_RANGE_MASK) << 16;
+	limit64 = (mem_limit_lo & PCI_PREF_RANGE_MASK) << 16;
 
 	if ((mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) {
 		u32 mem_base_hi, mem_limit_hi;
@@ -428,17 +429,20 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child)
 		 * this, just assume they are not being used.
 		 */
 		if (mem_base_hi <= mem_limit_hi) {
-#if BITS_PER_LONG == 64
-			base |= ((unsigned long) mem_base_hi) << 32;
-			limit |= ((unsigned long) mem_limit_hi) << 32;
-#else
-			if (mem_base_hi || mem_limit_hi) {
-				dev_err(&dev->dev, "can't handle 64-bit address space for bridge\n");
-				return;
-			}
-#endif
+			base64 |= (u64) mem_base_hi << 32;
+			limit64 |= (u64) mem_limit_hi << 32;
 		}
 	}
+
+	base = (dma_addr_t) base64;
+	limit = (dma_addr_t) limit64;
+
+	if (base != base64) {
+		dev_err(&dev->dev, "can't handle bridge window above 4GB (bus address %#010llx)\n",
+			(unsigned long long) base64);
+		return;
+	}
+
 	if (base <= limit) {
 		res->flags = (mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) |
 					 IORESOURCE_MEM | IORESOURCE_PREFETCH;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 047/168] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (45 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 046/168] PCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 048/168] IB/isert: Adjust CQ size to HW limits Luis Henriques
                   ` (120 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Rafael J. Wysocki, Luis Henriques

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

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

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

commit 78579b7c7eb45f0e7ec5e9437087ed21749f9a9c upstream.

As reported by Dmitry, on some Chromebooks there are devices with
corresponding ACPI objects and with unusual system wakeup
configuration.  Namely, they technically are wakeup-capable, but the
wakeup is handled via a platform-specific out-of-band mechanism and
the ACPI PM layer has no information on the wakeup capability.  As
a result, device_may_wakeup(dev) called from acpi_dev_suspend_late()
returns 'true' for those devices, but the wakeup.flags.valid flag is
unset for the corresponding ACPI device objects, so acpi_device_wakeup()
reproducibly fails for them causing acpi_dev_suspend_late() to return
an error code.  The entire system suspend is then aborted and the
machines in question cannot suspend at all.

Address the problem by ignoring the device_may_wakeup(dev) return
value in acpi_dev_suspend_late() if the ACPI companion of the device
being handled has wakeup.flags.valid unset (in which case it is clear
that the wakeup is supposed to be handled by other means).

This fixes a regression introduced by commit a76e9bd89ae7 (i2c:
attach/detach I2C client device to the ACPI power domain) as the
affected systems could suspend and resume successfully before that
commit.

Fixes: a76e9bd89ae7 (i2c: attach/detach I2C client device to the ACPI power domain)
Reported-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/acpi/device_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 49a51277f81d..9ea7b99bc9a0 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -859,7 +859,7 @@ int acpi_dev_suspend_late(struct device *dev)
 		return 0;
 
 	target_state = acpi_target_system_state();
-	wakeup = device_may_wakeup(dev);
+	wakeup = device_may_wakeup(dev) && acpi_device_can_wakeup(adev);
 	error = __acpi_device_sleep_wake(adev, target_state, wakeup);
 	if (wakeup && error)
 		return error;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 048/168] IB/isert: Adjust CQ size to HW limits
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (46 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 047/168] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 049/168] drm/radeon: fix endian swapping in vbios fetch for tdp table Luis Henriques
                   ` (119 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Moore, Nicholas Bellinger, Luis Henriques

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

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

From: Chris Moore <Chris.Moore@Emulex.Com>

commit b1a5ad006b34ded9dc7ec64988deba1b3ecad367 upstream.

isert has an issue of trying to create a CQ with more CQEs than are
supported by the hardware, that currently results in failures during
isert_device creation during first session login.

This is the isert version of the patch that Minh Tran submitted for
iser, and is simple a workaround required to function with existing
ocrdma hardware.

Signed-off-by: Chris Moore <chris.moore@emulex.com>
Reviewied-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 1e2c7ad50992..c83b77e4546f 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -228,12 +228,16 @@ isert_create_device_ib_res(struct isert_device *device)
 	struct isert_cq_desc *cq_desc;
 	struct ib_device_attr *dev_attr;
 	int ret = 0, i, j;
+	int max_rx_cqe, max_tx_cqe;
 
 	dev_attr = &device->dev_attr;
 	ret = isert_query_device(ib_dev, dev_attr);
 	if (ret)
 		return ret;
 
+	max_rx_cqe = min(ISER_MAX_RX_CQ_LEN, dev_attr->max_cqe);
+	max_tx_cqe = min(ISER_MAX_TX_CQ_LEN, dev_attr->max_cqe);
+
 	/* asign function handlers */
 	if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS &&
 	    dev_attr->device_cap_flags & IB_DEVICE_SIGNATURE_HANDOVER) {
@@ -275,7 +279,7 @@ isert_create_device_ib_res(struct isert_device *device)
 						isert_cq_rx_callback,
 						isert_cq_event_callback,
 						(void *)&cq_desc[i],
-						ISER_MAX_RX_CQ_LEN, i);
+						max_rx_cqe, i);
 		if (IS_ERR(device->dev_rx_cq[i])) {
 			ret = PTR_ERR(device->dev_rx_cq[i]);
 			device->dev_rx_cq[i] = NULL;
@@ -287,7 +291,7 @@ isert_create_device_ib_res(struct isert_device *device)
 						isert_cq_tx_callback,
 						isert_cq_event_callback,
 						(void *)&cq_desc[i],
-						ISER_MAX_TX_CQ_LEN, i);
+						max_tx_cqe, i);
 		if (IS_ERR(device->dev_tx_cq[i])) {
 			ret = PTR_ERR(device->dev_tx_cq[i]);
 			device->dev_tx_cq[i] = NULL;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 049/168] drm/radeon: fix endian swapping in vbios fetch for tdp table
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (47 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 048/168] IB/isert: Adjust CQ size to HW limits Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 050/168] x86_64, traps: Stop using IST for #SS Luis Henriques
                   ` (118 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 28731d5818ae25b92d1fb82fe0ac196e97102c1b upstream.

Value needs to be swapped on BE.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/r600_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/r600_dpm.c b/drivers/gpu/drm/radeon/r600_dpm.c
index 9c61b74ef441..e961be55348a 100644
--- a/drivers/gpu/drm/radeon/r600_dpm.c
+++ b/drivers/gpu/drm/radeon/r600_dpm.c
@@ -1255,7 +1255,7 @@ int r600_parse_extended_power_table(struct radeon_device *rdev)
 					(mode_info->atom_context->bios + data_offset +
 					 le16_to_cpu(ext_hdr->usPowerTuneTableOffset));
 				rdev->pm.dpm.dyn_state.cac_tdp_table->maximum_power_delivery_limit =
-					ppt->usMaximumPowerDeliveryLimit;
+					le16_to_cpu(ppt->usMaximumPowerDeliveryLimit);
 				pt = &ppt->power_tune_table;
 			} else {
 				ATOM_PPLIB_POWERTUNE_Table *ppt = (ATOM_PPLIB_POWERTUNE_Table *)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 050/168] x86_64, traps: Stop using IST for #SS
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (48 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 049/168] drm/radeon: fix endian swapping in vbios fetch for tdp table Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 051/168] fold swapping ->d_name.hash into switch_names() Luis Henriques
                   ` (117 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andy Lutomirski, Linus Torvalds, Luis Henriques

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

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

From: Andy Lutomirski <luto@amacapital.net>

commit 6f442be2fb22be02cafa606f1769fa1e6f894441 upstream.

On a 32-bit kernel, this has no effect, since there are no IST stacks.

On a 64-bit kernel, #SS can only happen in user code, on a failed iret
to user space, a canonical violation on access via RSP or RBP, or a
genuine stack segment violation in 32-bit kernel code.  The first two
cases don't need IST, and the latter two cases are unlikely fatal bugs,
and promoting them to double faults would be fine.

This fixes a bug in which the espfix64 code mishandles a stack segment
violation.

This saves 4k of memory per CPU and a tiny bit of code.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/include/asm/page_32_types.h |  1 -
 arch/x86/include/asm/page_64_types.h | 11 +++++------
 arch/x86/include/asm/traps.h         |  1 +
 arch/x86/kernel/dumpstack_64.c       |  1 -
 arch/x86/kernel/entry_64.S           |  2 +-
 arch/x86/kernel/traps.c              | 18 +-----------------
 6 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h
index f48b17df4224..3a52ee0e726d 100644
--- a/arch/x86/include/asm/page_32_types.h
+++ b/arch/x86/include/asm/page_32_types.h
@@ -20,7 +20,6 @@
 #define THREAD_SIZE_ORDER	1
 #define THREAD_SIZE		(PAGE_SIZE << THREAD_SIZE_ORDER)
 
-#define STACKFAULT_STACK 0
 #define DOUBLEFAULT_STACK 1
 #define NMI_STACK 0
 #define DEBUG_STACK 0
diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
index 678205195ae1..75450b2c7be4 100644
--- a/arch/x86/include/asm/page_64_types.h
+++ b/arch/x86/include/asm/page_64_types.h
@@ -14,12 +14,11 @@
 #define IRQ_STACK_ORDER 2
 #define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER)
 
-#define STACKFAULT_STACK 1
-#define DOUBLEFAULT_STACK 2
-#define NMI_STACK 3
-#define DEBUG_STACK 4
-#define MCE_STACK 5
-#define N_EXCEPTION_STACKS 5  /* hw limit: 7 */
+#define DOUBLEFAULT_STACK 1
+#define NMI_STACK 2
+#define DEBUG_STACK 3
+#define MCE_STACK 4
+#define N_EXCEPTION_STACKS 4  /* hw limit: 7 */
 
 #define PUD_PAGE_SIZE		(_AC(1, UL) << PUD_SHIFT)
 #define PUD_PAGE_MASK		(~(PUD_PAGE_SIZE-1))
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index bc8352e7010a..707adc6549d8 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -39,6 +39,7 @@ asmlinkage void simd_coprocessor_error(void);
 
 #ifdef CONFIG_TRACING
 asmlinkage void trace_page_fault(void);
+#define trace_stack_segment stack_segment
 #define trace_divide_error divide_error
 #define trace_bounds bounds
 #define trace_invalid_op invalid_op
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 1abcb50b48ae..ff86f19b5758 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -24,7 +24,6 @@ static char x86_stack_ids[][8] = {
 		[ DEBUG_STACK-1			]	= "#DB",
 		[ NMI_STACK-1			]	= "NMI",
 		[ DOUBLEFAULT_STACK-1		]	= "#DF",
-		[ STACKFAULT_STACK-1		]	= "#SS",
 		[ MCE_STACK-1			]	= "#MC",
 #if DEBUG_STKSZ > EXCEPTION_STKSZ
 		[ N_EXCEPTION_STACKS ...
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index c844f0816ab8..1b1d9ab375a5 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1303,7 +1303,7 @@ apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
 
 idtentry debug do_debug has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK
 idtentry int3 do_int3 has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK
-idtentry stack_segment do_stack_segment has_error_code=1 paranoid=1
+idtentry stack_segment do_stack_segment has_error_code=1
 #ifdef CONFIG_XEN
 idtentry xen_debug do_debug has_error_code=0
 idtentry xen_int3 do_int3 has_error_code=0
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 0d0e922fafc1..0eafe9ea2494 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -233,27 +233,11 @@ DO_ERROR(X86_TRAP_UD,     SIGILL,  "invalid opcode",		invalid_op)
 DO_ERROR(X86_TRAP_OLD_MF, SIGFPE,  "coprocessor segment overrun",coprocessor_segment_overrun)
 DO_ERROR(X86_TRAP_TS,     SIGSEGV, "invalid TSS",		invalid_TSS)
 DO_ERROR(X86_TRAP_NP,     SIGBUS,  "segment not present",	segment_not_present)
-#ifdef CONFIG_X86_32
 DO_ERROR(X86_TRAP_SS,     SIGBUS,  "stack segment",		stack_segment)
-#endif
 DO_ERROR(X86_TRAP_AC,     SIGBUS,  "alignment check",		alignment_check)
 
 #ifdef CONFIG_X86_64
 /* Runs on IST stack */
-dotraplinkage void do_stack_segment(struct pt_regs *regs, long error_code)
-{
-	enum ctx_state prev_state;
-
-	prev_state = exception_enter();
-	if (notify_die(DIE_TRAP, "stack segment", regs, error_code,
-		       X86_TRAP_SS, SIGBUS) != NOTIFY_STOP) {
-		preempt_conditional_sti(regs);
-		do_trap(X86_TRAP_SS, SIGBUS, "stack segment", regs, error_code, NULL);
-		preempt_conditional_cli(regs);
-	}
-	exception_exit(prev_state);
-}
-
 dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
 {
 	static const char str[] = "double fault";
@@ -778,7 +762,7 @@ void __init trap_init(void)
 	set_intr_gate(X86_TRAP_OLD_MF, coprocessor_segment_overrun);
 	set_intr_gate(X86_TRAP_TS, invalid_TSS);
 	set_intr_gate(X86_TRAP_NP, segment_not_present);
-	set_intr_gate_ist(X86_TRAP_SS, &stack_segment, STACKFAULT_STACK);
+	set_intr_gate(X86_TRAP_SS, stack_segment);
 	set_intr_gate(X86_TRAP_GP, general_protection);
 	set_intr_gate(X86_TRAP_SPURIOUS, spurious_interrupt_bug);
 	set_intr_gate(X86_TRAP_MF, coprocessor_error);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 051/168] fold swapping ->d_name.hash into switch_names()
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (49 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 050/168] x86_64, traps: Stop using IST for #SS Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25   ` Luis Henriques
                   ` (116 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Torvalds, Al Viro, Stefan Bader, Luis Henriques

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

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

From: Linus Torvalds <torvalds@linux-foundation.org>

commit a28ddb87cdddb0db57466ba7f59f831002f4340c upstream.

and do it along with ->d_name.len there

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
[ luis: used Stefan's backport to 3.16 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/dcache.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index f9cec9d4dbe0..8a7dcc895d99 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2441,7 +2441,7 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
 			}
 		}
 	}
-	swap(dentry->d_name.len, target->d_name.len);
+	swap(dentry->d_name.hash_len, target->d_name.hash_len);
 }
 
 static void dentry_lock_for_move(struct dentry *dentry, struct dentry *target)
@@ -2540,7 +2540,6 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
 
 	/* Switch the names.. */
 	switch_names(dentry, target);
-	swap(dentry->d_name.hash, target->d_name.hash);
 
 	/* ... and switch the parents */
 	if (IS_ROOT(dentry)) {
@@ -2679,7 +2678,6 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
 	dparent = dentry->d_parent;
 
 	switch_names(dentry, anon);
-	swap(dentry->d_name.hash, anon->d_name.hash);
 
 	dentry->d_parent = dentry;
 	list_del_init(&dentry->d_u.d_child);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 052/168] vfs: Don't exchange "short" filenames unconditionally.
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
@ 2014-12-15 14:25   ` Luis Henriques
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 002/168] sparc64: Fix constraints on swab helpers Luis Henriques
                     ` (166 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Torvalds, Alexander Viro, linux-fsdevel, Mikhail Efremov,
	Stefan Bader, Luis Henriques

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

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

From: Mikhail Efremov <sem@altlinux.org>

commit d2fa4a8476b911782f7e5167db18770222ac40c3 upstream.

Only exchange source and destination filenames
if flags contain RENAME_EXCHANGE.
In case if executable file was running and replaced by
other file /proc/PID/exe should still show correct file name,
not the old name of the file by which it was replaced.

The scenario when this bug manifests itself was like this:
* ALT Linux uses rpm and start-stop-daemon;
* during a package upgrade rpm creates a temporary file
  for an executable to rename it upon successful unpacking;
* start-stop-daemon is run subsequently and it obtains
  the (nonexistant) temporary filename via /proc/PID/exe
  thus failing to identify the running process.

Note that "long" filenames (> DNAiME_INLINE_LEN) are still
exchanged without RENAME_EXCHANGE and this behaviour exists
long enough (should be fixed too apparently).
So this patch is just an interim workaround that restores
behavior for "short" names as it was before changes
introduced by commit da1ce0670c14 ("vfs: add cross-rename").

See https://lkml.org/lkml/2014/9/7/6 for details.

AV: the comments about being more careful with ->d_name.hash
than with ->d_name.name are from back in 2.3.40s; they
became obsolete by 2.3.60s, when we started to unhash the
target instead of swapping hash chain positions followed
by d_delete() as we used to do when dcache was first
introduced.

Acked-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Fixes: da1ce0670c14 "vfs: add cross-rename"
Signed-off-by: Mikhail Efremov <sem@altlinux.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
[ luis: used Stefan's backport to 3.16 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/dcache.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 8a7dcc895d99..1d8b6a310822 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2401,7 +2401,8 @@ void dentry_update_name_case(struct dentry *dentry, struct qstr *name)
 }
 EXPORT_SYMBOL(dentry_update_name_case);
 
-static void switch_names(struct dentry *dentry, struct dentry *target)
+static void switch_names(struct dentry *dentry, struct dentry *target,
+			 bool exchange)
 {
 	if (dname_external(target)) {
 		if (dname_external(dentry)) {
@@ -2435,6 +2436,12 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
 			 */
 			unsigned int i;
 			BUILD_BUG_ON(!IS_ALIGNED(DNAME_INLINE_LEN, sizeof(long)));
+			if (!exchange) {
+				memcpy(dentry->d_iname, target->d_name.name,
+						target->d_name.len + 1);
+				dentry->d_name.hash_len = target->d_name.hash_len;
+				return;
+			}
 			for (i = 0; i < DNAME_INLINE_LEN / sizeof(long); i++) {
 				swap(((long *) &dentry->d_iname)[i],
 				     ((long *) &target->d_iname)[i]);
@@ -2484,12 +2491,15 @@ static void dentry_unlock_parents_for_move(struct dentry *dentry,
  * When switching names, the actual string doesn't strictly have to
  * be preserved in the target - because we're dropping the target
  * anyway. As such, we can just do a simple memcpy() to copy over
- * the new name before we switch.
- *
- * Note that we have to be a lot more careful about getting the hash
- * switched - we have to switch the hash value properly even if it
- * then no longer matches the actual (corrupted) string of the target.
- * The hash value has to match the hash queue that the dentry is on..
+ * the new name before we switch, unless we are going to rehash
+ * it.  Note that if we *do* unhash the target, we are not allowed
+ * to rehash it without giving it a new name/hash key - whether
+ * we swap or overwrite the names here, resulting name won't match
+ * the reality in filesystem; it's only there for d_path() purposes.
+ * Note that all of this is happening under rename_lock, so the
+ * any hash lookup seeing it in the middle of manipulations will
+ * be discarded anyway.  So we do not care what happens to the hash
+ * key in that case.
  */
 /*
  * __d_move - move a dentry
@@ -2539,7 +2549,7 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
 	list_del(&target->d_u.d_child);
 
 	/* Switch the names.. */
-	switch_names(dentry, target);
+	switch_names(dentry, target, exchange);
 
 	/* ... and switch the parents */
 	if (IS_ROOT(dentry)) {
@@ -2677,7 +2687,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
 
 	dparent = dentry->d_parent;
 
-	switch_names(dentry, anon);
+	switch_names(dentry, anon, false);
 
 	dentry->d_parent = dentry;
 	list_del_init(&dentry->d_u.d_child);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 052/168] vfs: Don't exchange "short" filenames unconditionally.
@ 2014-12-15 14:25   ` Luis Henriques
  0 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikhail Efremov, Alexander Viro, linux-fsdevel, Linus Torvalds

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

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

From: Mikhail Efremov <sem@altlinux.org>

commit d2fa4a8476b911782f7e5167db18770222ac40c3 upstream.

Only exchange source and destination filenames
if flags contain RENAME_EXCHANGE.
In case if executable file was running and replaced by
other file /proc/PID/exe should still show correct file name,
not the old name of the file by which it was replaced.

The scenario when this bug manifests itself was like this:
* ALT Linux uses rpm and start-stop-daemon;
* during a package upgrade rpm creates a temporary file
  for an executable to rename it upon successful unpacking;
* start-stop-daemon is run subsequently and it obtains
  the (nonexistant) temporary filename via /proc/PID/exe
  thus failing to identify the running process.

Note that "long" filenames (> DNAiME_INLINE_LEN) are still
exchanged without RENAME_EXCHANGE and this behaviour exists
long enough (should be fixed too apparently).
So this patch is just an interim workaround that restores
behavior for "short" names as it was before changes
introduced by commit da1ce0670c14 ("vfs: add cross-rename").

See https://lkml.org/lkml/2014/9/7/6 for details.

AV: the comments about being more careful with ->d_name.hash
than with ->d_name.name are from back in 2.3.40s; they
became obsolete by 2.3.60s, when we started to unhash the
target instead of swapping hash chain positions followed
by d_delete() as we used to do when dcache was first
introduced.

Acked-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Fixes: da1ce0670c14 "vfs: add cross-rename"
Signed-off-by: Mikhail Efremov <sem@altlinux.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
[ luis: used Stefan's backport to 3.16 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/dcache.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 8a7dcc895d99..1d8b6a310822 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2401,7 +2401,8 @@ void dentry_update_name_case(struct dentry *dentry, struct qstr *name)
 }
 EXPORT_SYMBOL(dentry_update_name_case);
 
-static void switch_names(struct dentry *dentry, struct dentry *target)
+static void switch_names(struct dentry *dentry, struct dentry *target,
+			 bool exchange)
 {
 	if (dname_external(target)) {
 		if (dname_external(dentry)) {
@@ -2435,6 +2436,12 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
 			 */
 			unsigned int i;
 			BUILD_BUG_ON(!IS_ALIGNED(DNAME_INLINE_LEN, sizeof(long)));
+			if (!exchange) {
+				memcpy(dentry->d_iname, target->d_name.name,
+						target->d_name.len + 1);
+				dentry->d_name.hash_len = target->d_name.hash_len;
+				return;
+			}
 			for (i = 0; i < DNAME_INLINE_LEN / sizeof(long); i++) {
 				swap(((long *) &dentry->d_iname)[i],
 				     ((long *) &target->d_iname)[i]);
@@ -2484,12 +2491,15 @@ static void dentry_unlock_parents_for_move(struct dentry *dentry,
  * When switching names, the actual string doesn't strictly have to
  * be preserved in the target - because we're dropping the target
  * anyway. As such, we can just do a simple memcpy() to copy over
- * the new name before we switch.
- *
- * Note that we have to be a lot more careful about getting the hash
- * switched - we have to switch the hash value properly even if it
- * then no longer matches the actual (corrupted) string of the target.
- * The hash value has to match the hash queue that the dentry is on..
+ * the new name before we switch, unless we are going to rehash
+ * it.  Note that if we *do* unhash the target, we are not allowed
+ * to rehash it without giving it a new name/hash key - whether
+ * we swap or overwrite the names here, resulting name won't match
+ * the reality in filesystem; it's only there for d_path() purposes.
+ * Note that all of this is happening under rename_lock, so the
+ * any hash lookup seeing it in the middle of manipulations will
+ * be discarded anyway.  So we do not care what happens to the hash
+ * key in that case.
  */
 /*
  * __d_move - move a dentry
@@ -2539,7 +2549,7 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
 	list_del(&target->d_u.d_child);
 
 	/* Switch the names.. */
-	switch_names(dentry, target);
+	switch_names(dentry, target, exchange);
 
 	/* ... and switch the parents */
 	if (IS_ROOT(dentry)) {
@@ -2677,7 +2687,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
 
 	dparent = dentry->d_parent;
 
-	switch_names(dentry, anon);
+	switch_names(dentry, anon, false);
 
 	dentry->d_parent = dentry;
 	list_del_init(&dentry->d_u.d_child);
-- 
2.1.3

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

* [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (51 preceding siblings ...)
  2014-12-15 14:25   ` Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2015-01-11 22:39   ` Ben Hutchings
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 054/168] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH Luis Henriques
                   ` (114 subsequent siblings)
  167 siblings, 1 reply; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Robert Jarzmik, Luis Henriques

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

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

From: Robert Jarzmik <robert.jarzmik@free.fr>

commit cde7fc879969f933614b1256df2625d6ff637bab upstream.

The commit 2111667b4677 ("ARM: pxa: call debug_ll_io_init for
earlyprintk") triggers in the current kernel the attached backtrace on
PXA/tosa early in the boot time when DEBUG_LL is enabled.

It is due to overlap between uart virtual memory defined in
DEBUG_UART_VIRT and mapped by debug_ll_io_init() and peripheral bus
mapped by pxa_map_io at the same address, 0xf2100000.

As hinted by Arnd, map early virtual memory for low level debug on
address 0xf6200000, even if that means 2 virtual mappings will give
access to the pxa internal UARTs (FFUART, BTUART, STUART, ...).

------------[ cut here ]------------
kernel BUG at /home/lumag/linux/mm/vmalloc.c:1143!
Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
Modules linked in:
CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-00032-g8e0d202-dirty #23
task: c062a5a8 ti: c0620000 task.ti: c0620000
PC is at vm_area_add_early+0x54/0x84
LR is at add_static_vm_early+0xc/0x60
pc : [<c03e1100>]    lr : [<c03d9ef4>]    psr: 800001d3
sp : c0621f04  ip : c03efa74  fp : c03edf84
r10: c0637e98  r9 : 40000001  r8 : c03da57c
r7 : c3ffcfb0  r6 : 00000000  r5 : c3ffcfb0  r4 : 02000000
r3 : c3ffcfd8  r2 : f2100000  r1 : f4000000  r0 : c3ffcfb0
Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
Control: 00007977  Table: a0004000  DAC: 00000017
Process swapper (pid: 0, stack limit = 0xc06201c8)
Stack: (0xc0621f04 to 0xc0622000)
1f00:          c3ffcfd8 40000001 c3ffcfd8 c03ee08c c03da570 c03db90c c0637d24
1f20: 00000000 c03ec7cc c066e654 a0700000 000a0700 c03db914 c03db90c c03daf84
1f40: 00000000 000a0000 c0000000 c03ec7cc 000a0700 c0700000 ffff1000 000a3fff
1f60: 00001000 00000007 00000000 c03ec7cc c0008000 c03ed748 c0621fd4 c03d5d18
1f80: 69052d00 a03ec48c 00000000 c03d8ad0 0000006c 00007977 c036c6e8 00000001
1fa0: c0621fd4 c03ed744 c0628000 a0004000 69052d00 a03ec48c 00000000 c03d68d4
1fc0: 00000000 00000000 00000000 00000000 00000000 c03ed748 c0649894 c062801c
1fe0: c03ed744 c062b2f0 a0004000 69052d00 a03ec48c a0008040 00000000 00000000
[<c03e1100>] (vm_area_add_early) from [<c03d9ef4>] (add_static_vm_early+0xc/0x60)
[<c03d9ef4>] (add_static_vm_early) from [<c03da570>] (iotable_init.part.6+0xa8/0xb4)
[<c03da570>] (iotable_init.part.6) from [<c03db914>] (pxa25x_map_io+0x8/0x24)
[<c03db914>] (pxa25x_map_io) from [<c03daf84>] (paging_init+0x744/0x8d8)
[<c03daf84>] (paging_init) from [<c03d8ad0>] (setup_arch+0x354/0x608)
[<c03d8ad0>] (setup_arch) from [<c03d68d4>] (start_kernel+0xa8/0x3dc)
[<c03d68d4>] (start_kernel) from [<a0008040>] (0xa0008040)
Code: e5904008 e0811004 e1520001 2a000005 (e7f001f2)
---[ end trace f24b6c88ae00fa9a ]---
Kernel panic - not syncing: Attempted to kill the idle task!
---[ end Kernel panic - not syncing: Attempted to kill the idle task!

Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Arnd Bergmann <arnd@arndb.de>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/Kconfig.debug                    | 2 +-
 arch/arm/mach-pxa/include/mach/addr-map.h | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 8f90595069a1..1fdb08427db7 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -1118,7 +1118,7 @@ config DEBUG_UART_VIRT
 	default 0xf1600000 if ARCH_INTEGRATOR
 	default 0xf1c28000 if DEBUG_SUNXI_UART0
 	default 0xf1c28400 if DEBUG_SUNXI_UART1
-	default 0xf2100000 if DEBUG_PXA_UART1
+	default 0xf6200000 if DEBUG_PXA_UART1
 	default 0xf4090000 if ARCH_LPC32XX
 	default 0xf4200000 if ARCH_GEMINI
 	default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h
index bbf9df37ad4b..d28fe291233a 100644
--- a/arch/arm/mach-pxa/include/mach/addr-map.h
+++ b/arch/arm/mach-pxa/include/mach/addr-map.h
@@ -39,6 +39,11 @@
 #define DMEMC_SIZE		0x00100000
 
 /*
+ * Reserved space for low level debug virtual addresses within
+ * 0xf6200000..0xf6201000
+ */
+
+/*
  * Internal Memory Controller (PXA27x and later)
  */
 #define IMEMC_PHYS		0x58000000
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 054/168] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (52 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 055/168] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP Luis Henriques
                   ` (113 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: James Ralston, Takashi Iwai, Luis Henriques

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

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

From: James Ralston <james.d.ralston@intel.com>

commit c8b00fd2f4c504a564adcad5b8bd6952ab850b02 upstream.

This patch adds the HD Audio Device IDs for the Intel Sunrise Point PCH.

[the item position rearranged by tiwai]

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/hda_intel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 007849b443d9..050033e2ef9b 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -173,6 +173,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
 			 "{Intel, LPT},"
 			 "{Intel, LPT_LP},"
 			 "{Intel, WPT_LP},"
+			 "{Intel, SPT},"
 			 "{Intel, HPT},"
 			 "{Intel, PBG},"
 			 "{Intel, SCH},"
@@ -1784,6 +1785,9 @@ static const struct pci_device_id azx_ids[] = {
 	/* Wildcat Point-LP */
 	{ PCI_DEVICE(0x8086, 0x9ca0),
 	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+	/* Sunrise Point */
+	{ PCI_DEVICE(0x8086, 0xa170),
+	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
 	/* Haswell */
 	{ PCI_DEVICE(0x8086, 0x0a0c),
 	  .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 055/168] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (53 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 054/168] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 056/168] arm64/crypto: fix makefile rule for aes-glue-%.o Luis Henriques
                   ` (112 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Devin Ryles, Takashi Iwai, Luis Henriques

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

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

From: Devin Ryles <devin.ryles@intel.com>

commit b4565913460cbd7d86c6bd52913dfaa07fa384aa upstream.

This patch adds DeviceIDs for Sunrise Point-LP

Signed-off-by: Devin Ryles <devin.ryles@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/hda_intel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 050033e2ef9b..007a1a8298fc 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -174,6 +174,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
 			 "{Intel, LPT_LP},"
 			 "{Intel, WPT_LP},"
 			 "{Intel, SPT},"
+			 "{Intel, SPT_LP},"
 			 "{Intel, HPT},"
 			 "{Intel, PBG},"
 			 "{Intel, SCH},"
@@ -1788,6 +1789,9 @@ static const struct pci_device_id azx_ids[] = {
 	/* Sunrise Point */
 	{ PCI_DEVICE(0x8086, 0xa170),
 	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+	/* Sunrise Point-LP */
+	{ PCI_DEVICE(0x8086, 0x9d70),
+	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
 	/* Haswell */
 	{ PCI_DEVICE(0x8086, 0x0a0c),
 	  .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 056/168] arm64/crypto: fix makefile rule for aes-glue-%.o
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (54 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 055/168] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 057/168] HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed Luis Henriques
                   ` (111 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andreas Schwab, Ard Biesheuvel, Catalin Marinas, Luis Henriques

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

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

From: Andreas Schwab <schwab@suse.de>

commit 7c2105fbe9658d6cee18751568e29579bb58bfec upstream.

This fixes the following build failure when building with CONFIG_MODVERSIONS
enabled:

  CC [M]  arch/arm64/crypto/aes-glue-ce.o
ld: cannot find arch/arm64/crypto/aes-glue-ce.o: No such file or directory
make[1]: *** [arch/arm64/crypto/aes-ce-blk.o] Error 1
make: *** [arch/arm64/crypto] Error 2

The $(obj)/aes-glue-%.o rule only creates $(obj)/.tmp_aes-glue-ce.o, it
should use if_changed_rule instead of if_changed_dep.

Signed-off-by: Andreas Schwab <schwab@suse.de>
[ardb: mention CONFIG_MODVERSIONS in commit log]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm64/crypto/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/crypto/Makefile b/arch/arm64/crypto/Makefile
index 2070a56ecc46..a3f935fde975 100644
--- a/arch/arm64/crypto/Makefile
+++ b/arch/arm64/crypto/Makefile
@@ -35,4 +35,4 @@ AFLAGS_aes-neon.o	:= -DINTERLEAVE=4
 CFLAGS_aes-glue-ce.o	:= -DUSE_V8_CRYPTO_EXTENSIONS
 
 $(obj)/aes-glue-%.o: $(src)/aes-glue.c FORCE
-	$(call if_changed_dep,cc_o_c)
+	$(call if_changed_rule,cc_o_c)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 057/168] HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (55 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 056/168] arm64/crypto: fix makefile rule for aes-glue-%.o Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 058/168] Bluetooth: Add support for Intel bootloader devices Luis Henriques
                   ` (110 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Reyad Attiyat, Jiri Kosina, Luis Henriques

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

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

From: Reyad Attiyat <reyad.attiyat@gmail.com>

commit 46df9dedabc1541f9c45f94ecd2c3c7ab0c3bf23 upstream.

Set disconnected flag in struct usbhid when a usb device is removed. Check for
disconnected flag before sending urb requests. This prevents a kernel panic
when a hid driver calls hid_hw_request() after removing a usb device.

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
 IP: [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290
 PGD 0
 Oops: 0002 [#1] PREEMPT SMP
 CPU: 2 PID: 39 Comm: khubd Tainted: G          IO  3.16.0-rc5+ #112
 Hardware name: Microsoft Corporation Surface Pro 2/Surface Pro 2, BIOS 2.03.0250 09/06/2013
 task: ffff880118aba6e0 ti: ffff8800daf80000 task.ti: ffff8800daf80000
 RIP: 0010:[<ffffffff8161746f>]  [<ffffffff8161746f>] hid_submit_ctrl+0x7f/0x290
 RSP: 0018:ffff8800daf83750  EFLAGS: 00010086
 RAX: 0000000080000300 RBX: ffff88003f60c000 RCX: 0000000000000000
 RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff880117f78000
 RBP: ffff8800daf83788 R08: 0000000000000001 R09: 0000000000000001
 R10: 0000000000000001 R11: 0000000000000000 R12: ffff880117f78000
 R13: ffff88003f11a290 R14: 000000000000000c R15: ffff880091cb3ab8
 FS:  0000000000000000(0000) GS:ffff88011b000000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000058 CR3: 0000000001c11000 CR4: 00000000001407e0
 Stack:
  ffff880117f3dcd0 ffff880117f78000 ffff88003f60c000 ffff880117f78000
  ffff880117f78000 ffff88003f11a290 0000000000000000 ffff8800daf837b0
  ffffffff81617707 ffff880117f78000 ffff88003f60c000 0000000000000013
 Call Trace:
  [<ffffffff81617707>] usbhid_restart_ctrl_queue+0x87/0x140
  [<ffffffff81617a88>] usbhid_submit_report+0x2c8/0x370
  [<ffffffff81617b4a>] usbhid_request+0x1a/0x30
  [<ffffffffa020edfb>] sensor_hub_set_feature+0x8b/0xd0 [hid_sensor_hub]
  [<ffffffffa02d9084>] hid_sensor_power_state+0x84/0x110 [hid_sensor_trigger]
  [<ffffffffa02d9129>] hid_sensor_data_rdy_trigger_set_state+0x19/0x20 [hid_sensor_trigger]
  [<ffffffffa034d5b7>] iio_triggered_buffer_predisable+0xa7/0xb0 [industrialio]
  [<ffffffffa034cc4a>] iio_disable_all_buffers+0x3a/0xc0 [industrialio]
  [<ffffffffa03487d3>] iio_device_unregister+0x53/0x80 [industrialio]
  [<ffffffffa026c06a>] hid_accel_3d_remove+0x2a/0x50 [hid_sensor_accel_3d]
  [<ffffffff814f433d>] platform_drv_remove+0x1d/0x40
  [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
  [<ffffffff814f1955>] device_release_driver+0x25/0x40
  [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
  [<ffffffff814ed7d6>] device_del+0x136/0x1e0
  [<ffffffff81512190>] ? mfd_cell_disable+0x80/0x80
  [<ffffffff814f41d1>] platform_device_del+0x21/0xc0
  [<ffffffff814f4282>] platform_device_unregister+0x12/0x30
  [<ffffffff815121d3>] mfd_remove_devices_fn+0x43/0x50
  [<ffffffff814ed3e3>] device_for_each_child+0x43/0x70
  [<ffffffff81512105>] mfd_remove_devices+0x25/0x30
  [<ffffffffa020ebd7>] sensor_hub_remove+0x87/0x140 [hid_sensor_hub]
  [<ffffffff81607c5b>] hid_device_remove+0x6b/0xd0
  [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
  [<ffffffff814f1955>] device_release_driver+0x25/0x40
  [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
  [<ffffffff814ed7d6>] device_del+0x136/0x1e0
  [<ffffffff81607d47>] hid_destroy_device+0x27/0x60
  [<ffffffff81616972>] usbhid_disconnect+0x22/0x50
  [<ffffffff81568597>] usb_unbind_interface+0x77/0x2b0
  [<ffffffff814f18bf>] __device_release_driver+0x7f/0xf0
  [<ffffffff814f1955>] device_release_driver+0x25/0x40
  [<ffffffff814f121c>] bus_remove_device+0x11c/0x1a0
  [<ffffffff814ed7d6>] device_del+0x136/0x1e0
  [<ffffffff81565cd1>] usb_disable_device+0x91/0x2a0
  [<ffffffff8155b046>] usb_disconnect+0x96/0x2e0
  [<ffffffff8155d74a>] hub_thread+0xb5a/0x1840

Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/usbhid/hid-core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index d8b69764d5a9..8945c9e551d7 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -538,7 +538,8 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
 	int head;
 	struct usbhid_device *usbhid = hid->driver_data;
 
-	if ((hid->quirks & HID_QUIRK_NOGET) && dir == USB_DIR_IN)
+	if (((hid->quirks & HID_QUIRK_NOGET) && dir == USB_DIR_IN) ||
+		test_bit(HID_DISCONNECTED, &usbhid->iofl))
 		return;
 
 	if (usbhid->urbout && dir == USB_DIR_OUT && report->type == HID_OUTPUT_REPORT) {
@@ -1386,6 +1387,9 @@ static void usbhid_disconnect(struct usb_interface *intf)
 		return;
 
 	usbhid = hid->driver_data;
+	spin_lock_irq(&usbhid->lock);	/* Sync with error and led handlers */
+	set_bit(HID_DISCONNECTED, &usbhid->iofl);
+	spin_unlock_irq(&usbhid->lock);
 	hid_destroy_device(hid);
 	kfree(usbhid);
 }
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 058/168] Bluetooth: Add support for Intel bootloader devices
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (56 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 057/168] HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 059/168] Bluetooth: Handle Intel USB bootloader with buggy interrupt Luis Henriques
                   ` (109 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcel Holtmann, Johan Hedberg, Luis Henriques

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

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

From: Marcel Holtmann <marcel@holtmann.org>

commit 40df783d1ef1989ac454e3dfcda017270b8950e6 upstream.

Intel Bluetooth devices that boot up in bootloader mode can not
be used as generic HCI devices, but their HCI transport is still
valuable and so bring that up as raw-only devices.

T:  Bus=02 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 14 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=0a5a Rev= 0.00
S:  Manufacturer=Intel(R) Corporation
S:  Product=Intel(R) Wilkins Peak 2x2
S:  SerialNumber=001122334455 WP_A0
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/btusb.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 0489a946e68d..1db4a6675151 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -49,7 +49,8 @@ static struct usb_driver btusb_driver;
 #define BTUSB_WRONG_SCO_MTU	0x40
 #define BTUSB_ATH3012		0x80
 #define BTUSB_INTEL		0x100
-#define BTUSB_BCM_PATCHRAM	0x200
+#define BTUSB_INTEL_BOOT	0x200
+#define BTUSB_BCM_PATCHRAM	0x400
 
 static const struct usb_device_id btusb_table[] = {
 	/* Generic Bluetooth USB device */
@@ -121,6 +122,9 @@ static const struct usb_device_id btusb_table[] = {
 	/* IMC Networks - Broadcom based */
 	{ USB_VENDOR_AND_INTERFACE_INFO(0x13d3, 0xff, 0x01, 0x01) },
 
+	/* Intel Bluetooth USB Bootloader (RAM module) */
+	{ USB_DEVICE(0x8087, 0x0a5a), .driver_info = BTUSB_INTEL_BOOT },
+
 	{ }	/* Terminating entry */
 };
 
@@ -1650,6 +1654,9 @@ static int btusb_probe(struct usb_interface *intf,
 	if (id->driver_info & BTUSB_INTEL)
 		hdev->setup = btusb_setup_intel;
 
+	if (id->driver_info & BTUSB_INTEL_BOOT)
+		set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
+
 	/* Interface numbers are hardcoded in the specification */
 	data->isoc = usb_ifnum_to_if(data->udev, 1);
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 059/168] Bluetooth: Handle Intel USB bootloader with buggy interrupt
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (57 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 058/168] Bluetooth: Add support for Intel bootloader devices Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 060/168] Bluetooth: Ignore isochronous endpoints for Intel USB bootloader Luis Henriques
                   ` (108 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcel Holtmann, Johan Hedberg, Luis Henriques

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

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

From: Marcel Holtmann <marcel@holtmann.org>

commit 3a5ef20c979c0f33b6fb2582d04957397a6bf51f upstream.

The interrupt interface for the Intel USB bootloader devices is only
enabled after receiving SetInterface(0, AltSetting=0). When this USB
command is not send, then no HCI events will be received.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/btusb.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 1db4a6675151..9c63e20a46a4 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1699,6 +1699,18 @@ static int btusb_probe(struct usb_interface *intf,
 		data->isoc = NULL;
 	}
 
+	if (id->driver_info & BTUSB_INTEL_BOOT) {
+		/* A bug in the bootloader causes that interrupt interface is
+		 * only enabled after receiving SetInterface(0, AltSetting=0).
+		 */
+		err = usb_set_interface(data->udev, 0, 0);
+		if (err < 0) {
+			BT_ERR("failed to set interface 0, alt 0 %d", err);
+			hci_free_dev(hdev);
+			return err;
+		}
+	}
+
 	if (data->isoc) {
 		err = usb_driver_claim_interface(&btusb_driver,
 							data->isoc, data);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 060/168] Bluetooth: Ignore isochronous endpoints for Intel USB bootloader
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (58 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 059/168] Bluetooth: Handle Intel USB bootloader with buggy interrupt Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 061/168] Bluetooth: Fix endian and alignment issue with ath3k version handling Luis Henriques
                   ` (107 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcel Holtmann, Johan Hedberg, Luis Henriques

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

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

From: Marcel Holtmann <marcel@holtmann.org>

commit d92f2df0565ea04101d6ac04bdc10feeb1d93c94 upstream.

The isochronous endpoints are not valid when the Intel Bluetooth
controller boots up in bootloader mode. So just mark these endpoints
as broken and then they will not be configured.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/btusb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 9c63e20a46a4..72fd005c053d 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -123,7 +123,8 @@ static const struct usb_device_id btusb_table[] = {
 	{ USB_VENDOR_AND_INTERFACE_INFO(0x13d3, 0xff, 0x01, 0x01) },
 
 	/* Intel Bluetooth USB Bootloader (RAM module) */
-	{ USB_DEVICE(0x8087, 0x0a5a), .driver_info = BTUSB_INTEL_BOOT },
+	{ USB_DEVICE(0x8087, 0x0a5a),
+	  .driver_info = BTUSB_INTEL_BOOT | BTUSB_BROKEN_ISOC },
 
 	{ }	/* Terminating entry */
 };
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 061/168] Bluetooth: Fix endian and alignment issue with ath3k version handling
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (59 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 060/168] Bluetooth: Ignore isochronous endpoints for Intel USB bootloader Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 062/168] Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard Luis Henriques
                   ` (106 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcel Holtmann, Johan Hedberg, Luis Henriques

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

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

From: Marcel Holtmann <marcel@holtmann.org>

commit 72dd2b2a44d82118714e0821fa16c65f9e40eb00 upstream.

The ath3k driver is treating the version information badly when it
comes to loading the right firmware version and comparing that it
actually matches with the hardware.

Initially this showed up as this:

  CHECK   drivers/bluetooth/ath3k.c
drivers/bluetooth/ath3k.c:373:17: warning: cast to restricted __le32
drivers/bluetooth/ath3k.c:435:17: warning: cast to restricted __le32

However when fixing this by actually using __packed and __le32 for
the ath3_version structure, more issues came up:

  CHECK   drivers/bluetooth/ath3k.c
drivers/bluetooth/ath3k.c:381:32: warning: incorrect type in assignment (different base types)
drivers/bluetooth/ath3k.c:381:32:    expected restricted __le32 [usertype] rom_version
drivers/bluetooth/ath3k.c:381:32:    got int [signed] <noident>
drivers/bluetooth/ath3k.c:382:34: warning: incorrect type in assignment (different base types)
drivers/bluetooth/ath3k.c:382:34:    expected restricted __le32 [usertype] build_version
drivers/bluetooth/ath3k.c:382:34:    got int [signed] <noident>
drivers/bluetooth/ath3k.c:386:28: warning: restricted __le32 degrades to integer
drivers/bluetooth/ath3k.c:386:56: warning: restricted __le32 degrades to integer

This patch fixes every instance of the firmware version handling and
makes sure it is endian safe and uses proper unaligned access.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/ath3k.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index f50dffc0374f..095c4381f697 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -27,6 +27,7 @@
 #include <linux/device.h>
 #include <linux/firmware.h>
 #include <linux/usb.h>
+#include <asm/unaligned.h>
 #include <net/bluetooth/bluetooth.h>
 
 #define VERSION "1.0"
@@ -50,12 +51,12 @@
 #define ATH3K_NAME_LEN				0xFF
 
 struct ath3k_version {
-	unsigned int	rom_version;
-	unsigned int	build_version;
-	unsigned int	ram_version;
-	unsigned char	ref_clock;
-	unsigned char	reserved[0x07];
-};
+	__le32	rom_version;
+	__le32	build_version;
+	__le32	ram_version;
+	__u8	ref_clock;
+	__u8	reserved[7];
+} __packed;
 
 static const struct usb_device_id ath3k_table[] = {
 	/* Atheros AR3011 */
@@ -347,7 +348,8 @@ static int ath3k_load_patch(struct usb_device *udev)
 	unsigned char fw_state;
 	char filename[ATH3K_NAME_LEN] = {0};
 	const struct firmware *firmware;
-	struct ath3k_version fw_version, pt_version;
+	struct ath3k_version fw_version;
+	__u32 pt_rom_version, pt_build_version;
 	int ret;
 
 	ret = ath3k_get_state(udev, &fw_state);
@@ -368,7 +370,7 @@ static int ath3k_load_patch(struct usb_device *udev)
 	}
 
 	snprintf(filename, ATH3K_NAME_LEN, "ar3k/AthrBT_0x%08x.dfu",
-		le32_to_cpu(fw_version.rom_version));
+		 le32_to_cpu(fw_version.rom_version));
 
 	ret = request_firmware(&firmware, filename, &udev->dev);
 	if (ret < 0) {
@@ -376,12 +378,13 @@ static int ath3k_load_patch(struct usb_device *udev)
 		return ret;
 	}
 
-	pt_version.rom_version = *(int *)(firmware->data + firmware->size - 8);
-	pt_version.build_version = *(int *)
-		(firmware->data + firmware->size - 4);
+	pt_rom_version = get_unaligned_le32(firmware->data +
+					    firmware->size - 8);
+	pt_build_version = get_unaligned_le32(firmware->data +
+					      firmware->size - 4);
 
-	if ((pt_version.rom_version != fw_version.rom_version) ||
-		(pt_version.build_version <= fw_version.build_version)) {
+	if (pt_rom_version != le32_to_cpu(fw_version.rom_version) ||
+	    pt_build_version <= le32_to_cpu(fw_version.build_version)) {
 		BT_ERR("Patch file version did not match with firmware");
 		release_firmware(firmware);
 		return -EINVAL;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 062/168] Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (60 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 061/168] Bluetooth: Fix endian and alignment issue with ath3k version handling Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 063/168] Bluetooth: Fix crash in the Marvell driver initialization codepath Luis Henriques
                   ` (105 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcel Holtmann, Johan Hedberg, Luis Henriques

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

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

From: Marcel Holtmann <marcel@holtmann.org>

commit c2aef6e8cbebd60f79555baeb9266e220f135a44 upstream.

The Asus Z97-DELUXE motherboard contains a Broadcom based Bluetooth
controller on the USB bus. However vendor and product ID are listed
as ASUSTek Computer.

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0b05 ProdID=17cf Rev= 1.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM20702A0
S:  SerialNumber=54271E910064
C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

Reported-by: Jerome Leclanche <jerome@leclan.ch>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/btusb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 72fd005c053d..0663fe85be29 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -116,6 +116,9 @@ static const struct usb_device_id btusb_table[] = {
 	{ USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01),
 	  .driver_info = BTUSB_BCM_PATCHRAM },
 
+	/* ASUSTek Computer - Broadcom based */
+	{ USB_VENDOR_AND_INTERFACE_INFO(0x0b05, 0xff, 0x01, 0x01) },
+
 	/* Belkin F8065bf - Broadcom based */
 	{ USB_VENDOR_AND_INTERFACE_INFO(0x050d, 0xff, 0x01, 0x01) },
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 063/168] Bluetooth: Fix crash in the Marvell driver initialization codepath
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (61 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 062/168] Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 064/168] Bluetooth: Add support for Acer [13D3:3432] Luis Henriques
                   ` (104 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anatol Pomozov, Marcel Holtmann, Luis Henriques

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

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

From: Anatol Pomozov <anatol.pomozov@gmail.com>

commit 8500d791c458ccbbb3e2d3fa9a0320ffd5729069 upstream.

btmrvl_add_card() function calls kthread_run that might return error
(e.g. if current thread is killed). If one tries to use the error
value as a pointer then invalid memory access oops happens.

Check kthread_run() return value, if it is an error then release resources
correctly.

TEST=boot computer with BT modules enabled. I see the error message that
BT device initialization failed. Now kernel does not crash. Hint: to enable
BT run 'rmmod btmrvl_sdio; modprobe btmrvl_sdio'

Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/btmrvl_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 3ecba5c979bd..ae0b48471ffc 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -667,12 +667,17 @@ struct btmrvl_private *btmrvl_add_card(void *card)
 	init_waitqueue_head(&priv->main_thread.wait_q);
 	priv->main_thread.task = kthread_run(btmrvl_service_main_thread,
 				&priv->main_thread, "btmrvl_main_service");
+	if (IS_ERR(priv->main_thread.task))
+		goto err_thread;
 
 	priv->btmrvl_dev.card = card;
 	priv->btmrvl_dev.tx_dnld_rdy = true;
 
 	return priv;
 
+err_thread:
+	btmrvl_free_adapter(priv);
+
 err_adapter:
 	kfree(priv);
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 064/168] Bluetooth: Add support for Acer [13D3:3432]
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (62 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 063/168] Bluetooth: Fix crash in the Marvell driver initialization codepath Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 065/168] Add a new PID/VID 0227/0930 for AR3012 Luis Henriques
                   ` (103 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anantha Krishnan, Marcel Holtmann, Luis Henriques

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

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

From: Anantha Krishnan <ananthk@codeaurora.org>

commit fa2f1394fe9c1a217213f02df77812701de6362f upstream.

Add support for the QCA6174 chip.

    T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 30 Spd=12  MxCh= 0
    D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=13d3 ProdID=3432 Rev=00.02
    C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb

Signed-off-by: Anantha Krishnan <ananthk@codeaurora.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/ath3k.c | 2 ++
 drivers/bluetooth/btusb.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 095c4381f697..6b8c09dc3e55 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -104,6 +104,7 @@ static const struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x13d3, 0x3375) },
 	{ USB_DEVICE(0x13d3, 0x3393) },
 	{ USB_DEVICE(0x13d3, 0x3402) },
+	{ USB_DEVICE(0x13d3, 0x3432) },
 
 	/* Atheros AR5BBU12 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xE02C) },
@@ -153,6 +154,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
 
 	/* Atheros AR5BBU22 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 0663fe85be29..a917f38f03ec 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -183,6 +183,7 @@ static const struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
 
 	/* Atheros AR5BBU12 with sflash firmware */
 	{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 065/168] Add a new PID/VID 0227/0930 for AR3012.
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (63 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 064/168] Bluetooth: Add support for Acer [13D3:3432] Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 066/168] Input: xpad - add VID/PID for Razer Sabertooth Luis Henriques
                   ` (102 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vincent Zwanenburg, Marcel Holtmann, Luis Henriques

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

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

From: Vincent Zwanenburg <vincentz@topmail.ie>

commit 89d2975fa06e66ea0d3665d91f799fb1ce4b8bad upstream.

usb devices info:

T:  Bus=01 Lev=02 Prnt=05 Port=00 Cnt=01 Dev#= 20 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0930 ProdID=0227 Rev= 0.02
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Vincent Zwanenburg <vincentz@topmail.ie>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/ath3k.c | 2 ++
 drivers/bluetooth/btusb.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 6b8c09dc3e55..3a7356a72b53 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -88,6 +88,7 @@ static const struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x04CA, 0x300b) },
 	{ USB_DEVICE(0x0930, 0x0219) },
 	{ USB_DEVICE(0x0930, 0x0220) },
+	{ USB_DEVICE(0x0930, 0x0227) },
 	{ USB_DEVICE(0x0b05, 0x17d0) },
 	{ USB_DEVICE(0x0CF3, 0x0036) },
 	{ USB_DEVICE(0x0CF3, 0x3004) },
@@ -138,6 +139,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index a917f38f03ec..67fa7de5376a 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -167,6 +167,7 @@ static const struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 066/168] Input: xpad - add VID/PID for Razer Sabertooth
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (64 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 065/168] Add a new PID/VID 0227/0930 for AR3012 Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 067/168] Input: xpad - sync device IDs with xboxdrv Luis Henriques
                   ` (101 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Frank Razenberg, Dmitry Torokhov, Luis Henriques

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

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

From: Frank Razenberg <frank@zzattack.org>

commit a7b447380c5c974c740437af82793e450f47304d upstream.

The xpad driver recognizes Razer Sabertooth controllers as generic xbox
controller, while it is really a 360 controller.  This patch adds pid/vid
mappings for the controller so that it is correctly recognized.

Signed-off-by: Frank Razenberg <frank@zzattack.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 603fe0dd3682..a5a1b6f5796b 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -169,6 +169,7 @@ static const struct xpad_device {
 	{ 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 },
 	{ 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 },
 	{ 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 },
 	{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
 	{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
 	{ 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 },
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 067/168] Input: xpad - sync device IDs with xboxdrv
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (65 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 066/168] Input: xpad - add VID/PID for Razer Sabertooth Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 068/168] Input: xpad - add USB ID for Thrustmaster Ferrari 458 Racing Wheel Luis Henriques
                   ` (100 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Benjamin Valentin, Dmitry Torokhov, Luis Henriques

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

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

From: Benjamin Valentin <benpicco@zedat.fu-berlin.de>

commit f554f619b7041e388d46395b1e30b151925a7797 upstream.

The userspace xboxdrv driver knows some more device ids than the kernel.
This patch adds the missing xbox gamepads from [1] to xpad.c

[1] https://github.com/Grumbel/xboxdrv/blob/master/src/xpad_device.cpp

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/joystick/xpad.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index a5a1b6f5796b..229495a936f0 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -124,7 +124,9 @@ static const struct xpad_device {
 	{ 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
 	{ 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
 	{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
+	{ 0x044f, 0xb326, "Thrustmaster Gamepad GP XID", 0, XTYPE_XBOX360 },
 	{ 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 },
+	{ 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 },
 	{ 0x046d, 0xc21f, "Logitech Gamepad F710", 0, XTYPE_XBOX360 },
 	{ 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 },
 	{ 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX },
@@ -138,10 +140,17 @@ static const struct xpad_device {
 	{ 0x0738, 0x4540, "Mad Catz Beat Pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
 	{ 0x0738, 0x4556, "Mad Catz Lynx Wireless Controller", 0, XTYPE_XBOX },
 	{ 0x0738, 0x4716, "Mad Catz Wired Xbox 360 Controller", 0, XTYPE_XBOX360 },
+	{ 0x0738, 0x4718, "Mad Catz Street Fighter IV FightStick SE", 0, XTYPE_XBOX360 },
+	{ 0x0738, 0x4726, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 },
 	{ 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
 	{ 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
+	{ 0x0738, 0x4740, "Mad Catz Beat Pad", 0, XTYPE_XBOX360 },
 	{ 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
+	{ 0x0738, 0xb726, "Mad Catz Xbox controller - MW2", 0, XTYPE_XBOX360 },
 	{ 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", XTYPE_XBOX360 },
+	{ 0x0738, 0xcb02, "Saitek Cyborg Rumble Pad - PC/Xbox 360", 0, XTYPE_XBOX360 },
+	{ 0x0738, 0xcb03, "Saitek P3200 Rumble Pad - PC/Xbox 360", 0, XTYPE_XBOX360 },
+	{ 0x0738, 0xf738, "Super SFIV FightStick TE S", 0, XTYPE_XBOX360 },
 	{ 0x0c12, 0x8802, "Zeroplus Xbox Controller", 0, XTYPE_XBOX },
 	{ 0x0c12, 0x8809, "RedOctane Xbox Dance Pad", DANCEPAD_MAP_CONFIG, XTYPE_XBOX },
 	{ 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX },
@@ -154,29 +163,50 @@ static const struct xpad_device {
 	{ 0x0e6f, 0x0005, "Eclipse wireless Controller", 0, XTYPE_XBOX },
 	{ 0x0e6f, 0x0006, "Edge wireless Controller", 0, XTYPE_XBOX },
 	{ 0x0e6f, 0x0105, "HSM3 Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
+	{ 0x0e6f, 0x0113, "Afterglow AX.1 Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
 	{ 0x0e6f, 0x0201, "Pelican PL-3601 'TSZ' Wired Xbox 360 Controller", 0, XTYPE_XBOX360 },
 	{ 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
+	{ 0x0e6f, 0x021f, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
+	{ 0x0e6f, 0x0301, "Logic3 Controller", 0, XTYPE_XBOX360 },
+	{ 0x0e6f, 0x0401, "Logic3 Controller", 0, XTYPE_XBOX360 },
 	{ 0x0e8f, 0x0201, "SmartJoy Frag Xpad/PS2 adaptor", 0, XTYPE_XBOX },
+	{ 0x0e8f, 0x3008, "Generic xbox control (dealextreme)", 0, XTYPE_XBOX },
+	{ 0x0f0d, 0x000a, "Hori Co. DOA4 FightStick", 0, XTYPE_XBOX360 },
 	{ 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
 	{ 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
 	{ 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
 	{ 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
 	{ 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
 	{ 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
+	{ 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
 	{ 0x12ab, 0x8809, "Xbox DDR dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
 	{ 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", 0, XTYPE_XBOX360 },
 	{ 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
 	{ 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 },
+	{ 0x1532, 0x0037, "Razer Sabertooth", 0, XTYPE_XBOX360 },
+	{ 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },
+	{ 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
+	{ 0x15e4, 0x3f10, "Batarang Xbox 360 controller", 0, XTYPE_XBOX360 },
+	{ 0x162e, 0xbeef, "Joytech Neo-Se Take2", 0, XTYPE_XBOX360 },
 	{ 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 },
 	{ 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 },
 	{ 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 },
 	{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
 	{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
 	{ 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 },
+	{ 0x1bad, 0xf023, "MLG Pro Circuit Controller (Xbox)", 0, XTYPE_XBOX360 },
 	{ 0x1bad, 0xf028, "Street Fighter IV FightPad", 0, XTYPE_XBOX360 },
+	{ 0x1bad, 0xf038, "Street Fighter IV FightStick TE", 0, XTYPE_XBOX360 },
+	{ 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 0, XTYPE_XBOX360 },
 	{ 0x1bad, 0xf901, "Gamestop Xbox 360 Controller", 0, XTYPE_XBOX360 },
 	{ 0x1bad, 0xf903, "Tron Xbox 360 controller", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5000, "Razer Atrox Arcade Stick", 0, XTYPE_XBOX360 },
 	{ 0x24c6, 0x5300, "PowerA MINI PROEX Controller", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5303, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5500, "Hori XBOX 360 EX 2 with Turbo", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5501, "Hori Real Arcade Pro VX-SA", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 },
 	{ 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
 	{ 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
 };
@@ -260,6 +290,9 @@ static struct usb_device_id xpad_table[] = {
 	XPAD_XBOX360_VENDOR(0x0f0d),		/* Hori Controllers */
 	XPAD_XBOX360_VENDOR(0x1689),		/* Razer Onza */
 	XPAD_XBOX360_VENDOR(0x24c6),		/* PowerA Controllers */
+	XPAD_XBOX360_VENDOR(0x1532),		/* Razer Sabertooth */
+	XPAD_XBOX360_VENDOR(0x15e4),		/* Numark X-Box 360 controllers */
+	XPAD_XBOX360_VENDOR(0x162e),		/* Joytech X-Box 360 controllers */
 	{ }
 };
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 068/168] Input: xpad - add USB ID for Thrustmaster Ferrari 458 Racing Wheel
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (66 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 067/168] Input: xpad - sync device IDs with xboxdrv Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 069/168] Input: serio - avoid negative serio device numbers Luis Henriques
                   ` (99 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tommi Rantala, Dmitry Torokhov, Luis Henriques

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

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

From: Tommi Rantala <tt.rantala@gmail.com>

commit 4b54625822eb7a4eae9c5b8c890b6c4dc001b895 upstream.

Add the USB ID for the Xbox 360 Thrustmaster Ferrari 458 Racing Wheel.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 229495a936f0..e383eebbafdd 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -207,6 +207,7 @@ static const struct xpad_device {
 	{ 0x24c6, 0x5501, "Hori Real Arcade Pro VX-SA", 0, XTYPE_XBOX360 },
 	{ 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick", 0, XTYPE_XBOX360 },
 	{ 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 },
+	{ 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
 	{ 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
 	{ 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
 };
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 069/168] Input: serio - avoid negative serio device numbers
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (67 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 068/168] Input: xpad - add USB ID for Thrustmaster Ferrari 458 Racing Wheel Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 070/168] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Luis Henriques
                   ` (98 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Richard Leitner, Dmitry Torokhov, Luis Henriques

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

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

From: Richard Leitner <richard.leitner@skidata.com>

commit 0224ec9e9f111b1c39ec00a10de4858061b4afea upstream.

Fix the format string for serio device name generation to avoid negative
device numbers when the id exceeds the maximum signed integer value.

Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/serio/serio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index b29134de983b..d399b8b0f000 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -524,8 +524,8 @@ static void serio_init_port(struct serio *serio)
 	spin_lock_init(&serio->lock);
 	mutex_init(&serio->drv_mutex);
 	device_initialize(&serio->dev);
-	dev_set_name(&serio->dev, "serio%ld",
-			(long)atomic_inc_return(&serio_no) - 1);
+	dev_set_name(&serio->dev, "serio%lu",
+		     (unsigned long)atomic_inc_return(&serio_no) - 1);
 	serio->dev.bus = &serio_bus;
 	serio->dev.release = serio_release_port;
 	serio->dev.groups = serio_device_attr_groups;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 070/168] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (68 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 069/168] Input: serio - avoid negative serio device numbers Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 071/168] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear Luis Henriques
                   ` (97 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Jeffery, Trond Myklebust, Moritz Mühlenhoff,
	Kamal Mostafa, Luis Henriques

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

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

From: David Jeffery <djeffery@redhat.com>

commit 92a56555bd576c61b27a5cab9f38a33a1e9a1df5 upstream.

If a SIGKILL is sent to a task waiting in __nfs_iocounter_wait,
it will busy-wait or soft lockup in its while loop.
nfs_wait_bit_killable won't sleep, and the loop won't exit on
the error return.

Stop the busy-wait by breaking out of the loop when
nfs_wait_bit_killable returns an error.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[ kamal: backport to 3.13-stable: context ]
Cc: Moritz Mühlenhoff <muehlenhoff@univention.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/pagelist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 3a9c34a0f898..54d049f930f7 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -116,7 +116,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c)
 		if (atomic_read(&c->io_count) == 0)
 			break;
 		ret = nfs_wait_bit_killable(&c->flags);
-	} while (atomic_read(&c->io_count) != 0);
+	} while (atomic_read(&c->io_count) != 0 && !ret);
 	finish_wait(wq, &q.wait);
 	return ret;
 }
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 071/168] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (69 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 070/168] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2015-01-12  0:23   ` [stable] " Ben Hutchings
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 072/168] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE Luis Henriques
                   ` (96 subsequent siblings)
  167 siblings, 1 reply; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Steve Capper, Russell King, Hou Pengyang, Luis Henriques

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

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

From: Steven Capper <steve.capper@linaro.org>

commit f2950706871c4b6e8c0f0d7c3f62d35930b8de63 upstream.

Long descriptors on ARM are 64 bits, and some pte functions such as
pte_dirty return a bitwise-and of a flag with the pte value. If the
flag to be tested resides in the upper 32 bits of the pte, then we run
into the danger of the result being dropped if downcast.

For example:
	gather_stats(page, md, pte_dirty(*pte), 1);
where pte_dirty(*pte) is downcast to an int.

This patch introduces a new macro pte_isset which performs the bitwise
and, then performs a double logical invert (where needed) to ensure
predictable downcasting. The logical inverse pte_isclear is also
introduced.

Equivalent pmd functions for Transparent HugePages have also been
added.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Hou Pengyang <houpengyang@huawei.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/include/asm/pgtable-3level.h | 12 ++++++++----
 arch/arm/include/asm/pgtable.h        | 18 +++++++++++-------
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index 85c60adc8b60..34f371c4bbb2 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -207,17 +207,21 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
 #define pte_huge(pte)		(pte_val(pte) && !(pte_val(pte) & PTE_TABLE_BIT))
 #define pte_mkhuge(pte)		(__pte(pte_val(pte) & ~PTE_TABLE_BIT))
 
-#define pmd_young(pmd)		(pmd_val(pmd) & PMD_SECT_AF)
+#define pmd_isset(pmd, val)	((u32)(val) == (val) ? pmd_val(pmd) & (val) \
+						: !!(pmd_val(pmd) & (val)))
+#define pmd_isclear(pmd, val)	(!(pmd_val(pmd) & (val)))
+
+#define pmd_young(pmd)		(pmd_isset((pmd), PMD_SECT_AF))
 
 #define __HAVE_ARCH_PMD_WRITE
-#define pmd_write(pmd)		(!(pmd_val(pmd) & PMD_SECT_RDONLY))
+#define pmd_write(pmd)		(pmd_isclear((pmd), PMD_SECT_RDONLY))
 
 #define pmd_hugewillfault(pmd)	(!pmd_young(pmd) || !pmd_write(pmd))
 #define pmd_thp_or_huge(pmd)	(pmd_huge(pmd) || pmd_trans_huge(pmd))
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-#define pmd_trans_huge(pmd)	(pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT))
-#define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING)
+#define pmd_trans_huge(pmd)	(pmd_val(pmd) && !pmd_table(pmd))
+#define pmd_trans_splitting(pmd) (pmd_isset((pmd), PMD_SECT_SPLITTING))
 #endif
 
 #define PMD_BIT_FUNC(fn,op) \
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 5478e5d6ad89..01baef07cd0c 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -214,18 +214,22 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
 
 #define pte_clear(mm,addr,ptep)	set_pte_ext(ptep, __pte(0), 0)
 
+#define pte_isset(pte, val)	((u32)(val) == (val) ? pte_val(pte) & (val) \
+						: !!(pte_val(pte) & (val)))
+#define pte_isclear(pte, val)	(!(pte_val(pte) & (val)))
+
 #define pte_none(pte)		(!pte_val(pte))
-#define pte_present(pte)	(pte_val(pte) & L_PTE_PRESENT)
-#define pte_valid(pte)		(pte_val(pte) & L_PTE_VALID)
+#define pte_present(pte)	(pte_isset((pte), L_PTE_PRESENT))
+#define pte_valid(pte)		(pte_isset((pte), L_PTE_VALID))
 #define pte_accessible(mm, pte)	(mm_tlb_flush_pending(mm) ? pte_present(pte) : pte_valid(pte))
-#define pte_write(pte)		(!(pte_val(pte) & L_PTE_RDONLY))
-#define pte_dirty(pte)		(pte_val(pte) & L_PTE_DIRTY)
-#define pte_young(pte)		(pte_val(pte) & L_PTE_YOUNG)
-#define pte_exec(pte)		(!(pte_val(pte) & L_PTE_XN))
+#define pte_write(pte)		(pte_isclear((pte), L_PTE_RDONLY))
+#define pte_dirty(pte)		(pte_isset((pte), L_PTE_DIRTY))
+#define pte_young(pte)		(pte_isset((pte), L_PTE_YOUNG))
+#define pte_exec(pte)		(pte_isclear((pte), L_PTE_XN))
 #define pte_special(pte)	(0)
 
 #define pte_valid_user(pte)	\
-	(pte_valid(pte) && (pte_val(pte) & L_PTE_USER) && pte_young(pte))
+	(pte_valid(pte) && pte_isset((pte), L_PTE_USER) && pte_young(pte))
 
 #if __LINUX_ARM_ARCH__ < 6
 static inline void __sync_icache_dcache(pte_t pteval)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 072/168] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (70 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 071/168] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2015-01-12  0:26   ` Ben Hutchings
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 073/168] aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer Luis Henriques
                   ` (95 subsequent siblings)
  167 siblings, 1 reply; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Steve Capper, Russell King, Hou Pengyang, Luis Henriques

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

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

From: Steven Capper <steve.capper@linaro.org>

commit ded9477984690d026e46dd75e8157392cea3f13f upstream.

For LPAE, we have the following means for encoding writable or dirty
ptes:
                              L_PTE_DIRTY       L_PTE_RDONLY
    !pte_dirty && !pte_write        0               1
    !pte_dirty && pte_write         0               1
    pte_dirty && !pte_write         1               1
    pte_dirty && pte_write          1               0

So we can't distinguish between writeable clean ptes and read only
ptes. This can cause problems with ptes being incorrectly flagged as
read only when they are writeable but not dirty.

This patch renumbers L_PTE_RDONLY from AP[2] to a software bit #58,
and adds additional logic to set AP[2] whenever the pte is read only
or not dirty. That way we can distinguish between clean writeable ptes
and read only ptes.

HugeTLB pages will use this new logic automatically.

We need to add some logic to Transparent HugePages to ensure that they
correctly interpret the revised pgprot permissions (L_PTE_RDONLY has
moved and no longer matches PMD_SECT_AP2). In the process of revising
THP, the names of the PMD software bits have been prefixed with L_ to
make them easier to distinguish from their hardware bit counterparts.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Hou Pengyang <houpengyang@huawei.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/include/asm/pgtable-3level-hwdef.h |  3 ++-
 arch/arm/include/asm/pgtable-3level.h       | 41 +++++++++++++++++------------
 arch/arm/mm/dump.c                          |  4 +--
 arch/arm/mm/proc-v7-3level.S                |  9 +++++--
 4 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h
index 626989fec4d3..9fd61c72a33a 100644
--- a/arch/arm/include/asm/pgtable-3level-hwdef.h
+++ b/arch/arm/include/asm/pgtable-3level-hwdef.h
@@ -43,7 +43,7 @@
 #define PMD_SECT_BUFFERABLE	(_AT(pmdval_t, 1) << 2)
 #define PMD_SECT_CACHEABLE	(_AT(pmdval_t, 1) << 3)
 #define PMD_SECT_USER		(_AT(pmdval_t, 1) << 6)		/* AP[1] */
-#define PMD_SECT_RDONLY		(_AT(pmdval_t, 1) << 7)		/* AP[2] */
+#define PMD_SECT_AP2		(_AT(pmdval_t, 1) << 7)		/* read only */
 #define PMD_SECT_S		(_AT(pmdval_t, 3) << 8)
 #define PMD_SECT_AF		(_AT(pmdval_t, 1) << 10)
 #define PMD_SECT_nG		(_AT(pmdval_t, 1) << 11)
@@ -72,6 +72,7 @@
 #define PTE_TABLE_BIT		(_AT(pteval_t, 1) << 1)
 #define PTE_BUFFERABLE		(_AT(pteval_t, 1) << 2)		/* AttrIndx[0] */
 #define PTE_CACHEABLE		(_AT(pteval_t, 1) << 3)		/* AttrIndx[1] */
+#define PTE_AP2			(_AT(pteval_t, 1) << 7)		/* AP[2] */
 #define PTE_EXT_SHARED		(_AT(pteval_t, 3) << 8)		/* SH[1:0], inner shareable */
 #define PTE_EXT_AF		(_AT(pteval_t, 1) << 10)	/* Access Flag */
 #define PTE_EXT_NG		(_AT(pteval_t, 1) << 11)	/* nG */
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index 34f371c4bbb2..06e0bc0f8b00 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -79,18 +79,19 @@
 #define L_PTE_PRESENT		(_AT(pteval_t, 3) << 0)		/* Present */
 #define L_PTE_FILE		(_AT(pteval_t, 1) << 2)		/* only when !PRESENT */
 #define L_PTE_USER		(_AT(pteval_t, 1) << 6)		/* AP[1] */
-#define L_PTE_RDONLY		(_AT(pteval_t, 1) << 7)		/* AP[2] */
 #define L_PTE_SHARED		(_AT(pteval_t, 3) << 8)		/* SH[1:0], inner shareable */
 #define L_PTE_YOUNG		(_AT(pteval_t, 1) << 10)	/* AF */
 #define L_PTE_XN		(_AT(pteval_t, 1) << 54)	/* XN */
-#define L_PTE_DIRTY		(_AT(pteval_t, 1) << 55)	/* unused */
-#define L_PTE_SPECIAL		(_AT(pteval_t, 1) << 56)	/* unused */
+#define L_PTE_DIRTY		(_AT(pteval_t, 1) << 55)
+#define L_PTE_SPECIAL		(_AT(pteval_t, 1) << 56)
 #define L_PTE_NONE		(_AT(pteval_t, 1) << 57)	/* PROT_NONE */
+#define L_PTE_RDONLY		(_AT(pteval_t, 1) << 58)	/* READ ONLY */
 
-#define PMD_SECT_VALID		(_AT(pmdval_t, 1) << 0)
-#define PMD_SECT_DIRTY		(_AT(pmdval_t, 1) << 55)
-#define PMD_SECT_SPLITTING	(_AT(pmdval_t, 1) << 56)
-#define PMD_SECT_NONE		(_AT(pmdval_t, 1) << 57)
+#define L_PMD_SECT_VALID	(_AT(pmdval_t, 1) << 0)
+#define L_PMD_SECT_DIRTY	(_AT(pmdval_t, 1) << 55)
+#define L_PMD_SECT_SPLITTING	(_AT(pmdval_t, 1) << 56)
+#define L_PMD_SECT_NONE		(_AT(pmdval_t, 1) << 57)
+#define L_PMD_SECT_RDONLY	(_AT(pteval_t, 1) << 58)
 
 /*
  * To be used in assembly code with the upper page attributes.
@@ -214,24 +215,25 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
 #define pmd_young(pmd)		(pmd_isset((pmd), PMD_SECT_AF))
 
 #define __HAVE_ARCH_PMD_WRITE
-#define pmd_write(pmd)		(pmd_isclear((pmd), PMD_SECT_RDONLY))
+#define pmd_write(pmd)		(pmd_isclear((pmd), L_PMD_SECT_RDONLY))
+#define pmd_dirty(pmd)		(pmd_isset((pmd), L_PMD_SECT_DIRTY))
 
 #define pmd_hugewillfault(pmd)	(!pmd_young(pmd) || !pmd_write(pmd))
 #define pmd_thp_or_huge(pmd)	(pmd_huge(pmd) || pmd_trans_huge(pmd))
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 #define pmd_trans_huge(pmd)	(pmd_val(pmd) && !pmd_table(pmd))
-#define pmd_trans_splitting(pmd) (pmd_isset((pmd), PMD_SECT_SPLITTING))
+#define pmd_trans_splitting(pmd) (pmd_isset((pmd), L_PMD_SECT_SPLITTING))
 #endif
 
 #define PMD_BIT_FUNC(fn,op) \
 static inline pmd_t pmd_##fn(pmd_t pmd) { pmd_val(pmd) op; return pmd; }
 
-PMD_BIT_FUNC(wrprotect,	|= PMD_SECT_RDONLY);
+PMD_BIT_FUNC(wrprotect,	|= L_PMD_SECT_RDONLY);
 PMD_BIT_FUNC(mkold,	&= ~PMD_SECT_AF);
-PMD_BIT_FUNC(mksplitting, |= PMD_SECT_SPLITTING);
-PMD_BIT_FUNC(mkwrite,   &= ~PMD_SECT_RDONLY);
-PMD_BIT_FUNC(mkdirty,   |= PMD_SECT_DIRTY);
+PMD_BIT_FUNC(mksplitting, |= L_PMD_SECT_SPLITTING);
+PMD_BIT_FUNC(mkwrite,   &= ~L_PMD_SECT_RDONLY);
+PMD_BIT_FUNC(mkdirty,   |= L_PMD_SECT_DIRTY);
 PMD_BIT_FUNC(mkyoung,   |= PMD_SECT_AF);
 
 #define pmd_mkhuge(pmd)		(__pmd(pmd_val(pmd) & ~PMD_TABLE_BIT))
@@ -245,8 +247,8 @@ PMD_BIT_FUNC(mkyoung,   |= PMD_SECT_AF);
 
 static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
 {
-	const pmdval_t mask = PMD_SECT_USER | PMD_SECT_XN | PMD_SECT_RDONLY |
-				PMD_SECT_VALID | PMD_SECT_NONE;
+	const pmdval_t mask = PMD_SECT_USER | PMD_SECT_XN | L_PMD_SECT_RDONLY |
+				L_PMD_SECT_VALID | L_PMD_SECT_NONE;
 	pmd_val(pmd) = (pmd_val(pmd) & ~mask) | (pgprot_val(newprot) & mask);
 	return pmd;
 }
@@ -257,8 +259,13 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 	BUG_ON(addr >= TASK_SIZE);
 
 	/* create a faulting entry if PROT_NONE protected */
-	if (pmd_val(pmd) & PMD_SECT_NONE)
-		pmd_val(pmd) &= ~PMD_SECT_VALID;
+	if (pmd_val(pmd) & L_PMD_SECT_NONE)
+		pmd_val(pmd) &= ~L_PMD_SECT_VALID;
+
+	if (pmd_write(pmd) && pmd_dirty(pmd))
+		pmd_val(pmd) &= ~PMD_SECT_AP2;
+	else
+		pmd_val(pmd) |= PMD_SECT_AP2;
 
 	*pmdp = __pmd(pmd_val(pmd) | PMD_SECT_nG);
 	flush_pmd_entry(pmdp);
diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
index c508f41a43bc..59424937e52b 100644
--- a/arch/arm/mm/dump.c
+++ b/arch/arm/mm/dump.c
@@ -126,8 +126,8 @@ static const struct prot_bits section_bits[] = {
 		.val	= PMD_SECT_USER,
 		.set	= "USR",
 	}, {
-		.mask	= PMD_SECT_RDONLY,
-		.val	= PMD_SECT_RDONLY,
+		.mask	= L_PMD_SECT_RDONLY,
+		.val	= L_PMD_SECT_RDONLY,
 		.set	= "ro",
 		.clear	= "RW",
 #elif __LINUX_ARM_ARCH__ >= 6
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S
index 22e3ad63500c..eb81123a845d 100644
--- a/arch/arm/mm/proc-v7-3level.S
+++ b/arch/arm/mm/proc-v7-3level.S
@@ -86,8 +86,13 @@ ENTRY(cpu_v7_set_pte_ext)
 	tst	rh, #1 << (57 - 32)		@ L_PTE_NONE
 	bicne	rl, #L_PTE_VALID
 	bne	1f
-	tst	rh, #1 << (55 - 32)		@ L_PTE_DIRTY
-	orreq	rl, #L_PTE_RDONLY
+
+	eor	ip, rh, #1 << (55 - 32)	@ toggle L_PTE_DIRTY in temp reg to
+					@ test for !L_PTE_DIRTY || L_PTE_RDONLY
+	tst	ip, #1 << (55 - 32) | 1 << (58 - 32)
+	orrne	rl, #PTE_AP2
+	biceq	rl, #PTE_AP2
+
 1:	strd	r2, r3, [r0]
 	ALT_SMP(W(nop))
 	ALT_UP (mcr	p15, 0, r0, c7, c10, 1)		@ flush_pte
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 073/168] aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (71 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 072/168] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 074/168] ARM: mvebu: add missing of_node_put() call in coherency.c Luis Henriques
                   ` (94 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Gu Zheng, Benjamin LaHaise, Luis Henriques

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

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

From: Gu Zheng <guz.fnst@cn.fujitsu.com>

commit 835f252c6debd204fcd607c79975089b1ecd3472 upstream.

https://bugzilla.kernel.org/show_bug.cgi?id=86831

Markus reported that when shutting down mysqld (with AIO support,
on a ext3 formatted Harddrive) leads to a negative number of dirty pages
(underrun to the counter). The negative number results in a drastic reduction
of the write performance because the page cache is not used, because the kernel
thinks it is still 2 ^ 32 dirty pages open.

Add a warn trace in __dec_zone_state will catch this easily:

static inline void __dec_zone_state(struct zone *zone, enum
	zone_stat_item item)
{
     atomic_long_dec(&zone->vm_stat[item]);
+    WARN_ON_ONCE(item == NR_FILE_DIRTY &&
	atomic_long_read(&zone->vm_stat[item]) < 0);
     atomic_long_dec(&vm_stat[item]);
}

[   21.341632] ------------[ cut here ]------------
[   21.346294] WARNING: CPU: 0 PID: 309 at include/linux/vmstat.h:242
cancel_dirty_page+0x164/0x224()
[   21.355296] Modules linked in: wutbox_cp sata_mv
[   21.359968] CPU: 0 PID: 309 Comm: kworker/0:1 Not tainted 3.14.21-WuT #80
[   21.366793] Workqueue: events free_ioctx
[   21.370760] [<c0016a64>] (unwind_backtrace) from [<c0012f88>]
(show_stack+0x20/0x24)
[   21.378562] [<c0012f88>] (show_stack) from [<c03f8ccc>]
(dump_stack+0x24/0x28)
[   21.385840] [<c03f8ccc>] (dump_stack) from [<c0023ae4>]
(warn_slowpath_common+0x84/0x9c)
[   21.393976] [<c0023ae4>] (warn_slowpath_common) from [<c0023bb8>]
(warn_slowpath_null+0x2c/0x34)
[   21.402800] [<c0023bb8>] (warn_slowpath_null) from [<c00c0688>]
(cancel_dirty_page+0x164/0x224)
[   21.411524] [<c00c0688>] (cancel_dirty_page) from [<c00c080c>]
(truncate_inode_page+0x8c/0x158)
[   21.420272] [<c00c080c>] (truncate_inode_page) from [<c00c0a94>]
(truncate_inode_pages_range+0x11c/0x53c)
[   21.429890] [<c00c0a94>] (truncate_inode_pages_range) from
[<c00c0f6c>] (truncate_pagecache+0x88/0xac)
[   21.439252] [<c00c0f6c>] (truncate_pagecache) from [<c00c0fec>]
(truncate_setsize+0x5c/0x74)
[   21.447731] [<c00c0fec>] (truncate_setsize) from [<c013b3a8>]
(put_aio_ring_file.isra.14+0x34/0x90)
[   21.456826] [<c013b3a8>] (put_aio_ring_file.isra.14) from
[<c013b424>] (aio_free_ring+0x20/0xcc)
[   21.465660] [<c013b424>] (aio_free_ring) from [<c013b4f4>]
(free_ioctx+0x24/0x44)
[   21.473190] [<c013b4f4>] (free_ioctx) from [<c003d8d8>]
(process_one_work+0x134/0x47c)
[   21.481132] [<c003d8d8>] (process_one_work) from [<c003e988>]
(worker_thread+0x130/0x414)
[   21.489350] [<c003e988>] (worker_thread) from [<c00448ac>]
(kthread+0xd4/0xec)
[   21.496621] [<c00448ac>] (kthread) from [<c000ec18>]
(ret_from_fork+0x14/0x20)
[   21.503884] ---[ end trace 79c4bf42c038c9a1 ]---

The cause is that we set the aio ring file pages as *DIRTY* via SetPageDirty
(bypasses the VFS dirty pages increment) when init, and aio fs uses
*default_backing_dev_info* as the backing dev, which does not disable
the dirty pages accounting capability.
So truncating aio ring file will contribute to accounting dirty pages (VFS
dirty pages decrement), then error occurs.

The original goal is keeping these pages in memory (can not be reclaimed
or swapped) in life-time via marking it dirty. But thinking more, we have
already pinned pages via elevating the page's refcount, which can already
achieve the goal, so the SetPageDirty seems unnecessary.

In order to fix the issue, using the __set_page_dirty_no_writeback instead
of the nop .set_page_dirty, and dropped the SetPageDirty (don't manually
set the dirty flags, don't disable set_page_dirty(), rely on default behaviour).

With the above change, the dirty pages accounting can work well. But as we
known, aio fs is an anonymous one, which should never cause any real write-back,
we can ignore the dirty pages (write back) accounting by disabling the dirty
pages (write back) accounting capability. So we introduce an aio private
backing dev info (disabled the ACCT_DIRTY/WRITEBACK/ACCT_WB capabilities) to
replace the default one.

Reported-by: Markus Königshaus <m.koenigshaus@wut.de>
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/aio.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index d72588a4c935..b645387b6d57 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -165,6 +165,15 @@ static struct vfsmount *aio_mnt;
 static const struct file_operations aio_ring_fops;
 static const struct address_space_operations aio_ctx_aops;
 
+/* Backing dev info for aio fs.
+ * -no dirty page accounting or writeback happens
+ */
+static struct backing_dev_info aio_fs_backing_dev_info = {
+	.name           = "aiofs",
+	.state          = 0,
+	.capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK | BDI_CAP_MAP_COPY,
+};
+
 static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
 {
 	struct qstr this = QSTR_INIT("[aio]", 5);
@@ -176,6 +185,7 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
 
 	inode->i_mapping->a_ops = &aio_ctx_aops;
 	inode->i_mapping->private_data = ctx;
+	inode->i_mapping->backing_dev_info = &aio_fs_backing_dev_info;
 	inode->i_size = PAGE_SIZE * nr_pages;
 
 	path.dentry = d_alloc_pseudo(aio_mnt->mnt_sb, &this);
@@ -221,6 +231,9 @@ static int __init aio_setup(void)
 	if (IS_ERR(aio_mnt))
 		panic("Failed to create aio fs mount.");
 
+	if (bdi_init(&aio_fs_backing_dev_info))
+		panic("Failed to init aio fs backing dev info.");
+
 	kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC);
 	kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC);
 
@@ -282,11 +295,6 @@ static const struct file_operations aio_ring_fops = {
 	.mmap = aio_ring_mmap,
 };
 
-static int aio_set_page_dirty(struct page *page)
-{
-	return 0;
-}
-
 #if IS_ENABLED(CONFIG_MIGRATION)
 static int aio_migratepage(struct address_space *mapping, struct page *new,
 			struct page *old, enum migrate_mode mode)
@@ -358,7 +366,7 @@ out:
 #endif
 
 static const struct address_space_operations aio_ctx_aops = {
-	.set_page_dirty = aio_set_page_dirty,
+	.set_page_dirty = __set_page_dirty_no_writeback,
 #if IS_ENABLED(CONFIG_MIGRATION)
 	.migratepage	= aio_migratepage,
 #endif
@@ -413,7 +421,6 @@ static int aio_setup_ring(struct kioctx *ctx)
 		pr_debug("pid(%d) page[%d]->count=%d\n",
 			 current->pid, i, page_count(page));
 		SetPageUptodate(page);
-		SetPageDirty(page);
 		unlock_page(page);
 
 		ctx->ring_pages[i] = page;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 074/168] ARM: mvebu: add missing of_node_put() call in coherency.c
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (72 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 073/168] aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 075/168] spi: dw: Fix dynamic speed change Luis Henriques
                   ` (93 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Petazzoni, Jason Cooper, Luis Henriques

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

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

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

commit 2eb04ae010a8fb165ba7aa56e9aa8e7980887dee upstream.

There is a missing of_node_put() to decrement the device_node
reference counter after a of_find_matching_node() in coherency_init().

Fixes: 501f928e0097 ("ARM: mvebu: add a coherency_available() call")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Link: https://lkml.kernel.org/r/1414423955-5933-4-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-mvebu/coherency.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 2bdc3233abe2..044b51185fcc 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -400,6 +400,8 @@ int __init coherency_init(void)
 		 type == COHERENCY_FABRIC_TYPE_ARMADA_380)
 		armada_375_380_coherency_init(np);
 
+	of_node_put(np);
+
 	return 0;
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 075/168] spi: dw: Fix dynamic speed change.
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (73 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 074/168] ARM: mvebu: add missing of_node_put() call in coherency.c Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 076/168] USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick Luis Henriques
                   ` (92 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vlastimil Setka, Thor Thayer, Mark Brown, Luis Henriques

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

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

From: Thor Thayer <tthayer@opensource.altera.com>

commit 0a8727e69778683495058852f783eeda141a754e upstream.

An IOCTL call that calls spi_setup() and then dw_spi_setup() will
overwrite the persisted last transfer speed. On each transfer, the
SPI speed is compared to the last transfer speed to determine if the
clock divider registers need to be updated (did the speed change?).
This bug was observed with the spidev driver using spi-config to
update the max transfer speed.

This fix: Don't overwrite the persisted last transaction clock speed
when updating the SPI parameters in dw_spi_setup(). On the next
transaction, the new speed won't match the persisted last speed
and the hardware registers will be updated.
On initialization, the persisted last transaction clock
speed will be 0 but will be updated after the first SPI
transaction.

Move zeroed clock divider check into clock change test because
chip->clk_div is zero on startup and would cause a divide-by-zero
error. The calculation was wrong as well (can't support odd #).

Reported-by: Vlastimil Setka <setka@vsis.cz>
Signed-off-by: Vlastimil Setka <setka@vsis.cz>
Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/spi/spi-dw.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 0dd0623319b0..080e0a343675 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -382,9 +382,6 @@ static void pump_transfers(unsigned long data)
 	chip = dws->cur_chip;
 	spi = message->spi;
 
-	if (unlikely(!chip->clk_div))
-		chip->clk_div = dws->max_freq / chip->speed_hz;
-
 	if (message->state == ERROR_STATE) {
 		message->status = -EIO;
 		goto early_exit;
@@ -425,7 +422,7 @@ static void pump_transfers(unsigned long data)
 	if (transfer->speed_hz) {
 		speed = chip->speed_hz;
 
-		if (transfer->speed_hz != speed) {
+		if ((transfer->speed_hz != speed) || (!chip->clk_div)) {
 			speed = transfer->speed_hz;
 
 			/* clk_div doesn't support odd number */
@@ -586,7 +583,6 @@ static int dw_spi_setup(struct spi_device *spi)
 		dev_err(&spi->dev, "No max speed HZ parameter\n");
 		return -EINVAL;
 	}
-	chip->speed_hz = spi->max_speed_hz;
 
 	chip->tmode = 0; /* Tx & Rx */
 	/* Default SPI mode is SCPOL = 0, SCPH = 0 */
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 076/168] USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (74 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 075/168] spi: dw: Fix dynamic speed change Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 077/168] iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask Luis Henriques
                   ` (91 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Preston Fick, Johan Hovold, Luis Henriques

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

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

From: Preston Fick <pffick@gmail.com>

commit ffcfe30ebd8dd703d0fc4324ffe56ea21f5479f4 upstream.

Signed-off-by: Preston Fick <pffick@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/cp210x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 3beae723ad3a..5741e9405069 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
 	{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
 	{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
+	{ USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */
 	{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
 	{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
 	{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 077/168] iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (75 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 076/168] USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 078/168] iio: adc: men_z188_adc: Add terminating entry for men_z188_ids Luis Henriques
                   ` (90 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Cristina Ciocan, Jonathan Cameron, Luis Henriques

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

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

From: Cristina Ciocan <cristina.ciocan@intel.com>

commit ccf54555da9a5e91e454b909ca6a5303c7d6b910 upstream.

The direction field is set on 7 bits, thus we need to AND it with 0111 111 mask
in order to retrieve it, that is 0x7F, not 0xCF as it is now.

Fixes: ade7ef7ba (staging:iio: Differential channel handling)
Signed-off-by: Cristina Ciocan <cristina.ciocan@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/iio/events.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h
index 8bbd7bc1043d..03fa332ad2a8 100644
--- a/include/linux/iio/events.h
+++ b/include/linux/iio/events.h
@@ -72,7 +72,7 @@ struct iio_event_data {
 
 #define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF)
 
-#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xCF)
+#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0x7F)
 
 #define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF)
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 078/168] iio: adc: men_z188_adc: Add terminating entry for men_z188_ids
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (76 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 077/168] iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 079/168] Input: synaptics - adjust min/max on Thinkpad E540 Luis Henriques
                   ` (89 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Axel Lin, Jonathan Cameron, Luis Henriques

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

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

From: Axel Lin <axel.lin@ingics.com>

commit fbbba1f89eb68e7d07707e104193d56de8e37fe5 upstream.

The mcb_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/iio/adc/men_z188_adc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/men_z188_adc.c b/drivers/iio/adc/men_z188_adc.c
index b58d6302521f..d095efe1ba14 100644
--- a/drivers/iio/adc/men_z188_adc.c
+++ b/drivers/iio/adc/men_z188_adc.c
@@ -152,6 +152,7 @@ static void men_z188_remove(struct mcb_device *dev)
 
 static const struct mcb_device_id men_z188_ids[] = {
 	{ .device = 0xbc },
+	{ }
 };
 MODULE_DEVICE_TABLE(mcb, men_z188_ids);
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 079/168] Input: synaptics - adjust min/max on Thinkpad E540
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (77 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 078/168] iio: adc: men_z188_adc: Add terminating entry for men_z188_ids Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 080/168] spi: Fix mapping from vmalloc-ed buffer to scatter list Luis Henriques
                   ` (88 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Binyamin Sagal, Dmitry Torokhov, Luis Henriques

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

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

From: Ben Sagal <bensagal@gmail.com>

commit bce4f9e764c36bc35dd5c9cf9e057c09f422397d upstream.

The LEN2006 Synaptics touchpad (as found in Thinkpad E540) returns wrong
min max values.

touchpad-edge-detector output:
>  Touchpad SynPS/2 Synaptics TouchPad on /dev/input/event6
>  Move one finger around the touchpad to detect the actual edges
>  Kernel says:    x [1472..5674], y [1408..4684]
>  Touchpad sends: x [1264..5675], y [1171..4688]

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88211
Signed-off-by: Binyamin Sagal <bensagal@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/mouse/synaptics.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 3dcdeb785649..2d992a94f5dc 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -140,6 +140,10 @@ static const struct min_max_quirk min_max_pnpid_table[] = {
 		(const char * const []){"LEN2001", NULL},
 		1024, 5022, 2508, 4832
 	},
+	{
+		(const char * const []){"LEN2006", NULL},
+		1264, 5675, 1171, 4688
+	},
 	{ }
 };
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 080/168] spi: Fix mapping from vmalloc-ed buffer to scatter list
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (78 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 079/168] Input: synaptics - adjust min/max on Thinkpad E540 Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 081/168] clk-divider: Fix READ_ONLY when divider > 1 Luis Henriques
                   ` (87 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Charles Keepax, Mark Brown, Luis Henriques

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

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

From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

commit c1aefbdd050e1fb15e92bcaf34d95b17ea952097 upstream.

We can only use page_address on memory that has been mapped using kmap,
when the buffer passed to the SPI has been allocated by vmalloc the page
has not necessarily been mapped through kmap. This means sometimes
page_address will return NULL causing the pointer we pass to sg_set_buf
to be invalid.

As we only call page_address so that we can pass a virtual address to
sg_set_buf which will then immediately call virt_to_page on it, fix this
by calling sg_set_page directly rather then relying on the sg_set_buf
helper.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/spi/spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d4f9670b51bc..d9a59a0464cd 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -606,13 +606,13 @@ static int spi_map_buf(struct spi_master *master, struct device *dev,
 				sg_free_table(sgt);
 				return -ENOMEM;
 			}
-			sg_buf = page_address(vm_page) +
-				((size_t)buf & ~PAGE_MASK);
+			sg_set_page(&sgt->sgl[i], vm_page,
+				    min, offset_in_page(buf));
 		} else {
 			sg_buf = buf;
+			sg_set_buf(&sgt->sgl[i], sg_buf, min);
 		}
 
-		sg_set_buf(&sgt->sgl[i], sg_buf, min);
 
 		buf += min;
 		len -= min;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 081/168] clk-divider: Fix READ_ONLY when divider > 1
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (79 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 080/168] spi: Fix mapping from vmalloc-ed buffer to scatter list Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 082/168] spi: sirf: fix word width configuration Luis Henriques
                   ` (86 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: James Hogan, Thomas Abraham, Tomasz Figa, Max Schwarz,
	Michael Turquette, Luis Henriques

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

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

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

commit e6d5e7d90be92cee626d7ec16ca9b06f1eed710b upstream.

Commit 79c6ab509558 (clk: divider: add CLK_DIVIDER_READ_ONLY flag) in
v3.16 introduced the CLK_DIVIDER_READ_ONLY flag which caused the
recalc_rate() and round_rate() clock callbacks to be omitted.

However using this flag has the unfortunate side effect of causing the
clock recalculation code when a clock rate change is attempted to always
treat it as a pass-through clock, i.e. with a fixed divide of 1, which
may not be the case. Child clock rates are then recalculated using the
wrong parent rate.

Therefore instead of dropping the recalc_rate() and round_rate()
callbacks, alter clk_divider_bestdiv() to always report the current
divider as the best divider so that it is never altered.

For me the read only clock was the system clock, which divided the PLL
rate by 2, from which both the UART and the SPI clocks were divided.
Initial setting of the UART rate set it correctly, but when the SPI
clock was set, the other child clocks were miscalculated. The UART clock
was recalculated using the PLL rate as the parent rate, resulting in a
UART new_rate of double what it should be, and a UART which spewed forth
garbage when the rate changes were propagated.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Thomas Abraham <thomas.ab@samsung.com>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Max Schwarz <max.schwarz@online.de>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
[ luis: backported to 3.16:
  - drop changes to drivers/clk/rockchip/clk.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/clk/clk-divider.c    | 18 +++++++++---------
 include/linux/clk-provider.h |  1 -
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 18a9de29df0e..c0a842b335c5 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -263,6 +263,14 @@ static int clk_divider_bestdiv(struct clk_hw *hw, unsigned long rate,
 	if (!rate)
 		rate = 1;
 
+	/* if read only, just return current value */
+	if (divider->flags & CLK_DIVIDER_READ_ONLY) {
+		bestdiv = readl(divider->reg) >> divider->shift;
+		bestdiv &= div_mask(divider);
+		bestdiv = _get_div(divider, bestdiv);
+		return bestdiv;
+	}
+
 	maxdiv = _get_maxdiv(divider);
 
 	if (!(__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT)) {
@@ -361,11 +369,6 @@ const struct clk_ops clk_divider_ops = {
 };
 EXPORT_SYMBOL_GPL(clk_divider_ops);
 
-const struct clk_ops clk_divider_ro_ops = {
-	.recalc_rate = clk_divider_recalc_rate,
-};
-EXPORT_SYMBOL_GPL(clk_divider_ro_ops);
-
 static struct clk *_register_divider(struct device *dev, const char *name,
 		const char *parent_name, unsigned long flags,
 		void __iomem *reg, u8 shift, u8 width,
@@ -391,10 +394,7 @@ static struct clk *_register_divider(struct device *dev, const char *name,
 	}
 
 	init.name = name;
-	if (clk_divider_flags & CLK_DIVIDER_READ_ONLY)
-		init.ops = &clk_divider_ro_ops;
-	else
-		init.ops = &clk_divider_ops;
+	init.ops = &clk_divider_ops;
 	init.flags = flags | CLK_IS_BASIC;
 	init.parent_names = (parent_name ? &parent_name: NULL);
 	init.num_parents = (parent_name ? 1 : 0);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 0c287dbbb144..a4ebe5b78e74 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -341,7 +341,6 @@ struct clk_divider {
 #define CLK_DIVIDER_READ_ONLY		BIT(5)
 
 extern const struct clk_ops clk_divider_ops;
-extern const struct clk_ops clk_divider_ro_ops;
 struct clk *clk_register_divider(struct device *dev, const char *name,
 		const char *parent_name, unsigned long flags,
 		void __iomem *reg, u8 shift, u8 width,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 082/168] spi: sirf: fix word width configuration
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (80 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 081/168] clk-divider: Fix READ_ONLY when divider > 1 Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 083/168] usb: serial: ftdi_sio: add PIDs for Matrix Orbital products Luis Henriques
                   ` (85 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Qipan Li, Barry Song, Mark Brown, Luis Henriques

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

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

From: Qipan Li <Qipan.Li@csr.com>

commit 9c4b19a07dddda3ba35a2eb9b4134d485908e2f5 upstream.

commit 8c328a262f ("spi: sirf: Avoid duplicate code in various
bits_per_word cases") is wrong in setting data width register of
fifo is not right, it should use sspi->word_width >> 1 to set
related bits. According to hardware spec, the mapping between
register value and data width:
0 - byte
1 - WORD
2 - DWORD

Fixes: 8c328a262f ("spi: sirf: Avoid duplicate code in various bits_per_word cases") is wrong in setting data width register of
Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index 1a5161336730..633a38337787 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -563,9 +563,9 @@ spi_sirfsoc_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 
 	sspi->word_width = DIV_ROUND_UP(bits_per_word, 8);
 	txfifo_ctrl = SIRFSOC_SPI_FIFO_THD(SIRFSOC_SPI_FIFO_SIZE / 2) |
-					   sspi->word_width;
+					   (sspi->word_width >> 1);
 	rxfifo_ctrl = SIRFSOC_SPI_FIFO_THD(SIRFSOC_SPI_FIFO_SIZE / 2) |
-					   sspi->word_width;
+					   (sspi->word_width >> 1);
 
 	if (!(spi->mode & SPI_CS_HIGH))
 		regval |= SIRFSOC_SPI_CS_IDLE_STAT;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 083/168] usb: serial: ftdi_sio: add PIDs for Matrix Orbital products
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (81 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 082/168] spi: sirf: fix word width configuration Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 084/168] USB: keyspan: fix tty line-status reporting Luis Henriques
                   ` (84 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Troy Clark, Johan Hovold, Luis Henriques

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

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

From: Troy Clark <tclark@matrixorbital.ca>

commit 204ec6e07ea7aff863df0f7c53301f9cbbfbb9d3 upstream.

Add PIDs for new Matrix Orbital GTT series products.

Signed-off-by: Troy Clark <tclark@matrixorbital.ca>
[johan: shorten commit message ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/ftdi_sio.c     | 33 +++++++++++++++++++++++++++++++++
 drivers/usb/serial/ftdi_sio_ids.h | 39 +++++++++++++++++++++++++++++++++++----
 2 files changed, 68 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index a523adad6380..debcdef4cbf0 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -483,6 +483,39 @@ static const struct usb_device_id id_table_combined[] = {
 	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) },
 	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) },
 	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) },
+	{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 6786b705ccf6..e52409c9be99 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -926,8 +926,8 @@
 #define BAYER_CONTOUR_CABLE_PID        0x6001
 
 /*
- * The following are the values for the Matrix Orbital FTDI Range
- * Anything in this range will use an FT232RL.
+ * Matrix Orbital Intelligent USB displays.
+ * http://www.matrixorbital.com
  */
 #define MTXORB_VID			0x1B3D
 #define MTXORB_FTDI_RANGE_0100_PID	0x0100
@@ -1186,8 +1186,39 @@
 #define MTXORB_FTDI_RANGE_01FD_PID	0x01FD
 #define MTXORB_FTDI_RANGE_01FE_PID	0x01FE
 #define MTXORB_FTDI_RANGE_01FF_PID	0x01FF
-
-
+#define MTXORB_FTDI_RANGE_4701_PID	0x4701
+#define MTXORB_FTDI_RANGE_9300_PID	0x9300
+#define MTXORB_FTDI_RANGE_9301_PID	0x9301
+#define MTXORB_FTDI_RANGE_9302_PID	0x9302
+#define MTXORB_FTDI_RANGE_9303_PID	0x9303
+#define MTXORB_FTDI_RANGE_9304_PID	0x9304
+#define MTXORB_FTDI_RANGE_9305_PID	0x9305
+#define MTXORB_FTDI_RANGE_9306_PID	0x9306
+#define MTXORB_FTDI_RANGE_9307_PID	0x9307
+#define MTXORB_FTDI_RANGE_9308_PID	0x9308
+#define MTXORB_FTDI_RANGE_9309_PID	0x9309
+#define MTXORB_FTDI_RANGE_930A_PID	0x930A
+#define MTXORB_FTDI_RANGE_930B_PID	0x930B
+#define MTXORB_FTDI_RANGE_930C_PID	0x930C
+#define MTXORB_FTDI_RANGE_930D_PID	0x930D
+#define MTXORB_FTDI_RANGE_930E_PID	0x930E
+#define MTXORB_FTDI_RANGE_930F_PID	0x930F
+#define MTXORB_FTDI_RANGE_9310_PID	0x9310
+#define MTXORB_FTDI_RANGE_9311_PID	0x9311
+#define MTXORB_FTDI_RANGE_9312_PID	0x9312
+#define MTXORB_FTDI_RANGE_9313_PID	0x9313
+#define MTXORB_FTDI_RANGE_9314_PID	0x9314
+#define MTXORB_FTDI_RANGE_9315_PID	0x9315
+#define MTXORB_FTDI_RANGE_9316_PID	0x9316
+#define MTXORB_FTDI_RANGE_9317_PID	0x9317
+#define MTXORB_FTDI_RANGE_9318_PID	0x9318
+#define MTXORB_FTDI_RANGE_9319_PID	0x9319
+#define MTXORB_FTDI_RANGE_931A_PID	0x931A
+#define MTXORB_FTDI_RANGE_931B_PID	0x931B
+#define MTXORB_FTDI_RANGE_931C_PID	0x931C
+#define MTXORB_FTDI_RANGE_931D_PID	0x931D
+#define MTXORB_FTDI_RANGE_931E_PID	0x931E
+#define MTXORB_FTDI_RANGE_931F_PID	0x931F
 
 /*
  * The Mobility Lab (TML)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 084/168] USB: keyspan: fix tty line-status reporting
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (82 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 083/168] usb: serial: ftdi_sio: add PIDs for Matrix Orbital products Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 085/168] USB: keyspan: fix overrun-error reporting Luis Henriques
                   ` (83 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit 5d1678a33c731b56e245e888fdae5e88efce0997 upstream.

Fix handling of TTY error flags, which are not bitmasks and must
specifically not be ORed together as this prevents the line discipline
from recognising them.

Also insert null characters when reporting overrun errors as these are
not associated with the received character.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/keyspan.c | 76 ++++++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 28 deletions(-)

diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 93cb7cebda62..7799d8bc4a63 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -321,14 +321,19 @@ static void	usa26_indat_callback(struct urb *urb)
 			/* some bytes had errors, every byte has status */
 			dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
 			for (i = 0; i + 1 < urb->actual_length; i += 2) {
-				int stat = data[i], flag = 0;
-				if (stat & RXERROR_OVERRUN)
-					flag |= TTY_OVERRUN;
-				if (stat & RXERROR_FRAMING)
-					flag |= TTY_FRAME;
-				if (stat & RXERROR_PARITY)
-					flag |= TTY_PARITY;
+				int stat = data[i];
+				int flag = TTY_NORMAL;
+
+				if (stat & RXERROR_OVERRUN) {
+					tty_insert_flip_char(&port->port, 0,
+								TTY_OVERRUN);
+				}
 				/* XXX should handle break (0x10) */
+				if (stat & RXERROR_PARITY)
+					flag = TTY_PARITY;
+				else if (stat & RXERROR_FRAMING)
+					flag = TTY_FRAME;
+
 				tty_insert_flip_char(&port->port, data[i+1],
 						flag);
 			}
@@ -649,14 +654,19 @@ static void	usa49_indat_callback(struct urb *urb)
 		} else {
 			/* some bytes had errors, every byte has status */
 			for (i = 0; i + 1 < urb->actual_length; i += 2) {
-				int stat = data[i], flag = 0;
-				if (stat & RXERROR_OVERRUN)
-					flag |= TTY_OVERRUN;
-				if (stat & RXERROR_FRAMING)
-					flag |= TTY_FRAME;
-				if (stat & RXERROR_PARITY)
-					flag |= TTY_PARITY;
+				int stat = data[i];
+				int flag = TTY_NORMAL;
+
+				if (stat & RXERROR_OVERRUN) {
+					tty_insert_flip_char(&port->port, 0,
+								TTY_OVERRUN);
+				}
 				/* XXX should handle break (0x10) */
+				if (stat & RXERROR_PARITY)
+					flag = TTY_PARITY;
+				else if (stat & RXERROR_FRAMING)
+					flag = TTY_FRAME;
+
 				tty_insert_flip_char(&port->port, data[i+1],
 						flag);
 			}
@@ -713,15 +723,19 @@ static void usa49wg_indat_callback(struct urb *urb)
 			 */
 			for (x = 0; x + 1 < len &&
 				    i + 1 < urb->actual_length; x += 2) {
-				int stat = data[i], flag = 0;
+				int stat = data[i];
+				int flag = TTY_NORMAL;
 
-				if (stat & RXERROR_OVERRUN)
-					flag |= TTY_OVERRUN;
-				if (stat & RXERROR_FRAMING)
-					flag |= TTY_FRAME;
-				if (stat & RXERROR_PARITY)
-					flag |= TTY_PARITY;
+				if (stat & RXERROR_OVERRUN) {
+					tty_insert_flip_char(&port->port, 0,
+								TTY_OVERRUN);
+				}
 				/* XXX should handle break (0x10) */
+				if (stat & RXERROR_PARITY)
+					flag = TTY_PARITY;
+				else if (stat & RXERROR_FRAMING)
+					flag = TTY_FRAME;
+
 				tty_insert_flip_char(&port->port, data[i+1],
 						     flag);
 				i += 2;
@@ -784,14 +798,20 @@ static void usa90_indat_callback(struct urb *urb)
 			/* some bytes had errors, every byte has status */
 				dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
 				for (i = 0; i + 1 < urb->actual_length; i += 2) {
-					int stat = data[i], flag = 0;
-					if (stat & RXERROR_OVERRUN)
-						flag |= TTY_OVERRUN;
-					if (stat & RXERROR_FRAMING)
-						flag |= TTY_FRAME;
-					if (stat & RXERROR_PARITY)
-						flag |= TTY_PARITY;
+					int stat = data[i];
+					int flag = TTY_NORMAL;
+
+					if (stat & RXERROR_OVERRUN) {
+						tty_insert_flip_char(
+								&port->port, 0,
+								TTY_OVERRUN);
+					}
 					/* XXX should handle break (0x10) */
+					if (stat & RXERROR_PARITY)
+						flag = TTY_PARITY;
+					else if (stat & RXERROR_FRAMING)
+						flag = TTY_FRAME;
+
 					tty_insert_flip_char(&port->port,
 							data[i+1], flag);
 				}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 085/168] USB: keyspan: fix overrun-error reporting
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (83 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 084/168] USB: keyspan: fix tty line-status reporting Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 086/168] USB: ssu100: " Luis Henriques
                   ` (82 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit 855515a6d3731242d85850a206f2ec084c917338 upstream.

Fix reporting of overrun errors, which are not associated with a
character. Instead insert a null character and report only once.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/keyspan.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 7799d8bc4a63..077c714f1285 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -311,12 +311,13 @@ static void	usa26_indat_callback(struct urb *urb)
 		if ((data[0] & 0x80) == 0) {
 			/* no errors on individual bytes, only
 			   possible overrun err */
-			if (data[0] & RXERROR_OVERRUN)
-				err = TTY_OVERRUN;
-			else
-				err = 0;
+			if (data[0] & RXERROR_OVERRUN) {
+				tty_insert_flip_char(&port->port, 0,
+								TTY_OVERRUN);
+			}
 			for (i = 1; i < urb->actual_length ; ++i)
-				tty_insert_flip_char(&port->port, data[i], err);
+				tty_insert_flip_char(&port->port, data[i],
+								TTY_NORMAL);
 		} else {
 			/* some bytes had errors, every byte has status */
 			dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
@@ -787,13 +788,13 @@ static void usa90_indat_callback(struct urb *urb)
 			if ((data[0] & 0x80) == 0) {
 				/* no errors on individual bytes, only
 				   possible overrun err*/
-				if (data[0] & RXERROR_OVERRUN)
-					err = TTY_OVERRUN;
-				else
-					err = 0;
+				if (data[0] & RXERROR_OVERRUN) {
+					tty_insert_flip_char(&port->port, 0,
+								TTY_OVERRUN);
+				}
 				for (i = 1; i < urb->actual_length ; ++i)
 					tty_insert_flip_char(&port->port,
-							data[i], err);
+							data[i], TTY_NORMAL);
 			}  else {
 			/* some bytes had errors, every byte has status */
 				dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 086/168] USB: ssu100: fix overrun-error reporting
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (84 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 085/168] USB: keyspan: fix overrun-error reporting Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 087/168] nfsd: correctly define v4.2 support attributes Luis Henriques
                   ` (81 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit 75bcbf29c284dd0154c3e895a0bd1ef0e796160e upstream.

Fix reporting of overrun errors, which should only be reported once
using the inserted null character.

Fixes: 6b8f1ca5581b ("USB: ssu100: set tty_flags in ssu100_process_packet")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/ssu100.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index a7fe664b6b7d..70a098de429f 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -490,10 +490,9 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,
 			if (*tty_flag == TTY_NORMAL)
 				*tty_flag = TTY_FRAME;
 		}
-		if (lsr & UART_LSR_OE){
+		if (lsr & UART_LSR_OE) {
 			port->icount.overrun++;
-			if (*tty_flag == TTY_NORMAL)
-				*tty_flag = TTY_OVERRUN;
+			tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
 		}
 	}
 
@@ -511,12 +510,8 @@ static void ssu100_process_read_urb(struct urb *urb)
 	if ((len >= 4) &&
 	    (packet[0] == 0x1b) && (packet[1] == 0x1b) &&
 	    ((packet[2] == 0x00) || (packet[2] == 0x01))) {
-		if (packet[2] == 0x00) {
+		if (packet[2] == 0x00)
 			ssu100_update_lsr(port, packet[3], &flag);
-			if (flag == TTY_OVERRUN)
-				tty_insert_flip_char(&port->port, 0,
-						TTY_OVERRUN);
-		}
 		if (packet[2] == 0x01)
 			ssu100_update_msr(port, packet[3]);
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 087/168] nfsd: correctly define v4.2 support attributes
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (85 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 086/168] USB: ssu100: " Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 088/168] SUNRPC: Fix locking around callback channel reply receive Luis Henriques
                   ` (80 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christoph Hellwig, J. Bruce Fields, Luis Henriques

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

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

From: Christoph Hellwig <hch@lst.de>

commit 6d0ba0432a5e10bc714ba9c5adc460e726e5fbb4 upstream.

Even when security labels are disabled we support at least the same
attributes as v4.1.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfsd/nfsd.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 847daf37e566..1579b2171fcc 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -335,12 +335,15 @@ void		nfsd_lockd_shutdown(void);
 	(NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT)
 
 #ifdef CONFIG_NFSD_V4_SECURITY_LABEL
-#define NFSD4_2_SUPPORTED_ATTRS_WORD2 \
-	(NFSD4_1_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SECURITY_LABEL)
+#define NFSD4_2_SECURITY_ATTRS		FATTR4_WORD2_SECURITY_LABEL
 #else
-#define NFSD4_2_SUPPORTED_ATTRS_WORD2 0
+#define NFSD4_2_SECURITY_ATTRS		0
 #endif
 
+#define NFSD4_2_SUPPORTED_ATTRS_WORD2 \
+	(NFSD4_1_SUPPORTED_ATTRS_WORD2 | \
+	NFSD4_2_SECURITY_ATTRS)
+
 static inline u32 nfsd_suppattrs0(u32 minorversion)
 {
 	return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 088/168] SUNRPC: Fix locking around callback channel reply receive
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (86 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 087/168] nfsd: correctly define v4.2 support attributes Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 089/168] nfsd: Fix slot wake up race in the nfsv4.1 callback code Luis Henriques
                   ` (79 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Trond Myklebust, J. Bruce Fields, Luis Henriques

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

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

From: Trond Myklebust <trond.myklebust@primarydata.com>

commit 093a1468b6edb0e568be7311b8d2228d205702db upstream.

Both xprt_lookup_rqst() and xprt_complete_rqst() require that you
take the transport lock in order to avoid races with xprt_transmit().

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sunrpc/svcsock.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index b2437ee93657..89a4db5be155 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1000,17 +1000,12 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp)
 	xid = *p++;
 	calldir = *p;
 
-	if (bc_xprt)
-		req = xprt_lookup_rqst(bc_xprt, xid);
-
-	if (!req) {
-		printk(KERN_NOTICE
-			"%s: Got unrecognized reply: "
-			"calldir 0x%x xpt_bc_xprt %p xid %08x\n",
-			__func__, ntohl(calldir),
-			bc_xprt, xid);
+	if (!bc_xprt)
 		return -EAGAIN;
-	}
+	spin_lock_bh(&bc_xprt->transport_lock);
+	req = xprt_lookup_rqst(bc_xprt, xid);
+	if (!req)
+		goto unlock_notfound;
 
 	memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf));
 	/*
@@ -1021,11 +1016,21 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp)
 	dst = &req->rq_private_buf.head[0];
 	src = &rqstp->rq_arg.head[0];
 	if (dst->iov_len < src->iov_len)
-		return -EAGAIN; /* whatever; just giving up. */
+		goto unlock_eagain; /* whatever; just giving up. */
 	memcpy(dst->iov_base, src->iov_base, src->iov_len);
 	xprt_complete_rqst(req->rq_task, rqstp->rq_arg.len);
 	rqstp->rq_arg.len = 0;
+	spin_unlock_bh(&bc_xprt->transport_lock);
 	return 0;
+unlock_notfound:
+	printk(KERN_NOTICE
+		"%s: Got unrecognized reply: "
+		"calldir 0x%x xpt_bc_xprt %p xid %08x\n",
+		__func__, ntohl(calldir),
+		bc_xprt, ntohl(xid));
+unlock_eagain:
+	spin_unlock_bh(&bc_xprt->transport_lock);
+	return -EAGAIN;
 }
 
 static int copy_pages_to_kvecs(struct kvec *vec, struct page **pages, int len)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 089/168] nfsd: Fix slot wake up race in the nfsv4.1 callback code
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (87 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 088/168] SUNRPC: Fix locking around callback channel reply receive Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 090/168] bnx2fc: do not add shared skbs to the fcoe_rx_list Luis Henriques
                   ` (78 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Trond Myklebust, J. Bruce Fields, Luis Henriques

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

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

From: Trond Myklebust <trond.myklebust@primarydata.com>

commit c6c15e1ed303ffc47e696ea1c9a9df1761c1f603 upstream.

The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no
locking in order to guarantee atomicity, and so allows for races of
the form.

Task 1                                  Task 2
======                                  ======
if (test_and_set_bit(0) != 0) {
                                        clear_bit(0)
                                        rpc_wake_up_next(queue)
        rpc_sleep_on(queue)
        return false;
}

This patch breaks the race condition by adding a retest of the bit
after the call to rpc_sleep_on().

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfsd/nfs4callback.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 0f23ad005826..510a99115bb7 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -801,8 +801,12 @@ static bool nfsd41_cb_get_slot(struct nfs4_client *clp, struct rpc_task *task)
 {
 	if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) {
 		rpc_sleep_on(&clp->cl_cb_waitq, task, NULL);
-		dprintk("%s slot is busy\n", __func__);
-		return false;
+		/* Race breaker */
+		if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) {
+			dprintk("%s slot is busy\n", __func__);
+			return false;
+		}
+		rpc_wake_up_queued_task(&clp->cl_cb_waitq, task);
 	}
 	return true;
 }
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 090/168] bnx2fc: do not add shared skbs to the fcoe_rx_list
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (88 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 089/168] nfsd: Fix slot wake up race in the nfsv4.1 callback code Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 091/168] scsi: add Intel Multi-Flex to scsi scan blacklist Luis Henriques
                   ` (77 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Maurizio Lombardi, Christoph Hellwig, Luis Henriques

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

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

From: Maurizio Lombardi <mlombard@redhat.com>

commit 01a4cc4d0cd6a836c7b923760e8eb1cbb6a47258 upstream.

In some cases, the fcoe_rx_list may contains multiple instances
of the same skb (the so called "shared skbs").

the bnx2fc_l2_rcv thread is a loop that extracts a skb from the list,
modifies (and destroys) its content and then proceed to the next one.
The problem is that if the skb is shared, the remaining instances will
be corrupted.

The solution is to use skb_share_check() before adding the skb to the
fcoe_rx_list.

[ 6286.808725] ------------[ cut here ]------------
[ 6286.808729] WARNING: at include/scsi/fc_frame.h:173 bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]()
[ 6286.808748] Modules linked in: bnx2x(-) mdio dm_service_time bnx2fc cnic uio fcoe libfcoe 8021q garp stp mrp libfc llc scsi_transport_fc scsi_tgt sg iTCO_wdt iTCO_vendor_support coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper ptp cryptd hpilo serio_raw hpwdt lpc_ich pps_core ipmi_si pcspkr mfd_core ipmi_msghandler shpchp pcc_cpufreq mperf nfsd auth_rpcgss nfs_acl lockd sunrpc dm_multipath xfs libcrc32c ata_generic pata_acpi sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit ata_piix drm_kms_helper ttm drm libata i2c_core hpsa dm_mirror dm_region_hash dm_log dm_mod [last unloaded: mdio]
[ 6286.808750] CPU: 3 PID: 1304 Comm: bnx2fc_l2_threa Not tainted 3.10.0-121.el7.x86_64 #1
[ 6286.808750] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013
[ 6286.808752]  0000000000000000 000000000b36e715 ffff8800deba1e00 ffffffff815ec0ba
[ 6286.808753]  ffff8800deba1e38 ffffffff8105dee1 ffffffffa05618c0 ffff8801e4c81888
[ 6286.808754]  ffffe8ffff663868 ffff8801f402b180 ffff8801f56bc000 ffff8800deba1e48
[ 6286.808754] Call Trace:
[ 6286.808759]  [<ffffffff815ec0ba>] dump_stack+0x19/0x1b
[ 6286.808762]  [<ffffffff8105dee1>] warn_slowpath_common+0x61/0x80
[ 6286.808763]  [<ffffffff8105e00a>] warn_slowpath_null+0x1a/0x20
[ 6286.808765]  [<ffffffffa054f415>] bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]
[ 6286.808767]  [<ffffffffa054eff0>] ? bnx2fc_disable+0x90/0x90 [bnx2fc]
[ 6286.808769]  [<ffffffff81085aef>] kthread+0xcf/0xe0
[ 6286.808770]  [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
[ 6286.808772]  [<ffffffff815fc76c>] ret_from_fork+0x7c/0xb0
[ 6286.808773]  [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
[ 6286.808774] ---[ end trace c6cdb939184ccb4e ]---

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 785d0d71781e..a190ab663133 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -411,6 +411,7 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev,
 	struct fc_frame_header *fh;
 	struct fcoe_rcv_info *fr;
 	struct fcoe_percpu_s *bg;
+	struct sk_buff *tmp_skb;
 	unsigned short oxid;
 
 	interface = container_of(ptype, struct bnx2fc_interface,
@@ -423,6 +424,12 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct net_device *dev,
 		goto err;
 	}
 
+	tmp_skb = skb_share_check(skb, GFP_ATOMIC);
+	if (!tmp_skb)
+		goto err;
+
+	skb = tmp_skb;
+
 	if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) {
 		printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n");
 		goto err;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 091/168] scsi: add Intel Multi-Flex to scsi scan blacklist
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (89 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 090/168] bnx2fc: do not add shared skbs to the fcoe_rx_list Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 092/168] ARM: 8216/1: xscale: correct auxiliary register in suspend/resume Luis Henriques
                   ` (76 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christian Sünkenberg, Christoph Hellwig, Luis Henriques

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

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

From: =?UTF-8?q?Christian=20S=C3=BCnkenberg?=

commit 1899045510ff109980d9cc34e330fd8ca3631871 upstream.

Intel Multi-Flex LUNs choke on REPORT SUPPORTED OPERATION CODES
resulting in sd_mod hanging for several minutes on startup.
The issue was introduced with WRITE SAME discovery heuristics.

Fixes: 5db44863b6eb ("[SCSI] sd: Implement support for WRITE SAME")
Signed-off-by: Christian Sünkenberg <christian.suenkenberg@hfg-karlsruhe.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/scsi/scsi_devinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 49014a143c6a..c1d04d4d3c6c 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -202,6 +202,7 @@ static struct {
 	{"IOMEGA", "Io20S         *F", NULL, BLIST_KEY},
 	{"INSITE", "Floptical   F*8I", NULL, BLIST_KEY},
 	{"INSITE", "I325VM", NULL, BLIST_KEY},
+	{"Intel", "Multi-Flex", NULL, BLIST_NO_RSOC},
 	{"iRiver", "iFP Mass Driver", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36},
 	{"LASOUND", "CDX7405", "3.10", BLIST_MAX5LUN | BLIST_SINGLELUN},
 	{"MATSHITA", "PD-1", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 092/168] ARM: 8216/1: xscale: correct auxiliary register in suspend/resume
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (90 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 091/168] scsi: add Intel Multi-Flex to scsi scan blacklist Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 093/168] USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012 Luis Henriques
                   ` (75 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dmitry Eremin-Solenikov, Russell King, Luis Henriques

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

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

From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

commit ef59a20ba375aeb97b3150a118318884743452a8 upstream.

According to the manuals I have, XScale auxiliary register should be
reached with opc_2 = 1 instead of crn = 1. cpu_xscale_proc_init
correctly uses c1, c0, 1 arguments, but cpu_xscale_do_suspend and
cpu_xscale_do_resume use c1, c1, 0. Correct suspend/resume functions to
also use c1, c0, 1.

The issue was primarily noticed thanks to qemu reporing "unsupported
instruction" on the pxa suspend path. Confirmed in PXA210/250 and PXA255
XScale Core manuals and in PXA270 and PXA320 Developers Guides.

Harware tested by me on tosa (pxa255). Robert confirmed on pxa270 board.

Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mm/proc-xscale.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index d19b1cfcad91..b34b95f45cb3 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -535,7 +535,7 @@ ENTRY(cpu_xscale_do_suspend)
 	mrc	p15, 0, r5, c15, c1, 0	@ CP access reg
 	mrc	p15, 0, r6, c13, c0, 0	@ PID
 	mrc	p15, 0, r7, c3, c0, 0	@ domain ID
-	mrc	p15, 0, r8, c1, c1, 0	@ auxiliary control reg
+	mrc	p15, 0, r8, c1, c0, 1	@ auxiliary control reg
 	mrc	p15, 0, r9, c1, c0, 0	@ control reg
 	bic	r4, r4, #2		@ clear frequency change bit
 	stmia	r0, {r4 - r9}		@ store cp regs
@@ -552,7 +552,7 @@ ENTRY(cpu_xscale_do_resume)
 	mcr	p15, 0, r6, c13, c0, 0	@ PID
 	mcr	p15, 0, r7, c3, c0, 0	@ domain ID
 	mcr	p15, 0, r1, c2, c0, 0	@ translation table base addr
-	mcr	p15, 0, r8, c1, c1, 0	@ auxiliary control reg
+	mcr	p15, 0, r8, c1, c0, 1	@ auxiliary control reg
 	mov	r0, r9			@ control register
 	b	cpu_resume_mmu
 ENDPROC(cpu_xscale_do_resume)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 093/168] USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (91 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 092/168] ARM: 8216/1: xscale: correct auxiliary register in suspend/resume Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 094/168] USB: xhci: don't start a halted endpoint before its new dequeue is set Luis Henriques
                   ` (74 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Greg Kroah-Hartman, Luis Henriques

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

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

From: Hans de Goede <hdegoede@redhat.com>

commit 8daee1352d51a32676b84bddcc0e3252d1caa833 upstream.

These disks have a broken uas implementation, the tag field of the status
iu-s is not set properly, so we need to fall-back to usb-storage for these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/storage/unusual_uas.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
index 2fefaf923e4a..18a283d6de1c 100644
--- a/drivers/usb/storage/unusual_uas.h
+++ b/drivers/usb/storage/unusual_uas.h
@@ -103,3 +103,10 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
 		"VL711",
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_NO_ATA_1X),
+
+/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
+UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
+		"Hitachi",
+		"External HDD",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_IGNORE_UAS),
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 094/168] USB: xhci: don't start a halted endpoint before its new dequeue is set
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (92 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 093/168] USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012 Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 095/168] Revert "xhci: clear root port wake on bits if controller isn't wake-up capable" Luis Henriques
                   ` (73 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mathias Nyman, Greg Kroah-Hartman, Luis Henriques

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

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit c3492dbfa1050debf23a5b5cd2bc7514c5b37896 upstream.

A halted endpoint ring must first be reset, then move the ring
dequeue pointer past the problematic TRB. If we start the ring too
early after reset, but before moving the dequeue pointer we
will end up executing the same problematic TRB again.

As we always issue a set transfer dequeue command after a reset
endpoint command we can skip starting endpoint rings at reset endpoint
command completion.

Without this fix we end up trying to handle the same faulty TD for
contol endpoints. causing timeout, and failing testusb ctrl_out write
tests.

Fixes: e9df17e (USB: xhci: Correct assumptions about number of rings per endpoint.)
Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-ring.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 28a929d45cfe..5188a6bded0e 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1102,9 +1102,8 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id,
 				false);
 		xhci_ring_cmd_db(xhci);
 	} else {
-		/* Clear our internal halted state and restart the ring(s) */
+		/* Clear our internal halted state */
 		xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED;
-		ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
 	}
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 095/168] Revert "xhci: clear root port wake on bits if controller isn't wake-up capable"
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (93 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 094/168] USB: xhci: don't start a halted endpoint before its new dequeue is set Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 096/168] USB: xhci: Reset a halted endpoint immediately when we encounter a stall Luis Henriques
                   ` (72 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lu Baolu, Mathias Nyman, Greg Kroah-Hartman, Luis Henriques

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

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

From: Lu Baolu <baolu.lu@linux.intel.com>

commit 9b41ebd3cf0f68d8cad779d3eeba336f78262e43 upstream.

commit ff8cbf250b44 ("xhci: clear root port wake on bits if controller isn't")
can cause device detection error if runtime PM is enabled, and S3 wake
is disabled. Revert it.
https://bugzilla.kernel.org/show_bug.cgi?id=85701

This commit got into stable and should be reverted from there as well.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reported-by: Dmitry Nezhevenko <dion@inhex.net>
[Mathias Nyman: reword commit message]
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-hub.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 69aece31143a..64f0ddac957f 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -22,7 +22,6 @@
 
 
 #include <linux/slab.h>
-#include <linux/device.h>
 #include <asm/unaligned.h>
 
 #include "xhci.h"
@@ -1142,9 +1141,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
 		 * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME
 		 * is enabled, so also enable remote wake here.
 		 */
-		if (hcd->self.root_hub->do_remote_wakeup
-				&& device_may_wakeup(hcd->self.controller)) {
-
+		if (hcd->self.root_hub->do_remote_wakeup) {
 			if (t1 & PORT_CONNECT) {
 				t2 |= PORT_WKOC_E | PORT_WKDISC_E;
 				t2 &= ~PORT_WKCONN_E;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 096/168] USB: xhci: Reset a halted endpoint immediately when we encounter a stall.
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (94 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 095/168] Revert "xhci: clear root port wake on bits if controller isn't wake-up capable" Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 097/168] usb: xhci: rework root port wake bits if controller isn't allowed to wakeup Luis Henriques
                   ` (71 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mathias Nyman, Greg Kroah-Hartman, Luis Henriques

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

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit 8e71a322fdb127814bcba423a512914ca5bc6cf5 upstream.

If a device is halted and reuturns a STALL, then the halted endpoint
needs to be cleared both on the host and device side. The host
side halt is cleared by issueing a xhci reset endpoint command. The device side
is cleared with a ClearFeature(ENDPOINT_HALT) request, which should
be issued by the device driver if a URB reruen -EPIPE.

Previously we cleared the host side halt after the device side was cleared.
To make sure the host side halt is cleared in time we want to issue the
reset endpoint command immedialtely when a STALL status is encountered.

Otherwise we end up not following the specs and not returning -EPIPE
several times in a row when trying to transfer data to a halted endpoint.

Fixes: bcef3fd (USB: xhci: Handle errors that cause endpoint halts.)
Tested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-ring.c | 40 +++++++--------------------
 drivers/usb/host/xhci.c      | 65 ++++++++++----------------------------------
 2 files changed, 25 insertions(+), 80 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 5188a6bded0e..17df04a2d18b 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1846,22 +1846,13 @@ static int finish_td(struct xhci_hcd *xhci, struct xhci_td *td,
 		ep->stopped_td = td;
 		return 0;
 	} else {
-		if (trb_comp_code == COMP_STALL) {
-			/* The transfer is completed from the driver's
-			 * perspective, but we need to issue a set dequeue
-			 * command for this stalled endpoint to move the dequeue
-			 * pointer past the TD.  We can't do that here because
-			 * the halt condition must be cleared first.  Let the
-			 * USB class driver clear the stall later.
-			 */
-			ep->stopped_td = td;
-			ep->stopped_stream = ep_ring->stream_id;
-		} else if (xhci_requires_manual_halt_cleanup(xhci,
-					ep_ctx, trb_comp_code)) {
-			/* Other types of errors halt the endpoint, but the
-			 * class driver doesn't call usb_reset_endpoint() unless
-			 * the error is -EPIPE.  Clear the halted status in the
-			 * xHCI hardware manually.
+		if (trb_comp_code == COMP_STALL ||
+		    xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
+						      trb_comp_code)) {
+			/* Issue a reset endpoint command to clear the host side
+			 * halt, followed by a set dequeue command to move the
+			 * dequeue pointer past the TD.
+			 * The class driver clears the device side halt later.
 			 */
 			xhci_cleanup_halted_endpoint(xhci,
 					slot_id, ep_index, ep_ring->stream_id,
@@ -1981,9 +1972,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
 		else
 			td->urb->actual_length = 0;
 
-		xhci_cleanup_halted_endpoint(xhci,
-			slot_id, ep_index, 0, td, event_trb);
-		return finish_td(xhci, td, event_trb, event, ep, status, true);
+		return finish_td(xhci, td, event_trb, event, ep, status, false);
 	}
 	/*
 	 * Did we transfer any data, despite the errors that might have
@@ -2537,17 +2526,8 @@ cleanup:
 		if (ret) {
 			urb = td->urb;
 			urb_priv = urb->hcpriv;
-			/* Leave the TD around for the reset endpoint function
-			 * to use(but only if it's not a control endpoint,
-			 * since we already queued the Set TR dequeue pointer
-			 * command for stalled control endpoints).
-			 */
-			if (usb_endpoint_xfer_control(&urb->ep->desc) ||
-				(trb_comp_code != COMP_STALL &&
-					trb_comp_code != COMP_BABBLE))
-				xhci_urb_free_priv(xhci, urb_priv);
-			else
-				kfree(urb_priv);
+
+			xhci_urb_free_priv(xhci, urb_priv);
 
 			usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
 			if ((urb->actual_length != urb->transfer_buffer_length &&
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 2d1284adc987..502580e172e9 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2921,68 +2921,33 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
 	}
 }
 
-/* Deal with stalled endpoints.  The core should have sent the control message
- * to clear the halt condition.  However, we need to make the xHCI hardware
- * reset its sequence number, since a device will expect a sequence number of
- * zero after the halt condition is cleared.
+/* Called when clearing halted device. The core should have sent the control
+ * message to clear the device halt condition. The host side of the halt should
+ * already be cleared with a reset endpoint command issued when the STALL tx
+ * event was received.
+ *
  * Context: in_interrupt
  */
+
 void xhci_endpoint_reset(struct usb_hcd *hcd,
 		struct usb_host_endpoint *ep)
 {
 	struct xhci_hcd *xhci;
-	struct usb_device *udev;
-	unsigned int ep_index;
-	unsigned long flags;
-	int ret;
-	struct xhci_virt_ep *virt_ep;
-	struct xhci_command *command;
 
 	xhci = hcd_to_xhci(hcd);
-	udev = (struct usb_device *) ep->hcpriv;
-	/* Called with a root hub endpoint (or an endpoint that wasn't added
-	 * with xhci_add_endpoint()
-	 */
-	if (!ep->hcpriv)
-		return;
-	ep_index = xhci_get_endpoint_index(&ep->desc);
-	virt_ep = &xhci->devs[udev->slot_id]->eps[ep_index];
-	if (!virt_ep->stopped_td) {
-		xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
-			"Endpoint 0x%x not halted, refusing to reset.",
-			ep->desc.bEndpointAddress);
-		return;
-	}
-	if (usb_endpoint_xfer_control(&ep->desc)) {
-		xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
-				"Control endpoint stall already handled.");
-		return;
-	}
-
-	command = xhci_alloc_command(xhci, false, false, GFP_ATOMIC);
-	if (!command)
-		return;
 
-	xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
-			"Queueing reset endpoint command");
-	spin_lock_irqsave(&xhci->lock, flags);
-	ret = xhci_queue_reset_ep(xhci, command, udev->slot_id, ep_index);
 	/*
-	 * Can't change the ring dequeue pointer until it's transitioned to the
-	 * stopped state, which is only upon a successful reset endpoint
-	 * command.  Better hope that last command worked!
+	 * We might need to implement the config ep cmd in xhci 4.8.1 note:
+	 * The Reset Endpoint Command may only be issued to endpoints in the
+	 * Halted state. If software wishes reset the Data Toggle or Sequence
+	 * Number of an endpoint that isn't in the Halted state, then software
+	 * may issue a Configure Endpoint Command with the Drop and Add bits set
+	 * for the target endpoint. that is in the Stopped state.
 	 */
-	if (!ret) {
-		xhci_cleanup_stalled_ring(xhci, udev, ep_index);
-		kfree(virt_ep->stopped_td);
-		xhci_ring_cmd_db(xhci);
-	}
-	virt_ep->stopped_td = NULL;
-	virt_ep->stopped_stream = 0;
-	spin_unlock_irqrestore(&xhci->lock, flags);
 
-	if (ret)
-		xhci_warn(xhci, "FIXME allocate a new ring segment\n");
+	/* For now just print debug to follow the situation */
+	xhci_dbg(xhci, "Endpoint 0x%x ep reset callback called\n",
+		 ep->desc.bEndpointAddress);
 }
 
 static int xhci_check_streams_endpoint(struct xhci_hcd *xhci,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 097/168] usb: xhci: rework root port wake bits if controller isn't allowed to wakeup
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (95 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 096/168] USB: xhci: Reset a halted endpoint immediately when we encounter a stall Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 098/168] ixgbe: Correctly disable VLAN filter in promiscuous mode Luis Henriques
                   ` (70 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lu Baolu, Mathias Nyman, Greg Kroah-Hartman, Luis Henriques

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

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

From: Lu Baolu <baolu.lu@linux.intel.com>

commit a1377e5397ab321e21b793ec8cd2b6f12bd3c718 upstream.

When system is being suspended, if host device is not allowed to do wakeup,
xhci_suspend() needs to clear all root port wake on bits. Otherwise, some
platforms may generate spurious wakeup, even if PCI PME# is disabled.

The initial commit ff8cbf250b44 ("xhci: clear root port wake on bits"),
which also got into stable, turned out to not work correctly and had to
be reverted, and is now rewritten.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
[Mathias Nyman: reword commit message]
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-pci.c  |  2 +-
 drivers/usb/host/xhci-plat.c | 10 +++++++++-
 drivers/usb/host/xhci.c      | 42 +++++++++++++++++++++++++++++++++++++++++-
 drivers/usb/host/xhci.h      |  2 +-
 4 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index d71aa5a97f0d..e614d1831e79 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -279,7 +279,7 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
 	if (xhci_compliance_mode_recovery_timer_quirk_check())
 		pdev->no_d3cold = true;
 
-	return xhci_suspend(xhci);
+	return xhci_suspend(xhci, do_wakeup);
 }
 
 static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 29d8adb5c8d1..271690de8de1 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -245,7 +245,15 @@ static int xhci_plat_suspend(struct device *dev)
 	struct usb_hcd	*hcd = dev_get_drvdata(dev);
 	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);
 
-	return xhci_suspend(xhci);
+	/*
+	 * xhci_suspend() needs `do_wakeup` to know whether host is allowed
+	 * to do wakeup during suspend. Since xhci_plat_suspend is currently
+	 * only designed for system suspend, device_may_wakeup() is enough
+	 * to dertermine whether host is allowed to do wakeup. Need to
+	 * reconsider this when xhci_plat_suspend enlarges its scope, e.g.,
+	 * also applies to runtime suspend.
+	 */
+	return xhci_suspend(xhci, device_may_wakeup(dev));
 }
 
 static int xhci_plat_resume(struct device *dev)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 502580e172e9..5e5f0c1b6613 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -35,6 +35,8 @@
 #define DRIVER_AUTHOR "Sarah Sharp"
 #define DRIVER_DESC "'eXtensible' Host Controller (xHC) Driver"
 
+#define	PORT_WAKE_BITS	(PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E)
+
 /* Some 0.95 hardware can't handle the chain bit on a Link TRB being cleared */
 static int link_quirk;
 module_param(link_quirk, int, S_IRUGO | S_IWUSR);
@@ -850,13 +852,47 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci)
 	xhci_set_cmd_ring_deq(xhci);
 }
 
+static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci)
+{
+	int port_index;
+	__le32 __iomem **port_array;
+	unsigned long flags;
+	u32 t1, t2;
+
+	spin_lock_irqsave(&xhci->lock, flags);
+
+	/* disble usb3 ports Wake bits*/
+	port_index = xhci->num_usb3_ports;
+	port_array = xhci->usb3_ports;
+	while (port_index--) {
+		t1 = readl(port_array[port_index]);
+		t1 = xhci_port_state_to_neutral(t1);
+		t2 = t1 & ~PORT_WAKE_BITS;
+		if (t1 != t2)
+			writel(t2, port_array[port_index]);
+	}
+
+	/* disble usb2 ports Wake bits*/
+	port_index = xhci->num_usb2_ports;
+	port_array = xhci->usb2_ports;
+	while (port_index--) {
+		t1 = readl(port_array[port_index]);
+		t1 = xhci_port_state_to_neutral(t1);
+		t2 = t1 & ~PORT_WAKE_BITS;
+		if (t1 != t2)
+			writel(t2, port_array[port_index]);
+	}
+
+	spin_unlock_irqrestore(&xhci->lock, flags);
+}
+
 /*
  * Stop HC (not bus-specific)
  *
  * This is called when the machine transition into S3/S4 mode.
  *
  */
-int xhci_suspend(struct xhci_hcd *xhci)
+int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
 {
 	int			rc = 0;
 	unsigned int		delay = XHCI_MAX_HALT_USEC;
@@ -867,6 +903,10 @@ int xhci_suspend(struct xhci_hcd *xhci)
 			xhci->shared_hcd->state != HC_STATE_SUSPENDED)
 		return -EINVAL;
 
+	/* Clear root port wake on bits if wakeup not allowed. */
+	if (!do_wakeup)
+		xhci_disable_port_wake_on_bits(xhci);
+
 	/* Don't poll the roothubs on bus suspend. */
 	xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
 	clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index dace5152e179..00ed780c0563 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1764,7 +1764,7 @@ void xhci_shutdown(struct usb_hcd *hcd);
 int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks);
 
 #ifdef	CONFIG_PM
-int xhci_suspend(struct xhci_hcd *xhci);
+int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup);
 int xhci_resume(struct xhci_hcd *xhci, bool hibernated);
 #else
 #define	xhci_suspend	NULL
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 098/168] ixgbe: Correctly disable VLAN filter in promiscuous mode
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (96 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 097/168] usb: xhci: rework root port wake bits if controller isn't allowed to wakeup Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 099/168] ixgbe: Fix possible null-dereference in error path Luis Henriques
                   ` (69 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jacob Keller, Vladislav Yasevich, Jeff Kirsher, David S. Miller,
	Luis Henriques

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

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

From: Vlad Yasevich <vyasevich@gmail.com>

commit 4556dc591691fca743518edb24f15fbc83b5c8ef upstream.

IXGBE adapter seems to require that VLAN filtering be enabled if
VMDQ or SRIOV are enabled.  When those functions are disabled,
VLAN filtering may be disabled in promiscuous mode.

Prior to commit a9b8943ee129 ("ixgbe: remove vlan_filter_disable
and enable functions")

The logic was correct.  However, after the commit the logic
got reversed and VLAN filtered in now turned on when VMDQ/SRIOV
is disabled.

This patch changes the condition to enable hw vlan filtered
when VMDQ or SRIOV is enabled.

Fixes: a9b8943ee129 ("ixgbe: remove vlan_filter_disable and enable functions")
CC: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Acked-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index f5aa3311ea28..889005922c33 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4065,8 +4065,8 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
 		 * if SR-IOV and VMDQ are disabled - otherwise ensure
 		 * that hardware VLAN filters remain enabled.
 		 */
-		if (!(adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |
-					IXGBE_FLAG_SRIOV_ENABLED)))
+		if (adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |
+				      IXGBE_FLAG_SRIOV_ENABLED))
 			vlnctrl |= (IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);
 	} else {
 		if (netdev->flags & IFF_ALLMULTI) {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 099/168] ixgbe: Fix possible null-dereference in error path
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (97 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 098/168] ixgbe: Correctly disable VLAN filter in promiscuous mode Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 100/168] ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe Luis Henriques
                   ` (68 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Rustad, Jeff Kirsher, Luis Henriques

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

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

From: Mark Rustad <mark.d.rustad@intel.com>

commit 508a8c9e264e1057f663e578c47c5ffa00adb160 upstream.

In ixgbe_probe, the code at label err_dma can dereference adapter
when it has a NULL value. The check is there to avoid disabling a
disabled device. When adapter is NULL, treat it as if the device
is enabled, because it is enabled in that case.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 889005922c33..c4d560d7dabb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8477,7 +8477,7 @@ err_alloc_etherdev:
 				     pci_select_bars(pdev, IORESOURCE_MEM));
 err_pci_reg:
 err_dma:
-	if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
+	if (!adapter || !test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
 		pci_disable_device(pdev);
 	return err;
 }
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 100/168] ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (98 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 099/168] ixgbe: Fix possible null-dereference in error path Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 101/168] ALSA: hda - Limit 40bit DMA for AMD HDMI controllers Luis Henriques
                   ` (67 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Rustad, Daniel Borkmann, Jeff Kirsher, David S. Miller,
	Luis Henriques

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

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

From: Daniel Borkmann <dborkman@redhat.com>

commit b5b2ffc0574e1f271d79b6b992ee382dc9d5eaa8 upstream.

While working on a different issue, I noticed an annoying use
after free bug on my machine when unloading the ixgbe driver:

[ 8642.318797] ixgbe 0000:02:00.1: removed PHC on p2p2
[ 8642.742716] ixgbe 0000:02:00.1: complete
[ 8642.743784] BUG: unable to handle kernel paging request at ffff8807d3740a90
[ 8642.744828] IP: [<ffffffffa01c77dc>] ixgbe_remove+0xfc/0x1b0 [ixgbe]
[ 8642.745886] PGD 20c6067 PUD 81c1f6067 PMD 81c15a067 PTE 80000007d3740060
[ 8642.746956] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
[ 8642.748039] Modules linked in: [...]
[ 8642.752929] CPU: 1 PID: 1225 Comm: rmmod Not tainted 3.18.0-rc2+ #49
[ 8642.754203] Hardware name: Supermicro X10SLM-F/X10SLM-F, BIOS 1.1b 11/01/2013
[ 8642.755505] task: ffff8807e34d3fe0 ti: ffff8807b7204000 task.ti: ffff8807b7204000
[ 8642.756831] RIP: 0010:[<ffffffffa01c77dc>]  [<ffffffffa01c77dc>] ixgbe_remove+0xfc/0x1b0 [ixgbe]
[...]
[ 8642.774335] Stack:
[ 8642.775805]  ffff8807ee824098 ffff8807ee824098 ffffffffa01f3000 ffff8807ee824000
[ 8642.777326]  ffff8807b7207e18 ffffffff8137720f ffff8807ee824098 ffff8807ee824098
[ 8642.778848]  ffffffffa01f3068 ffff8807ee8240f8 ffff8807b7207e38 ffffffff8144180f
[ 8642.780365] Call Trace:
[ 8642.781869]  [<ffffffff8137720f>] pci_device_remove+0x3f/0xc0
[ 8642.783395]  [<ffffffff8144180f>] __device_release_driver+0x7f/0xf0
[ 8642.784876]  [<ffffffff814421f8>] driver_detach+0xb8/0xc0
[ 8642.786352]  [<ffffffff814414a9>] bus_remove_driver+0x59/0xe0
[ 8642.787783]  [<ffffffff814429d0>] driver_unregister+0x30/0x70
[ 8642.789202]  [<ffffffff81375c65>] pci_unregister_driver+0x25/0xa0
[ 8642.790657]  [<ffffffffa01eb38e>] ixgbe_exit_module+0x1c/0xc8e [ixgbe]
[ 8642.792064]  [<ffffffff810f93a2>] SyS_delete_module+0x132/0x1c0
[ 8642.793450]  [<ffffffff81012c61>] ? do_notify_resume+0x61/0xa0
[ 8642.794837]  [<ffffffff816d2029>] system_call_fastpath+0x12/0x17

The issue is that test_and_set_bit() done on adapter->state is being
performed *after* the netdevice has been freed via free_netdev().

When netdev is being allocated on initialization time, it allocates
a private area, here struct ixgbe_adapter, that resides after the
net_device structure. In ixgbe_probe(), the device init routine,
we set up the adapter after alloc_etherdev_mq() on the private area
and add a reference for the pci_dev as well via pci_set_drvdata().

Both in the error path of ixgbe_probe(), but also on module unload
when ixgbe_remove() is being called, commit 41c62843eb6a ("ixgbe:
Fix rcu warnings induced by LER") accesses adapter after free_netdev().
The patch stores the result in a bool and thus fixes above oops on my
side.

Fixes: 41c62843eb6a ("ixgbe: Fix rcu warnings induced by LER")
Cc: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index c4d560d7dabb..a125d3c35856 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8081,6 +8081,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int i, err, pci_using_dac, expected_gts;
 	unsigned int indices = MAX_TX_QUEUES;
 	u8 part_str[IXGBE_PBANUM_LENGTH];
+	bool disable_dev = false;
 #ifdef IXGBE_FCOE
 	u16 device_caps;
 #endif
@@ -8471,13 +8472,14 @@ err_sw_init:
 	iounmap(adapter->io_addr);
 	kfree(adapter->mac_table);
 err_ioremap:
+	disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
 	free_netdev(netdev);
 err_alloc_etherdev:
 	pci_release_selected_regions(pdev,
 				     pci_select_bars(pdev, IORESOURCE_MEM));
 err_pci_reg:
 err_dma:
-	if (!adapter || !test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
+	if (!adapter || disable_dev)
 		pci_disable_device(pdev);
 	return err;
 }
@@ -8495,6 +8497,7 @@ static void ixgbe_remove(struct pci_dev *pdev)
 {
 	struct ixgbe_adapter *adapter = pci_get_drvdata(pdev);
 	struct net_device *netdev = adapter->netdev;
+	bool disable_dev;
 
 	ixgbe_dbg_adapter_exit(adapter);
 
@@ -8544,11 +8547,12 @@ static void ixgbe_remove(struct pci_dev *pdev)
 	e_dev_info("complete\n");
 
 	kfree(adapter->mac_table);
+	disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
 	free_netdev(netdev);
 
 	pci_disable_pcie_error_reporting(pdev);
 
-	if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
+	if (disable_dev)
 		pci_disable_device(pdev);
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 101/168] ALSA: hda - Limit 40bit DMA for AMD HDMI controllers
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (99 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 100/168] ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 102/168] PCI/MSI: Add device flag indicating that 64-bit MSIs don't work Luis Henriques
                   ` (66 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Takashi Iwai, Benjamin Herrenschmidt, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 413cbf469a19e7662ba5025695bf5a573927105a upstream.

AMD/ATI HDMI controller chip models, we already have a filter to lower
to 32bit DMA, but the rest are supposed to be working with 64bit
although the hardware doesn't really work with 63bit but only with 40
or 48bit DMA.  In this patch, we take 40bit DMA for safety for the
AMD/ATI controllers as the graphics drivers does.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ luis: backported to 3.16:
  - replaced AZX_GCAP_64OK by ICH6_GCAP_64OK ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/hda_intel.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 007a1a8298fc..ba0266f7cf03 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1273,6 +1273,7 @@ static int azx_first_init(struct azx *chip)
 	struct snd_card *card = chip->card;
 	int err;
 	unsigned short gcap;
+	unsigned int dma_bits = 64;
 
 #if BITS_PER_LONG != 64
 	/* Fix up base address on ULI M5461 */
@@ -1309,9 +1310,14 @@ static int azx_first_init(struct azx *chip)
 	gcap = azx_readw(chip, GCAP);
 	dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
 
+	/* AMD devices support 40 or 48bit DMA, take the safe one */
+	if (chip->pci->vendor == PCI_VENDOR_ID_AMD)
+		dma_bits = 40;
+
 	/* disable SB600 64bit support for safety */
 	if (chip->pci->vendor == PCI_VENDOR_ID_ATI) {
 		struct pci_dev *p_smbus;
+		dma_bits = 40;
 		p_smbus = pci_get_device(PCI_VENDOR_ID_ATI,
 					 PCI_DEVICE_ID_ATI_SBX00_SMBUS,
 					 NULL);
@@ -1341,9 +1347,11 @@ static int azx_first_init(struct azx *chip)
 	}
 
 	/* allow 64bit DMA address if supported by H/W */
-	if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
-		pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
-	else {
+	if (!(gcap & ICH6_GCAP_64OK))
+		dma_bits = 32;
+	if (!pci_set_dma_mask(pci, DMA_BIT_MASK(dma_bits))) {
+		pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(dma_bits));
+	} else {
 		pci_set_dma_mask(pci, DMA_BIT_MASK(32));
 		pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
 	}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 102/168] PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (100 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 101/168] ALSA: hda - Limit 40bit DMA for AMD HDMI controllers Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 103/168] gpu/radeon: Set flag to indicate broken 64-bit MSI Luis Henriques
                   ` (65 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Benjamin Herrenschmidt, Luis Henriques

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

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

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

commit f144d1496b47e7450f41b767d0d91c724c2198bc upstream.

This can be set by quirks/drivers to be used by the architecture code
that assigns the MSI addresses.

We additionally add verification in the core MSI code that the values
assigned by the architecture do satisfy the limitation in order to fail
gracefully if they don't (ie. the arch hasn't been updated to deal with
that quirk yet).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/pci/msi.c   | 26 ++++++++++++++++++++++++++
 include/linux/pci.h |  1 +
 2 files changed, 27 insertions(+)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 13f3d3037272..1d6c61ad7da7 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -594,6 +594,20 @@ error_attrs:
 	return ret;
 }
 
+static int msi_verify_entries(struct pci_dev *dev)
+{
+	struct msi_desc *entry;
+
+	list_for_each_entry(entry, &dev->msi_list, list) {
+		if (!dev->no_64bit_msi || !entry->msg.address_hi)
+			continue;
+		dev_err(&dev->dev, "Device has broken 64-bit MSI but arch"
+			" tried to assign one above 4G\n");
+		return -EIO;
+	}
+	return 0;
+}
+
 /**
  * msi_capability_init - configure device's MSI capability structure
  * @dev: pointer to the pci_dev data structure of MSI device function
@@ -647,6 +661,13 @@ static int msi_capability_init(struct pci_dev *dev, int nvec)
 		return ret;
 	}
 
+	ret = msi_verify_entries(dev);
+	if (ret) {
+		msi_mask_irq(entry, mask, ~mask);
+		free_msi_irqs(dev);
+		return ret;
+	}
+
 	ret = populate_msi_sysfs(dev);
 	if (ret) {
 		msi_mask_irq(entry, mask, ~mask);
@@ -762,6 +783,11 @@ static int msix_capability_init(struct pci_dev *dev,
 	if (ret)
 		goto out_avail;
 
+	/* Check if all MSI entries honor device restrictions */
+	ret = msi_verify_entries(dev);
+	if (ret)
+		goto out_free;
+
 	/*
 	 * Some devices require MSI-X to be enabled before we can touch the
 	 * MSI-X registers.  We need to mask all the vectors to prevent
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 97fe7ebf2e25..04fdc409eec6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -331,6 +331,7 @@ struct pci_dev {
 	unsigned int	is_added:1;
 	unsigned int	is_busmaster:1; /* device is busmaster */
 	unsigned int	no_msi:1;	/* device may not use msi */
+	unsigned int	no_64bit_msi:1; /* device may only use 32-bit MSIs */
 	unsigned int	block_cfg_access:1;	/* config space access is blocked */
 	unsigned int	broken_parity_status:1;	/* Device generates false positive parity */
 	unsigned int	irq_reroute_variant:2;	/* device needs IRQ rerouting variant */
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 103/168] gpu/radeon: Set flag to indicate broken 64-bit MSI
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (101 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 102/168] PCI/MSI: Add device flag indicating that 64-bit MSIs don't work Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 104/168] sound/radeon: Move 64-bit MSI quirk from arch to driver Luis Henriques
                   ` (64 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Benjamin Herrenschmidt, Luis Henriques

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

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

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

commit 91ed6fd2c383bb8f02d66e98b4a4d2f7207249dc upstream.

Some radeon ASICs don't support all 64 address bits of MSIs despite
advertising support for 64-bit MSIs in their configuration space.

This breaks on systems such as IBM POWER7/8, where 64-bit MSIs can
be assigned with some of the high address bits set.

This makes use of the newly introduced "no_64bit_msi" flag in structure
pci_dev to allow the MSI allocation code to fallback to 32-bit MSIs
on those adapters.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_irq_kms.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 16807afab362..c74f12d125f7 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -202,6 +202,16 @@ static bool radeon_msi_ok(struct radeon_device *rdev)
 	if (rdev->flags & RADEON_IS_AGP)
 		return false;
 
+	/*
+	 * Older chips have a HW limitation, they can only generate 40 bits
+	 * of address for "64-bit" MSIs which breaks on some platforms, notably
+	 * IBM POWER servers, so we limit them
+	 */
+	if (rdev->family < CHIP_BONAIRE) {
+		dev_info(rdev->dev, "radeon: MSI limited to 32-bit\n");
+		rdev->pdev->no_64bit_msi = 1;
+	}
+
 	/* force MSI on */
 	if (radeon_msi == 1)
 		return true;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 104/168] sound/radeon: Move 64-bit MSI quirk from arch to driver
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (102 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 103/168] gpu/radeon: Set flag to indicate broken 64-bit MSI Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 105/168] powerpc/pseries: Honor the generic "no_64bit_msi" flag Luis Henriques
                   ` (63 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Benjamin Herrenschmidt, Luis Henriques

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

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

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

commit db79afa1e57925ba96ab18514c0ebe42a28e393e upstream.

A number of radeon cards have a HW limitation causing them to be
unable to generate the full 64-bit of address bits for MSIs. This
breaks MSIs on some platforms such as POWER machines.

We used to have a powerpc specific quirk to address that on a
single card, but this doesn't scale very well, this is better
put under control of the drivers who know precisely what a given
HW revision can do.

We now have a generic quirk in the PCI code. We should set it
appropriately for all radeon's from the audio driver.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/hda_intel.c | 10 ++++++++--
 sound/pci/hda/hda_priv.h  |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ba0266f7cf03..6383971dcd15 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -252,7 +252,8 @@ enum {
 
 /* quirks for ATI/AMD HDMI */
 #define AZX_DCAPS_PRESET_ATI_HDMI \
-	(AZX_DCAPS_NO_TCSEL | AZX_DCAPS_SYNC_WRITE | AZX_DCAPS_POSFIX_LPIB)
+	(AZX_DCAPS_NO_TCSEL | AZX_DCAPS_SYNC_WRITE | AZX_DCAPS_POSFIX_LPIB|\
+	 AZX_DCAPS_NO_MSI64)
 
 /* quirks for Nvidia */
 #define AZX_DCAPS_PRESET_NVIDIA \
@@ -1297,9 +1298,14 @@ static int azx_first_init(struct azx *chip)
 		return -ENXIO;
 	}
 
-	if (chip->msi)
+	if (chip->msi) {
+		if (chip->driver_caps & AZX_DCAPS_NO_MSI64) {
+			dev_dbg(card->dev, "Disabling 64bit MSI\n");
+			pci->no_64bit_msi = true;
+		}
 		if (pci_enable_msi(pci) < 0)
 			chip->msi = 0;
+	}
 
 	if (azx_acquire_irq(chip, 0) < 0)
 		return -EBUSY;
diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h
index e9d1a5762a55..526bc876f0a1 100644
--- a/sound/pci/hda/hda_priv.h
+++ b/sound/pci/hda/hda_priv.h
@@ -191,6 +191,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
 #define AZX_DCAPS_PM_RUNTIME	(1 << 26)	/* runtime PM support */
 #define AZX_DCAPS_I915_POWERWELL (1 << 27)	/* HSW i915 powerwell support */
 #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28)	/* CORBRP clears itself after reset */
+#define AZX_DCAPS_NO_MSI64      (1 << 29)	/* Stick to 32-bit MSIs */
 
 /* position fix mode */
 enum {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 105/168] powerpc/pseries: Honor the generic "no_64bit_msi" flag
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (103 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 104/168] sound/radeon: Move 64-bit MSI quirk from arch to driver Luis Henriques
@ 2014-12-15 14:25 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 106/168] MIPS: r4kcache: Add EVA case for protected_writeback_dcache_line Luis Henriques
                   ` (62 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:25 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Benjamin Herrenschmidt, Luis Henriques

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

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

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

commit 415072a041bf50dbd6d56934ffc0cbbe14c97be8 upstream.

Instead of the arch specific quirk which we are deprecating

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/platforms/pseries/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 0c882e83c4ce..6849d85ea0d5 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -428,7 +428,7 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type)
 	 */
 again:
 	if (type == PCI_CAP_ID_MSI) {
-		if (pdn->force_32bit_msi) {
+		if (pdev->no_64bit_msi) {
 			rc = rtas_change_msi(pdn, RTAS_CHANGE_32MSI_FN, nvec);
 			if (rc < 0) {
 				/*
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 106/168] MIPS: r4kcache: Add EVA case for protected_writeback_dcache_line
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (104 preceding siblings ...)
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 105/168] powerpc/pseries: Honor the generic "no_64bit_msi" flag Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 107/168] MIPS: cpu-probe: Set the FTLB probability bit on supported cores Luis Henriques
                   ` (61 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Markos Chandras, linux-mips, Ralf Baechle, Luis Henriques

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

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

From: Markos Chandras <markos.chandras@imgtec.com>

commit 83fd43449baaf88fe5c03dd0081a062041837c51 upstream.

Commit de8974e3f76c0 ("MIPS: asm: r4kcache: Add EVA cache flushing
functions") added cache function for EVA using the cachee instruction.
However, it didn't add a case for the protected_writeback_dcache_line.
mips_dsemul() calls r4k_flush_cache_sigtramp() which in turn uses
the protected_writeback_dcache_line() to flush the trampoline code
back to memory. This used the wrong "cache" instruction leading to
random userland crashes on non-FPU cores.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8331/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/include/asm/r4kcache.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h
index 0b8bd28a0df1..ed038d7c3410 100644
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
@@ -254,7 +254,11 @@ static inline void protected_flush_icache_line(unsigned long addr)
  */
 static inline void protected_writeback_dcache_line(unsigned long addr)
 {
+#ifdef CONFIG_EVA
+	protected_cachee_op(Hit_Writeback_Inv_D, addr);
+#else
 	protected_cache_op(Hit_Writeback_Inv_D, addr);
+#endif
 }
 
 static inline void protected_writeback_scache_line(unsigned long addr)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 107/168] MIPS: cpu-probe: Set the FTLB probability bit on supported cores
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (105 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 106/168] MIPS: r4kcache: Add EVA case for protected_writeback_dcache_line Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 108/168] MIPS: fix EVA & non-SMP non-FPU FP context signal handling Luis Henriques
                   ` (60 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Markos Chandras, linux-mips, Ralf Baechle, Luis Henriques

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

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

From: Markos Chandras <markos.chandras@imgtec.com>

commit cf0a8aa0226da5de88011e7f30eff22a894b2f49 upstream.

Make use of the Config6/FLTBP bit to set the probability of a TLBWR
instruction to hit the FTLB or the VTLB. A value of 0 (which may be
the default value on certain cores, such as proAptiv or P5600)
means that a TLBWR instruction will never hit the VTLB which
leads to performance limitations since it effectively decreases
the number of available TLB slots.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8368/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/include/asm/mipsregs.h |  2 ++
 arch/mips/kernel/cpu-probe.c     | 33 ++++++++++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 98e9754a4b6b..6ad0208b50fb 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -660,6 +660,8 @@
 #define MIPS_CONF6_SYND		(_ULCAST_(1) << 13)
 /* proAptiv FTLB on/off bit */
 #define MIPS_CONF6_FTLBEN	(_ULCAST_(1) << 15)
+/* FTLB probability bits */
+#define MIPS_CONF6_FTLBP_SHIFT	(16)
 
 #define MIPS_CONF7_WII		(_ULCAST_(1) << 31)
 
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index d74f957c561e..d5006d23ca7b 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -179,6 +179,32 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa)
 static char unknown_isa[] = KERN_ERR \
 	"Unsupported ISA type, c0.config0: %d.";
 
+static unsigned int calculate_ftlb_probability(struct cpuinfo_mips *c)
+{
+
+	unsigned int probability = c->tlbsize / c->tlbsizevtlb;
+
+	/*
+	 * 0 = All TLBWR instructions go to FTLB
+	 * 1 = 15:1: For every 16 TBLWR instructions, 15 go to the
+	 * FTLB and 1 goes to the VTLB.
+	 * 2 = 7:1: As above with 7:1 ratio.
+	 * 3 = 3:1: As above with 3:1 ratio.
+	 *
+	 * Use the linear midpoint as the probability threshold.
+	 */
+	if (probability >= 12)
+		return 1;
+	else if (probability >= 6)
+		return 2;
+	else
+		/*
+		 * So FTLB is less than 4 times bigger than VTLB.
+		 * A 3:1 ratio can still be useful though.
+		 */
+		return 3;
+}
+
 static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)
 {
 	unsigned int config6;
@@ -189,9 +215,14 @@ static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)
 	case CPU_P5600:
 		/* proAptiv & related cores use Config6 to enable the FTLB */
 		config6 = read_c0_config6();
+		/* Clear the old probability value */
+		config6 &= ~(3 << MIPS_CONF6_FTLBP_SHIFT);
 		if (enable)
 			/* Enable FTLB */
-			write_c0_config6(config6 | MIPS_CONF6_FTLBEN);
+			write_c0_config6(config6 |
+					 (calculate_ftlb_probability(c)
+					  << MIPS_CONF6_FTLBP_SHIFT)
+					 | MIPS_CONF6_FTLBEN);
 		else
 			/* Disable FTLB */
 			write_c0_config6(config6 &  ~MIPS_CONF6_FTLBEN);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 108/168] MIPS: fix EVA & non-SMP non-FPU FP context signal handling
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (106 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 107/168] MIPS: cpu-probe: Set the FTLB probability bit on supported cores Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 109/168] MIPS: Loongson: Make platform serial setup always built-in Luis Henriques
                   ` (59 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Paul Burton, linux-mips, Ralf Baechle, Luis Henriques

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

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

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

commit 14fa12df1d6bc1d3389a0fa842e0ebd8e8a9af26 upstream.

The save_fp_context & restore_fp_context pointers were being assigned
to the wrong variables if either:

  - The kernel is configured for UP & runs on a system without an FPU,
    since b2ead5282885 "MIPS: Move & rename
    fpu_emulator_{save,restore}_context".

  - The kernel is configured for EVA, since ca750649e08c "MIPS: kernel:
    signal: Prevent save/restore FPU context in user memory".

This would lead to FP context being clobbered incorrectly when setting
up a sigcontext, then the garbage values being saved uselessly when
returning from the signal.

Fix by swapping the pointer assignments appropriately.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8230/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/kernel/signal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 9e60d117e41e..394e2b12a3ba 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -676,13 +676,13 @@ static int signal_setup(void)
 		save_fp_context = _save_fp_context;
 		restore_fp_context = _restore_fp_context;
 	} else {
-		save_fp_context = copy_fp_from_sigcontext;
-		restore_fp_context = copy_fp_to_sigcontext;
+		save_fp_context = copy_fp_to_sigcontext;
+		restore_fp_context = copy_fp_from_sigcontext;
 	}
 #endif /* CONFIG_SMP */
 #else
-	save_fp_context = copy_fp_from_sigcontext;;
-	restore_fp_context = copy_fp_to_sigcontext;
+	save_fp_context = copy_fp_to_sigcontext;
+	restore_fp_context = copy_fp_from_sigcontext;
 #endif
 
 	return 0;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 109/168] MIPS: Loongson: Make platform serial setup always built-in.
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (107 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 108/168] MIPS: fix EVA & non-SMP non-FPU FP context signal handling Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 110/168] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset Luis Henriques
                   ` (58 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aaro Koskinen, linux-mips, Huacai Chen, Markos Chandras,
	Ralf Baechle, Luis Henriques

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

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

From: Aaro Koskinen <aaro.koskinen@iki.fi>

commit 26927f76499849e095714452b8a4e09350f6a3b9 upstream.

If SERIAL_8250 is compiled as a module, the platform specific setup
for Loongson will be a module too, and it will not work very well.
At least on Loongson 3 it will trigger a build failure,
since loongson_sysconf is not exported to modules.

Fix by making the platform specific serial code always built-in.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reported-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Markos Chandras <Markos.Chandras@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/8533/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/loongson/common/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile
index 0bb9cc9dc621..d87e03330b29 100644
--- a/arch/mips/loongson/common/Makefile
+++ b/arch/mips/loongson/common/Makefile
@@ -11,7 +11,8 @@ obj-$(CONFIG_PCI) += pci.o
 # Serial port support
 #
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
-obj-$(CONFIG_SERIAL_8250) += serial.o
+loongson-serial-$(CONFIG_SERIAL_8250) := serial.o
+obj-y += $(loongson-serial-m) $(loongson-serial-y)
 obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
 obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 110/168] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (108 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 109/168] MIPS: Loongson: Make platform serial setup always built-in Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 111/168] net/ping: handle protocol mismatching scenario Luis Henriques
                   ` (57 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ville Syrjälä, Jani Nikula, Luis Henriques

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

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

From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>

commit bdfa7542d40e6251c232a802231b37116bd31b11 upstream.

During a GPU reset we need to get pending page flip cleared out
since the ring contents are gone and flip will never complete
on its own. This used to work until the mmio vs. CS flip race
detection came about. That piece of code is looking for a
specific surface address in the SURFLIVE register, but as
a flip to that address may never happen the check may never
pass. So we should just skip the SURFLIVE and flip counter
checks when the GPU gets reset.

intel_display_handle_reset() tries to effectively complete
the flip anyway by calling .update_primary_plane(). But that
may not satisfy the conditions of the mmio vs. CS race
detection since there's no guarantee that a modeset didn't
sneak in between the GPU reset and intel_display_handle_reset().
Such a modeset will not wait for pending flips due to the ongoing GPU
reset, and then the primary plane updates performed by
intel_display_handle_reset() will already use the new surface
address, and thus the surface address the flip is waiting for
might never appear in SURFLIVE. The result is that the flip
will never complete and attempts to perform further page flips
will fail with -EBUSY.

During the GPU reset intel_crtc_has_pending_flip() will return
false regardless, so the deadlock with a modeset vs. the error
work acquiring crtc->mutex was avoided. And the reset_counter
check in intel_crtc_has_pending_flip() actually made this bug
even less severe since it allowed normal modesets to go through
even though there's a pending flip.

This is a regression introduced by me here:
 commit 75f7f3ec600524c9544cc31695155f1a9ddbe1d9
 Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
 Date:   Tue Apr 15 21:41:34 2014 +0300

    drm/i915: Fix mmio vs. CS flip race on ILK+

Testcase: igt/kms_flip/flip-vs-panning-vs-hang
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/intel_display.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 373d652d01fa..6b835b86fbfd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8925,6 +8925,10 @@ static bool page_flip_finished(struct intel_crtc *crtc)
 	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (i915_reset_in_progress(&dev_priv->gpu_error) ||
+	    crtc->reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
+		return true;
+
 	/*
 	 * The relevant registers doen't exist on pre-ctg.
 	 * As the flip done interrupt doesn't trigger for mmio
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 111/168] net/ping: handle protocol mismatching scenario
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (109 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 110/168] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 112/168] usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000 Luis Henriques
                   ` (56 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev, Jane Zhou,
	Yiwei Zhao, Luis Henriques

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

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

From: Jane Zhou <a17711@motorola.com>

commit 91a0b603469069cdcce4d572b7525ffc9fd352a6 upstream.

ping_lookup() may return a wrong sock if sk_buff's and sock's protocols
dont' match. For example, sk_buff's protocol is ETH_P_IPV6, but sock's
sk_family is AF_INET, in that case, if sk->sk_bound_dev_if is zero, a wrong
sock will be returned.
the fix is to "continue" the searching, if no matching, return NULL.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Jane Zhou <a17711@motorola.com>
Signed-off-by: Yiwei Zhao <gbjc64@motorola.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ping.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 044a0ddf6a79..620e8ffa62e8 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -217,6 +217,8 @@ static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident)
 					     &ipv6_hdr(skb)->daddr))
 				continue;
 #endif
+		} else {
+			continue;
 		}
 
 		if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 112/168] usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (110 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 111/168] net/ping: handle protocol mismatching scenario Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 113/168] Input: xpad - use proper endpoint type Luis Henriques
                   ` (55 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Greg Kroah-Hartman, Luis Henriques

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

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

From: Hans de Goede <hdegoede@redhat.com>

commit 263e80b43559a6103e178a9176938ce171b23872 upstream.

This wireless mouse receiver needs a reset-resume quirk to properly come
out of reset.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1165206
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/core/quirks.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index c85459338991..b195fdb1effc 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -44,6 +44,9 @@ static const struct usb_device_id usb_quirk_list[] = {
 	/* Creative SB Audigy 2 NX */
 	{ USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* Microsoft Wireless Laser Mouse 6000 Receiver */
+	{ USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	/* Microsoft LifeCam-VX700 v2.0 */
 	{ USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 113/168] Input: xpad - use proper endpoint type
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (111 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 112/168] usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000 Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 114/168] powerpc/pseries: Fix endiannes issue in RTAS call from xmon Luis Henriques
                   ` (54 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Pierre-Loup A. Griffais, Greg Kroah-Hartman, Dmitry Torokhov,
	Luis Henriques

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

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

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a1f9a4072655843fc03186acbad65990cc05dd2d upstream.

The xpad wireless endpoint is not a bulk endpoint on my devices, but
rather an interrupt one, so the USB core complains when it is submitted.
I'm guessing that the author really did mean that this should be an
interrupt urb, but as there are a zillion different xpad devices out
there, let's cover out bases and handle both bulk and interrupt
endpoints just as easily.

Signed-off-by: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/joystick/xpad.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index e383eebbafdd..18558f73b4a3 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1038,9 +1038,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
 		}
 
 		ep_irq_in = &intf->cur_altsetting->endpoint[1].desc;
-		usb_fill_bulk_urb(xpad->bulk_out, udev,
-				usb_sndbulkpipe(udev, ep_irq_in->bEndpointAddress),
-				xpad->bdata, XPAD_PKT_LEN, xpad_bulk_out, xpad);
+		if (usb_endpoint_is_bulk_out(ep_irq_in)) {
+			usb_fill_bulk_urb(xpad->bulk_out, udev,
+					  usb_sndbulkpipe(udev,
+							  ep_irq_in->bEndpointAddress),
+					  xpad->bdata, XPAD_PKT_LEN,
+					  xpad_bulk_out, xpad);
+		} else {
+			usb_fill_int_urb(xpad->bulk_out, udev,
+					 usb_sndintpipe(udev,
+							ep_irq_in->bEndpointAddress),
+					 xpad->bdata, XPAD_PKT_LEN,
+					 xpad_bulk_out, xpad, 0);
+		}
 
 		/*
 		 * Submit the int URB immediately rather than waiting for open
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 114/168] powerpc/pseries: Fix endiannes issue in RTAS call from xmon
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (112 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 113/168] Input: xpad - use proper endpoint type Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 115/168] powerpc/powernv: Replace OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE Luis Henriques
                   ` (53 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Laurent Dufour, Michael Ellerman, Luis Henriques

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

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

From: Laurent Dufour <ldufour@linux.vnet.ibm.com>

commit 3b8a3c01096925a824ed3272601082289d9c23a5 upstream.

On pseries system (LPAR) xmon failed to enter when running in LE mode,
system is hunging. Inititating xmon will lead to such an output on the
console:

SysRq : Entering xmon
cpu 0x15: Vector: 0  at [c0000003f39ffb10]
    pc: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
    lr: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
    sp: c0000003f39ffc70
   msr: 8000000000009033
  current = 0xc0000003fafa7180
  paca    = 0xc000000007d75e80	 softe: 0	 irq_happened: 0x01
    pid   = 14617, comm = bash
Bad kernel stack pointer fafb4b0 at eca7cc4
cpu 0x15: Vector: 300 (Data Access) at [c000000007f07d40]
    pc: 000000000eca7cc4
    lr: 000000000eca7c44
    sp: fafb4b0
   msr: 8000000000001000
   dar: 10000000
 dsisr: 42000000
  current = 0xc0000003fafa7180
  paca    = 0xc000000007d75e80	 softe: 0	 irq_happened: 0x01
    pid   = 14617, comm = bash
cpu 0x15: Exception 300 (Data Access) in xmon, returning to main loop
xmon: WARNING: bad recursive fault on cpu 0x15

The root cause is that xmon is calling RTAS to turn off the surveillance
when entering xmon, and RTAS is requiring big endian parameters.

This patch is byte swapping the RTAS arguments when running in LE mode.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/xmon/xmon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index d199bfa2f1fa..c6c497b40c45 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -292,10 +292,10 @@ static inline void disable_surveillance(void)
 	args.token = rtas_token("set-indicator");
 	if (args.token == RTAS_UNKNOWN_SERVICE)
 		return;
-	args.nargs = 3;
-	args.nret = 1;
+	args.nargs = cpu_to_be32(3);
+	args.nret = cpu_to_be32(1);
 	args.rets = &args.args[3];
-	args.args[0] = SURVEILLANCE_TOKEN;
+	args.args[0] = cpu_to_be32(SURVEILLANCE_TOKEN);
 	args.args[1] = 0;
 	args.args[2] = 0;
 	enter_rtas(__pa(&args));
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 115/168] powerpc/powernv: Replace OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (113 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 114/168] powerpc/pseries: Fix endiannes issue in RTAS call from xmon Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 116/168] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions Luis Henriques
                   ` (52 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Gavin Shan, Michael Ellerman, Luis Henriques

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

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

From: Gavin Shan <gwshan@linux.vnet.ibm.com>

commit 360d88a9e3fba596a12520b242fbab1c45b983e1 upstream.

The flag passed to ioda_eeh_phb_reset() should be EEH_RESET_DEACTIVATE,
which is translated to OPAL_DEASSERT_RESET or something else by the
EEH backend accordingly.

The patch replaces OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE for
ioda_eeh_phb_reset().

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index dc30aa5a2ce8..c339a2fbdf0b 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1403,7 +1403,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
 	if (is_kdump_kernel()) {
 		pr_info("  Issue PHB reset ...\n");
 		ioda_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
-		ioda_eeh_phb_reset(hose, OPAL_DEASSERT_RESET);
+		ioda_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
 	}
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 116/168] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (114 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 115/168] powerpc/powernv: Replace OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 117/168] drm/radeon: report disconnected for LVDS/eDP with PX if ddc fails Luis Henriques
                   ` (51 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anton Blanchard, Michael Ellerman, Luis Henriques

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

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

From: Anton Blanchard <anton@samba.org>

commit 152d44a853e42952f6c8a504fb1f8eefd21fd5fd upstream.

I used some 64 bit instructions when adding the 32 bit getcpu VDSO
function. Fix it.

Fixes: 18ad51dd342a ("powerpc: Add VDSO version of getcpu")
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/kernel/vdso32/getcpu.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/vdso32/getcpu.S b/arch/powerpc/kernel/vdso32/getcpu.S
index 23eb9a9441bd..c62be60c7274 100644
--- a/arch/powerpc/kernel/vdso32/getcpu.S
+++ b/arch/powerpc/kernel/vdso32/getcpu.S
@@ -30,8 +30,8 @@
 V_FUNCTION_BEGIN(__kernel_getcpu)
   .cfi_startproc
 	mfspr	r5,SPRN_SPRG_VDSO_READ
-	cmpdi	cr0,r3,0
-	cmpdi	cr1,r4,0
+	cmpwi	cr0,r3,0
+	cmpwi	cr1,r4,0
 	clrlwi  r6,r5,16
 	rlwinm  r7,r5,16,31-15,31-0
 	beq	cr0,1f
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 117/168] drm/radeon: report disconnected for LVDS/eDP with PX if ddc fails
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (115 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 116/168] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 118/168] ARM: 8222/1: mvebu: enable strex backoff delay Luis Henriques
                   ` (50 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 1348579433566355e570008929daa09a0db64fd8 upstream.

If ddc fails, presumably the i2c mux (and hopefully the signal
mux) are switched to the other GPU so don't fetch the edid from
the vbios so that the connector reports disconnected.

bug:
https://bugzilla.opensuse.org/show_bug.cgi?id=904417

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ luis: backported to 3.16:
  - dropped changes to radeon_connector_get_edid() ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 44831197e82e..eb76aa72466c 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -695,6 +695,8 @@ static int radeon_lvds_mode_valid(struct drm_connector *connector,
 static enum drm_connector_status
 radeon_lvds_detect(struct drm_connector *connector, bool force)
 {
+	struct drm_device *dev = connector->dev;
+	struct radeon_device *rdev = dev->dev_private;
 	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
 	struct drm_encoder *encoder = radeon_best_single_encoder(connector);
 	enum drm_connector_status ret = connector_status_disconnected;
@@ -711,7 +713,11 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
 		/* check if panel is valid */
 		if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240)
 			ret = connector_status_connected;
-
+		/* don't fetch the edid from the vbios if ddc fails and runpm is
+		 * enabled so we report disconnected.
+		 */
+		if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0))
+			ret = connector_status_disconnected;
 	}
 
 	/* check for edid as well */
@@ -1492,6 +1498,11 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
 			/* check if panel is valid */
 			if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240)
 				ret = connector_status_connected;
+			/* don't fetch the edid from the vbios if ddc fails and runpm is
+			 * enabled so we report disconnected.
+			 */
+			if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0))
+				ret = connector_status_disconnected;
 		}
 		/* eDP is always DP */
 		radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 118/168] ARM: 8222/1: mvebu: enable strex backoff delay
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (116 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 117/168] drm/radeon: report disconnected for LVDS/eDP with PX if ddc fails Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 119/168] ARM: 8226/1: cacheflush: get rid of restarting block Luis Henriques
                   ` (49 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nadav Haklai, Thomas Petazzoni, Russell King, Luis Henriques

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

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

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

commit 995ab5189d1d7264e79e665dfa032a19b3ac646e upstream.

Under extremely rare conditions, in an MPCore node consisting of at
least 3 CPUs, two CPUs trying to perform a STREX to data on the same
shared cache line can enter a livelock situation.

This patch enables the HW mechanism that overcomes the bug. This fixes
the incorrect setup of the STREX backoff delay bit due to a wrong
description in the specification.

Note that enabling the STREX backoff delay mechanism is done by
leaving the bit *cleared*, while the bit was currently being set by
the proc-v7.S code.

[Thomas: adapt to latest mainline, slightly reword the commit log, add
stable markers.]

Fixes: de4901933f6d ("arm: mm: Add support for PJ4B cpu and init routines")

Signed-off-by: Nadav Haklai <nadavh@marvell.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mm/proc-v7.S | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 3db2c2f04a30..0eba0d1fd65a 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -235,7 +235,6 @@ __v7_pj4b_setup:
 /* Auxiliary Debug Modes Control 1 Register */
 #define PJ4B_STATIC_BP (1 << 2) /* Enable Static BP */
 #define PJ4B_INTER_PARITY (1 << 8) /* Disable Internal Parity Handling */
-#define PJ4B_BCK_OFF_STREX (1 << 5) /* Enable the back off of STREX instr */
 #define PJ4B_CLEAN_LINE (1 << 16) /* Disable data transfer for clean line */
 
 /* Auxiliary Debug Modes Control 2 Register */
@@ -258,7 +257,6 @@ __v7_pj4b_setup:
 	/* Auxiliary Debug Modes Control 1 Register */
 	mrc	p15, 1,	r0, c15, c1, 1
 	orr     r0, r0, #PJ4B_CLEAN_LINE
-	orr     r0, r0, #PJ4B_BCK_OFF_STREX
 	orr     r0, r0, #PJ4B_INTER_PARITY
 	bic	r0, r0, #PJ4B_STATIC_BP
 	mcr	p15, 1,	r0, c15, c1, 1
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 119/168] ARM: 8226/1: cacheflush: get rid of restarting block
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (117 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 118/168] ARM: 8222/1: mvebu: enable strex backoff delay Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 120/168] staging: r8188eu: Add new device ID for DLink GO-USB-N150 Luis Henriques
                   ` (48 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vladimir Murzin, Russell King, Luis Henriques

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

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

From: Vladimir Murzin <vladimir.murzin@arm.com>

commit 3f4aa45ceea5789a4aade536acc27f2e0d3da5e1 upstream.

We cannot restart cacheflush safely if a process provides user-defined
signal handler and signal is pending. In this case -EINTR is returned
and it is expected that process re-invokes syscall. However, there are
a few problems with that:
 * looks like nobody bothers checking return value from cacheflush
 * but if it did, we don't provide the restart address for that, so the
   process has to use the same range again
 * ...and again, what might lead to looping forever

So, remove cacheflush restarting code and terminate cache flushing
as early as fatal signal is pending.

Reported-by: Chanho Min <chanho.min@lge.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/include/asm/thread_info.h | 11 -----------
 arch/arm/kernel/traps.c            | 31 ++-----------------------------
 2 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index e4e4208a9130..76155ee5ac3b 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -43,16 +43,6 @@ struct cpu_context_save {
 	__u32	extra[2];		/* Xscale 'acc' register, etc */
 };
 
-struct arm_restart_block {
-	union {
-		/* For user cache flushing */
-		struct {
-			unsigned long start;
-			unsigned long end;
-		} cache;
-	};
-};
-
 /*
  * low level task data that entry.S needs immediate access to.
  * __switch_to() assumes cpu_context follows immediately after cpu_domain.
@@ -78,7 +68,6 @@ struct thread_info {
 	unsigned long		thumbee_state;	/* ThumbEE Handler Base register */
 #endif
 	struct restart_block	restart_block;
-	struct arm_restart_block	arm_restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)						\
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index da11b28a72da..8dffc57a9f71 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -511,8 +511,6 @@ static int bad_syscall(int n, struct pt_regs *regs)
 	return regs->ARM_r0;
 }
 
-static long do_cache_op_restart(struct restart_block *);
-
 static inline int
 __do_cache_op(unsigned long start, unsigned long end)
 {
@@ -521,24 +519,8 @@ __do_cache_op(unsigned long start, unsigned long end)
 	do {
 		unsigned long chunk = min(PAGE_SIZE, end - start);
 
-		if (signal_pending(current)) {
-			struct thread_info *ti = current_thread_info();
-
-			ti->restart_block = (struct restart_block) {
-				.fn	= do_cache_op_restart,
-			};
-
-			ti->arm_restart_block = (struct arm_restart_block) {
-				{
-					.cache = {
-						.start	= start,
-						.end	= end,
-					},
-				},
-			};
-
-			return -ERESTART_RESTARTBLOCK;
-		}
+		if (fatal_signal_pending(current))
+			return 0;
 
 		ret = flush_cache_user_range(start, start + chunk);
 		if (ret)
@@ -551,15 +533,6 @@ __do_cache_op(unsigned long start, unsigned long end)
 	return 0;
 }
 
-static long do_cache_op_restart(struct restart_block *unused)
-{
-	struct arm_restart_block *restart_block;
-
-	restart_block = &current_thread_info()->arm_restart_block;
-	return __do_cache_op(restart_block->cache.start,
-			     restart_block->cache.end);
-}
-
 static inline int
 do_cache_op(unsigned long start, unsigned long end, int flags)
 {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 120/168] staging: r8188eu: Add new device ID for DLink GO-USB-N150
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (118 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 119/168] ARM: 8226/1: cacheflush: get rid of restarting block Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 121/168] btrfs: zero out left over bytes after processing compression streams Luis Henriques
                   ` (47 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, Greg Kroah-Hartman, Luis Henriques

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

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

From: Larry Finger <Larry.Finger@lwfinger.net>

commit 6d4556fc0309608f760f1d329df56d77fdd0c31a upstream.

The DLink GO-USB-N150 with revision B1 uses this driver.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index c4273cd5f7ed..db785c05f01c 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -58,6 +58,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
 	{USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */
 	{USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
 	{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
+	{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
 	{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
 	{}	/* Terminating entry */
 };
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 121/168] btrfs: zero out left over bytes after processing compression streams
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (119 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 120/168] staging: r8188eu: Add new device ID for DLink GO-USB-N150 Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 122/168] uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME Luis Henriques
                   ` (46 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Mason, Linus Torvalds, Luis Henriques

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

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

From: Chris Mason <clm@fb.com>

commit 2f19cad94cee3c9bd52d0c9ca584ef506302fb7c upstream.

Don Bailey noticed that our page zeroing for compression at end-io time
isn't complete.  This reworks a patch from Linus to push the zeroing
into the zlib and lzo specific functions instead of trying to handle the
corners inside btrfs_decompress_buf2page

Signed-off-by: Chris Mason <clm@fb.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Reported-by: Don A. Bailey <donb@securitymouse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/btrfs/compression.c | 33 +++++++++++++++++++++++++++++++--
 fs/btrfs/compression.h |  4 +++-
 fs/btrfs/lzo.c         | 15 +++++++++++++++
 fs/btrfs/zlib.c        | 20 ++++++++++++++++++--
 4 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 1daea0b47187..6db91cdbd92d 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -1010,8 +1010,6 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
 		bytes = min(bytes, working_bytes);
 		kaddr = kmap_atomic(page_out);
 		memcpy(kaddr + *pg_offset, buf + buf_offset, bytes);
-		if (*pg_index == (vcnt - 1) && *pg_offset == 0)
-			memset(kaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
 		kunmap_atomic(kaddr);
 		flush_dcache_page(page_out);
 
@@ -1053,3 +1051,34 @@ int btrfs_decompress_buf2page(char *buf, unsigned long buf_start,
 
 	return 1;
 }
+
+/*
+ * When uncompressing data, we need to make sure and zero any parts of
+ * the biovec that were not filled in by the decompression code.  pg_index
+ * and pg_offset indicate the last page and the last offset of that page
+ * that have been filled in.  This will zero everything remaining in the
+ * biovec.
+ */
+void btrfs_clear_biovec_end(struct bio_vec *bvec, int vcnt,
+				   unsigned long pg_index,
+				   unsigned long pg_offset)
+{
+	while (pg_index < vcnt) {
+		struct page *page = bvec[pg_index].bv_page;
+		unsigned long off = bvec[pg_index].bv_offset;
+		unsigned long len = bvec[pg_index].bv_len;
+
+		if (pg_offset < off)
+			pg_offset = off;
+		if (pg_offset < off + len) {
+			unsigned long bytes = off + len - pg_offset;
+			char *kaddr;
+
+			kaddr = kmap_atomic(page);
+			memset(kaddr + pg_offset, 0, bytes);
+			kunmap_atomic(kaddr);
+		}
+		pg_index++;
+		pg_offset = 0;
+	}
+}
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 0c803b4fbf93..d181f70caae0 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -45,7 +45,9 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
 				  unsigned long nr_pages);
 int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
 				 int mirror_num, unsigned long bio_flags);
-
+void btrfs_clear_biovec_end(struct bio_vec *bvec, int vcnt,
+				   unsigned long pg_index,
+				   unsigned long pg_offset);
 struct btrfs_compress_op {
 	struct list_head *(*alloc_workspace)(void);
 
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index dfad8514f0da..70e84945d2fd 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -374,6 +374,8 @@ cont:
 	}
 done:
 	kunmap(pages_in[page_in_index]);
+	if (!ret)
+		btrfs_clear_biovec_end(bvec, vcnt, page_out_index, pg_offset);
 	return ret;
 }
 
@@ -411,10 +413,23 @@ static int lzo_decompress(struct list_head *ws, unsigned char *data_in,
 		goto out;
 	}
 
+	/*
+	 * the caller is already checking against PAGE_SIZE, but lets
+	 * move this check closer to the memcpy/memset
+	 */
+	destlen = min_t(unsigned long, destlen, PAGE_SIZE);
 	bytes = min_t(unsigned long, destlen, out_len - start_byte);
 
 	kaddr = kmap_atomic(dest_page);
 	memcpy(kaddr, workspace->buf + start_byte, bytes);
+
+	/*
+	 * btrfs_getblock is doing a zero on the tail of the page too,
+	 * but this will cover anything missing from the decompressed
+	 * data.
+	 */
+	if (bytes < destlen)
+		memset(kaddr+bytes, 0, destlen-bytes);
 	kunmap_atomic(kaddr);
 out:
 	return ret;
diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
index b67d8fc81277..1c9137348f53 100644
--- a/fs/btrfs/zlib.c
+++ b/fs/btrfs/zlib.c
@@ -302,6 +302,8 @@ done:
 	zlib_inflateEnd(&workspace->inf_strm);
 	if (data_in)
 		kunmap(pages_in[page_in_index]);
+	if (!ret)
+		btrfs_clear_biovec_end(bvec, vcnt, page_out_index, pg_offset);
 	return ret;
 }
 
@@ -313,10 +315,14 @@ static int zlib_decompress(struct list_head *ws, unsigned char *data_in,
 	struct workspace *workspace = list_entry(ws, struct workspace, list);
 	int ret = 0;
 	int wbits = MAX_WBITS;
-	unsigned long bytes_left = destlen;
+	unsigned long bytes_left;
 	unsigned long total_out = 0;
+	unsigned long pg_offset = 0;
 	char *kaddr;
 
+	destlen = min_t(unsigned long, destlen, PAGE_SIZE);
+	bytes_left = destlen;
+
 	workspace->inf_strm.next_in = data_in;
 	workspace->inf_strm.avail_in = srclen;
 	workspace->inf_strm.total_in = 0;
@@ -344,7 +350,6 @@ static int zlib_decompress(struct list_head *ws, unsigned char *data_in,
 		unsigned long buf_start;
 		unsigned long buf_offset;
 		unsigned long bytes;
-		unsigned long pg_offset = 0;
 
 		ret = zlib_inflate(&workspace->inf_strm, Z_NO_FLUSH);
 		if (ret != Z_OK && ret != Z_STREAM_END)
@@ -387,6 +392,17 @@ next:
 		ret = 0;
 
 	zlib_inflateEnd(&workspace->inf_strm);
+
+	/*
+	 * this should only happen if zlib returned fewer bytes than we
+	 * expected.  btrfs_get_block is responsible for zeroing from the
+	 * end of the inline extent (destlen) to the end of the page
+	 */
+	if (pg_offset < destlen) {
+		kaddr = kmap_atomic(dest_page);
+		memset(kaddr + pg_offset, 0, destlen - pg_offset);
+		kunmap_atomic(kaddr);
+	}
 	return ret;
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 122/168] uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (120 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 121/168] btrfs: zero out left over bytes after processing compression streams Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 123/168] powerpc/powernv: Honor the generic "no_64bit_msi" flag Luis Henriques
                   ` (45 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andy Lutomirski, Linus Torvalds, Luis Henriques

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

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

From: Andy Lutomirski <luto@amacapital.net>

commit 82975bc6a6df743b9a01810fb32cb65d0ec5d60b upstream.

x86 call do_notify_resume on paranoid returns if TIF_UPROBE is set but
not on non-paranoid returns.  I suspect that this is a mistake and that
the code only works because int3 is paranoid.

Setting _TIF_NOTIFY_RESUME in the uprobe code was probably a workaround
for the x86 bug.  With that bug fixed, we can remove _TIF_NOTIFY_RESUME
from the uprobes code.

Reported-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/include/asm/thread_info.h | 2 +-
 kernel/events/uprobes.c            | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 854053889d4d..547e344a6dc6 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -141,7 +141,7 @@ struct thread_info {
 /* Only used for 64 bit */
 #define _TIF_DO_NOTIFY_MASK						\
 	(_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME |	\
-	 _TIF_USER_RETURN_NOTIFY)
+	 _TIF_USER_RETURN_NOTIFY | _TIF_UPROBE)
 
 /* flags to check in __switch_to() */
 #define _TIF_WORK_CTXSW							\
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 6f3254e8c137..9a4d44f93015 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1639,7 +1639,6 @@ bool uprobe_deny_signal(void)
 		if (__fatal_signal_pending(t) || arch_uprobe_xol_was_trapped(t)) {
 			utask->state = UTASK_SSTEP_TRAPPED;
 			set_tsk_thread_flag(t, TIF_UPROBE);
-			set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
 		}
 	}
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 123/168] powerpc/powernv: Honor the generic "no_64bit_msi" flag
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (121 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 122/168] uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 124/168] net: sun4i-emac: fix memory leak on bad packet Luis Henriques
                   ` (44 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Benjamin Herrenschmidt, Luis Henriques

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

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

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

commit 360743814c4082515581aa23ab1d8e699e1fbe88 upstream.

Instead of the arch specific quirk which we are deprecating
and that drivers don't understand.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 3 +--
 arch/powerpc/platforms/powernv/pci.c      | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index c339a2fbdf0b..34bd00be8018 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -901,7 +901,6 @@ static int pnv_pci_ioda_msi_setup(struct pnv_phb *phb, struct pci_dev *dev,
 				  unsigned int is_64, struct msi_msg *msg)
 {
 	struct pnv_ioda_pe *pe = pnv_ioda_get_pe(dev);
-	struct pci_dn *pdn = pci_get_pdn(dev);
 	struct irq_data *idata;
 	struct irq_chip *ichip;
 	unsigned int xive_num = hwirq - phb->msi_base;
@@ -917,7 +916,7 @@ static int pnv_pci_ioda_msi_setup(struct pnv_phb *phb, struct pci_dev *dev,
 		return -ENXIO;
 
 	/* Force 32-bit MSI on some broken devices */
-	if (pdn && pdn->force_32bit_msi)
+	if (dev->no_64bit_msi)
 		is_64 = 0;
 
 	/* Assign XIVE to PE */
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index f91a4e5d872e..8326838ab6f6 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -50,9 +50,8 @@ static int pnv_msi_check_device(struct pci_dev* pdev, int nvec, int type)
 {
 	struct pci_controller *hose = pci_bus_to_host(pdev->bus);
 	struct pnv_phb *phb = hose->private_data;
-	struct pci_dn *pdn = pci_get_pdn(pdev);
 
-	if (pdn && pdn->force_32bit_msi && !phb->msi32_support)
+	if (pdev->no_64bit_msi && !phb->msi32_support)
 		return -ENODEV;
 
 	return (phb && phb->msi_bmp.bitmap) ? 0 : -ENODEV;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 124/168] net: sun4i-emac: fix memory leak on bad packet
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (122 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 123/168] powerpc/powernv: Honor the generic "no_64bit_msi" flag Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 125/168] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Luis Henriques
                   ` (43 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Stefan Roese, Maxime Ripard, Marc Zyngier, David S. Miller,
	Luis Henriques

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

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

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

commit 2670cc699a66c4cf268cb3e3f6dfc325ec14f224 upstream.

Upon reception of a new frame, the emac driver checks for a number
of error conditions, and flag the packet as "bad" if any of these
are present. It then allocates a skb unconditionally, but only uses
it if the packet is "good". On the error path, the skb is just forgotten,
and the system leaks memory.

The piece of junk I have on my desk seems to encounter such error
frequently enough so that the box goes OOM after a couple of days,
which makes me grumpy.

Fix this by moving the allocation on the "good_packet" path (and
convert it to netdev_alloc_skb while we're at it).

Tested on a random Allwinner A20 board.

Cc: Stefan Roese <sr@denx.de>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/allwinner/sun4i-emac.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index d81e7167a8b5..29b9f082475d 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -633,8 +633,10 @@ static void emac_rx(struct net_device *dev)
 		}
 
 		/* Move data from EMAC */
-		skb = dev_alloc_skb(rxlen + 4);
-		if (good_packet && skb) {
+		if (good_packet) {
+			skb = netdev_alloc_skb(dev, rxlen + 4);
+			if (!skb)
+				continue;
 			skb_reserve(skb, 2);
 			rdptr = (u8 *) skb_put(skb, rxlen - 4);
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 125/168] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (123 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 124/168] net: sun4i-emac: fix memory leak on bad packet Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 126/168] x86_64, traps: Rework bad_iret Luis Henriques
                   ` (42 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andy Lutomirski, Linus Torvalds, Luis Henriques

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

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

From: Andy Lutomirski <luto@amacapital.net>

commit af726f21ed8af2cdaa4e93098dc211521218ae65 upstream.

There's nothing special enough about the espfix64 double fault fixup to
justify writing it in assembly.  Move it to C.

This also fixes a bug: if the double fault came from an IST stack, the
old asm code would return to a partially uninitialized stack frame.

Fixes: 3891a04aafd668686239349ea58f3314ea2af86b
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/entry_64.S | 34 ++--------------------------------
 arch/x86/kernel/traps.c    | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 32 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 1b1d9ab375a5..41712e1d129a 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -842,6 +842,7 @@ ENTRY(native_iret)
 	jnz native_irq_return_ldt
 #endif
 
+.global native_irq_return_iret
 native_irq_return_iret:
 	iretq
 	_ASM_EXTABLE(native_irq_return_iret, bad_iret)
@@ -936,37 +937,6 @@ ENTRY(retint_kernel)
 	CFI_ENDPROC
 END(common_interrupt)
 
-	/*
-	 * If IRET takes a fault on the espfix stack, then we
-	 * end up promoting it to a doublefault.  In that case,
-	 * modify the stack to make it look like we just entered
-	 * the #GP handler from user space, similar to bad_iret.
-	 */
-#ifdef CONFIG_X86_ESPFIX64
-	ALIGN
-__do_double_fault:
-	XCPT_FRAME 1 RDI+8
-	movq RSP(%rdi),%rax		/* Trap on the espfix stack? */
-	sarq $PGDIR_SHIFT,%rax
-	cmpl $ESPFIX_PGD_ENTRY,%eax
-	jne do_double_fault		/* No, just deliver the fault */
-	cmpl $__KERNEL_CS,CS(%rdi)
-	jne do_double_fault
-	movq RIP(%rdi),%rax
-	cmpq $native_irq_return_iret,%rax
-	jne do_double_fault		/* This shouldn't happen... */
-	movq PER_CPU_VAR(kernel_stack),%rax
-	subq $(6*8-KERNEL_STACK_OFFSET),%rax	/* Reset to original stack */
-	movq %rax,RSP(%rdi)
-	movq $0,(%rax)			/* Missing (lost) #GP error code */
-	movq $general_protection,RIP(%rdi)
-	retq
-	CFI_ENDPROC
-END(__do_double_fault)
-#else
-# define __do_double_fault do_double_fault
-#endif
-
 /*
  * APIC interrupts.
  */
@@ -1138,7 +1108,7 @@ idtentry overflow do_overflow has_error_code=0
 idtentry bounds do_bounds has_error_code=0
 idtentry invalid_op do_invalid_op has_error_code=0
 idtentry device_not_available do_device_not_available has_error_code=0
-idtentry double_fault __do_double_fault has_error_code=1 paranoid=1
+idtentry double_fault do_double_fault has_error_code=1 paranoid=1
 idtentry coprocessor_segment_overrun do_coprocessor_segment_overrun has_error_code=0
 idtentry invalid_TSS do_invalid_TSS has_error_code=1
 idtentry segment_not_present do_segment_not_present has_error_code=1
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 0eafe9ea2494..48035e9cdde9 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -243,6 +243,30 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
 	static const char str[] = "double fault";
 	struct task_struct *tsk = current;
 
+#ifdef CONFIG_X86_ESPFIX64
+	extern unsigned char native_irq_return_iret[];
+
+	/*
+	 * If IRET takes a non-IST fault on the espfix64 stack, then we
+	 * end up promoting it to a doublefault.  In that case, modify
+	 * the stack to make it look like we just entered the #GP
+	 * handler from user space, similar to bad_iret.
+	 */
+	if (((long)regs->sp >> PGDIR_SHIFT) == ESPFIX_PGD_ENTRY &&
+		regs->cs == __KERNEL_CS &&
+		regs->ip == (unsigned long)native_irq_return_iret)
+	{
+		struct pt_regs *normal_regs = task_pt_regs(current);
+
+		/* Fake a #GP(0) from userspace. */
+		memmove(&normal_regs->ip, (void *)regs->sp, 5*8);
+		normal_regs->orig_ax = 0;  /* Missing (lost) #GP error code */
+		regs->ip = (unsigned long)general_protection;
+		regs->sp = (unsigned long)&normal_regs->orig_ax;
+		return;
+	}
+#endif
+
 	exception_enter();
 	/* Return not checked because double check cannot be ignored */
 	notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 126/168] x86_64, traps: Rework bad_iret
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (124 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 125/168] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 127/168] drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets Luis Henriques
                   ` (41 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andy Lutomirski, Linus Torvalds, Luis Henriques

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

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

From: Andy Lutomirski <luto@amacapital.net>

commit b645af2d5905c4e32399005b867987919cbfc3ae upstream.

It's possible for iretq to userspace to fail.  This can happen because
of a bad CS, SS, or RIP.

Historically, we've handled it by fixing up an exception from iretq to
land at bad_iret, which pretends that the failed iret frame was really
the hardware part of #GP(0) from userspace.  To make this work, there's
an extra fixup to fudge the gs base into a usable state.

This is suboptimal because it loses the original exception.  It's also
buggy because there's no guarantee that we were on the kernel stack to
begin with.  For example, if the failing iret happened on return from an
NMI, then we'll end up executing general_protection on the NMI stack.
This is bad for several reasons, the most immediate of which is that
general_protection, as a non-paranoid idtentry, will try to deliver
signals and/or schedule from the wrong stack.

This patch throws out bad_iret entirely.  As a replacement, it augments
the existing swapgs fudge into a full-blown iret fixup, mostly written
in C.  It's should be clearer and more correct.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/entry_64.S | 45 +++++++++++++++++++--------------------------
 arch/x86/kernel/traps.c    | 29 +++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 41712e1d129a..902a14d02882 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -844,8 +844,13 @@ ENTRY(native_iret)
 
 .global native_irq_return_iret
 native_irq_return_iret:
+	/*
+	 * This may fault.  Non-paranoid faults on return to userspace are
+	 * handled by fixup_bad_iret.  These include #SS, #GP, and #NP.
+	 * Double-faults due to espfix64 are handled in do_double_fault.
+	 * Other faults here are fatal.
+	 */
 	iretq
-	_ASM_EXTABLE(native_irq_return_iret, bad_iret)
 
 #ifdef CONFIG_X86_ESPFIX64
 native_irq_return_ldt:
@@ -873,25 +878,6 @@ native_irq_return_ldt:
 	jmp native_irq_return_iret
 #endif
 
-	.section .fixup,"ax"
-bad_iret:
-	/*
-	 * The iret traps when the %cs or %ss being restored is bogus.
-	 * We've lost the original trap vector and error code.
-	 * #GPF is the most likely one to get for an invalid selector.
-	 * So pretend we completed the iret and took the #GPF in user mode.
-	 *
-	 * We are now running with the kernel GS after exception recovery.
-	 * But error_entry expects us to have user GS to match the user %cs,
-	 * so swap back.
-	 */
-	pushq $0
-
-	SWAPGS
-	jmp general_protection
-
-	.previous
-
 	/* edi: workmask, edx: work */
 retint_careful:
 	CFI_RESTORE_STATE
@@ -1383,16 +1369,15 @@ error_sti:
 
 /*
  * There are two places in the kernel that can potentially fault with
- * usergs. Handle them here. The exception handlers after iret run with
- * kernel gs again, so don't set the user space flag. B stepping K8s
- * sometimes report an truncated RIP for IRET exceptions returning to
- * compat mode. Check for these here too.
+ * usergs. Handle them here.  B stepping K8s sometimes report a
+ * truncated RIP for IRET exceptions returning to compat mode. Check
+ * for these here too.
  */
 error_kernelspace:
 	incl %ebx
 	leaq native_irq_return_iret(%rip),%rcx
 	cmpq %rcx,RIP+8(%rsp)
-	je error_swapgs
+	je error_bad_iret
 	movl %ecx,%eax	/* zero extend */
 	cmpq %rax,RIP+8(%rsp)
 	je bstep_iret
@@ -1403,7 +1388,15 @@ error_kernelspace:
 bstep_iret:
 	/* Fix truncated RIP */
 	movq %rcx,RIP+8(%rsp)
-	jmp error_swapgs
+	/* fall through */
+
+error_bad_iret:
+	SWAPGS
+	mov %rsp,%rdi
+	call fixup_bad_iret
+	mov %rax,%rsp
+	decl %ebx	/* Return to usergs */
+	jmp error_sti
 	CFI_ENDPROC
 END(error_entry)
 
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 48035e9cdde9..de801f22128a 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -407,6 +407,35 @@ asmlinkage __visible struct pt_regs *sync_regs(struct pt_regs *eregs)
 	return regs;
 }
 NOKPROBE_SYMBOL(sync_regs);
+
+struct bad_iret_stack {
+	void *error_entry_ret;
+	struct pt_regs regs;
+};
+
+asmlinkage __visible
+struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
+{
+	/*
+	 * This is called from entry_64.S early in handling a fault
+	 * caused by a bad iret to user mode.  To handle the fault
+	 * correctly, we want move our stack frame to task_pt_regs
+	 * and we want to pretend that the exception came from the
+	 * iret target.
+	 */
+	struct bad_iret_stack *new_stack =
+		container_of(task_pt_regs(current),
+			     struct bad_iret_stack, regs);
+
+	/* Copy the IRET target to the new stack. */
+	memmove(&new_stack->regs.ip, (void *)s->regs.sp, 5*8);
+
+	/* Copy the remainder of the stack from the current stack. */
+	memmove(new_stack, s, offsetof(struct bad_iret_stack, regs.ip));
+
+	BUG_ON(!user_mode_vm(&new_stack->regs));
+	return new_stack;
+}
 #endif
 
 /*
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 127/168] drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (125 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 126/168] x86_64, traps: Rework bad_iret Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 128/168] [media] smiapp: Only some selection targets are settable Luis Henriques
                   ` (40 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ben Hutchings, David S. Miller, Luis Henriques

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

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

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

commit 5188cd44c55db3e92cd9e77a40b5baa7ed4340f7 upstream.

UFO is now disabled on all drivers that work with virtio net headers,
but userland may try to send UFO/IPv6 packets anyway.  Instead of
sending with ID=0, we should select identifiers on their behalf (as we
used to).

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: 916e4cf46d02 ("ipv6: reuse ip6_frag_id from ip6_ufo_append_data")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/macvtap.c  |  3 +++
 drivers/net/tun.c      |  6 +++++-
 include/net/ipv6.h     |  2 ++
 net/ipv6/output_core.c | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index ff1acf99c10b..07c942b6ae01 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -16,6 +16,7 @@
 #include <linux/idr.h>
 #include <linux/fs.h>
 
+#include <net/ipv6.h>
 #include <net/net_namespace.h>
 #include <net/rtnetlink.h>
 #include <net/sock.h>
@@ -570,6 +571,8 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb,
 			break;
 		case VIRTIO_NET_HDR_GSO_UDP:
 			gso_type = SKB_GSO_UDP;
+			if (skb->protocol == htons(ETH_P_IPV6))
+				ipv6_proxy_select_ident(skb);
 			break;
 		default:
 			return -EINVAL;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 6c48ae7b1faa..ee7538dc9c21 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -65,6 +65,7 @@
 #include <linux/nsproxy.h>
 #include <linux/virtio_net.h>
 #include <linux/rcupdate.h>
+#include <net/ipv6.h>
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>
 #include <net/rtnetlink.h>
@@ -1139,6 +1140,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 		break;
 	}
 
+	skb_reset_network_header(skb);
+
 	if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) {
 		pr_debug("GSO!\n");
 		switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
@@ -1150,6 +1153,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 			break;
 		case VIRTIO_NET_HDR_GSO_UDP:
 			skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
+			if (skb->protocol == htons(ETH_P_IPV6))
+				ipv6_proxy_select_ident(skb);
 			break;
 		default:
 			tun->dev->stats.rx_frame_errors++;
@@ -1179,7 +1184,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 		skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG;
 	}
 
-	skb_reset_network_header(skb);
 	skb_probe_transport_header(skb, 0);
 
 	rxhash = skb_get_hash(skb);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 574337fe72dd..9b442a8d68ba 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -668,6 +668,8 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
 	return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
 }
 
+void ipv6_proxy_select_ident(struct sk_buff *skb);
+
 int ip6_dst_hoplimit(struct dst_entry *dst);
 
 static inline int ip6_sk_dst_hoplimit(struct ipv6_pinfo *np, struct flowi6 *fl6,
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 5ec867e4a8b7..1d4156ddf355 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -3,11 +3,45 @@
  * not configured or static.  These functions are needed by GSO/GRO implementation.
  */
 #include <linux/export.h>
+#include <net/ip.h>
 #include <net/ipv6.h>
 #include <net/ip6_fib.h>
 #include <net/addrconf.h>
 #include <net/secure_seq.h>
 
+/* This function exists only for tap drivers that must support broken
+ * clients requesting UFO without specifying an IPv6 fragment ID.
+ *
+ * This is similar to ipv6_select_ident() but we use an independent hash
+ * seed to limit information leakage.
+ *
+ * The network header must be set before calling this.
+ */
+void ipv6_proxy_select_ident(struct sk_buff *skb)
+{
+	static u32 ip6_proxy_idents_hashrnd __read_mostly;
+	struct in6_addr buf[2];
+	struct in6_addr *addrs;
+	u32 hash, id;
+
+	addrs = skb_header_pointer(skb,
+				   skb_network_offset(skb) +
+				   offsetof(struct ipv6hdr, saddr),
+				   sizeof(buf), buf);
+	if (!addrs)
+		return;
+
+	net_get_random_once(&ip6_proxy_idents_hashrnd,
+			    sizeof(ip6_proxy_idents_hashrnd));
+
+	hash = __ipv6_addr_jhash(&addrs[1], ip6_proxy_idents_hashrnd);
+	hash = __ipv6_addr_jhash(&addrs[0], hash);
+
+	id = ip_idents_reserve(hash, 1);
+	skb_shinfo(skb)->ip6_frag_id = htonl(id);
+}
+EXPORT_SYMBOL_GPL(ipv6_proxy_select_ident);
+
 int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
 {
 	u16 offset = sizeof(struct ipv6hdr);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 128/168] [media] smiapp: Only some selection targets are settable
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (126 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 127/168] drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 129/168] i2c: omap: fix NACK and Arbitration Lost irq handling Luis Henriques
                   ` (39 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sakari Ailus, Mauro Carvalho Chehab, Luis Henriques

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

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

From: Sakari Ailus <sakari.ailus@iki.fi>

commit b31eb901c4e5eeef4c83c43dfbc7fe0d4348cb21 upstream.

Setting a non-settable selection target caused BUG() to be called. The check
for valid selections only takes the selection target into account, but does
not tell whether it may be set, or only get. Fix the issue by simply
returning an error to the user.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/media/i2c/smiapp/smiapp-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 06fb03291d59..698219a9e538 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2138,7 +2138,7 @@ static int smiapp_set_selection(struct v4l2_subdev *subdev,
 		ret = smiapp_set_compose(subdev, fh, sel);
 		break;
 	default:
-		BUG();
+		ret = -EINVAL;
 	}
 
 	mutex_unlock(&sensor->mutex);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 129/168] i2c: omap: fix NACK and Arbitration Lost irq handling
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (127 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 128/168] [media] smiapp: Only some selection targets are settable Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 130/168] [media] s2255drv: fix payload size for JPG, MJPEG Luis Henriques
                   ` (38 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexander Kochetkov, Wolfram Sang, Luis Henriques

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

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

From: Alexander Kochetkov <al.kochet@gmail.com>

commit 27caca9d2e01c92b26d0690f065aad093fea01c7 upstream.

commit 1d7afc95946487945cc7f5019b41255b72224b70 (i2c: omap: ack IRQ in parts)
changed the interrupt handler to complete transfers without clearing
XRDY (AL case) and ARDY (NACK case) flags. XRDY or ARDY interrupts will be
fired again. As a result, ISR keep processing transfer after it was already
complete (from the driver code point of view).

A didn't see real impacts of the 1d7afc9, but it is really bad idea to
have ISR running on user data after transfer was complete.

It looks, what 1d7afc9 violate TI specs in what how AL and NACK should be
handled (see Note 1, sprugn4r, Figure 17-31 and Figure 17-32).

According to specs (if I understood correctly), in case of NACK and AL driver
must reset NACK, AL, ARDY, RDR, and RRDY (Master Receive Mode), and
NACK, AL, ARDY, and XDR (Master Transmitter Mode).

All that is done down the code under the if condition:
if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) ...

The patch restore pre 1d7afc9 logic of handling NACK and AL interrupts, so
no interrupts is fired after ISR informs the rest of driver what transfer
complete.

Note: instead of removing break under NACK case, we could just replace 'break'
with 'continue' and allow NACK transfer to finish using ARDY event. I found
that NACK and ARDY bits usually set together. That case confirm TI wiki:
http://processors.wiki.ti.com/index.php/I2C_Tips#Detecting_and_handling_NACK

In order if someone interested in the event traces for NACK and AL cases,
I sent them to mailing list.

Tested on Beagleboard XM C.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Fixes: 1d7afc9 i2c: omap: ack IRQ in parts
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/i2c/busses/i2c-omap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index b182793a4051..4ba4c2c7bc79 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -926,14 +926,12 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
 		if (stat & OMAP_I2C_STAT_NACK) {
 			err |= OMAP_I2C_STAT_NACK;
 			omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK);
-			break;
 		}
 
 		if (stat & OMAP_I2C_STAT_AL) {
 			dev_err(dev->dev, "Arbitration lost\n");
 			err |= OMAP_I2C_STAT_AL;
 			omap_i2c_ack_stat(dev, OMAP_I2C_STAT_AL);
-			break;
 		}
 
 		/*
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 130/168] [media] s2255drv: fix payload size for JPG, MJPEG
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (128 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 129/168] i2c: omap: fix NACK and Arbitration Lost irq handling Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 131/168] x86: Use $(OBJDUMP) instead of plain objdump Luis Henriques
                   ` (37 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dean Anderson, Hans Verkuil, Mauro Carvalho Chehab, Luis Henriques

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

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

From: sensoray-dev <linux-dev@sensoray.com>

commit 1f391217ad8d7cd7b1e48e6e2abf49970cd91d18 upstream.

length is the size of the buffer, not the payload. That's set using
vb2_set_plane_payload().

Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/media/usb/s2255/s2255drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index a44466bc7b86..ea56159e9bb2 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -632,7 +632,7 @@ static void s2255_fillbuff(struct s2255_vc *vc,
 			break;
 		case V4L2_PIX_FMT_JPEG:
 		case V4L2_PIX_FMT_MJPEG:
-			buf->vb.v4l2_buf.length = jpgsize;
+			vb2_set_plane_payload(&buf->vb, 0, jpgsize);
 			memcpy(vbuf, tmpbuf, jpgsize);
 			break;
 		case V4L2_PIX_FMT_YUV422P:
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 131/168] x86: Use $(OBJDUMP) instead of plain objdump
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (129 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 130/168] [media] s2255drv: fix payload size for JPG, MJPEG Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 132/168] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap Luis Henriques
                   ` (36 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Clayton, Junjie Mao, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner, Luis Henriques

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

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

From: Chris Clayton <chris2553@googlemail.com>

commit e2e68ae688b0a3766cd75aedf4ed4e39be402009 upstream.

commit e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
broke the cross compile of x86. It added a objdump invocation, which
invokes the host native objdump and ignores an active cross tool
chain.

Use $(OBJDUMP) instead which takes the CROSS_COMPILE prefix into
account.

[ tglx: Massage changelog and use $(OBJDUMP) ]

Fixes: e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
Signed-off-by: Chris Clayton <chris2553@googlemail.com>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Junjie Mao <eternal.n08@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/54705C8E.1080400@googlemail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/boot/compressed/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 14fe7cba21d1..b5bb49866bcc 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -75,7 +75,7 @@ suffix-$(CONFIG_KERNEL_XZ)	:= xz
 suffix-$(CONFIG_KERNEL_LZO) 	:= lzo
 suffix-$(CONFIG_KERNEL_LZ4) 	:= lz4
 
-RUN_SIZE = $(shell objdump -h vmlinux | \
+RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \
 	     perl $(srctree)/arch/x86/tools/calc_run_size.pl)
 quiet_cmd_mkpiggy = MKPIGGY $@
       cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 132/168] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (130 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 131/168] x86: Use $(OBJDUMP) instead of plain objdump Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 133/168] drm/nouveau/gf116: remove copy1 engine Luis Henriques
                   ` (35 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ian Campbell, Grant Likely, Rob Herring, Luis Henriques

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

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

From: Ian Campbell <ian.campbell@citrix.com>

commit 094cb98179f19b75acf9ff471daabf3948ce98e6 upstream.

memblock_is_region_reserved() returns true in the case of a partial
overlap, meaning that the current code fails to reserve the
non-overlapping portion.

This call was introduced as part of d1552ce449eb "of/fdt: move
memreserve and dtb memory reservations into core" which went into
v3.16.

I observed this causing a Midway system with a buggy fdt (the header
declares itself to be larger than it really is) failing to boot
because the over-inflated size of the fdt was causing it to seem to
run into the swapper_pg_dir region, meaning the DT wasn't reserved.
The symptoms were failing to find an disks or network and failing to
boot.

However given the ambiguity of whether things like the initrd are
covered by /memreserve/ and similar I think it is best to also
register the region rather than just ignoring it.

Since memblock_reserve() handles overlaps just fine lets just warn and
carry on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/of/fdt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index f2da1750a597..5c437ca532b3 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -960,8 +960,6 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					phys_addr_t size, bool nomap)
 {
-	if (memblock_is_region_reserved(base, size))
-		return -EBUSY;
 	if (nomap)
 		return memblock_remove(base, size);
 	return memblock_reserve(base, size);
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 133/168] drm/nouveau/gf116: remove copy1 engine
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (131 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 132/168] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 134/168] nouveau: move the hotplug ignore to correct place Luis Henriques
                   ` (34 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ilia Mirkin, Ben Skeggs, Luis Henriques

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

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

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

commit 226d63a1addea8cbe8fc671978e62dc84927b046 upstream.

Indications are that no GF116's actually have a copy engine there, but
actually have the decompression engine. This engine can be made to do
copies, but that should be done separately.

Unclear why this didn't turn up on all GF116's, but perhaps the
non-mobile ones came with enough VRAM to not trigger ttm migrations in
test scenarios.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85465
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59168
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/nouveau/core/engine/device/nvc0.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
index 01e5e5545de2..d8cec47c75b2 100644
--- a/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
@@ -212,7 +212,6 @@ nvc0_identify(struct nouveau_device *device)
 		device->oclass[NVDEV_ENGINE_BSP    ] = &nvc0_bsp_oclass;
 		device->oclass[NVDEV_ENGINE_PPP    ] = &nvc0_ppp_oclass;
 		device->oclass[NVDEV_ENGINE_COPY0  ] = &nvc0_copy0_oclass;
-		device->oclass[NVDEV_ENGINE_COPY1  ] = &nvc0_copy1_oclass;
 		device->oclass[NVDEV_ENGINE_DISP   ] =  nva3_disp_oclass;
 		device->oclass[NVDEV_ENGINE_PERFMON] = &nvc0_perfmon_oclass;
 		break;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 134/168] nouveau: move the hotplug ignore to correct place.
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (132 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 133/168] drm/nouveau/gf116: remove copy1 engine Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 135/168] ALSA: hda/realtek - Add headset Mic support for new Dell machine Luis Henriques
                   ` (33 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bjorn Helgaas, Dave Airlie, Luis Henriques

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

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

From: Dave Airlie <airlied@redhat.com>

commit 8b62c8c6df08ca567c78afa51aa7bbc554cede06 upstream.

Introduced in b440bde74f, however it was added to
the wrong function in nouveau.

https://bugzilla.kernel.org/show_bug.cgi?id=86011
Cc: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 0f7addae60d7..84a8b9fb20c8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -595,7 +595,6 @@ int nouveau_pmops_suspend(struct device *dev)
 
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
-	pci_ignore_hotplug(pdev);
 	pci_set_power_state(pdev, PCI_D3hot);
 	return 0;
 }
@@ -887,6 +886,7 @@ static int nouveau_pmops_runtime_suspend(struct device *dev)
 	ret = nouveau_do_suspend(drm_dev, true);
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
+	pci_ignore_hotplug(pdev);
 	pci_set_power_state(pdev, PCI_D3cold);
 	drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
 	return ret;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 135/168] ALSA: hda/realtek - Add headset Mic support for new Dell machine
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (133 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 134/168] nouveau: move the hotplug ignore to correct place Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 136/168] drm/i915: More cautious with pch fifo underruns Luis Henriques
                   ` (32 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kailang Yang, Takashi Iwai, Luis Henriques

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

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

From: Kailang Yang <kailang@realtek.com>

commit b734304f15ebe2a1e89fb9422541fbecf50b7cd9 upstream.

Dell has new machines. It supports headset Mic and Headphone Mic.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 60f010959327..e517902cbd66 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4792,6 +4792,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1028, 0x0684, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
+	SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
+	SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 136/168] drm/i915: More cautious with pch fifo underruns
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (134 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 135/168] ALSA: hda/realtek - Add headset Mic support for new Dell machine Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 137/168] drm/i915: Unlock panel even when LVDS is disabled Luis Henriques
                   ` (31 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Vetter, Jani Nikula, Luis Henriques

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

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit b68362278af94e1171f5be9d4e44988601fb0439 upstream.

Apparently PCH fifo underruns are tricky, we have plenty reports that
we see the occasional underrun (especially at boot-up).

So for a change let's see what happens when we don't re-enable pch
fifo underrun reporting when the pipe is disabled. This means that the
kernel can't catch pch fifo underruns when they happen (except when
all pipes are on on the pch). But we'll still catch underruns when
disabling the pipe again. So not a terrible reduction in test
coverage.

Since the DRM_ERROR is new and hence a regression plan B would be to
revert it back to a debug output. Which would be a lot worse than this
hack for underrun test coverage in the wild. See the referenced
discussions for more.

References: http://mid.gmane.org/CA+gsUGRfGe3t4NcjdeA=qXysrhLY3r4CEu7z4bjTwxi1uOfy+g@mail.gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85898
References: https://bugs.freedesktop.org/show_bug.cgi?id=85898
References: https://bugs.freedesktop.org/show_bug.cgi?id=86233
References: https://bugs.freedesktop.org/show_bug.cgi?id=86478
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Tested-by: lu hua <huax.lu@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6b835b86fbfd..abed8ee8e2d7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4183,7 +4183,6 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
 		ironlake_fdi_disable(crtc);
 
 		ironlake_disable_pch_transcoder(dev_priv, pipe);
-		intel_set_pch_fifo_underrun_reporting(dev, pipe, true);
 
 		if (HAS_PCH_CPT(dev)) {
 			/* disable TRANS_DP_CTL */
@@ -4250,7 +4249,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
 
 	if (intel_crtc->config.has_pch_encoder) {
 		lpt_disable_pch_transcoder(dev_priv);
-		intel_set_pch_fifo_underrun_reporting(dev, TRANSCODER_A, true);
 		intel_ddi_fdi_disable(crtc);
 	}
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 137/168] drm/i915: Unlock panel even when LVDS is disabled
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (135 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 136/168] drm/i915: More cautious with pch fifo underruns Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 138/168] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller Luis Henriques
                   ` (30 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexey Orishko, Chris Wilson, Francois Tigeot, Daniel Vetter,
	Jani Nikula, Luis Henriques

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

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

From: Daniel Vetter <daniel.vetter@ffwll.ch>

commit b0616c5306b342ceca07044dbc4f917d95c4f825 upstream.

Otherwise we'll have backtraces in assert_panel_unlocked because the
BIOS locks the register. In the reporter's case this regression was
introduced in

commit c31407a3672aaebb4acddf90944a114fa5c8af7b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 18 21:07:01 2012 +0100

    drm/i915: Add no-lvds quirk for Supermicro X7SPA-H

Reported-by: Alexey Orishko <alexey.orishko@gmail.com>
Cc: Alexey Orishko <alexey.orishko@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Francois Tigeot <ftigeot@wolfpond.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Tested-by: Alexey Orishko <alexey.orishko@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/intel_lvds.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 0fb230949f81..eef36d0076ee 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -893,6 +893,17 @@ void intel_lvds_init(struct drm_device *dev)
 	int pipe;
 	u8 pin;
 
+	/*
+	 * Unlock registers and just leave them unlocked. Do this before
+	 * checking quirk lists to avoid bogus WARNINGs.
+	 */
+	if (HAS_PCH_SPLIT(dev)) {
+		I915_WRITE(PCH_PP_CONTROL,
+			   I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS);
+	} else {
+		I915_WRITE(PP_CONTROL,
+			   I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
+	}
 	if (!intel_lvds_supported(dev))
 		return;
 
@@ -1088,17 +1099,6 @@ out:
 	DRM_DEBUG_KMS("detected %s-link lvds configuration\n",
 		      lvds_encoder->is_dual_link ? "dual" : "single");
 
-	/*
-	 * Unlock registers and just
-	 * leave them unlocked
-	 */
-	if (HAS_PCH_SPLIT(dev)) {
-		I915_WRITE(PCH_PP_CONTROL,
-			   I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS);
-	} else {
-		I915_WRITE(PP_CONTROL,
-			   I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
-	}
 	lvds_connector->lid_notifier.notifier_call = intel_lid_notify;
 	if (acpi_lid_notifier_register(&lvds_connector->lid_notifier)) {
 		DRM_DEBUG_KMS("lid notifier registration failed\n");
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 138/168] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (136 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 137/168] drm/i915: Unlock panel even when LVDS is disabled Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 139/168] sata_fsl: fix error handling of irq_of_parse_and_map Luis Henriques
                   ` (29 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Devin Ryles, Tejun Heo, Luis Henriques

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

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

From: Devin Ryles <devin.ryles@intel.com>

commit 249cd0a187ed4ef1d0af7f74362cc2791ec5581b upstream.

This patch adds DeviceIDs for Sunrise Point-LP.

Signed-off-by: Devin Ryles <devin.ryles@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/ata/ahci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 99c9a2b5f377..5fc11a616a7a 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -321,6 +321,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */
 	{ PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
 	{ PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */
+	{ PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise Point-LP AHCI */
+	{ PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */
+	{ PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */
 	{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */
 	{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */
 	{ PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 139/168] sata_fsl: fix error handling of irq_of_parse_and_map
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (137 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 138/168] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 140/168] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 Luis Henriques
                   ` (28 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dmitry Torokhov, Tejun Heo, Luis Henriques

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

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

From: Dmitry Torokhov <dtor@chromium.org>

commit aad0b624129709c94c2e19e583b6053520353fa8 upstream.

irq_of_parse_and_map() returns 0 on error (the result is unsigned int),
so testing for negative result never works.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/ata/sata_fsl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 616a6d2ac20c..db3c29d6a105 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1489,7 +1489,7 @@ static int sata_fsl_probe(struct platform_device *ofdev)
 	host_priv->csr_base = csr_base;
 
 	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
-	if (irq < 0) {
+	if (!irq) {
 		dev_err(&ofdev->dev, "invalid irq from platform\n");
 		goto error_exit_with_cleanup;
 	}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 140/168] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (138 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 139/168] sata_fsl: fix error handling of irq_of_parse_and_map Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 141/168] mm: frontswap: invalidate expired data on a dup-store failure Luis Henriques
                   ` (27 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Petr Mladek, Alex Deucher, Luis Henriques

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

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

From: Petr Mladek <pmladek@suse.cz>

commit f5475cc43c899e33098d4db44b7c5e710f16589d upstream.

I was unable too boot 3.18.0-rc6 because of the following kernel
panic in drm_calc_vbltimestamp_from_scanoutpos():

    [drm] Initialized drm 1.1.0 20060810
    [drm] radeon kernel modesetting enabled.
    [drm] initializing kernel modesetting (RV100 0x1002:0x515E 0x15D9:0x8080).
    [drm] register mmio base: 0xC8400000
    [drm] register mmio size: 65536
    radeon 0000:0b:01.0: VRAM: 128M 0x00000000D0000000 - 0x00000000D7FFFFFF (16M used)
    radeon 0000:0b:01.0: GTT: 512M 0x00000000B0000000 - 0x00000000CFFFFFFF
    [drm] Detected VRAM RAM=128M, BAR=128M
    [drm] RAM width 16bits DDR
    [TTM] Zone  kernel: Available graphics memory: 3829346 kiB
    [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
    [TTM] Initializing pool allocator
    [TTM] Initializing DMA pool allocator
    [drm] radeon: 16M of VRAM memory ready
    [drm] radeon: 512M of GTT memory ready.
    [drm] GART: num cpu pages 131072, num gpu pages 131072
    [drm] PCI GART of 512M enabled (table at 0x0000000037880000).
    radeon 0000:0b:01.0: WB disabled
    radeon 0000:0b:01.0: fence driver on ring 0 use gpu addr 0x00000000b0000000 and cpu addr 0xffff8800bbbfa000
    [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [drm] Driver supports precise vblank timestamp query.
    [drm] radeon: irq initialized.
    [drm] Loading R100 Microcode
    radeon 0000:0b:01.0: Direct firmware load for radeon/R100_cp.bin failed with error -2
    radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
    [drm:r100_cp_init] *ERROR* Failed to load firmware!
    radeon 0000:0b:01.0: failed initializing CP (-2).
    radeon 0000:0b:01.0: Disabling GPU acceleration
    [drm] radeon: cp finalized
    BUG: unable to handle kernel NULL pointer dereference at 000000000000025c
    IP: [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
    PGD 0
    Oops: 0000 [#1] SMP
    Modules linked in:
    CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc6-4-default #2649
    Hardware name: Supermicro X7DB8/X7DB8, BIOS 6.00 07/26/2006
    task: ffff880234da2010 ti: ffff880234da4000 task.ti: ffff880234da4000
    RIP: 0010:[<ffffffff8150423b>]  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
    RSP: 0000:ffff880234da7918  EFLAGS: 00010086
    RAX: ffffffff81557890 RBX: 0000000000000000 RCX: ffff880234da7a48
    RDX: ffff880234da79f4 RSI: 0000000000000000 RDI: ffff880232e15000
    RBP: ffff880234da79b8 R08: 0000000000000000 R09: 0000000000000000
    R10: 000000000000000a R11: 0000000000000001 R12: ffff880232dda1c0
    R13: ffff880232e1518c R14: 0000000000000292 R15: ffff880232e15000
    FS:  0000000000000000(0000) GS:ffff88023fc40000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 000000000000025c CR3: 0000000002014000 CR4: 00000000000007e0
    Stack:
     ffff880234da79d8 0000000000000286 ffff880232dcbc00 0000000000002480
     ffff880234da7958 0000000000000296 ffff880234da7998 ffffffff8151b51d
     ffff880234da7a48 0000000032dcbeb0 ffff880232dcbc00 ffff880232dcbc58
    Call Trace:
     [<ffffffff8151b51d>] ? drm_vma_offset_remove+0x1d/0x110
     [<ffffffff8152dc98>] radeon_get_vblank_timestamp_kms+0x38/0x60
     [<ffffffff8152076a>] ? ttm_bo_release_list+0xba/0x180
     [<ffffffff81503751>] drm_get_last_vbltimestamp+0x41/0x70
     [<ffffffff81503933>] vblank_disable_and_save+0x73/0x1d0
     [<ffffffff81106b2f>] ? try_to_del_timer_sync+0x4f/0x70
     [<ffffffff81505245>] drm_vblank_cleanup+0x65/0xa0
     [<ffffffff815604fa>] radeon_irq_kms_fini+0x1a/0x70
     [<ffffffff8156c07e>] r100_init+0x26e/0x410
     [<ffffffff8152ae3e>] radeon_device_init+0x7ae/0xb50
     [<ffffffff8152d57f>] radeon_driver_load_kms+0x8f/0x210
     [<ffffffff81506965>] drm_dev_register+0xb5/0x110
     [<ffffffff8150998f>] drm_get_pci_dev+0x8f/0x200
     [<ffffffff815291cd>] radeon_pci_probe+0xad/0xe0
     [<ffffffff8141a365>] local_pci_probe+0x45/0xa0
     [<ffffffff8141b741>] pci_device_probe+0xd1/0x130
     [<ffffffff81633dad>] driver_probe_device+0x12d/0x3e0
     [<ffffffff8163413b>] __driver_attach+0x9b/0xa0
     [<ffffffff816340a0>] ? __device_attach+0x40/0x40
     [<ffffffff81631cd3>] bus_for_each_dev+0x63/0xa0
     [<ffffffff8163378e>] driver_attach+0x1e/0x20
     [<ffffffff81633390>] bus_add_driver+0x180/0x240
     [<ffffffff81634914>] driver_register+0x64/0xf0
     [<ffffffff81419cac>] __pci_register_driver+0x4c/0x50
     [<ffffffff81509bf5>] drm_pci_init+0xf5/0x120
     [<ffffffff821dc871>] ? ttm_init+0x6a/0x6a
     [<ffffffff821dc908>] radeon_init+0x97/0xb5
     [<ffffffff810002fc>] do_one_initcall+0xbc/0x1f0
     [<ffffffff810e3278>] ? __wake_up+0x48/0x60
     [<ffffffff8218e256>] kernel_init_freeable+0x18a/0x215
     [<ffffffff8218d983>] ? initcall_blacklist+0xc0/0xc0
     [<ffffffff818a78f0>] ? rest_init+0x80/0x80
     [<ffffffff818a78fe>] kernel_init+0xe/0xf0
     [<ffffffff818c0c3c>] ret_from_fork+0x7c/0xb0
     [<ffffffff818a78f0>] ? rest_init+0x80/0x80
    Code: 45 ac 0f 88 a8 01 00 00 3b b7 d0 01 00 00 49 89 ff 0f 83 99 01 00 00 48 8b 47 20 48 8b 80 88 00 00 00 48 85 c0 0f 84 cd 01 00 00 <41> 8b b1 5c 02 00 00 41 8b 89 58 02 00 00 89 75 98 41 8b b1 60
    RIP  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
     RSP <ffff880234da7918>
    CR2: 000000000000025c
    ---[ end trace ad2c0aadf48e2032 ]---
    Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009

It has helped me to add a NULL pointer check that was suggested at
http://lists.freedesktop.org/archives/dri-devel/2014-October/070663.html

I am not familiar with the code. But the change looks sane
and we need something fast at this stage of 3.18 development.

Suggested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_kms.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index c1a206dd859d..b3758de7009a 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -791,6 +791,8 @@ int radeon_get_vblank_timestamp_kms(struct drm_device *dev, int crtc,
 
 	/* Get associated drm_crtc: */
 	drmcrtc = &rdev->mode_info.crtcs[crtc]->base;
+	if (!drmcrtc)
+		return -EINVAL;
 
 	/* Helper routine in DRM core does all the work: */
 	return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 141/168] mm: frontswap: invalidate expired data on a dup-store failure
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (139 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 140/168] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 142/168] mm/vmpressure.c: fix race in vmpressure_work_fn() Luis Henriques
                   ` (26 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Weijie Yang, Konrad Rzeszutek Wilk, Seth Jennings, Dan Streetman,
	Minchan Kim, Bob Liu, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Weijie Yang <weijie.yang@samsung.com>

commit fb993fa1a2f669215fa03a09eed7848f2663e336 upstream.

If a frontswap dup-store failed, it should invalidate the expired page
in the backend, or it could trigger some data corruption issue.
Such as:
 1. use zswap as the frontswap backend with writeback feature
 2. store a swap page(version_1) to entry A, success
 3. dup-store a newer page(version_2) to the same entry A, fail
 4. use __swap_writepage() write version_2 page to swapfile, success
 5. zswap do shrink, writeback version_1 page to swapfile
 6. version_2 page is overwrited by version_1, data corrupt.

This patch fixes this issue by invalidating expired data immediately
when meet a dup-store failure.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Seth Jennings <sjennings@variantweb.net>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/frontswap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/frontswap.c b/mm/frontswap.c
index c30eec536f03..f2a3571c6e22 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -244,8 +244,10 @@ int __frontswap_store(struct page *page)
 		  the (older) page from frontswap
 		 */
 		inc_frontswap_failed_stores();
-		if (dup)
+		if (dup) {
 			__frontswap_clear(sis, offset);
+			frontswap_ops->invalidate_page(type, offset);
+		}
 	}
 	if (frontswap_writethrough_enabled)
 		/* report failure so swap also writes to swap device */
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 142/168] mm/vmpressure.c: fix race in vmpressure_work_fn()
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (140 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 141/168] mm: frontswap: invalidate expired data on a dup-store failure Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 143/168] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary Luis Henriques
                   ` (25 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anton Vorontsov, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Andrew Morton <akpm@linux-foundation.org>

commit 91b57191cfd152c02ded0745250167d0263084f8 upstream.

In some android devices, there will be a "divide by zero" exception.
vmpr->scanned could be zero before spin_lock(&vmpr->sr_lock).

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=88051

[akpm@linux-foundation.org: neaten]
Reported-by: ji_ang <ji_ang@163.com>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/vmpressure.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mm/vmpressure.c b/mm/vmpressure.c
index d4042e75f7c7..c5afd573d7da 100644
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -165,6 +165,7 @@ static void vmpressure_work_fn(struct work_struct *work)
 	unsigned long scanned;
 	unsigned long reclaimed;
 
+	spin_lock(&vmpr->sr_lock);
 	/*
 	 * Several contexts might be calling vmpressure(), so it is
 	 * possible that the work was rescheduled again before the old
@@ -173,11 +174,12 @@ static void vmpressure_work_fn(struct work_struct *work)
 	 * here. No need for any locks here since we don't care if
 	 * vmpr->reclaimed is in sync.
 	 */
-	if (!vmpr->scanned)
+	scanned = vmpr->scanned;
+	if (!scanned) {
+		spin_unlock(&vmpr->sr_lock);
 		return;
+	}
 
-	spin_lock(&vmpr->sr_lock);
-	scanned = vmpr->scanned;
 	reclaimed = vmpr->reclaimed;
 	vmpr->scanned = 0;
 	vmpr->reclaimed = 0;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 143/168] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (141 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 142/168] mm/vmpressure.c: fix race in vmpressure_work_fn() Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 144/168] drivers/input/evdev.c: don't kfree() a vmalloc address Luis Henriques
                   ` (24 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Seth Forshee, David S. Miller, Luis Henriques

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

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

From: Seth Forshee <seth.forshee@canonical.com>

commit 8d609725d4357f499e2103e46011308b32f53513 upstream.

These BUGs can be erroneously triggered by frags which refer to
tail pages within a compound page. The data in these pages may
overrun the hardware page while still being contained within the
compound page, but since compound_order() evaluates to 0 for tail
pages the assertion fails. The code already iterates through
subsequent pages correctly in this scenario, so the BUGs are
unnecessary and can be removed.

Fixes: f36c374782e4 ("xen/netfront: handle compound page fragments on transmit")
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/xen-netfront.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 055222bae6e4..7a4cd11e6a07 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -496,9 +496,6 @@ static void xennet_make_frags(struct sk_buff *skb, struct netfront_queue *queue,
 		len = skb_frag_size(frag);
 		offset = frag->page_offset;
 
-		/* Data must not cross a page boundary. */
-		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
-
 		/* Skip unused frames from start of page */
 		page += offset >> PAGE_SHIFT;
 		offset &= ~PAGE_MASK;
@@ -506,8 +503,6 @@ static void xennet_make_frags(struct sk_buff *skb, struct netfront_queue *queue,
 		while (len > 0) {
 			unsigned long bytes;
 
-			BUG_ON(offset >= PAGE_SIZE);
-
 			bytes = PAGE_SIZE - offset;
 			if (bytes > len)
 				bytes = len;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 144/168] drivers/input/evdev.c: don't kfree() a vmalloc address
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (142 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 143/168] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 145/168] mm: fix swapoff hang after page migration and fork Luis Henriques
                   ` (23 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Henrik Rydberg, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Andrew Morton <akpm@linux-foundation.org>

commit 92788ac1eb06e69a822de45e2a8a63fa45eb5be2 upstream.

If kzalloc() failed and then evdev_open_device() fails, evdev_open()
will pass a vmalloc'ed pointer to kfree.

This might fix https://bugzilla.kernel.org/show_bug.cgi?id=88401, where
there was a crash in kfree().

Reported-by: Christian Casteyde <casteyde.christian@free.fr>
Belatedly-Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/evdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index fd325ec9f064..b51970d1e9ee 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -422,7 +422,7 @@ static int evdev_open(struct inode *inode, struct file *file)
 
  err_free_client:
 	evdev_detach_client(evdev, client);
-	kfree(client);
+	kvfree(client);
 	return error;
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 145/168] mm: fix swapoff hang after page migration and fork
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (143 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 144/168] drivers/input/evdev.c: don't kfree() a vmalloc address Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 146/168] mm: fix anon_vma_clone() error treatment Luis Henriques
                   ` (22 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hugh Dickins, Kelley Nielsen, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Hugh Dickins <hughd@google.com>

commit 2022b4d18a491a578218ce7a4eca8666db895a73 upstream.

I've been seeing swapoff hangs in recent testing: it's cycling around
trying unsuccessfully to find an mm for some remaining pages of swap.

I have been exercising swap and page migration more heavily recently,
and now notice a long-standing error in copy_one_pte(): it's trying to
add dst_mm to swapoff's mmlist when it finds a swap entry, but is doing
so even when it's a migration entry or an hwpoison entry.

Which wouldn't matter much, except it adds dst_mm next to src_mm,
assuming src_mm is already on the mmlist: which may not be so.  Then if
pages are later swapped out from dst_mm, swapoff won't be able to find
where to replace them.

There's already a !non_swap_entry() test for stats: move that up before
the swap_duplicate() and the addition to mmlist.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/memory.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 7e9f0918559b..00a99f5614df 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -813,20 +813,20 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
 		if (!pte_file(pte)) {
 			swp_entry_t entry = pte_to_swp_entry(pte);
 
-			if (swap_duplicate(entry) < 0)
-				return entry.val;
-
-			/* make sure dst_mm is on swapoff's mmlist. */
-			if (unlikely(list_empty(&dst_mm->mmlist))) {
-				spin_lock(&mmlist_lock);
-				if (list_empty(&dst_mm->mmlist))
-					list_add(&dst_mm->mmlist,
-						 &src_mm->mmlist);
-				spin_unlock(&mmlist_lock);
-			}
-			if (likely(!non_swap_entry(entry)))
+			if (likely(!non_swap_entry(entry))) {
+				if (swap_duplicate(entry) < 0)
+					return entry.val;
+
+				/* make sure dst_mm is on swapoff's mmlist. */
+				if (unlikely(list_empty(&dst_mm->mmlist))) {
+					spin_lock(&mmlist_lock);
+					if (list_empty(&dst_mm->mmlist))
+						list_add(&dst_mm->mmlist,
+							 &src_mm->mmlist);
+					spin_unlock(&mmlist_lock);
+				}
 				rss[MM_SWAPENTS]++;
-			else if (is_migration_entry(entry)) {
+			} else if (is_migration_entry(entry)) {
 				page = migration_entry_to_page(entry);
 
 				if (PageAnon(page))
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 146/168] mm: fix anon_vma_clone() error treatment
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (144 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 145/168] mm: fix swapoff hang after page migration and fork Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 147/168] slab: fix nodeid bounds check for non-contiguous node IDs Luis Henriques
                   ` (21 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Forrest, Konstantin Khlebnikov, Andrea Arcangeli,
	Rik van Riel, Tim Hartrick, Hugh Dickins, Michel Lespinasse,
	Vlastimil Babka, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Daniel Forrest <dan.forrest@ssec.wisc.edu>

commit c4ea95d7cd08d9ffd7fa75e6c5e0332d596dd11e upstream.

Andrew Morton noticed that the error return from anon_vma_clone() was
being dropped and replaced with -ENOMEM (which is not itself a bug
because the only error return value from anon_vma_clone() is -ENOMEM).

I did an audit of callers of anon_vma_clone() and discovered an actual
bug where the error return was being lost.  In __split_vma(), between
Linux 3.11 and 3.12 the code was changed so the err variable is used
before the call to anon_vma_clone() and the default initial value of
-ENOMEM is overwritten.  So a failure of anon_vma_clone() will return
success since err at this point is now zero.

Below is a patch which fixes this bug and also propagates the error
return value from anon_vma_clone() in all cases.

Fixes: ef0855d334e1 ("mm: mempolicy: turn vma_set_policy() into vma_dup_policy()")
Signed-off-by: Daniel Forrest <dan.forrest@ssec.wisc.edu>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Tim Hartrick <tim@edgecast.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Michel Lespinasse <walken@google.com>
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: Luis Henriques <luis.henriques@canonical.com>
---
 mm/mmap.c | 10 +++++++---
 mm/rmap.c |  6 ++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 874e0e5ea193..4813ecec5a94 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -747,8 +747,11 @@ again:			remove_next = 1 + (end > next->vm_end);
 		 * shrinking vma had, to cover any anon pages imported.
 		 */
 		if (exporter && exporter->anon_vma && !importer->anon_vma) {
-			if (anon_vma_clone(importer, exporter))
-				return -ENOMEM;
+			int error;
+
+			error = anon_vma_clone(importer, exporter);
+			if (error)
+				return error;
 			importer->anon_vma = exporter->anon_vma;
 		}
 	}
@@ -2430,7 +2433,8 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma,
 	if (err)
 		goto out_free_vma;
 
-	if (anon_vma_clone(new, vma))
+	err = anon_vma_clone(new, vma);
+	if (err)
 		goto out_free_mpol;
 
 	if (new->vm_file)
diff --git a/mm/rmap.c b/mm/rmap.c
index 22a4a7699cdb..78274432b48f 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -274,6 +274,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
 {
 	struct anon_vma_chain *avc;
 	struct anon_vma *anon_vma;
+	int error;
 
 	/* Don't bother if the parent process has no anon_vma here. */
 	if (!pvma->anon_vma)
@@ -283,8 +284,9 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
 	 * First, attach the new VMA to the parent VMA's anon_vmas,
 	 * so rmap can find non-COWed pages in child processes.
 	 */
-	if (anon_vma_clone(vma, pvma))
-		return -ENOMEM;
+	error = anon_vma_clone(vma, pvma);
+	if (error)
+		return error;
 
 	/* Then add our own anon_vma. */
 	anon_vma = anon_vma_alloc();
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 147/168] slab: fix nodeid bounds check for non-contiguous node IDs
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (145 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 146/168] mm: fix anon_vma_clone() error treatment Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 148/168] ahci: disable MSI on SAMSUNG 0xa800 SSD Luis Henriques
                   ` (20 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Paul Mackerras, Christoph Lameter, Joonsoo Kim, Andrew Morton,
	Linus Torvalds, Luis Henriques

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

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

From: Paul Mackerras <paulus@samba.org>

commit 7c3fbbdd04a681a1992ad6a3d7a36a63ff668753 upstream.

The bounds check for nodeid in ____cache_alloc_node gives false
positives on machines where the node IDs are not contiguous, leading to
a panic at boot time.  For example, on a POWER8 machine the node IDs are
typically 0, 1, 16 and 17.  This means that num_online_nodes() returns
4, so when ____cache_alloc_node is called with nodeid = 16 the VM_BUG_ON
triggers, like this:

  kernel BUG at /home/paulus/kernel/kvm/mm/slab.c:3079!
  Call Trace:
    .____cache_alloc_node+0x5c/0x270 (unreliable)
    .kmem_cache_alloc_node_trace+0xdc/0x360
    .init_list+0x3c/0x128
    .kmem_cache_init+0x1dc/0x258
    .start_kernel+0x2a0/0x568
    start_here_common+0x20/0xa8

To fix this, we instead compare the nodeid with MAX_NUMNODES, and
additionally make sure it isn't negative (since nodeid is an int).  The
check is there mainly to protect the array dereference in the get_node()
call in the next line, and the array being dereferenced is of size
MAX_NUMNODES.  If the nodeid is in range but invalid (for example if the
node is off-line), the BUG_ON in the next line will catch that.

Fixes: 14e50c6a9bc2 ("mm: slab: Verify the nodeid passed to ____cache_alloc_node")
Signed-off-by: Paul Mackerras <paulus@samba.org>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/slab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slab.c b/mm/slab.c
index c9103e4cf2c2..92dbea7e7132 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3225,7 +3225,7 @@ static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags,
 	void *obj;
 	int x;
 
-	VM_BUG_ON(nodeid > num_online_nodes());
+	VM_BUG_ON(nodeid < 0 || nodeid >= MAX_NUMNODES);
 	n = cachep->node[nodeid];
 	BUG_ON(!n);
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 148/168] ahci: disable MSI on SAMSUNG 0xa800 SSD
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (146 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 147/168] slab: fix nodeid bounds check for non-contiguous node IDs Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 149/168] i2c: davinci: generate STP always when NACK is received Luis Henriques
                   ` (19 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tejun Heo, Luis Henriques

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

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

From: Tejun Heo <tj@kernel.org>

commit 2b21ef0aae65f22f5ba86b13c4588f6f0c2dbefb upstream.

Just like 0x1600 which got blacklisted by 66a7cbc303f4 ("ahci: disable
MSI instead of NCQ on Samsung pci-e SSDs on macbooks"), 0xa800 chokes
on NCQ commands if MSI is enabled.  Disable MSI.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Dominik Mierzejewski <dominik@greysector.net>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=89171
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/ata/ahci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 5fc11a616a7a..3b18399290b3 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -495,6 +495,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	 * enabled.  https://bugzilla.kernel.org/show_bug.cgi?id=60731
 	 */
 	{ PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_nomsi },
+	{ PCI_VDEVICE(SAMSUNG, 0xa800), board_ahci_nomsi },
 
 	/* Enmotus */
 	{ PCI_DEVICE(0x1c44, 0x8000), board_ahci },
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 149/168] i2c: davinci: generate STP always when NACK is received
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (147 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 148/168] ahci: disable MSI on SAMSUNG 0xa800 SSD Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 150/168] i2c: cadence: Set the hardware time-out register to maximum value Luis Henriques
                   ` (18 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Grygorii Strashko, Wolfram Sang, Luis Henriques

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

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

From: Grygorii Strashko <grygorii.strashko@ti.com>

commit 9ea359f7314132cbcb5a502d2d8ef095be1f45e4 upstream.

According to I2C specification the NACK should be handled as follows:
"When SDA remains HIGH during this ninth clock pulse, this is defined as the Not
Acknowledge signal. The master can then generate either a STOP condition to
abort the transfer, or a repeated START condition to start a new transfer."
[I2C spec Rev. 6, 3.1.6: http://www.nxp.com/documents/user_manual/UM10204.pdf]

Currently the Davinci i2c driver interrupts the transfer on receipt of a
NACK but fails to send a STOP in some situations and so makes the bus
stuck until next I2C IP reset (idle/enable).

For example, the issue will happen during SMBus read transfer which
consists from two i2c messages write command/address and read data:

S Slave Address Wr A Command Code A Sr Slave Address Rd A D1..Dn A P
<--- write -----------------------> <--- read --------------------->

The I2C client device will send NACK if it can't recognize "Command Code"
and it's expected from I2C master to generate STP in this case.
But now, Davinci i2C driver will just exit with -EREMOTEIO and STP will
not be generated.

Hence, fix it by generating Stop condition (STP) always when NACK is received.

This patch fixes Davinci I2C in the same way it was done for OMAP I2C
commit cda2109a26eb ("i2c: omap: query STP always when NACK is received").

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reported-by: Hein Tibosch <hein_tibosch@yahoo.es>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/i2c/busses/i2c-davinci.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 389bc68c55ad..831b7df52fd5 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -411,11 +411,9 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
 	if (dev->cmd_err & DAVINCI_I2C_STR_NACK) {
 		if (msg->flags & I2C_M_IGNORE_NAK)
 			return msg->len;
-		if (stop) {
-			w = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG);
-			w |= DAVINCI_I2C_MDR_STP;
-			davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
-		}
+		w = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG);
+		w |= DAVINCI_I2C_MDR_STP;
+		davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
 		return -EREMOTEIO;
 	}
 	return -EIO;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 150/168] i2c: cadence: Set the hardware time-out register to maximum value
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (148 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 149/168] i2c: davinci: generate STP always when NACK is received Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 151/168] drm/radeon: sync all BOs involved in a CS v2 Luis Henriques
                   ` (17 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vishnu Motghare, Harini Katakam, Wolfram Sang, Luis Henriques

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

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

From: Vishnu Motghare <vishnum@xilinx.com>

commit 681d15a0f527af7ab3a783e1037de86fbcb136ac upstream.

Cadence I2C controller has bug wherein it generates invalid read transactions
after timeout in master receiver mode. This driver does not use the HW
timeout and this interrupt is disabled but the feature itself cannot be
disabled. Hence, this patch writes the maximum value (0xFF) to this register.
This is one of the workarounds to this bug and it will not avoid the issue
completely but reduces the chances of error.

Signed-off-by: Vishnu Motghare <vishnum@xilinx.com>
Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/i2c/busses/i2c-cadence.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index 63f3f03ecc9b..c604f4c3ac0d 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -111,6 +111,8 @@
 #define CDNS_I2C_DIVA_MAX	4
 #define CDNS_I2C_DIVB_MAX	64
 
+#define CDNS_I2C_TIMEOUT_MAX	0xFF
+
 #define cdns_i2c_readreg(offset)       readl_relaxed(id->membase + offset)
 #define cdns_i2c_writereg(val, offset) writel_relaxed(val, id->membase + offset)
 
@@ -852,6 +854,15 @@ static int cdns_i2c_probe(struct platform_device *pdev)
 		goto err_clk_dis;
 	}
 
+	/*
+	 * Cadence I2C controller has a bug wherein it generates
+	 * invalid read transaction after HW timeout in master receiver mode.
+	 * HW timeout is not used by this driver and the interrupt is disabled.
+	 * But the feature itself cannot be disabled. Hence maximum value
+	 * is written to this register to reduce the chances of error.
+	 */
+	cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET);
+
 	dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n",
 		 id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq);
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 151/168] drm/radeon: sync all BOs involved in a CS v2
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (149 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 150/168] i2c: cadence: Set the hardware time-out register to maximum value Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 152/168] ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic Luis Henriques
                   ` (16 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christian König, Alex Deucher, Luis Henriques

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

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

From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>

commit 86b276385c6a986872e4cd144f5940b156053c3f upstream.

Not just the userspace relocs, otherwise we won't wait
for a swapped out page tables to be swapped in again.

v2: rebased on Alex current drm-fixes-3.18

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[ luis: backported to 3.16: used Christian's backport to 3.17 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_cs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index c50a1da6c12a..4aa1ede7b7b5 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -226,14 +226,11 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority
 
 static void radeon_cs_sync_rings(struct radeon_cs_parser *p)
 {
-	int i;
-
-	for (i = 0; i < p->nrelocs; i++) {
-		if (!p->relocs[i].robj)
-			continue;
+	struct radeon_cs_reloc *reloc;
 
+	list_for_each_entry(reloc, &p->validated, tv.head) {
 		radeon_semaphore_sync_to(p->ib.semaphore,
-					 p->relocs[i].robj->tbo.sync_obj);
+					 reloc->robj->tbo.sync_obj);
 	}
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 152/168] ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (150 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 151/168] drm/radeon: sync all BOs involved in a CS v2 Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 153/168] ipv6: gre: fix wrong skb->protocol in WCCP Luis Henriques
                   ` (15 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Xin Long, Cong Wang, David S. Miller, Luis Henriques

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

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

From: lucien <lucien.xin@gmail.com>

commit 20ea60ca9952bd19d4b0d74719daba305aef5178 upstream.

Now the vti_link_ops do not point the .dellink, for fb tunnel device
(ip_vti0), the net_device will be removed as the default .dellink is
unregister_netdevice_queue,but the tunnel still in the tunnel list,
then if we add a new vti tunnel, in ip_tunnel_find():

        hlist_for_each_entry_rcu(t, head, hash_node) {
                if (local == t->parms.iph.saddr &&
                    remote == t->parms.iph.daddr &&
                    link == t->parms.link &&
==>                 type == t->dev->type &&
                    ip_tunnel_key_match(&t->parms, flags, key))
                        break;
        }

the panic will happen, cause dev of ip_tunnel *t is null:
[ 3835.072977] IP: [<ffffffffa04103fd>] ip_tunnel_find+0x9d/0xc0 [ip_tunnel]
[ 3835.073008] PGD b2c21067 PUD b7277067 PMD 0
[ 3835.073008] Oops: 0000 [#1] SMP
.....
[ 3835.073008] Stack:
[ 3835.073008]  ffff8800b72d77f0 ffffffffa0411924 ffff8800bb956000 ffff8800b72d78e0
[ 3835.073008]  ffff8800b72d78a0 0000000000000000 ffffffffa040d100 ffff8800b72d7858
[ 3835.073008]  ffffffffa040b2e3 0000000000000000 0000000000000000 0000000000000000
[ 3835.073008] Call Trace:
[ 3835.073008]  [<ffffffffa0411924>] ip_tunnel_newlink+0x64/0x160 [ip_tunnel]
[ 3835.073008]  [<ffffffffa040b2e3>] vti_newlink+0x43/0x70 [ip_vti]
[ 3835.073008]  [<ffffffff8150d4da>] rtnl_newlink+0x4fa/0x5f0
[ 3835.073008]  [<ffffffff812f68bb>] ? nla_strlcpy+0x5b/0x70
[ 3835.073008]  [<ffffffff81508fb0>] ? rtnl_link_ops_get+0x40/0x60
[ 3835.073008]  [<ffffffff8150d11f>] ? rtnl_newlink+0x13f/0x5f0
[ 3835.073008]  [<ffffffff81509cf4>] rtnetlink_rcv_msg+0xa4/0x270
[ 3835.073008]  [<ffffffff8126adf5>] ? sock_has_perm+0x75/0x90
[ 3835.073008]  [<ffffffff81509c50>] ? rtnetlink_rcv+0x30/0x30
[ 3835.073008]  [<ffffffff81529e39>] netlink_rcv_skb+0xa9/0xc0
[ 3835.073008]  [<ffffffff81509c48>] rtnetlink_rcv+0x28/0x30
....

modprobe ip_vti
ip link del ip_vti0 type vti
ip link add ip_vti0 type vti
rmmod ip_vti

do that one or more times, kernel will panic.

fix it by assigning ip_tunnel_dellink to vti_link_ops' dellink, in
which we skip the unregister of fb tunnel device. do the same on ip6_vti.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ip_vti.c  |  1 +
 net/ipv6/ip6_vti.c | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index b8960f3527f3..ea7525b1f996 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -528,6 +528,7 @@ static struct rtnl_link_ops vti_link_ops __read_mostly = {
 	.validate	= vti_tunnel_validate,
 	.newlink	= vti_newlink,
 	.changelink	= vti_changelink,
+	.dellink        = ip_tunnel_dellink,
 	.get_size	= vti_get_size,
 	.fill_info	= vti_fill_info,
 };
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index f3ce1cbc0bc5..7c6e6bfb1b0f 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -901,6 +901,15 @@ static int vti6_newlink(struct net *src_net, struct net_device *dev,
 	return vti6_tnl_create2(dev);
 }
 
+static void vti6_dellink(struct net_device *dev, struct list_head *head)
+{
+	struct net *net = dev_net(dev);
+	struct vti6_net *ip6n = net_generic(net, vti6_net_id);
+
+	if (dev != ip6n->fb_tnl_dev)
+		unregister_netdevice_queue(dev, head);
+}
+
 static int vti6_changelink(struct net_device *dev, struct nlattr *tb[],
 			   struct nlattr *data[])
 {
@@ -976,6 +985,7 @@ static struct rtnl_link_ops vti6_link_ops __read_mostly = {
 	.setup		= vti6_dev_setup,
 	.validate	= vti6_validate,
 	.newlink	= vti6_newlink,
+	.dellink	= vti6_dellink,
 	.changelink	= vti6_changelink,
 	.get_size	= vti6_get_size,
 	.fill_info	= vti6_fill_info,
@@ -1016,6 +1026,7 @@ static int __net_init vti6_init_net(struct net *net)
 	if (!ip6n->fb_tnl_dev)
 		goto err_alloc_dev;
 	dev_net_set(ip6n->fb_tnl_dev, net);
+	ip6n->fb_tnl_dev->rtnl_link_ops = &vti6_link_ops;
 
 	err = vti6_fb_tnl_dev_init(ip6n->fb_tnl_dev);
 	if (err < 0)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 153/168] ipv6: gre: fix wrong skb->protocol in WCCP
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (151 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 152/168] ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 154/168] Fix race condition between vxlan_sock_add and vxlan_sock_release Luis Henriques
                   ` (14 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dmitry Kozlov, Yuri Chislov, Daniel Borkmann, David S. Miller,
	Luis Henriques

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

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

From: Yuri Chislov <yuri.chislov@gmail.com>

commit be6572fdb1bfbe23b2624d477de50af50b02f5d6 upstream.

When using GRE redirection in WCCP, it sets the wrong skb->protocol,
that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic.

Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Yuri Chislov <yuri.chislov@gmail.com>
Tested-by: Yuri Chislov <yuri.chislov@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv6/ip6_gre.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index c3ba41cef1df..0baac7127c57 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -499,11 +499,11 @@ static int ip6gre_rcv(struct sk_buff *skb)
 
 		skb->protocol = gre_proto;
 		/* WCCP version 1 and 2 protocol decoding.
-		 * - Change protocol to IP
+		 * - Change protocol to IPv6
 		 * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
 		 */
 		if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) {
-			skb->protocol = htons(ETH_P_IP);
+			skb->protocol = htons(ETH_P_IPV6);
 			if ((*(h + offset) & 0xF0) != 0x40)
 				offset += 4;
 		}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 154/168] Fix race condition between vxlan_sock_add and vxlan_sock_release
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (152 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 153/168] ipv6: gre: fix wrong skb->protocol in WCCP Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 155/168] tg3: fix ring init when there are more TX than RX channels Luis Henriques
                   ` (13 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcelo Ricardo Leitner, David S. Miller, Luis Henriques

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

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

From: Marcelo Leitner <mleitner@redhat.com>

commit 00c83b01d58068dfeb2e1351cca6fccf2a83fa8f upstream.

Currently, when trying to reuse a socket, vxlan_sock_add will grab
vn->sock_lock, locate a reusable socket, inc refcount and release
vn->sock_lock.

But vxlan_sock_release() will first decrement refcount, and then grab
that lock. refcnt operations are atomic but as currently we have
deferred works which hold vs->refcnt each, this might happen, leading to
a use after free (specially after vxlan_igmp_leave):

  CPU 1                            CPU 2

deferred work                    vxlan_sock_add
  ...                              ...
                                   spin_lock(&vn->sock_lock)
                                   vs = vxlan_find_sock();
  vxlan_sock_release
    dec vs->refcnt, reaches 0
    spin_lock(&vn->sock_lock)
                                   vxlan_sock_hold(vs), refcnt=1
                                   spin_unlock(&vn->sock_lock)
    hlist_del_rcu(&vs->hlist);
    vxlan_notify_del_rx_port(vs)
    spin_unlock(&vn->sock_lock)

So when we look for a reusable socket, we check if it wasn't freed
already before reusing it.

Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Fixes: 7c47cedf43a8b3 ("vxlan: move IGMP join/leave to work queue")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/vxlan.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 032c52e1208a..24c1bef7abc6 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2064,9 +2064,8 @@ static int vxlan_init(struct net_device *dev)
 	spin_lock(&vn->sock_lock);
 	vs = vxlan_find_sock(vxlan->net, ipv6 ? AF_INET6 : AF_INET,
 			     vxlan->dst_port);
-	if (vs) {
+	if (vs && atomic_add_unless(&vs->refcnt, 1, 0)) {
 		/* If we have a socket with same port already, reuse it */
-		atomic_inc(&vs->refcnt);
 		vxlan_vs_add_dev(vs, vxlan);
 	} else {
 		/* otherwise make new socket outside of RTNL */
@@ -2545,12 +2544,9 @@ struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
 
 	spin_lock(&vn->sock_lock);
 	vs = vxlan_find_sock(net, ipv6 ? AF_INET6 : AF_INET, port);
-	if (vs) {
-		if (vs->rcv == rcv)
-			atomic_inc(&vs->refcnt);
-		else
+	if (vs && ((vs->rcv != rcv) ||
+		   !atomic_add_unless(&vs->refcnt, 1, 0)))
 			vs = ERR_PTR(-EBUSY);
-	}
 	spin_unlock(&vn->sock_lock);
 
 	if (!vs)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 155/168] tg3: fix ring init when there are more TX than RX channels
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (153 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 154/168] Fix race condition between vxlan_sock_add and vxlan_sock_release Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 156/168] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res Luis Henriques
                   ` (12 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thadeu Lima de Souza Cascardo, David S. Miller, Luis Henriques

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

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

From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>

commit a620a6bc1c94c22d6c312892be1e0ae171523125 upstream.

If TX channels are set to 4 and RX channels are set to less than 4,
using ethtool -L, the driver will try to initialize more RX channels
than it has allocated, causing an oops.

This fix only initializes the RX ring if it has been allocated.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 8345c6523799..2a1adec84d0e 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8561,7 +8561,8 @@ static int tg3_init_rings(struct tg3 *tp)
 		if (tnapi->rx_rcb)
 			memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
 
-		if (tg3_rx_prodring_alloc(tp, &tnapi->prodring)) {
+		if (tnapi->prodring.rx_std &&
+		    tg3_rx_prodring_alloc(tp, &tnapi->prodring)) {
 			tg3_free_rings(tp);
 			return -ENOMEM;
 		}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 156/168] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (154 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 155/168] tg3: fix ring init when there are more TX than RX channels Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 157/168] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Luis Henriques
                   ` (11 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jack Morgenstein, Or Gerlitz, David S. Miller, Luis Henriques

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

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

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

commit 2d5c57d7fbfaa642fb7f0673df24f32b83d9066c upstream.

Some VF drivers use the upper byte of "param1" (the qp count field)
in mlx4_qp_reserve_range() to pass flags which are used to optimize
the range allocation.

Under the current code, if any of these flags are set, the 32-bit
count field yields a count greater than 2^24, which is out of range,
and this VF fails.

As these flags represent a "best-effort" allocation hint anyway, they may
safely be ignored. Therefore, the PF driver may simply mask out the bits.

Fixes: c82e9aa0a8 "mlx4_core: resource tracking for HCA resources used by guests"
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 0efc1368e5a8..9d14ed372c44 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -1532,7 +1532,7 @@ static int qp_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
 
 	switch (op) {
 	case RES_OP_RESERVE:
-		count = get_param_l(&in_param);
+		count = get_param_l(&in_param) & 0xffffff;
 		align = get_param_h(&in_param);
 		err = mlx4_grant_resource(dev, slave, RES_QP, count, 0);
 		if (err)
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 157/168] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (155 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 156/168] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 158/168] rtnetlink: release net refcnt on error in do_setlink() Luis Henriques
                   ` (10 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Scott Feldman, Thomas Graf, David S. Miller, Luis Henriques

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

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

From: Thomas Graf <tgraf@suug.ch>

commit f6c6fda4c9e17940b0a2ba206b0408babfdc930c upstream.

Fixes: 7f28fa10 ("bonding: add arp_ip_target netlink support")
Reported-by: John Fastabend <john.fastabend@gmail.com>
Cc: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/bonding/bond_netlink.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index 5ab3c1847e67..8626bc0cb2af 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -197,7 +197,12 @@ static int bond_changelink(struct net_device *bond_dev,
 
 		bond_option_arp_ip_targets_clear(bond);
 		nla_for_each_nested(attr, data[IFLA_BOND_ARP_IP_TARGET], rem) {
-			__be32 target = nla_get_be32(attr);
+			__be32 target;
+
+			if (nla_len(attr) < sizeof(target))
+				return -EINVAL;
+
+			target = nla_get_be32(attr);
 
 			bond_opt_initval(&newval, (__force u64)target);
 			err = __bond_opt_set(bond, BOND_OPT_ARP_TARGETS,
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 158/168] rtnetlink: release net refcnt on error in do_setlink()
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (156 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 157/168] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 159/168] gre: Set inner mac header in gro complete Luis Henriques
                   ` (9 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric W. Biederman, Nicolas Dichtel, David S. Miller, Luis Henriques

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

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

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>

commit e0ebde0e131b529fd721b24f62872def5ec3718c upstream.

rtnl_link_get_net() holds a reference on the 'struct net', we need to release
it in case of error.

CC: Eric W. Biederman <ebiederm@xmission.com>
Fixes: b51642f6d77b ("net: Enable a userns root rtnl calls that are safe for unprivilged users")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/rtnetlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index e0b5ca349049..48c2be43f856 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1490,6 +1490,7 @@ static int do_setlink(const struct sk_buff *skb,
 			goto errout;
 		}
 		if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) {
+			put_net(net);
 			err = -EPERM;
 			goto errout;
 		}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 159/168] gre: Set inner mac header in gro complete
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (157 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 158/168] rtnetlink: release net refcnt on error in do_setlink() Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 160/168] mips: bpf: Fix broken BPF_MOD Luis Henriques
                   ` (8 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tom Herbert, David S. Miller, Luis Henriques

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

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

From: Tom Herbert <therbert@google.com>

commit 6fb2a756739aa507c1fd5b8126f0bfc2f070dc46 upstream.

Set the inner mac header to point to the GRE payload when
doing GRO. This is needed if we proceed to send the packet
through GRE GSO which now uses the inner mac header instead
of inner network header to determine the length of encapsulation
headers.

Fixes: 14051f0452a2 ("gre: Use inner mac length when computing tunnel length")
Reported-by: Wolfgang Walter <linux@stwm.de>
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/gre_offload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index 32041ecbeafb..4ae6b52751e9 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -279,6 +279,9 @@ static int gre_gro_complete(struct sk_buff *skb, int nhoff)
 		err = ptype->callbacks.gro_complete(skb, nhoff + grehlen);
 
 	rcu_read_unlock();
+
+	skb_set_inner_mac_header(skb, nhoff + grehlen);
+
 	return err;
 }
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 160/168] mips: bpf: Fix broken BPF_MOD
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (158 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 159/168] gre: Set inner mac header in gro complete Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 161/168] net: mvneta: fix Tx interrupt delay Luis Henriques
                   ` (7 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Denis Kirjanov, David S. Miller, Luis Henriques

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

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

From: Denis Kirjanov <kda@linux-powerpc.org>

commit 2e46477a12f6fd273e31a220b155d66e8352198c upstream.

Remove optimize_div() from BPF_MOD | BPF_K case
since we don't know the dividend and fix the
emit_mod() by reading the mod operation result from HI register

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/net/bpf_jit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index b87390a56a2f..965f1c116cc5 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -430,7 +430,7 @@ static inline void emit_mod(unsigned int dst, unsigned int src,
 		u32 *p = &ctx->target[ctx->idx];
 		uasm_i_divu(&p, dst, src);
 		p = &ctx->target[ctx->idx + 1];
-		uasm_i_mflo(&p, dst);
+		uasm_i_mfhi(&p, dst);
 	}
 	ctx->idx += 2; /* 2 insts */
 }
@@ -1005,7 +1005,7 @@ load_ind:
 			break;
 		case BPF_ALU | BPF_MOD | BPF_K:
 			/* A %= k */
-			if (k == 1 || optimize_div(&k)) {
+			if (k == 1) {
 				ctx->flags |= SEEN_A;
 				emit_jit_reg_move(r_A, r_zero, ctx);
 			} else {
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 161/168] net: mvneta: fix Tx interrupt delay
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (159 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 160/168] mips: bpf: Fix broken BPF_MOD Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 162/168] net: mvneta: fix race condition in mvneta_tx() Luis Henriques
                   ` (6 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Willy Tarreau, David S. Miller, Luis Henriques

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

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

From: willy tarreau <w@1wt.eu>

commit aebea2ba0f7495e1a1c9ea5e753d146cb2f6b845 upstream.

The mvneta driver sets the amount of Tx coalesce packets to 16 by
default. Normally that does not cause any trouble since the driver
uses a much larger Tx ring size (532 packets). But some sockets
might run with very small buffers, much smaller than the equivalent
of 16 packets. This is what ping is doing for example, by setting
SNDBUF to 324 bytes rounded up to 2kB by the kernel.

The problem is that there is no documented method to force a specific
packet to emit an interrupt (eg: the last of the ring) nor is it
possible to make the NIC emit an interrupt after a given delay.

In this case, it causes trouble, because when ping sends packets over
its raw socket, the few first packets leave the system, and the first
15 packets will be emitted without an IRQ being generated, so without
the skbs being freed. And since the socket's buffer is small, there's
no way to reach that amount of packets, and the ping ends up with
"send: no buffer available" after sending 6 packets. Running with 3
instances of ping in parallel is enough to hide the problem, because
with 6 packets per instance, that's 18 packets total, which is enough
to grant a Tx interrupt before all are sent.

The original driver in the LSP kernel worked around this design flaw
by using a software timer to clean up the Tx descriptors. This timer
was slow and caused terrible network performance on some Tx-bound
workloads (such as routing) but was enough to make tools like ping
work correctly.

Instead here, we simply set the packet counts before interrupt to 1.
This ensures that each packet sent will produce an interrupt. NAPI
takes care of coalescing interrupts since the interrupt is disabled
once generated.

No measurable performance impact nor CPU usage were observed on small
nor large packets, including when saturating the link on Tx, and this
fixes tools like ping which rely on too small a send buffer. If one
wants to increase this value for certain workloads where it is safe
to do so, "ethtool -C $dev tx-frames" will override this default
setting.

This fix needs to be applied to stable kernels starting with 3.10.

Tested-By: Maggie Mae Roxas <maggie.mae.roxas@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index dadd9a5f6323..626aa88644b8 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -215,7 +215,7 @@
 /* Various constants */
 
 /* Coalescing */
-#define MVNETA_TXDONE_COAL_PKTS		16
+#define MVNETA_TXDONE_COAL_PKTS		1
 #define MVNETA_RX_COAL_PKTS		32
 #define MVNETA_RX_COAL_USEC		100
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 162/168] net: mvneta: fix race condition in mvneta_tx()
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (160 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 161/168] net: mvneta: fix Tx interrupt delay Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 163/168] net: sctp: use MAX_HEADER for headroom reserve in output path Luis Henriques
                   ` (5 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, David S. Miller, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit 5f478b41033606d325e420df693162e2524c2b94 upstream.

mvneta_tx() dereferences skb to get skb->len too late,
as hardware might have completed the transmit and TX completion
could have freed the skb from another cpu.

Fixes: 71f6d1b31fb1 ("net: mvneta: replace Tx timer with a real interrupt")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 626aa88644b8..393d49202f23 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1719,6 +1719,7 @@ static int mvneta_tx(struct sk_buff *skb, struct net_device *dev)
 	u16 txq_id = skb_get_queue_mapping(skb);
 	struct mvneta_tx_queue *txq = &pp->txqs[txq_id];
 	struct mvneta_tx_desc *tx_desc;
+	int len = skb->len;
 	int frags = 0;
 	u32 tx_cmd;
 
@@ -1786,7 +1787,7 @@ out:
 
 		u64_stats_update_begin(&stats->syncp);
 		stats->tx_packets++;
-		stats->tx_bytes  += skb->len;
+		stats->tx_bytes  += len;
 		u64_stats_update_end(&stats->syncp);
 	} else {
 		dev->stats.tx_dropped++;
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 163/168] net: sctp: use MAX_HEADER for headroom reserve in output path
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (161 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 162/168] net: mvneta: fix race condition in mvneta_tx() Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 164/168] i2c: omap: fix i207 errata handling Luis Henriques
                   ` (4 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Borkmann, David S. Miller, Luis Henriques

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

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

From: Daniel Borkmann <dborkman@redhat.com>

commit 9772b54c55266ce80c639a80aa68eeb908f8ecf5 upstream.

To accomodate for enough headroom for tunnels, use MAX_HEADER instead
of LL_MAX_HEADER. Robert reported that he has hit after roughly 40hrs
of trinity an skb_under_panic() via SCTP output path (see reference).
I couldn't reproduce it from here, but not using MAX_HEADER as elsewhere
in other protocols might be one possible cause for this.

In any case, it looks like accounting on chunks themself seems to look
good as the skb already passed the SCTP output path and did not hit
any skb_over_panic(). Given tunneling was enabled in his .config, the
headroom would have been expanded by MAX_HEADER in this case.

Reported-by: Robert Święcki <robert@swiecki.net>
Reference: https://lkml.org/lkml/2014/12/1/507
Fixes: 594ccc14dfe4d ("[SCTP] Replace incorrect use of dev_alloc_skb with alloc_skb in sctp_packet_transmit().")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sctp/output.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/output.c b/net/sctp/output.c
index 407ae2bf97b0..3f5b7221dda3 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -401,12 +401,12 @@ int sctp_packet_transmit(struct sctp_packet *packet)
 	sk = chunk->skb->sk;
 
 	/* Allocate the new skb.  */
-	nskb = alloc_skb(packet->size + LL_MAX_HEADER, GFP_ATOMIC);
+	nskb = alloc_skb(packet->size + MAX_HEADER, GFP_ATOMIC);
 	if (!nskb)
 		goto nomem;
 
 	/* Make sure the outbound skb has enough header room reserved. */
-	skb_reserve(nskb, packet->overhead + LL_MAX_HEADER);
+	skb_reserve(nskb, packet->overhead + MAX_HEADER);
 
 	/* Set the owning socket so that we know where to get the
 	 * destination IP address.
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 164/168] i2c: omap: fix i207 errata handling
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (162 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 163/168] net: sctp: use MAX_HEADER for headroom reserve in output path Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 165/168] x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs Luis Henriques
                   ` (3 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexander Kochetkov, Wolfram Sang, Luis Henriques

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

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

From: Alexander Kochetkov <al.kochet@gmail.com>

commit ccfc866356674cb3a61829d239c685af6e85f197 upstream.

commit 6d9939f651419a63e091105663821f9c7d3fec37 (i2c: omap: split out [XR]DR
and [XR]RDY) changed the way how errata i207 (I2C: RDR Flag May Be Incorrectly
Set) get handled. 6d9939f6514 code doesn't correspond to workaround provided by
errata.

According to errata ISR must filter out spurious RDR before data read not after.
ISR must read RXSTAT to get number of bytes available to read. Because RDR
could be set while there could no data in the receive FIFO.

Restored pre 6d9939f6514 way of handling errata.

Found by code review. Real impact haven't seen.
Tested on Beagleboard XM C.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Fixes: 6d9939f651419a63e09110 i2c: omap: split out [XR]DR and [XR]RDY
Tested-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/i2c/busses/i2c-omap.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 4ba4c2c7bc79..5a8c15e52ede 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -956,11 +956,13 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
 			if (dev->fifo_size)
 				num_bytes = dev->buf_len;
 
-			omap_i2c_receive_data(dev, num_bytes, true);
-
-			if (dev->errata & I2C_OMAP_ERRATA_I207)
+			if (dev->errata & I2C_OMAP_ERRATA_I207) {
 				i2c_omap_errata_i207(dev, stat);
+				num_bytes = (omap_i2c_read_reg(dev,
+					OMAP_I2C_BUFSTAT_REG) >> 8) & 0x3F;
+			}
 
+			omap_i2c_receive_data(dev, num_bytes, true);
 			omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RDR);
 			continue;
 		}
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 165/168] x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (163 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 164/168] i2c: omap: fix i207 errata handling Luis Henriques
@ 2014-12-15 14:26 ` Luis Henriques
  2014-12-15 14:27 ` [PATCH 3.16.y-ckt 166/168] USB: add reset resume quirk for usb3503 Luis Henriques
                   ` (2 subsequent siblings)
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:26 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andy Lutomirski, Linus Torvalds, Steven Rostedt, Ingo Molnar,
	Luis Henriques

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

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

From: Andy Lutomirski <luto@amacapital.net>

commit 7ddc6a2199f1da405a2fb68c40db8899b1a8cd87 upstream.

These functions can be executed on the int3 stack, so kprobes
are dangerous. Tracing is probably a bad idea, too.

Fixes: b645af2d5905 ("x86_64, traps: Rework bad_iret")
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/50e33d26adca60816f3ba968875801652507d0c4.1416870125.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/traps.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index de801f22128a..07ab8e9733c5 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -387,7 +387,7 @@ NOKPROBE_SYMBOL(do_int3);
  * for scheduling or signal handling. The actual stack switch is done in
  * entry.S
  */
-asmlinkage __visible struct pt_regs *sync_regs(struct pt_regs *eregs)
+asmlinkage __visible notrace struct pt_regs *sync_regs(struct pt_regs *eregs)
 {
 	struct pt_regs *regs = eregs;
 	/* Did already sync */
@@ -413,7 +413,7 @@ struct bad_iret_stack {
 	struct pt_regs regs;
 };
 
-asmlinkage __visible
+asmlinkage __visible notrace
 struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
 {
 	/*
@@ -436,6 +436,7 @@ struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
 	BUG_ON(!user_mode_vm(&new_stack->regs));
 	return new_stack;
 }
+NOKPROBE_SYMBOL(fixup_bad_iret);
 #endif
 
 /*
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 166/168] USB: add reset resume quirk for usb3503
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (164 preceding siblings ...)
  2014-12-15 14:26 ` [PATCH 3.16.y-ckt 165/168] x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs Luis Henriques
@ 2014-12-15 14:27 ` Luis Henriques
  2014-12-15 14:27 ` [PATCH 3.16.y-ckt 167/168] PCI: pciehp: Prevent NULL dereference during probe Luis Henriques
  2014-12-15 14:27 ` [PATCH 3.16.y-ckt 168/168] igb: bring link up when PHY is powered up Luis Henriques
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:27 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joonyoung Shim, Greg Kroah-Hartman, Luis Henriques

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

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

From: Joonyoung Shim <jy0922.shim@samsung.com>

commit 526a4045c60fbaede88ec95a69a73059dff02160 upstream.

The usb device will autoresume from choose_wakeup() if it is
autosuspended with the wrong wakeup setting, but below errors occur
because usb3503 misc driver will switch to standby mode when suspended.

As add USB_QUIRK_RESET_RESUME, it can stop setting wrong wakeup from
autosuspend_check().

[    7.734717] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    7.854658] usb 1-3: device descriptor read/64, error -71
[    8.079657] usb 1-3: device descriptor read/64, error -71
[    8.294664] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    8.414658] usb 1-3: device descriptor read/64, error -71
[    8.639657] usb 1-3: device descriptor read/64, error -71
[    8.854667] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    9.264598] usb 1-3: device not accepting address 3, error -71
[    9.374655] usb 1-3: reset high-speed USB device number 3 using exynos-ehci
[    9.784601] usb 1-3: device not accepting address 3, error -71
[    9.784838] usb usb1-port3: device 1-3 not suspended yet

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/core/quirks.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index b195fdb1effc..7f4a4412b2fc 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -165,6 +165,9 @@ static const struct usb_device_id usb_quirk_list[] = {
 	/* INTEL VALUE SSD */
 	{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* USB3503 */
+	{ USB_DEVICE(0x0424, 0x3503), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	{ }  /* terminating entry must be last */
 };
 
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 167/168] PCI: pciehp: Prevent NULL dereference during probe
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (165 preceding siblings ...)
  2014-12-15 14:27 ` [PATCH 3.16.y-ckt 166/168] USB: add reset resume quirk for usb3503 Luis Henriques
@ 2014-12-15 14:27 ` Luis Henriques
  2014-12-15 14:27 ` [PATCH 3.16.y-ckt 168/168] igb: bring link up when PHY is powered up Luis Henriques
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:27 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andreas Noever, Bjorn Helgaas, Luis Henriques

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

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

From: Andreas Noever <andreas.noever@gmail.com>

commit bceee4a97eb58bd0e80e39eff11b506ddd9e7ad3 upstream.

pciehp assumes that dev->subordinate, the struct pci_bus for a bridge's
secondary bus, exists.  But we do not create that bus if we run out of bus
numbers during enumeration.  This leads to a NULL dereference in
init_slot() (and other places).

Change pciehp_probe() to return -ENODEV when no secondary bus is present.

Signed-off-by: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/pci/hotplug/pciehp_core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index a2297db80813..07aa722bb12c 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -255,6 +255,13 @@ static int pciehp_probe(struct pcie_device *dev)
 	else if (pciehp_acpi_slot_detection_check(dev->port))
 		goto err_out_none;
 
+	if (!dev->port->subordinate) {
+		/* Can happen if we run out of bus numbers during probe */
+		dev_err(&dev->device,
+			"Hotplug bridge without secondary bus, ignoring\n");
+		goto err_out_none;
+	}
+
 	ctrl = pcie_init(dev);
 	if (!ctrl) {
 		dev_err(&dev->device, "Controller initialization failed\n");
-- 
2.1.3


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

* [PATCH 3.16.y-ckt 168/168] igb: bring link up when PHY is powered up
  2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
                   ` (166 preceding siblings ...)
  2014-12-15 14:27 ` [PATCH 3.16.y-ckt 167/168] PCI: pciehp: Prevent NULL dereference during probe Luis Henriques
@ 2014-12-15 14:27 ` Luis Henriques
  167 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2014-12-15 14:27 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Todd Fujinaka, Jeff Kirsher, Vincent Donnefort, Luis Henriques

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

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

From: Todd Fujinaka <todd.fujinaka@intel.com>

commit aec653c43b0c55667355e26d7de1236bda9fb4e3 upstream.

Call igb_setup_link() when the PHY is powered up.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Reported-by: Jeff Westfahl <jeff.westfahl@ni.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Vincent Donnefort <vdonnefort@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a9537ba7a5a0..4d2dc17fd31b 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1630,6 +1630,8 @@ void igb_power_up_link(struct igb_adapter *adapter)
 		igb_power_up_phy_copper(&adapter->hw);
 	else
 		igb_power_up_serdes_link_82575(&adapter->hw);
+
+	igb_setup_link(&adapter->hw);
 }
 
 /**
-- 
2.1.3


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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
  2014-12-15 14:24 ` [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver Luis Henriques
@ 2015-01-11 21:49   ` Ben Hutchings
  2015-01-12 17:20       ` Daniel Vetter
  0 siblings, 1 reply; 187+ messages in thread
From: Ben Hutchings @ 2015-01-11 21:49 UTC (permalink / raw)
  To: Luis Henriques, Chris Wilson, Greg Kroah-Hartman
  Cc: linux-kernel, stable, kernel-team, Daniel Vetter

[-- Attachment #1: Type: text/plain, Size: 2905 bytes --]

On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Chris Wilson <chris@chris-wilson.co.uk>
> 
> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>

Should this also be applied to any older stable branches?

i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
possible for the alloc_apertures() call to fail.

remove_conflicting_framebuffers() has returned an error code since 3.14
(but could silently fail before then!) so this should be applicable to
the 3.14 stable branch too.

Ben.

> ---
>  drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index d44344140627..0663fb4fa606 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
>  }
>  
>  #if IS_ENABLED(CONFIG_FB)
> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  {
>  	struct apertures_struct *ap;
>  	struct pci_dev *pdev = dev_priv->dev->pdev;
>  	bool primary;
> +	int ret;
>  
>  	ap = alloc_apertures(1);
>  	if (!ap)
> -		return;
> +		return -ENOMEM;
>  
>  	ap->ranges[0].base = dev_priv->gtt.mappable_base;
>  	ap->ranges[0].size = dev_priv->gtt.mappable_end;
> @@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  	primary =
>  		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
>  
> -	remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> +	ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
>  
>  	kfree(ap);
> +
> +	return ret;
>  }
>  #else
> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>  {
> +	return 0;
>  }
>  #endif
>  
> @@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  			goto out_gtt;
>  		}
>  
> -		i915_kick_out_firmware_fb(dev_priv);
> +		ret = i915_kick_out_firmware_fb(dev_priv);
> +		if (ret) {
> +			DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
> +			goto out_gtt;
> +		}
>  	}
>  
>  	pci_set_master(dev->pdev);

-- 
Ben Hutchings
One of the nice things about standards is that there are so many of them.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL Luis Henriques
@ 2015-01-11 22:39   ` Ben Hutchings
  2015-01-12 10:09       ` Luis Henriques
  0 siblings, 1 reply; 187+ messages in thread
From: Ben Hutchings @ 2015-01-11 22:39 UTC (permalink / raw)
  To: Luis Henriques; +Cc: linux-kernel, stable, kernel-team, Robert Jarzmik

[-- Attachment #1: Type: text/plain, Size: 4995 bytes --]

On Mon, 2014-12-15 at 14:25 +0000, Luis Henriques wrote:
> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Robert Jarzmik <robert.jarzmik@free.fr>
> 
> commit cde7fc879969f933614b1256df2625d6ff637bab upstream.
> 
> The commit 2111667b4677 ("ARM: pxa: call debug_ll_io_init for
> earlyprintk") triggers in the current kernel the attached backtrace on
> PXA/tosa early in the boot time when DEBUG_LL is enabled.

That was in 3.17-rc1, so I don't think this fix was needed for 3.16.  I
don't know whether it causes any harm to apply it here.

Ben.

> It is due to overlap between uart virtual memory defined in
> DEBUG_UART_VIRT and mapped by debug_ll_io_init() and peripheral bus
> mapped by pxa_map_io at the same address, 0xf2100000.
> 
> As hinted by Arnd, map early virtual memory for low level debug on
> address 0xf6200000, even if that means 2 virtual mappings will give
> access to the pxa internal UARTs (FFUART, BTUART, STUART, ...).
> 
> ------------[ cut here ]------------
> kernel BUG at /home/lumag/linux/mm/vmalloc.c:1143!
> Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-00032-g8e0d202-dirty #23
> task: c062a5a8 ti: c0620000 task.ti: c0620000
> PC is at vm_area_add_early+0x54/0x84
> LR is at add_static_vm_early+0xc/0x60
> pc : [<c03e1100>]    lr : [<c03d9ef4>]    psr: 800001d3
> sp : c0621f04  ip : c03efa74  fp : c03edf84
> r10: c0637e98  r9 : 40000001  r8 : c03da57c
> r7 : c3ffcfb0  r6 : 00000000  r5 : c3ffcfb0  r4 : 02000000
> r3 : c3ffcfd8  r2 : f2100000  r1 : f4000000  r0 : c3ffcfb0
> Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
> Control: 00007977  Table: a0004000  DAC: 00000017
> Process swapper (pid: 0, stack limit = 0xc06201c8)
> Stack: (0xc0621f04 to 0xc0622000)
> 1f00:          c3ffcfd8 40000001 c3ffcfd8 c03ee08c c03da570 c03db90c c0637d24
> 1f20: 00000000 c03ec7cc c066e654 a0700000 000a0700 c03db914 c03db90c c03daf84
> 1f40: 00000000 000a0000 c0000000 c03ec7cc 000a0700 c0700000 ffff1000 000a3fff
> 1f60: 00001000 00000007 00000000 c03ec7cc c0008000 c03ed748 c0621fd4 c03d5d18
> 1f80: 69052d00 a03ec48c 00000000 c03d8ad0 0000006c 00007977 c036c6e8 00000001
> 1fa0: c0621fd4 c03ed744 c0628000 a0004000 69052d00 a03ec48c 00000000 c03d68d4
> 1fc0: 00000000 00000000 00000000 00000000 00000000 c03ed748 c0649894 c062801c
> 1fe0: c03ed744 c062b2f0 a0004000 69052d00 a03ec48c a0008040 00000000 00000000
> [<c03e1100>] (vm_area_add_early) from [<c03d9ef4>] (add_static_vm_early+0xc/0x60)
> [<c03d9ef4>] (add_static_vm_early) from [<c03da570>] (iotable_init.part.6+0xa8/0xb4)
> [<c03da570>] (iotable_init.part.6) from [<c03db914>] (pxa25x_map_io+0x8/0x24)
> [<c03db914>] (pxa25x_map_io) from [<c03daf84>] (paging_init+0x744/0x8d8)
> [<c03daf84>] (paging_init) from [<c03d8ad0>] (setup_arch+0x354/0x608)
> [<c03d8ad0>] (setup_arch) from [<c03d68d4>] (start_kernel+0xa8/0x3dc)
> [<c03d68d4>] (start_kernel) from [<a0008040>] (0xa0008040)
> Code: e5904008 e0811004 e1520001 2a000005 (e7f001f2)
> ---[ end trace f24b6c88ae00fa9a ]---
> Kernel panic - not syncing: Attempted to kill the idle task!
> ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
> 
> Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> [ luis: backported to 3.16: adjusted context ]
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>  arch/arm/Kconfig.debug                    | 2 +-
>  arch/arm/mach-pxa/include/mach/addr-map.h | 5 +++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 8f90595069a1..1fdb08427db7 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -1118,7 +1118,7 @@ config DEBUG_UART_VIRT
>  	default 0xf1600000 if ARCH_INTEGRATOR
>  	default 0xf1c28000 if DEBUG_SUNXI_UART0
>  	default 0xf1c28400 if DEBUG_SUNXI_UART1
> -	default 0xf2100000 if DEBUG_PXA_UART1
> +	default 0xf6200000 if DEBUG_PXA_UART1
>  	default 0xf4090000 if ARCH_LPC32XX
>  	default 0xf4200000 if ARCH_GEMINI
>  	default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
> diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h
> index bbf9df37ad4b..d28fe291233a 100644
> --- a/arch/arm/mach-pxa/include/mach/addr-map.h
> +++ b/arch/arm/mach-pxa/include/mach/addr-map.h
> @@ -39,6 +39,11 @@
>  #define DMEMC_SIZE		0x00100000
>  
>  /*
> + * Reserved space for low level debug virtual addresses within
> + * 0xf6200000..0xf6201000
> + */
> +
> +/*
>   * Internal Memory Controller (PXA27x and later)
>   */
>  #define IMEMC_PHYS		0x58000000

-- 
Ben Hutchings
One of the nice things about standards is that there are so many of them.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [stable] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 071/168] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear Luis Henriques
@ 2015-01-12  0:23   ` Ben Hutchings
  0 siblings, 0 replies; 187+ messages in thread
From: Ben Hutchings @ 2015-01-12  0:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Zefan Li, Jiri Slaby
  Cc: linux-kernel, stable, kernel-team, Steve Capper, Russell King,
	Hou Pengyang, Luis Henriques

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

On Mon, 2014-12-15 at 14:25 +0000, Luis Henriques wrote:
> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Steven Capper <steve.capper@linaro.org>
> 
> commit f2950706871c4b6e8c0f0d7c3f62d35930b8de63 upstream.
> 
> Long descriptors on ARM are 64 bits, and some pte functions such as
> pte_dirty return a bitwise-and of a flag with the pte value. If the
> flag to be tested resides in the upper 32 bits of the pte, then we run
> into the danger of the result being dropped if downcast.
> 
> For example:
> 	gather_stats(page, md, pte_dirty(*pte), 1);
> where pte_dirty(*pte) is downcast to an int.
> 
> This patch introduces a new macro pte_isset which performs the bitwise
> and, then performs a double logical invert (where needed) to ensure
> predictable downcasting. The logical inverse pte_isclear is also
> introduced.
> 
> Equivalent pmd functions for Transparent HugePages have also been
> added.
> 
> Signed-off-by: Steve Capper <steve.capper@linaro.org>
> Reviewed-by: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Hou Pengyang <houpengyang@huawei.com>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
[...]

This has only been applied to 3.16 so far, but it appears to be suitable
for every branch from 3.4 onwards as ARM LPAE was introduced in 3.3.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH 3.16.y-ckt 072/168] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE
  2014-12-15 14:25 ` [PATCH 3.16.y-ckt 072/168] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE Luis Henriques
@ 2015-01-12  0:26   ` Ben Hutchings
  0 siblings, 0 replies; 187+ messages in thread
From: Ben Hutchings @ 2015-01-12  0:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Zefan Li, Jiri Slaby
  Cc: linux-kernel, stable, kernel-team, Steve Capper, Russell King,
	Hou Pengyang, Luis Henriques

[-- Attachment #1: Type: text/plain, Size: 2001 bytes --]

On Mon, 2014-12-15 at 14:25 +0000, Luis Henriques wrote:
> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Steven Capper <steve.capper@linaro.org>
> 
> commit ded9477984690d026e46dd75e8157392cea3f13f upstream.
> 
> For LPAE, we have the following means for encoding writable or dirty
> ptes:
>                               L_PTE_DIRTY       L_PTE_RDONLY
>     !pte_dirty && !pte_write        0               1
>     !pte_dirty && pte_write         0               1
>     pte_dirty && !pte_write         1               1
>     pte_dirty && pte_write          1               0
> 
> So we can't distinguish between writeable clean ptes and read only
> ptes. This can cause problems with ptes being incorrectly flagged as
> read only when they are writeable but not dirty.
> 
> This patch renumbers L_PTE_RDONLY from AP[2] to a software bit #58,
> and adds additional logic to set AP[2] whenever the pte is read only
> or not dirty. That way we can distinguish between clean writeable ptes
> and read only ptes.
> 
> HugeTLB pages will use this new logic automatically.
> 
> We need to add some logic to Transparent HugePages to ensure that they
> correctly interpret the revised pgprot permissions (L_PTE_RDONLY has
> moved and no longer matches PMD_SECT_AP2). In the process of revising
> THP, the names of the PMD software bits have been prefixed with L_ to
> make them easier to distinguish from their hardware bit counterparts.
> 
> Signed-off-by: Steve Capper <steve.capper@linaro.org>
> Reviewed-by: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Hou Pengyang <houpengyang@huawei.com>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
[...]

This one also looks suitable for 3.4 onwards, except that THP was not
supported before 3.11.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL
  2015-01-11 22:39   ` Ben Hutchings
@ 2015-01-12 10:09       ` Luis Henriques
  0 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2015-01-12 10:09 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kernel, stable, kernel-team, Robert Jarzmik

On Sun, Jan 11, 2015 at 10:39:08PM +0000, Ben Hutchings wrote:
> On Mon, 2014-12-15 at 14:25 +0000, Luis Henriques wrote:
> > 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Robert Jarzmik <robert.jarzmik@free.fr>
> > 
> > commit cde7fc879969f933614b1256df2625d6ff637bab upstream.
> > 
> > The commit 2111667b4677 ("ARM: pxa: call debug_ll_io_init for
> > earlyprintk") triggers in the current kernel the attached backtrace on
> > PXA/tosa early in the boot time when DEBUG_LL is enabled.
> 
> That was in 3.17-rc1, so I don't think this fix was needed for 3.16.  I
> don't know whether it causes any harm to apply it here.
> 

Thanks Ben.

Robert, do you think this is a problem?  I can revert this patch as
it has already been released in 3.16.7-ckt3.

Cheers,
--
Luís

> Ben.
> 
> > It is due to overlap between uart virtual memory defined in
> > DEBUG_UART_VIRT and mapped by debug_ll_io_init() and peripheral bus
> > mapped by pxa_map_io at the same address, 0xf2100000.
> > 
> > As hinted by Arnd, map early virtual memory for low level debug on
> > address 0xf6200000, even if that means 2 virtual mappings will give
> > access to the pxa internal UARTs (FFUART, BTUART, STUART, ...).
> > 
> > ------------[ cut here ]------------
> > kernel BUG at /home/lumag/linux/mm/vmalloc.c:1143!
> > Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
> > Modules linked in:
> > CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-00032-g8e0d202-dirty #23
> > task: c062a5a8 ti: c0620000 task.ti: c0620000
> > PC is at vm_area_add_early+0x54/0x84
> > LR is at add_static_vm_early+0xc/0x60
> > pc : [<c03e1100>]    lr : [<c03d9ef4>]    psr: 800001d3
> > sp : c0621f04  ip : c03efa74  fp : c03edf84
> > r10: c0637e98  r9 : 40000001  r8 : c03da57c
> > r7 : c3ffcfb0  r6 : 00000000  r5 : c3ffcfb0  r4 : 02000000
> > r3 : c3ffcfd8  r2 : f2100000  r1 : f4000000  r0 : c3ffcfb0
> > Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
> > Control: 00007977  Table: a0004000  DAC: 00000017
> > Process swapper (pid: 0, stack limit = 0xc06201c8)
> > Stack: (0xc0621f04 to 0xc0622000)
> > 1f00:          c3ffcfd8 40000001 c3ffcfd8 c03ee08c c03da570 c03db90c c0637d24
> > 1f20: 00000000 c03ec7cc c066e654 a0700000 000a0700 c03db914 c03db90c c03daf84
> > 1f40: 00000000 000a0000 c0000000 c03ec7cc 000a0700 c0700000 ffff1000 000a3fff
> > 1f60: 00001000 00000007 00000000 c03ec7cc c0008000 c03ed748 c0621fd4 c03d5d18
> > 1f80: 69052d00 a03ec48c 00000000 c03d8ad0 0000006c 00007977 c036c6e8 00000001
> > 1fa0: c0621fd4 c03ed744 c0628000 a0004000 69052d00 a03ec48c 00000000 c03d68d4
> > 1fc0: 00000000 00000000 00000000 00000000 00000000 c03ed748 c0649894 c062801c
> > 1fe0: c03ed744 c062b2f0 a0004000 69052d00 a03ec48c a0008040 00000000 00000000
> > [<c03e1100>] (vm_area_add_early) from [<c03d9ef4>] (add_static_vm_early+0xc/0x60)
> > [<c03d9ef4>] (add_static_vm_early) from [<c03da570>] (iotable_init.part.6+0xa8/0xb4)
> > [<c03da570>] (iotable_init.part.6) from [<c03db914>] (pxa25x_map_io+0x8/0x24)
> > [<c03db914>] (pxa25x_map_io) from [<c03daf84>] (paging_init+0x744/0x8d8)
> > [<c03daf84>] (paging_init) from [<c03d8ad0>] (setup_arch+0x354/0x608)
> > [<c03d8ad0>] (setup_arch) from [<c03d68d4>] (start_kernel+0xa8/0x3dc)
> > [<c03d68d4>] (start_kernel) from [<a0008040>] (0xa0008040)
> > Code: e5904008 e0811004 e1520001 2a000005 (e7f001f2)
> > ---[ end trace f24b6c88ae00fa9a ]---
> > Kernel panic - not syncing: Attempted to kill the idle task!
> > ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
> > 
> > Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> > Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > [ luis: backported to 3.16: adjusted context ]
> > Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> > ---
> >  arch/arm/Kconfig.debug                    | 2 +-
> >  arch/arm/mach-pxa/include/mach/addr-map.h | 5 +++++
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> > index 8f90595069a1..1fdb08427db7 100644
> > --- a/arch/arm/Kconfig.debug
> > +++ b/arch/arm/Kconfig.debug
> > @@ -1118,7 +1118,7 @@ config DEBUG_UART_VIRT
> >  	default 0xf1600000 if ARCH_INTEGRATOR
> >  	default 0xf1c28000 if DEBUG_SUNXI_UART0
> >  	default 0xf1c28400 if DEBUG_SUNXI_UART1
> > -	default 0xf2100000 if DEBUG_PXA_UART1
> > +	default 0xf6200000 if DEBUG_PXA_UART1
> >  	default 0xf4090000 if ARCH_LPC32XX
> >  	default 0xf4200000 if ARCH_GEMINI
> >  	default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
> > diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h
> > index bbf9df37ad4b..d28fe291233a 100644
> > --- a/arch/arm/mach-pxa/include/mach/addr-map.h
> > +++ b/arch/arm/mach-pxa/include/mach/addr-map.h
> > @@ -39,6 +39,11 @@
> >  #define DMEMC_SIZE		0x00100000
> >  
> >  /*
> > + * Reserved space for low level debug virtual addresses within
> > + * 0xf6200000..0xf6201000
> > + */
> > +
> > +/*
> >   * Internal Memory Controller (PXA27x and later)
> >   */
> >  #define IMEMC_PHYS		0x58000000
> 
> -- 
> Ben Hutchings
> One of the nice things about standards is that there are so many of them.

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

* Re: [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL
@ 2015-01-12 10:09       ` Luis Henriques
  0 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2015-01-12 10:09 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-kernel, stable, kernel-team, Robert Jarzmik

On Sun, Jan 11, 2015 at 10:39:08PM +0000, Ben Hutchings wrote:
> On Mon, 2014-12-15 at 14:25 +0000, Luis Henriques wrote:
> > 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Robert Jarzmik <robert.jarzmik@free.fr>
> > 
> > commit cde7fc879969f933614b1256df2625d6ff637bab upstream.
> > 
> > The commit 2111667b4677 ("ARM: pxa: call debug_ll_io_init for
> > earlyprintk") triggers in the current kernel the attached backtrace on
> > PXA/tosa early in the boot time when DEBUG_LL is enabled.
> 
> That was in 3.17-rc1, so I don't think this fix was needed for 3.16.  I
> don't know whether it causes any harm to apply it here.
> 

Thanks Ben.

Robert, do you think this is a problem?  I can revert this patch as
it has already been released in 3.16.7-ckt3.

Cheers,
--
Lu�s

> Ben.
> 
> > It is due to overlap between uart virtual memory defined in
> > DEBUG_UART_VIRT and mapped by debug_ll_io_init() and peripheral bus
> > mapped by pxa_map_io at the same address, 0xf2100000.
> > 
> > As hinted by Arnd, map early virtual memory for low level debug on
> > address 0xf6200000, even if that means 2 virtual mappings will give
> > access to the pxa internal UARTs (FFUART, BTUART, STUART, ...).
> > 
> > ------------[ cut here ]------------
> > kernel BUG at /home/lumag/linux/mm/vmalloc.c:1143!
> > Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
> > Modules linked in:
> > CPU: 0 PID: 0 Comm: swapper Not tainted 3.17.0-00032-g8e0d202-dirty #23
> > task: c062a5a8 ti: c0620000 task.ti: c0620000
> > PC is at vm_area_add_early+0x54/0x84
> > LR is at add_static_vm_early+0xc/0x60
> > pc : [<c03e1100>]    lr : [<c03d9ef4>]    psr: 800001d3
> > sp : c0621f04  ip : c03efa74  fp : c03edf84
> > r10: c0637e98  r9 : 40000001  r8 : c03da57c
> > r7 : c3ffcfb0  r6 : 00000000  r5 : c3ffcfb0  r4 : 02000000
> > r3 : c3ffcfd8  r2 : f2100000  r1 : f4000000  r0 : c3ffcfb0
> > Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
> > Control: 00007977  Table: a0004000  DAC: 00000017
> > Process swapper (pid: 0, stack limit = 0xc06201c8)
> > Stack: (0xc0621f04 to 0xc0622000)
> > 1f00:          c3ffcfd8 40000001 c3ffcfd8 c03ee08c c03da570 c03db90c c0637d24
> > 1f20: 00000000 c03ec7cc c066e654 a0700000 000a0700 c03db914 c03db90c c03daf84
> > 1f40: 00000000 000a0000 c0000000 c03ec7cc 000a0700 c0700000 ffff1000 000a3fff
> > 1f60: 00001000 00000007 00000000 c03ec7cc c0008000 c03ed748 c0621fd4 c03d5d18
> > 1f80: 69052d00 a03ec48c 00000000 c03d8ad0 0000006c 00007977 c036c6e8 00000001
> > 1fa0: c0621fd4 c03ed744 c0628000 a0004000 69052d00 a03ec48c 00000000 c03d68d4
> > 1fc0: 00000000 00000000 00000000 00000000 00000000 c03ed748 c0649894 c062801c
> > 1fe0: c03ed744 c062b2f0 a0004000 69052d00 a03ec48c a0008040 00000000 00000000
> > [<c03e1100>] (vm_area_add_early) from [<c03d9ef4>] (add_static_vm_early+0xc/0x60)
> > [<c03d9ef4>] (add_static_vm_early) from [<c03da570>] (iotable_init.part.6+0xa8/0xb4)
> > [<c03da570>] (iotable_init.part.6) from [<c03db914>] (pxa25x_map_io+0x8/0x24)
> > [<c03db914>] (pxa25x_map_io) from [<c03daf84>] (paging_init+0x744/0x8d8)
> > [<c03daf84>] (paging_init) from [<c03d8ad0>] (setup_arch+0x354/0x608)
> > [<c03d8ad0>] (setup_arch) from [<c03d68d4>] (start_kernel+0xa8/0x3dc)
> > [<c03d68d4>] (start_kernel) from [<a0008040>] (0xa0008040)
> > Code: e5904008 e0811004 e1520001 2a000005 (e7f001f2)
> > ---[ end trace f24b6c88ae00fa9a ]---
> > Kernel panic - not syncing: Attempted to kill the idle task!
> > ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
> > 
> > Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> > Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > [ luis: backported to 3.16: adjusted context ]
> > Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> > ---
> >  arch/arm/Kconfig.debug                    | 2 +-
> >  arch/arm/mach-pxa/include/mach/addr-map.h | 5 +++++
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> > index 8f90595069a1..1fdb08427db7 100644
> > --- a/arch/arm/Kconfig.debug
> > +++ b/arch/arm/Kconfig.debug
> > @@ -1118,7 +1118,7 @@ config DEBUG_UART_VIRT
> >  	default 0xf1600000 if ARCH_INTEGRATOR
> >  	default 0xf1c28000 if DEBUG_SUNXI_UART0
> >  	default 0xf1c28400 if DEBUG_SUNXI_UART1
> > -	default 0xf2100000 if DEBUG_PXA_UART1
> > +	default 0xf6200000 if DEBUG_PXA_UART1
> >  	default 0xf4090000 if ARCH_LPC32XX
> >  	default 0xf4200000 if ARCH_GEMINI
> >  	default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
> > diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h
> > index bbf9df37ad4b..d28fe291233a 100644
> > --- a/arch/arm/mach-pxa/include/mach/addr-map.h
> > +++ b/arch/arm/mach-pxa/include/mach/addr-map.h
> > @@ -39,6 +39,11 @@
> >  #define DMEMC_SIZE		0x00100000
> >  
> >  /*
> > + * Reserved space for low level debug virtual addresses within
> > + * 0xf6200000..0xf6201000
> > + */
> > +
> > +/*
> >   * Internal Memory Controller (PXA27x and later)
> >   */
> >  #define IMEMC_PHYS		0x58000000
> 
> -- 
> Ben Hutchings
> One of the nice things about standards is that there are so many of them.

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

* Re: [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL
  2015-01-12 10:09       ` Luis Henriques
  (?)
@ 2015-01-12 10:56       ` Robert Jarzmik
  2015-01-12 13:02           ` Luis Henriques
  -1 siblings, 1 reply; 187+ messages in thread
From: Robert Jarzmik @ 2015-01-12 10:56 UTC (permalink / raw)
  To: Luis Henriques; +Cc: Ben Hutchings, linux-kernel, stable, kernel-team

Luis Henriques <luis.henriques@canonical.com> writes:

> On Sun, Jan 11, 2015 at 10:39:08PM +0000, Ben Hutchings wrote:
> Thanks Ben.
>
> Robert, do you think this is a problem?  I can revert this patch as
> it has already been released in 3.16.7-ckt3.
Hi Luis,

No, no problem. It'll be an unused kconfig variable, that's all, as
debug_ll_io_init() is not called in v3.16 in pxa_map_io().

Cheers.

--
Robert

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

* Re: [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL
  2015-01-12 10:56       ` Robert Jarzmik
@ 2015-01-12 13:02           ` Luis Henriques
  0 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2015-01-12 13:02 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: Ben Hutchings, linux-kernel, stable, kernel-team

On Mon, Jan 12, 2015 at 11:56:56AM +0100, Robert Jarzmik wrote:
> Luis Henriques <luis.henriques@canonical.com> writes:
> 
> > On Sun, Jan 11, 2015 at 10:39:08PM +0000, Ben Hutchings wrote:
> > Thanks Ben.
> >
> > Robert, do you think this is a problem?  I can revert this patch as
> > it has already been released in 3.16.7-ckt3.
> Hi Luis,
> 
> No, no problem. It'll be an unused kconfig variable, that's all, as
> debug_ll_io_init() is not called in v3.16 in pxa_map_io().
> 

Great, thanks for your feedback.  And since this variable was already
there anyway, I'll just keep this patch in 3.16 instead of reverting
it.

Cheers,
--
Luís

> Cheers.
> 
> --
> Robert

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

* Re: [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL
@ 2015-01-12 13:02           ` Luis Henriques
  0 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2015-01-12 13:02 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: Ben Hutchings, linux-kernel, stable, kernel-team

On Mon, Jan 12, 2015 at 11:56:56AM +0100, Robert Jarzmik wrote:
> Luis Henriques <luis.henriques@canonical.com> writes:
> 
> > On Sun, Jan 11, 2015 at 10:39:08PM +0000, Ben Hutchings wrote:
> > Thanks Ben.
> >
> > Robert, do you think this is a problem?  I can revert this patch as
> > it has already been released in 3.16.7-ckt3.
> Hi Luis,
> 
> No, no problem. It'll be an unused kconfig variable, that's all, as
> debug_ll_io_init() is not called in v3.16 in pxa_map_io().
> 

Great, thanks for your feedback.  And since this variable was already
there anyway, I'll just keep this patch in 3.16 instead of reverting
it.

Cheers,
--
Lu�s

> Cheers.
> 
> --
> Robert

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
  2015-01-11 21:49   ` Ben Hutchings
@ 2015-01-12 17:20       ` Daniel Vetter
  0 siblings, 0 replies; 187+ messages in thread
From: Daniel Vetter @ 2015-01-12 17:20 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Luis Henriques, Chris Wilson, Greg Kroah-Hartman,
	Linux Kernel Mailing List, stable, kernel-team, Nikula, Jani,
	intel-gfx

On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
>> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Chris Wilson <chris@chris-wilson.co.uk>
>>
>> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
>>
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
>
> Should this also be applied to any older stable branches?
>
> i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
> possible for the alloc_apertures() call to fail.
>
> remove_conflicting_framebuffers() has returned an error code since 3.14
> (but could silently fail before then!) so this should be applicable to
> the 3.14 stable branch too.

tbh I don't know why this patch ended up in a stable kernel, at least
I didn't find anything where we (drm/i915 maintainers) marked it as
such. And there's no bugzilla references added either. Imo the patch
doesn't qualify for stable (it's not a real-world bug afaik).
-Daniel

>
> Ben.
>
>> ---
>>  drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
>>  1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
>> index d44344140627..0663fb4fa606 100644
>> --- a/drivers/gpu/drm/i915/i915_dma.c
>> +++ b/drivers/gpu/drm/i915/i915_dma.c
>> @@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
>>  }
>>
>>  #if IS_ENABLED(CONFIG_FB)
>> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>>  {
>>       struct apertures_struct *ap;
>>       struct pci_dev *pdev = dev_priv->dev->pdev;
>>       bool primary;
>> +     int ret;
>>
>>       ap = alloc_apertures(1);
>>       if (!ap)
>> -             return;
>> +             return -ENOMEM;
>>
>>       ap->ranges[0].base = dev_priv->gtt.mappable_base;
>>       ap->ranges[0].size = dev_priv->gtt.mappable_end;
>> @@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>>       primary =
>>               pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
>>
>> -     remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
>> +     ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
>>
>>       kfree(ap);
>> +
>> +     return ret;
>>  }
>>  #else
>> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>>  {
>> +     return 0;
>>  }
>>  #endif
>>
>> @@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>>                       goto out_gtt;
>>               }
>>
>> -             i915_kick_out_firmware_fb(dev_priv);
>> +             ret = i915_kick_out_firmware_fb(dev_priv);
>> +             if (ret) {
>> +                     DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
>> +                     goto out_gtt;
>> +             }
>>       }
>>
>>       pci_set_master(dev->pdev);
>
> --
> Ben Hutchings
> One of the nice things about standards is that there are so many of them.



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
@ 2015-01-12 17:20       ` Daniel Vetter
  0 siblings, 0 replies; 187+ messages in thread
From: Daniel Vetter @ 2015-01-12 17:20 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Luis Henriques, Greg Kroah-Hartman, intel-gfx,
	Linux Kernel Mailing List, stable, kernel-team

On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
>> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Chris Wilson <chris@chris-wilson.co.uk>
>>
>> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
>>
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
>
> Should this also be applied to any older stable branches?
>
> i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
> possible for the alloc_apertures() call to fail.
>
> remove_conflicting_framebuffers() has returned an error code since 3.14
> (but could silently fail before then!) so this should be applicable to
> the 3.14 stable branch too.

tbh I don't know why this patch ended up in a stable kernel, at least
I didn't find anything where we (drm/i915 maintainers) marked it as
such. And there's no bugzilla references added either. Imo the patch
doesn't qualify for stable (it's not a real-world bug afaik).
-Daniel

>
> Ben.
>
>> ---
>>  drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
>>  1 file changed, 13 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
>> index d44344140627..0663fb4fa606 100644
>> --- a/drivers/gpu/drm/i915/i915_dma.c
>> +++ b/drivers/gpu/drm/i915/i915_dma.c
>> @@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
>>  }
>>
>>  #if IS_ENABLED(CONFIG_FB)
>> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>>  {
>>       struct apertures_struct *ap;
>>       struct pci_dev *pdev = dev_priv->dev->pdev;
>>       bool primary;
>> +     int ret;
>>
>>       ap = alloc_apertures(1);
>>       if (!ap)
>> -             return;
>> +             return -ENOMEM;
>>
>>       ap->ranges[0].base = dev_priv->gtt.mappable_base;
>>       ap->ranges[0].size = dev_priv->gtt.mappable_end;
>> @@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>>       primary =
>>               pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
>>
>> -     remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
>> +     ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
>>
>>       kfree(ap);
>> +
>> +     return ret;
>>  }
>>  #else
>> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
>>  {
>> +     return 0;
>>  }
>>  #endif
>>
>> @@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>>                       goto out_gtt;
>>               }
>>
>> -             i915_kick_out_firmware_fb(dev_priv);
>> +             ret = i915_kick_out_firmware_fb(dev_priv);
>> +             if (ret) {
>> +                     DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
>> +                     goto out_gtt;
>> +             }
>>       }
>>
>>       pci_set_master(dev->pdev);
>
> --
> Ben Hutchings
> One of the nice things about standards is that there are so many of them.



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
  2015-01-12 17:20       ` Daniel Vetter
  (?)
@ 2015-01-12 17:28       ` Ben Hutchings
  -1 siblings, 0 replies; 187+ messages in thread
From: Ben Hutchings @ 2015-01-12 17:28 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Luis Henriques, Chris Wilson, Greg Kroah-Hartman,
	Linux Kernel Mailing List, stable, kernel-team, Nikula, Jani,
	intel-gfx

[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]

On Mon, 2015-01-12 at 18:20 +0100, Daniel Vetter wrote:
> On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
> >> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> >>
> >> ------------------
> >>
> >> From: Chris Wilson <chris@chris-wilson.co.uk>
> >>
> >> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
> >>
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> >
> > Should this also be applied to any older stable branches?
> >
> > i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
> > possible for the alloc_apertures() call to fail.
> >
> > remove_conflicting_framebuffers() has returned an error code since 3.14
> > (but could silently fail before then!) so this should be applicable to
> > the 3.14 stable branch too.
> 
> tbh I don't know why this patch ended up in a stable kernel, at least
> I didn't find anything where we (drm/i915 maintainers) marked it as
> such. And there's no bugzilla references added either. Imo the patch
> doesn't qualify for stable (it's not a real-world bug afaik).
[...]

It seems to be a dependency of:

commit 0485c9dc24ec0939b42ca5104c0373297506b555
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Nov 14 10:09:49 2014 +0100

    drm/i915: Kick fbdev before vgacon

which was requested for 3.16+.

So, neither of these is needed for earlier versions.  Sorry for the
noise.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
  2015-01-12 17:20       ` Daniel Vetter
  (?)
@ 2015-01-12 17:43         ` Luis Henriques
  -1 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2015-01-12 17:43 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Ben Hutchings, Chris Wilson, Greg Kroah-Hartman,
	Linux Kernel Mailing List, stable, kernel-team, Nikula, Jani,
	intel-gfx

On Mon, Jan 12, 2015 at 06:20:22PM +0100, Daniel Vetter wrote:
> On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
> >> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> >>
> >> ------------------
> >>
> >> From: Chris Wilson <chris@chris-wilson.co.uk>
> >>
> >> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
> >>
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> >
> > Should this also be applied to any older stable branches?
> >
> > i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
> > possible for the alloc_apertures() call to fail.
> >
> > remove_conflicting_framebuffers() has returned an error code since 3.14
> > (but could silently fail before then!) so this should be applicable to
> > the 3.14 stable branch too.
> 
> tbh I don't know why this patch ended up in a stable kernel, at least
> I didn't find anything where we (drm/i915 maintainers) marked it as
> such. And there's no bugzilla references added either. Imo the patch
> doesn't qualify for stable (it's not a real-world bug afaik).

You're right, this patch was not tagged for stable.

While applying 0485c9dc24ec ("drm/i915: Kick fbdev before vgacon") to
the 3.16 kernel, I found that cherry-picking f96de58fc7e7 would make
it apply cleanly and it didn't shock me to have it in a stable kernel.
That's why I applied it for release 3.16.7-ckt3.  I guess I should
have added a note in the commit text justifying its presence.

Cheers,
--
Luís

> -Daniel
> 
> >
> > Ben.
> >
> >> ---
> >>  drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
> >>  1 file changed, 13 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> >> index d44344140627..0663fb4fa606 100644
> >> --- a/drivers/gpu/drm/i915/i915_dma.c
> >> +++ b/drivers/gpu/drm/i915/i915_dma.c
> >> @@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
> >>  }
> >>
> >>  #if IS_ENABLED(CONFIG_FB)
> >> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>  {
> >>       struct apertures_struct *ap;
> >>       struct pci_dev *pdev = dev_priv->dev->pdev;
> >>       bool primary;
> >> +     int ret;
> >>
> >>       ap = alloc_apertures(1);
> >>       if (!ap)
> >> -             return;
> >> +             return -ENOMEM;
> >>
> >>       ap->ranges[0].base = dev_priv->gtt.mappable_base;
> >>       ap->ranges[0].size = dev_priv->gtt.mappable_end;
> >> @@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>       primary =
> >>               pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
> >>
> >> -     remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> >> +     ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> >>
> >>       kfree(ap);
> >> +
> >> +     return ret;
> >>  }
> >>  #else
> >> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>  {
> >> +     return 0;
> >>  }
> >>  #endif
> >>
> >> @@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> >>                       goto out_gtt;
> >>               }
> >>
> >> -             i915_kick_out_firmware_fb(dev_priv);
> >> +             ret = i915_kick_out_firmware_fb(dev_priv);
> >> +             if (ret) {
> >> +                     DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
> >> +                     goto out_gtt;
> >> +             }
> >>       }
> >>
> >>       pci_set_master(dev->pdev);
> >
> > --
> > Ben Hutchings
> > One of the nice things about standards is that there are so many of them.
> 
> 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
@ 2015-01-12 17:43         ` Luis Henriques
  0 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2015-01-12 17:43 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Ben Hutchings, Chris Wilson, Greg Kroah-Hartman,
	Linux Kernel Mailing List, stable, kernel-team, Nikula, Jani,
	intel-gfx

On Mon, Jan 12, 2015 at 06:20:22PM +0100, Daniel Vetter wrote:
> On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
> >> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> >>
> >> ------------------
> >>
> >> From: Chris Wilson <chris@chris-wilson.co.uk>
> >>
> >> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
> >>
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> >
> > Should this also be applied to any older stable branches?
> >
> > i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
> > possible for the alloc_apertures() call to fail.
> >
> > remove_conflicting_framebuffers() has returned an error code since 3.14
> > (but could silently fail before then!) so this should be applicable to
> > the 3.14 stable branch too.
> 
> tbh I don't know why this patch ended up in a stable kernel, at least
> I didn't find anything where we (drm/i915 maintainers) marked it as
> such. And there's no bugzilla references added either. Imo the patch
> doesn't qualify for stable (it's not a real-world bug afaik).

You're right, this patch was not tagged for stable.

While applying 0485c9dc24ec ("drm/i915: Kick fbdev before vgacon") to
the 3.16 kernel, I found that cherry-picking f96de58fc7e7 would make
it apply cleanly and it didn't shock me to have it in a stable kernel.
That's why I applied it for release 3.16.7-ckt3.  I guess I should
have added a note in the commit text justifying its presence.

Cheers,
--
Lu�s

> -Daniel
> 
> >
> > Ben.
> >
> >> ---
> >>  drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
> >>  1 file changed, 13 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> >> index d44344140627..0663fb4fa606 100644
> >> --- a/drivers/gpu/drm/i915/i915_dma.c
> >> +++ b/drivers/gpu/drm/i915/i915_dma.c
> >> @@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
> >>  }
> >>
> >>  #if IS_ENABLED(CONFIG_FB)
> >> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>  {
> >>       struct apertures_struct *ap;
> >>       struct pci_dev *pdev = dev_priv->dev->pdev;
> >>       bool primary;
> >> +     int ret;
> >>
> >>       ap = alloc_apertures(1);
> >>       if (!ap)
> >> -             return;
> >> +             return -ENOMEM;
> >>
> >>       ap->ranges[0].base = dev_priv->gtt.mappable_base;
> >>       ap->ranges[0].size = dev_priv->gtt.mappable_end;
> >> @@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>       primary =
> >>               pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
> >>
> >> -     remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> >> +     ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> >>
> >>       kfree(ap);
> >> +
> >> +     return ret;
> >>  }
> >>  #else
> >> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>  {
> >> +     return 0;
> >>  }
> >>  #endif
> >>
> >> @@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> >>                       goto out_gtt;
> >>               }
> >>
> >> -             i915_kick_out_firmware_fb(dev_priv);
> >> +             ret = i915_kick_out_firmware_fb(dev_priv);
> >> +             if (ret) {
> >> +                     DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
> >> +                     goto out_gtt;
> >> +             }
> >>       }
> >>
> >>       pci_set_master(dev->pdev);
> >
> > --
> > Ben Hutchings
> > One of the nice things about standards is that there are so many of them.
> 
> 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
@ 2015-01-12 17:43         ` Luis Henriques
  0 siblings, 0 replies; 187+ messages in thread
From: Luis Henriques @ 2015-01-12 17:43 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Greg Kroah-Hartman, intel-gfx, Linux Kernel Mailing List, stable,
	kernel-team, Ben Hutchings

On Mon, Jan 12, 2015 at 06:20:22PM +0100, Daniel Vetter wrote:
> On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
> >> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
> >>
> >> ------------------
> >>
> >> From: Chris Wilson <chris@chris-wilson.co.uk>
> >>
> >> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
> >>
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> >
> > Should this also be applied to any older stable branches?
> >
> > i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
> > possible for the alloc_apertures() call to fail.
> >
> > remove_conflicting_framebuffers() has returned an error code since 3.14
> > (but could silently fail before then!) so this should be applicable to
> > the 3.14 stable branch too.
> 
> tbh I don't know why this patch ended up in a stable kernel, at least
> I didn't find anything where we (drm/i915 maintainers) marked it as
> such. And there's no bugzilla references added either. Imo the patch
> doesn't qualify for stable (it's not a real-world bug afaik).

You're right, this patch was not tagged for stable.

While applying 0485c9dc24ec ("drm/i915: Kick fbdev before vgacon") to
the 3.16 kernel, I found that cherry-picking f96de58fc7e7 would make
it apply cleanly and it didn't shock me to have it in a stable kernel.
That's why I applied it for release 3.16.7-ckt3.  I guess I should
have added a note in the commit text justifying its presence.

Cheers,
--
Luís

> -Daniel
> 
> >
> > Ben.
> >
> >> ---
> >>  drivers/gpu/drm/i915/i915_dma.c | 18 +++++++++++++-----
> >>  1 file changed, 13 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> >> index d44344140627..0663fb4fa606 100644
> >> --- a/drivers/gpu/drm/i915/i915_dma.c
> >> +++ b/drivers/gpu/drm/i915/i915_dma.c
> >> @@ -1425,15 +1425,16 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
> >>  }
> >>
> >>  #if IS_ENABLED(CONFIG_FB)
> >> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>  {
> >>       struct apertures_struct *ap;
> >>       struct pci_dev *pdev = dev_priv->dev->pdev;
> >>       bool primary;
> >> +     int ret;
> >>
> >>       ap = alloc_apertures(1);
> >>       if (!ap)
> >> -             return;
> >> +             return -ENOMEM;
> >>
> >>       ap->ranges[0].base = dev_priv->gtt.mappable_base;
> >>       ap->ranges[0].size = dev_priv->gtt.mappable_end;
> >> @@ -1441,13 +1442,16 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>       primary =
> >>               pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
> >>
> >> -     remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> >> +     ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
> >>
> >>       kfree(ap);
> >> +
> >> +     return ret;
> >>  }
> >>  #else
> >> -static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >> +static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
> >>  {
> >> +     return 0;
> >>  }
> >>  #endif
> >>
> >> @@ -1664,7 +1668,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> >>                       goto out_gtt;
> >>               }
> >>
> >> -             i915_kick_out_firmware_fb(dev_priv);
> >> +             ret = i915_kick_out_firmware_fb(dev_priv);
> >> +             if (ret) {
> >> +                     DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
> >> +                     goto out_gtt;
> >> +             }
> >>       }
> >>
> >>       pci_set_master(dev->pdev);
> >
> > --
> > Ben Hutchings
> > One of the nice things about standards is that there are so many of them.
> 
> 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
  2015-01-12 17:43         ` Luis Henriques
@ 2015-01-12 21:43           ` Daniel Vetter
  -1 siblings, 0 replies; 187+ messages in thread
From: Daniel Vetter @ 2015-01-12 21:43 UTC (permalink / raw)
  To: Luis Henriques
  Cc: Ben Hutchings, Chris Wilson, Greg Kroah-Hartman,
	Linux Kernel Mailing List, stable, kernel-team, Nikula, Jani,
	intel-gfx

On Mon, Jan 12, 2015 at 6:43 PM, Luis Henriques
<luis.henriques@canonical.com> wrote:
> On Mon, Jan 12, 2015 at 06:20:22PM +0100, Daniel Vetter wrote:
>> On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
>> > On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
>> >> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
>> >>
>> >> ------------------
>> >>
>> >> From: Chris Wilson <chris@chris-wilson.co.uk>
>> >>
>> >> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
>> >>
>> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> >> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
>> >
>> > Should this also be applied to any older stable branches?
>> >
>> > i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
>> > possible for the alloc_apertures() call to fail.
>> >
>> > remove_conflicting_framebuffers() has returned an error code since 3.14
>> > (but could silently fail before then!) so this should be applicable to
>> > the 3.14 stable branch too.
>>
>> tbh I don't know why this patch ended up in a stable kernel, at least
>> I didn't find anything where we (drm/i915 maintainers) marked it as
>> such. And there's no bugzilla references added either. Imo the patch
>> doesn't qualify for stable (it's not a real-world bug afaik).
>
> You're right, this patch was not tagged for stable.
>
> While applying 0485c9dc24ec ("drm/i915: Kick fbdev before vgacon") to
> the 3.16 kernel, I found that cherry-picking f96de58fc7e7 would make
> it apply cleanly and it didn't shock me to have it in a stable kernel.
> That's why I applied it for release 3.16.7-ckt3.  I guess I should
> have added a note in the commit text justifying its presence.

Ah makes sense. Usually we try to tag cc: stable patches with their
depencies (and I looked for that but didn't find anything). As a rule
I only scan stable patches from Greg's kernels since there's way too
much going on (and this time around too much vacation and conferences
on top).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver
@ 2015-01-12 21:43           ` Daniel Vetter
  0 siblings, 0 replies; 187+ messages in thread
From: Daniel Vetter @ 2015-01-12 21:43 UTC (permalink / raw)
  To: Luis Henriques
  Cc: Greg Kroah-Hartman, intel-gfx, Linux Kernel Mailing List, stable,
	kernel-team, Ben Hutchings

On Mon, Jan 12, 2015 at 6:43 PM, Luis Henriques
<luis.henriques@canonical.com> wrote:
> On Mon, Jan 12, 2015 at 06:20:22PM +0100, Daniel Vetter wrote:
>> On Sun, Jan 11, 2015 at 10:49 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
>> > On Mon, 2014-12-15 at 14:24 +0000, Luis Henriques wrote:
>> >> 3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me know.
>> >>
>> >> ------------------
>> >>
>> >> From: Chris Wilson <chris@chris-wilson.co.uk>
>> >>
>> >> commit f96de58fc7e7d3d717c7c63975c3b896c906b5e3 upstream.
>> >>
>> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> >> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
>> >
>> > Should this also be applied to any older stable branches?
>> >
>> > i915_kick_out_firmware_fb() was introduced in 3.6 and it has always been
>> > possible for the alloc_apertures() call to fail.
>> >
>> > remove_conflicting_framebuffers() has returned an error code since 3.14
>> > (but could silently fail before then!) so this should be applicable to
>> > the 3.14 stable branch too.
>>
>> tbh I don't know why this patch ended up in a stable kernel, at least
>> I didn't find anything where we (drm/i915 maintainers) marked it as
>> such. And there's no bugzilla references added either. Imo the patch
>> doesn't qualify for stable (it's not a real-world bug afaik).
>
> You're right, this patch was not tagged for stable.
>
> While applying 0485c9dc24ec ("drm/i915: Kick fbdev before vgacon") to
> the 3.16 kernel, I found that cherry-picking f96de58fc7e7 would make
> it apply cleanly and it didn't shock me to have it in a stable kernel.
> That's why I applied it for release 3.16.7-ckt3.  I guess I should
> have added a note in the commit text justifying its presence.

Ah makes sense. Usually we try to tag cc: stable patches with their
depencies (and I looked for that but didn't find anything). As a rule
I only scan stable patches from Greg's kernels since there's way too
much going on (and this time around too much vacation and conferences
on top).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-01-12 21:43 UTC | newest]

Thread overview: 187+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 14:24 [3.16.y-ckt stable] Linux 3.16.7-ckt3 stable review Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 001/168] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 002/168] sparc64: Fix constraints on swab helpers Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 003/168] inetdevice: fixed signed integer overflow Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 004/168] ipv4: Fix incorrect error code when adding an unreachable route Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 005/168] ieee802154: fix error handling in ieee802154fake_probe() Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 006/168] qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 007/168] bonding: fix curr_active_slave/carrier with loadbalance arp monitoring Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 008/168] pptp: fix stack info leak in pptp_getname() Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 009/168] ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 010/168] net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 011/168] net/mlx4_en: Advertize encapsulation offloads features only when VXLAN tunnel is set Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 012/168] target: Don't call TFO->write_pending if data_length == 0 Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 013/168] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 014/168] srp-target: Retry when QP creation fails with ENOMEM Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 015/168] ASoC: fsi: remove unsupported PAUSE flag Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 016/168] ASoC: rsnd: " Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 017/168] ib_isert: Add max_send_sge=2 minimum for control PDU responses Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 018/168] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 019/168] ASoC: dpcm: Fix race between FE/BE updates and trigger Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 020/168] ASoC: samsung: Add MODULE_DEVICE_TABLE for Snow Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 021/168] mac80211: Fix regression that triggers a kernel BUG with CCMP Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 022/168] rt2x00: do not align payload on modern H/W Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 023/168] ath9k: Fix RTC_DERIVED_CLK usage Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 024/168] ASoC: cs42l51: re-hook of_match_table pointer Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 025/168] ASoC: sgtl5000: Fix SMALL_POP bit definition Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 026/168] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 027/168] bitops: Fix shift overflow in GENMASK macros Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 028/168] x86: Require exact match for 'noxsave' command line option Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 029/168] drm/i915: drop WaSetupGtModeTdRowDispatch:snb Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 030/168] drm/i915: Handle failure to kick out a conflicting fb driver Luis Henriques
2015-01-11 21:49   ` Ben Hutchings
2015-01-12 17:20     ` Daniel Vetter
2015-01-12 17:20       ` Daniel Vetter
2015-01-12 17:28       ` Ben Hutchings
2015-01-12 17:43       ` Luis Henriques
2015-01-12 17:43         ` Luis Henriques
2015-01-12 17:43         ` Luis Henriques
2015-01-12 21:43         ` Daniel Vetter
2015-01-12 21:43           ` Daniel Vetter
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 031/168] drm/i915: Kick fbdev before vgacon Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 032/168] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 033/168] can: dev: avoid calling kfree_skb() from interrupt context Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 034/168] can: esd_usb2: fix memory leak on disconnect Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 035/168] x86, mm: Set NX across entire PMD at boot Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 036/168] x86, kaslr: Handle Gold linker for finding bss/brk Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 037/168] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 038/168] of: Fix crash if an earlycon driver is not found Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 039/168] of/base: Fix PowerPC address parsing hack Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 040/168] clockevent: sun4i: Fix race condition in the probe code Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 041/168] MIPS: IP27: Fix __node_distances undefined error Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 042/168] MIPS: oprofile: Fix backtrace on 64-bit kernel Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 043/168] MIPS: asm: uaccess: Add v1 register to clobber list on EVA Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 044/168] MIPS: lib: memcpy: Restore NOP on delay slot before returning to caller Luis Henriques
2014-12-15 14:24 ` [PATCH 3.16.y-ckt 045/168] btrfs: fix lockups from btrfs_clear_path_blocking Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 046/168] PCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 047/168] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 048/168] IB/isert: Adjust CQ size to HW limits Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 049/168] drm/radeon: fix endian swapping in vbios fetch for tdp table Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 050/168] x86_64, traps: Stop using IST for #SS Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 051/168] fold swapping ->d_name.hash into switch_names() Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 052/168] vfs: Don't exchange "short" filenames unconditionally Luis Henriques
2014-12-15 14:25   ` Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 053/168] ARM: pxa: fix hang on startup with DEBUG_LL Luis Henriques
2015-01-11 22:39   ` Ben Hutchings
2015-01-12 10:09     ` Luis Henriques
2015-01-12 10:09       ` Luis Henriques
2015-01-12 10:56       ` Robert Jarzmik
2015-01-12 13:02         ` Luis Henriques
2015-01-12 13:02           ` Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 054/168] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 055/168] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 056/168] arm64/crypto: fix makefile rule for aes-glue-%.o Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 057/168] HID: usbhid: Use flag HID_DISCONNECTED when a usb device is removed Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 058/168] Bluetooth: Add support for Intel bootloader devices Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 059/168] Bluetooth: Handle Intel USB bootloader with buggy interrupt Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 060/168] Bluetooth: Ignore isochronous endpoints for Intel USB bootloader Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 061/168] Bluetooth: Fix endian and alignment issue with ath3k version handling Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 062/168] Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 063/168] Bluetooth: Fix crash in the Marvell driver initialization codepath Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 064/168] Bluetooth: Add support for Acer [13D3:3432] Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 065/168] Add a new PID/VID 0227/0930 for AR3012 Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 066/168] Input: xpad - add VID/PID for Razer Sabertooth Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 067/168] Input: xpad - sync device IDs with xboxdrv Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 068/168] Input: xpad - add USB ID for Thrustmaster Ferrari 458 Racing Wheel Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 069/168] Input: serio - avoid negative serio device numbers Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 070/168] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 071/168] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear Luis Henriques
2015-01-12  0:23   ` [stable] " Ben Hutchings
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 072/168] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE Luis Henriques
2015-01-12  0:26   ` Ben Hutchings
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 073/168] aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 074/168] ARM: mvebu: add missing of_node_put() call in coherency.c Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 075/168] spi: dw: Fix dynamic speed change Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 076/168] USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 077/168] iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 078/168] iio: adc: men_z188_adc: Add terminating entry for men_z188_ids Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 079/168] Input: synaptics - adjust min/max on Thinkpad E540 Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 080/168] spi: Fix mapping from vmalloc-ed buffer to scatter list Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 081/168] clk-divider: Fix READ_ONLY when divider > 1 Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 082/168] spi: sirf: fix word width configuration Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 083/168] usb: serial: ftdi_sio: add PIDs for Matrix Orbital products Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 084/168] USB: keyspan: fix tty line-status reporting Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 085/168] USB: keyspan: fix overrun-error reporting Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 086/168] USB: ssu100: " Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 087/168] nfsd: correctly define v4.2 support attributes Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 088/168] SUNRPC: Fix locking around callback channel reply receive Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 089/168] nfsd: Fix slot wake up race in the nfsv4.1 callback code Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 090/168] bnx2fc: do not add shared skbs to the fcoe_rx_list Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 091/168] scsi: add Intel Multi-Flex to scsi scan blacklist Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 092/168] ARM: 8216/1: xscale: correct auxiliary register in suspend/resume Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 093/168] USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012 Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 094/168] USB: xhci: don't start a halted endpoint before its new dequeue is set Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 095/168] Revert "xhci: clear root port wake on bits if controller isn't wake-up capable" Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 096/168] USB: xhci: Reset a halted endpoint immediately when we encounter a stall Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 097/168] usb: xhci: rework root port wake bits if controller isn't allowed to wakeup Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 098/168] ixgbe: Correctly disable VLAN filter in promiscuous mode Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 099/168] ixgbe: Fix possible null-dereference in error path Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 100/168] ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 101/168] ALSA: hda - Limit 40bit DMA for AMD HDMI controllers Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 102/168] PCI/MSI: Add device flag indicating that 64-bit MSIs don't work Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 103/168] gpu/radeon: Set flag to indicate broken 64-bit MSI Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 104/168] sound/radeon: Move 64-bit MSI quirk from arch to driver Luis Henriques
2014-12-15 14:25 ` [PATCH 3.16.y-ckt 105/168] powerpc/pseries: Honor the generic "no_64bit_msi" flag Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 106/168] MIPS: r4kcache: Add EVA case for protected_writeback_dcache_line Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 107/168] MIPS: cpu-probe: Set the FTLB probability bit on supported cores Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 108/168] MIPS: fix EVA & non-SMP non-FPU FP context signal handling Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 109/168] MIPS: Loongson: Make platform serial setup always built-in Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 110/168] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 111/168] net/ping: handle protocol mismatching scenario Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 112/168] usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000 Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 113/168] Input: xpad - use proper endpoint type Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 114/168] powerpc/pseries: Fix endiannes issue in RTAS call from xmon Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 115/168] powerpc/powernv: Replace OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 116/168] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 117/168] drm/radeon: report disconnected for LVDS/eDP with PX if ddc fails Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 118/168] ARM: 8222/1: mvebu: enable strex backoff delay Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 119/168] ARM: 8226/1: cacheflush: get rid of restarting block Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 120/168] staging: r8188eu: Add new device ID for DLink GO-USB-N150 Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 121/168] btrfs: zero out left over bytes after processing compression streams Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 122/168] uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 123/168] powerpc/powernv: Honor the generic "no_64bit_msi" flag Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 124/168] net: sun4i-emac: fix memory leak on bad packet Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 125/168] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 126/168] x86_64, traps: Rework bad_iret Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 127/168] drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 128/168] [media] smiapp: Only some selection targets are settable Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 129/168] i2c: omap: fix NACK and Arbitration Lost irq handling Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 130/168] [media] s2255drv: fix payload size for JPG, MJPEG Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 131/168] x86: Use $(OBJDUMP) instead of plain objdump Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 132/168] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 133/168] drm/nouveau/gf116: remove copy1 engine Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 134/168] nouveau: move the hotplug ignore to correct place Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 135/168] ALSA: hda/realtek - Add headset Mic support for new Dell machine Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 136/168] drm/i915: More cautious with pch fifo underruns Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 137/168] drm/i915: Unlock panel even when LVDS is disabled Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 138/168] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 139/168] sata_fsl: fix error handling of irq_of_parse_and_map Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 140/168] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 141/168] mm: frontswap: invalidate expired data on a dup-store failure Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 142/168] mm/vmpressure.c: fix race in vmpressure_work_fn() Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 143/168] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 144/168] drivers/input/evdev.c: don't kfree() a vmalloc address Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 145/168] mm: fix swapoff hang after page migration and fork Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 146/168] mm: fix anon_vma_clone() error treatment Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 147/168] slab: fix nodeid bounds check for non-contiguous node IDs Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 148/168] ahci: disable MSI on SAMSUNG 0xa800 SSD Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 149/168] i2c: davinci: generate STP always when NACK is received Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 150/168] i2c: cadence: Set the hardware time-out register to maximum value Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 151/168] drm/radeon: sync all BOs involved in a CS v2 Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 152/168] ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 153/168] ipv6: gre: fix wrong skb->protocol in WCCP Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 154/168] Fix race condition between vxlan_sock_add and vxlan_sock_release Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 155/168] tg3: fix ring init when there are more TX than RX channels Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 156/168] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 157/168] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 158/168] rtnetlink: release net refcnt on error in do_setlink() Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 159/168] gre: Set inner mac header in gro complete Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 160/168] mips: bpf: Fix broken BPF_MOD Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 161/168] net: mvneta: fix Tx interrupt delay Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 162/168] net: mvneta: fix race condition in mvneta_tx() Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 163/168] net: sctp: use MAX_HEADER for headroom reserve in output path Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 164/168] i2c: omap: fix i207 errata handling Luis Henriques
2014-12-15 14:26 ` [PATCH 3.16.y-ckt 165/168] x86/asm/traps: Disable tracing and kprobes in fixup_bad_iret and sync_regs Luis Henriques
2014-12-15 14:27 ` [PATCH 3.16.y-ckt 166/168] USB: add reset resume quirk for usb3503 Luis Henriques
2014-12-15 14:27 ` [PATCH 3.16.y-ckt 167/168] PCI: pciehp: Prevent NULL dereference during probe Luis Henriques
2014-12-15 14:27 ` [PATCH 3.16.y-ckt 168/168] igb: bring link up when PHY is powered up Luis Henriques

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.