stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review
@ 2015-09-30  9:49 Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 001/133] ipv6: addrconf: validate new MTU before applying it Luis Henriques
                   ` (132 more replies)
  0 siblings, 133 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 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-ckt18 stable kernel.

This version contains 133 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/ubuntu/linux.git/log/?h=linux-3.16.y-review

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

The review period for version 3.16.7-ckt18 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

--
 .../ABI/testing/configfs-usb-gadget-loopback       |  2 +-
 .../ABI/testing/configfs-usb-gadget-sourcesink     |  2 +-
 arch/arm/Kconfig                                   |  1 +
 arch/arm/mach-omap2/clockdomains7xx_data.c         |  2 +-
 arch/arm/mach-orion5x/include/mach/irqs.h          | 64 +++++++-------
 arch/arm/mach-orion5x/irq.c                        |  4 +-
 arch/arm64/Kconfig                                 |  4 +
 arch/arm64/kernel/fpsimd.c                         |  1 +
 arch/parisc/kernel/irq.c                           |  8 +-
 arch/parisc/kernel/syscall.S                       |  2 +-
 arch/powerpc/include/asm/pgtable-ppc64.h           | 14 ++-
 arch/powerpc/include/asm/rtas.h                    |  1 +
 arch/powerpc/kernel/rtas.c                         | 17 ++++
 arch/powerpc/platforms/powernv/pci.c               |  5 +-
 arch/powerpc/platforms/pseries/ras.c               |  3 +-
 arch/powerpc/sysdev/fsl_msi.c                      |  5 +-
 arch/powerpc/sysdev/mpic_pasemi_msi.c              |  6 +-
 arch/powerpc/sysdev/mpic_u3msi.c                   |  5 +-
 arch/powerpc/sysdev/ppc4xx_msi.c                   |  5 +-
 arch/x86/crypto/ghash-clmulni-intel_glue.c         |  1 +
 arch/x86/kernel/cpu/mcheck/mce_intel.c             | 41 +++++----
 arch/x86/kvm/mmu.c                                 | 45 ----------
 arch/x86/lib/usercopy.c                            |  2 +-
 arch/x86/mm/init_32.c                              |  1 +
 arch/xtensa/include/asm/traps.h                    | 29 ++++---
 arch/xtensa/kernel/entry.S                         |  7 +-
 block/blk-mq-sysfs.c                               | 25 ++++--
 drivers/acpi/acpi_pnp.c                            |  1 +
 drivers/auxdisplay/ks0108.c                        |  1 +
 drivers/base/devres.c                              |  4 +-
 drivers/base/node.c                                | 10 +++
 drivers/base/platform.c                            |  8 +-
 drivers/clk/samsung/clk-exynos4.c                  |  2 +
 drivers/clk/versatile/clk-sp810.c                  |  4 +-
 drivers/gpu/drm/i915/i915_drv.h                    | 10 +--
 drivers/gpu/drm/i915/i915_gem_execbuffer.c         |  2 +-
 drivers/gpu/drm/qxl/qxl_display.c                  | 66 +++++++++------
 drivers/gpu/drm/qxl/qxl_drv.h                      |  2 +
 drivers/gpu/drm/radeon/atombios_dp.c               |  5 +-
 drivers/gpu/drm/radeon/radeon_combios.c            |  8 ++
 drivers/gpu/drm/radeon/radeon_connectors.c         |  5 ++
 drivers/hid/hid-cp2112.c                           | 10 +--
 drivers/hid/usbhid/hid-core.c                      |  2 +-
 drivers/iio/imu/adis16400_core.c                   |  2 +-
 drivers/iio/imu/adis16480.c                        | 39 +++++++--
 drivers/iio/industrialio-buffer.c                  |  2 +-
 drivers/iio/industrialio-event.c                   |  2 +-
 drivers/infiniband/core/uverbs.h                   |  3 +-
 drivers/infiniband/core/uverbs_cmd.c               | 10 ++-
 drivers/infiniband/core/uverbs_main.c              | 43 +++++++---
 drivers/infiniband/hw/mlx4/ah.c                    |  6 +-
 drivers/infiniband/hw/mlx4/mcg.c                   |  7 +-
 drivers/infiniband/hw/mlx4/sysfs.c                 |  5 +-
 drivers/infiniband/hw/qib/qib_keys.c               |  4 +
 drivers/infiniband/hw/qib/qib_verbs.c              | 14 ++-
 drivers/infiniband/hw/qib/qib_verbs.h              |  2 +
 drivers/input/evdev.c                              | 13 +--
 drivers/input/serio/ambakmi.c                      |  8 +-
 drivers/macintosh/windfarm_core.c                  |  2 +-
 drivers/md/Kconfig                                 |  2 +-
 drivers/md/md.c                                    |  2 +
 drivers/md/raid10.c                                |  5 +-
 drivers/media/platform/omap3isp/isp.c              |  4 +-
 drivers/media/rc/rc-main.c                         |  3 -
 drivers/mmc/core/core.c                            |  6 +-
 drivers/mmc/host/sdhci.c                           |  4 +-
 drivers/mtd/nand/pxa3xx_nand.c                     |  3 +
 drivers/mtd/ubi/block.c                            |  1 +
 drivers/net/ethernet/broadcom/genet/bcmgenet.c     |  2 +-
 drivers/net/ethernet/broadcom/tg3.c                |  2 +-
 drivers/net/ethernet/intel/igb/igb.h               |  1 +
 drivers/net/ethernet/intel/igb/igb_ethtool.c       |  5 +-
 drivers/net/ethernet/intel/igb/igb_main.c          | 16 +++-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  5 +-
 drivers/net/phy/fixed.c                            |  2 +-
 drivers/net/usb/usbnet.c                           |  7 +-
 drivers/net/virtio_net.c                           |  4 +-
 drivers/net/wireless/ath/ath10k/htc.c              |  4 +-
 drivers/net/wireless/ath/ath10k/htt_tx.c           |  8 +-
 drivers/net/wireless/ath/ath10k/pci.c              |  8 +-
 drivers/net/wireless/ath/ath10k/wmi.c              |  1 +
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c        |  1 +
 drivers/of/address.c                               |  6 +-
 drivers/pci/access.c                               | 61 ++++++++++++-
 drivers/pci/quirks.c                               | 18 +++-
 drivers/platform/x86/ideapad-laptop.c              |  7 ++
 drivers/regulator/pbias-regulator.c                |  5 ++
 drivers/rtc/rtc-s5m.c                              | 10 +++
 drivers/scsi/scsi_error.c                          | 11 ++-
 drivers/staging/comedi/drivers/adl_pci7x3x.c       | 16 +++-
 drivers/staging/comedi/drivers/usbduxsigma.c       | 99 ++++++++++------------
 drivers/tty/serial/8250/8250_pci.c                 | 81 +++++++++++++-----
 drivers/tty/serial/8250/8250_pnp.c                 | 11 +++
 drivers/usb/dwc3/ep0.c                             | 12 ++-
 drivers/usb/gadget/m66592-udc.c                    |  2 +-
 drivers/usb/host/ehci-sysfs.c                      |  8 +-
 drivers/usb/serial/ftdi_sio.c                      |  4 +
 drivers/usb/serial/ftdi_sio_ids.h                  |  8 ++
 drivers/usb/serial/qcserial.c                      |  1 +
 drivers/usb/serial/symbolserial.c                  |  6 +-
 fs/btrfs/transaction.c                             |  3 +
 fs/ceph/super.c                                    |  3 +-
 fs/cifs/cifsfs.c                                   |  6 +-
 fs/ecryptfs/dentry.c                               | 16 ++--
 fs/ext4/extents.c                                  | 13 ---
 fs/ext4/super.c                                    |  4 +-
 fs/gfs2/super.c                                    |  6 +-
 fs/hfs/bnode.c                                     |  9 +-
 fs/hfs/brec.c                                      | 20 +++--
 fs/hfs/super.c                                     |  4 +-
 fs/hfsplus/bnode.c                                 |  3 -
 fs/hfsplus/options.c                               |  4 +-
 fs/hostfs/hostfs_kern.c                            |  2 +-
 fs/hpfs/namei.c                                    | 25 +++++-
 fs/libfs.c                                         |  2 +-
 fs/nfs/nfs4proc.c                                  |  3 +-
 fs/nfs/pagelist.c                                  |  4 +-
 fs/ocfs2/super.c                                   |  4 +-
 fs/reiserfs/super.c                                |  8 +-
 fs/xfs/xfs_aops.c                                  |  3 +-
 fs/xfs/xfs_da_format.h                             | 11 ++-
 fs/xfs/xfs_dir2_data.c                             |  3 +-
 fs/xfs/xfs_dir2_node.c                             | 10 ++-
 fs/xfs/xfs_super.c                                 |  4 +-
 include/linux/etherdevice.h                        |  2 +-
 include/linux/iio/iio.h                            | 17 ++++
 include/linux/netlink.h                            | 13 ++-
 include/linux/pci.h                                |  2 +
 include/linux/seq_file.h                           | 35 ++++++++
 kernel/cgroup.c                                    |  5 +-
 kernel/fork.c                                      | 28 +++---
 kernel/sched/core.c                                |  8 ++
 kernel/task_work.c                                 | 12 +--
 mm/vmscan.c                                        |  2 +-
 net/batman-adv/distributed-arp-table.c             |  7 +-
 net/batman-adv/multicast.c                         | 87 ++++++++++++++-----
 net/batman-adv/network-coding.c                    |  7 +-
 net/batman-adv/originator.c                        |  5 ++
 net/batman-adv/soft-interface.c                    |  7 +-
 net/batman-adv/translation-table.c                 |  8 +-
 net/batman-adv/types.h                             | 15 ++--
 net/core/fib_rules.c                               | 14 +--
 net/ipv6/addrconf.c                                | 17 +++-
 net/ipv6/exthdrs_offload.c                         |  2 +-
 net/ipv6/ip6mr.c                                   |  2 +-
 net/mac80211/tx.c                                  |  3 -
 net/netfilter/nfnetlink_queue_core.c               |  5 +-
 net/netlink/af_netlink.c                           | 48 ++++++++---
 net/netlink/af_netlink.h                           |  9 ++
 net/openvswitch/datapath.c                         |  4 +-
 net/openvswitch/flow_table.c                       | 23 ++---
 net/openvswitch/flow_table.h                       |  2 +-
 net/rds/connection.c                               |  6 ++
 net/sctp/protocol.c                                | 64 +++++++++-----
 net/sunrpc/xprtrdma/svc_rdma_sendto.c              | 10 ++-
 security/selinux/hooks.c                           |  2 +-
 sound/pci/hda/patch_realtek.c                      |  6 +-
 sound/soc/codecs/adav80x.c                         |  1 -
 sound/soc/codecs/rt5640.c                          | 40 ++++++++-
 sound/soc/spear/spear_pcm.c                        |  2 +-
 sound/usb/mixer.c                                  |  2 +-
 tools/perf/builtin-stat.c                          |  5 +-
 tools/perf/util/hist.c                             |  3 +
 163 files changed, 1202 insertions(+), 564 deletions(-)

Adam Lee (1):
      serial: 8250_pci: Add support for Pericom PI7C9X795[1248]

Adrien Schildknecht (1):
      rtlwifi: rtl8192cu: Add new device ID

Alexey Brodkin (1):
      stmmac: fix check for phydev being open

Andrey Ryabinin (1):
      crypto: ghash-clmulni: specify context size for ghash async algorithm

Antoine Ténart (1):
      mtd: pxa3xx_nand: add a default chunk size

Ard Biesheuvel (1):
      arm64: flush FP/SIMD state correctly after execve()

Arnaldo Carvalho de Melo (1):
      perf hists: Update the column width for the "srcline" sort key

Axel Lin (2):
      ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config
      ASoC: spear_pcm: Use devm_snd_dmaengine_pcm_register to fix resource leak

Benjamin Cama (1):
      ARM: orion5x: fix legacy orion5x IRQ numbers

Bjorn Helgaas (1):
      PCI: Fix TI816X class code quirk

Bob Copeland (1):
      mac80211: enable assoc check for mesh interfaces

Chris Wilson (2):
      drm/i915: Always mark the object as dirty when used by the GPU
      drm/i915: Limit the number of loops for reading a split 64bit register

Christoph Hellwig (2):
      IB/uverbs: reject invalid or unknown opcodes
      scsi_dh: fix randconfig build error

Chuck Lever (1):
      svcrdma: Fix send_reply() scatter/gather set-up

Cristina Opriceana (2):
      iio: industrialio-buffer: Fix iio_buffer_poll return value
      iio: event: Remove negative error code from iio_event_poll

Dan Carpenter (2):
      clk: versatile: off by one in clk_sp810_timerclken_of_get()
      usb: gadget: m66592-udc: forever loop in set_feature()

Daniel Borkmann (3):
      ipv6: fix exthdrs offload registration in out_rt path
      netlink, mmap: fix edge-case leakages in nf queue zero-copy
      netlink, mmap: transform mmap skb into full skb on taps

Darrick J. Wong (1):
      libxfs: readahead of dir3 data blocks should use the read verifier

David Daney (1):
      of/address: Don't loop forever in of_find_matching_node_by_address().

David Härdeman (1):
      [media] rc-core: fix remove uevent generation

David Jeffery (1):
      xfs: return errors from partial I/O failures to files

David Ward (1):
      USB: qcserial: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module

Don Zickus (1):
      HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error

Ellen Wang (2):
      HID: cp2112: fix I2C_SMBUS_BYTE write
      HID: cp2112: fix byte order in SMBUS operations

Eric Dumazet (1):
      task_work: remove fifo ordering guarantee

Eric W. Biederman (2):
      unshare: Unsharing a thread does not require unsharing a vm
      fs: Set the size of empty dirs to 0.

Eric Whitney (1):
      ext4: fix loss of delalloc extent info in ext4_zero_range()

Eugene Shatokhin (1):
      usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared

Filipe Manana (1):
      Btrfs: check if previous transaction aborted to avoid fs corruption

Florian Fainelli (1):
      net: bcmgenet: Use correct dev_id for free_irq

Grant Likely (1):
      drivercore: Fix unregistration path of platform devices

Hans de Goede (1):
      ideapad-laptop: Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list

Helge Deller (1):
      parisc: Filter out spurious interrupts in PA-RISC irq handler

Hin-Tak Leung (2):
      hfs,hfsplus: cache pages correctly between bnode_create and bnode_free
      hfs: fix B-tree corruption after insertion at position 0

Ian Abbott (3):
      staging: comedi: usbduxsigma: don't clobber ai_timer in command test
      staging: comedi: usbduxsigma: don't clobber ao_timer in command test
      staging: comedi: adl_pci7x3x: fix digital output on PCI-7230

Jack Morgenstein (2):
      IB/mlx4: Fix potential deadlock when sending mad to wire
      IB/mlx4: Forbid using sysfs to change RoCE pkeys

Jaewon Kim (1):
      vmscan: fix increasing nr_isolated incurred by putback unevictable pages

Jan H. Schönherr (1):
      sched: Fix cpu_active_mask/cpu_online_mask race

Jan Kara (2):
      xfs: Fix xfs_attr_leafblock definition
      xfs: Fix file type directory corruption for btree directories

Jason Wang (1):
      virtio-net: drop NETIF_F_FRAGLIST

Jean Delvare (1):
      tg3: Fix temperature reporting

Jeff Vander Stoep (1):
      arm64: kconfig: Move LIST_POISON to a safe value

Jeffery Miller (1):
      Add radeon suspend/resume quirk for HP Compaq dc5750.

Jesse Brandeburg (1):
      net: fix endian check warning in etherdevice.h

Jesse Gross (1):
      openvswitch: Zero flows on allocation.

Jialing Fu (1):
      mmc: core: fix race condition in mmc_wait_data_done

Jisheng Zhang (1):
      mmc: sdhci: also get preset value and driver type for MMC_DDR52

John David Anglin (1):
      parisc: Use double word condition in 64bit CAS operation

John Lin (1):
      ASoC: rt5640: fix line out no sound issue

Jonathon Jongsma (1):
      drm/qxl: validate monitors config modes

Joonyoung Shim (1):
      rtc: s5m: fix to update ctrl register

Kan Liang (1):
      perf stat: Get correct cpu id for print_aggr

Kees Cook (1):
      fs: create and use seq_show_option for escaping

Kevin Cernekee (1):
      UBI: block: Add missing cache flushes

Kinglong Mee (1):
      NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client

Kishon Vijay Abraham I (2):
      usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes
      regulator: pbias: Fix broken pbias disable functionality

Krzysztof Kozlowski (1):
      clk: exynos4: Fix wrong clock for Exynos4x12 ADC

Lars-Peter Clausen (3):
      iio: adis16400: Fix adis16448 gyroscope scale
      iio: Add inverse unit conversion macros
      iio: adis16480: Fix scale factors

Linus Lüssing (8):
      batman-adv: Make DAT capability changes atomic
      batman-adv: Make NC capability changes atomic
      batman-adv: Make TT capability changes atomic
      batman-adv: fix multicast counter when purging originators
      batman-adv: fix counter for multicast supporting nodes
      batman-adv: Make MCAST capability changes atomic
      batman-adv: Fix potential synchronization issues in mcast tvlv handler
      batman-adv: Fix potentially broken skb network header access

Maciej S. Szmigiero (2):
      serial: 8250: don't bind to SMSC IrCC IR port
      serial: 8250: bind to ALi Fast Infrared Controller (ALI5123)

Marcelo Leitner (1):
      ipv6: addrconf: validate new MTU before applying it

Marcelo Ricardo Leitner (1):
      sctp: fix race on protocol/netns initialization

Mark Rustad (2):
      PCI: Add dev_flags bit to access VPD through function 0
      PCI: Add VPD function 0 quirk for Intel Ethernet devices

Masahiro Yamada (1):
      devres: fix devres_get()

Matthijs Kooijman (1):
      USB: ftdi_sio: Added custom PID for CustomWare products

Max Filippov (2):
      xtensa: fix threadptr reload on return to userspace
      xtensa: fix kernel register spilling

Michael Ellerman (1):
      powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash

Michal Hocko (1):
      scsi: fix scsi_error_handler vs. scsi_host_dev_release race

Michal Kazior (1):
      ath10k: fix dma_mapping_error() handling

Mike Marciniszyn (1):
      IB/qib: Change lkey table allocation to support more MRs

Mikulas Patocka (1):
      hpfs: update ctime and mtime on directory modification

Minfei Huang (1):
      x86/mm: Initialize pmd_idx in page_table_range_init_count()

Ming Lei (1):
      blk-mq: fix buffer overflow when reading sysfs file of 'pending'

NeilBrown (3):
      NFSv4: don't set SETATTR for O_RDONLY|O_EXCL
      md: flush ->event_work before stopping array.
      md/raid10: always set reshape_safe when initializing reshape_position.

Noa Osherovich (1):
      IB/mlx4: Use correct SL on AH query under RoCE

Paul Bolle (1):
      windfarm: decrement client count when unregistering

Paul Mackerras (1):
      powerpc/MSI: Fix race condition in tearing down MSI interrupts

Peter Chen (3):
      Doc: ABI: testing: configfs-usb-gadget-loopback
      Doc: ABI: testing: configfs-usb-gadget-sourcesink
      usb: host: ehci-sys: delete useless bus_to_hcd conversion

Philipp Hachtmann (1):
      USB: symbolserial: Use usb_get_serial_port_data

Richard Laing (1):
      net/ipv6: Correct PIM6 mrt_lock handling

Sakari Ailus (1):
      [media] v4l: omap3isp: Fix sub-device power management code

Sasha Levin (1):
      RDS: verify the underlying transport exists before creating a connection

Sergei Shtylyov (1):
      fixed_phy: pass 'irq' to fixed_phy_add()

Shota Suzuki (1):
      igb: Fix oops caused by missing queue pairing

Stephen Chandler Paul (1):
      DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd

Sudip Mukherjee (1):
      auxdisplay: ks0108: fix refcount

Takashi Iwai (3):
      Input: evdev - do not report errors form flush()
      ALSA: hda - Enable headphone jack detect on old Fujitsu laptops
      ALSA: hda - Use ALC880_FIXUP_FUJITSU for FSC Amilo M1437

Thomas Huth (1):
      powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers

Trond Myklebust (1):
      NFS: nfs_set_pgio_error sometimes misses errors

Tyler Hicks (1):
      eCryptfs: Invalidate dcache entries when lower i_nlink is zero

Ulf Hansson (1):
      Input: ambakmi - fix system PM by converting to modern callbacks

Vignesh R (1):
      ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP

Ville Syrjälä (1):
      drm/radeon/atom: Send out the full AUX address

Wilson Kok (1):
      fib_rules: fix fib rule dumps across multiple skbs

Xiao Guangrong (1):
      KVM: MMU: fix validation of mmio page fault

Xie XiuQi (1):
      x86/mce: Reenable CMCI banks when swiching back to interrupt mode

Yann Droneaud (1):
      perf/x86: Fix copy_from_user_nmi() return if range is not ok

Yao-Wen Mao (1):
      ALSA: usb-audio: correct the value cache check.

Yinghai Lu (1):
      mm: check if section present during memory block registering

Yishai Hadas (1):
      IB/uverbs: Fix race between ib_uverbs_open and remove_one

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

* [PATCH 3.16.y-ckt 001/133] ipv6: addrconf: validate new MTU before applying it
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 002/133] virtio-net: drop NETIF_F_FRAGLIST Luis Henriques
                   ` (131 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcelo Ricardo Leitner, Sabrina Dubroca, David S. Miller,
	Moritz Muehlenhoff, Luis Henriques

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

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

From: Marcelo Leitner <mleitner@redhat.com>

commit 77751427a1ff25b27d47a4c36b12c3c8667855ac upstream.

Currently we don't check if the new MTU is valid or not and this allows
one to configure a smaller than minimum allowed by RFCs or even bigger
than interface own MTU, which is a problem as it may lead to packet
drops.

If you have a daemon like NetworkManager running, this may be exploited
by remote attackers by forging RA packets with an invalid MTU, possibly
leading to a DoS. (NetworkManager currently only validates for values
too small, but not for too big ones.)

The fix is just to make sure the new value is valid. That is, between
IPV6_MIN_MTU and interface's MTU.

Note that similar check is already performed at
ndisc_router_discovery(), for when kernel itself parses the RA.

Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv6/addrconf.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4a9a34954923..75630e173adf 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4789,6 +4789,21 @@ int addrconf_sysctl_forward(struct ctl_table *ctl, int write,
 	return ret;
 }
 
+static
+int addrconf_sysctl_mtu(struct ctl_table *ctl, int write,
+			void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+	struct inet6_dev *idev = ctl->extra1;
+	int min_mtu = IPV6_MIN_MTU;
+	struct ctl_table lctl;
+
+	lctl = *ctl;
+	lctl.extra1 = &min_mtu;
+	lctl.extra2 = idev ? &idev->dev->mtu : NULL;
+
+	return proc_dointvec_minmax(&lctl, write, buffer, lenp, ppos);
+}
+
 static void dev_disable_change(struct inet6_dev *idev)
 {
 	struct netdev_notifier_info info;
@@ -4940,7 +4955,7 @@ static struct addrconf_sysctl_table
 			.data		= &ipv6_devconf.mtu6,
 			.maxlen		= sizeof(int),
 			.mode		= 0644,
-			.proc_handler	= proc_dointvec,
+			.proc_handler	= addrconf_sysctl_mtu,
 		},
 		{
 			.procname	= "accept_ra",

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

* [PATCH 3.16.y-ckt 002/133] virtio-net: drop NETIF_F_FRAGLIST
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 001/133] ipv6: addrconf: validate new MTU before applying it Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 003/133] [media] v4l: omap3isp: Fix sub-device power management code Luis Henriques
                   ` (130 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michael S. Tsirkin, Jason Wang, David S. Miller,
	Moritz Muehlenhoff, Luis Henriques

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

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

From: Jason Wang <jasowang@redhat.com>

commit 48900cb6af4282fa0fb6ff4d72a81aa3dadb5c39 upstream.

virtio declares support for NETIF_F_FRAGLIST, but assumes
that there are at most MAX_SKB_FRAGS + 2 fragments which isn't
always true with a fraglist.

A longer fraglist in the skb will make the call to skb_to_sgvec overflow
the sg array, leading to memory corruption.

Drop NETIF_F_FRAGLIST so we only get what we can handle.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 7d9f84a91f37..0ef4ee7289b4 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1652,9 +1652,9 @@ static int virtnet_probe(struct virtio_device *vdev)
 	/* Do we support "hardware" checksums? */
 	if (virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) {
 		/* This opens up the world of extra features. */
-		dev->hw_features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;
+		dev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_SG;
 		if (csum)
-			dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;
+			dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
 
 		if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) {
 			dev->hw_features |= NETIF_F_TSO | NETIF_F_UFO

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

* [PATCH 3.16.y-ckt 003/133] [media] v4l: omap3isp: Fix sub-device power management code
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 001/133] ipv6: addrconf: validate new MTU before applying it Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 002/133] virtio-net: drop NETIF_F_FRAGLIST Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 004/133] [media] rc-core: fix remove uevent generation Luis Henriques
                   ` (129 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sakari Ailus, Laurent Pinchart, Mauro Carvalho Chehab,
	Luis Henriques

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

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

From: Sakari Ailus <sakari.ailus@iki.fi>

commit 9d39f05490115bf145e5ea03c0b7ec9d3d015b01 upstream.

Commit 813f5c0ac5cc ("media: Change media device link_notify behaviour")
modified the media controller link setup notification API and updated the
OMAP3 ISP driver accordingly. As a side effect it introduced a bug by
turning power on after setting the link instead of before. This results in
sub-devices not being powered down in some cases when they should be. Fix
it.

Fixes: 813f5c0ac5cc [media] media: Change media device link_notify behaviour

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/media/platform/omap3isp/isp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 2c7aa6720569..1cc8e219298d 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -823,14 +823,14 @@ static int isp_pipeline_link_notify(struct media_link *link, u32 flags,
 	int ret;
 
 	if (notification == MEDIA_DEV_NOTIFY_POST_LINK_CH &&
-	    !(link->flags & MEDIA_LNK_FL_ENABLED)) {
+	    !(flags & MEDIA_LNK_FL_ENABLED)) {
 		/* Powering off entities is assumed to never fail. */
 		isp_pipeline_pm_power(source, -sink_use);
 		isp_pipeline_pm_power(sink, -source_use);
 		return 0;
 	}
 
-	if (notification == MEDIA_DEV_NOTIFY_POST_LINK_CH &&
+	if (notification == MEDIA_DEV_NOTIFY_PRE_LINK_CH &&
 		(flags & MEDIA_LNK_FL_ENABLED)) {
 
 		ret = isp_pipeline_pm_power(source, sink_use);

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

* [PATCH 3.16.y-ckt 004/133] [media] rc-core: fix remove uevent generation
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (2 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 003/133] [media] v4l: omap3isp: Fix sub-device power management code Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 005/133] HID: cp2112: fix I2C_SMBUS_BYTE write Luis Henriques
                   ` (128 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Härdeman, Mauro Carvalho Chehab, Luis Henriques

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

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

From: =?UTF-8?q?David=20H=C3=A4rdeman?= <david@hardeman.nu>

commit a66b0c41ad277ae62a3ae6ac430a71882f899557 upstream.

The input_dev is already gone when the rc device is being unregistered
so checking for its presence only means that no remove uevent will be
generated.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/media/rc/rc-main.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 970b93d6f399..af56ea915bad 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1162,9 +1162,6 @@ static int rc_dev_uevent(struct device *device, struct kobj_uevent_env *env)
 {
 	struct rc_dev *dev = to_rc_dev(device);
 
-	if (!dev || !dev->input_dev)
-		return -ENODEV;
-
 	if (dev->rc_map.name)
 		ADD_HOTPLUG_VAR("NAME=%s", dev->rc_map.name);
 	if (dev->driver_name)

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

* [PATCH 3.16.y-ckt 005/133] HID: cp2112: fix I2C_SMBUS_BYTE write
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (3 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 004/133] [media] rc-core: fix remove uevent generation Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 006/133] HID: cp2112: fix byte order in SMBUS operations Luis Henriques
                   ` (127 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ellen Wang, Jiri Kosina, Luis Henriques

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

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

From: Ellen Wang <ellen@cumulusnetworks.com>

commit 6d00d153f00097d259f86304e11858a50a1b8ad1 upstream.

When doing an I2C_SMBUS_BYTE write (one byte write, no address),
the data to be written is in "command" not "data->byte".

Signed-off-by: Ellen Wang <ellen@cumulusnetworks.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-cp2112.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index ffe69be882de..68d6d93cbec9 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -451,7 +451,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
 		if (I2C_SMBUS_READ == read_write)
 			count = cp2112_read_req(buf, addr, read_length);
 		else
-			count = cp2112_write_req(buf, addr, data->byte, NULL,
+			count = cp2112_write_req(buf, addr, command, NULL,
 						 0);
 		break;
 	case I2C_SMBUS_BYTE_DATA:

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

* [PATCH 3.16.y-ckt 006/133] HID: cp2112: fix byte order in SMBUS operations
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (4 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 005/133] HID: cp2112: fix I2C_SMBUS_BYTE write Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 007/133] xtensa: fix threadptr reload on return to userspace Luis Henriques
                   ` (126 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ellen Wang, Jiri Kosina, Luis Henriques

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

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

From: Ellen Wang <ellen@cumulusnetworks.com>

commit 29e2d6d1f6f61ba2b5cc9d9867e01d8c31a6c4f7 upstream.

Change all occurrences of be16 to le16 in cp2112_xfer(),
because SMBUS words are little endian, not big endian.

Signed-off-by: Ellen Wang <ellen@cumulusnetworks.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-cp2112.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 68d6d93cbec9..bc37acd0fc67 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -434,7 +434,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
 	struct cp2112_device *dev = (struct cp2112_device *)adap->algo_data;
 	struct hid_device *hdev = dev->hdev;
 	u8 buf[64];
-	__be16 word;
+	__le16 word;
 	ssize_t count;
 	size_t read_length = 0;
 	unsigned int retries;
@@ -466,7 +466,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
 		break;
 	case I2C_SMBUS_WORD_DATA:
 		read_length = 2;
-		word = cpu_to_be16(data->word);
+		word = cpu_to_le16(data->word);
 
 		if (I2C_SMBUS_READ == read_write)
 			count = cp2112_write_read_req(buf, addr, read_length,
@@ -479,7 +479,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
 		size = I2C_SMBUS_WORD_DATA;
 		read_write = I2C_SMBUS_READ;
 		read_length = 2;
-		word = cpu_to_be16(data->word);
+		word = cpu_to_le16(data->word);
 
 		count = cp2112_write_read_req(buf, addr, read_length, command,
 					      (u8 *)&word, 2);
@@ -572,7 +572,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
 		data->byte = buf[0];
 		break;
 	case I2C_SMBUS_WORD_DATA:
-		data->word = be16_to_cpup((__be16 *)buf);
+		data->word = le16_to_cpup((__le16 *)buf);
 		break;
 	case I2C_SMBUS_BLOCK_DATA:
 		if (read_length > I2C_SMBUS_BLOCK_MAX) {

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

* [PATCH 3.16.y-ckt 007/133] xtensa: fix threadptr reload on return to userspace
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (5 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 006/133] HID: cp2112: fix byte order in SMBUS operations Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 008/133] ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP Luis Henriques
                   ` (125 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Max Filippov, Luis Henriques

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

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

From: Max Filippov <jcmvbkbc@gmail.com>

commit 4229fb12a03e5da5882b420b0aa4a02e77447b86 upstream.

Userspace return code may skip restoring THREADPTR register if there are
no registers that need to be zeroed. This leads to spurious failures in
libc NPTL tests.

Always restore THREADPTR on return to userspace.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/xtensa/kernel/entry.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index a06b7efaae82..8a749f02d8d6 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -568,12 +568,13 @@ user_exception_exit:
 	 *	 (if we have restored WSBITS-1 frames).
 	 */
 
+2:
 #if XCHAL_HAVE_THREADPTR
 	l32i	a3, a1, PT_THREADPTR
 	wur	a3, threadptr
 #endif
 
-2:	j	common_exception_exit
+	j	common_exception_exit
 
 	/* This is the kernel exception exit.
 	 * We avoided to do a MOVSP when we entered the exception, but we

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

* [PATCH 3.16.y-ckt 008/133] ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (6 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 007/133] xtensa: fix threadptr reload on return to userspace Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 009/133] mac80211: enable assoc check for mesh interfaces Luis Henriques
                   ` (124 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vignesh R, Paul Walmsley, Luis Henriques

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

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

From: Vignesh R <vigneshr@ti.com>

commit b9e23f321940d2db2c9def8ff723b8464fb86343 upstream.

Legacy IPs like PWMSS, present under l4per2_7xx_clkdm, cannot support
smart-idle when its clock domain is in HW_AUTO on DRA7 SoCs. Hence,
program clock domain to SW_WKUP.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Reviewed-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-omap2/clockdomains7xx_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/clockdomains7xx_data.c b/arch/arm/mach-omap2/clockdomains7xx_data.c
index 57d5df0c1fbd..7581e036bda6 100644
--- a/arch/arm/mach-omap2/clockdomains7xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains7xx_data.c
@@ -331,7 +331,7 @@ static struct clockdomain l4per2_7xx_clkdm = {
 	.dep_bit	  = DRA7XX_L4PER2_STATDEP_SHIFT,
 	.wkdep_srcs	  = l4per2_wkup_sleep_deps,
 	.sleepdep_srcs	  = l4per2_wkup_sleep_deps,
-	.flags		  = CLKDM_CAN_HWSUP_SWSUP,
+	.flags		  = CLKDM_CAN_SWSUP,
 };
 
 static struct clockdomain mpu0_7xx_clkdm = {

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

* [PATCH 3.16.y-ckt 009/133] mac80211: enable assoc check for mesh interfaces
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (7 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 008/133] ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 010/133] PCI: Add dev_flags bit to access VPD through function 0 Luis Henriques
                   ` (123 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bob Copeland, Johannes Berg, Luis Henriques

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

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

From: Bob Copeland <me@bobcopeland.com>

commit 3633ebebab2bbe88124388b7620442315c968e8f upstream.

We already set a station to be associated when peering completes, both
in user space and in the kernel.  Thus we should always have an
associated sta before sending data frames to that station.

Failure to check assoc state can cause crashes in the lower-level driver
due to transmitting unicast data frames before driver sta structures
(e.g. ampdu state in ath9k) are initialized.  This occurred when
forwarding in the presence of fixed mesh paths: frames were transmitted
to stations with whom we hadn't yet completed peering.

Reported-by: Alexis Green <agreen@cococorp.com>
Tested-by: Jesse Jones <jjones@cococorp.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/mac80211/tx.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f0fda4e1dc0d..c344e0bc00b7 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -297,9 +297,6 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
 	if (tx->sdata->vif.type == NL80211_IFTYPE_WDS)
 		return TX_CONTINUE;
 
-	if (tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
-		return TX_CONTINUE;
-
 	if (tx->flags & IEEE80211_TX_PS_BUFFERED)
 		return TX_CONTINUE;
 

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

* [PATCH 3.16.y-ckt 010/133] PCI: Add dev_flags bit to access VPD through function 0
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (8 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 009/133] mac80211: enable assoc check for mesh interfaces Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 011/133] PCI: Add VPD function 0 quirk for Intel Ethernet devices Luis Henriques
                   ` (122 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Rustad, Bjorn Helgaas, Luis Henriques

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

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

From: Mark Rustad <mark.d.rustad@intel.com>

commit 932c435caba8a2ce473a91753bad0173269ef334 upstream.

Add a dev_flags bit, PCI_DEV_FLAGS_VPD_REF_F0, to access VPD through
function 0 to provide VPD access on other functions.  This is for hardware
devices that provide copies of the same VPD capability registers in
multiple functions.  Because the kernel expects that each function has its
own registers, both the locking and the state tracking are affected by VPD
accesses to different functions.

On such devices for example, if a VPD write is performed on function 0,
*any* later attempt to read VPD from any other function of that device will
hang.  This has to do with how the kernel tracks the expected value of the
F bit per function.

Concurrent accesses to different functions of the same device can not only
hang but also corrupt both read and write VPD data.

When hangs occur, typically the error message:

  vpd r/w failed.  This is likely a firmware bug on this device.

will be seen.

Never set this bit on function 0 or there will be an infinite recursion.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/pci/access.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/pci.h  |  2 ++
 2 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index d292d7cb3417..cf4733b05db2 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -352,6 +352,56 @@ static const struct pci_vpd_ops pci_vpd_pci22_ops = {
 	.release = pci_vpd_pci22_release,
 };
 
+static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count,
+			       void *arg)
+{
+	struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
+	ssize_t ret;
+
+	if (!tdev)
+		return -ENODEV;
+
+	ret = pci_read_vpd(tdev, pos, count, arg);
+	pci_dev_put(tdev);
+	return ret;
+}
+
+static ssize_t pci_vpd_f0_write(struct pci_dev *dev, loff_t pos, size_t count,
+				const void *arg)
+{
+	struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
+	ssize_t ret;
+
+	if (!tdev)
+		return -ENODEV;
+
+	ret = pci_write_vpd(tdev, pos, count, arg);
+	pci_dev_put(tdev);
+	return ret;
+}
+
+static const struct pci_vpd_ops pci_vpd_f0_ops = {
+	.read = pci_vpd_f0_read,
+	.write = pci_vpd_f0_write,
+	.release = pci_vpd_pci22_release,
+};
+
+static int pci_vpd_f0_dev_check(struct pci_dev *dev)
+{
+	struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
+	int ret = 0;
+
+	if (!tdev)
+		return -ENODEV;
+	if (!tdev->vpd || !tdev->multifunction ||
+	    dev->class != tdev->class || dev->vendor != tdev->vendor ||
+	    dev->device != tdev->device)
+		ret = -ENODEV;
+
+	pci_dev_put(tdev);
+	return ret;
+}
+
 int pci_vpd_pci22_init(struct pci_dev *dev)
 {
 	struct pci_vpd_pci22 *vpd;
@@ -360,12 +410,21 @@ int pci_vpd_pci22_init(struct pci_dev *dev)
 	cap = pci_find_capability(dev, PCI_CAP_ID_VPD);
 	if (!cap)
 		return -ENODEV;
+	if (dev->dev_flags & PCI_DEV_FLAGS_VPD_REF_F0) {
+		int ret = pci_vpd_f0_dev_check(dev);
+
+		if (ret)
+			return ret;
+	}
 	vpd = kzalloc(sizeof(*vpd), GFP_ATOMIC);
 	if (!vpd)
 		return -ENOMEM;
 
 	vpd->base.len = PCI_VPD_PCI22_SIZE;
-	vpd->base.ops = &pci_vpd_pci22_ops;
+	if (dev->dev_flags & PCI_DEV_FLAGS_VPD_REF_F0)
+		vpd->base.ops = &pci_vpd_f0_ops;
+	else
+		vpd->base.ops = &pci_vpd_pci22_ops;
 	mutex_init(&vpd->lock);
 	vpd->cap = cap;
 	vpd->busy = false;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 7641001e65cf..260fb331cfdd 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -177,6 +177,8 @@ enum pci_dev_flags {
 	PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5),
 	/* Do not use bus resets for device */
 	PCI_DEV_FLAGS_NO_BUS_RESET = (__force pci_dev_flags_t) (1 << 6),
+	/* Get VPD from function 0 VPD */
+	PCI_DEV_FLAGS_VPD_REF_F0 = (__force pci_dev_flags_t) (1 << 8),
 };
 
 enum pci_irq_reroute_variant {

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

* [PATCH 3.16.y-ckt 011/133] PCI: Add VPD function 0 quirk for Intel Ethernet devices
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (9 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 010/133] PCI: Add dev_flags bit to access VPD through function 0 Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 012/133] staging: comedi: usbduxsigma: don't clobber ai_timer in command test Luis Henriques
                   ` (121 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Rustad, Bjorn Helgaas, Luis Henriques

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

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

From: Mark Rustad <mark.d.rustad@intel.com>

commit 7aa6ca4d39edf01f997b9e02cf6d2fdeb224f351 upstream.

Set the PCI_DEV_FLAGS_VPD_REF_F0 flag on all Intel Ethernet device
functions other than function 0, so that on multi-function devices, we will
always read VPD from function 0 instead of from the other functions.

[bhelgaas: changelog]
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/pci/quirks.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 6948f2379e16..91181b5ff437 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1883,6 +1883,15 @@ static void quirk_netmos(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID,
 			 PCI_CLASS_COMMUNICATION_SERIAL, 8, quirk_netmos);
 
+static void quirk_f0_vpd_link(struct pci_dev *dev)
+{
+	if (!dev->multifunction || !PCI_FUNC(dev->devfn))
+		return;
+	dev->dev_flags |= PCI_DEV_FLAGS_VPD_REF_F0;
+}
+DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
+			      PCI_CLASS_NETWORK_ETHERNET, 8, quirk_f0_vpd_link);
+
 static void quirk_e100_interrupt(struct pci_dev *dev)
 {
 	u16 command, pmcsr;

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

* [PATCH 3.16.y-ckt 012/133] staging: comedi: usbduxsigma: don't clobber ai_timer in command test
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (10 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 011/133] PCI: Add VPD function 0 quirk for Intel Ethernet devices Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 013/133] staging: comedi: usbduxsigma: don't clobber ao_timer " Luis Henriques
                   ` (120 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ian Abbott, Luis Henriques

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

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

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

commit 423b24c37dd5794a674c74b0ed56392003a69891 upstream.

`devpriv->ai_timer` is used while an asynchronous command is running on
the AI subdevice.  It also gets modified by the subdevice's `cmdtest`
handler for checking new asynchronous commands
(`usbduxsigma_ai_cmdtest()`), which is not correct as it's allowed to
check new commands while an old command is still running.  Fix it by
moving the code which sets up `devpriv->ai_timer` and
`devpriv->ai_interval` into the subdevice's `cmd` handler,
`usbduxsigma_ai_cmd()`.

** This backported patch also moves the code that sets up
`devpriv->ai_sample_count` from `usbduxsigma_ai_cmdtest()` to
`usbduxsigma_ai_cmd()` for the same reason as above. (This was not
needed in the upstream commit.) **

Note that the removed code in `usbduxsigma_ai_cmdtest()` checked that
`devpriv->ai_timer` did not end up less than than 1, but that could not
happen because `cmd->scan_begin_arg` had already been checked to be at
least the minimum required value (at least when `cmd->scan_begin_src ==
TRIG_TIMER`, which had also been checked to be the case).

Fixes: b986be8527c7 ("staging: comedi: usbduxsigma: tidy up analog input command support)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/comedi/drivers/usbduxsigma.c | 53 +++++++++++++---------------
 1 file changed, 24 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index ccc3ef7ba55c..e2c0c54e0910 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -572,35 +572,6 @@ static int usbduxsigma_ai_cmdtest(struct comedi_device *dev,
 	if (err)
 		return 3;
 
-	/* Step 4: fix up any arguments */
-
-	if (high_speed) {
-		/*
-		 * every 2 channels get a time window of 125us. Thus, if we
-		 * sample all 16 channels we need 1ms. If we sample only one
-		 * channel we need only 125us
-		 */
-		devpriv->ai_interval = interval;
-		devpriv->ai_timer = cmd->scan_begin_arg / (125000 * interval);
-	} else {
-		/* interval always 1ms */
-		devpriv->ai_interval = 1;
-		devpriv->ai_timer = cmd->scan_begin_arg / 1000000;
-	}
-	if (devpriv->ai_timer < 1)
-		err |= -EINVAL;
-
-	if (cmd->stop_src == TRIG_COUNT) {
-		/* data arrives as one packet */
-		devpriv->ai_sample_count = cmd->stop_arg;
-	} else {
-		/* continuous acquisition */
-		devpriv->ai_sample_count = 0;
-	}
-
-	if (err)
-		return 4;
-
 	return 0;
 }
 
@@ -700,6 +671,30 @@ static int usbduxsigma_ai_cmd(struct comedi_device *dev,
 
 	/* set current channel of the running acquisition to zero */
 	s->async->cur_chan = 0;
+
+	if (devpriv->high_speed) {
+		/*
+		 * every 2 channels get a time window of 125us. Thus, if we
+		 * sample all 16 channels we need 1ms. If we sample only one
+		 * channel we need only 125us
+		 */
+		unsigned int interval = usbduxsigma_chans_to_interval(len);
+
+		devpriv->ai_interval = interval;
+		devpriv->ai_timer = cmd->scan_begin_arg / (125000 * interval);
+	} else {
+		/* interval always 1ms */
+		devpriv->ai_interval = 1;
+		devpriv->ai_timer = cmd->scan_begin_arg / 1000000;
+	}
+	if (cmd->stop_src == TRIG_COUNT) {
+		/* data arrives as one packet */
+		devpriv->ai_sample_count = cmd->stop_arg;
+	} else {
+		/* continuous acquisition */
+		devpriv->ai_sample_count = 0;
+	}
+
 	for (i = 0; i < len; i++) {
 		unsigned int chan  = CR_CHAN(cmd->chanlist[i]);
 

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

* [PATCH 3.16.y-ckt 013/133] staging: comedi: usbduxsigma: don't clobber ao_timer in command test
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (11 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 012/133] staging: comedi: usbduxsigma: don't clobber ai_timer in command test Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 014/133] clk: exynos4: Fix wrong clock for Exynos4x12 ADC Luis Henriques
                   ` (119 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ian Abbott, Luis Henriques

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

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

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

commit c04a1f17803e0d3eeada586ca34a6b436959bc20 upstream.

`devpriv->ao_timer` is used while an asynchronous command is running on
the AO subdevice.  It also gets modified by the subdevice's `cmdtest`
handler for checking new asynchronous commands,
`usbduxsigma_ao_cmdtest()`, which is not correct as it's allowed to
check new commands while an old command is still running.  Fix it by
moving the code which sets up `devpriv->ao_timer` into the subdevice's
`cmd` handler, `usbduxsigma_ao_cmd()`.

** This backported patch also moves the code that sets up
`devpriv->ao_sample_count` from `usbduxsigma_ao_cmdtest()` to
`usbduxsigma_ao_cmd()` for the same reason as above.  (This was not
needed in the upstream commit.) **

Note that the removed code in `usbduxsigma_ao_cmdtest()` checked that
`devpriv->ao_timer` did not end up less that 1, but that could not
happen due because `cmd->scan_begin_arg` or `cmd->convert_arg` had
already been range-checked.

Also note that we tested the `high_speed` variable in the old code, but
that is currently always 0 and means that we always use "scan" timing
(`cmd->scan_begin_src == TRIG_TIMER` and `cmd->convert_src == TRIG_NOW`)
and never "convert" (individual sample) timing (`cmd->scan_begin_src ==
TRIG_FOLLOW` and `cmd->convert_src == TRIG_TIMER`).  The moved code
tests `cmd->convert_src` instead to decide whether "scan" or "convert"
timing is being used, although currently only "scan" timing is
supported.

Fixes: fb1ef622e7a3 ("staging: comedi: usbduxsigma: tidy up analog output command support")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/comedi/drivers/usbduxsigma.c | 46 ++++++++++++----------------
 1 file changed, 20 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index e2c0c54e0910..823ccf6fef66 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -946,11 +946,26 @@ static int usbduxsigma_ao_cmdtest(struct comedi_device *dev,
 	if (err)
 		return 3;
 
-	/* Step 4: fix up any arguments */
+	return 0;
+}
 
-	/* we count in timer steps */
-	if (high_speed) {
-		/* timing of the conversion itself: every 125 us */
+static int usbduxsigma_ao_cmd(struct comedi_device *dev,
+			      struct comedi_subdevice *s)
+{
+	struct usbduxsigma_private *devpriv = dev->private;
+	struct comedi_cmd *cmd = &s->async->cmd;
+	int ret;
+
+	down(&devpriv->sem);
+
+	/* set current channel of the running acquisition to zero */
+	s->async->cur_chan = 0;
+
+	if (cmd->convert_src == TRIG_TIMER) {
+		/*
+		 * timing of the conversion itself: every 125 us
+		 * at high speed (not used yet)
+		 */
 		devpriv->ao_timer = cmd->convert_arg / 125000;
 	} else {
 		/*
@@ -959,12 +974,9 @@ static int usbduxsigma_ao_cmdtest(struct comedi_device *dev,
 		 */
 		devpriv->ao_timer = cmd->scan_begin_arg / 1000000;
 	}
-	if (devpriv->ao_timer < 1)
-		err |= -EINVAL;
-
 	if (cmd->stop_src == TRIG_COUNT) {
 		/* not continuous, use counter */
-		if (high_speed) {
+		if (cmd->convert_src == TRIG_TIMER) {
 			/* high speed also scans everything at once */
 			devpriv->ao_sample_count = cmd->stop_arg *
 						   cmd->scan_end_arg;
@@ -981,24 +993,6 @@ static int usbduxsigma_ao_cmdtest(struct comedi_device *dev,
 		devpriv->ao_sample_count = 0;
 	}
 
-	if (err)
-		return 4;
-
-	return 0;
-}
-
-static int usbduxsigma_ao_cmd(struct comedi_device *dev,
-			      struct comedi_subdevice *s)
-{
-	struct usbduxsigma_private *devpriv = dev->private;
-	struct comedi_cmd *cmd = &s->async->cmd;
-	int ret;
-
-	down(&devpriv->sem);
-
-	/* set current channel of the running acquisition to zero */
-	s->async->cur_chan = 0;
-
 	devpriv->ao_counter = devpriv->ao_timer;
 
 	if (cmd->start_src == TRIG_NOW) {

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

* [PATCH 3.16.y-ckt 014/133] clk: exynos4: Fix wrong clock for Exynos4x12 ADC
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (12 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 013/133] staging: comedi: usbduxsigma: don't clobber ao_timer " Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 015/133] usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes Luis Henriques
                   ` (118 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Krzysztof Kozlowski, Stephen Boyd, Luis Henriques

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

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

From: Krzysztof Kozlowski <k.kozlowski@samsung.com>

commit e323d56eb06b266b77c2b430cb5f1977ba549e03 upstream.

The TSADC gate clock was used in Exynos4x12 DTSI for exynos-adc driver.
However TSADC is present only on Exynos4210 so on Trats2 board (with
Exynos4412 SoC) the exynos-adc driver could not be probed:
   ERROR: could not get clock /adc@126C0000:adc(0)
   exynos-adc 126c0000.adc: failed getting clock, err = -2
   exynos-adc: probe of 126c0000.adc failed with error -2

Instead on Exynos4x12 SoCs the main clock used by Analog to Digital
Converter is located in different register and it is named in datasheet
as PCLK_ADC. Regardless of the name the purpose of this PCLK_ADC clock
is the same as purpose of TSADC from Exynos4210.

The patch adds gate clock for Exynos4x12 using the proper register so
backward compatibility is preserved. This fixes the probe of exynos-adc
driver on Exynos4x12 boards and allows accessing sensors connected to it
on Trats2 board (ntc,ncp15wb473 AP and battery thermistors).

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: c63c57433003 ("ARM: dts: Add ADC's dt data to read raw data for exynos4x12")
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Acked-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/clk/samsung/clk-exynos4.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
index 7f4a473a7ad7..1a2e2c915f35 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -83,6 +83,7 @@
 #define DIV_PERIL4		0xc560
 #define DIV_PERIL5		0xc564
 #define E4X12_DIV_CAM1		0xc568
+#define E4X12_GATE_BUS_FSYS1	0xc744
 #define GATE_SCLK_CAM		0xc820
 #define GATE_IP_CAM		0xc920
 #define GATE_IP_TV		0xc924
@@ -906,6 +907,7 @@ static struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = {
 	GATE(CLK_MDMA, "mdma", "aclk200", E4X12_GATE_IP_IMAGE, 2, 0, 0),
 	GATE(CLK_SMMU_MDMA, "smmu_mdma", "aclk200", E4X12_GATE_IP_IMAGE, 5, 0,
 		0),
+	GATE(CLK_TSADC, "tsadc", "aclk133", E4X12_GATE_BUS_FSYS1, 16, 0, 0),
 	GATE(CLK_MIPI_HSI, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0),
 	GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0),
 	GATE(CLK_SYSREG, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1,

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

* [PATCH 3.16.y-ckt 015/133] usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (13 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 014/133] clk: exynos4: Fix wrong clock for Exynos4x12 ADC Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 016/133] Doc: ABI: testing: configfs-usb-gadget-loopback Luis Henriques
                   ` (117 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kishon Vijay Abraham I, Felipe Balbi, Luis Henriques

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

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

From: Kishon Vijay Abraham I <kishon@ti.com>

commit b2fb5b1a0f50d3ebc12342c8d8dead245e9c9d4e upstream.

DWC3 uses bounce buffer to handle non max packet aligned OUT transfers and
the size of bounce buffer is 512 bytes. However if the host initiates OUT
transfers of size more than 512 bytes (and non max packet aligned), the
driver throws a WARN dump but still programs the TRB to receive more than
512 bytes. This will cause bounce buffer to overflow and corrupt the
adjacent memory locations which can be fatal.

Fix it by programming the TRB to receive a maximum of DWC3_EP0_BOUNCE_SIZE
(512) bytes.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/dwc3/ep0.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index bcefce032757..312bc0542562 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -793,6 +793,11 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
 		unsigned maxp = ep0->endpoint.maxpacket;
 
 		transfer_size += (maxp - (transfer_size % maxp));
+
+		/* Maximum of DWC3_EP0_BOUNCE_SIZE can only be received */
+		if (transfer_size > DWC3_EP0_BOUNCE_SIZE)
+			transfer_size = DWC3_EP0_BOUNCE_SIZE;
+
 		transferred = min_t(u32, ur->length,
 				transfer_size - length);
 		memcpy(ur->buf, dwc->ep0_bounce, transferred);
@@ -905,11 +910,14 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
 			return;
 		}
 
-		WARN_ON(req->request.length > DWC3_EP0_BOUNCE_SIZE);
-
 		maxpacket = dep->endpoint.maxpacket;
 		transfer_size = roundup(req->request.length, maxpacket);
 
+		if (transfer_size > DWC3_EP0_BOUNCE_SIZE) {
+			dev_WARN(dwc->dev, "bounce buf can't handle req len\n");
+			transfer_size = DWC3_EP0_BOUNCE_SIZE;
+		}
+
 		dwc->ep0_bounced = true;
 
 		/*

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

* [PATCH 3.16.y-ckt 016/133] Doc: ABI: testing: configfs-usb-gadget-loopback
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (14 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 015/133] usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 017/133] Doc: ABI: testing: configfs-usb-gadget-sourcesink Luis Henriques
                   ` (116 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Chen, Felipe Balbi, Luis Henriques

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

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

From: Peter Chen <peter.chen@freescale.com>

commit 8cd50626823c00ca7472b2f61cb8c0eb9798ddc0 upstream.

Fix the name of attribute

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 Documentation/ABI/testing/configfs-usb-gadget-loopback | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/configfs-usb-gadget-loopback b/Documentation/ABI/testing/configfs-usb-gadget-loopback
index 9aae5bfb9908..06beefbcf061 100644
--- a/Documentation/ABI/testing/configfs-usb-gadget-loopback
+++ b/Documentation/ABI/testing/configfs-usb-gadget-loopback
@@ -5,4 +5,4 @@ Description:
 		The attributes:
 
 		qlen		- depth of loopback queue
-		bulk_buflen	- buffer length
+		buflen		- buffer length

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

* [PATCH 3.16.y-ckt 017/133] Doc: ABI: testing: configfs-usb-gadget-sourcesink
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (15 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 016/133] Doc: ABI: testing: configfs-usb-gadget-loopback Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 018/133] serial: 8250_pci: Add support for Pericom PI7C9X795[1248] Luis Henriques
                   ` (115 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Chen, Felipe Balbi, Luis Henriques

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

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

From: Peter Chen <peter.chen@freescale.com>

commit 4bc58eb16bb2352854b9c664cc36c1c68d2bfbb7 upstream.

Fix the name of attribute

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 Documentation/ABI/testing/configfs-usb-gadget-sourcesink | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/configfs-usb-gadget-sourcesink b/Documentation/ABI/testing/configfs-usb-gadget-sourcesink
index 29477c319f61..bc7ff731aa0c 100644
--- a/Documentation/ABI/testing/configfs-usb-gadget-sourcesink
+++ b/Documentation/ABI/testing/configfs-usb-gadget-sourcesink
@@ -9,4 +9,4 @@ Description:
 		isoc_maxpacket	- 0 - 1023 (fs), 0 - 1024 (hs/ss)
 		isoc_mult	- 0..2 (hs/ss only)
 		isoc_maxburst	- 0..15 (ss only)
-		qlen		- buffer length
+		buflen		- buffer length

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

* [PATCH 3.16.y-ckt 018/133] serial: 8250_pci: Add support for Pericom PI7C9X795[1248]
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (16 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 017/133] Doc: ABI: testing: configfs-usb-gadget-sourcesink Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 019/133] KVM: MMU: fix validation of mmio page fault Luis Henriques
                   ` (114 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Adam Lee, Greg Kroah-Hartman, Luis Henriques

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

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

From: Adam Lee <adam.lee@canonical.com>

commit 89c043a6cb2d4525d48a38ed78d5f0f5672338b3 upstream.

Pericom PI7C9X795[1248] are Uno/Dual/Quad/Octal UART devices, this
patch enables them, also defines PCI_VENDOR_ID_PERICOM here.

Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/8250/8250_pci.c | 81 ++++++++++++++++++++++++++++----------
 1 file changed, 61 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 18a2660ff734..ae4a16e8ee10 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1796,6 +1796,12 @@ pci_wch_ch353_setup(struct serial_private *priv,
 #define PCI_DEVICE_ID_SUNIX_1999	0x1999
 
 
+#define PCI_VENDOR_ID_PERICOM			0x12D8
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7951	0x7951
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7952	0x7952
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7954	0x7954
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7958	0x7958
+
 /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584	0x1584
 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1588	0x1588
@@ -2075,27 +2081,12 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
 	 * Pericom
 	 */
 	{
-		.vendor		= 0x12d8,
-		.device		= 0x7952,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.setup		= pci_pericom_setup,
-	},
-	{
-		.vendor		= 0x12d8,
-		.device		= 0x7954,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.setup		= pci_pericom_setup,
-	},
-	{
-		.vendor		= 0x12d8,
-		.device		= 0x7958,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.setup		= pci_pericom_setup,
+		.vendor         = PCI_VENDOR_ID_PERICOM,
+		.device         = PCI_ANY_ID,
+		.subvendor      = PCI_ANY_ID,
+		.subdevice      = PCI_ANY_ID,
+		.setup          = pci_pericom_setup,
 	},
-
 	/*
 	 * PLX
 	 */
@@ -2757,6 +2748,10 @@ enum pci_board_num_t {
 	pbn_fintek_4,
 	pbn_fintek_8,
 	pbn_fintek_12,
+	pbn_pericom_PI7C9X7951,
+	pbn_pericom_PI7C9X7952,
+	pbn_pericom_PI7C9X7954,
+	pbn_pericom_PI7C9X7958,
 };
 
 /*
@@ -3542,6 +3537,33 @@ static struct pciserial_board pci_boards[] = {
 		.base_baud	= 115200,
 		.first_offset	= 0x40,
 	},
+	/*
+	 * Pericom PI7C9X795[1248] Uno/Dual/Quad/Octal UART
+	 */
+	[pbn_pericom_PI7C9X7951] = {
+		.flags          = FL_BASE0,
+		.num_ports      = 1,
+		.base_baud      = 921600,
+		.uart_offset	= 0x8,
+	},
+	[pbn_pericom_PI7C9X7952] = {
+		.flags          = FL_BASE0,
+		.num_ports      = 2,
+		.base_baud      = 921600,
+		.uart_offset	= 0x8,
+	},
+	[pbn_pericom_PI7C9X7954] = {
+		.flags          = FL_BASE0,
+		.num_ports      = 4,
+		.base_baud      = 921600,
+		.uart_offset	= 0x8,
+	},
+	[pbn_pericom_PI7C9X7958] = {
+		.flags          = FL_BASE0,
+		.num_ports      = 8,
+		.base_baud      = 921600,
+		.uart_offset	= 0x8,
+	},
 };
 
 static const struct pci_device_id blacklist[] = {
@@ -4791,6 +4813,25 @@ static struct pci_device_id serial_pci_tbl[] = {
 		0, pbn_exar_XR17V358 },
 
 	/*
+	 * Pericom PI7C9X795[1248] Uno/Dual/Quad/Octal UART
+	 */
+	{   PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7951,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0,
+		0, pbn_pericom_PI7C9X7951 },
+	{   PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7952,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0,
+		0, pbn_pericom_PI7C9X7952 },
+	{   PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7954,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0,
+		0, pbn_pericom_PI7C9X7954 },
+	{   PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7958,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0,
+		0, pbn_pericom_PI7C9X7958 },
+	/*
 	 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
 	 */
 	{	PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,

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

* [PATCH 3.16.y-ckt 019/133] KVM: MMU: fix validation of mmio page fault
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (17 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 018/133] serial: 8250_pci: Add support for Pericom PI7C9X795[1248] Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 020/133] auxdisplay: ks0108: fix refcount Luis Henriques
                   ` (113 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Xiao Guangrong, Paolo Bonzini, Luis Henriques

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

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

From: Xiao Guangrong <guangrong.xiao@linux.intel.com>

commit 6f691251c0350ac52a007c54bf3ef62e9d8cdc5e upstream.

We got the bug that qemu complained with "KVM: unknown exit, hardware
reason 31" and KVM shown these info:
[84245.284948] EPT: Misconfiguration.
[84245.285056] EPT: GPA: 0xfeda848
[84245.285154] ept_misconfig_inspect_spte: spte 0x5eaef50107 level 4
[84245.285344] ept_misconfig_inspect_spte: spte 0x5f5fadc107 level 3
[84245.285532] ept_misconfig_inspect_spte: spte 0x5141d18107 level 2
[84245.285723] ept_misconfig_inspect_spte: spte 0x52e40dad77 level 1

This is because we got a mmio #PF and the handler see the mmio spte becomes
normal (points to the ram page)

However, this is valid after introducing fast mmio spte invalidation which
increases the generation-number instead of zapping mmio sptes, a example
is as follows:
1. QEMU drops mmio region by adding a new memslot
2. invalidate all mmio sptes
3.

        VCPU 0                        VCPU 1
    access the invalid mmio spte
                            access the region originally was MMIO before
                            set the spte to the normal ram map

    mmio #PF
    check the spte and see it becomes normal ram mapping !!!

This patch fixes the bug just by dropping the check in mmio handler, it's
good for backport. Full check will be introduced in later patches

Reported-by: Pavel Shirshov <ru.pchel@gmail.com>
Tested-by: Pavel Shirshov <ru.pchel@gmail.com>
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kvm/mmu.c | 45 ---------------------------------------------
 1 file changed, 45 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 59ff6e7f3bef..cb3d12be3c9c 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -377,12 +377,6 @@ static u64 __get_spte_lockless(u64 *sptep)
 {
 	return ACCESS_ONCE(*sptep);
 }
-
-static bool __check_direct_spte_mmio_pf(u64 spte)
-{
-	/* It is valid if the spte is zapped. */
-	return spte == 0ull;
-}
 #else
 union split_spte {
 	struct {
@@ -498,23 +492,6 @@ retry:
 
 	return spte.spte;
 }
-
-static bool __check_direct_spte_mmio_pf(u64 spte)
-{
-	union split_spte sspte = (union split_spte)spte;
-	u32 high_mmio_mask = shadow_mmio_mask >> 32;
-
-	/* It is valid if the spte is zapped. */
-	if (spte == 0ull)
-		return true;
-
-	/* It is valid if the spte is being zapped. */
-	if (sspte.spte_low == 0ull &&
-	    (sspte.spte_high & high_mmio_mask) == high_mmio_mask)
-		return true;
-
-	return false;
-}
 #endif
 
 static bool spte_is_locklessly_modifiable(u64 spte)
@@ -3216,21 +3193,6 @@ static bool quickly_check_mmio_pf(struct kvm_vcpu *vcpu, u64 addr, bool direct)
 	return vcpu_match_mmio_gva(vcpu, addr);
 }
 
-
-/*
- * On direct hosts, the last spte is only allows two states
- * for mmio page fault:
- *   - It is the mmio spte
- *   - It is zapped or it is being zapped.
- *
- * This function completely checks the spte when the last spte
- * is not the mmio spte.
- */
-static bool check_direct_spte_mmio_pf(u64 spte)
-{
-	return __check_direct_spte_mmio_pf(spte);
-}
-
 static u64 walk_shadow_page_get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr)
 {
 	struct kvm_shadow_walk_iterator iterator;
@@ -3273,13 +3235,6 @@ int handle_mmio_page_fault_common(struct kvm_vcpu *vcpu, u64 addr, bool direct)
 	}
 
 	/*
-	 * It's ok if the gva is remapped by other cpus on shadow guest,
-	 * it's a BUG if the gfn is not a mmio page.
-	 */
-	if (direct && !check_direct_spte_mmio_pf(spte))
-		return RET_MMIO_PF_BUG;
-
-	/*
 	 * If the page table is zapped by other cpus, let CPU fault again on
 	 * the address.
 	 */

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

* [PATCH 3.16.y-ckt 020/133] auxdisplay: ks0108: fix refcount
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (18 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 019/133] KVM: MMU: fix validation of mmio page fault Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 021/133] devres: fix devres_get() Luis Henriques
                   ` (112 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sudip Mukherjee, Greg Kroah-Hartman, Luis Henriques

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

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

From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

commit bab383de3b84e584b0f09227151020b2a43dc34c upstream.

parport_find_base() will implicitly do parport_get_port() which
increases the refcount. Then parport_register_device() will again
increment the refcount. But while unloading the module we are only
doing parport_unregister_device() decrementing the refcount only once.
We add an parport_put_port() to neutralize the effect of
parport_get_port().

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/auxdisplay/ks0108.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/auxdisplay/ks0108.c b/drivers/auxdisplay/ks0108.c
index 5b93852392b8..0d752851a1ee 100644
--- a/drivers/auxdisplay/ks0108.c
+++ b/drivers/auxdisplay/ks0108.c
@@ -139,6 +139,7 @@ static int __init ks0108_init(void)
 
 	ks0108_pardevice = parport_register_device(ks0108_parport, KS0108_NAME,
 		NULL, NULL, NULL, PARPORT_DEV_EXCL, NULL);
+	parport_put_port(ks0108_parport);
 	if (ks0108_pardevice == NULL) {
 		printk(KERN_ERR KS0108_NAME ": ERROR: "
 			"parport didn't register new device\n");

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

* [PATCH 3.16.y-ckt 021/133] devres: fix devres_get()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (19 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 020/133] auxdisplay: ks0108: fix refcount Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 022/133] iio: adis16400: Fix adis16448 gyroscope scale Luis Henriques
                   ` (111 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Masahiro Yamada, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit 64526370d11ce8868ca495723d595b61e8697fbf upstream.

Currently, devres_get() passes devres_free() the pointer to devres,
but devres_free() should be given with the pointer to resource data.

Fixes: 9ac7849e35f7 ("devres: device resource management")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/base/devres.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index 52302946770f..87643ca7c035 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -297,10 +297,10 @@ void * devres_get(struct device *dev, void *new_res,
 	if (!dr) {
 		add_dr(dev, &new_dr->node);
 		dr = new_dr;
-		new_dr = NULL;
+		new_res = NULL;
 	}
 	spin_unlock_irqrestore(&dev->devres_lock, flags);
-	devres_free(new_dr);
+	devres_free(new_res);
 
 	return dr->data;
 }

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

* [PATCH 3.16.y-ckt 022/133] iio: adis16400: Fix adis16448 gyroscope scale
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (20 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 021/133] devres: fix devres_get() Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 023/133] iio: Add inverse unit conversion macros Luis Henriques
                   ` (110 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lars-Peter Clausen, Jonathan Cameron, Luis Henriques

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

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

From: Lars-Peter Clausen <lars@metafoo.de>

commit 8166537283b31d7abaae9e56bd48fbbc30cdc579 upstream.

Use the correct scale for the adis16448 gyroscope output.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/iio/imu/adis16400_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c
index 10265263fa1a..a44fe6df7d70 100644
--- a/drivers/iio/imu/adis16400_core.c
+++ b/drivers/iio/imu/adis16400_core.c
@@ -807,7 +807,7 @@ static struct adis16400_chip_info adis16400_chips[] = {
 		.flags = ADIS16400_HAS_PROD_ID |
 				ADIS16400_HAS_SERIAL_NUMBER |
 				ADIS16400_BURST_DIAG_STAT,
-		.gyro_scale_micro = IIO_DEGREE_TO_RAD(10000), /* 0.01 deg/s */
+		.gyro_scale_micro = IIO_DEGREE_TO_RAD(40000), /* 0.04 deg/s */
 		.accel_scale_micro = IIO_G_TO_M_S_2(833), /* 1/1200 g */
 		.temp_scale_nano = 73860000, /* 0.07386 C */
 		.temp_offset = 31000000 / 73860, /* 31 C = 0x00 */

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

* [PATCH 3.16.y-ckt 023/133] iio: Add inverse unit conversion macros
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (21 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 022/133] iio: adis16400: Fix adis16448 gyroscope scale Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 024/133] iio: adis16480: Fix scale factors Luis Henriques
                   ` (109 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lars-Peter Clausen, Jonathan Cameron, Luis Henriques

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

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

From: Lars-Peter Clausen <lars@metafoo.de>

commit c689a923c867eac40ed3826c1d9328edea8b6bc7 upstream.

Add inverse unit conversion macro to convert from standard IIO units to
units that might be used by some devices.

Those are useful in combination with scale factors that are specified as
IIO_VAL_FRACTIONAL. Typically the denominator for those specifications will
contain the maximum raw value the sensor will generate and the numerator
the value it maps to in a specific unit. Sometimes datasheets specify those
in different units than the standard IIO units (e.g. degree/s instead of
rad/s) and so we need to do a unit conversion.

>From a mathematical point of view it does not make a difference whether we
apply the unit conversion to the numerator or the inverse unit conversion
to the denominator since (x / y) / z = x / (y * z). But as the denominator
is typically a larger value and we are rounding both the numerator and
denominator to integer values using the later method gives us a better
precision (E.g. the relative error is smaller if we round 8000.3 to 8000
rather than rounding 8.3 to 8).

This is where in inverse unit conversion macros will be used.

Marked for stable as used by some upcoming fixes.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/iio/iio.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index ccde91725f98..00aefda27dbb 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -621,6 +621,15 @@ int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer,
 #define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL)
 
 /**
+ * IIO_RAD_TO_DEGREE() - Convert rad to degree
+ * @rad: A value in rad
+ *
+ * Returns the given value converted from rad to degree
+ */
+#define IIO_RAD_TO_DEGREE(rad) \
+	(((rad) * 18000000ULL + 314159ULL / 2) / 314159ULL)
+
+/**
  * IIO_G_TO_M_S_2() - Convert g to meter / second**2
  * @g: A value in g
  *
@@ -628,4 +637,12 @@ int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer,
  */
 #define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL)
 
+/**
+ * IIO_M_S_2_TO_G() - Convert meter / second**2 to g
+ * @ms2: A value in meter / second**2
+ *
+ * Returns the given value converted from meter / second**2 to g
+ */
+#define IIO_M_S_2_TO_G(ms2) (((ms2) * 100000ULL + 980665ULL / 2) / 980665ULL)
+
 #endif /* _INDUSTRIAL_IO_H_ */

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

* [PATCH 3.16.y-ckt 024/133] iio: adis16480: Fix scale factors
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (22 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 023/133] iio: Add inverse unit conversion macros Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 025/133] ideapad-laptop: Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list Luis Henriques
                   ` (108 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lars-Peter Clausen, Jonathan Cameron, Luis Henriques

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

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

From: Lars-Peter Clausen <lars@metafoo.de>

commit 7abad1063deb0f77d275c61f58863ec319c58c5c upstream.

The different devices support by the adis16480 driver have slightly
different scales for the gyroscope and accelerometer channels.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/iio/imu/adis16480.c | 39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index dd4206cac62d..5e1b117d4e3b 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -110,6 +110,10 @@
 struct adis16480_chip_info {
 	unsigned int num_channels;
 	const struct iio_chan_spec *channels;
+	unsigned int gyro_max_val;
+	unsigned int gyro_max_scale;
+	unsigned int accel_max_val;
+	unsigned int accel_max_scale;
 };
 
 struct adis16480 {
@@ -533,19 +537,21 @@ static int adis16480_set_filter_freq(struct iio_dev *indio_dev,
 static int adis16480_read_raw(struct iio_dev *indio_dev,
 	const struct iio_chan_spec *chan, int *val, int *val2, long info)
 {
+	struct adis16480 *st = iio_priv(indio_dev);
+
 	switch (info) {
 	case IIO_CHAN_INFO_RAW:
 		return adis_single_conversion(indio_dev, chan, 0, val);
 	case IIO_CHAN_INFO_SCALE:
 		switch (chan->type) {
 		case IIO_ANGL_VEL:
-			*val = 0;
-			*val2 = IIO_DEGREE_TO_RAD(20000); /* 0.02 degree/sec */
-			return IIO_VAL_INT_PLUS_MICRO;
+			*val = st->chip_info->gyro_max_scale;
+			*val2 = st->chip_info->gyro_max_val;
+			return IIO_VAL_FRACTIONAL;
 		case IIO_ACCEL:
-			*val = 0;
-			*val2 = IIO_G_TO_M_S_2(800); /* 0.8 mg */
-			return IIO_VAL_INT_PLUS_MICRO;
+			*val = st->chip_info->accel_max_scale;
+			*val2 = st->chip_info->accel_max_val;
+			return IIO_VAL_FRACTIONAL;
 		case IIO_MAGN:
 			*val = 0;
 			*val2 = 100; /* 0.0001 gauss */
@@ -702,18 +708,39 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
 	[ADIS16375] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
+		/*
+		 * storing the value in rad/degree and the scale in degree
+		 * gives us the result in rad and better precession than
+		 * storing the scale directly in rad.
+		 */
+		.gyro_max_val = IIO_RAD_TO_DEGREE(22887),
+		.gyro_max_scale = 300,
+		.accel_max_val = IIO_M_S_2_TO_G(21973),
+		.accel_max_scale = 18,
 	},
 	[ADIS16480] = {
 		.channels = adis16480_channels,
 		.num_channels = ARRAY_SIZE(adis16480_channels),
+		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
+		.gyro_max_scale = 450,
+		.accel_max_val = IIO_M_S_2_TO_G(12500),
+		.accel_max_scale = 5,
 	},
 	[ADIS16485] = {
 		.channels = adis16485_channels,
 		.num_channels = ARRAY_SIZE(adis16485_channels),
+		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
+		.gyro_max_scale = 450,
+		.accel_max_val = IIO_M_S_2_TO_G(20000),
+		.accel_max_scale = 5,
 	},
 	[ADIS16488] = {
 		.channels = adis16480_channels,
 		.num_channels = ARRAY_SIZE(adis16480_channels),
+		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
+		.gyro_max_scale = 450,
+		.accel_max_val = IIO_M_S_2_TO_G(22500),
+		.accel_max_scale = 18,
 	},
 };
 

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

* [PATCH 3.16.y-ckt 025/133] ideapad-laptop: Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (23 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 024/133] iio: adis16480: Fix scale factors Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 026/133] ASoC: rt5640: fix line out no sound issue Luis Henriques
                   ` (107 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Darren Hart, Luis Henriques

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

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

From: Hans de Goede <hdegoede@redhat.com>

commit fa92a31b3335478c545cdc8e79e1e9b788184e6b upstream.

Like some of the other Yoga models the Lenovo Yoga 3 14 does not have a
hw rfkill switch, and trying to read the hw rfkill switch through the
ideapad module causes it to always reported blocking breaking wifi.

This commit adds the Lenovo Yoga 3 14 to the no_hw_rfkill dmi list, fixing
the wifi breakage.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1239050
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/platform/x86/ideapad-laptop.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 627d43f3f078..cfc93618ebf1 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -846,6 +846,13 @@ static struct dmi_system_id no_hw_rfkill_list[] = {
 		},
 	},
 	{
+		.ident = "Lenovo Yoga 3 14",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3 14"),
+		},
+	},
+	{
 		.ident = "Lenovo Yoga 3 Pro 1370",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),

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

* [PATCH 3.16.y-ckt 026/133] ASoC: rt5640: fix line out no sound issue
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (24 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 025/133] ideapad-laptop: Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 027/133] iio: industrialio-buffer: Fix iio_buffer_poll return value Luis Henriques
                   ` (106 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: John Lin, Mark Brown, Luis Henriques

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

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

From: John Lin <john.lin@realtek.com>

commit 9b850ca4f1c5acd7fcbbd4b38a2d27132801a8d5 upstream.

The power for line out was not turned on when line out is enabled.
So we add "LOUT amp" widget to turn on the power for line out.

Signed-off-by: John Lin <john.lin@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/rt5640.c | 40 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 37 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 70679cf14c83..fdfb09bece91 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -984,6 +984,35 @@ static int rt5640_hp_event(struct snd_soc_dapm_widget *w,
 	return 0;
 }
 
+static int rt5640_lout_event(struct snd_soc_dapm_widget *w,
+	struct snd_kcontrol *kcontrol, int event)
+{
+	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+
+	switch (event) {
+	case SND_SOC_DAPM_POST_PMU:
+		hp_amp_power_on(codec);
+		snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
+			RT5640_PWR_LM, RT5640_PWR_LM);
+		snd_soc_update_bits(codec, RT5640_OUTPUT,
+			RT5640_L_MUTE | RT5640_R_MUTE, 0);
+		break;
+
+	case SND_SOC_DAPM_PRE_PMD:
+		snd_soc_update_bits(codec, RT5640_OUTPUT,
+			RT5640_L_MUTE | RT5640_R_MUTE,
+			RT5640_L_MUTE | RT5640_R_MUTE);
+		snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
+			RT5640_PWR_LM, 0);
+		break;
+
+	default:
+		return 0;
+	}
+
+	return 0;
+}
+
 static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w,
 			   struct snd_kcontrol *kcontrol, int event)
 {
@@ -1179,13 +1208,16 @@ static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = {
 		0, rt5640_spo_l_mix, ARRAY_SIZE(rt5640_spo_l_mix)),
 	SND_SOC_DAPM_MIXER("SPOR MIX", SND_SOC_NOPM, 0,
 		0, rt5640_spo_r_mix, ARRAY_SIZE(rt5640_spo_r_mix)),
-	SND_SOC_DAPM_MIXER("LOUT MIX", RT5640_PWR_ANLG1, RT5640_PWR_LM_BIT, 0,
+	SND_SOC_DAPM_MIXER("LOUT MIX", SND_SOC_NOPM, 0, 0,
 		rt5640_lout_mix, ARRAY_SIZE(rt5640_lout_mix)),
 	SND_SOC_DAPM_SUPPLY_S("Improve HP Amp Drv", 1, SND_SOC_NOPM,
 		0, 0, rt5640_hp_power_event, SND_SOC_DAPM_POST_PMU),
 	SND_SOC_DAPM_PGA_S("HP Amp", 1, SND_SOC_NOPM, 0, 0,
 		rt5640_hp_event,
 		SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
+	SND_SOC_DAPM_PGA_S("LOUT amp", 1, SND_SOC_NOPM, 0, 0,
+		rt5640_lout_event,
+		SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
 	SND_SOC_DAPM_SUPPLY("HP L Amp", RT5640_PWR_ANLG1,
 		RT5640_PWR_HP_L_BIT, 0, NULL, 0),
 	SND_SOC_DAPM_SUPPLY("HP R Amp", RT5640_PWR_ANLG1,
@@ -1500,8 +1532,10 @@ static const struct snd_soc_dapm_route rt5640_dapm_routes[] = {
 	{"HP R Playback", "Switch", "HP Amp"},
 	{"HPOL", NULL, "HP L Playback"},
 	{"HPOR", NULL, "HP R Playback"},
-	{"LOUTL", NULL, "LOUT MIX"},
-	{"LOUTR", NULL, "LOUT MIX"},
+
+	{"LOUT amp", NULL, "LOUT MIX"},
+	{"LOUTL", NULL, "LOUT amp"},
+	{"LOUTR", NULL, "LOUT amp"},
 };
 
 static const struct snd_soc_dapm_route rt5640_specific_dapm_routes[] = {

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

* [PATCH 3.16.y-ckt 027/133] iio: industrialio-buffer: Fix iio_buffer_poll return value
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (25 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 026/133] ASoC: rt5640: fix line out no sound issue Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 028/133] iio: event: Remove negative error code from iio_event_poll Luis Henriques
                   ` (105 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Cristina Opriceana, Jonathan Cameron, Luis Henriques

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

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

From: Cristina Opriceana <cristina.opriceana@gmail.com>

commit 1bdc0293901cbea23c6dc29432e81919d4719844 upstream.

Change return value to 0 if no device is bound since
unsigned int cannot support negative error codes.

Fixes: f18e7a068 ("iio: Return -ENODEV for file operations if the
device has been unregistered")

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/iio/industrialio-buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 9f1a14009901..b8af417e7b93 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -96,7 +96,7 @@ unsigned int iio_buffer_poll(struct file *filp,
 	struct iio_buffer *rb = indio_dev->buffer;
 
 	if (!indio_dev->info)
-		return -ENODEV;
+		return 0;
 
 	poll_wait(filp, &rb->pollq, wait);
 	if (iio_buffer_data_available(rb))

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

* [PATCH 3.16.y-ckt 028/133] iio: event: Remove negative error code from iio_event_poll
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (26 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 027/133] iio: industrialio-buffer: Fix iio_buffer_poll return value Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 029/133] NFSv4: don't set SETATTR for O_RDONLY|O_EXCL Luis Henriques
                   ` (104 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Cristina Opriceana, Jonathan Cameron, Luis Henriques

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

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

From: Cristina Opriceana <cristina.opriceana@gmail.com>

commit 41d903c00051d8f31c98a8136edbac67e6f8688f upstream.

Negative return values are not supported by iio_event_poll since
its return type is unsigned int.

Fixes: f18e7a068a0a3 ("iio: Return -ENODEV for file operations if the device has been unregistered")

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/iio/industrialio-event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c
index ad7a35f63a16..57672c96566d 100644
--- a/drivers/iio/industrialio-event.c
+++ b/drivers/iio/industrialio-event.c
@@ -84,7 +84,7 @@ static unsigned int iio_event_poll(struct file *filep,
 	unsigned int events = 0;
 
 	if (!indio_dev->info)
-		return -ENODEV;
+		return events;
 
 	poll_wait(filep, &ev_int->wait, wait);
 

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

* [PATCH 3.16.y-ckt 029/133] NFSv4: don't set SETATTR for O_RDONLY|O_EXCL
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (27 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 028/133] iio: event: Remove negative error code from iio_event_poll Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 030/133] unshare: Unsharing a thread does not require unsharing a vm Luis Henriques
                   ` (103 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: NeilBrown, Trond Myklebust, Luis Henriques

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

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

From: NeilBrown <neilb@suse.com>

commit efcbc04e16dfa95fef76309f89710dd1d99a5453 upstream.

It is unusual to combine the open flags O_RDONLY and O_EXCL, but
it appears that libre-office does just that.

[pid  3250] stat("/home/USER/.config", {st_mode=S_IFDIR|0700, st_size=8192, ...}) = 0
[pid  3250] open("/home/USER/.config/libreoffice/4-suse/user/extensions/buildid", O_RDONLY|O_EXCL <unfinished ...>

NFSv4 takes O_EXCL as a sign that a setattr command should be sent,
probably to reset the timestamps.

When it was an O_RDONLY open, the SETATTR command does not
identify any actual attributes to change.
If no delegation was provided to the open, the SETATTR uses the
all-zeros stateid and the request is accepted (at least by the
Linux NFS server - no harm, no foul).

If a read-delegation was provided, this is used in the SETATTR
request, and a Netapp filer will justifiably claim
NFS4ERR_BAD_STATEID, which the Linux client takes as a sign
to retry - indefinitely.

So only treat O_EXCL specially if O_CREAT was also given.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index dd15268c003c..6cf18adda512 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2331,7 +2331,7 @@ static int _nfs4_do_open(struct inode *dir,
 		goto err_free_label;
 	state = ctx->state;
 
-	if ((opendata->o_arg.open_flags & O_EXCL) &&
+	if ((opendata->o_arg.open_flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL) &&
 	    (opendata->o_arg.createmode != NFS4_CREATE_GUARDED)) {
 		nfs4_exclusive_attrset(opendata, sattr);
 

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

* [PATCH 3.16.y-ckt 030/133] unshare: Unsharing a thread does not require unsharing a vm
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (28 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 029/133] NFSv4: don't set SETATTR for O_RDONLY|O_EXCL Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 031/133] fs: Set the size of empty dirs to 0 Luis Henriques
                   ` (102 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Eric W. Biederman, Luis Henriques

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

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

From: "Eric W. Biederman" <ebiederm@xmission.com>

commit 12c641ab8270f787dfcce08b5f20ce8b65008096 upstream.

In the logic in the initial commit of unshare made creating a new
thread group for a process, contingent upon creating a new memory
address space for that process.  That is wrong.  Two separate
processes in different thread groups can share a memory address space
and clone allows creation of such proceses.

This is significant because it was observed that mm_users > 1 does not
mean that a process is multi-threaded, as reading /proc/PID/maps
temporarily increments mm_users, which allows other processes to
(accidentally) interfere with unshare() calls.

Correct the check in check_unshare_flags() to test for
!thread_group_empty() for CLONE_THREAD, CLONE_SIGHAND, and CLONE_VM.
For sighand->count > 1 for CLONE_SIGHAND and CLONE_VM.
For !current_is_single_threaded instead of mm_users > 1 for CLONE_VM.

By using the correct checks in unshare this removes the possibility of
an accidental denial of service attack.

Additionally using the correct checks in unshare ensures that only an
explicit unshare(CLONE_VM) can possibly trigger the slow path of
current_is_single_threaded().  As an explict unshare(CLONE_VM) is
pointless it is not expected there are many applications that make
that call.

Fixes: b2e0d98705e60e45bbb3c0032c48824ad7ae0704 userns: Implement unshare of the user namespace
Reported-by: Ricky Zhou <rickyz@chromium.org>
Reported-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/fork.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index b41958b0cb67..a4ca06e80972 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1753,13 +1753,21 @@ static int check_unshare_flags(unsigned long unshare_flags)
 				CLONE_NEWUSER|CLONE_NEWPID))
 		return -EINVAL;
 	/*
-	 * Not implemented, but pretend it works if there is nothing to
-	 * unshare. Note that unsharing CLONE_THREAD or CLONE_SIGHAND
-	 * needs to unshare vm.
+	 * Not implemented, but pretend it works if there is nothing
+	 * to unshare.  Note that unsharing the address space or the
+	 * signal handlers also need to unshare the signal queues (aka
+	 * CLONE_THREAD).
 	 */
 	if (unshare_flags & (CLONE_THREAD | CLONE_SIGHAND | CLONE_VM)) {
-		/* FIXME: get_task_mm() increments ->mm_users */
-		if (atomic_read(&current->mm->mm_users) > 1)
+		if (!thread_group_empty(current))
+			return -EINVAL;
+	}
+	if (unshare_flags & (CLONE_SIGHAND | CLONE_VM)) {
+		if (atomic_read(&current->sighand->count) > 1)
+			return -EINVAL;
+	}
+	if (unshare_flags & CLONE_VM) {
+		if (!current_is_single_threaded())
 			return -EINVAL;
 	}
 
@@ -1828,16 +1836,16 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
 	if (unshare_flags & CLONE_NEWUSER)
 		unshare_flags |= CLONE_THREAD | CLONE_FS;
 	/*
-	 * If unsharing a thread from a thread group, must also unshare vm.
-	 */
-	if (unshare_flags & CLONE_THREAD)
-		unshare_flags |= CLONE_VM;
-	/*
 	 * If unsharing vm, must also unshare signal handlers.
 	 */
 	if (unshare_flags & CLONE_VM)
 		unshare_flags |= CLONE_SIGHAND;
 	/*
+	 * If unsharing a signal handlers, must also unshare the signal queues.
+	 */
+	if (unshare_flags & CLONE_SIGHAND)
+		unshare_flags |= CLONE_THREAD;
+	/*
 	 * If unsharing namespace, must also unshare filesystem information.
 	 */
 	if (unshare_flags & CLONE_NEWNS)

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

* [PATCH 3.16.y-ckt 031/133] fs: Set the size of empty dirs to 0.
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (29 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 030/133] unshare: Unsharing a thread does not require unsharing a vm Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 032/133] x86/mce: Reenable CMCI banks when swiching back to interrupt mode Luis Henriques
                   ` (101 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Eric W. Biederman, Luis Henriques

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

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

From: "Eric W. Biederman" <ebiederm@xmission.com>

commit 4b75de8615050c1b0dd8d7794838c42f74ed36ba upstream.

Before the make_empty_dir_inode calls were introduce into proc, sysfs,
and sysctl those directories when stated reported an i_size of 0.
make_empty_dir_inode started reporting an i_size of 2.  At least one
userspace application depended on stat returning i_size of 0.  So
modify make_empty_dir_inode to cause an i_size of 0 to be reported for
these directories.

Reported-by: Tejun Heo <tj@kernel.org>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/libfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/libfs.c b/fs/libfs.c
index c4c5f7223477..5ba7e10d6b23 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -1158,7 +1158,7 @@ void make_empty_dir_inode(struct inode *inode)
 	inode->i_uid = GLOBAL_ROOT_UID;
 	inode->i_gid = GLOBAL_ROOT_GID;
 	inode->i_rdev = 0;
-	inode->i_size = 2;
+	inode->i_size = 0;
 	inode->i_blkbits = PAGE_SHIFT;
 	inode->i_blocks = 0;
 

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

* [PATCH 3.16.y-ckt 032/133] x86/mce: Reenable CMCI banks when swiching back to interrupt mode
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (30 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 031/133] fs: Set the size of empty dirs to 0 Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 033/133] ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config Luis Henriques
                   ` (100 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Xie XiuQi, Borislav Petkov, H. Peter Anvin, Linus Torvalds,
	Peter Zijlstra, Thomas Gleixner, Tony Luck, huawei.libin,
	linux-edac, rui.xiang, Ingo Molnar, Luis Henriques

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

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

From: Xie XiuQi <xiexiuqi@huawei.com>

commit 1b48465500611a2dc5e75800c61ac352e22d41c3 upstream.

Zhang Liguang reported the following issue:

1) System detects a CMCI storm on the current CPU.

2) Kernel disables the CMCI interrupt on banks owned by the
   current CPU and switches to poll mode

3) After the CMCI storm subsides, kernel switches back to
   interrupt mode

4) We expect the system to reenable the CMCI interrupt on banks
   owned by the current CPU

   mce_intel_adjust_timer
   |-> cmci_reenable
       |-> cmci_discover     # owned banks are ignored here

  static void cmci_discover(int banks)
	...
	for (i = 0; i < banks; i++) {
		...
		if (test_bit(i, owned))	# ownd banks is ignore here
			continue;

So convert cmci_storm_disable_banks() to
cmci_toggle_interrupt_mode() which controls whether to enable or
disable CMCI interrupts with its argument.

NB: We cannot clear the owned bit because the banks won't be
polled, otherwise. See:

  27f6c573e0f7 ("x86, CMCI: Add proper detection of end of CMCI storms")

for more info.

Reported-by: Zhang Liguang <zhangliguang@huawei.com>
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: huawei.libin@huawei.com
Cc: linux-edac <linux-edac@vger.kernel.org>
Cc: rui.xiang@huawei.com
Link: http://lkml.kernel.org/r/1439396985-12812-10-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[ luis: backported to 3.16:
  - use __get_cpu_var() instead of this_cpu_ptr()
  - adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/cpu/mcheck/mce_intel.c | 41 +++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
index 3bdb95ae8c43..62f5609581cb 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
@@ -97,6 +97,27 @@ void mce_intel_hcpu_update(unsigned long cpu)
 	per_cpu(cmci_storm_state, cpu) = CMCI_STORM_NONE;
 }
 
+static void cmci_toggle_interrupt_mode(bool on)
+{
+	unsigned long flags, *owned;
+	int bank;
+	u64 val;
+
+	raw_spin_lock_irqsave(&cmci_discover_lock, flags);
+	owned = __get_cpu_var(mce_banks_owned);
+	for_each_set_bit(bank, owned, MAX_NR_BANKS) {
+		rdmsrl(MSR_IA32_MCx_CTL2(bank), val);
+
+		if (on)
+			val |= MCI_CTL2_CMCI_EN;
+		else
+			val &= ~MCI_CTL2_CMCI_EN;
+
+		wrmsrl(MSR_IA32_MCx_CTL2(bank), val);
+	}
+	raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
+}
+
 unsigned long mce_intel_adjust_timer(unsigned long interval)
 {
 	int r;
@@ -125,7 +146,7 @@ unsigned long mce_intel_adjust_timer(unsigned long interval)
 		 */
 		if (!atomic_read(&cmci_storm_on_cpus)) {
 			__this_cpu_write(cmci_storm_state, CMCI_STORM_NONE);
-			cmci_reenable();
+			cmci_toggle_interrupt_mode(true);
 			cmci_recheck();
 		}
 		return CMCI_POLL_INTERVAL;
@@ -138,22 +159,6 @@ unsigned long mce_intel_adjust_timer(unsigned long interval)
 	}
 }
 
-static void cmci_storm_disable_banks(void)
-{
-	unsigned long flags, *owned;
-	int bank;
-	u64 val;
-
-	raw_spin_lock_irqsave(&cmci_discover_lock, flags);
-	owned = __get_cpu_var(mce_banks_owned);
-	for_each_set_bit(bank, owned, MAX_NR_BANKS) {
-		rdmsrl(MSR_IA32_MCx_CTL2(bank), val);
-		val &= ~MCI_CTL2_CMCI_EN;
-		wrmsrl(MSR_IA32_MCx_CTL2(bank), val);
-	}
-	raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
-}
-
 static bool cmci_storm_detect(void)
 {
 	unsigned int cnt = __this_cpu_read(cmci_storm_cnt);
@@ -175,7 +180,7 @@ static bool cmci_storm_detect(void)
 	if (cnt <= CMCI_STORM_THRESHOLD)
 		return false;
 
-	cmci_storm_disable_banks();
+	cmci_toggle_interrupt_mode(false);
 	__this_cpu_write(cmci_storm_state, CMCI_STORM_ACTIVE);
 	r = atomic_add_return(1, &cmci_storm_on_cpus);
 	mce_timer_kick(CMCI_POLL_INTERVAL);

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

* [PATCH 3.16.y-ckt 033/133] ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (31 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 032/133] x86/mce: Reenable CMCI banks when swiching back to interrupt mode Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 034/133] regulator: pbias: Fix broken pbias disable functionality Luis Henriques
                   ` (99 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Axel Lin, Mark Brown, Luis Henriques

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

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

From: Axel Lin <axel.lin@ingics.com>

commit 9d8352864907f0ad76124c5b28f65b5a382d7d7c upstream.

Don't set .read_flag_mask for adav803, it's for adav801 only.

Fixes: 0c2d69645628 ("ASoC: adav80x: Split SPI and I2C code into different modules")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/adav80x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c
index 41da62f7250c..c44cd97b2364 100644
--- a/sound/soc/codecs/adav80x.c
+++ b/sound/soc/codecs/adav80x.c
@@ -883,7 +883,6 @@ const struct regmap_config adav80x_regmap_config = {
 	.val_bits = 8,
 	.pad_bits = 1,
 	.reg_bits = 7,
-	.read_flag_mask = 0x01,
 
 	.max_register = ADAV80X_PLL_OUTE,
 

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

* [PATCH 3.16.y-ckt 034/133] regulator: pbias: Fix broken pbias disable functionality
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (32 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 033/133] ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 035/133] serial: 8250: don't bind to SMSC IrCC IR port Luis Henriques
                   ` (98 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kishon Vijay Abraham I, Mark Brown, Luis Henriques

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

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

From: Kishon Vijay Abraham I <kishon@ti.com>

commit c329061be51bef655f28c9296093984c977aff85 upstream.

regulator_disable of pbias always writes '0' to the enable_reg.
However actual disable value of pbias regulator is not always '0'.
Fix it by populating the disable_val in pbias_reg_info for the
various platforms and assign it to the disable_val of
pbias regulator descriptor. This will be used by
regulator_disable_regmap while disabling pbias regulator.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/regulator/pbias-regulator.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c
index 6d02d68dfb46..98cf14b22e56 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -30,6 +30,7 @@
 struct pbias_reg_info {
 	u32 enable;
 	u32 enable_mask;
+	u32 disable_val;
 	u32 vmode;
 	unsigned int enable_time;
 	char *name;
@@ -62,6 +63,7 @@ static const struct pbias_reg_info pbias_mmc_omap2430 = {
 	.enable = BIT(1),
 	.enable_mask = BIT(1),
 	.vmode = BIT(0),
+	.disable_val = 0,
 	.enable_time = 100,
 	.name = "pbias_mmc_omap2430"
 };
@@ -77,6 +79,7 @@ static const struct pbias_reg_info pbias_sim_omap3 = {
 static const struct pbias_reg_info pbias_mmc_omap4 = {
 	.enable = BIT(26) | BIT(22),
 	.enable_mask = BIT(26) | BIT(25) | BIT(22),
+	.disable_val = BIT(25),
 	.vmode = BIT(21),
 	.enable_time = 100,
 	.name = "pbias_mmc_omap4"
@@ -85,6 +88,7 @@ static const struct pbias_reg_info pbias_mmc_omap4 = {
 static const struct pbias_reg_info pbias_mmc_omap5 = {
 	.enable = BIT(27) | BIT(26),
 	.enable_mask = BIT(27) | BIT(25) | BIT(26),
+	.disable_val = BIT(25),
 	.vmode = BIT(21),
 	.enable_time = 100,
 	.name = "pbias_mmc_omap5"
@@ -159,6 +163,7 @@ static int pbias_regulator_probe(struct platform_device *pdev)
 		drvdata[data_idx].desc.enable_reg = res->start;
 		drvdata[data_idx].desc.enable_mask = info->enable_mask;
 		drvdata[data_idx].desc.enable_val = info->enable;
+		drvdata[data_idx].desc.disable_val = info->disable_val;
 
 		cfg.init_data = pbias_matches[idx].init_data;
 		cfg.driver_data = &drvdata[data_idx];

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

* [PATCH 3.16.y-ckt 035/133] serial: 8250: don't bind to SMSC IrCC IR port
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (33 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 034/133] regulator: pbias: Fix broken pbias disable functionality Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 036/133] serial: 8250: bind to ALi Fast Infrared Controller (ALI5123) Luis Henriques
                   ` (97 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Maciej Szmigiero, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit ffa34de03bcfbfa88d8352942bc238bb48e94e2d upstream.

SMSC IrCC SIR/FIR port should not be bound to by
(legacy) serial driver so its own driver (smsc-ircc2)
can bind to it.

Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/tty/serial/8250/8250_pnp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index 682a2fbe5c06..2b22cc1e57a2 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -364,6 +364,11 @@ static const struct pnp_device_id pnp_dev_table[] = {
 	/* Winbond CIR port, should not be probed. We should keep track
 	   of it to prevent the legacy serial driver from probing it */
 	{	"WEC1022",		CIR_PORT	},
+	/*
+	 * SMSC IrCC SIR/FIR port, should not be probed by serial driver
+	 * as well so its own driver can bind to it.
+	 */
+	{	"SMCF010",		CIR_PORT	},
 	{	"",			0	}
 };
 

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

* [PATCH 3.16.y-ckt 036/133] serial: 8250: bind to ALi Fast Infrared Controller (ALI5123)
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (34 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 035/133] serial: 8250: don't bind to SMSC IrCC IR port Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 037/133] staging: comedi: adl_pci7x3x: fix digital output on PCI-7230 Luis Henriques
                   ` (96 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Maciej Szmigiero, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit 1d7002777a8fe8188caaa98d4a8eb4ed298fcdae upstream.

This way this device can be used with irtty-sir -
at least on Toshiba Satellite A20-S103 it is not configured by default
and needs PNP activation before it starts to respond on I/O ports.

This device has actually its own driver (ali-ircc),
but this driver seems to be non-functional for a very long time
(see http://permalink.gmane.org/gmane.linux.irda.general/484
http://permalink.gmane.org/gmane.network.protocols.obex.openobex.user/943
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535070 ).

Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/acpi/acpi_pnp.c            | 1 +
 drivers/tty/serial/8250/8250_pnp.c | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
index fa13db682309..717d9a5e0339 100644
--- a/drivers/acpi/acpi_pnp.c
+++ b/drivers/acpi/acpi_pnp.c
@@ -158,6 +158,7 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {
 	{"AEI0250"},		/* PROLiNK 1456VH ISA PnP K56flex Fax Modem */
 	{"AEI1240"},		/* Actiontec ISA PNP 56K X2 Fax Modem */
 	{"AKY1021"},		/* Rockwell 56K ACF II Fax+Data+Voice Modem */
+	{"ALI5123"},		/* ALi Fast Infrared Controller */
 	{"AZT4001"},		/* AZT3005 PnP SOUND DEVICE */
 	{"BDP3336"},		/* Best Data Products Inc. Smart One 336F PnP Modem */
 	{"BRI0A49"},		/* Boca Complete Ofc Communicator 14.4 Data-FAX */
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index 2b22cc1e57a2..4ebb5d76fd22 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -41,6 +41,12 @@ static const struct pnp_device_id pnp_dev_table[] = {
 	{	"AEI1240",		0	},
 	/* Rockwell 56K ACF II Fax+Data+Voice Modem */
 	{	"AKY1021",		0 /*SPCI_FL_NO_SHIRQ*/	},
+	/*
+	 * ALi Fast Infrared Controller
+	 * Native driver (ali-ircc) is broken so at least
+	 * it can be used with irtty-sir.
+	 */
+	{	"ALI5123",		0	},
 	/* AZT3005 PnP SOUND DEVICE */
 	{	"AZT4001",		0	},
 	/* Best Data Products Inc. Smart One 336F PnP Modem */

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

* [PATCH 3.16.y-ckt 037/133] staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (35 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 036/133] serial: 8250: bind to ALi Fast Infrared Controller (ALI5123) Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 038/133] blk-mq: fix buffer overflow when reading sysfs file of 'pending' Luis Henriques
                   ` (95 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ian Abbott, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e upstream.

The "adl_pci7x3x" driver replaced the "adl_pci7230" and "adl_pci7432"
drivers in commits 8f567c373c4b ("staging: comedi: new adl_pci7x3x
driver") and 657f77d173d3 ("staging: comedi: remove adl_pci7230 and
adl_pci7432 drivers").  Although the new driver code agrees with the
user manuals for the respective boards, digital outputs stopped working
on the PCI-7230.  This has 16 digital output channels and the previous
adl_pci7230 driver shifted the 16 bit output state left by 16 bits
before writing to the hardware register.  The new adl_pci7x3x driver
doesn't do that.  Fix it in `adl_pci7x3x_do_insn_bits()` by checking
for the special case of the subdevice having only 16 channels and
duplicating the 16 bit output state into both halves of the 32-bit
register.  That should work both for what the board actually does and
for what the user manual says it should do.

Fixes: 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/staging/comedi/drivers/adl_pci7x3x.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci7x3x.c b/drivers/staging/comedi/drivers/adl_pci7x3x.c
index 5e3cc77a8a0c..870e06334556 100644
--- a/drivers/staging/comedi/drivers/adl_pci7x3x.c
+++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c
@@ -113,8 +113,20 @@ static int adl_pci7x3x_do_insn_bits(struct comedi_device *dev,
 {
 	unsigned long reg = (unsigned long)s->private;
 
-	if (comedi_dio_update_state(s, data))
-		outl(s->state, dev->iobase + reg);
+	if (comedi_dio_update_state(s, data)) {
+		unsigned int val = s->state;
+
+		if (s->n_chan == 16) {
+			/*
+			 * It seems the PCI-7230 needs the 16-bit DO state
+			 * to be shifted left by 16 bits before being written
+			 * to the 32-bit register.  Set the value in both
+			 * halves of the register to be sure.
+			 */
+			val |= val << 16;
+		}
+		outl(val, dev->iobase + reg);
+	}
 
 	data[1] = s->state;
 

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

* [PATCH 3.16.y-ckt 038/133] blk-mq: fix buffer overflow when reading sysfs file of 'pending'
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (36 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 037/133] staging: comedi: adl_pci7x3x: fix digital output on PCI-7230 Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 039/133] xtensa: fix kernel register spilling Luis Henriques
                   ` (94 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ming Lei, Jens Axboe, Luis Henriques

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

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

From: Ming Lei <ming.lei@canonical.com>

commit 596f5aad2a704b72934e5abec1b1b4114c16f45b upstream.

There may be lots of pending requests so that the buffer of PAGE_SIZE
can't hold them at all.

One typical example is scsi-mq, the queue depth(.can_queue) of
scsi_host and blk-mq is quite big but scsi_device's queue_depth
is a bit small(.cmd_per_lun), then it is quite easy to have lots
of pending requests in hw queue.

This patch fixes the following warning and the related memory
destruction.

[  359.025101] fill_read_buffer: blk_mq_hw_sysfs_show+0x0/0x7d returned bad count^M
[  359.055595] irq event stamp: 15537^M
[  359.055606] general protection fault: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC ^M
[  359.055614] Dumping ftrace buffer:^M
[  359.055660]    (ftrace buffer empty)^M
[  359.055672] Modules linked in: nbd ipv6 kvm_intel kvm serio_raw^M
[  359.055678] CPU: 4 PID: 21631 Comm: stress-ng-sysfs Not tainted 4.2.0-rc5-next-20150805 #434^M
[  359.055679] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011^M
[  359.055682] task: ffff8802161cc000 ti: ffff88021b4a8000 task.ti: ffff88021b4a8000^M
[  359.055693] RIP: 0010:[<ffffffff811541c5>]  [<ffffffff811541c5>] __kmalloc+0xe8/0x152^M

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 block/blk-mq-sysfs.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c
index e0fb3f4a628f..4bd57a9cf5ff 100644
--- a/block/blk-mq-sysfs.c
+++ b/block/blk-mq-sysfs.c
@@ -141,15 +141,26 @@ static ssize_t blk_mq_sysfs_completed_show(struct blk_mq_ctx *ctx, char *page)
 
 static ssize_t sysfs_list_show(char *page, struct list_head *list, char *msg)
 {
-	char *start_page = page;
 	struct request *rq;
+	int len = snprintf(page, PAGE_SIZE - 1, "%s:\n", msg);
+
+	list_for_each_entry(rq, list, queuelist) {
+		const int rq_len = 2 * sizeof(rq) + 2;
+
+		/* if the output will be truncated */
+		if (PAGE_SIZE - 1 < len + rq_len) {
+			/* backspacing if it can't hold '\t...\n' */
+			if (PAGE_SIZE - 1 < len + 5)
+				len -= rq_len;
+			len += snprintf(page + len, PAGE_SIZE - 1 - len,
+					"\t...\n");
+			break;
+		}
+		len += snprintf(page + len, PAGE_SIZE - 1 - len,
+				"\t%p\n", rq);
+	}
 
-	page += sprintf(page, "%s:\n", msg);
-
-	list_for_each_entry(rq, list, queuelist)
-		page += sprintf(page, "\t%p\n", rq);
-
-	return page - start_page;
+	return len;
 }
 
 static ssize_t blk_mq_sysfs_rq_list_show(struct blk_mq_ctx *ctx, char *page)

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

* [PATCH 3.16.y-ckt 039/133] xtensa: fix kernel register spilling
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (37 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 038/133] blk-mq: fix buffer overflow when reading sysfs file of 'pending' Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 040/133] NFS: nfs_set_pgio_error sometimes misses errors Luis Henriques
                   ` (93 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Max Filippov, Luis Henriques

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

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

From: Max Filippov <jcmvbkbc@gmail.com>

commit 77d6273e79e3a86552fcf10cdd31a69b46ed2ce6 upstream.

call12 can't be safely used as the first call in the inline function,
because the compiler does not extend the stack frame of the bounding
function accordingly, which may result in corruption of local variables.

If a call needs to be done, do call8 first followed by call12.

For pure assembly code in _switch_to increase stack frame size of the
bounding function.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/xtensa/include/asm/traps.h | 29 +++++++++++++++++++----------
 arch/xtensa/kernel/entry.S      |  4 ++--
 2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/arch/xtensa/include/asm/traps.h b/arch/xtensa/include/asm/traps.h
index 677bfcf4ee5d..28f33a8b7f5f 100644
--- a/arch/xtensa/include/asm/traps.h
+++ b/arch/xtensa/include/asm/traps.h
@@ -25,30 +25,39 @@ static inline void spill_registers(void)
 {
 #if XCHAL_NUM_AREGS > 16
 	__asm__ __volatile__ (
-		"	call12	1f\n"
+		"	call8	1f\n"
 		"	_j	2f\n"
 		"	retw\n"
 		"	.align	4\n"
 		"1:\n"
+#if XCHAL_NUM_AREGS == 32
+		"	_entry	a1, 32\n"
+		"	addi	a8, a0, 3\n"
+		"	_entry	a1, 16\n"
+		"	mov	a12, a12\n"
+		"	retw\n"
+#else
 		"	_entry	a1, 48\n"
-		"	addi	a12, a0, 3\n"
-#if XCHAL_NUM_AREGS > 32
-		"	.rept	(" __stringify(XCHAL_NUM_AREGS) " - 32) / 12\n"
+		"	call12	1f\n"
+		"	retw\n"
+		"	.align	4\n"
+		"1:\n"
+		"	.rept	(" __stringify(XCHAL_NUM_AREGS) " - 16) / 12\n"
 		"	_entry	a1, 48\n"
 		"	mov	a12, a0\n"
 		"	.endr\n"
-#endif
-		"	_entry	a1, 48\n"
+		"	_entry	a1, 16\n"
 #if XCHAL_NUM_AREGS % 12 == 0
-		"	mov	a8, a8\n"
-#elif XCHAL_NUM_AREGS % 12 == 4
 		"	mov	a12, a12\n"
-#elif XCHAL_NUM_AREGS % 12 == 8
+#elif XCHAL_NUM_AREGS % 12 == 4
 		"	mov	a4, a4\n"
+#elif XCHAL_NUM_AREGS % 12 == 8
+		"	mov	a8, a8\n"
 #endif
 		"	retw\n"
+#endif
 		"2:\n"
-		: : : "a12", "a13", "memory");
+		: : : "a8", "a9", "memory");
 #else
 	__asm__ __volatile__ (
 		"	mov	a12, a12\n"
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index 8a749f02d8d6..cf8a354fa628 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -1793,7 +1793,7 @@ ENDPROC(system_call)
 	mov	a12, a0
 	.endr
 #endif
-	_entry	a1, 48
+	_entry	a1, 16
 #if XCHAL_NUM_AREGS % 12 == 0
 	mov	a8, a8
 #elif XCHAL_NUM_AREGS % 12 == 4
@@ -1817,7 +1817,7 @@ ENDPROC(system_call)
 
 ENTRY(_switch_to)
 
-	entry	a1, 16
+	entry	a1, 48
 
 	mov	a11, a3			# and 'next' (a3)
 

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

* [PATCH 3.16.y-ckt 040/133] NFS: nfs_set_pgio_error sometimes misses errors
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (38 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 039/133] xtensa: fix kernel register spilling Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 041/133] NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client Luis Henriques
                   ` (92 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Luis Henriques

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

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

From: Trond Myklebust <trond.myklebust@primarydata.com>

commit e9ae58aeee8842a50f7e199d602a5ccb2e41a95f upstream.

We should ensure that we always set the pgio_header's error field
if a READ or WRITE RPC call returns an error. The current code depends
on 'hdr->good_bytes' always being initialised to a large value, which
is not always done correctly by callers.
When this happens, applications may end up missing important errors.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/pagelist.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 54d049f930f7..2bd81a6d308c 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -63,8 +63,8 @@ EXPORT_SYMBOL_GPL(nfs_pgheader_init);
 void nfs_set_pgio_error(struct nfs_pgio_header *hdr, int error, loff_t pos)
 {
 	spin_lock(&hdr->lock);
-	if (pos < hdr->io_start + hdr->good_bytes) {
-		set_bit(NFS_IOHDR_ERROR, &hdr->flags);
+	if (!test_and_set_bit(NFS_IOHDR_ERROR, &hdr->flags)
+	    || pos < hdr->io_start + hdr->good_bytes) {
 		clear_bit(NFS_IOHDR_EOF, &hdr->flags);
 		hdr->good_bytes = pos - hdr->io_start;
 		hdr->error = error;

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

* [PATCH 3.16.y-ckt 041/133] NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (39 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 040/133] NFS: nfs_set_pgio_error sometimes misses errors Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 042/133] usb: host: ehci-sys: delete useless bus_to_hcd conversion Luis Henriques
                   ` (91 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kinglong Mee, Trond Myklebust, Luis Henriques

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

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

From: Kinglong Mee <kinglongmee@gmail.com>

commit 18e3b739fdc826481c6a1335ce0c5b19b3d415da upstream.

---Steps to Reproduce--
<nfs-server>
# cat /etc/exports
/nfs/referal  *(rw,insecure,no_subtree_check,no_root_squash,crossmnt)
/nfs/old      *(ro,insecure,subtree_check,root_squash,crossmnt)

<nfs-client>
# mount -t nfs nfs-server:/nfs/ /mnt/
# ll /mnt/*/

<nfs-server>
# cat /etc/exports
/nfs/referal   *(rw,insecure,no_subtree_check,no_root_squash,crossmnt,refer=/nfs/old/@nfs-server)
/nfs/old       *(ro,insecure,subtree_check,root_squash,crossmnt)
# service nfs restart

<nfs-client>
# ll /mnt/*/    --->>>>> oops here

[ 5123.102925] BUG: unable to handle kernel NULL pointer dereference at           (null)
[ 5123.103363] IP: [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4]
[ 5123.103752] PGD 587b9067 PUD 3cbf5067 PMD 0
[ 5123.104131] Oops: 0000 [#1]
[ 5123.104529] Modules linked in: nfsv4(OE) nfs(OE) fscache(E) nfsd(OE) xfs libcrc32c iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi coretemp crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev vmw_balloon parport_pc parport i2c_piix4 shpchp auth_rpcgss nfs_acl vmw_vmci lockd grace sunrpc vmwgfx drm_kms_helper ttm drm mptspi serio_raw scsi_transport_spi e1000 mptscsih mptbase ata_generic pata_acpi [last unloaded: nfsd]
[ 5123.105887] CPU: 0 PID: 15853 Comm: ::1-manager Tainted: G           OE   4.2.0-rc6+ #214
[ 5123.106358] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 05/20/2014
[ 5123.106860] task: ffff88007620f300 ti: ffff88005877c000 task.ti: ffff88005877c000
[ 5123.107363] RIP: 0010:[<ffffffffa03ed38b>]  [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4]
[ 5123.107909] RSP: 0018:ffff88005877fdb8  EFLAGS: 00010246
[ 5123.108435] RAX: ffff880053f3bc00 RBX: ffff88006ce6c908 RCX: ffff880053a0d240
[ 5123.108968] RDX: ffffea0000e6d940 RSI: ffff8800399a0000 RDI: ffff88006ce6c908
[ 5123.109503] RBP: ffff88005877fe28 R08: ffffffff81c708a0 R09: 0000000000000000
[ 5123.110045] R10: 00000000000001a2 R11: ffff88003ba7f5c8 R12: ffff880054c55800
[ 5123.110618] R13: 0000000000000000 R14: ffff880053a0d240 R15: ffff880053a0d240
[ 5123.111169] FS:  0000000000000000(0000) GS:ffffffff81c27000(0000) knlGS:0000000000000000
[ 5123.111726] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 5123.112286] CR2: 0000000000000000 CR3: 0000000054cac000 CR4: 00000000001406f0
[ 5123.112888] Stack:
[ 5123.113458]  ffffea0000e6d940 ffff8800399a0000 00000000000167d0 0000000000000000
[ 5123.114049]  0000000000000000 0000000000000000 0000000000000000 00000000a7ec82c6
[ 5123.114662]  ffff88005877fe18 ffffea0000e6d940 ffff8800399a0000 ffff880054c55800
[ 5123.115264] Call Trace:
[ 5123.115868]  [<ffffffffa03fb44b>] nfs4_try_migration+0xbb/0x220 [nfsv4]
[ 5123.116487]  [<ffffffffa03fcb3b>] nfs4_run_state_manager+0x4ab/0x7b0 [nfsv4]
[ 5123.117104]  [<ffffffffa03fc690>] ? nfs4_do_reclaim+0x510/0x510 [nfsv4]
[ 5123.117813]  [<ffffffff810a4527>] kthread+0xd7/0xf0
[ 5123.118456]  [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160
[ 5123.119108]  [<ffffffff816d9cdf>] ret_from_fork+0x3f/0x70
[ 5123.119723]  [<ffffffff810a4450>] ? kthread_worker_fn+0x160/0x160
[ 5123.120329] Code: 4c 8b 6a 58 74 17 eb 52 48 8d 55 a8 89 c6 4c 89 e7 e8 4a b5 ff ff 8b 45 b0 85 c0 74 1c 4c 89 f9 48 8b 55 90 48 8b 75 98 48 89 df <41> ff 55 00 3d e8 d8 ff ff 41 89 c6 74 cf 48 8b 4d c8 65 48 33
[ 5123.121643] RIP  [<ffffffffa03ed38b>] nfs4_proc_get_locations+0x9b/0x120 [nfsv4]
[ 5123.122308]  RSP <ffff88005877fdb8>
[ 5123.122942] CR2: 0000000000000000

Fixes: ec011fe847 ("NFS: Introduce a vector of migration recovery ops")
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/nfs4proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 6cf18adda512..2dfd374a89f5 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8363,6 +8363,7 @@ static const struct nfs4_minor_version_ops nfs_v4_2_minor_ops = {
 	.reboot_recovery_ops = &nfs41_reboot_recovery_ops,
 	.nograce_recovery_ops = &nfs41_nograce_recovery_ops,
 	.state_renewal_ops = &nfs41_state_renewal_ops,
+	.mig_recovery_ops = &nfs41_mig_recovery_ops,
 };
 #endif
 

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

* [PATCH 3.16.y-ckt 042/133] usb: host: ehci-sys: delete useless bus_to_hcd conversion
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (40 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 041/133] NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 043/133] USB: symbolserial: Use usb_get_serial_port_data Luis Henriques
                   ` (90 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Chen, Greg Kroah-Hartman, Luis Henriques

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

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

From: Peter Chen <peter.chen@freescale.com>

commit 0521cfd06e1ebcd575e7ae36aab068b38df23850 upstream.

The ehci platform device's drvdata is the pointer of struct usb_hcd
already, so we doesn't need to call bus_to_hcd conversion again.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/ehci-sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-sysfs.c b/drivers/usb/host/ehci-sysfs.c
index f6459dfb6f54..94054dad7710 100644
--- a/drivers/usb/host/ehci-sysfs.c
+++ b/drivers/usb/host/ehci-sysfs.c
@@ -29,7 +29,7 @@ static ssize_t show_companion(struct device *dev,
 	int			count = PAGE_SIZE;
 	char			*ptr = buf;
 
-	ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+	ehci = hcd_to_ehci(dev_get_drvdata(dev));
 	nports = HCS_N_PORTS(ehci->hcs_params);
 
 	for (index = 0; index < nports; ++index) {
@@ -54,7 +54,7 @@ static ssize_t store_companion(struct device *dev,
 	struct ehci_hcd		*ehci;
 	int			portnum, new_owner;
 
-	ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+	ehci = hcd_to_ehci(dev_get_drvdata(dev));
 	new_owner = PORT_OWNER;		/* Owned by companion */
 	if (sscanf(buf, "%d", &portnum) != 1)
 		return -EINVAL;
@@ -85,7 +85,7 @@ static ssize_t show_uframe_periodic_max(struct device *dev,
 	struct ehci_hcd		*ehci;
 	int			n;
 
-	ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+	ehci = hcd_to_ehci(dev_get_drvdata(dev));
 	n = scnprintf(buf, PAGE_SIZE, "%d\n", ehci->uframe_periodic_max);
 	return n;
 }
@@ -101,7 +101,7 @@ static ssize_t store_uframe_periodic_max(struct device *dev,
 	unsigned long		flags;
 	ssize_t			ret;
 
-	ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
+	ehci = hcd_to_ehci(dev_get_drvdata(dev));
 	if (kstrtouint(buf, 0, &uframe_periodic_max) < 0)
 		return -EINVAL;
 

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

* [PATCH 3.16.y-ckt 043/133] USB: symbolserial: Use usb_get_serial_port_data
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (41 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 042/133] usb: host: ehci-sys: delete useless bus_to_hcd conversion Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 044/133] USB: ftdi_sio: Added custom PID for CustomWare products Luis Henriques
                   ` (89 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Philipp Hachtmann, Greg Kroah-Hartman, Luis Henriques

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

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

From: Philipp Hachtmann <hachti@hachti.de>

commit 951d3793bbfc0a441d791d820183aa3085c83ea9 upstream.

The driver used usb_get_serial_data(port->serial) which compiled but resulted
in a NULL pointer being returned (and subsequently used). I did not go deeper
into this but I guess this is a regression.

Signed-off-by: Philipp Hachtmann <hachti@hachti.de>
Fixes: a85796ee5149 ("USB: symbolserial: move private-data allocation to
port_probe")
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/symbolserial.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c
index 8fceec7298e0..6ed804450a5a 100644
--- a/drivers/usb/serial/symbolserial.c
+++ b/drivers/usb/serial/symbolserial.c
@@ -94,7 +94,7 @@ exit:
 
 static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port)
 {
-	struct symbol_private *priv = usb_get_serial_data(port->serial);
+	struct symbol_private *priv = usb_get_serial_port_data(port);
 	unsigned long flags;
 	int result = 0;
 
@@ -120,7 +120,7 @@ static void symbol_close(struct usb_serial_port *port)
 static void symbol_throttle(struct tty_struct *tty)
 {
 	struct usb_serial_port *port = tty->driver_data;
-	struct symbol_private *priv = usb_get_serial_data(port->serial);
+	struct symbol_private *priv = usb_get_serial_port_data(port);
 
 	spin_lock_irq(&priv->lock);
 	priv->throttled = true;
@@ -130,7 +130,7 @@ static void symbol_throttle(struct tty_struct *tty)
 static void symbol_unthrottle(struct tty_struct *tty)
 {
 	struct usb_serial_port *port = tty->driver_data;
-	struct symbol_private *priv = usb_get_serial_data(port->serial);
+	struct symbol_private *priv = usb_get_serial_port_data(port);
 	int result;
 	bool was_throttled;
 

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

* [PATCH 3.16.y-ckt 044/133] USB: ftdi_sio: Added custom PID for CustomWare products
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (42 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 043/133] USB: symbolserial: Use usb_get_serial_port_data Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 045/133] USB: qcserial: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module Luis Henriques
                   ` (88 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Matthijs Kooijman, Johan Hovold, Greg Kroah-Hartman,
	Luis Henriques

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

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

From: Matthijs Kooijman <matthijs@stdin.nl>

commit 1fb8dc36384ae1140ee6ccc470de74397606a9d5 upstream.

CustomWare uses the FTDI VID with custom PIDs for their ShipModul MiniPlex
products.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/ftdi_sio.c     | 4 ++++
 drivers/usb/serial/ftdi_sio_ids.h | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index bc77ea7cde48..7fb81dbbdc8d 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -618,6 +618,10 @@ static const struct usb_device_id id_table_combined[] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	{ USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2WI_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX3_PID) },
 	/*
 	 * ELV devices:
 	 */
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 792e054126de..2943b97b2a83 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -568,6 +568,14 @@
  */
 #define FTDI_SYNAPSE_SS200_PID 0x9090 /* SS200 - SNAP Stick 200 */
 
+/*
+ * CustomWare / ShipModul NMEA multiplexers product ids (FTDI_VID)
+ */
+#define FTDI_CUSTOMWARE_MINIPLEX_PID	0xfd48	/* MiniPlex first generation NMEA Multiplexer */
+#define FTDI_CUSTOMWARE_MINIPLEX2_PID	0xfd49	/* MiniPlex-USB and MiniPlex-2 series */
+#define FTDI_CUSTOMWARE_MINIPLEX2WI_PID	0xfd4a	/* MiniPlex-2Wi */
+#define FTDI_CUSTOMWARE_MINIPLEX3_PID	0xfd4b	/* MiniPlex-3 series */
+
 
 /********************************/
 /** third-party VID/PID combos **/

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

* [PATCH 3.16.y-ckt 045/133] USB: qcserial: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (43 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 044/133] USB: ftdi_sio: Added custom PID for CustomWare products Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 046/133] igb: Fix oops caused by missing queue pairing Luis Henriques
                   ` (87 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Ward, Johan Hovold, Greg Kroah-Hartman, Luis Henriques

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

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

From: David Ward <david.ward@ll.mit.edu>

commit 44840dec6127e4d7c5074f75d2dd96bc4ab85fe3 upstream.

This is an HP-branded Sierra Wireless EM7355:
https://bugzilla.redhat.com/show_bug.cgi?id=1223646#c2

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/qcserial.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index d156545728c2..ebcec8cda858 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -139,6 +139,7 @@ static const struct usb_device_id id_table[] = {
 	{USB_DEVICE(0x0AF0, 0x8120)},	/* Option GTM681W */
 
 	/* non-Gobi Sierra Wireless devices */
+	{DEVICE_SWI(0x03f0, 0x4e1d)},	/* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
 	{DEVICE_SWI(0x0f3d, 0x68a2)},	/* Sierra Wireless MC7700 */
 	{DEVICE_SWI(0x114f, 0x68a2)},	/* Sierra Wireless MC7750 */
 	{DEVICE_SWI(0x1199, 0x68a2)},	/* Sierra Wireless MC7710 */

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

* [PATCH 3.16.y-ckt 046/133] igb: Fix oops caused by missing queue pairing
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (44 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 045/133] USB: qcserial: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 047/133] HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error Luis Henriques
                   ` (86 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Shota Suzuki, Jeff Kirsher, Luis Henriques

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

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

From: Shota Suzuki <suzuki_shota_t3@lab.ntt.co.jp>

commit 72ddef0506da852dc82f078f37ced8ef4d74a2bf upstream.

When initializing igb driver (e.g. 82576, I350), IGB_FLAG_QUEUE_PAIRS is
set if adapter->rss_queues exceeds half of max_rss_queues in
igb_init_queue_configuration().
On the other hand, IGB_FLAG_QUEUE_PAIRS is not set even if the number of
queues exceeds half of max_combined in igb_set_channels() when changing
the number of queues by "ethtool -L".
In this case, if numvecs is larger than MAX_MSIX_ENTRIES (10), the size
of adapter->msix_entries[], an overflow can occur in
igb_set_interrupt_capability(), which in turn leads to an oops.

Fix this problem as follows:
 - When changing the number of queues by "ethtool -L", set
   IGB_FLAG_QUEUE_PAIRS in the same way as initializing igb driver.
 - When increasing the size of q_vector, reallocate it appropriately.
   (With IGB_FLAG_QUEUE_PAIRS set, the size of q_vector gets larger.)

Another possible way to fix this problem is to cap the queues at its
initial number, which is the number of the initial online cpus. But this
is not the optimal way because we cannot increase queues when another
cpu becomes online.

Note that before commit cd14ef54d25b ("igb: Change to use statically
allocated array for MSIx entries"), this problem did not cause oops
but just made the number of queues become 1 because of entering msi_only
mode in igb_set_interrupt_capability().

Fixes: 907b7835799f ("igb: Add ethtool support to configure number of channels")
Signed-off-by: Shota Suzuki <suzuki_shota_t3@lab.ntt.co.jp>
Tested-by: Aaron Brown <aaron.f.brown@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/igb/igb.h         |  1 +
 drivers/net/ethernet/intel/igb/igb_ethtool.c |  5 ++++-
 drivers/net/ethernet/intel/igb/igb_main.c    | 16 ++++++++++++++--
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index 06102d1f7c03..e34f49381770 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -532,6 +532,7 @@ void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
 			 struct sk_buff *skb);
 int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
 int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
+void igb_set_flag_queue_pairs(struct igb_adapter *, const u32);
 #ifdef CONFIG_IGB_HWMON
 void igb_sysfs_exit(struct igb_adapter *adapter);
 int igb_sysfs_init(struct igb_adapter *adapter);
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index c737d1f40838..311c46b0291d 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2969,6 +2969,7 @@ static int igb_set_channels(struct net_device *netdev,
 {
 	struct igb_adapter *adapter = netdev_priv(netdev);
 	unsigned int count = ch->combined_count;
+	unsigned int max_combined = 0;
 
 	/* Verify they are not requesting separate vectors */
 	if (!count || ch->rx_count || ch->tx_count)
@@ -2979,11 +2980,13 @@ static int igb_set_channels(struct net_device *netdev,
 		return -EINVAL;
 
 	/* Verify the number of channels doesn't exceed hw limits */
-	if (count > igb_max_channels(adapter))
+	max_combined = igb_max_channels(adapter);
+	if (count > max_combined)
 		return -EINVAL;
 
 	if (count != adapter->rss_queues) {
 		adapter->rss_queues = count;
+		igb_set_flag_queue_pairs(adapter, max_combined);
 
 		/* Hardware has to reinitialize queues and interrupts to
 		 * match the new configuration.
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index b554cc9e492d..b844902d12a0 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1206,10 +1206,14 @@ static int igb_alloc_q_vector(struct igb_adapter *adapter,
 
 	/* allocate q_vector and rings */
 	q_vector = adapter->q_vector[v_idx];
-	if (!q_vector)
+	if (!q_vector) {
 		q_vector = kzalloc(size, GFP_KERNEL);
-	else
+	} else if (size > ksize(q_vector)) {
+		kfree_rcu(q_vector, rcu);
+		q_vector = kzalloc(size, GFP_KERNEL);
+	} else {
 		memset(q_vector, 0, size);
+	}
 	if (!q_vector)
 		return -ENOMEM;
 
@@ -2901,6 +2905,14 @@ static void igb_init_queue_configuration(struct igb_adapter *adapter)
 
 	adapter->rss_queues = min_t(u32, max_rss_queues, num_online_cpus());
 
+	igb_set_flag_queue_pairs(adapter, max_rss_queues);
+}
+
+void igb_set_flag_queue_pairs(struct igb_adapter *adapter,
+			      const u32 max_rss_queues)
+{
+	struct e1000_hw *hw = &adapter->hw;
+
 	/* Determine if we need to pair queues. */
 	switch (hw->mac.type) {
 	case e1000_82575:

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

* [PATCH 3.16.y-ckt 047/133] HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (45 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 046/133] igb: Fix oops caused by missing queue pairing Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 048/133] eCryptfs: Invalidate dcache entries when lower i_nlink is zero Luis Henriques
                   ` (85 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Don Zickus, Jiri Kosina, Luis Henriques

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

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

From: Don Zickus <dzickus@redhat.com>

commit 3af4e5a95184d6d3c1c6a065f163faa174a96a1d upstream.

It was reported that after 10-20 reboots, a usb keyboard plugged
into a docking station would not work unless it was replugged in.

Using usbmon, it turns out the interrupt URBs were streaming with
callback errors of -71 for some reason.  The hid-core.c::hid_io_error was
supposed to retry and then reset, but the reset wasn't really happening.

The check for HID_NO_BANDWIDTH was inverted.  Fix was simple.

Tested by reporter and locally by me by unplugging a keyboard halfway until I
could recreate a stream of errors but no disconnect.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/usbhid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 8945c9e551d7..b22e5c4e5448 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -180,7 +180,7 @@ static void hid_io_error(struct hid_device *hid)
 	if (time_after(jiffies, usbhid->stop_retry)) {
 
 		/* Retries failed, so do a port reset unless we lack bandwidth*/
-		if (test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
+		if (!test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
 		     && !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) {
 
 			schedule_work(&usbhid->reset_work);

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

* [PATCH 3.16.y-ckt 048/133] eCryptfs: Invalidate dcache entries when lower i_nlink is zero
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (46 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 047/133] HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 049/133] libxfs: readahead of dir3 data blocks should use the read verifier Luis Henriques
                   ` (84 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tyler Hicks, Luis Henriques

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

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

From: Tyler Hicks <tyhicks@canonical.com>

commit 5556e7e6d30e8e9b5ee51b0e5edd526ee80e5e36 upstream.

Consider eCryptfs dcache entries to be stale when the corresponding
lower inode's i_nlink count is zero. This solves a problem caused by the
lower inode being directly modified, without going through the eCryptfs
mount, leaving stale eCryptfs dentries cached and the eCryptfs inode's
i_nlink count not being cleared.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Richard Weinberger <richard@nod.at>
[ luis: backported to 3.16:
  - use dentry->d_inode instead of d_inode(dentry)
  - adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/ecryptfs/dentry.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c
index 4000f6b3a750..c7703c056e06 100644
--- a/fs/ecryptfs/dentry.c
+++ b/fs/ecryptfs/dentry.c
@@ -45,20 +45,20 @@
 static int ecryptfs_d_revalidate(struct dentry *dentry, unsigned int flags)
 {
 	struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
-	int rc;
-
-	if (!(lower_dentry->d_flags & DCACHE_OP_REVALIDATE))
-		return 1;
+	int rc = 1;
 
 	if (flags & LOOKUP_RCU)
 		return -ECHILD;
 
-	rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags);
+	if (lower_dentry->d_flags & DCACHE_OP_REVALIDATE)
+		rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags);
+
 	if (dentry->d_inode) {
-		struct inode *lower_inode =
-			ecryptfs_inode_to_lower(dentry->d_inode);
+		struct inode *inode = dentry->d_inode;
 
-		fsstack_copy_attr_all(dentry->d_inode, lower_inode);
+		fsstack_copy_attr_all(inode, ecryptfs_inode_to_lower(inode));
+		if (!inode->i_nlink)
+			return 0;
 	}
 	return rc;
 }

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

* [PATCH 3.16.y-ckt 049/133] libxfs: readahead of dir3 data blocks should use the read verifier
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (47 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 048/133] eCryptfs: Invalidate dcache entries when lower i_nlink is zero Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 050/133] xfs: Fix xfs_attr_leafblock definition Luis Henriques
                   ` (83 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Darrick J. Wong, Dave Chinner, Luis Henriques

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

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

From: "Darrick J. Wong" <darrick.wong@oracle.com>

commit 2f123bce18943fff819bc10f8868ffb9149fc622 upstream.

In the dir3 data block readahead function, use the regular read
verifier to check the block's CRC and spot-check the block contents
instead of directly calling only the spot-checking routine.  This
prevents corrupted directory data blocks from being read into the
kernel, which can lead to garbage ls output and directory loops (if
say one of the entries contains slashes and other junk).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
[ luis: backported to 3.16:
  - file rename: fs/xfs/libxfs/xfs_dir2_data.c -> fs/xfs/xfs_dir2_data.c
  - adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/xfs/xfs_dir2_data.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index 8c2f6422648e..a32a935e3800 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -253,7 +253,8 @@ xfs_dir3_data_reada_verify(
 		return;
 	case cpu_to_be32(XFS_DIR2_DATA_MAGIC):
 	case cpu_to_be32(XFS_DIR3_DATA_MAGIC):
-		xfs_dir3_data_verify(bp);
+		bp->b_ops = &xfs_dir3_data_buf_ops;
+		bp->b_ops->verify_read(bp);
 		return;
 	default:
 		xfs_buf_ioerror(bp, EFSCORRUPTED);

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

* [PATCH 3.16.y-ckt 050/133] xfs: Fix xfs_attr_leafblock definition
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (48 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 049/133] libxfs: readahead of dir3 data blocks should use the read verifier Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 051/133] arm64: kconfig: Move LIST_POISON to a safe value Luis Henriques
                   ` (82 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Jan Kara, Dave Chinner, Luis Henriques

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

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

From: Jan Kara <jack@suse.com>

commit ffeecc5213024ae663377b442eedcfbacf6d0c5d upstream.

struct xfs_attr_leafblock contains 'entries' array which is declared
with size 1 altough it can in fact contain much more entries. Since this
array is followed by further struct members, gcc (at least in version
4.8.3) thinks that the array has the fixed size of 1 element and thus
may optimize away all accesses beyond the end of array resulting in
non-working code. This problem was only observed with userspace code in
xfsprogs, however it's better to be safe in kernel as well and have
matching kernel and xfsprogs definitions.

Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
[ luis: backported to 3.16:
  - file rename: fs/xfs/libxfs/xfs_da_format.h -> fs/xfs/xfs_da_format.h ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/xfs/xfs_da_format.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_da_format.h b/fs/xfs/xfs_da_format.h
index 0a49b0286372..3b4d3041e611 100644
--- a/fs/xfs/xfs_da_format.h
+++ b/fs/xfs/xfs_da_format.h
@@ -680,8 +680,15 @@ typedef struct xfs_attr_leaf_name_remote {
 typedef struct xfs_attr_leafblock {
 	xfs_attr_leaf_hdr_t	hdr;	/* constant-structure header block */
 	xfs_attr_leaf_entry_t	entries[1];	/* sorted on key, not name */
-	xfs_attr_leaf_name_local_t namelist;	/* grows from bottom of buf */
-	xfs_attr_leaf_name_remote_t valuelist;	/* grows from bottom of buf */
+	/*
+	 * The rest of the block contains the following structures after the
+	 * leaf entries, growing from the bottom up. The variables are never
+	 * referenced and definining them can actually make gcc optimize away
+	 * accesses to the 'entries' array above index 0 so don't do that.
+	 *
+	 * xfs_attr_leaf_name_local_t namelist;
+	 * xfs_attr_leaf_name_remote_t valuelist;
+	 */
 } xfs_attr_leafblock_t;
 
 /*

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

* [PATCH 3.16.y-ckt 051/133] arm64: kconfig: Move LIST_POISON to a safe value
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (49 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 050/133] xfs: Fix xfs_attr_leafblock definition Luis Henriques
@ 2015-09-30  9:49 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 052/133] Btrfs: check if previous transaction aborted to avoid fs corruption Luis Henriques
                   ` (81 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:49 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thierry Strudel, Jeff Vander Stoep, Will Deacon, Luis Henriques

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

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

From: Jeff Vander Stoep <jeffv@google.com>

commit bf0c4e04732479f650ff59d1ee82de761c0071f0 upstream.

Move the poison pointer offset to 0xdead000000000000, a
recognized value that is not mappable by user-space exploits.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm64/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 839f48c26ef0..316ed8cf5bc0 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -81,6 +81,10 @@ config NO_IOPORT_MAP
 config STACKTRACE_SUPPORT
 	def_bool y
 
+config ILLEGAL_POINTER_VALUE
+	hex
+	default 0xdead000000000000
+
 config LOCKDEP_SUPPORT
 	def_bool y
 

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

* [PATCH 3.16.y-ckt 052/133] Btrfs: check if previous transaction aborted to avoid fs corruption
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (50 preceding siblings ...)
  2015-09-30  9:49 ` [PATCH 3.16.y-ckt 051/133] arm64: kconfig: Move LIST_POISON to a safe value Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers Luis Henriques
                   ` (80 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Filipe Manana, Chris Mason, Luis Henriques

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

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

From: Filipe Manana <fdmanana@suse.com>

commit 1f9b8c8fbc9a4d029760b16f477b9d15500e3a34 upstream.

While we are committing a transaction, it's possible the previous one is
still finishing its commit and therefore we wait for it to finish first.
However we were not checking if that previous transaction ended up getting
aborted after we waited for it to commit, so we ended up committing the
current transaction which can lead to fs corruption because the new
superblock can point to trees that have had one or more nodes/leafs that
were never durably persisted.
The following sequence diagram exemplifies how this is possible:

          CPU 0                                                        CPU 1

  transaction N starts

  (...)

  btrfs_commit_transaction(N)

    cur_trans->state = TRANS_STATE_COMMIT_START;
    (...)
    cur_trans->state = TRANS_STATE_COMMIT_DOING;
    (...)

    cur_trans->state = TRANS_STATE_UNBLOCKED;
    root->fs_info->running_transaction = NULL;

                                                              btrfs_start_transaction()
                                                                 --> starts transaction N + 1

    btrfs_write_and_wait_transaction(trans, root);
      --> starts writing all new or COWed ebs created
          at transaction N

                                                              creates some new ebs, COWs some
                                                              existing ebs but doesn't COW or
                                                              deletes eb X

                                                              btrfs_commit_transaction(N + 1)
                                                                (...)
                                                                cur_trans->state = TRANS_STATE_COMMIT_START;
                                                                (...)
                                                                wait_for_commit(root, prev_trans);
                                                                  --> prev_trans == transaction N

    btrfs_write_and_wait_transaction() continues
    writing ebs
       --> fails writing eb X, we abort transaction N
           and set bit BTRFS_FS_STATE_ERROR on
           fs_info->fs_state, so no new transactions
           can start after setting that bit

       cleanup_transaction()
         btrfs_cleanup_one_transaction()
           wakes up task at CPU 1

                                                                continues, doesn't abort because
                                                                cur_trans->aborted (transaction N + 1)
                                                                is zero, and no checks for bit
                                                                BTRFS_FS_STATE_ERROR in fs_info->fs_state
                                                                are made

                                                                btrfs_write_and_wait_transaction(trans, root);
                                                                  --> succeeds, no errors during writeback

                                                                write_ctree_super(trans, root, 0);
                                                                  --> succeeds
                                                                  --> we have now a superblock that points us
                                                                      to some root that uses eb X, which was
                                                                      never written to disk

In this scenario future attempts to read eb X from disk results in an
error message like "parent transid verify failed on X wanted Y found Z".

So fix this by aborting the current transaction if after waiting for the
previous transaction we verify that it was aborted.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/btrfs/transaction.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 3807fffb1c33..0309af907e21 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1733,8 +1733,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
 			spin_unlock(&root->fs_info->trans_lock);
 
 			wait_for_commit(root, prev_trans);
+			ret = prev_trans->aborted;
 
 			btrfs_put_transaction(prev_trans);
+			if (ret)
+				goto cleanup_transaction;
 		} else {
 			spin_unlock(&root->fs_info->trans_lock);
 		}

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

* [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (51 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 052/133] Btrfs: check if previous transaction aborted to avoid fs corruption Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-10-15  3:23   ` Ben Hutchings
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 054/133] DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd Luis Henriques
                   ` (79 subsequent siblings)
  132 siblings, 1 reply; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Benjamin Cama, Gregory CLEMENT, Luis Henriques

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

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

From: Benjamin Cama <benoar@dolka.fr>

commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.

Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
Fix this by increasing all interrupts by one, as did 5d6bed2a9c8b for
dove. Also, force MULTI_IRQ_HANDLER for all orion platforms (including
dove) as the specific handler is needed to shift back IRQ numbers by
one.

[gregory.clement@free-electrons.com]: moved the select
MULTI_IRQ_HANDLER from PLAT_ORION_LEGACY to ARCH_ORION5X as it broke
the build for dove.

Fixes: a71b092a9c68 ("ARM: Convert handle_IRQ to use __handle_domain_irq")
Signed-off-by: Benjamin Cama <benoar@dolka.fr>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Tested-by: Detlef Vollmann <dv@vollmann.ch>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/Kconfig                          |  1 +
 arch/arm/mach-orion5x/include/mach/irqs.h | 64 +++++++++++++++----------------
 arch/arm/mach-orion5x/irq.c               |  4 +-
 3 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 290f02ee0157..f32418a0cd18 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -565,6 +565,7 @@ config ARCH_ORION5X
 	select MVEBU_MBUS
 	select PCI
 	select PLAT_ORION_LEGACY
+	select MULTI_IRQ_HANDLER
 	help
 	  Support for the following Marvell Orion 5x series SoCs:
 	  Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
diff --git a/arch/arm/mach-orion5x/include/mach/irqs.h b/arch/arm/mach-orion5x/include/mach/irqs.h
index a6fa9d8f12d8..2431d9923427 100644
--- a/arch/arm/mach-orion5x/include/mach/irqs.h
+++ b/arch/arm/mach-orion5x/include/mach/irqs.h
@@ -16,42 +16,42 @@
 /*
  * Orion Main Interrupt Controller
  */
-#define IRQ_ORION5X_BRIDGE		0
-#define IRQ_ORION5X_DOORBELL_H2C	1
-#define IRQ_ORION5X_DOORBELL_C2H	2
-#define IRQ_ORION5X_UART0		3
-#define IRQ_ORION5X_UART1		4
-#define IRQ_ORION5X_I2C			5
-#define IRQ_ORION5X_GPIO_0_7		6
-#define IRQ_ORION5X_GPIO_8_15		7
-#define IRQ_ORION5X_GPIO_16_23		8
-#define IRQ_ORION5X_GPIO_24_31		9
-#define IRQ_ORION5X_PCIE0_ERR		10
-#define IRQ_ORION5X_PCIE0_INT		11
-#define IRQ_ORION5X_USB1_CTRL		12
-#define IRQ_ORION5X_DEV_BUS_ERR		14
-#define IRQ_ORION5X_PCI_ERR		15
-#define IRQ_ORION5X_USB_BR_ERR		16
-#define IRQ_ORION5X_USB0_CTRL		17
-#define IRQ_ORION5X_ETH_RX		18
-#define IRQ_ORION5X_ETH_TX		19
-#define IRQ_ORION5X_ETH_MISC		20
-#define IRQ_ORION5X_ETH_SUM		21
-#define IRQ_ORION5X_ETH_ERR		22
-#define IRQ_ORION5X_IDMA_ERR		23
-#define IRQ_ORION5X_IDMA_0		24
-#define IRQ_ORION5X_IDMA_1		25
-#define IRQ_ORION5X_IDMA_2		26
-#define IRQ_ORION5X_IDMA_3		27
-#define IRQ_ORION5X_CESA		28
-#define IRQ_ORION5X_SATA		29
-#define IRQ_ORION5X_XOR0		30
-#define IRQ_ORION5X_XOR1		31
+#define IRQ_ORION5X_BRIDGE		(1 + 0)
+#define IRQ_ORION5X_DOORBELL_H2C	(1 + 1)
+#define IRQ_ORION5X_DOORBELL_C2H	(1 + 2)
+#define IRQ_ORION5X_UART0		(1 + 3)
+#define IRQ_ORION5X_UART1		(1 + 4)
+#define IRQ_ORION5X_I2C			(1 + 5)
+#define IRQ_ORION5X_GPIO_0_7		(1 + 6)
+#define IRQ_ORION5X_GPIO_8_15		(1 + 7)
+#define IRQ_ORION5X_GPIO_16_23		(1 + 8)
+#define IRQ_ORION5X_GPIO_24_31		(1 + 9)
+#define IRQ_ORION5X_PCIE0_ERR		(1 + 10)
+#define IRQ_ORION5X_PCIE0_INT		(1 + 11)
+#define IRQ_ORION5X_USB1_CTRL		(1 + 12)
+#define IRQ_ORION5X_DEV_BUS_ERR		(1 + 14)
+#define IRQ_ORION5X_PCI_ERR		(1 + 15)
+#define IRQ_ORION5X_USB_BR_ERR		(1 + 16)
+#define IRQ_ORION5X_USB0_CTRL		(1 + 17)
+#define IRQ_ORION5X_ETH_RX		(1 + 18)
+#define IRQ_ORION5X_ETH_TX		(1 + 19)
+#define IRQ_ORION5X_ETH_MISC		(1 + 20)
+#define IRQ_ORION5X_ETH_SUM		(1 + 21)
+#define IRQ_ORION5X_ETH_ERR		(1 + 22)
+#define IRQ_ORION5X_IDMA_ERR		(1 + 23)
+#define IRQ_ORION5X_IDMA_0		(1 + 24)
+#define IRQ_ORION5X_IDMA_1		(1 + 25)
+#define IRQ_ORION5X_IDMA_2		(1 + 26)
+#define IRQ_ORION5X_IDMA_3		(1 + 27)
+#define IRQ_ORION5X_CESA		(1 + 28)
+#define IRQ_ORION5X_SATA		(1 + 29)
+#define IRQ_ORION5X_XOR0		(1 + 30)
+#define IRQ_ORION5X_XOR1		(1 + 31)
 
 /*
  * Orion General Purpose Pins
  */
-#define IRQ_ORION5X_GPIO_START	32
+#define IRQ_ORION5X_GPIO_START	33
 #define NR_GPIO_IRQS		32
 
 #define NR_IRQS			(IRQ_ORION5X_GPIO_START + NR_GPIO_IRQS)
diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c
index cd4bac4d7e43..086ecb87d885 100644
--- a/arch/arm/mach-orion5x/irq.c
+++ b/arch/arm/mach-orion5x/irq.c
@@ -42,7 +42,7 @@ __exception_irq_entry orion5x_legacy_handle_irq(struct pt_regs *regs)
 	stat = readl_relaxed(MAIN_IRQ_CAUSE);
 	stat &= readl_relaxed(MAIN_IRQ_MASK);
 	if (stat) {
-		unsigned int hwirq = __fls(stat);
+		unsigned int hwirq = 1 + __fls(stat);
 		handle_IRQ(hwirq, regs);
 		return;
 	}
@@ -51,7 +51,7 @@ __exception_irq_entry orion5x_legacy_handle_irq(struct pt_regs *regs)
 
 void __init orion5x_init_irq(void)
 {
-	orion_irq_init(0, MAIN_IRQ_MASK);
+	orion_irq_init(1, MAIN_IRQ_MASK);
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER
 	set_handle_irq(orion5x_legacy_handle_irq);

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

* [PATCH 3.16.y-ckt 054/133] DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (52 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 055/133] xfs: Fix file type directory corruption for btree directories Luis Henriques
                   ` (78 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Stephen Chandler Paul, Alex Deucher, Luis Henriques

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

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

From: Stephen Chandler Paul <cpaul@redhat.com>

commit 924f92bf12bfbef3662619e3ed24a1cea7c1cbcd upstream.

Most of the time this isn't an issue since hotplugging an adaptor will
trigger a crtc mode change which in turn, causes the driver to probe
every DisplayPort for a dpcd. However, in cases where hotplugging
doesn't cause a mode change (specifically when one unplugs a monitor
from a DisplayPort connector, then plugs that same monitor back in
seconds later on the same port without any other monitors connected), we
never probe for the dpcd before starting the initial link training. What
happens from there looks like this:

	- GPU has only one monitor connected. It's connected via
	  DisplayPort, and does not go through an adaptor of any sort.

	- User unplugs DisplayPort connector from GPU.

	- Change in HPD is detected by the driver, we probe every
	  DisplayPort for a possible connection.

	- Probe the port the user originally had the monitor connected
	  on for it's dpcd. This fails, and we clear the first (and only
	  the first) byte of the dpcd to indicate we no longer have a
	  dpcd for this port.

	- User plugs the previously disconnected monitor back into the
	  same DisplayPort.

	- radeon_connector_hotplug() is called before everyone else,
	  and tries to handle the link training. Since only the first
	  byte of the dpcd is zeroed, the driver is able to complete
	  link training but does so against the wrong dpcd, causing it
	  to initialize the link with the wrong settings.

	- Display stays blank (usually), dpcd is probed after the
	  initial link training, and the driver prints no obvious
	  messages to the log.

In theory, since only one byte of the dpcd is chopped off (specifically,
the byte that contains the revision information for DisplayPort), it's
not entirely impossible that this bug may not show on certain monitors.
For instance, the only reason this bug was visible on my ASUS PB238
monitor was due to the fact that this monitor using the enhanced framing
symbol sequence, the flag for which is ignored if the radeon driver
thinks that the DisplayPort version is below 1.1.

Signed-off-by: Stephen Chandler Paul <cpaul@redhat.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index eb76aa72466c..508eed9f8071 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -72,6 +72,11 @@ void radeon_connector_hotplug(struct drm_connector *connector)
 			if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
 				drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
 			} else if (radeon_dp_needs_link_train(radeon_connector)) {
+				/* Don't try to start link training before we
+				 * have the dpcd */
+				if (!radeon_dp_getdpcd(radeon_connector))
+					return;
+
 				/* set it to OFF so that drm_helper_connector_dpms()
 				 * won't return immediately since the current state
 				 * is ON at this point.

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

* [PATCH 3.16.y-ckt 055/133] xfs: Fix file type directory corruption for btree directories
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (53 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 054/133] DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 056/133] sched: Fix cpu_active_mask/cpu_online_mask race Luis Henriques
                   ` (77 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Jan Kara, Dave Chinner, Luis Henriques

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

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

From: Jan Kara <jack@suse.com>

commit 037542345a82aaaa228ec280fe6ddff1568d169f upstream.

Users have occasionally reported that file type for some directory
entries is wrong. This mostly happened after updating libraries some
libraries. After some debugging the problem was traced down to
xfs_dir2_node_replace(). The function uses args->filetype as a file type
to store in the replaced directory entry however it also calls
xfs_da3_node_lookup_int() which will store file type of the current
directory entry in args->filetype. Thus we fail to change file type of a
directory entry to a proper type.

Fix the problem by storing new file type in a local variable before
calling xfs_da3_node_lookup_int().

Reported-by: Giacomo Comes <comes@naic.edu>
Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
[ luis: backported to 3.16:
  - file rename: fs/xfs/libxfs/xfs_dir2_node.c -> fs/xfs/xfs_dir2_node.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/xfs/xfs_dir2_node.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index da43d304fca2..436d7ce80cb5 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -2144,6 +2144,7 @@ xfs_dir2_node_replace(
 	int			error;		/* error return value */
 	int			i;		/* btree level */
 	xfs_ino_t		inum;		/* new inode number */
+	int			ftype;		/* new file type */
 	xfs_dir2_leaf_t		*leaf;		/* leaf structure */
 	xfs_dir2_leaf_entry_t	*lep;		/* leaf entry being changed */
 	int			rval;		/* internal return value */
@@ -2157,7 +2158,14 @@ xfs_dir2_node_replace(
 	state = xfs_da_state_alloc();
 	state->args = args;
 	state->mp = args->dp->i_mount;
+
+	/*
+	 * We have to save new inode number and ftype since
+	 * xfs_da3_node_lookup_int() is going to overwrite them
+	 */
 	inum = args->inumber;
+	ftype = args->filetype;
+
 	/*
 	 * Lookup the entry to change in the btree.
 	 */
@@ -2195,7 +2203,7 @@ xfs_dir2_node_replace(
 		 * Fill in the new inode number and log the entry.
 		 */
 		dep->inumber = cpu_to_be64(inum);
-		args->dp->d_ops->data_put_ftype(dep, args->filetype);
+		args->dp->d_ops->data_put_ftype(dep, ftype);
 		xfs_dir2_data_log_entry(args, state->extrablk.bp, dep);
 		rval = 0;
 	}

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

* [PATCH 3.16.y-ckt 056/133] sched: Fix cpu_active_mask/cpu_online_mask race
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (54 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 055/133] xfs: Fix file type directory corruption for btree directories Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 057/133] rtlwifi: rtl8192cu: Add new device ID Luis Henriques
                   ` (76 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jan H. Schönherr, Anton Blanchard, Borislav Petkov,
	Joerg Roedel, Linus Torvalds, Matt Wilson, Michael Ellerman,
	Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Luis Henriques

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

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

From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= <jschoenh@amazon.de>

commit dd9d3843755da95f63dd3a376f62b3e45c011210 upstream.

There is a race condition in SMP bootup code, which may result
in

    WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
    workqueue_cpu_up_callback()
or
    kernel BUG at kernel/smpboot.c:135!

It can be triggered with a bit of luck in Linux guests running
on busy hosts.

	CPU0                        CPUn
	====                        ====

	_cpu_up()
	  __cpu_up()
				    start_secondary()
				      set_cpu_online()
					cpumask_set_cpu(cpu,
						   to_cpumask(cpu_online_bits));
	  cpu_notify(CPU_ONLINE)
	    <do stuff, see below>
					cpumask_set_cpu(cpu,
						   to_cpumask(cpu_active_bits));

During the various CPU_ONLINE callbacks CPUn is online but not
active. Several things can go wrong at that point, depending on
the scheduling of tasks on CPU0.

Variant 1:

  cpu_notify(CPU_ONLINE)
    workqueue_cpu_up_callback()
      rebind_workers()
        set_cpus_allowed_ptr()

  This call fails because it requires an active CPU; rebind_workers()
  ends with a warning:

    WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
    workqueue_cpu_up_callback()

Variant 2:

  cpu_notify(CPU_ONLINE)
    smpboot_thread_call()
      smpboot_unpark_threads()
       ..
        __kthread_unpark()
          __kthread_bind()
          wake_up_state()
           ..
            select_task_rq()
              select_fallback_rq()

  The ->wake_cpu of the unparked thread is not allowed, making a call
  to select_fallback_rq() necessary. Then, select_fallback_rq() cannot
  find an allowed, active CPU and promptly resets the allowed CPUs, so
  that the task in question ends up on CPU0.

  When those unparked tasks are eventually executed, they run
  immediately into a BUG:

    kernel BUG at kernel/smpboot.c:135!

Just changing the order in which the online/active bits are set
(and adding some memory barriers), would solve the two issues
above. However, it would change the order of operations back to
the one before commit 6acbfb96976f ("sched: Fix hotplug vs.
set_cpus_allowed_ptr()"), thus, reintroducing that particular
problem.

Going further back into history, we have at least the following
commits touching this topic:
- commit 2baab4e90495 ("sched: Fix select_fallback_rq() vs cpu_active/cpu_online")
- commit 5fbd036b552f ("sched: Cleanup cpu_active madness")

Together, these give us the following non-working solutions:

  - secondary CPU sets active before online, because active is assumed to
    be a subset of online;

  - secondary CPU sets online before active, because the primary CPU
    assumes that an online CPU is also active;

  - secondary CPU sets online and waits for primary CPU to set active,
    because it might deadlock.

Commit 875ebe940d77 ("powerpc/smp: Wait until secondaries are
active & online") introduces an arch-specific solution to this
arch-independent problem.

Now, go for a more general solution without explicit waiting and
simply set active twice: once on the secondary CPU after online
was set and once on the primary CPU after online was seen.

set_cpus_allowed_ptr()")

Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Anton Blanchard <anton@samba.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Wilson <msw@amazon.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 6acbfb96976f ("sched: Fix hotplug vs. set_cpus_allowed_ptr()")
Link: http://lkml.kernel.org/r/1439408156-18840-1-git-send-email-jschoenh@amazon.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/sched/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5c89af9ea192..f06dcf7dcd00 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5174,6 +5174,14 @@ static int sched_cpu_active(struct notifier_block *nfb,
 	case CPU_STARTING:
 		set_cpu_rq_start_time();
 		return NOTIFY_OK;
+	case CPU_ONLINE:
+		/*
+		 * At this point a starting CPU has marked itself as online via
+		 * set_cpu_online(). But it might not yet have marked itself
+		 * as active, which is essential from here on.
+		 *
+		 * Thus, fall-through and help the starting CPU along.
+		 */
 	case CPU_DOWN_FAILED:
 		set_cpu_active((long)hcpu, true);
 		return NOTIFY_OK;

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

* [PATCH 3.16.y-ckt 057/133] rtlwifi: rtl8192cu: Add new device ID
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (55 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 056/133] sched: Fix cpu_active_mask/cpu_online_mask race Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 058/133] of/address: Don't loop forever in of_find_matching_node_by_address() Luis Henriques
                   ` (75 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Adrien Schildknecht, Kalle Valo, Luis Henriques

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

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

From: Adrien Schildknecht <adrien+dev@schischi.me>

commit 1642d09fb9b128e8e538b2a4179962a34f38dff9 upstream.

The v2 of NetGear WNA1000M uses a different idProduct: USB ID 0846:9043

Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 7ada8cb0f0da..3776948600e3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -314,6 +314,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
 	{RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
 	{RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
 	{RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/
+	{RTL_USB_DEVICE(0x0846, 0x9043, rtl92cu_hal_cfg)}, /*NG WNA1000Mv2*/
 	{RTL_USB_DEVICE(0x0b05, 0x17ba, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
 	{RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
 	{RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/

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

* [PATCH 3.16.y-ckt 058/133] of/address: Don't loop forever in of_find_matching_node_by_address().
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (56 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 057/133] rtlwifi: rtl8192cu: Add new device ID Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 059/133] drivercore: Fix unregistration path of platform devices Luis Henriques
                   ` (74 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Daney, Rob Herring, Luis Henriques

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

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

From: David Daney <david.daney@cavium.com>

commit 3a496b00b6f90c41bd21a410871dfc97d4f3c7ab upstream.

If the internal call to of_address_to_resource() fails, we end up
looping forever in of_find_matching_node_by_address().  This can be
caused by a defective device tree, or calling with an incorrect
matches argument.

Fix by calling of_find_matching_node() unconditionally at the end of
the loop.

Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/of/address.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/address.c b/drivers/of/address.c
index bab28871b992..5af2a0deff14 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -691,10 +691,10 @@ struct device_node *of_find_matching_node_by_address(struct device_node *from,
 	struct resource res;
 
 	while (dn) {
-		if (of_address_to_resource(dn, 0, &res))
-			continue;
-		if (res.start == base_address)
+		if (!of_address_to_resource(dn, 0, &res) &&
+		    res.start == base_address)
 			return dn;
+
 		dn = of_find_matching_node(dn, matches);
 	}
 

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

* [PATCH 3.16.y-ckt 059/133] drivercore: Fix unregistration path of platform devices
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (57 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 058/133] of/address: Don't loop forever in of_find_matching_node_by_address() Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 060/133] arm64: flush FP/SIMD state correctly after execve() Luis Henriques
                   ` (73 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Pantelis Antoniou, Wolfram Sang, Rob Herring, Greg Kroah-Hartman,
	Ricardo Ribalda Delgado, Grant Likely, Luis Henriques

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

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

From: Grant Likely <grant.likely@linaro.org>

commit 7f5dcaf1fdf289767a126a0a5cc3ef39b5254b06 upstream.

The unregister path of platform_device is broken. On registration, it
will register all resources with either a parent already set, or
type==IORESOURCE_{IO,MEM}. However, on unregister it will release
everything with type==IORESOURCE_{IO,MEM}, but ignore the others. There
are also cases where resources don't get registered in the first place,
like with devices created by of_platform_populate()*.

Fix the unregister path to be symmetrical with the register path by
checking the parent pointer instead of the type field to decide which
resources to unregister. This is safe because the upshot of the
registration path algorithm is that registered resources have a parent
pointer, and non-registered resources do not.

* It can be argued that of_platform_populate() should be registering
  it's resources, and they argument has some merit. However, there are
  quite a few platforms that end up broken if we try to do that due to
  overlapping resources in the device tree. Until that is fixed, we need
  to solve the immediate problem.

Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/base/platform.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index eee48c49f5de..9106f3046569 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -362,9 +362,7 @@ int platform_device_add(struct platform_device *pdev)
 
 	while (--i >= 0) {
 		struct resource *r = &pdev->resource[i];
-		unsigned long type = resource_type(r);
-
-		if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
+		if (r->parent)
 			release_resource(r);
 	}
 
@@ -395,9 +393,7 @@ void platform_device_del(struct platform_device *pdev)
 
 		for (i = 0; i < pdev->num_resources; i++) {
 			struct resource *r = &pdev->resource[i];
-			unsigned long type = resource_type(r);
-
-			if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
+			if (r->parent)
 				release_resource(r);
 		}
 	}

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

* [PATCH 3.16.y-ckt 060/133] arm64: flush FP/SIMD state correctly after execve()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (58 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 059/133] drivercore: Fix unregistration path of platform devices Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 061/133] xfs: return errors from partial I/O failures to files Luis Henriques
                   ` (72 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ard Biesheuvel, Will Deacon, Luis Henriques

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

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

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

commit 674c242c9323d3c293fc4f9a3a3a619fe3063290 upstream.

When a task calls execve(), its FP/SIMD state is flushed so that
none of the original program state is observeable by the incoming
program.

However, since this flushing consists of setting the in-memory copy
of the FP/SIMD state to all zeroes, the CPU field is set to CPU 0 as
well, which indicates to the lazy FP/SIMD preserve/restore code that
the FP/SIMD state does not need to be reread from memory if the task
is scheduled again on CPU 0 without any other tasks having entered
userland (or used the FP/SIMD in kernel mode) on the same CPU in the
mean time. If this happens, the FP/SIMD state of the old program will
still be present in the registers when the new program starts.

So set the CPU field to the invalid value of NR_CPUS when performing
the flush, by calling fpsimd_flush_task_state().

Reported-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Reported-by: Janet Liu <janet.liu@spreadtrum.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm64/kernel/fpsimd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index ad8aebb1cdef..a43a40b6a846 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -157,6 +157,7 @@ void fpsimd_thread_switch(struct task_struct *next)
 void fpsimd_flush_thread(void)
 {
 	memset(&current->thread.fpsimd_state, 0, sizeof(struct fpsimd_state));
+	fpsimd_flush_task_state(current);
 	set_thread_flag(TIF_FOREIGN_FPSTATE);
 }
 

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

* [PATCH 3.16.y-ckt 061/133] xfs: return errors from partial I/O failures to files
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (59 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 060/133] arm64: flush FP/SIMD state correctly after execve() Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 062/133] ALSA: usb-audio: correct the value cache check Luis Henriques
                   ` (71 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Jeffery, Dave Chinner, Luis Henriques

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

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

From: David Jeffery <djeffery@redhat.com>

commit c9eb256eda4420c06bb10f5e8fbdbe1a34bc98e0 upstream.

There is an issue with xfs's error reporting in some cases of I/O partially
failing and partially succeeding. Calls like fsync() can report success even
though not all I/O was successful in partial-failure cases such as one disk of
a RAID0 array being offline.

The issue can occur when there are more than one bio per xfs_ioend struct.
Each call to xfs_end_bio() for a bio completing will write a value to
ioend->io_error.  If a successful bio completes after any failed bio, no
error is reported do to it writing 0 over the error code set by any failed bio.
The I/O error information is now lost and when the ioend is completed
only success is reported back up the filesystem stack.

xfs_end_bio() should only set ioend->io_error in the case of BIO_UPTODATE
being clear.  ioend->io_error is initialized to 0 at allocation so only needs
to be updated by a failed bio. Also check that ioend->io_error is 0 so that
the first error reported will be the error code returned.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/xfs/xfs_aops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 4ff074bc2a7d..3fc699ea7ba0 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -377,7 +377,8 @@ xfs_end_bio(
 	xfs_ioend_t		*ioend = bio->bi_private;
 
 	ASSERT(atomic_read(&bio->bi_cnt) >= 1);
-	ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error;
+	if (!ioend->io_error && !test_bit(BIO_UPTODATE, &bio->bi_flags))
+		ioend->io_error = error;
 
 	/* Toss bio and pass work off to an xfsdatad thread */
 	bio->bi_private = NULL;

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

* [PATCH 3.16.y-ckt 062/133] ALSA: usb-audio: correct the value cache check.
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (60 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 061/133] xfs: return errors from partial I/O failures to files Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 063/133] IB/qib: Change lkey table allocation to support more MRs Luis Henriques
                   ` (70 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yao-Wen Mao, Takashi Iwai, Luis Henriques

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

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

From: Yao-Wen Mao <yaowen@google.com>

commit 6aa6925cad06159dc6e25857991bbc4960821242 upstream.

The check of cval->cached should be zero-based (including master channel).

Signed-off-by: Yao-Wen Mao <yaowen@google.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/usb/mixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index f6d4967a652a..1550e15e9179 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2529,7 +2529,7 @@ static int restore_mixer_value(struct usb_mixer_elem_info *cval)
 		for (c = 0; c < MAX_CHANNELS; c++) {
 			if (!(cval->cmask & (1 << c)))
 				continue;
-			if (cval->cached & (1 << c)) {
+			if (cval->cached & (1 << (c + 1))) {
 				err = set_cur_mix_value(cval, c + 1, idx,
 							cval->cache_val[idx]);
 				if (err < 0)

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

* [PATCH 3.16.y-ckt 063/133] IB/qib: Change lkey table allocation to support more MRs
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (61 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 062/133] ALSA: usb-audio: correct the value cache check Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 064/133] drm/radeon/atom: Send out the full AUX address Luis Henriques
                   ` (69 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mike Marciniszyn, Doug Ledford, Luis Henriques

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

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

From: Mike Marciniszyn <mike.marciniszyn@intel.com>

commit d6f1c17e162b2a11e708f28fa93f2f79c164b442 upstream.

The lkey table is allocated with with a get_user_pages() with an
order based on a number of index bits from a module parameter.

The underlying kernel code cannot allocate that many contiguous pages.

There is no reason the underlying memory needs to be physically
contiguous.

This patch:
- switches the allocation/deallocation to vmalloc/vfree
- caps the number of bits to 23 to insure at least 1 generation bit
  o this matches the module parameter description

Reviewed-by: Vinit Agnihotri <vinit.abhay.agnihotri@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/hw/qib/qib_keys.c  |  4 ++++
 drivers/infiniband/hw/qib/qib_verbs.c | 14 ++++++++++----
 drivers/infiniband/hw/qib/qib_verbs.h |  2 ++
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c
index 3b9afccaaade..eabe54738be6 100644
--- a/drivers/infiniband/hw/qib/qib_keys.c
+++ b/drivers/infiniband/hw/qib/qib_keys.c
@@ -86,6 +86,10 @@ int qib_alloc_lkey(struct qib_mregion *mr, int dma_region)
 	 * unrestricted LKEY.
 	 */
 	rkt->gen++;
+	/*
+	 * bits are capped in qib_verbs.c to insure enough bits
+	 * for generation number
+	 */
 	mr->lkey = (r << (32 - ib_qib_lkey_table_size)) |
 		((((1 << (24 - ib_qib_lkey_table_size)) - 1) & rkt->gen)
 		 << 8);
diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
index 9bcfbd842980..40afdfce2fbc 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.c
+++ b/drivers/infiniband/hw/qib/qib_verbs.c
@@ -40,6 +40,7 @@
 #include <linux/rculist.h>
 #include <linux/mm.h>
 #include <linux/random.h>
+#include <linux/vmalloc.h>
 
 #include "qib.h"
 #include "qib_common.h"
@@ -2086,10 +2087,16 @@ int qib_register_ib_device(struct qib_devdata *dd)
 	 * the LKEY).  The remaining bits act as a generation number or tag.
 	 */
 	spin_lock_init(&dev->lk_table.lock);
+	/* insure generation is at least 4 bits see keys.c */
+	if (ib_qib_lkey_table_size > MAX_LKEY_TABLE_BITS) {
+		qib_dev_warn(dd, "lkey bits %u too large, reduced to %u\n",
+			ib_qib_lkey_table_size, MAX_LKEY_TABLE_BITS);
+		ib_qib_lkey_table_size = MAX_LKEY_TABLE_BITS;
+	}
 	dev->lk_table.max = 1 << ib_qib_lkey_table_size;
 	lk_tab_size = dev->lk_table.max * sizeof(*dev->lk_table.table);
 	dev->lk_table.table = (struct qib_mregion __rcu **)
-		__get_free_pages(GFP_KERNEL, get_order(lk_tab_size));
+		vmalloc(lk_tab_size);
 	if (dev->lk_table.table == NULL) {
 		ret = -ENOMEM;
 		goto err_lk;
@@ -2262,7 +2269,7 @@ err_tx:
 					sizeof(struct qib_pio_header),
 				  dev->pio_hdrs, dev->pio_hdrs_phys);
 err_hdrs:
-	free_pages((unsigned long) dev->lk_table.table, get_order(lk_tab_size));
+	vfree(dev->lk_table.table);
 err_lk:
 	kfree(dev->qp_table);
 err_qpt:
@@ -2316,8 +2323,7 @@ void qib_unregister_ib_device(struct qib_devdata *dd)
 					sizeof(struct qib_pio_header),
 				  dev->pio_hdrs, dev->pio_hdrs_phys);
 	lk_tab_size = dev->lk_table.max * sizeof(*dev->lk_table.table);
-	free_pages((unsigned long) dev->lk_table.table,
-		   get_order(lk_tab_size));
+	vfree(dev->lk_table.table);
 	kfree(dev->qp_table);
 }
 
diff --git a/drivers/infiniband/hw/qib/qib_verbs.h b/drivers/infiniband/hw/qib/qib_verbs.h
index bfc8948fdd35..44ca28c83fe6 100644
--- a/drivers/infiniband/hw/qib/qib_verbs.h
+++ b/drivers/infiniband/hw/qib/qib_verbs.h
@@ -647,6 +647,8 @@ struct qib_qpn_table {
 	struct qpn_map map[QPNMAP_ENTRIES];
 };
 
+#define MAX_LKEY_TABLE_BITS 23
+
 struct qib_lkey_table {
 	spinlock_t lock; /* protect changes in this struct */
 	u32 next;               /* next unused index (speeds search) */

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

* [PATCH 3.16.y-ckt 064/133] drm/radeon/atom: Send out the full AUX address
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (62 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 063/133] IB/qib: Change lkey table allocation to support more MRs Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 065/133] tg3: Fix temperature reporting Luis Henriques
                   ` (68 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alex Deucher, Christian König, Ville Syrjälä,
	Luis Henriques

3.16.7-ckt18 -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 3f8340cc72c9a1a4b49bce7802afd7f248400ef5 upstream.

AUX addresses are 20 bits long. Send out the entire address instead of
just the low 16 bits.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/atombios_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
index 41c2cd8954e7..f9db2aabc2ac 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -171,8 +171,9 @@ radeon_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 		return -E2BIG;
 
 	tx_buf[0] = msg->address & 0xff;
-	tx_buf[1] = msg->address >> 8;
-	tx_buf[2] = msg->request << 4;
+	tx_buf[1] = (msg->address >> 8) & 0xff;
+	tx_buf[2] = (msg->request << 4) |
+		((msg->address >> 16) & 0xf);
 	tx_buf[3] = msg->size ? (msg->size - 1) : 0;
 
 	switch (msg->request & ~DP_AUX_I2C_MOT) {

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

* [PATCH 3.16.y-ckt 065/133] tg3: Fix temperature reporting
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (63 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 064/133] drm/radeon/atom: Send out the full AUX address Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 066/133] drm/i915: Always mark the object as dirty when used by the GPU Luis Henriques
                   ` (67 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jean Delvare, Prashant Sreedharan, Michael Chan, David S. Miller,
	Luis Henriques

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

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

From: Jean Delvare <jdelvare@suse.de>

commit d3d11fe08ccc9bff174fc958722b5661f0932486 upstream.

The temperature registers appear to report values in degrees Celsius
while the hwmon API mandates values to be exposed in millidegrees
Celsius. Do the conversion so that the values reported by "sensors"
are correct.

Fixes: aed93e0bf493 ("tg3: Add hwmon support for temperature")
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Prashant Sreedharan <prashant@broadcom.com>
Cc: Michael Chan <mchan@broadcom.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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 73f7bdd1ebc9..24d42c6d0c66 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -10750,7 +10750,7 @@ static ssize_t tg3_show_temp(struct device *dev,
 	tg3_ape_scratchpad_read(tp, &temperature, attr->index,
 				sizeof(temperature));
 	spin_unlock_bh(&tp->lock);
-	return sprintf(buf, "%u\n", temperature);
+	return sprintf(buf, "%u\n", temperature * 1000);
 }
 
 

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

* [PATCH 3.16.y-ckt 066/133] drm/i915: Always mark the object as dirty when used by the GPU
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (64 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 065/133] tg3: Fix temperature reporting Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 067/133] Add radeon suspend/resume quirk for HP Compaq dc5750 Luis Henriques
                   ` (66 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Daniel Vetter, Kristian Høgsberg, Jesse Barnes,
	Goel, Akash, Michał Winiarski, Jani Nikula, Luis Henriques

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

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

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

commit 51bc140431e233284660b1d22c47dec9ecdb521e upstream.

There have been many hard to track down bugs whereby userspace forgot to
flag a write buffer and then cause graphics corruption or a hung GPU
when that buffer was later purged under memory pressure (as the buffer
appeared clean, its pages would have been evicted rather than preserved
and any changes more recent than in the backing storage would be lost).
In retrospect this is a rare optimisation against memory pressure,
already the slow path. If we always mark the buffer as dirty when
accessed by the GPU, anything not used can still be evicted cheaply
(ideal behaviour for mark-and-sweep eviction) but we do not run the risk
of corruption. For correct read serialisation, userspace still has to
notify when the GPU writes to an object. However, there are certain
situations under which userspace may wish to tell white lies to the
kernel...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "Goel, Akash" <akash.goel@intel.co>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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/i915_gem_execbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 3a30133f93e8..ebce39a0d921 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -965,6 +965,7 @@ i915_gem_execbuffer_move_to_active(struct list_head *vmas,
 		u32 old_read = obj->base.read_domains;
 		u32 old_write = obj->base.write_domain;
 
+		obj->dirty = 1; /* be paranoid  */
 		obj->base.write_domain = obj->base.pending_write_domain;
 		if (obj->base.write_domain == 0)
 			obj->base.pending_read_domains |= obj->base.read_domains;
@@ -973,7 +974,6 @@ i915_gem_execbuffer_move_to_active(struct list_head *vmas,
 
 		i915_vma_move_to_active(vma, ring);
 		if (obj->base.write_domain) {
-			obj->dirty = 1;
 			obj->last_write_seqno = intel_ring_get_seqno(ring);
 			/* check for potential scanout */
 			if (i915_gem_obj_ggtt_bound(obj) &&

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

* [PATCH 3.16.y-ckt 067/133] Add radeon suspend/resume quirk for HP Compaq dc5750.
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (65 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 066/133] drm/i915: Always mark the object as dirty when used by the GPU Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 068/133] IB/uverbs: reject invalid or unknown opcodes Luis Henriques
                   ` (65 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jeffery Miller, Alex Deucher, Luis Henriques

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

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

From: Jeffery Miller <jmiller@neverware.com>

commit 09bfda10e6efd7b65bcc29237bee1765ed779657 upstream.

With the radeon driver loaded the HP Compaq dc5750
Small Form Factor machine fails to resume from suspend.
Adding a quirk similar to other devices avoids
the problem and the system resumes properly.

Signed-off-by: Jeffery Miller <jmiller@neverware.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_combios.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 79a266934327..fd2820ff9e5b 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -3387,6 +3387,14 @@ void radeon_combios_asic_init(struct drm_device *dev)
 	    rdev->pdev->subsystem_device == 0x30ae)
 		return;
 
+	/* quirk for rs4xx HP Compaq dc5750 Small Form Factor to make it resume
+	 * - it hangs on resume inside the dynclk 1 table.
+	 */
+	if (rdev->family == CHIP_RS480 &&
+	    rdev->pdev->subsystem_vendor == 0x103c &&
+	    rdev->pdev->subsystem_device == 0x280a)
+		return;
+
 	/* DYN CLK 1 */
 	table = combios_get_table_offset(dev, COMBIOS_DYN_CLK_1_TABLE);
 	if (table)

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

* [PATCH 3.16.y-ckt 068/133] IB/uverbs: reject invalid or unknown opcodes
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (66 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 067/133] Add radeon suspend/resume quirk for HP Compaq dc5750 Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 069/133] hpfs: update ctime and mtime on directory modification Luis Henriques
                   ` (64 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christoph Hellwig, Doug Ledford, Luis Henriques

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

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

From: Christoph Hellwig <hch@lst.de>

commit b632ffa7cee439ba5dce3b3bc4a5cbe2b3e20133 upstream.

We have many WR opcodes that are only supported in kernel space
and/or require optional information to be copied into the WR
structure.  Reject all those not explicitly handled so that we
can't pass invalid information to drivers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/core/uverbs_cmd.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 2adc14372b94..5e66eab292d8 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -2111,6 +2111,12 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
 		next->send_flags = user_wr->send_flags;
 
 		if (is_ud) {
+			if (next->opcode != IB_WR_SEND &&
+			    next->opcode != IB_WR_SEND_WITH_IMM) {
+				ret = -EINVAL;
+				goto out_put;
+			}
+
 			next->wr.ud.ah = idr_read_ah(user_wr->wr.ud.ah,
 						     file->ucontext);
 			if (!next->wr.ud.ah) {
@@ -2150,9 +2156,11 @@ ssize_t ib_uverbs_post_send(struct ib_uverbs_file *file,
 					user_wr->wr.atomic.compare_add;
 				next->wr.atomic.swap = user_wr->wr.atomic.swap;
 				next->wr.atomic.rkey = user_wr->wr.atomic.rkey;
+			case IB_WR_SEND:
 				break;
 			default:
-				break;
+				ret = -EINVAL;
+				goto out_put;
 			}
 		}
 

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

* [PATCH 3.16.y-ckt 069/133] hpfs: update ctime and mtime on directory modification
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (67 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 068/133] IB/uverbs: reject invalid or unknown opcodes Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 070/133] Input: evdev - do not report errors form flush() Luis Henriques
                   ` (63 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mikulas Patocka, Linus Torvalds, Luis Henriques

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

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

From: Mikulas Patocka <mikulas@twibright.com>

commit f49a26e7718dd30b49e3541e3e25aecf5e7294e2 upstream.

Update ctime and mtime when a directory is modified. (though OS/2 doesn't
update them anyway)

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/hpfs/namei.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index bdbc2c3080a4..0642cafaab34 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -8,6 +8,17 @@
 #include <linux/sched.h>
 #include "hpfs_fn.h"
 
+static void hpfs_update_directory_times(struct inode *dir)
+{
+	time_t t = get_seconds();
+	if (t == dir->i_mtime.tv_sec &&
+	    t == dir->i_ctime.tv_sec)
+		return;
+	dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t;
+	dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0;
+	hpfs_write_inode_nolock(dir);
+}
+
 static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 {
 	const unsigned char *name = dentry->d_name.name;
@@ -99,6 +110,7 @@ static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 		result->i_mode = mode | S_IFDIR;
 		hpfs_write_inode_nolock(result);
 	}
+	hpfs_update_directory_times(dir);
 	d_instantiate(dentry, result);
 	hpfs_unlock(dir->i_sb);
 	return 0;
@@ -187,6 +199,7 @@ static int hpfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, b
 		result->i_mode = mode | S_IFREG;
 		hpfs_write_inode_nolock(result);
 	}
+	hpfs_update_directory_times(dir);
 	d_instantiate(dentry, result);
 	hpfs_unlock(dir->i_sb);
 	return 0;
@@ -262,6 +275,7 @@ static int hpfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, de
 	insert_inode_hash(result);
 
 	hpfs_write_inode_nolock(result);
+	hpfs_update_directory_times(dir);
 	d_instantiate(dentry, result);
 	brelse(bh);
 	hpfs_unlock(dir->i_sb);
@@ -340,6 +354,7 @@ static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *sy
 	insert_inode_hash(result);
 
 	hpfs_write_inode_nolock(result);
+	hpfs_update_directory_times(dir);
 	d_instantiate(dentry, result);
 	hpfs_unlock(dir->i_sb);
 	return 0;
@@ -423,6 +438,8 @@ again:
 out1:
 	hpfs_brelse4(&qbh);
 out:
+	if (!err)
+		hpfs_update_directory_times(dir);
 	hpfs_unlock(dir->i_sb);
 	return err;
 }
@@ -477,6 +494,8 @@ static int hpfs_rmdir(struct inode *dir, struct dentry *dentry)
 out1:
 	hpfs_brelse4(&qbh);
 out:
+	if (!err)
+		hpfs_update_directory_times(dir);
 	hpfs_unlock(dir->i_sb);
 	return err;
 }
@@ -595,7 +614,7 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 		goto end1;
 	}
 
-	end:
+end:
 	hpfs_i(i)->i_parent_dir = new_dir->i_ino;
 	if (S_ISDIR(i->i_mode)) {
 		inc_nlink(new_dir);
@@ -610,6 +629,10 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 		brelse(bh);
 	}
 end1:
+	if (!err) {
+		hpfs_update_directory_times(old_dir);
+		hpfs_update_directory_times(new_dir);
+	}
 	hpfs_unlock(i->i_sb);
 	return err;
 }

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

* [PATCH 3.16.y-ckt 070/133] Input: evdev - do not report errors form flush()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (68 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 069/133] hpfs: update ctime and mtime on directory modification Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 071/133] crypto: ghash-clmulni: specify context size for ghash async algorithm Luis Henriques
                   ` (62 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Takashi Iwai, Dmitry Torokhov, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit eb38f3a4f6e86f8bb10a3217ebd85ecc5d763aae upstream.

We've got bug reports showing the old systemd-logind (at least
system-210) aborting unexpectedly, and this turned out to be because
of an invalid error code from close() call to evdev devices.  close()
is supposed to return only either EINTR or EBADFD, while the device
returned ENODEV.  logind was overreacting to it and decided to kill
itself when an unexpected error code was received.  What a tragedy.

The bad error code comes from flush fops, and actually evdev_flush()
returns ENODEV when device is disconnected or client's access to it is
revoked. But in these cases the fact that flush did not actually happen is
not an error, but rather normal behavior. For non-disconnected devices
result of flush is also not that interesting as there is no potential of
data loss and even if it fails application has no way of handling the
error. Because of that we are better off always returning success from
evdev_flush().

Also returning EINTR from flush()/close() is discouraged (as it is not
clear how application should handle this error), so let's stop taking
evdev->mutex interruptibly.

Bugzilla: http://bugzilla.suse.com/show_bug.cgi?id=939834
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/evdev.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index f8e1f98bc222..c9bf10fc128f 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -240,19 +240,14 @@ static int evdev_flush(struct file *file, fl_owner_t id)
 {
 	struct evdev_client *client = file->private_data;
 	struct evdev *evdev = client->evdev;
-	int retval;
 
-	retval = mutex_lock_interruptible(&evdev->mutex);
-	if (retval)
-		return retval;
+	mutex_lock(&evdev->mutex);
 
-	if (!evdev->exist || client->revoked)
-		retval = -ENODEV;
-	else
-		retval = input_flush_device(&evdev->handle, file);
+	if (evdev->exist && !client->revoked)
+		input_flush_device(&evdev->handle, file);
 
 	mutex_unlock(&evdev->mutex);
-	return retval;
+	return 0;
 }
 
 static void evdev_free(struct device *dev)

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

* [PATCH 3.16.y-ckt 071/133] crypto: ghash-clmulni: specify context size for ghash async algorithm
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (69 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 070/133] Input: evdev - do not report errors form flush() Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 072/133] mm: check if section present during memory block registering Luis Henriques
                   ` (61 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andrey Ryabinin, Herbert Xu, Luis Henriques

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

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

From: Andrey Ryabinin <aryabinin@odin.com>

commit 71c6da846be478a61556717ef1ee1cea91f5d6a8 upstream.

Currently context size (cra_ctxsize) doesn't specified for
ghash_async_alg. Which means it's zero. Thus crypto_create_tfm()
doesn't allocate needed space for ghash_async_ctx, so any
read/write to ctx (e.g. in ghash_async_init_tfm()) is not valid.

Signed-off-by: Andrey Ryabinin <aryabinin@odin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/crypto/ghash-clmulni-intel_glue.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c
index 8253d85aa165..de1d72e3ec59 100644
--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c
+++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c
@@ -291,6 +291,7 @@ static struct ahash_alg ghash_async_alg = {
 			.cra_name		= "ghash",
 			.cra_driver_name	= "ghash-clmulni",
 			.cra_priority		= 400,
+			.cra_ctxsize		= sizeof(struct ghash_async_ctx),
 			.cra_flags		= CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC,
 			.cra_blocksize		= GHASH_BLOCK_SIZE,
 			.cra_type		= &crypto_ahash_type,

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

* [PATCH 3.16.y-ckt 072/133] mm: check if section present during memory block registering
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (70 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 071/133] crypto: ghash-clmulni: specify context size for ghash async algorithm Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 073/133] fs: create and use seq_show_option for escaping Luis Henriques
                   ` (60 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yinghai Lu, David Rientjes, Greg KH, Ingo Molnar, Andrew Morton,
	Linus Torvalds, Luis Henriques

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

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

From: Yinghai Lu <yinghai@kernel.org>

commit 04697858d89e4bf2650364f8d6956e2554e8ef88 upstream.

Tony Luck found on his setup, if memory block size 512M will cause crash
during booting.

  BUG: unable to handle kernel paging request at ffffea0074000020
  IP: get_nid_for_pfn+0x17/0x40
  PGD 128ffcb067 PUD 128ffc9067 PMD 0
  Oops: 0000 [#1] SMP
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.2.0-rc8 #1
  ...
  Call Trace:
     ? register_mem_sect_under_node+0x66/0xe0
     register_one_node+0x17b/0x240
     ? pci_iommu_alloc+0x6e/0x6e
     topology_init+0x3c/0x95
     do_one_initcall+0xcd/0x1f0

The system has non continuous RAM address:
 BIOS-e820: [mem 0x0000001300000000-0x0000001cffffffff] usable
 BIOS-e820: [mem 0x0000001d70000000-0x0000001ec7ffefff] usable
 BIOS-e820: [mem 0x0000001f00000000-0x0000002bffffffff] usable
 BIOS-e820: [mem 0x0000002c18000000-0x0000002d6fffefff] usable
 BIOS-e820: [mem 0x0000002e00000000-0x00000039ffffffff] usable

So there are start sections in memory block not present.  For example:

    memory block : [0x2c18000000, 0x2c20000000) 512M

first three sections are not present.

The current register_mem_sect_under_node() assume first section is
present, but memory block section number range [start_section_nr,
end_section_nr] would include not present section.

For arch that support vmemmap, we don't setup memmap for struct page
area within not present sections area.

So skip the pfn range that belong to absent section.

[akpm@linux-foundation.org: simplification]
[rientjes@google.com: more simplification]
Fixes: bdee237c0343 ("x86: mm: Use 2GB memory block size on large memory x86-64 systems")
Fixes: 982792c782ef ("x86, mm: probe memory block size for generic x86 64bit")
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Tony Luck <tony.luck@intel.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Cc: Greg KH <greg@kroah.com>
Cc: Ingo Molnar <mingo@elte.hu>
Tested-by: David Rientjes <rientjes@google.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>
---
 drivers/base/node.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index 40e4585f110a..5777d10d1e25 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -399,6 +399,16 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
 	for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
 		int page_nid;
 
+		/*
+		 * memory block could have several absent sections from start.
+		 * skip pfn range from absent section
+		 */
+		if (!pfn_present(pfn)) {
+			pfn = round_down(pfn + PAGES_PER_SECTION,
+					 PAGES_PER_SECTION) - 1;
+			continue;
+		}
+
 		page_nid = get_nid_for_pfn(pfn);
 		if (page_nid < 0)
 			continue;

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

* [PATCH 3.16.y-ckt 073/133] fs: create and use seq_show_option for escaping
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (71 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 072/133] mm: check if section present during memory block registering Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 074/133] ALSA: hda - Enable headphone jack detect on old Fujitsu laptops Luis Henriques
                   ` (59 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kees Cook, J. R. Okajima, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Kees Cook <keescook@chromium.org>

commit a068acf2ee77693e0bf39d6e07139ba704f461c3 upstream.

Many file systems that implement the show_options hook fail to correctly
escape their output which could lead to unescaped characters (e.g.  new
lines) leaking into /proc/mounts and /proc/[pid]/mountinfo files.  This
could lead to confusion, spoofed entries (resulting in things like
systemd issuing false d-bus "mount" notifications), and who knows what
else.  This looks like it would only be the root user stepping on
themselves, but it's possible weird things could happen in containers or
in other situations with delegated mount privileges.

Here's an example using overlay with setuid fusermount trusting the
contents of /proc/mounts (via the /etc/mtab symlink).  Imagine the use
of "sudo" is something more sneaky:

  $ BASE="ovl"
  $ MNT="$BASE/mnt"
  $ LOW="$BASE/lower"
  $ UP="$BASE/upper"
  $ WORK="$BASE/work/ 0 0
  none /proc fuse.pwn user_id=1000"
  $ mkdir -p "$LOW" "$UP" "$WORK"
  $ sudo mount -t overlay -o "lowerdir=$LOW,upperdir=$UP,workdir=$WORK" none /mnt
  $ cat /proc/mounts
  none /root/ovl/mnt overlay rw,relatime,lowerdir=ovl/lower,upperdir=ovl/upper,workdir=ovl/work/ 0 0
  none /proc fuse.pwn user_id=1000 0 0
  $ fusermount -u /proc
  $ cat /proc/mounts
  cat: /proc/mounts: No such file or directory

This fixes the problem by adding new seq_show_option and
seq_show_option_n helpers, and updating the vulnerable show_option
handlers to use them as needed.  Some, like SELinux, need to be open
coded due to unusual existing escape mechanisms.

[akpm@linux-foundation.org: add lost chunk, per Kees]
[keescook@chromium.org: seq_show_option should be using const parameters]
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Jan Kara <jack@suse.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Cc: J. R. Okajima <hooanon05g@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ luis: backported to 3.16:
  - dropped changes to fs/overlayfs/super.c, net/ceph/ceph_common.c and to
    cgroup_show_options() in kernel/cgroup.c
  - adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/ceph/super.c          |  3 ++-
 fs/cifs/cifsfs.c         |  6 +++---
 fs/ext4/super.c          |  4 ++--
 fs/gfs2/super.c          |  6 +++---
 fs/hfs/super.c           |  4 ++--
 fs/hfsplus/options.c     |  4 ++--
 fs/hostfs/hostfs_kern.c  |  2 +-
 fs/ocfs2/super.c         |  4 ++--
 fs/reiserfs/super.c      |  8 +++++---
 fs/xfs/xfs_super.c       |  4 ++--
 include/linux/seq_file.h | 35 +++++++++++++++++++++++++++++++++++
 kernel/cgroup.c          |  5 +++--
 security/selinux/hooks.c |  2 +-
 13 files changed, 63 insertions(+), 24 deletions(-)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 8503ec130c15..526db4502aa6 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -483,7 +483,8 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)
 	if (fsopt->max_readdir_bytes != CEPH_MAX_READDIR_BYTES_DEFAULT)
 		seq_printf(m, ",readdir_max_bytes=%d", fsopt->max_readdir_bytes);
 	if (strcmp(fsopt->snapdir_name, CEPH_SNAPDIRNAME_DEFAULT))
-		seq_printf(m, ",snapdirname=%s", fsopt->snapdir_name);
+		seq_show_option(m, "snapdirname", fsopt->snapdir_name);
+
 	return 0;
 }
 
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 888398067420..d678cda1cd81 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -382,17 +382,17 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
 	struct sockaddr *srcaddr;
 	srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr;
 
-	seq_printf(s, ",vers=%s", tcon->ses->server->vals->version_string);
+	seq_show_option(s, "vers", tcon->ses->server->vals->version_string);
 	cifs_show_security(s, tcon->ses);
 	cifs_show_cache_flavor(s, cifs_sb);
 
 	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)
 		seq_puts(s, ",multiuser");
 	else if (tcon->ses->user_name)
-		seq_printf(s, ",username=%s", tcon->ses->user_name);
+		seq_show_option(s, "username", tcon->ses->user_name);
 
 	if (tcon->ses->domainName)
-		seq_printf(s, ",domain=%s", tcon->ses->domainName);
+		seq_show_option(s, "domain", tcon->ses->domainName);
 
 	if (srcaddr->sa_family != AF_UNSPEC) {
 		struct sockaddr_in *saddr4;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cf977e2f8a6f..a8f6f6a358ce 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1750,10 +1750,10 @@ static inline void ext4_show_quota_options(struct seq_file *seq,
 	}
 
 	if (sbi->s_qf_names[USRQUOTA])
-		seq_printf(seq, ",usrjquota=%s", sbi->s_qf_names[USRQUOTA]);
+		seq_show_option(seq, "usrjquota", sbi->s_qf_names[USRQUOTA]);
 
 	if (sbi->s_qf_names[GRPQUOTA])
-		seq_printf(seq, ",grpjquota=%s", sbi->s_qf_names[GRPQUOTA]);
+		seq_show_option(seq, "grpjquota", sbi->s_qf_names[GRPQUOTA]);
 #endif
 }
 
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 1319b5c4ec68..b844cf82e0f9 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1302,11 +1302,11 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
 	if (is_ancestor(root, sdp->sd_master_dir))
 		seq_printf(s, ",meta");
 	if (args->ar_lockproto[0])
-		seq_printf(s, ",lockproto=%s", args->ar_lockproto);
+		seq_show_option(s, "lockproto", args->ar_lockproto);
 	if (args->ar_locktable[0])
-		seq_printf(s, ",locktable=%s", args->ar_locktable);
+		seq_show_option(s, "locktable", args->ar_locktable);
 	if (args->ar_hostdata[0])
-		seq_printf(s, ",hostdata=%s", args->ar_hostdata);
+		seq_show_option(s, "hostdata", args->ar_hostdata);
 	if (args->ar_spectator)
 		seq_printf(s, ",spectator");
 	if (args->ar_localflocks)
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index eee7206c38d1..410b65eea683 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -135,9 +135,9 @@ static int hfs_show_options(struct seq_file *seq, struct dentry *root)
 	struct hfs_sb_info *sbi = HFS_SB(root->d_sb);
 
 	if (sbi->s_creator != cpu_to_be32(0x3f3f3f3f))
-		seq_printf(seq, ",creator=%.4s", (char *)&sbi->s_creator);
+		seq_show_option_n(seq, "creator", (char *)&sbi->s_creator, 4);
 	if (sbi->s_type != cpu_to_be32(0x3f3f3f3f))
-		seq_printf(seq, ",type=%.4s", (char *)&sbi->s_type);
+		seq_show_option_n(seq, "type", (char *)&sbi->s_type, 4);
 	seq_printf(seq, ",uid=%u,gid=%u",
 			from_kuid_munged(&init_user_ns, sbi->s_uid),
 			from_kgid_munged(&init_user_ns, sbi->s_gid));
diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c
index c90b72ee676d..bb806e58c977 100644
--- a/fs/hfsplus/options.c
+++ b/fs/hfsplus/options.c
@@ -218,9 +218,9 @@ int hfsplus_show_options(struct seq_file *seq, struct dentry *root)
 	struct hfsplus_sb_info *sbi = HFSPLUS_SB(root->d_sb);
 
 	if (sbi->creator != HFSPLUS_DEF_CR_TYPE)
-		seq_printf(seq, ",creator=%.4s", (char *)&sbi->creator);
+		seq_show_option_n(seq, "creator", (char *)&sbi->creator, 4);
 	if (sbi->type != HFSPLUS_DEF_CR_TYPE)
-		seq_printf(seq, ",type=%.4s", (char *)&sbi->type);
+		seq_show_option_n(seq, "type", (char *)&sbi->type, 4);
 	seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask,
 			from_kuid_munged(&init_user_ns, sbi->uid),
 			from_kgid_munged(&init_user_ns, sbi->gid));
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index bb529f3b7f2b..456f60e2552e 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -255,7 +255,7 @@ static int hostfs_show_options(struct seq_file *seq, struct dentry *root)
 	size_t offset = strlen(root_ino) + 1;
 
 	if (strlen(root_path) > offset)
-		seq_printf(seq, ",%s", root_path + offset);
+		seq_show_option(seq, root_path + offset, NULL);
 
 	return 0;
 }
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index ddb662b32447..34690360ff33 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1564,8 +1564,8 @@ static int ocfs2_show_options(struct seq_file *s, struct dentry *root)
 		seq_printf(s, ",localflocks,");
 
 	if (osb->osb_cluster_stack[0])
-		seq_printf(s, ",cluster_stack=%.*s", OCFS2_STACK_LABEL_LEN,
-			   osb->osb_cluster_stack);
+		seq_show_option_n(s, "cluster_stack", osb->osb_cluster_stack,
+				  OCFS2_STACK_LABEL_LEN);
 	if (opts & OCFS2_MOUNT_USRQUOTA)
 		seq_printf(s, ",usrquota");
 	if (opts & OCFS2_MOUNT_GRPQUOTA)
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 27575041bea3..48c6924eba05 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -710,18 +710,20 @@ static int reiserfs_show_options(struct seq_file *seq, struct dentry *root)
 		seq_puts(seq, ",acl");
 
 	if (REISERFS_SB(s)->s_jdev)
-		seq_printf(seq, ",jdev=%s", REISERFS_SB(s)->s_jdev);
+		seq_show_option(seq, "jdev", REISERFS_SB(s)->s_jdev);
 
 	if (journal->j_max_commit_age != journal->j_default_max_commit_age)
 		seq_printf(seq, ",commit=%d", journal->j_max_commit_age);
 
 #ifdef CONFIG_QUOTA
 	if (REISERFS_SB(s)->s_qf_names[USRQUOTA])
-		seq_printf(seq, ",usrjquota=%s", REISERFS_SB(s)->s_qf_names[USRQUOTA]);
+		seq_show_option(seq, "usrjquota",
+				REISERFS_SB(s)->s_qf_names[USRQUOTA]);
 	else if (opts & (1 << REISERFS_USRQUOTA))
 		seq_puts(seq, ",usrquota");
 	if (REISERFS_SB(s)->s_qf_names[GRPQUOTA])
-		seq_printf(seq, ",grpjquota=%s", REISERFS_SB(s)->s_qf_names[GRPQUOTA]);
+		seq_show_option(seq, "grpjquota",
+				REISERFS_SB(s)->s_qf_names[GRPQUOTA]);
 	else if (opts & (1 << REISERFS_GRPQUOTA))
 		seq_puts(seq, ",grpquota");
 	if (REISERFS_SB(s)->s_jquota_fmt) {
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 8f0333b3f7a0..2637010a6224 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -529,9 +529,9 @@ xfs_showargs(
 		seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10);
 
 	if (mp->m_logname)
-		seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname);
+		seq_show_option(m, MNTOPT_LOGDEV, mp->m_logname);
 	if (mp->m_rtname)
-		seq_printf(m, "," MNTOPT_RTDEV "=%s", mp->m_rtname);
+		seq_show_option(m, MNTOPT_RTDEV, mp->m_rtname);
 
 	if (mp->m_dalign > 0)
 		seq_printf(m, "," MNTOPT_SUNIT "=%d",
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 52e0097f61f0..6288341db62d 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -158,6 +158,41 @@ static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
 #endif
 }
 
+/**
+ * seq_show_options - display mount options with appropriate escapes.
+ * @m: the seq_file handle
+ * @name: the mount option name
+ * @value: the mount option name's value, can be NULL
+ */
+static inline void seq_show_option(struct seq_file *m, const char *name,
+				   const char *value)
+{
+	seq_putc(m, ',');
+	seq_escape(m, name, ",= \t\n\\");
+	if (value) {
+		seq_putc(m, '=');
+		seq_escape(m, value, ", \t\n\\");
+	}
+}
+
+/**
+ * seq_show_option_n - display mount options with appropriate escapes
+ *		       where @value must be a specific length.
+ * @m: the seq_file handle
+ * @name: the mount option name
+ * @value: the mount option name's value, cannot be NULL
+ * @length: the length of @value to display
+ *
+ * This is a macro since this uses "length" to define the size of the
+ * stack buffer.
+ */
+#define seq_show_option_n(m, name, value, length) {	\
+	char val_buf[length + 1];			\
+	strncpy(val_buf, value, length);		\
+	val_buf[length] = '\0';				\
+	seq_show_option(m, name, val_buf);		\
+}
+
 #define SEQ_START_TOKEN ((void *)1)
 /*
  * Helpers for iteration over list_head-s in seq_files
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 44fadfb287bf..58fd665d1217 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1248,13 +1248,14 @@ static int cgroup_show_options(struct seq_file *seq,
 
 	spin_lock(&release_agent_path_lock);
 	if (strlen(root->release_agent_path))
-		seq_printf(seq, ",release_agent=%s", root->release_agent_path);
+		seq_show_option(seq, "release_agent",
+				root->release_agent_path);
 	spin_unlock(&release_agent_path_lock);
 
 	if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags))
 		seq_puts(seq, ",clone_children");
 	if (strlen(root->name))
-		seq_printf(seq, ",name=%s", root->name);
+		seq_show_option(seq, "name", root->name);
 	return 0;
 }
 
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9a23a7cccdc4..af2d5124f99c 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1100,7 +1100,7 @@ static void selinux_write_opts(struct seq_file *m,
 		seq_puts(m, prefix);
 		if (has_comma)
 			seq_putc(m, '\"');
-		seq_puts(m, opts->mnt_opts[i]);
+		seq_escape(m, opts->mnt_opts[i], "\"\n\\");
 		if (has_comma)
 			seq_putc(m, '\"');
 	}

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

* [PATCH 3.16.y-ckt 074/133] ALSA: hda - Enable headphone jack detect on old Fujitsu laptops
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (72 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 073/133] fs: create and use seq_show_option for escaping Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 075/133] ALSA: hda - Use ALC880_FIXUP_FUJITSU for FSC Amilo M1437 Luis Henriques
                   ` (58 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit bb148bdeb0ab16fc0ae8009799471e4d7180073b upstream.

According to the bug report, FSC Amilo laptops with ALC880 can detect
the headphone jack but currently the driver disables it.  It's partly
intentionally, as non-working jack detect was reported in the past.
Let's enable now.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102501
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 95ad148ddb6c..58bdf939d9a1 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1211,7 +1211,7 @@ static const struct hda_fixup alc880_fixups[] = {
 		/* override all pins as BIOS on old Amilo is broken */
 		.type = HDA_FIXUP_PINS,
 		.v.pins = (const struct hda_pintbl[]) {
-			{ 0x14, 0x0121411f }, /* HP */
+			{ 0x14, 0x0121401f }, /* HP */
 			{ 0x15, 0x99030120 }, /* speaker */
 			{ 0x16, 0x99030130 }, /* bass speaker */
 			{ 0x17, 0x411111f0 }, /* N/A */
@@ -1231,7 +1231,7 @@ static const struct hda_fixup alc880_fixups[] = {
 		/* almost compatible with FUJITSU, but no bass and SPDIF */
 		.type = HDA_FIXUP_PINS,
 		.v.pins = (const struct hda_pintbl[]) {
-			{ 0x14, 0x0121411f }, /* HP */
+			{ 0x14, 0x0121401f }, /* HP */
 			{ 0x15, 0x99030120 }, /* speaker */
 			{ 0x16, 0x411111f0 }, /* N/A */
 			{ 0x17, 0x411111f0 }, /* N/A */

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

* [PATCH 3.16.y-ckt 075/133] ALSA: hda - Use ALC880_FIXUP_FUJITSU for FSC Amilo M1437
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (73 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 074/133] ALSA: hda - Enable headphone jack detect on old Fujitsu laptops Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 076/133] rtc: s5m: fix to update ctrl register Luis Henriques
                   ` (57 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit a161574e200ae63a5042120e0d8c36830e81bde3 upstream.

It turned out that the machine has a bass speaker, so take a correct
fixup entry.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102501
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 58bdf939d9a1..0979f715f8b0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1440,7 +1440,7 @@ static const struct snd_pci_quirk alc880_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
 	SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
 	SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
-	SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734),
+	SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
 	SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
 	SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
 	SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),

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

* [PATCH 3.16.y-ckt 076/133] rtc: s5m: fix to update ctrl register
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (74 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 075/133] ALSA: hda - Use ALC880_FIXUP_FUJITSU for FSC Amilo M1437 Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 077/133] scsi: fix scsi_error_handler vs. scsi_host_dev_release race Luis Henriques
                   ` (56 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joonyoung Shim, Alexandre Belloni, Luis Henriques

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

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

From: Joonyoung Shim <jy0922.shim@samsung.com>

commit ff02c0444b83201ff76cc49deccac8cf2bffc7bc upstream.

According to datasheet, the S2MPS13X and S2MPS14X should update write
buffer via setting WUDR bit to high after ctrl register is written.

If not, ALARM interrupt of rtc-s5m doesn't happen first time when i use
tools/testing/selftests/timers/rtctest.c test program and hour format is
used to 12 hour mode in Odroid-XU3 board.

One more issue is the RTC doesn't keep time on Odroid-XU3 board when i
turn on board after power off even if RTC battery is connected. It can
be solved as setting WUDR & RUDR bits to high at the same time after
RTC_CTRL register is written. It's same with condition of only writing
ALARM registers, so this is for only S2MPS14 and we should set WUDR &
A_UDR bits to high on S2MPS13.

I can't find any reasonable description about this like fix from
datasheet, but can find similar codes from rtc driver source of
hardkernel kernel and vendor kernel.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/rtc/rtc-s5m.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index dd8b680dc94f..84560391a0e1 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -644,6 +644,16 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
 	case S2MPS14X:
 		data[0] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT);
 		ret = regmap_write(info->regmap, info->regs->ctrl, data[0]);
+		if (ret < 0)
+			break;
+
+		/*
+		 * Should set WUDR & (RUDR or AUDR) bits to high after writing
+		 * RTC_CTRL register like writing Alarm registers. We can't find
+		 * the description from datasheet but vendor code does that
+		 * really.
+		 */
+		ret = s5m8767_rtc_set_alarm_reg(info);
 		break;
 
 	default:

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

* [PATCH 3.16.y-ckt 077/133] scsi: fix scsi_error_handler vs. scsi_host_dev_release race
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (75 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 076/133] rtc: s5m: fix to update ctrl register Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 078/133] parisc: Use double word condition in 64bit CAS operation Luis Henriques
                   ` (55 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michal Hocko, James Bottomley, Luis Henriques

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

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

From: Michal Hocko <mhocko@suse.com>

commit 537b604c8b3aa8b96fe35f87dd085816552e294c upstream.

b9d5c6b7ef57 ("[SCSI] cleanup setting task state in
scsi_error_handler()") has introduced a race between scsi_error_handler
and scsi_host_dev_release resulting in the hang when the device goes
away because scsi_error_handler might miss a wake up:

CPU0					CPU1
scsi_error_handler			scsi_host_dev_release
  					  kthread_stop()
  kthread_should_stop()
    test_bit(KTHREAD_SHOULD_STOP)
					    set_bit(KTHREAD_SHOULD_STOP)
					    wake_up_process()
					    wait_for_completion()

  set_current_state(TASK_INTERRUPTIBLE)
  schedule()

The most straightforward solution seems to be to invert the ordering of
the set_current_state and kthread_should_stop.

The issue has been noticed during reboot test on a 3.0 based kernel but
the current code seems to be affected in the same way.

[jejb: additional comment added]
Reported-and-debugged-by: Mike Mayer <Mike.Meyer@teradata.com>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/scsi/scsi_error.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index f0c7a970547f..48790f1dbf79 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -2154,8 +2154,17 @@ int scsi_error_handler(void *data)
 	 * We never actually get interrupted because kthread_run
 	 * disables signal delivery for the created thread.
 	 */
-	while (!kthread_should_stop()) {
+	while (true) {
+		/*
+		 * The sequence in kthread_stop() sets the stop flag first
+		 * then wakes the process.  To avoid missed wakeups, the task
+		 * should always be in a non running state before the stop
+		 * flag is checked
+		 */
 		set_current_state(TASK_INTERRUPTIBLE);
+		if (kthread_should_stop())
+			break;
+
 		if ((shost->host_failed == 0 && shost->host_eh_scheduled == 0) ||
 		    shost->host_failed != shost->host_busy) {
 			SCSI_LOG_ERROR_RECOVERY(1,

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

* [PATCH 3.16.y-ckt 078/133] parisc: Use double word condition in 64bit CAS operation
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (76 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 077/133] scsi: fix scsi_error_handler vs. scsi_host_dev_release race Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 079/133] vmscan: fix increasing nr_isolated incurred by putback unevictable pages Luis Henriques
                   ` (54 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: John David Anglin, Helge Deller, Luis Henriques

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

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

From: John David Anglin <dave.anglin@bell.net>

commit 1b59ddfcf1678de38a1f8ca9fb8ea5eebeff1843 upstream.

The attached change fixes the condition used in the "sub" instruction.
A double word comparison is needed.  This fixes the 64-bit LWS CAS
operation on 64-bit kernels.

I can now enable 64-bit atomic support in GCC.

Signed-off-by: John David Anglin <dave.anglin>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/parisc/kernel/syscall.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index 7ef22e3387e0..0b8d26d3ba43 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -821,7 +821,7 @@ cas2_action:
 	/* 64bit CAS */
 #ifdef CONFIG_64BIT
 19:	ldd,ma	0(%sr3,%r26), %r29
-	sub,=	%r29, %r25, %r0
+	sub,*=	%r29, %r25, %r0
 	b,n	cas2_end
 20:	std,ma	%r24, 0(%sr3,%r26)
 	copy	%r0, %r28

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

* [PATCH 3.16.y-ckt 079/133] vmscan: fix increasing nr_isolated incurred by putback unevictable pages
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (77 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 078/133] parisc: Use double word condition in 64bit CAS operation Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 080/133] drm/i915: Limit the number of loops for reading a split 64bit register Luis Henriques
                   ` (53 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jaewon Kim, Mel Gorman, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Jaewon Kim <jaewon31.kim@samsung.com>

commit c54839a722a02818677bcabe57e957f0ce4f841d upstream.

reclaim_clean_pages_from_list() assumes that shrink_page_list() returns
number of pages removed from the candidate list.  But shrink_page_list()
puts back mlocked pages without passing it to caller and without
counting as nr_reclaimed.  This increases nr_isolated.

To fix this, this patch changes shrink_page_list() to pass unevictable
pages back to caller.  Caller will take care those pages.

Minchan said:

It fixes two issues.

1. With unevictable page, cma_alloc will be successful.

Exactly speaking, cma_alloc of current kernel will fail due to
unevictable pages.

2. fix leaking of NR_ISOLATED counter of vmstat

With it, too_many_isolated works.  Otherwise, it could make hang until
the process get SIGKILL.

Signed-off-by: Jaewon Kim <jaewon31.kim@samsung.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Acked-by: 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/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index d75349d574a3..c9091e10a18d 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1106,7 +1106,7 @@ cull_mlocked:
 		if (PageSwapCache(page))
 			try_to_free_swap(page);
 		unlock_page(page);
-		putback_lru_page(page);
+		list_add(&page->lru, &ret_pages);
 		continue;
 
 activate_locked:

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

* [PATCH 3.16.y-ckt 080/133] drm/i915: Limit the number of loops for reading a split 64bit register
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (78 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 079/133] vmscan: fix increasing nr_isolated incurred by putback unevictable pages Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 081/133] stmmac: fix check for phydev being open Luis Henriques
                   ` (52 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Michał Winiarski, Daniel Vetter, Jani Nikula,
	Jani Nikula, Luis Henriques

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

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

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

commit acd29f7b22262d9e848393b9b6ae13eb42d22514 upstream.

In I915_READ64_2x32 we attempt to read a 64bit register using 2 32bit
reads. Due to the nature of the registers we try to read in this manner,
they may increment between the two instruction (e.g. a timestamp
counter). To keep the result accurate, we repeat the read if we detect
an overflow (i.e. the upper value varies). However, some hardware is just
plain flaky and may endless loop as the the upper 32bits are not stable.
Just give up after a couple of tries and report whatever we read last.

v2: Use the most recent values when erring out on an unstable register.

Reported-by: russianneuromancer@ya.ru
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91906
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
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/i915_drv.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 67f72fa5a769..1378dadc618e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2682,13 +2682,13 @@ int vlv_freq_opcode(struct drm_i915_private *dev_priv, int val);
 #define I915_READ64(reg)	dev_priv->uncore.funcs.mmio_readq(dev_priv, (reg), true)
 
 #define I915_READ64_2x32(lower_reg, upper_reg) ({			\
-	u32 upper, lower, tmp;						\
-	tmp = I915_READ(upper_reg);					\
+	u32 upper, lower, old_upper, loop = 0;				\
+	upper = I915_READ(upper_reg);					\
 	do {								\
-		upper = tmp;						\
+		old_upper = upper;					\
 		lower = I915_READ(lower_reg);				\
-		tmp = I915_READ(upper_reg);				\
-	} while (upper != tmp);						\
+		upper = I915_READ(upper_reg);				\
+	} while (upper != old_upper && loop++ < 2);			\
 	(u64)upper << 32 | lower; })
 
 #define POSTING_READ(reg)	(void)I915_READ_NOTRACE(reg)

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

* [PATCH 3.16.y-ckt 081/133] stmmac: fix check for phydev being open
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (79 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 080/133] drm/i915: Limit the number of loops for reading a split 64bit register Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30 11:23   ` Sergei Shtylyov
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 082/133] hfs,hfsplus: cache pages correctly between bnode_create and bnode_free Luis Henriques
                   ` (51 subsequent siblings)
  132 siblings, 1 reply; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sergei Shtylyov, Giuseppe Cavallaro, David Miller, Alexey Brodkin,
	Luis Henriques

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

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

From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>

commit dfc50fcaad574e5c8c85cbc83eca1426b2413fa4 upstream.

Current check of phydev with IS_ERR(phydev) may make not much sense
because of_phy_connect() returns NULL on failure instead of error value.

Still for checking result of phy_connect() IS_ERR() makes perfect sense.

So let's use combined check IS_ERR_OR_NULL() that covers both cases.

Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: linux-kernel@vger.kernel.org
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 641086fc14b5..936cdee0c22e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -810,8 +810,11 @@ static int stmmac_init_phy(struct net_device *dev)
 
 	phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link, interface);
 
-	if (IS_ERR(phydev)) {
+	if (IS_ERR_OR_NULL(phydev)) {
 		pr_err("%s: Could not attach to PHY\n", dev->name);
+		if (!phydev)
+			return -ENODEV;
+
 		return PTR_ERR(phydev);
 	}
 

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

* [PATCH 3.16.y-ckt 082/133] hfs,hfsplus: cache pages correctly between bnode_create and bnode_free
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (80 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 081/133] stmmac: fix check for phydev being open Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 083/133] hfs: fix B-tree corruption after insertion at position 0 Luis Henriques
                   ` (50 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hin-Tak Leung, Sergei Antonov, Al Viro, Christoph Hellwig,
	Vyacheslav Dubeyko, Sougata Santra, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Hin-Tak Leung <htl10@users.sourceforge.net>

commit 7cb74be6fd827e314f81df3c5889b87e4c87c569 upstream.

Pages looked up by __hfs_bnode_create() (called by hfs_bnode_create() and
hfs_bnode_find() for finding or creating pages corresponding to an inode)
are immediately kmap()'ed and used (both read and write) and kunmap()'ed,
and should not be page_cache_release()'ed until hfs_bnode_free().

This patch fixes a problem I first saw in July 2012: merely running "du"
on a large hfsplus-mounted directory a few times on a reasonably loaded
system would get the hfsplus driver all confused and complaining about
B-tree inconsistencies, and generates a "BUG: Bad page state".  Most
recently, I can generate this problem on up-to-date Fedora 22 with shipped
kernel 4.0.5, by running "du /" (="/" + "/home" + "/mnt" + other smaller
mounts) and "du /mnt" simultaneously on two windows, where /mnt is a
lightly-used QEMU VM image of the full Mac OS X 10.9:

$ df -i / /home /mnt
Filesystem                  Inodes   IUsed      IFree IUse% Mounted on
/dev/mapper/fedora-root    3276800  551665    2725135   17% /
/dev/mapper/fedora-home   52879360  716221   52163139    2% /home
/dev/nbd0p2             4294967295 1387818 4293579477    1% /mnt

After applying the patch, I was able to run "du /" (60+ times) and "du
/mnt" (150+ times) continuously and simultaneously for 6+ hours.

There are many reports of the hfsplus driver getting confused under load
and generating "BUG: Bad page state" or other similar issues over the
years.  [1]

The unpatched code [2] has always been wrong since it entered the kernel
tree.  The only reason why it gets away with it is that the
kmap/memcpy/kunmap follow very quickly after the page_cache_release() so
the kernel has not had a chance to reuse the memory for something else,
most of the time.

The current RW driver appears to have followed the design and development
of the earlier read-only hfsplus driver [3], where-by version 0.1 (Dec
2001) had a B-tree node-centric approach to
read_cache_page()/page_cache_release() per bnode_get()/bnode_put(),
migrating towards version 0.2 (June 2002) of caching and releasing pages
per inode extents.  When the current RW code first entered the kernel [2]
in 2005, there was an REF_PAGES conditional (and "//" commented out code)
to switch between B-node centric paging to inode-centric paging.  There
was a mistake with the direction of one of the REF_PAGES conditionals in
__hfs_bnode_create().  In a subsequent "remove debug code" commit [4], the
read_cache_page()/page_cache_release() per bnode_get()/bnode_put() were
removed, but a page_cache_release() was mistakenly left in (propagating
the "REF_PAGES <-> !REF_PAGE" mistake), and the commented-out
page_cache_release() in bnode_release() (which should be spanned by
!REF_PAGES) was never enabled.

References:
[1]:
Michael Fox, Apr 2013
http://www.spinics.net/lists/linux-fsdevel/msg63807.html
("hfsplus volume suddenly inaccessable after 'hfs: recoff %d too large'")

Sasha Levin, Feb 2015
http://lkml.org/lkml/2015/2/20/85 ("use after free")

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/740814
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1027887
https://bugzilla.kernel.org/show_bug.cgi?id=42342
https://bugzilla.kernel.org/show_bug.cgi?id=63841
https://bugzilla.kernel.org/show_bug.cgi?id=78761

[2]:
http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/\
fs/hfs/bnode.c?id=d1081202f1d0ee35ab0beb490da4b65d4bc763db
commit d1081202f1d0ee35ab0beb490da4b65d4bc763db
Author: Andrew Morton <akpm@osdl.org>
Date:   Wed Feb 25 16:17:36 2004 -0800

    [PATCH] HFS rewrite

http://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/\
fs/hfsplus/bnode.c?id=91556682e0bf004d98a529bf829d339abb98bbbd

commit 91556682e0bf004d98a529bf829d339abb98bbbd
Author: Andrew Morton <akpm@osdl.org>
Date:   Wed Feb 25 16:17:48 2004 -0800

    [PATCH] HFS+ support

[3]:
http://sourceforge.net/projects/linux-hfsplus/

http://sourceforge.net/projects/linux-hfsplus/files/Linux%202.4.x%20patch/hfsplus%200.1/
http://sourceforge.net/projects/linux-hfsplus/files/Linux%202.4.x%20patch/hfsplus%200.2/

http://linux-hfsplus.cvs.sourceforge.net/viewvc/linux-hfsplus/linux/\
fs/hfsplus/bnode.c?r1=1.4&r2=1.5

Date:   Thu Jun 6 09:45:14 2002 +0000
Use buffer cache instead of page cache in bnode.c. Cache inode extents.

[4]:
http://git.kernel.org/cgit/linux/kernel/git/\
stable/linux-stable.git/commit/?id=a5e3985fa014029eb6795664c704953720cc7f7d

commit a5e3985fa014029eb6795664c704953720cc7f7d
Author: Roman Zippel <zippel@linux-m68k.org>
Date:   Tue Sep 6 15:18:47 2005 -0700

[PATCH] hfs: remove debug code

Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Reviewed-by: Anton Altaparmakov <anton@tuxera.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Sougata Santra <sougata@tuxera.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>
---
 fs/hfs/bnode.c     | 9 ++++-----
 fs/hfsplus/bnode.c | 3 ---
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index d3fa6bd9503e..221719eac5de 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -288,7 +288,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
 			page_cache_release(page);
 			goto fail;
 		}
-		page_cache_release(page);
 		node->page[i] = page;
 	}
 
@@ -398,11 +397,11 @@ node_error:
 
 void hfs_bnode_free(struct hfs_bnode *node)
 {
-	//int i;
+	int i;
 
-	//for (i = 0; i < node->tree->pages_per_bnode; i++)
-	//	if (node->page[i])
-	//		page_cache_release(node->page[i]);
+	for (i = 0; i < node->tree->pages_per_bnode; i++)
+		if (node->page[i])
+			page_cache_release(node->page[i]);
 	kfree(node);
 }
 
diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c
index 759708fd9331..63924662aaf3 100644
--- a/fs/hfsplus/bnode.c
+++ b/fs/hfsplus/bnode.c
@@ -454,7 +454,6 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
 			page_cache_release(page);
 			goto fail;
 		}
-		page_cache_release(page);
 		node->page[i] = page;
 	}
 
@@ -566,13 +565,11 @@ node_error:
 
 void hfs_bnode_free(struct hfs_bnode *node)
 {
-#if 0
 	int i;
 
 	for (i = 0; i < node->tree->pages_per_bnode; i++)
 		if (node->page[i])
 			page_cache_release(node->page[i]);
-#endif
 	kfree(node);
 }
 

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

* [PATCH 3.16.y-ckt 083/133] hfs: fix B-tree corruption after insertion at position 0
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (81 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 082/133] hfs,hfsplus: cache pages correctly between bnode_create and bnode_free Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 084/133] drm/qxl: validate monitors config modes Luis Henriques
                   ` (49 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hin-Tak Leung, Sergei Antonov, Joe Perches, Anton Altaparmakov,
	Al Viro, Christoph Hellwig, Andrew Morton, Linus Torvalds,
	Luis Henriques

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

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

From: Hin-Tak Leung <htl10@users.sourceforge.net>

commit b4cc0efea4f0bfa2477c56af406cfcf3d3e58680 upstream.

Fix B-tree corruption when a new record is inserted at position 0 in the
node in hfs_brec_insert().

This is an identical change to the corresponding hfs b-tree code to Sergei
Antonov's "hfsplus: fix B-tree corruption after insertion at position 0",
to keep similar code paths in the hfs and hfsplus drivers in sync, where
appropriate.

Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Sergei Antonov <saproj@gmail.com>
Cc: Joe Perches <joe@perches.com>
Reviewed-by: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Anton Altaparmakov <anton@tuxera.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.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>
---
 fs/hfs/brec.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c
index 9f4ee7f52026..6fc766df0461 100644
--- a/fs/hfs/brec.c
+++ b/fs/hfs/brec.c
@@ -131,13 +131,16 @@ skip:
 	hfs_bnode_write(node, entry, data_off + key_len, entry_len);
 	hfs_bnode_dump(node);
 
-	if (new_node) {
-		/* update parent key if we inserted a key
-		 * at the start of the first node
-		 */
-		if (!rec && new_node != node)
-			hfs_brec_update_parent(fd);
+	/*
+	 * update parent key if we inserted a key
+	 * at the start of the node and it is not the new node
+	 */
+	if (!rec && new_node != node) {
+		hfs_bnode_read_key(node, fd->search_key, data_off + size);
+		hfs_brec_update_parent(fd);
+	}
 
+	if (new_node) {
 		hfs_bnode_put(fd->bnode);
 		if (!new_node->parent) {
 			hfs_btree_inc_height(tree);
@@ -166,9 +169,6 @@ skip:
 		goto again;
 	}
 
-	if (!rec)
-		hfs_brec_update_parent(fd);
-
 	return 0;
 }
 
@@ -366,6 +366,8 @@ again:
 	if (IS_ERR(parent))
 		return PTR_ERR(parent);
 	__hfs_brec_find(parent, fd);
+	if (fd->record < 0)
+		return -ENOENT;
 	hfs_bnode_dump(parent);
 	rec = fd->record;
 

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

* [PATCH 3.16.y-ckt 084/133] drm/qxl: validate monitors config modes
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (82 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 083/133] hfs: fix B-tree corruption after insertion at position 0 Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 085/133] PCI: Fix TI816X class code quirk Luis Henriques
                   ` (48 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jonathon Jongsma, Dave Airlie, Luis Henriques

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

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

From: Jonathon Jongsma <jjongsma@redhat.com>

commit bd3e1c7c6de9f5f70d97cdb6c817151c0477c5e3 upstream.

Due to some recent changes in
drm_helper_probe_single_connector_modes_merge_bits(), old custom modes
were not being pruned properly. In current kernels,
drm_mode_validate_basic() is called to sanity-check each mode in the
list. If the sanity-check passes, the mode's status gets set to to
MODE_OK. In older kernels this check was not done, so old custom modes
would still have a status of MODE_UNVERIFIED at this point, and would
therefore be pruned later in the function.

As a result of this new behavior, the list of modes for a device always
includes every custom mode ever configured for the device, with the
largest one listed first. Since desktop environments usually choose the
first preferred mode when a hotplug event is emitted, this had the
result of making it very difficult for the user to reduce the size of
the display.

The qxl driver did implement the mode_valid connector function, but it
was empty. In order to restore the old behavior where old custom modes
are pruned, we implement a proper mode_valid function for the qxl
driver. This function now checks each mode against the last configured
custom mode and the list of standard modes. If the mode doesn't match
any of these, its status is set to MODE_BAD so that it will be pruned as
expected.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/qxl/qxl_display.c | 66 ++++++++++++++++++++++++---------------
 drivers/gpu/drm/qxl/qxl_drv.h     |  2 ++
 2 files changed, 42 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 98a344cef531..db72b4c17987 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -136,9 +136,35 @@ static int qxl_add_monitors_config_modes(struct drm_connector *connector,
 	*pwidth = head->width;
 	*pheight = head->height;
 	drm_mode_probed_add(connector, mode);
+	/* remember the last custom size for mode validation */
+	qdev->monitors_config_width = mode->hdisplay;
+	qdev->monitors_config_height = mode->vdisplay;
 	return 1;
 }
 
+static struct mode_size {
+	int w;
+	int h;
+} common_modes[] = {
+	{ 640,  480},
+	{ 720,  480},
+	{ 800,  600},
+	{ 848,  480},
+	{1024,  768},
+	{1152,  768},
+	{1280,  720},
+	{1280,  800},
+	{1280,  854},
+	{1280,  960},
+	{1280, 1024},
+	{1440,  900},
+	{1400, 1050},
+	{1680, 1050},
+	{1600, 1200},
+	{1920, 1080},
+	{1920, 1200}
+};
+
 static int qxl_add_common_modes(struct drm_connector *connector,
                                 unsigned pwidth,
                                 unsigned pheight)
@@ -146,29 +172,6 @@ static int qxl_add_common_modes(struct drm_connector *connector,
 	struct drm_device *dev = connector->dev;
 	struct drm_display_mode *mode = NULL;
 	int i;
-	struct mode_size {
-		int w;
-		int h;
-	} common_modes[] = {
-		{ 640,  480},
-		{ 720,  480},
-		{ 800,  600},
-		{ 848,  480},
-		{1024,  768},
-		{1152,  768},
-		{1280,  720},
-		{1280,  800},
-		{1280,  854},
-		{1280,  960},
-		{1280, 1024},
-		{1440,  900},
-		{1400, 1050},
-		{1680, 1050},
-		{1600, 1200},
-		{1920, 1080},
-		{1920, 1200}
-	};
-
 	for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
 		mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h,
 				    60, false, false, false);
@@ -757,11 +760,22 @@ static int qxl_conn_get_modes(struct drm_connector *connector)
 static int qxl_conn_mode_valid(struct drm_connector *connector,
 			       struct drm_display_mode *mode)
 {
+	struct drm_device *ddev = connector->dev;
+	struct qxl_device *qdev = ddev->dev_private;
+	int i;
+
 	/* TODO: is this called for user defined modes? (xrandr --add-mode)
 	 * TODO: check that the mode fits in the framebuffer */
-	DRM_DEBUG("%s: %dx%d status=%d\n", mode->name, mode->hdisplay,
-		  mode->vdisplay, mode->status);
-	return MODE_OK;
+
+	if(qdev->monitors_config_width == mode->hdisplay &&
+	   qdev->monitors_config_height == mode->vdisplay)
+		return MODE_OK;
+
+	for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
+		if (common_modes[i].w == mode->hdisplay && common_modes[i].h == mode->vdisplay)
+			return MODE_OK;
+	}
+	return MODE_BAD;
 }
 
 static struct drm_encoder *qxl_best_encoder(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h
index 36ed40ba773f..8aa077ca8244 100644
--- a/drivers/gpu/drm/qxl/qxl_drv.h
+++ b/drivers/gpu/drm/qxl/qxl_drv.h
@@ -325,6 +325,8 @@ struct qxl_device {
 	struct work_struct fb_work;
 
 	struct drm_property *hotplug_mode_update_property;
+	int monitors_config_width;
+	int monitors_config_height;
 };
 
 /* forward declaration for QXL_INFO_IO */

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

* [PATCH 3.16.y-ckt 085/133] PCI: Fix TI816X class code quirk
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (83 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 084/133] drm/qxl: validate monitors config modes Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 086/133] Input: ambakmi - fix system PM by converting to modern callbacks Luis Henriques
                   ` (47 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bjorn Helgaas, Hemant Pedanekar, Luis Henriques

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

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

From: Bjorn Helgaas <bhelgaas@google.com>

commit d1541dc977d376406f4584d8eb055488655c98ec upstream.

In fixup_ti816x_class(), we assigned "class = PCI_CLASS_MULTIMEDIA_VIDEO".
But PCI_CLASS_MULTIMEDIA_VIDEO is only the two-byte base class/sub-class
and needs to be shifted to make space for the low-order interface byte.

Shift PCI_CLASS_MULTIMEDIA_VIDEO to set the correct class code.

Fixes: 63c4408074cb ("PCI: Add quirk for setting valid class for TI816X Endpoint")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Hemant Pedanekar <hemantp@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/pci/quirks.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 91181b5ff437..61c0b5807986 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2827,12 +2827,15 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x3c28, vtd_mask_spec_errors);
 
 static void fixup_ti816x_class(struct pci_dev *dev)
 {
+	u32 class = dev->class;
+
 	/* TI 816x devices do not have class code set when in PCIe boot mode */
-	dev_info(&dev->dev, "Setting PCI class for 816x PCIe device\n");
-	dev->class = PCI_CLASS_MULTIMEDIA_VIDEO;
+	dev->class = PCI_CLASS_MULTIMEDIA_VIDEO << 8;
+	dev_info(&dev->dev, "PCI class overridden (%#08x -> %#08x)\n",
+		 class, dev->class);
 }
 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_TI, 0xb800,
-				 PCI_CLASS_NOT_DEFINED, 0, fixup_ti816x_class);
+			      PCI_CLASS_NOT_DEFINED, 0, fixup_ti816x_class);
 
 /* Some PCIe devices do not work reliably with the claimed maximum
  * payload size supported.

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

* [PATCH 3.16.y-ckt 086/133] Input: ambakmi - fix system PM by converting to modern callbacks
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (84 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 085/133] PCI: Fix TI816X class code quirk Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 087/133] svcrdma: Fix send_reply() scatter/gather set-up Luis Henriques
                   ` (46 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ulf Hansson, Dmitry Torokhov, Luis Henriques

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

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

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

commit cee3d8ccbecb8af6788edaaac46befca78b000dc upstream.

The legacy system PM support has long time ago been dropped from the
AMBA bus. Align to that by converting to the modern system PM
callbacks.

Fixes: 26825cfd90f9 (ARM: 7914/1: amba: Drop legacy PM support ...)
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/input/serio/ambakmi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 8b748d99b934..c6606cacb6a7 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -175,9 +175,9 @@ static int amba_kmi_remove(struct amba_device *dev)
 	return 0;
 }
 
-static int amba_kmi_resume(struct amba_device *dev)
+static int __maybe_unused amba_kmi_resume(struct device *dev)
 {
-	struct amba_kmi_port *kmi = amba_get_drvdata(dev);
+	struct amba_kmi_port *kmi = dev_get_drvdata(dev);
 
 	/* kick the serio layer to rescan this port */
 	serio_reconnect(kmi->io);
@@ -185,6 +185,8 @@ static int amba_kmi_resume(struct amba_device *dev)
 	return 0;
 }
 
+static SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume);
+
 static struct amba_id amba_kmi_idtable[] = {
 	{
 		.id	= 0x00041050,
@@ -199,11 +201,11 @@ static struct amba_driver ambakmi_driver = {
 	.drv		= {
 		.name	= "kmi-pl050",
 		.owner	= THIS_MODULE,
+		.pm	= &amba_kmi_dev_pm_ops,
 	},
 	.id_table	= amba_kmi_idtable,
 	.probe		= amba_kmi_probe,
 	.remove		= amba_kmi_remove,
-	.resume		= amba_kmi_resume,
 };
 
 module_amba_driver(ambakmi_driver);

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

* [PATCH 3.16.y-ckt 087/133] svcrdma: Fix send_reply() scatter/gather set-up
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (85 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 086/133] Input: ambakmi - fix system PM by converting to modern callbacks Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 088/133] x86/mm: Initialize pmd_idx in page_table_range_init_count() Luis Henriques
                   ` (45 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chuck Lever, J. Bruce Fields, Luis Henriques

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

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

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

commit 9d11b51ce7c150a69e761e30518f294fc73d55ff upstream.

The Linux NFS server returns garbage in the data payload of inline
NFS/RDMA READ replies. These are READs of under 1000 bytes or so
where the client has not provided either a reply chunk or a write
list.

The NFS server delivers the data payload for an NFS READ reply to
the transport in an xdr_buf page list. If the NFS client did not
provide a reply chunk or a write list, send_reply() is supposed to
set up a separate sge for the page containing the READ data, and
another sge for XDR padding if needed, then post all of the sges via
a single SEND Work Request.

The problem is send_reply() does not advance through the xdr_buf
when setting up scatter/gather entries for SEND WR. It always calls
dma_map_xdr with xdr_off set to zero. When there's more than one
sge, dma_map_xdr() sets up the SEND sge's so they all point to the
xdr_buf's head.

The current Linux NFS/RDMA client always provides a reply chunk or
a write list when performing an NFS READ over RDMA. Therefore, it
does not exercise this particular case. The Linux server has never
had to use more than one extra sge for building RPC/RDMA replies
with a Linux client.

However, an NFS/RDMA client _is_ allowed to send small NFS READs
without setting up a write list or reply chunk. The NFS READ reply
fits entirely within the inline reply buffer in this case. This is
perhaps a more efficient way of performing NFS READs that the Linux
NFS/RDMA client may some day adopt.

Fixes: b432e6b3d9c1 ('svcrdma: Change DMA mapping logic to . . .')
BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=285
Signed-off-by: Chuck Lever <chuck.lever@oracle.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/xprtrdma/svc_rdma_sendto.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 49fd21a5c215..0cf9f439025e 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -381,6 +381,7 @@ static int send_reply(struct svcxprt_rdma *rdma,
 		      int byte_count)
 {
 	struct ib_send_wr send_wr;
+	u32 xdr_off;
 	int sge_no;
 	int sge_bytes;
 	int page_no;
@@ -415,8 +416,8 @@ static int send_reply(struct svcxprt_rdma *rdma,
 	ctxt->direction = DMA_TO_DEVICE;
 
 	/* Map the payload indicated by 'byte_count' */
+	xdr_off = 0;
 	for (sge_no = 1; byte_count && sge_no < vec->count; sge_no++) {
-		int xdr_off = 0;
 		sge_bytes = min_t(size_t, vec->sge[sge_no].iov_len, byte_count);
 		byte_count -= sge_bytes;
 		ctxt->sge[sge_no].addr =
@@ -451,6 +452,13 @@ static int send_reply(struct svcxprt_rdma *rdma,
 	}
 	rqstp->rq_next_page = rqstp->rq_respages + 1;
 
+	/* The loop above bumps sc_dma_used for each sge. The
+	 * xdr_buf.tail gets a separate sge, but resides in the
+	 * same page as xdr_buf.head. Don't count it twice.
+	 */
+	if (sge_no > ctxt->count)
+		atomic_dec(&rdma->sc_dma_used);
+
 	BUG_ON(sge_no > rdma->sc_max_sge);
 	memset(&send_wr, 0, sizeof send_wr);
 	ctxt->wr_op = IB_WR_SEND;

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

* [PATCH 3.16.y-ckt 088/133] x86/mm: Initialize pmd_idx in page_table_range_init_count()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (86 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 087/133] svcrdma: Fix send_reply() scatter/gather set-up Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 089/133] net: bcmgenet: Use correct dev_id for free_irq Luis Henriques
                   ` (44 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Minfei Huang, tony.luck, wangnan0, david.vrabel, Thomas Gleixner,
	Luis Henriques

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

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

From: Minfei Huang <mnfhuang@gmail.com>

commit 9962eea9e55f797f05f20ba6448929cab2a9f018 upstream.

The variable pmd_idx is not initialized for the first iteration of the
for loop.

Assign the proper value which indexes the start address.

Fixes: 719272c45b82 'x86, mm: only call early_ioremap_page_table_range_init() once'
Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
Cc: tony.luck@intel.com
Cc: wangnan0@huawei.com
Cc: david.vrabel@citrix.com
Reviewed-by: yinghai@kernel.org
Link: http://lkml.kernel.org/r/1436703522-29552-1-git-send-email-mhuang@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/mm/init_32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index e39504878aec..a7b5b3071072 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end)
 
 	vaddr = start;
 	pgd_idx = pgd_index(vaddr);
+	pmd_idx = pmd_index(vaddr);
 
 	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) {
 		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);

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

* [PATCH 3.16.y-ckt 089/133] net: bcmgenet: Use correct dev_id for free_irq
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (87 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 088/133] x86/mm: Initialize pmd_idx in page_table_range_init_count() Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 090/133] powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers Luis Henriques
                   ` (43 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Florian Fainelli, David S. Miller, Luis Henriques

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

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

From: Florian Fainelli <f.fainelli@gmail.com>

commit 978ffac4189e8bb7e74bce6463e501a7b92555af upstream.

bcmgenet_open()'s error path call free_irq() with a dev_id argument
different from the one we used to call request_irq() with, this will
make us trip over the warning in kernel/irq/manage.c:__free_irq()

Fixes: 1c1008c793fa4 ("net: bcmgenet: add main driver file")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 4e615debe472..201cee5419dc 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2060,7 +2060,7 @@ static int bcmgenet_open(struct net_device *dev)
 	return 0;
 
 err_irq0:
-	free_irq(priv->irq0, dev);
+	free_irq(priv->irq0, priv);
 err_fini_dma:
 	bcmgenet_fini_dma(priv);
 err_clk_disable:

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

* [PATCH 3.16.y-ckt 090/133] powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (88 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 089/133] net: bcmgenet: Use correct dev_id for free_irq Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 091/133] clk: versatile: off by one in clk_sp810_timerclken_of_get() Luis Henriques
                   ` (42 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Huth, Michael Ellerman, Luis Henriques

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

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

From: Thomas Huth <thuth@redhat.com>

commit 1c2cb594441d02815d304cccec9742ff5c707495 upstream.

The EPOW interrupt handler uses rtas_get_sensor(), which in turn
uses rtas_busy_delay() to wait for RTAS becoming ready in case it
is necessary. But rtas_busy_delay() is annotated with might_sleep()
and thus may not be used by interrupts handlers like the EPOW handler!
This leads to the following BUG when CONFIG_DEBUG_ATOMIC_SLEEP is
enabled:

 BUG: sleeping function called from invalid context at arch/powerpc/kernel/rtas.c:496
 in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/1
 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.2.0-rc2-thuth #6
 Call Trace:
 [c00000007ffe7b90] [c000000000807670] dump_stack+0xa0/0xdc (unreliable)
 [c00000007ffe7bc0] [c0000000000e1f14] ___might_sleep+0x134/0x180
 [c00000007ffe7c20] [c00000000002aec0] rtas_busy_delay+0x30/0xd0
 [c00000007ffe7c50] [c00000000002bde4] rtas_get_sensor+0x74/0xe0
 [c00000007ffe7ce0] [c000000000083264] ras_epow_interrupt+0x44/0x450
 [c00000007ffe7d90] [c000000000120260] handle_irq_event_percpu+0xa0/0x300
 [c00000007ffe7e70] [c000000000120524] handle_irq_event+0x64/0xc0
 [c00000007ffe7eb0] [c000000000124dbc] handle_fasteoi_irq+0xec/0x260
 [c00000007ffe7ef0] [c00000000011f4f0] generic_handle_irq+0x50/0x80
 [c00000007ffe7f20] [c000000000010f3c] __do_irq+0x8c/0x200
 [c00000007ffe7f90] [c0000000000236cc] call_do_irq+0x14/0x24
 [c00000007e6f39e0] [c000000000011144] do_IRQ+0x94/0x110
 [c00000007e6f3a30] [c000000000002594] hardware_interrupt_common+0x114/0x180

Fix this issue by introducing a new rtas_get_sensor_fast() function
that does not use rtas_busy_delay() - and thus can only be used for
sensors that do not cause a BUSY condition - known as "fast" sensors.

The EPOW sensor is defined to be "fast" in sPAPR - mpe.

Fixes: 587f83e8dd50 ("powerpc/pseries: Use rtas_get_sensor in RAS code")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/include/asm/rtas.h      |  1 +
 arch/powerpc/kernel/rtas.c           | 17 +++++++++++++++++
 arch/powerpc/platforms/pseries/ras.c |  3 ++-
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index b390f55b0df1..af37e69b3b74 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -316,6 +316,7 @@ extern void rtas_power_off(void);
 extern void rtas_halt(void);
 extern void rtas_os_term(char *str);
 extern int rtas_get_sensor(int sensor, int index, int *state);
+extern int rtas_get_sensor_fast(int sensor, int index, int *state);
 extern int rtas_get_power_level(int powerdomain, int *level);
 extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
 extern bool rtas_indicator_present(int token, int *maxindex);
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 8b4c857c1421..af0dafab5807 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -584,6 +584,23 @@ int rtas_get_sensor(int sensor, int index, int *state)
 }
 EXPORT_SYMBOL(rtas_get_sensor);
 
+int rtas_get_sensor_fast(int sensor, int index, int *state)
+{
+	int token = rtas_token("get-sensor-state");
+	int rc;
+
+	if (token == RTAS_UNKNOWN_SERVICE)
+		return -ENOENT;
+
+	rc = rtas_call(token, 2, 2, state, sensor, index);
+	WARN_ON(rc == RTAS_BUSY || (rc >= RTAS_EXTENDED_DELAY_MIN &&
+				    rc <= RTAS_EXTENDED_DELAY_MAX));
+
+	if (rc < 0)
+		return rtas_error_rc(rc);
+	return rc;
+}
+
 bool rtas_indicator_present(int token, int *maxindex)
 {
 	int proplen, count, i;
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 9c5778e6ed4b..55cbad443500 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -187,7 +187,8 @@ static irqreturn_t ras_epow_interrupt(int irq, void *dev_id)
 	int state;
 	int critical;
 
-	status = rtas_get_sensor(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX, &state);
+	status = rtas_get_sensor_fast(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX,
+				      &state);
 
 	if (state > 3)
 		critical = 1;		/* Time Critical */

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

* [PATCH 3.16.y-ckt 091/133] clk: versatile: off by one in clk_sp810_timerclken_of_get()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (89 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 090/133] powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 092/133] usb: gadget: m66592-udc: forever loop in set_feature() Luis Henriques
                   ` (41 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Stephen Boyd, Luis Henriques

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

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

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

commit 3294bee87091be5f179474f6c39d1d87769635e2 upstream.

The ">" should be ">=" or we end up reading beyond the end of the array.

Fixes: 6e973d2c4385 ('clk: vexpress: Add separate SP810 driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/clk/versatile/clk-sp810.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c
index c6e86a9a2aa3..5122ef25f595 100644
--- a/drivers/clk/versatile/clk-sp810.c
+++ b/drivers/clk/versatile/clk-sp810.c
@@ -128,8 +128,8 @@ static struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec,
 {
 	struct clk_sp810 *sp810 = data;
 
-	if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] >
-			ARRAY_SIZE(sp810->timerclken)))
+	if (WARN_ON(clkspec->args_count != 1 ||
+		    clkspec->args[0] >=	ARRAY_SIZE(sp810->timerclken)))
 		return NULL;
 
 	return sp810->timerclken[clkspec->args[0]].clk;

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

* [PATCH 3.16.y-ckt 092/133] usb: gadget: m66592-udc: forever loop in set_feature()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (90 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 091/133] clk: versatile: off by one in clk_sp810_timerclken_of_get() Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 093/133] windfarm: decrement client count when unregistering Luis Henriques
                   ` (40 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Felipe Balbi, Luis Henriques

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

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

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

commit 5feb5d2003499b1094d898c010a7604d7afddc4c upstream.

There is an "&&" vs "||" typo here so this loops 3000 times or if we get
unlucky it could loop forever.

Fixes: ceaa0a6eeadf ('usb: gadget: m66592-udc: add support for TEST_MODE')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/udc/m66592-udc.c ->
    drivers/usb/gadget/m66592-udc.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/gadget/m66592-udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 0d17174b86f8..36b47a794d77 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1052,7 +1052,7 @@ static void set_feature(struct m66592 *m66592, struct usb_ctrlrequest *ctrl)
 				tmp = m66592_read(m66592, M66592_INTSTS0) &
 								M66592_CTSQ;
 				udelay(1);
-			} while (tmp != M66592_CS_IDST || timeout-- > 0);
+			} while (tmp != M66592_CS_IDST && timeout-- > 0);
 
 			if (tmp == M66592_CS_IDST)
 				m66592_bset(m66592,

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

* [PATCH 3.16.y-ckt 093/133] windfarm: decrement client count when unregistering
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (91 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 092/133] usb: gadget: m66592-udc: forever loop in set_feature() Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 094/133] perf hists: Update the column width for the "srcline" sort key Luis Henriques
                   ` (39 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Paul Bolle, Michael Ellerman, Luis Henriques

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

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

From: Paul Bolle <pebolle@tiscali.nl>

commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream.

wf_unregister_client() increments the client count when a client
unregisters. That is obviously incorrect. Decrement that client count
instead.

Fixes: 75722d3992f5 ("[PATCH] ppc64: Thermal control for SMU based machines")

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/macintosh/windfarm_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 3ee198b65843..cc7ece1712b5 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier_block *nb)
 {
 	mutex_lock(&wf_lock);
 	blocking_notifier_chain_unregister(&wf_client_list, nb);
-	wf_client_count++;
+	wf_client_count--;
 	if (wf_client_count == 0)
 		wf_stop_thread();
 	mutex_unlock(&wf_lock);

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

* [PATCH 3.16.y-ckt 094/133] perf hists: Update the column width for the "srcline" sort key
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (92 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 093/133] windfarm: decrement client count when unregistering Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 095/133] batman-adv: Make DAT capability changes atomic Luis Henriques
                   ` (38 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Namhyung Kim, Andi Kleen, Jiri Olsa, Arnaldo Carvalho de Melo,
	Luis Henriques

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

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

From: Arnaldo Carvalho de Melo <acme@redhat.com>

commit e8e6d37e73e6b950c891c780745460b87f4755b6 upstream.

When we introduce a new sort key, we need to update the
hists__calc_col_len() function accordingly, otherwise the width
will be limited to strlen(header).

We can't update it when obtaining a line value for a column (for
instance, in sort__srcline_cmp()), because we reset it all when doing a
resort (see hists__output_recalc_col_len()), so we need to, from what is
in the hist_entry fields, set each of the column widths.

Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Fixes: 409a8be61560 ("perf tools: Add sort by src line/number")
Link: http://lkml.kernel.org/n/tip-jgbe0yx8v1gs89cslr93pvz2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 tools/perf/util/hist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 30df6187ee02..e2a462bf5822 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -156,6 +156,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
 	hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12);
 	hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12);
 
+	if (h->srcline)
+		hists__new_col_len(hists, HISTC_SRCLINE, strlen(h->srcline));
+
 	if (h->transaction)
 		hists__new_col_len(hists, HISTC_TRANSACTION,
 				   hist_entry__transaction_len());

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

* [PATCH 3.16.y-ckt 095/133] batman-adv: Make DAT capability changes atomic
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (93 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 094/133] perf hists: Update the column width for the "srcline" sort key Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 096/133] batman-adv: Make NC " Luis Henriques
                   ` (37 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit 65d7d46050704bcdb8121ddbf4110bfbf2b38baa upstream.

Bitwise OR/AND assignments in C aren't guaranteed to be atomic. One
OGM handler might undo the set/clear of a specific bit from another
handler run in between.

Fix this by using the atomic set_bit()/clear_bit()/test_bit() functions.

Fixes: 17cf0ea455f1 ("batman-adv: tvlv - add distributed arp table container")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/distributed-arp-table.c | 7 ++++---
 net/batman-adv/types.h                 | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index f2c066b21716..28d70b941bb5 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -15,6 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/bitops.h>
 #include <linux/if_ether.h>
 #include <linux/if_arp.h>
 #include <linux/if_vlan.h>
@@ -422,7 +423,7 @@ static bool batadv_is_orig_node_eligible(struct batadv_dat_candidate *res,
 	int j;
 
 	/* check if orig node candidate is running DAT */
-	if (!(candidate->capabilities & BATADV_ORIG_CAPA_HAS_DAT))
+	if (!test_bit(BATADV_ORIG_CAPA_HAS_DAT, &candidate->capabilities))
 		goto out;
 
 	/* Check if this node has already been selected... */
@@ -681,9 +682,9 @@ static void batadv_dat_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
 					   uint16_t tvlv_value_len)
 {
 	if (flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND)
-		orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_DAT;
+		clear_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities);
 	else
-		orig->capabilities |= BATADV_ORIG_CAPA_HAS_DAT;
+		set_bit(BATADV_ORIG_CAPA_HAS_DAT, &orig->capabilities);
 }
 
 /**
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 8854c05622a9..3d316c8d340c 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -258,7 +258,7 @@ struct batadv_orig_node {
 	struct hlist_node mcast_want_all_ipv4_node;
 	struct hlist_node mcast_want_all_ipv6_node;
 #endif
-	uint8_t capabilities;
+	unsigned long capabilities;
 	uint8_t capa_initialized;
 	atomic_t last_ttvn;
 	unsigned char *tt_buff;
@@ -298,7 +298,7 @@ struct batadv_orig_node {
  *  (= orig node announces a tvlv of type BATADV_TVLV_MCAST)
  */
 enum batadv_orig_capabilities {
-	BATADV_ORIG_CAPA_HAS_DAT = BIT(0),
+	BATADV_ORIG_CAPA_HAS_DAT,
 	BATADV_ORIG_CAPA_HAS_NC = BIT(1),
 	BATADV_ORIG_CAPA_HAS_TT = BIT(2),
 	BATADV_ORIG_CAPA_HAS_MCAST = BIT(3),

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

* [PATCH 3.16.y-ckt 096/133] batman-adv: Make NC capability changes atomic
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (94 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 095/133] batman-adv: Make DAT capability changes atomic Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 097/133] batman-adv: Make TT " Luis Henriques
                   ` (36 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit 4635469f5c617282f18c69643af36cd8c0acf707 upstream.

Bitwise OR/AND assignments in C aren't guaranteed to be atomic. One
OGM handler might undo the set/clear of a specific bit from another
handler run in between.

Fix this by using the atomic set_bit()/clear_bit()/test_bit() functions.

Fixes: 3f4841ffb336 ("batman-adv: tvlv - add network coding container")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/network-coding.c | 7 ++++---
 net/batman-adv/types.h          | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
index 8d04d174669e..65d19690d8ae 100644
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@ -15,6 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/bitops.h>
 #include <linux/debugfs.h>
 
 #include "main.h"
@@ -105,9 +106,9 @@ static void batadv_nc_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
 					  uint16_t tvlv_value_len)
 {
 	if (flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND)
-		orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_NC;
+		clear_bit(BATADV_ORIG_CAPA_HAS_NC, &orig->capabilities);
 	else
-		orig->capabilities |= BATADV_ORIG_CAPA_HAS_NC;
+		set_bit(BATADV_ORIG_CAPA_HAS_NC, &orig->capabilities);
 }
 
 /**
@@ -871,7 +872,7 @@ void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
 		goto out;
 
 	/* check if orig node is network coding enabled */
-	if (!(orig_node->capabilities & BATADV_ORIG_CAPA_HAS_NC))
+	if (!test_bit(BATADV_ORIG_CAPA_HAS_NC, &orig_node->capabilities))
 		goto out;
 
 	/* accept ogms from 'good' neighbors and single hop neighbors */
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 3d316c8d340c..1b0b053ae729 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -299,7 +299,7 @@ struct batadv_orig_node {
  */
 enum batadv_orig_capabilities {
 	BATADV_ORIG_CAPA_HAS_DAT,
-	BATADV_ORIG_CAPA_HAS_NC = BIT(1),
+	BATADV_ORIG_CAPA_HAS_NC,
 	BATADV_ORIG_CAPA_HAS_TT = BIT(2),
 	BATADV_ORIG_CAPA_HAS_MCAST = BIT(3),
 };

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

* [PATCH 3.16.y-ckt 097/133] batman-adv: Make TT capability changes atomic
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (95 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 096/133] batman-adv: Make NC " Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 098/133] batman-adv: fix multicast counter when purging originators Luis Henriques
                   ` (35 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit ac4eebd48461ec993e7cb614d5afe7df8c72e6b7 upstream.

Bitwise OR/AND assignments in C aren't guaranteed to be atomic. One
OGM handler might undo the set/clear of a specific bit from another
handler run in between.

Fix this by using the atomic set_bit()/clear_bit()/test_bit() functions.

Fixes: e17931d1a61d ("batman-adv: introduce capability initialization bitfield")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/translation-table.c | 8 +++++---
 net/batman-adv/types.h             | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 4503069e29b5..b3e61e575f06 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -26,6 +26,7 @@
 #include "bridge_loop_avoidance.h"
 #include "multicast.h"
 
+#include <linux/bitops.h>
 #include <linux/crc32c.h>
 
 /* hash class keys */
@@ -1861,7 +1862,7 @@ void batadv_tt_global_del_orig(struct batadv_priv *bat_priv,
 		}
 		spin_unlock_bh(list_lock);
 	}
-	orig_node->capa_initialized &= ~BATADV_ORIG_CAPA_HAS_TT;
+	clear_bit(BATADV_ORIG_CAPA_HAS_TT, &orig_node->capa_initialized);
 }
 
 static bool batadv_tt_global_to_purge(struct batadv_tt_global_entry *tt_global,
@@ -2821,7 +2822,7 @@ static void _batadv_tt_update_changes(struct batadv_priv *bat_priv,
 				return;
 		}
 	}
-	orig_node->capa_initialized |= BATADV_ORIG_CAPA_HAS_TT;
+	set_bit(BATADV_ORIG_CAPA_HAS_TT, &orig_node->capa_initialized);
 }
 
 static void batadv_tt_fill_gtable(struct batadv_priv *bat_priv,
@@ -3323,7 +3324,8 @@ static void batadv_tt_update_orig(struct batadv_priv *bat_priv,
 	bool has_tt_init;
 
 	tt_vlan = (struct batadv_tvlv_tt_vlan_data *)tt_buff;
-	has_tt_init = orig_node->capa_initialized & BATADV_ORIG_CAPA_HAS_TT;
+	has_tt_init = test_bit(BATADV_ORIG_CAPA_HAS_TT,
+			       &orig_node->capa_initialized);
 
 	/* orig table not initialised AND first diff is in the OGM OR the ttvn
 	 * increased by one -> we can apply the attached changes
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 1b0b053ae729..fdf65b50e3ec 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -259,7 +259,7 @@ struct batadv_orig_node {
 	struct hlist_node mcast_want_all_ipv6_node;
 #endif
 	unsigned long capabilities;
-	uint8_t capa_initialized;
+	unsigned long capa_initialized;
 	atomic_t last_ttvn;
 	unsigned char *tt_buff;
 	int16_t tt_buff_len;
@@ -300,7 +300,7 @@ struct batadv_orig_node {
 enum batadv_orig_capabilities {
 	BATADV_ORIG_CAPA_HAS_DAT,
 	BATADV_ORIG_CAPA_HAS_NC,
-	BATADV_ORIG_CAPA_HAS_TT = BIT(2),
+	BATADV_ORIG_CAPA_HAS_TT,
 	BATADV_ORIG_CAPA_HAS_MCAST = BIT(3),
 };
 

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

* [PATCH 3.16.y-ckt 098/133] batman-adv: fix multicast counter when purging originators
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (96 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 097/133] batman-adv: Make TT " Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 099/133] batman-adv: fix counter for multicast supporting nodes Luis Henriques
                   ` (34 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit a5164886b0bdadd662f9715a7541432c4d1a0d99 upstream.

When purging an orig_node we should only decrease counter tracking the
number of nodes without multicast optimizations support if it was
increased through this orig_node before.

A not yet quite initialized orig_node (meaning it did not have its turn
in the mcast-tvlv handler so far) which gets purged would not adhere to
this and will lead to a counter imbalance.

Fixing this by adding a check whether the orig_node is mcast-initalized
before decreasing the counter in the mcast-orig_node-purging routine.

Introduced by 60432d756cf06e597ef9da511402dd059b112447
("batman-adv: Announce new capability via multicast TVLV")

Reported-by: Tobias Hachmer <tobias@hachmer.de>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/multicast.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index 96b66fd30f96..a5e457ec4916 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -739,7 +739,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
 {
 	struct batadv_priv *bat_priv = orig->bat_priv;
 
-	if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST))
+	if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) &&
+	    orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST)
 		atomic_dec(&bat_priv->mcast.num_disabled);
 
 	batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);

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

* [PATCH 3.16.y-ckt 099/133] batman-adv: fix counter for multicast supporting nodes
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (97 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 098/133] batman-adv: fix multicast counter when purging originators Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 100/133] batman-adv: Make MCAST capability changes atomic Luis Henriques
                   ` (33 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit e8829f007e982a9a8fb4023109233d5f344d4657 upstream.

A miscounting of nodes having multicast optimizations enabled can lead
to multicast packet loss in the following scenario:

If the first OGM a node receives from another one has no multicast
optimizations support (no multicast tvlv) then we are missing to
increase the counter. This potentially leads to the wrong assumption
that we could safely use multicast optimizations.

Fixings this by increasing the counter if the initial OGM has the
multicast TVLV unset, too.

Introduced by 60432d756cf06e597ef9da511402dd059b112447
("batman-adv: Announce new capability via multicast TVLV")

Reported-by: Tobias Hachmer <tobias@hachmer.de>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/multicast.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index a5e457ec4916..fe57bde57a2c 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -686,11 +686,13 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
 		if (orig_initialized)
 			atomic_dec(&bat_priv->mcast.num_disabled);
 		orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST;
-	/* If mcast support is being switched off increase the disabled
-	 * mcast node counter.
+	/* If mcast support is being switched off or if this is an initial
+	 * OGM without mcast support then increase the disabled mcast
+	 * node counter.
 	 */
 	} else if (!orig_mcast_enabled &&
-		   orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) {
+		   (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST ||
+		    !orig_initialized)) {
 		atomic_inc(&bat_priv->mcast.num_disabled);
 		orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST;
 	}

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

* [PATCH 3.16.y-ckt 100/133] batman-adv: Make MCAST capability changes atomic
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (98 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 099/133] batman-adv: fix counter for multicast supporting nodes Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 101/133] batman-adv: Fix potential synchronization issues in mcast tvlv handler Luis Henriques
                   ` (32 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit 9c936e3f4c4fad07abb6c082a89508b8f724c88f upstream.

Bitwise OR/AND assignments in C aren't guaranteed to be atomic. One
OGM handler might undo the set/clear of a specific bit from another
handler run in between.

Fix this by using the atomic set_bit()/clear_bit()/test_bit() functions.

Fixes: 60432d756cf0 ("batman-adv: Announce new capability via multicast TVLV")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/multicast.c | 19 +++++++++++--------
 net/batman-adv/types.h     |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index fe57bde57a2c..fef99333309a 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -22,6 +22,8 @@
 #include "translation-table.h"
 #include "multicast.h"
 
+#include <linux/bitops.h>
+
 /**
  * batadv_mcast_mla_softif_get - get softif multicast listeners
  * @dev: the device to collect multicast addresses from
@@ -675,29 +677,30 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
 	uint8_t mcast_flags = BATADV_NO_FLAGS;
 	bool orig_initialized;
 
-	orig_initialized = orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST;
+	orig_initialized = test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
+				    &orig->capa_initialized);
 
 	/* If mcast support is turned on decrease the disabled mcast node
 	 * counter only if we had increased it for this node before. If this
 	 * is a completely new orig_node no need to decrease the counter.
 	 */
 	if (orig_mcast_enabled &&
-	    !(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST)) {
+	    !test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities)) {
 		if (orig_initialized)
 			atomic_dec(&bat_priv->mcast.num_disabled);
-		orig->capabilities |= BATADV_ORIG_CAPA_HAS_MCAST;
+		set_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities);
 	/* If mcast support is being switched off or if this is an initial
 	 * OGM without mcast support then increase the disabled mcast
 	 * node counter.
 	 */
 	} else if (!orig_mcast_enabled &&
-		   (orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST ||
+		   (test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities) ||
 		    !orig_initialized)) {
 		atomic_inc(&bat_priv->mcast.num_disabled);
-		orig->capabilities &= ~BATADV_ORIG_CAPA_HAS_MCAST;
+		clear_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities);
 	}
 
-	orig->capa_initialized |= BATADV_ORIG_CAPA_HAS_MCAST;
+	set_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capa_initialized);
 
 	if (orig_mcast_enabled && tvlv_value &&
 	    (tvlv_value_len >= sizeof(mcast_flags)))
@@ -741,8 +744,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
 {
 	struct batadv_priv *bat_priv = orig->bat_priv;
 
-	if (!(orig->capabilities & BATADV_ORIG_CAPA_HAS_MCAST) &&
-	    orig->capa_initialized & BATADV_ORIG_CAPA_HAS_MCAST)
+	if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities) &&
+	    test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capa_initialized))
 		atomic_dec(&bat_priv->mcast.num_disabled);
 
 	batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index fdf65b50e3ec..b9cad3666b65 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -301,7 +301,7 @@ enum batadv_orig_capabilities {
 	BATADV_ORIG_CAPA_HAS_DAT,
 	BATADV_ORIG_CAPA_HAS_NC,
 	BATADV_ORIG_CAPA_HAS_TT,
-	BATADV_ORIG_CAPA_HAS_MCAST = BIT(3),
+	BATADV_ORIG_CAPA_HAS_MCAST,
 };
 
 /**

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

* [PATCH 3.16.y-ckt 101/133] batman-adv: Fix potential synchronization issues in mcast tvlv handler
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (99 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 100/133] batman-adv: Make MCAST capability changes atomic Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 102/133] batman-adv: Fix potentially broken skb network header access Luis Henriques
                   ` (31 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit 8a4023c5b5e30b11f1f383186f4a7222b3b823cf upstream.

So far the mcast tvlv handler did not anticipate the processing of
multiple incoming OGMs from the same originator at the same time. This
can lead to various issues:

* Broken refcounting: For instance two mcast handlers might both assume
  that an originator just got multicast capabilities and will together
  wrongly decrease mcast.num_disabled by two, potentially leading to
  an integer underflow.

* Potential kernel panic on hlist_del_rcu(): Two mcast handlers might
  one after another try to do an
  hlist_del_rcu(&orig->mcast_want_all_*_node). The second one will
  cause memory corruption / crashes.
  (Reported by: Sven Eckelmann <sven@narfation.org>)

Right in the beginning the code path makes assumptions about the current
multicast related state of an originator and bases all updates on that. The
easiest and least error prune way to fix the issues in this case is to
serialize multiple mcast handler invocations with a spinlock.

Fixes: 60432d756cf0 ("batman-adv: Announce new capability via multicast TVLV")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/multicast.c  | 63 +++++++++++++++++++++++++++++++++++----------
 net/batman-adv/originator.c |  5 ++++
 net/batman-adv/types.h      |  3 +++
 3 files changed, 58 insertions(+), 13 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index fef99333309a..a6a908f1ae87 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -23,6 +23,7 @@
 #include "multicast.h"
 
 #include <linux/bitops.h>
+#include <linux/bug.h>
 
 /**
  * batadv_mcast_mla_softif_get - get softif multicast listeners
@@ -568,19 +569,26 @@ batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
  *
  * If the BATADV_MCAST_WANT_ALL_UNSNOOPABLES flag of this originator,
  * orig, has toggled then this method updates counter and list accordingly.
+ *
+ * Caller needs to hold orig->mcast_handler_lock.
  */
 static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
 					     struct batadv_orig_node *orig,
 					     uint8_t mcast_flags)
 {
+	struct hlist_node *node = &orig->mcast_want_all_unsnoopables_node;
+	struct hlist_head *head = &bat_priv->mcast.want_all_unsnoopables_list;
+
 	/* switched from flag unset to set */
 	if (mcast_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES &&
 	    !(orig->mcast_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES)) {
 		atomic_inc(&bat_priv->mcast.num_want_all_unsnoopables);
 
 		spin_lock_bh(&bat_priv->mcast.want_lists_lock);
-		hlist_add_head_rcu(&orig->mcast_want_all_unsnoopables_node,
-				   &bat_priv->mcast.want_all_unsnoopables_list);
+		/* flag checks above + mcast_handler_lock prevents this */
+		WARN_ON(!hlist_unhashed(node));
+
+		hlist_add_head_rcu(node, head);
 		spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
 	/* switched from flag set to unset */
 	} else if (!(mcast_flags & BATADV_MCAST_WANT_ALL_UNSNOOPABLES) &&
@@ -588,7 +596,10 @@ static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
 		atomic_dec(&bat_priv->mcast.num_want_all_unsnoopables);
 
 		spin_lock_bh(&bat_priv->mcast.want_lists_lock);
-		hlist_del_rcu(&orig->mcast_want_all_unsnoopables_node);
+		/* flag checks above + mcast_handler_lock prevents this */
+		WARN_ON(hlist_unhashed(node));
+
+		hlist_del_init_rcu(node);
 		spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
 	}
 }
@@ -601,19 +612,26 @@ static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv,
  *
  * If the BATADV_MCAST_WANT_ALL_IPV4 flag of this originator, orig, has
  * toggled then this method updates counter and list accordingly.
+ *
+ * Caller needs to hold orig->mcast_handler_lock.
  */
 static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
 					  struct batadv_orig_node *orig,
 					  uint8_t mcast_flags)
 {
+	struct hlist_node *node = &orig->mcast_want_all_ipv4_node;
+	struct hlist_head *head = &bat_priv->mcast.want_all_ipv4_list;
+
 	/* switched from flag unset to set */
 	if (mcast_flags & BATADV_MCAST_WANT_ALL_IPV4 &&
 	    !(orig->mcast_flags & BATADV_MCAST_WANT_ALL_IPV4)) {
 		atomic_inc(&bat_priv->mcast.num_want_all_ipv4);
 
 		spin_lock_bh(&bat_priv->mcast.want_lists_lock);
-		hlist_add_head_rcu(&orig->mcast_want_all_ipv4_node,
-				   &bat_priv->mcast.want_all_ipv4_list);
+		/* flag checks above + mcast_handler_lock prevents this */
+		WARN_ON(!hlist_unhashed(node));
+
+		hlist_add_head_rcu(node, head);
 		spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
 	/* switched from flag set to unset */
 	} else if (!(mcast_flags & BATADV_MCAST_WANT_ALL_IPV4) &&
@@ -621,7 +639,10 @@ static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
 		atomic_dec(&bat_priv->mcast.num_want_all_ipv4);
 
 		spin_lock_bh(&bat_priv->mcast.want_lists_lock);
-		hlist_del_rcu(&orig->mcast_want_all_ipv4_node);
+		/* flag checks above + mcast_handler_lock prevents this */
+		WARN_ON(hlist_unhashed(node));
+
+		hlist_del_init_rcu(node);
 		spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
 	}
 }
@@ -634,19 +655,26 @@ static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv,
  *
  * If the BATADV_MCAST_WANT_ALL_IPV6 flag of this originator, orig, has
  * toggled then this method updates counter and list accordingly.
+ *
+ * Caller needs to hold orig->mcast_handler_lock.
  */
 static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,
 					  struct batadv_orig_node *orig,
 					  uint8_t mcast_flags)
 {
+	struct hlist_node *node = &orig->mcast_want_all_ipv6_node;
+	struct hlist_head *head = &bat_priv->mcast.want_all_ipv6_list;
+
 	/* switched from flag unset to set */
 	if (mcast_flags & BATADV_MCAST_WANT_ALL_IPV6 &&
 	    !(orig->mcast_flags & BATADV_MCAST_WANT_ALL_IPV6)) {
 		atomic_inc(&bat_priv->mcast.num_want_all_ipv6);
 
 		spin_lock_bh(&bat_priv->mcast.want_lists_lock);
-		hlist_add_head_rcu(&orig->mcast_want_all_ipv6_node,
-				   &bat_priv->mcast.want_all_ipv6_list);
+		/* flag checks above + mcast_handler_lock prevents this */
+		WARN_ON(!hlist_unhashed(node));
+
+		hlist_add_head_rcu(node, head);
 		spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
 	/* switched from flag set to unset */
 	} else if (!(mcast_flags & BATADV_MCAST_WANT_ALL_IPV6) &&
@@ -654,7 +682,10 @@ static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv,
 		atomic_dec(&bat_priv->mcast.num_want_all_ipv6);
 
 		spin_lock_bh(&bat_priv->mcast.want_lists_lock);
-		hlist_del_rcu(&orig->mcast_want_all_ipv6_node);
+		/* flag checks above + mcast_handler_lock prevents this */
+		WARN_ON(hlist_unhashed(node));
+
+		hlist_del_init_rcu(node);
 		spin_unlock_bh(&bat_priv->mcast.want_lists_lock);
 	}
 }
@@ -677,6 +708,11 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
 	uint8_t mcast_flags = BATADV_NO_FLAGS;
 	bool orig_initialized;
 
+	if (orig_mcast_enabled && tvlv_value &&
+	    (tvlv_value_len >= sizeof(mcast_flags)))
+		mcast_flags = *(uint8_t *)tvlv_value;
+
+	spin_lock_bh(&orig->mcast_handler_lock);
 	orig_initialized = test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
 				    &orig->capa_initialized);
 
@@ -702,15 +738,12 @@ static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
 
 	set_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capa_initialized);
 
-	if (orig_mcast_enabled && tvlv_value &&
-	    (tvlv_value_len >= sizeof(mcast_flags)))
-		mcast_flags = *(uint8_t *)tvlv_value;
-
 	batadv_mcast_want_unsnoop_update(bat_priv, orig, mcast_flags);
 	batadv_mcast_want_ipv4_update(bat_priv, orig, mcast_flags);
 	batadv_mcast_want_ipv6_update(bat_priv, orig, mcast_flags);
 
 	orig->mcast_flags = mcast_flags;
+	spin_unlock_bh(&orig->mcast_handler_lock);
 }
 
 /**
@@ -744,6 +777,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
 {
 	struct batadv_priv *bat_priv = orig->bat_priv;
 
+	spin_lock_bh(&orig->mcast_handler_lock);
+
 	if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities) &&
 	    test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capa_initialized))
 		atomic_dec(&bat_priv->mcast.num_disabled);
@@ -751,4 +786,6 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
 	batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
 	batadv_mcast_want_ipv4_update(bat_priv, orig, BATADV_NO_FLAGS);
 	batadv_mcast_want_ipv6_update(bat_priv, orig, BATADV_NO_FLAGS);
+
+	spin_unlock_bh(&orig->mcast_handler_lock);
 }
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 6a484514cd3e..57b30a6b9bbb 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -680,8 +680,13 @@ struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv,
 	orig_node->tt_buff_len = 0;
 	reset_time = jiffies - 1 - msecs_to_jiffies(BATADV_RESET_PROTECTION_MS);
 	orig_node->bcast_seqno_reset = reset_time;
+
 #ifdef CONFIG_BATMAN_ADV_MCAST
 	orig_node->mcast_flags = BATADV_NO_FLAGS;
+	INIT_HLIST_NODE(&orig_node->mcast_want_all_unsnoopables_node);
+	INIT_HLIST_NODE(&orig_node->mcast_want_all_ipv4_node);
+	INIT_HLIST_NODE(&orig_node->mcast_want_all_ipv6_node);
+	spin_lock_init(&orig_node->mcast_handler_lock);
 #endif
 
 	/* create a vlan object for the "untagged" LAN */
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index b9cad3666b65..27dddb453725 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -205,6 +205,7 @@ struct batadv_orig_bat_iv {
  * @batadv_dat_addr_t:  address of the orig node in the distributed hash
  * @last_seen: time when last packet from this node was received
  * @bcast_seqno_reset: time when the broadcast seqno window was reset
+ * @mcast_handler_lock: synchronizes mcast-capability and -flag changes
  * @mcast_flags: multicast flags announced by the orig node
  * @mcast_want_all_unsnoop_node: a list node for the
  *  mcast.want_all_unsnoopables list
@@ -253,6 +254,8 @@ struct batadv_orig_node {
 	unsigned long last_seen;
 	unsigned long bcast_seqno_reset;
 #ifdef CONFIG_BATMAN_ADV_MCAST
+	/* synchronizes mcast tvlv specific orig changes */
+	spinlock_t mcast_handler_lock;
 	uint8_t mcast_flags;
 	struct hlist_node mcast_want_all_unsnoopables_node;
 	struct hlist_node mcast_want_all_ipv4_node;

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

* [PATCH 3.16.y-ckt 102/133] batman-adv: Fix potentially broken skb network header access
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (100 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 101/133] batman-adv: Fix potential synchronization issues in mcast tvlv handler Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 103/133] net: fix endian check warning in etherdevice.h Luis Henriques
                   ` (30 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Marek Lindner, Antonio Quartulli,
	Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>

commit 53cf037bf846417fd92dc92ddf97267f69b110f4 upstream.

The two commits noted below added calls to ip_hdr() and ipv6_hdr(). They
need a correctly set skb network header.

Unfortunately we cannot rely on the device drivers to set it for us.
Therefore setting it in the beginning of the according ndo_start_xmit
handler.

Fixes: 1d8ab8d3c176 ("batman-adv: Modified forwarding behaviour for multicast packets")
Fixes: ab49886e3da7 ("batman-adv: Add IPv4 link-local/IPv6-ll-all-nodes multicast support")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/soft-interface.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 713498c378c7..3348eccf3e22 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -173,6 +173,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
 	int gw_mode;
 	enum batadv_forw_mode forw_mode;
 	struct batadv_orig_node *mcast_single_orig = NULL;
+	int network_offset = ETH_HLEN;
 
 	if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
 		goto dropped;
@@ -185,14 +186,18 @@ static int batadv_interface_tx(struct sk_buff *skb,
 	case ETH_P_8021Q:
 		vhdr = vlan_eth_hdr(skb);
 
-		if (vhdr->h_vlan_encapsulated_proto != ethertype)
+		if (vhdr->h_vlan_encapsulated_proto != ethertype) {
+			network_offset += VLAN_HLEN;
 			break;
+		}
 
 		/* fall through */
 	case ETH_P_BATMAN:
 		goto dropped;
 	}
 
+	skb_set_network_header(skb, network_offset);
+
 	if (batadv_bla_tx(bat_priv, skb, vid))
 		goto dropped;
 

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

* [PATCH 3.16.y-ckt 103/133] net: fix endian check warning in etherdevice.h
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (101 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 102/133] batman-adv: Fix potentially broken skb network header access Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 104/133] powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash Luis Henriques
                   ` (29 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jesse Brandeburg, Joe Perches, David S. Miller, Luis Henriques

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

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

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

commit fbaff3ef859a86dc3df2128d2de9f8a6e255a967 upstream.

Sparse builds have been warning for a really long time now
that etherdevice.h has a conversion that is unsafe.

  include/linux/etherdevice.h:79:32: warning: restricted __be16 degrades to integer

This code change fixes the issue and generates the exact
same assembly before/after (checked on x86_64)

Fixes: 2c722fe1c821 (etherdevice: Optimize a few is_<foo>_ether_addr functions)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/etherdevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 9c5529dc6d07..b3ef0bf12754 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -72,7 +72,7 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
 
 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
 	return (((*(const u32 *)addr) ^ (*(const u32 *)b)) |
-		((a[2] ^ b[2]) & m)) == 0;
+		(__force int)((a[2] ^ b[2]) & m)) == 0;
 #else
 	return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
 #endif

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

* [PATCH 3.16.y-ckt 104/133] powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (102 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 103/133] net: fix endian check warning in etherdevice.h Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 105/133] mtd: pxa3xx_nand: add a default chunk size Luis Henriques
                   ` (28 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Michael Ellerman, Luis Henriques

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

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

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

commit 74b5037baa2011a2799e2c43adde7d171b072f9e upstream.

The powerpc kernel can be built to have either a 4K PAGE_SIZE or a 64K
PAGE_SIZE.

However when built with a 4K PAGE_SIZE there is an additional config
option which can be enabled, PPC_HAS_HASH_64K, which means the kernel
also knows how to hash a 64K page even though the base PAGE_SIZE is 4K.

This is used in one obscure configuration, to support 64K pages for SPU
local store on the Cell processor when the rest of the kernel is using
4K pages.

In this configuration, pte_pagesize_index() is defined to just pass
through its arguments to get_slice_psize(). However pte_pagesize_index()
is called for both user and kernel addresses, whereas get_slice_psize()
only knows how to handle user addresses.

This has been broken forever, however until recently it happened to
work. That was because in get_slice_psize() the large kernel address
would cause the right shift of the slice mask to return zero.

However in commit 7aa0727f3302 ("powerpc/mm: Increase the slice range to
64TB"), the get_slice_psize() code was changed so that instead of a
right shift we do an array lookup based on the address. When passed a
kernel address this means we index way off the end of the slice array
and return random junk.

That is only fatal if we happen to hit something non-zero, but when we
do return a non-zero value we confuse the MMU code and eventually cause
a check stop.

This fix is ugly, but simple. When we're called for a kernel address we
return 4K, which is always correct in this configuration, otherwise we
use the slice mask.

Fixes: 7aa0727f3302 ("powerpc/mm: Increase the slice range to 64TB")
Reported-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/include/asm/pgtable-ppc64.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index 7b3d54fae46f..7356053b1133 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -135,7 +135,19 @@
 #define pte_iterate_hashed_end() } while(0)
 
 #ifdef CONFIG_PPC_HAS_HASH_64K
-#define pte_pagesize_index(mm, addr, pte)	get_slice_psize(mm, addr)
+/*
+ * We expect this to be called only for user addresses or kernel virtual
+ * addresses other than the linear mapping.
+ */
+#define pte_pagesize_index(mm, addr, pte)			\
+	({							\
+		unsigned int psize;				\
+		if (is_kernel_addr(addr))			\
+			psize = MMU_PAGE_4K;			\
+		else						\
+			psize = get_slice_psize(mm, addr);	\
+		psize;						\
+	})
 #else
 #define pte_pagesize_index(mm, addr, pte)	MMU_PAGE_4K
 #endif

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

* [PATCH 3.16.y-ckt 105/133] mtd: pxa3xx_nand: add a default chunk size
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (103 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 104/133] powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 106/133] ath10k: fix dma_mapping_error() handling Luis Henriques
                   ` (27 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Antoine Tenart, Brian Norris, Luis Henriques

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

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

From: =?UTF-8?q?Antoine=20T=C3=A9nart?= <antoine.tenart@free-electrons.com>

commit bc3e00f04cc1fe033a289c2fc2e5c73c0168d360 upstream.

When keeping the configuration set by the bootloader (by using
the marvell,nand-keep-config property), the pxa3xx_nand_detect_config()
function is called and set the chunk size to 512 as a default value if
NDCR_PAGE_SZ is not set.

In the other case, when not keeping the bootloader configuration, no
chunk size is set. Fix this by adding a default chunk size of 512.

Fixes: 70ed85232a93 ("mtd: nand: pxa3xx: Introduce multiple page I/O
support")

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index bc677362bc73..eac876732f97 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1465,6 +1465,9 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
 	if (pdata->keep_config && !pxa3xx_nand_detect_config(info))
 		goto KEEP_CONFIG;
 
+	/* Set a default chunk size */
+	info->chunk_size = 512;
+
 	ret = pxa3xx_nand_sensing(info);
 	if (ret) {
 		dev_info(&info->pdev->dev, "There is no chip on cs %d!\n",

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

* [PATCH 3.16.y-ckt 106/133] ath10k: fix dma_mapping_error() handling
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (104 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 105/133] mtd: pxa3xx_nand: add a default chunk size Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 107/133] mmc: sdhci: also get preset value and driver type for MMC_DDR52 Luis Henriques
                   ` (26 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michal Kazior, Kalle Valo, Luis Henriques

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

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

From: Michal Kazior <michal.kazior@tieto.com>

commit 5e55e3cbd1042cffa6249f22c10585e63f8a29bf upstream.

The function returns 1 when DMA mapping fails. The
driver would return bogus values and could
possibly confuse itself if DMA failed.

Fixes: 767d34fc67af ("ath10k: remove DMA mapping wrappers")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/ath/ath10k/htc.c    | 4 +++-
 drivers/net/wireless/ath/ath10k/htt_tx.c | 8 ++++++--
 drivers/net/wireless/ath/ath10k/pci.c    | 8 ++++++--
 drivers/net/wireless/ath/ath10k/wmi.c    | 1 +
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index e493db4b4a41..1f55977c9ec9 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -167,8 +167,10 @@ int ath10k_htc_send(struct ath10k_htc *htc,
 
 	skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE);
 	ret = dma_mapping_error(dev, skb_cb->paddr);
-	if (ret)
+	if (ret) {
+		ret = -EIO;
 		goto err_credits;
+	}
 
 	sg_item.transfer_id = ep->eid;
 	sg_item.transfer_context = skb;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 7064354d1f4f..a0aa5a604403 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -345,8 +345,10 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 	skb_cb->paddr = dma_map_single(dev, msdu->data, msdu->len,
 				       DMA_TO_DEVICE);
 	res = dma_mapping_error(dev, skb_cb->paddr);
-	if (res)
+	if (res) {
+		res = -EIO;
 		goto err_free_txdesc;
+	}
 
 	skb_put(txdesc, len);
 	cmd = (struct htt_cmd *)txdesc->data;
@@ -430,8 +432,10 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 	skb_cb->paddr = dma_map_single(dev, msdu->data, msdu->len,
 				       DMA_TO_DEVICE);
 	res = dma_mapping_error(dev, skb_cb->paddr);
-	if (res)
+	if (res) {
+		res = -EIO;
 		goto err_free_txbuf;
+	}
 
 	if (likely(use_frags)) {
 		frags = skb_cb->htt.txbuf->frags;
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index d0004d59c97e..1d993d661e37 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1340,8 +1340,10 @@ static int ath10k_pci_hif_exchange_bmi_msg(struct ath10k *ar,
 
 	req_paddr = dma_map_single(ar->dev, treq, req_len, DMA_TO_DEVICE);
 	ret = dma_mapping_error(ar->dev, req_paddr);
-	if (ret)
+	if (ret) {
+		ret = -EIO;
 		goto err_dma;
+	}
 
 	if (resp && resp_len) {
 		tresp = kzalloc(*resp_len, GFP_KERNEL);
@@ -1353,8 +1355,10 @@ static int ath10k_pci_hif_exchange_bmi_msg(struct ath10k *ar,
 		resp_paddr = dma_map_single(ar->dev, tresp, *resp_len,
 					    DMA_FROM_DEVICE);
 		ret = dma_mapping_error(ar->dev, resp_paddr);
-		if (ret)
+		if (ret) {
+			ret = EIO;
 			goto err_req;
+		}
 
 		xfer.wait_for_resp = true;
 		xfer.resp_len = 0;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 4b7782a529ac..47bb0e760452 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1458,6 +1458,7 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 		if (ret) {
 			ath10k_warn("failed to map beacon: %d\n", ret);
 			dev_kfree_skb_any(bcn);
+			ret = -EIO;
 			goto skip;
 		}
 

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

* [PATCH 3.16.y-ckt 107/133] mmc: sdhci: also get preset value and driver type for MMC_DDR52
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (105 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 106/133] ath10k: fix dma_mapping_error() handling Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 108/133] perf stat: Get correct cpu id for print_aggr Luis Henriques
                   ` (25 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jisheng Zhang, Ulf Hansson, Luis Henriques

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

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

From: Jisheng Zhang <jszhang@marvell.com>

commit 0dafa60eb2506617e6968b97cc5a44914a7fb1a6 upstream.

commit bb8175a8aa42 ("mmc: sdhci: clarify DDR timing mode between
SD-UHS and eMMC") added MMC_DDR52 as eMMC's DDR mode to be
distinguished from SD-UHS, but it missed setting driver type for
MMC_DDR52 timing mode.

So sometimes we get the following error on Marvell BG2Q DMP board:

[    1.559598] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd
response 0x900, card status 0xb00
[    1.569314] mmcblk0: retrying using single block read
[    1.575676] mmcblk0: error -84 transferring data, sector 2, nr 6, cmd
response 0x900, card status 0x0
[    1.585202] blk_update_request: I/O error, dev mmcblk0, sector 2
[    1.591818] mmcblk0: error -84 transferring data, sector 3, nr 5, cmd
response 0x900, card status 0x0
[    1.601341] blk_update_request: I/O error, dev mmcblk0, sector 3

This patches fixes this by adding the missing driver type setting.

Fixes: bb8175a8aa42 ("mmc: sdhci: clarify DDR timing mode ...")
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1d92337f5e4d..d7a5749da895 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1105,6 +1105,7 @@ static u16 sdhci_get_preset_value(struct sdhci_host *host)
 		preset = sdhci_readw(host, SDHCI_PRESET_FOR_SDR104);
 		break;
 	case MMC_TIMING_UHS_DDR50:
+	case MMC_TIMING_MMC_DDR52:
 		preset = sdhci_readw(host, SDHCI_PRESET_FOR_DDR50);
 		break;
 	default:
@@ -1545,7 +1546,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
 				 (ios->timing == MMC_TIMING_UHS_SDR25) ||
 				 (ios->timing == MMC_TIMING_UHS_SDR50) ||
 				 (ios->timing == MMC_TIMING_UHS_SDR104) ||
-				 (ios->timing == MMC_TIMING_UHS_DDR50))) {
+				 (ios->timing == MMC_TIMING_UHS_DDR50) ||
+				 (ios->timing == MMC_TIMING_MMC_DDR52))) {
 			u16 preset;
 
 			sdhci_enable_preset_value(host, true);

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

* [PATCH 3.16.y-ckt 108/133] perf stat: Get correct cpu id for print_aggr
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (106 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 107/133] mmc: sdhci: also get preset value and driver type for MMC_DDR52 Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 109/133] ASoC: spear_pcm: Use devm_snd_dmaengine_pcm_register to fix resource leak Luis Henriques
                   ` (24 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kan Liang, Adrian Hunter, Andi Kleen, David Ahern, Namhyung Kim,
	Peter Zijlstra, Arnaldo Carvalho de Melo, Luis Henriques

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

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

From: Kan Liang <kan.liang@intel.com>

commit 601083cffb7cabdcc55b8195d732f0f7028570fa upstream.

print_aggr() fails to print per-core/per-socket statistics after commit
582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events")
if events have differnt cpus. Because in print_aggr(), aggr_get_id needs
index (not cpu id) to find core/pkg id. Also, evsel cpu maps should be
used to get aggregated id.

Here is an example:

Counting events cycles,uncore_imc_0/cas_count_read/. (Uncore event has
cpumask 0,18)

  $ perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,18 --per-core sleep 2

Without this patch, it failes to get CPU 18 result.

   Performance counter stats for 'CPU(s) 0,18':

  S0-C0           1            7526851      cycles
  S0-C0           1               1.05 MiB  uncore_imc_0/cas_count_read/
  S1-C0           0      <not counted>      cycles
  S1-C0           0      <not counted> MiB  uncore_imc_0/cas_count_read/

With this patch, it can get both CPU0 and CPU18 result.

   Performance counter stats for 'CPU(s) 0,18':

  S0-C0           1            6327768      cycles
  S0-C0           1               0.47 MiB  uncore_imc_0/cas_count_read/
  S1-C0           1             330228      cycles
  S1-C0           1               0.29 MiB  uncore_imc_0/cas_count_read/

Signed-off-by: Kan Liang <kan.liang@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events")
Link: http://lkml.kernel.org/r/1435820925-51091-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 tools/perf/builtin-stat.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 65a151e36067..0c82e635f13f 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1115,7 +1115,7 @@ static void abs_printout(int cpu, int nr, struct perf_evsel *evsel, double avg)
 static void print_aggr(char *prefix)
 {
 	struct perf_evsel *counter;
-	int cpu, cpu2, s, s2, id, nr;
+	int cpu, s, s2, id, nr;
 	double uval;
 	u64 ena, run, val;
 
@@ -1128,8 +1128,7 @@ static void print_aggr(char *prefix)
 			val = ena = run = 0;
 			nr = 0;
 			for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
-				cpu2 = perf_evsel__cpus(counter)->map[cpu];
-				s2 = aggr_get_id(evsel_list->cpus, cpu2);
+				s2 = aggr_get_id(perf_evsel__cpus(counter), cpu);
 				if (s2 != id)
 					continue;
 				val += counter->counts->cpu[cpu].val;

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

* [PATCH 3.16.y-ckt 109/133] ASoC: spear_pcm: Use devm_snd_dmaengine_pcm_register to fix resource leak
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (107 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 108/133] perf stat: Get correct cpu id for print_aggr Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 110/133] IB/mlx4: Fix potential deadlock when sending mad to wire Luis Henriques
                   ` (23 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Axel Lin, Mark Brown, Luis Henriques

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

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

From: Axel Lin <axel.lin@ingics.com>

commit 2c3f4b97eea5ce405baf2591715445da6ed05851 upstream.

All the callers assume devm_spear_pcm_platform_register is a devm_ API, so
use devm_snd_dmaengine_pcm_register in devm_spear_pcm_platform_register.

Fixes: e1771bcf99b0 ("ASoC: SPEAr: remove custom DMA alloc compat function")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/spear/spear_pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 0e5a8f35d0ad..792ee1a0f1de 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -44,7 +44,7 @@ int devm_spear_pcm_platform_register(struct device *dev,
 	*config = spear_dmaengine_pcm_config;
 	config->compat_filter_fn = filter;
 
-	return snd_dmaengine_pcm_register(dev, config,
+	return devm_snd_dmaengine_pcm_register(dev, config,
 		SND_DMAENGINE_PCM_FLAG_NO_DT |
 		SND_DMAENGINE_PCM_FLAG_COMPAT);
 }

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

* [PATCH 3.16.y-ckt 110/133] IB/mlx4: Fix potential deadlock when sending mad to wire
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (108 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 109/133] ASoC: spear_pcm: Use devm_snd_dmaengine_pcm_register to fix resource leak Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 111/133] IB/mlx4: Forbid using sysfs to change RoCE pkeys Luis Henriques
                   ` (22 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jack Morgenstein, Or Gerlitz, Doug Ledford, Luis Henriques

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

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

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

commit 90c1d8b6350cca9d8a234f03c77a317a7613bcee upstream.

send_mad_to_wire takes the same spinlock that is taken in
the interrupt context.  Therefore, it needs irqsave/restore.

Fixes: b9c5d6a64358 ('IB/mlx4: Add multicast group (MCG) paravirtualization for SR-IOV')
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/hw/mlx4/mcg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/mcg.c b/drivers/infiniband/hw/mlx4/mcg.c
index ed327e6c8fdc..a0559a8af4f4 100644
--- a/drivers/infiniband/hw/mlx4/mcg.c
+++ b/drivers/infiniband/hw/mlx4/mcg.c
@@ -206,15 +206,16 @@ static int send_mad_to_wire(struct mlx4_ib_demux_ctx *ctx, struct ib_mad *mad)
 {
 	struct mlx4_ib_dev *dev = ctx->dev;
 	struct ib_ah_attr	ah_attr;
+	unsigned long flags;
 
-	spin_lock(&dev->sm_lock);
+	spin_lock_irqsave(&dev->sm_lock, flags);
 	if (!dev->sm_ah[ctx->port - 1]) {
 		/* port is not yet Active, sm_ah not ready */
-		spin_unlock(&dev->sm_lock);
+		spin_unlock_irqrestore(&dev->sm_lock, flags);
 		return -EAGAIN;
 	}
 	mlx4_ib_query_ah(dev->sm_ah[ctx->port - 1], &ah_attr);
-	spin_unlock(&dev->sm_lock);
+	spin_unlock_irqrestore(&dev->sm_lock, flags);
 	return mlx4_ib_send_to_wire(dev, mlx4_master_func_num(dev->dev),
 				    ctx->port, IB_QPT_GSI, 0, 1, IB_QP1_QKEY,
 				    &ah_attr, NULL, mad);

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

* [PATCH 3.16.y-ckt 111/133] IB/mlx4: Forbid using sysfs to change RoCE pkeys
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (109 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 110/133] IB/mlx4: Fix potential deadlock when sending mad to wire Luis Henriques
@ 2015-09-30  9:50 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 112/133] IB/mlx4: Use correct SL on AH query under RoCE Luis Henriques
                   ` (21 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:50 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jack Morgenstein, Or Gerlitz, Doug Ledford, Luis Henriques

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

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

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

commit 2b135db3e81301d0452e6aa107349abe67b097d6 upstream.

The pkey mapping for RoCE must remain the default mapping:
VFs:
  virtual index 0 = mapped to real index 0 (0xFFFF)
  All others indices: mapped to a real pkey index containing an
                      invalid pkey.
PF:
  virtual index i = real index i.

Don't allow users to change these mappings using files found in
sysfs.

Fixes: c1e7e466120b ('IB/mlx4: Add iov directory in sysfs under the ib device')
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/hw/mlx4/sysfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx4/sysfs.c b/drivers/infiniband/hw/mlx4/sysfs.c
index cb4c66e723b5..89b43da1978d 100644
--- a/drivers/infiniband/hw/mlx4/sysfs.c
+++ b/drivers/infiniband/hw/mlx4/sysfs.c
@@ -660,6 +660,8 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave)
 	struct mlx4_port *p;
 	int i;
 	int ret;
+	int is_eth = rdma_port_get_link_layer(&dev->ib_dev, port_num) ==
+			IB_LINK_LAYER_ETHERNET;
 
 	p = kzalloc(sizeof *p, GFP_KERNEL);
 	if (!p)
@@ -677,7 +679,8 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave)
 
 	p->pkey_group.name  = "pkey_idx";
 	p->pkey_group.attrs =
-		alloc_group_attrs(show_port_pkey, store_port_pkey,
+		alloc_group_attrs(show_port_pkey,
+				  is_eth ? NULL : store_port_pkey,
 				  dev->dev->caps.pkey_table_len[port_num]);
 	if (!p->pkey_group.attrs) {
 		ret = -ENOMEM;

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

* [PATCH 3.16.y-ckt 112/133] IB/mlx4: Use correct SL on AH query under RoCE
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (110 preceding siblings ...)
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 111/133] IB/mlx4: Forbid using sysfs to change RoCE pkeys Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 113/133] IB/uverbs: Fix race between ib_uverbs_open and remove_one Luis Henriques
                   ` (20 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Shani Michaeli, Noa Osherovich, Or Gerlitz, Doug Ledford,
	Luis Henriques

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

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

From: Noa Osherovich <noaos@mellanox.com>

commit 5e99b139f1b68acd65e36515ca347b03856dfb5a upstream.

The mlx4 IB driver implementation for ib_query_ah used a wrong offset
(28 instead of 29) when link type is Ethernet. Fixed to use the correct one.

Fixes: fa417f7b520e ('IB/mlx4: Add support for IBoE')
Signed-off-by: Shani Michaeli <shanim@mellanox.com>
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/hw/mlx4/ah.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
index 2d8c3397774f..e65ee1947279 100644
--- a/drivers/infiniband/hw/mlx4/ah.c
+++ b/drivers/infiniband/hw/mlx4/ah.c
@@ -147,9 +147,13 @@ int mlx4_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr)
 	enum rdma_link_layer ll;
 
 	memset(ah_attr, 0, sizeof *ah_attr);
-	ah_attr->sl = be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 28;
 	ah_attr->port_num = be32_to_cpu(ah->av.ib.port_pd) >> 24;
 	ll = rdma_port_get_link_layer(ibah->device, ah_attr->port_num);
+	if (ll == IB_LINK_LAYER_ETHERNET)
+		ah_attr->sl = be32_to_cpu(ah->av.eth.sl_tclass_flowlabel) >> 29;
+	else
+		ah_attr->sl = be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 28;
+
 	ah_attr->dlid = ll == IB_LINK_LAYER_INFINIBAND ? be16_to_cpu(ah->av.ib.dlid) : 0;
 	if (ah->av.ib.stat_rate)
 		ah_attr->static_rate = ah->av.ib.stat_rate - MLX4_STAT_RATE_OFFSET;

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

* [PATCH 3.16.y-ckt 113/133] IB/uverbs: Fix race between ib_uverbs_open and remove_one
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (111 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 112/133] IB/mlx4: Use correct SL on AH query under RoCE Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 114/133] mmc: core: fix race condition in mmc_wait_data_done Luis Henriques
                   ` (19 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yishai Hadas, Shachar Raindel, Doug Ledford, Luis Henriques

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

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

From: Yishai Hadas <yishaih@mellanox.com>

commit 35d4a0b63dc0c6d1177d4f532a9deae958f0662c upstream.

Fixes: 2a72f212263701b927559f6850446421d5906c41 ("IB/uverbs: Remove dev_table")

Before this commit there was a device look-up table that was protected
by a spin_lock used by ib_uverbs_open and by ib_uverbs_remove_one. When
it was dropped and container_of was used instead, it enabled the race
with remove_one as dev might be freed just after:
dev = container_of(inode->i_cdev, struct ib_uverbs_device, cdev) but
before the kref_get.

In addition, this buggy patch added some dead code as
container_of(x,y,z) can never be NULL and so dev can never be NULL.
As a result the comment above ib_uverbs_open saying "the open method
will either immediately run -ENXIO" is wrong as it can never happen.

The solution follows Jason Gunthorpe suggestion from below URL:
https://www.mail-archive.com/linux-rdma@vger.kernel.org/msg25692.html

cdev will hold a kref on the parent (the containing structure,
ib_uverbs_device) and only when that kref is released it is
guaranteed that open will never be called again.

In addition, fixes the active count scheme to use an atomic
not a kref to prevent WARN_ON as pointed by above comment
from Jason.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Shachar Raindel <raindel@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/infiniband/core/uverbs.h      |  3 ++-
 drivers/infiniband/core/uverbs_main.c | 43 ++++++++++++++++++++++++-----------
 2 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h
index a283274a5a09..639557bdc0cd 100644
--- a/drivers/infiniband/core/uverbs.h
+++ b/drivers/infiniband/core/uverbs.h
@@ -85,7 +85,7 @@
  */
 
 struct ib_uverbs_device {
-	struct kref				ref;
+	atomic_t				refcount;
 	int					num_comp_vectors;
 	struct completion			comp;
 	struct device			       *dev;
@@ -94,6 +94,7 @@ struct ib_uverbs_device {
 	struct cdev			        cdev;
 	struct rb_root				xrcd_tree;
 	struct mutex				xrcd_tree_mutex;
+	struct kobject				kobj;
 };
 
 struct ib_uverbs_event_file {
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 7a515c867674..8802d5ccd93d 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -127,14 +127,18 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
 static void ib_uverbs_add_one(struct ib_device *device);
 static void ib_uverbs_remove_one(struct ib_device *device);
 
-static void ib_uverbs_release_dev(struct kref *ref)
+static void ib_uverbs_release_dev(struct kobject *kobj)
 {
 	struct ib_uverbs_device *dev =
-		container_of(ref, struct ib_uverbs_device, ref);
+		container_of(kobj, struct ib_uverbs_device, kobj);
 
-	complete(&dev->comp);
+	kfree(dev);
 }
 
+static struct kobj_type ib_uverbs_dev_ktype = {
+	.release = ib_uverbs_release_dev,
+};
+
 static void ib_uverbs_release_event_file(struct kref *ref)
 {
 	struct ib_uverbs_event_file *file =
@@ -298,13 +302,19 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
 	return context->device->dealloc_ucontext(context);
 }
 
+static void ib_uverbs_comp_dev(struct ib_uverbs_device *dev)
+{
+	complete(&dev->comp);
+}
+
 static void ib_uverbs_release_file(struct kref *ref)
 {
 	struct ib_uverbs_file *file =
 		container_of(ref, struct ib_uverbs_file, ref);
 
 	module_put(file->device->ib_dev->owner);
-	kref_put(&file->device->ref, ib_uverbs_release_dev);
+	if (atomic_dec_and_test(&file->device->refcount))
+		ib_uverbs_comp_dev(file->device);
 
 	kfree(file);
 }
@@ -734,9 +744,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp)
 	int ret;
 
 	dev = container_of(inode->i_cdev, struct ib_uverbs_device, cdev);
-	if (dev)
-		kref_get(&dev->ref);
-	else
+	if (!atomic_inc_not_zero(&dev->refcount))
 		return -ENXIO;
 
 	if (!try_module_get(dev->ib_dev->owner)) {
@@ -757,6 +765,7 @@ static int ib_uverbs_open(struct inode *inode, struct file *filp)
 	mutex_init(&file->mutex);
 
 	filp->private_data = file;
+	kobject_get(&dev->kobj);
 
 	return nonseekable_open(inode, filp);
 
@@ -764,13 +773,16 @@ err_module:
 	module_put(dev->ib_dev->owner);
 
 err:
-	kref_put(&dev->ref, ib_uverbs_release_dev);
+	if (atomic_dec_and_test(&dev->refcount))
+		ib_uverbs_comp_dev(dev);
+
 	return ret;
 }
 
 static int ib_uverbs_close(struct inode *inode, struct file *filp)
 {
 	struct ib_uverbs_file *file = filp->private_data;
+	struct ib_uverbs_device *dev = file->device;
 
 	ib_uverbs_cleanup_ucontext(file, file->ucontext);
 
@@ -778,6 +790,7 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp)
 		kref_put(&file->async_file->ref, ib_uverbs_release_event_file);
 
 	kref_put(&file->ref, ib_uverbs_release_file);
+	kobject_put(&dev->kobj);
 
 	return 0;
 }
@@ -873,10 +886,11 @@ static void ib_uverbs_add_one(struct ib_device *device)
 	if (!uverbs_dev)
 		return;
 
-	kref_init(&uverbs_dev->ref);
+	atomic_set(&uverbs_dev->refcount, 1);
 	init_completion(&uverbs_dev->comp);
 	uverbs_dev->xrcd_tree = RB_ROOT;
 	mutex_init(&uverbs_dev->xrcd_tree_mutex);
+	kobject_init(&uverbs_dev->kobj, &ib_uverbs_dev_ktype);
 
 	spin_lock(&map_lock);
 	devnum = find_first_zero_bit(dev_map, IB_UVERBS_MAX_DEVICES);
@@ -903,6 +917,7 @@ static void ib_uverbs_add_one(struct ib_device *device)
 	cdev_init(&uverbs_dev->cdev, NULL);
 	uverbs_dev->cdev.owner = THIS_MODULE;
 	uverbs_dev->cdev.ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops;
+	uverbs_dev->cdev.kobj.parent = &uverbs_dev->kobj;
 	kobject_set_name(&uverbs_dev->cdev.kobj, "uverbs%d", uverbs_dev->devnum);
 	if (cdev_add(&uverbs_dev->cdev, base, 1))
 		goto err_cdev;
@@ -933,9 +948,10 @@ err_cdev:
 		clear_bit(devnum, overflow_map);
 
 err:
-	kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
+	if (atomic_dec_and_test(&uverbs_dev->refcount))
+		ib_uverbs_comp_dev(uverbs_dev);
 	wait_for_completion(&uverbs_dev->comp);
-	kfree(uverbs_dev);
+	kobject_put(&uverbs_dev->kobj);
 	return;
 }
 
@@ -955,9 +971,10 @@ static void ib_uverbs_remove_one(struct ib_device *device)
 	else
 		clear_bit(uverbs_dev->devnum - IB_UVERBS_MAX_DEVICES, overflow_map);
 
-	kref_put(&uverbs_dev->ref, ib_uverbs_release_dev);
+	if (atomic_dec_and_test(&uverbs_dev->refcount))
+		ib_uverbs_comp_dev(uverbs_dev);
 	wait_for_completion(&uverbs_dev->comp);
-	kfree(uverbs_dev);
+	kobject_put(&uverbs_dev->kobj);
 }
 
 static char *uverbs_devnode(struct device *dev, umode_t *mode)

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

* [PATCH 3.16.y-ckt 114/133] mmc: core: fix race condition in mmc_wait_data_done
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (112 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 113/133] IB/uverbs: Fix race between ib_uverbs_open and remove_one Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 115/133] ipv6: fix exthdrs offload registration in out_rt path Luis Henriques
                   ` (18 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jialing Fu, Shawn Lin, Ulf Hansson, Luis Henriques

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

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

From: Jialing Fu <jlfu@marvell.com>

commit 71f8a4b81d040b3d094424197ca2f1bf811b1245 upstream.

The following panic is captured in ker3.14, but the issue still exists
in latest kernel.
---------------------------------------------------------------------
[   20.738217] c0 3136 (Compiler) Unable to handle kernel NULL pointer dereference
at virtual address 00000578
......
[   20.738499] c0 3136 (Compiler) PC is at _raw_spin_lock_irqsave+0x24/0x60
[   20.738527] c0 3136 (Compiler) LR is at _raw_spin_lock_irqsave+0x20/0x60
[   20.740134] c0 3136 (Compiler) Call trace:
[   20.740165] c0 3136 (Compiler) [<ffffffc0008ee900>] _raw_spin_lock_irqsave+0x24/0x60
[   20.740200] c0 3136 (Compiler) [<ffffffc0000dd024>] __wake_up+0x1c/0x54
[   20.740230] c0 3136 (Compiler) [<ffffffc000639414>] mmc_wait_data_done+0x28/0x34
[   20.740262] c0 3136 (Compiler) [<ffffffc0006391a0>] mmc_request_done+0xa4/0x220
[   20.740314] c0 3136 (Compiler) [<ffffffc000656894>] sdhci_tasklet_finish+0xac/0x264
[   20.740352] c0 3136 (Compiler) [<ffffffc0000a2b58>] tasklet_action+0xa0/0x158
[   20.740382] c0 3136 (Compiler) [<ffffffc0000a2078>] __do_softirq+0x10c/0x2e4
[   20.740411] c0 3136 (Compiler) [<ffffffc0000a24bc>] irq_exit+0x8c/0xc0
[   20.740439] c0 3136 (Compiler) [<ffffffc00008489c>] handle_IRQ+0x48/0xac
[   20.740469] c0 3136 (Compiler) [<ffffffc000081428>] gic_handle_irq+0x38/0x7c
----------------------------------------------------------------------
Because in SMP, "mrq" has race condition between below two paths:
path1: CPU0: <tasklet context>
  static void mmc_wait_data_done(struct mmc_request *mrq)
  {
     mrq->host->context_info.is_done_rcv = true;
     //
     // If CPU0 has just finished "is_done_rcv = true" in path1, and at
     // this moment, IRQ or ICache line missing happens in CPU0.
     // What happens in CPU1 (path2)?
     //
     // If the mmcqd thread in CPU1(path2) hasn't entered to sleep mode:
     // path2 would have chance to break from wait_event_interruptible
     // in mmc_wait_for_data_req_done and continue to run for next
     // mmc_request (mmc_blk_rw_rq_prep).
     //
     // Within mmc_blk_rq_prep, mrq is cleared to 0.
     // If below line still gets host from "mrq" as the result of
     // compiler, the panic happens as we traced.
     wake_up_interruptible(&mrq->host->context_info.wait);
  }

path2: CPU1: <The mmcqd thread runs mmc_queue_thread>
  static int mmc_wait_for_data_req_done(...
  {
     ...
     while (1) {
           wait_event_interruptible(context_info->wait,
                   (context_info->is_done_rcv ||
                    context_info->is_new_req));
     	   static void mmc_blk_rw_rq_prep(...
           {
           ...
           memset(brq, 0, sizeof(struct mmc_blk_request));

This issue happens very coincidentally; however adding mdelay(1) in
mmc_wait_data_done as below could duplicate it easily.

   static void mmc_wait_data_done(struct mmc_request *mrq)
   {
     mrq->host->context_info.is_done_rcv = true;
+    mdelay(1);
     wake_up_interruptible(&mrq->host->context_info.wait);
    }

At runtime, IRQ or ICache line missing may just happen at the same place
of the mdelay(1).

This patch gets the mmc_context_info at the beginning of function, it can
avoid this race condition.

Signed-off-by: Jialing Fu <jlfu@marvell.com>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Fixes: 2220eedfd7ae ("mmc: fix async request mechanism ....")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/core/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 767b47296e1b..aba0b8c632ee 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -314,8 +314,10 @@ EXPORT_SYMBOL(mmc_start_bkops);
  */
 static void mmc_wait_data_done(struct mmc_request *mrq)
 {
-	mrq->host->context_info.is_done_rcv = true;
-	wake_up_interruptible(&mrq->host->context_info.wait);
+	struct mmc_context_info *context_info = &mrq->host->context_info;
+
+	context_info->is_done_rcv = true;
+	wake_up_interruptible(&context_info->wait);
 }
 
 static void mmc_wait_done(struct mmc_request *mrq)

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

* [PATCH 3.16.y-ckt 115/133] ipv6: fix exthdrs offload registration in out_rt path
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (113 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 114/133] mmc: core: fix race condition in mmc_wait_data_done Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 116/133] task_work: remove fifo ordering guarantee Luis Henriques
                   ` (17 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Borkmann, David S. Miller, Luis Henriques

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

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

From: Daniel Borkmann <daniel@iogearbox.net>

commit e41b0bedba0293b9e1e8d1e8ed553104b9693656 upstream.

We previously register IPPROTO_ROUTING offload under inet6_add_offload(),
but in error path, we try to unregister it with inet_del_offload(). This
doesn't seem correct, it should actually be inet6_del_offload(), also
ipv6_exthdrs_offload_exit() from that commit seems rather incorrect (it
also uses rthdr_offload twice), but it got removed entirely later on.

Fixes: 3336288a9fea ("ipv6: Switch to using new offload infrastructure.")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv6/exthdrs_offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/exthdrs_offload.c b/net/ipv6/exthdrs_offload.c
index 447a7fbd1bb6..f5e2ba1c18bf 100644
--- a/net/ipv6/exthdrs_offload.c
+++ b/net/ipv6/exthdrs_offload.c
@@ -36,6 +36,6 @@ out:
 	return ret;
 
 out_rt:
-	inet_del_offload(&rthdr_offload, IPPROTO_ROUTING);
+	inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING);
 	goto out;
 }

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

* [PATCH 3.16.y-ckt 116/133] task_work: remove fifo ordering guarantee
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (114 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 115/133] ipv6: fix exthdrs offload registration in out_rt path Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 117/133] fixed_phy: pass 'irq' to fixed_phy_add() Luis Henriques
                   ` (16 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, Linus Torvalds, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit c82199061009d1561e31e17fca5e47a87cb7ff4c upstream.

In commit f341861fb0b ("task_work: add a scheduling point in
task_work_run()") I fixed a latency problem adding a cond_resched()
call.

Later, commit ac3d0da8f329 added yet another loop to reverse a list,
bringing back the latency spike :

I've seen in some cases this loop taking 275 ms, if for example a
process with 2,000,000 files is killed.

We could add yet another cond_resched() in the reverse loop, or we
can simply remove the reversal, as I do not think anything
would depend on order of task_work_add() submitted works.

Fixes: ac3d0da8f329 ("task_work: Make task_work_add() lockless")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Maciej Żenczykowski <maze@google.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/task_work.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/kernel/task_work.c b/kernel/task_work.c
index 8727032e3a6f..53fa971d000d 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -18,6 +18,8 @@ static struct callback_head work_exited; /* all we need is ->next == NULL */
  * This is like the signal handler which runs in kernel mode, but it doesn't
  * try to wake up the @task.
  *
+ * Note: there is no ordering guarantee on works queued here.
+ *
  * RETURNS:
  * 0 if succeeds or -ESRCH.
  */
@@ -108,16 +110,6 @@ void task_work_run(void)
 		raw_spin_unlock_wait(&task->pi_lock);
 		smp_mb();
 
-		/* Reverse the list to run the works in fifo order */
-		head = NULL;
-		do {
-			next = work->next;
-			work->next = head;
-			head = work;
-			work = next;
-		} while (work);
-
-		work = head;
 		do {
 			next = work->next;
 			work->func(work);

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

* [PATCH 3.16.y-ckt 117/133] fixed_phy: pass 'irq' to fixed_phy_add()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (115 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 116/133] task_work: remove fifo ordering guarantee Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 118/133] netlink, mmap: fix edge-case leakages in nf queue zero-copy Luis Henriques
                   ` (15 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sergei Shtylyov, David S. Miller, Luis Henriques

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

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

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

commit bd1a05ee98b06c9a20138c45f96ccfddf3163f93 upstream.

I've noticed  that fixed_phy_register() ignores its 'irq' parameter instead of
passing it to fixed_phy_add(). Luckily, fixed_phy_register()  seems to  always
be  called with PHY_POLL  for 'irq'... :-)

Fixes: a75951217472 ("net: phy: extend fixed driver with fixed_phy_register()")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16:
  - fixed_phy_add() only has 3 parameters in 3.16 kernel ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/phy/fixed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index d60d875cb445..5ea82da50ceb 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -240,7 +240,7 @@ int fixed_phy_register(unsigned int irq,
 	phy_addr = phy_fixed_addr++;
 	spin_unlock(&phy_fixed_addr_lock);
 
-	ret = fixed_phy_add(PHY_POLL, phy_addr, status);
+	ret = fixed_phy_add(irq, phy_addr, status);
 	if (ret < 0)
 		return ret;
 

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

* [PATCH 3.16.y-ckt 118/133] netlink, mmap: fix edge-case leakages in nf queue zero-copy
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (116 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 117/133] fixed_phy: pass 'irq' to fixed_phy_add() Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 119/133] scsi_dh: fix randconfig build error Luis Henriques
                   ` (14 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Borkmann, David S. Miller, Luis Henriques

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

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

From: Daniel Borkmann <daniel@iogearbox.net>

commit 6bb0fef489f667cf701853054f44579754f00a06 upstream.

When netlink mmap on receive side is the consumer of nf queue data,
it can happen that in some edge cases, we write skb shared info into
the user space mmap buffer:

Assume a possible rx ring frame size of only 4096, and the network skb,
which is being zero-copied into the netlink skb, contains page frags
with an overall skb->len larger than the linear part of the netlink
skb.

skb_zerocopy(), which is generic and thus not aware of the fact that
shared info cannot be accessed for such skbs then tries to write and
fill frags, thus leaking kernel data/pointers and in some corner cases
possibly writing out of bounds of the mmap area (when filling the
last slot in the ring buffer this way).

I.e. the ring buffer slot is then of status NL_MMAP_STATUS_VALID, has
an advertised length larger than 4096, where the linear part is visible
at the slot beginning, and the leaked sizeof(struct skb_shared_info)
has been written to the beginning of the next slot (also corrupting
the struct nl_mmap_hdr slot header incl. status etc), since skb->end
points to skb->data + ring->frame_size - NL_MMAP_HDRLEN.

The fix adds and lets __netlink_alloc_skb() take the actual needed
linear room for the network skb + meta data into account. It's completely
irrelevant for non-mmaped netlink sockets, but in case mmap sockets
are used, it can be decided whether the available skb_tailroom() is
really large enough for the buffer, or whether it needs to internally
fallback to a normal alloc_skb().

>>From nf queue side, the information whether the destination port is
an mmap RX ring is not really available without extra port-to-socket
lookup, thus it can only be determined in lower layers i.e. when
__netlink_alloc_skb() is called that checks internally for this. I
chose to add the extra ldiff parameter as mmap will then still work:
We have data_len and hlen in nfqnl_build_packet_message(), data_len
is the full length (capped at queue->copy_range) for skb_zerocopy()
and hlen some possible part of data_len that needs to be copied; the
rem_len variable indicates the needed remaining linear mmap space.

The only other workaround in nf queue internally would be after
allocation time by f.e. cap'ing the data_len to the skb_tailroom()
iff we deal with an mmap skb, but that would 1) expose the fact that
we use a mmap skb to upper layers, and 2) trim the skb where we
otherwise could just have moved the full skb into the normal receive
queue.

After the patch, in my test case the ring slot doesn't fit and therefore
shows NL_MMAP_STATUS_COPY, where a full skb carries all the data and
thus needs to be picked up via recv().

Fixes: 3ab1f683bf8b ("nfnetlink: add support for memory mapped netlink")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/netlink.h              | 13 +++++++++++--
 net/netfilter/nfnetlink_queue_core.c |  5 +++--
 net/netlink/af_netlink.c             | 18 ++++++++++++------
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 9e572daa15d5..4ec1c2a29337 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -66,8 +66,17 @@ extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
 extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
 extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
 extern int netlink_has_listeners(struct sock *sk, unsigned int group);
-extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
-					 u32 dst_portid, gfp_t gfp_mask);
+
+extern struct sk_buff *__netlink_alloc_skb(struct sock *ssk, unsigned int size,
+					   unsigned int ldiff, u32 dst_portid,
+					   gfp_t gfp_mask);
+static inline struct sk_buff *
+netlink_alloc_skb(struct sock *ssk, unsigned int size, u32 dst_portid,
+		  gfp_t gfp_mask)
+{
+	return __netlink_alloc_skb(ssk, size, 0, dst_portid, gfp_mask);
+}
+
 extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
 extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
 			     __u32 group, gfp_t allocation);
diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
index 219ccff2d71c..7a83e57ad3f1 100644
--- a/net/netfilter/nfnetlink_queue_core.c
+++ b/net/netfilter/nfnetlink_queue_core.c
@@ -284,7 +284,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
 			   __be32 **packet_id_ptr)
 {
 	size_t size;
-	size_t data_len = 0, cap_len = 0;
+	size_t data_len = 0, cap_len = 0, rem_len = 0;
 	unsigned int hlen = 0;
 	struct sk_buff *skb;
 	struct nlattr *nla;
@@ -341,6 +341,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
 		hlen = min_t(unsigned int, hlen, data_len);
 		size += sizeof(struct nlattr) + hlen;
 		cap_len = entskb->len;
+		rem_len = data_len - hlen;
 		break;
 	}
 
@@ -352,7 +353,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue,
 			+ nla_total_size(sizeof(u_int32_t)));	/* gid */
 	}
 
-	skb = nfnetlink_alloc_skb(net, size, queue->peer_portid,
+	skb = __netlink_alloc_skb(net->nfnl, size, rem_len, queue->peer_portid,
 				  GFP_ATOMIC);
 	if (!skb) {
 		skb_tx_error(entskb);
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a64b8eec3640..329f48404fa0 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1840,15 +1840,16 @@ retry:
 }
 EXPORT_SYMBOL(netlink_unicast);
 
-struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
-				  u32 dst_portid, gfp_t gfp_mask)
+struct sk_buff *__netlink_alloc_skb(struct sock *ssk, unsigned int size,
+				    unsigned int ldiff, u32 dst_portid,
+				    gfp_t gfp_mask)
 {
 #ifdef CONFIG_NETLINK_MMAP
+	unsigned int maxlen, linear_size;
 	struct sock *sk = NULL;
 	struct sk_buff *skb;
 	struct netlink_ring *ring;
 	struct nl_mmap_hdr *hdr;
-	unsigned int maxlen;
 
 	sk = netlink_getsockbyportid(ssk, dst_portid);
 	if (IS_ERR(sk))
@@ -1859,7 +1860,11 @@ struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
 	if (ring->pg_vec == NULL)
 		goto out_put;
 
-	if (ring->frame_size - NL_MMAP_HDRLEN < size)
+	/* We need to account the full linear size needed as a ring
+	 * slot cannot have non-linear parts.
+	 */
+	linear_size = size + ldiff;
+	if (ring->frame_size - NL_MMAP_HDRLEN < linear_size)
 		goto out_put;
 
 	skb = alloc_skb_head(gfp_mask);
@@ -1873,13 +1878,14 @@ struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
 
 	/* check again under lock */
 	maxlen = ring->frame_size - NL_MMAP_HDRLEN;
-	if (maxlen < size)
+	if (maxlen < linear_size)
 		goto out_free;
 
 	netlink_forward_ring(ring);
 	hdr = netlink_current_frame(ring, NL_MMAP_STATUS_UNUSED);
 	if (hdr == NULL)
 		goto err2;
+
 	netlink_ring_setup_skb(skb, sk, ring, hdr);
 	netlink_set_status(hdr, NL_MMAP_STATUS_RESERVED);
 	atomic_inc(&ring->pending);
@@ -1905,7 +1911,7 @@ out:
 #endif
 	return alloc_skb(size, gfp_mask);
 }
-EXPORT_SYMBOL_GPL(netlink_alloc_skb);
+EXPORT_SYMBOL_GPL(__netlink_alloc_skb);
 
 int netlink_has_listeners(struct sock *sk, unsigned int group)
 {

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

* [PATCH 3.16.y-ckt 119/133] scsi_dh: fix randconfig build error
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (117 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 118/133] netlink, mmap: fix edge-case leakages in nf queue zero-copy Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 120/133] md: flush ->event_work before stopping array Luis Henriques
                   ` (13 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christoph Hellwig, James Bottomley, Luis Henriques

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

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

From: Christoph Hellwig <hch@lst.de>

commit 294ab783ad98066b87296db1311c7ba2a60206a5 upstream.

It looks like the Kconfig check that was meant to fix this (commit
fe9233fb6914a0eb20166c967e3020f7f0fba2c9 [SCSI] scsi_dh: fix kconfig related
build errors) was actually reversed, but no-one noticed until the new set of
patches which separated DM and SCSI_DH).

Fixes: fe9233fb6914a0eb20166c967e3020f7f0fba2c9
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
index 5bdedf6df153..c5a97771f570 100644
--- a/drivers/md/Kconfig
+++ b/drivers/md/Kconfig
@@ -354,7 +354,7 @@ config DM_MULTIPATH
 	# of SCSI_DH if the latter isn't defined but if
 	# it is, DM_MULTIPATH must depend on it.  We get a build
 	# error if SCSI_DH=m and DM_MULTIPATH=y
-	depends on SCSI_DH || !SCSI_DH
+	depends on !SCSI_DH || SCSI
 	---help---
 	  Allow volume managers to support multipath hardware.
 

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

* [PATCH 3.16.y-ckt 120/133] md: flush ->event_work before stopping array.
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (118 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 119/133] scsi_dh: fix randconfig build error Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 121/133] md/raid10: always set reshape_safe when initializing reshape_position Luis Henriques
                   ` (12 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Luis Henriques

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

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

From: NeilBrown <neilb@suse.com>

commit ee5d004fd0591536a061451eba2b187092e9127c upstream.

The 'event_work' worker used by dm-raid may still be running
when the array is stopped.  This can result in an oops.

So flush the workqueue on which it is run after detaching
and before destroying the device.

Reported-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Fixes: 9d09e663d550 ("dm: raid456 basic support")
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/md.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index b6eddaf97541..9fc6c5de0638 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5264,6 +5264,8 @@ EXPORT_SYMBOL_GPL(md_stop_writes);
 
 static void __md_stop(struct mddev *mddev)
 {
+	/* Ensure ->event_work is done */
+	flush_workqueue(md_misc_wq);
 	mddev->ready = 0;
 	mddev->pers->stop(mddev);
 	if (mddev->pers->sync_request && mddev->to_remove == NULL)

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

* [PATCH 3.16.y-ckt 121/133] md/raid10: always set reshape_safe when initializing reshape_position.
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (119 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 120/133] md: flush ->event_work before stopping array Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 122/133] perf/x86: Fix copy_from_user_nmi() return if range is not ok Luis Henriques
                   ` (11 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Luis Henriques

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

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

From: NeilBrown <neilb@suse.com>

commit 299b0685e31c9f3dcc2d58ee3beca761a40b44b3 upstream.

'reshape_position' tracks where in the reshape we have reached.
'reshape_safe' tracks where in the reshape we have safely recorded
in the metadata.

These are compared to determine when to update the metadata.
So it is important that reshape_safe is initialised properly.
Currently it isn't.  When starting a reshape from the beginning
it usually has the correct value by luck.  But when reducing the
number of devices in a RAID10, it has the wrong value and this leads
to the metadata not being updated correctly.
This can lead to corruption if the reshape is not allowed to complete.

This patch is suitable for any -stable kernel which supports RAID10
reshape, which is 3.5 and later.

Fixes: 3ea7daa5d7fd ("md/raid10: add reshape support")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/raid10.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index a46124ecafc7..73c9f579b042 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3585,6 +3585,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
 			/* far_copies must be 1 */
 			conf->prev.stride = conf->dev_sectors;
 	}
+	conf->reshape_safe = conf->reshape_progress;
 	spin_lock_init(&conf->device_lock);
 	INIT_LIST_HEAD(&conf->retry_list);
 
@@ -3793,7 +3794,6 @@ static int run(struct mddev *mddev)
 		}
 		conf->offset_diff = min_offset_diff;
 
-		conf->reshape_safe = conf->reshape_progress;
 		clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
 		clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
 		set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
@@ -4138,6 +4138,7 @@ static int raid10_start_reshape(struct mddev *mddev)
 		conf->reshape_progress = size;
 	} else
 		conf->reshape_progress = 0;
+	conf->reshape_safe = conf->reshape_progress;
 	spin_unlock_irq(&conf->device_lock);
 
 	if (mddev->delta_disks && mddev->bitmap) {
@@ -4204,6 +4205,7 @@ abort:
 		rdev->new_data_offset = rdev->data_offset;
 	smp_wmb();
 	conf->reshape_progress = MaxSector;
+	conf->reshape_safe = MaxSector;
 	mddev->reshape_position = MaxSector;
 	spin_unlock_irq(&conf->device_lock);
 	return ret;
@@ -4556,6 +4558,7 @@ static void end_reshape(struct r10conf *conf)
 	md_finish_reshape(conf->mddev);
 	smp_wmb();
 	conf->reshape_progress = MaxSector;
+	conf->reshape_safe = MaxSector;
 	spin_unlock_irq(&conf->device_lock);
 
 	/* read-ahead size must cover two whole stripes, which is

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

* [PATCH 3.16.y-ckt 122/133] perf/x86: Fix copy_from_user_nmi() return if range is not ok
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (120 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 121/133] md/raid10: always set reshape_safe when initializing reshape_position Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 123/133] ext4: fix loss of delalloc extent info in ext4_zero_range() Luis Henriques
                   ` (10 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yann Droneaud, Peter Zijlstra (Intel), Linus Torvalds,
	Thomas Gleixner, Ingo Molnar, Luis Henriques

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

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

From: Yann Droneaud <ydroneaud@opteya.com>

commit ebf2d2689de551d90965090bb991fc640a0c0d41 upstream.

Commit 0a196848ca36 ("perf: Fix arch_perf_out_copy_user default"),
changes copy_from_user_nmi() to return the number of
remaining bytes so that it behave like copy_from_user().

Unfortunately, when the range is outside of the process
memory, the return value  is still the number of byte
copied, eg. 0, instead of the remaining bytes.

As all users of copy_from_user_nmi() were modified as
part of commit 0a196848ca36, the function should be
fixed to return the total number of bytes if range is
not correct.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1435001923-30986-1-git-send-email-ydroneaud@opteya.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/lib/usercopy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/lib/usercopy.c b/arch/x86/lib/usercopy.c
index ddf9ecb53cc3..e342586db6e4 100644
--- a/arch/x86/lib/usercopy.c
+++ b/arch/x86/lib/usercopy.c
@@ -20,7 +20,7 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
 	unsigned long ret;
 
 	if (__range_not_ok(from, n, TASK_SIZE))
-		return 0;
+		return n;
 
 	/*
 	 * Even though this function is typically called from NMI/IRQ context

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

* [PATCH 3.16.y-ckt 123/133] ext4: fix loss of delalloc extent info in ext4_zero_range()
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (121 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 122/133] perf/x86: Fix copy_from_user_nmi() return if range is not ok Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 124/133] powerpc/MSI: Fix race condition in tearing down MSI interrupts Luis Henriques
                   ` (9 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Whitney, Theodore Ts'o, Luis Henriques

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

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

From: Eric Whitney <enwlinux@gmail.com>

commit 94426f4b9648154dc5a6760b59e6953e640ab3b1 upstream.

In ext4_zero_range(), removing a file's entire block range from the
extent status tree removes all records of that file's delalloc extents.
The delalloc accounting code uses this information, and its loss can
then lead to accounting errors and kernel warnings at writeback time and
subsequent file system damage.  This is most noticeable on bigalloc
file systems where code in ext4_ext_map_blocks() handles cases where
delalloc extents share clusters with a newly allocated extent.

Because we're not deleting a block range and are correctly updating the
status of its associated extent, there is no need to remove anything
from the extent status tree.

When this patch is combined with an unrelated bug fix for
ext4_zero_range(), kernel warnings and e2fsck errors reported during
xfstests runs on bigalloc filesystems are greatly reduced without
introducing regressions on other xfstests-bld test scenarios.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/ext4/extents.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index ba5d7dc47b3e..e41ec5034bad 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4846,19 +4846,6 @@ static long ext4_zero_range(struct file *file, loff_t offset,
 					     flags, mode);
 		if (ret)
 			goto out_dio;
-		/*
-		 * Remove entire range from the extent status tree.
-		 *
-		 * ext4_es_remove_extent(inode, lblk, max_blocks) is
-		 * NOT sufficient.  I'm not sure why this is the case,
-		 * but let's be conservative and remove the extent
-		 * status tree for the entire inode.  There should be
-		 * no outstanding delalloc extents thanks to the
-		 * filemap_write_and_wait_range() call above.
-		 */
-		ret = ext4_es_remove_extent(inode, 0, EXT_MAX_BLOCKS);
-		if (ret)
-			goto out_dio;
 	}
 	if (!partial_begin && !partial_end)
 		goto out_dio;

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

* [PATCH 3.16.y-ckt 124/133] powerpc/MSI: Fix race condition in tearing down MSI interrupts
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (122 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 123/133] ext4: fix loss of delalloc extent info in ext4_zero_range() Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 125/133] RDS: verify the underlying transport exists before creating a connection Luis Henriques
                   ` (8 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Paul Mackerras, Michael Ellerman, Luis Henriques

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

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

From: Paul Mackerras <paulus@ozlabs.org>

commit e297c939b745e420ef0b9dc989cb87bda617b399 upstream.

This fixes a race which can result in the same virtual IRQ number
being assigned to two different MSI interrupts.  The most visible
consequence of that is usually a warning and stack trace from the
sysfs code about an attempt to create a duplicate entry in sysfs.

The race happens when one CPU (say CPU 0) is disposing of an MSI
while another CPU (say CPU 1) is setting up an MSI.  CPU 0 calls
(for example) pnv_teardown_msi_irqs(), which calls
msi_bitmap_free_hwirqs() to indicate that the MSI (i.e. its
hardware IRQ number) is no longer in use.  Then, before CPU 0 gets
to calling irq_dispose_mapping() to free up the virtal IRQ number,
CPU 1 comes in and calls msi_bitmap_alloc_hwirqs() to allocate an
MSI, and gets the same hardware IRQ number that CPU 0 just freed.
CPU 1 then calls irq_create_mapping() to get a virtual IRQ number,
which sees that there is currently a mapping for that hardware IRQ
number and returns the corresponding virtual IRQ number (which is
the same virtual IRQ number that CPU 0 was using).  CPU 0 then
calls irq_dispose_mapping() and frees that virtual IRQ number.
Now, if another CPU comes along and calls irq_create_mapping(), it
is likely to get the virtual IRQ number that was just freed,
resulting in the same virtual IRQ number apparently being used for
two different hardware interrupts.

To fix this race, we just move the call to msi_bitmap_free_hwirqs()
to after the call to irq_dispose_mapping().  Since virq_to_hw()
doesn't work for the virtual IRQ number after irq_dispose_mapping()
has been called, we need to call it before irq_dispose_mapping() and
remember the result for the msi_bitmap_free_hwirqs() call.

The pattern of calling msi_bitmap_free_hwirqs() before
irq_dispose_mapping() appears in 5 places under arch/powerpc, and
appears to have originated in commit 05af7bd2d75e ("[POWERPC] MPIC
U3/U4 MSI backend") from 2007.

Fixes: 05af7bd2d75e ("[POWERPC] MPIC U3/U4 MSI backend")
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/platforms/powernv/pci.c  | 5 +++--
 arch/powerpc/sysdev/fsl_msi.c         | 5 +++--
 arch/powerpc/sysdev/mpic_pasemi_msi.c | 6 ++++--
 arch/powerpc/sysdev/mpic_u3msi.c      | 5 +++--
 arch/powerpc/sysdev/ppc4xx_msi.c      | 5 +++--
 5 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 1e539d019973..a6c16d1f06f5 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -108,6 +108,7 @@ static void pnv_teardown_msi_irqs(struct pci_dev *pdev)
 	struct pci_controller *hose = pci_bus_to_host(pdev->bus);
 	struct pnv_phb *phb = hose->private_data;
 	struct msi_desc *entry;
+	irq_hw_number_t hwirq;
 
 	if (WARN_ON(!phb))
 		return;
@@ -115,10 +116,10 @@ static void pnv_teardown_msi_irqs(struct pci_dev *pdev)
 	list_for_each_entry(entry, &pdev->msi_list, list) {
 		if (entry->irq == NO_IRQ)
 			continue;
+		hwirq = virq_to_hw(entry->irq);
 		irq_set_msi_desc(entry->irq, NULL);
-		msi_bitmap_free_hwirqs(&phb->msi_bmp,
-			virq_to_hw(entry->irq) - phb->msi_base, 1);
 		irq_dispose_mapping(entry->irq);
+		msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq - phb->msi_base, 1);
 	}
 }
 #endif /* CONFIG_PCI_MSI */
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 77efbaec7b9c..4a9b36777775 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -121,15 +121,16 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev)
 {
 	struct msi_desc *entry;
 	struct fsl_msi *msi_data;
+	irq_hw_number_t hwirq;
 
 	list_for_each_entry(entry, &pdev->msi_list, list) {
 		if (entry->irq == NO_IRQ)
 			continue;
+		hwirq = virq_to_hw(entry->irq);
 		msi_data = irq_get_chip_data(entry->irq);
 		irq_set_msi_desc(entry->irq, NULL);
-		msi_bitmap_free_hwirqs(&msi_data->bitmap,
-				       virq_to_hw(entry->irq), 1);
 		irq_dispose_mapping(entry->irq);
+		msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
 	}
 
 	return;
diff --git a/arch/powerpc/sysdev/mpic_pasemi_msi.c b/arch/powerpc/sysdev/mpic_pasemi_msi.c
index 38e62382070c..9e14d82287a1 100644
--- a/arch/powerpc/sysdev/mpic_pasemi_msi.c
+++ b/arch/powerpc/sysdev/mpic_pasemi_msi.c
@@ -74,6 +74,7 @@ static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
 static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
 {
 	struct msi_desc *entry;
+	irq_hw_number_t hwirq;
 
 	pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
 
@@ -81,10 +82,11 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
 		if (entry->irq == NO_IRQ)
 			continue;
 
+		hwirq = virq_to_hw(entry->irq);
 		irq_set_msi_desc(entry->irq, NULL);
-		msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap,
-				       virq_to_hw(entry->irq), ALLOC_CHUNK);
 		irq_dispose_mapping(entry->irq);
+		msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap,
+				       hwirq, ALLOC_CHUNK);
 	}
 
 	return;
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 9a7aa0ed9c1c..dfc3486bf802 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -124,15 +124,16 @@ static int u3msi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
 static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
 {
 	struct msi_desc *entry;
+	irq_hw_number_t hwirq;
 
         list_for_each_entry(entry, &pdev->msi_list, list) {
 		if (entry->irq == NO_IRQ)
 			continue;
 
+		hwirq = virq_to_hw(entry->irq);
 		irq_set_msi_desc(entry->irq, NULL);
-		msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap,
-				       virq_to_hw(entry->irq), 1);
 		irq_dispose_mapping(entry->irq);
+		msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1);
 	}
 
 	return;
diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c
index 43948da837a7..c3e65129940b 100644
--- a/arch/powerpc/sysdev/ppc4xx_msi.c
+++ b/arch/powerpc/sysdev/ppc4xx_msi.c
@@ -121,16 +121,17 @@ void ppc4xx_teardown_msi_irqs(struct pci_dev *dev)
 {
 	struct msi_desc *entry;
 	struct ppc4xx_msi *msi_data = &ppc4xx_msi;
+	irq_hw_number_t hwirq;
 
 	dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n");
 
 	list_for_each_entry(entry, &dev->msi_list, list) {
 		if (entry->irq == NO_IRQ)
 			continue;
+		hwirq = virq_to_hw(entry->irq);
 		irq_set_msi_desc(entry->irq, NULL);
-		msi_bitmap_free_hwirqs(&msi_data->bitmap,
-				virq_to_hw(entry->irq), 1);
 		irq_dispose_mapping(entry->irq);
+		msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
 	}
 }
 

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

* [PATCH 3.16.y-ckt 125/133] RDS: verify the underlying transport exists before creating a connection
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (123 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 124/133] powerpc/MSI: Fix race condition in tearing down MSI interrupts Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 126/133] UBI: block: Add missing cache flushes Luis Henriques
                   ` (7 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sasha Levin, David S. Miller, Luis Henriques

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

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

From: Sasha Levin <sasha.levin@oracle.com>

commit 74e98eb085889b0d2d4908f59f6e00026063014f upstream.

There was no verification that an underlying transport exists when creating
a connection, this would cause dereferencing a NULL ptr.

It might happen on sockets that weren't properly bound before attempting to
send a message, which will cause a NULL ptr deref:

[135546.047719] kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN
[135546.051270] Modules linked in:
[135546.051781] CPU: 4 PID: 15650 Comm: trinity-c4 Not tainted 4.2.0-next-20150902-sasha-00041-gbaa1222-dirty #2527
[135546.053217] task: ffff8800835bc000 ti: ffff8800bc708000 task.ti: ffff8800bc708000
[135546.054291] RIP: __rds_conn_create (net/rds/connection.c:194)
[135546.055666] RSP: 0018:ffff8800bc70fab0  EFLAGS: 00010202
[135546.056457] RAX: dffffc0000000000 RBX: 0000000000000f2c RCX: ffff8800835bc000
[135546.057494] RDX: 0000000000000007 RSI: ffff8800835bccd8 RDI: 0000000000000038
[135546.058530] RBP: ffff8800bc70fb18 R08: 0000000000000001 R09: 0000000000000000
[135546.059556] R10: ffffed014d7a3a23 R11: ffffed014d7a3a21 R12: 0000000000000000
[135546.060614] R13: 0000000000000001 R14: ffff8801ec3d0000 R15: 0000000000000000
[135546.061668] FS:  00007faad4ffb700(0000) GS:ffff880252000000(0000) knlGS:0000000000000000
[135546.062836] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[135546.063682] CR2: 000000000000846a CR3: 000000009d137000 CR4: 00000000000006a0
[135546.064723] Stack:
[135546.065048]  ffffffffafe2055c ffffffffafe23fc1 ffffed00493097bf ffff8801ec3d0008
[135546.066247]  0000000000000000 00000000000000d0 0000000000000000 ac194a24c0586342
[135546.067438]  1ffff100178e1f78 ffff880320581b00 ffff8800bc70fdd0 ffff880320581b00
[135546.068629] Call Trace:
[135546.069028] ? __rds_conn_create (include/linux/rcupdate.h:856 net/rds/connection.c:134)
[135546.069989] ? rds_message_copy_from_user (net/rds/message.c:298)
[135546.071021] rds_conn_create_outgoing (net/rds/connection.c:278)
[135546.071981] rds_sendmsg (net/rds/send.c:1058)
[135546.072858] ? perf_trace_lock (include/trace/events/lock.h:38)
[135546.073744] ? lockdep_init (kernel/locking/lockdep.c:3298)
[135546.074577] ? rds_send_drop_to (net/rds/send.c:976)
[135546.075508] ? __might_fault (./arch/x86/include/asm/current.h:14 mm/memory.c:3795)
[135546.076349] ? __might_fault (mm/memory.c:3795)
[135546.077179] ? rds_send_drop_to (net/rds/send.c:976)
[135546.078114] sock_sendmsg (net/socket.c:611 net/socket.c:620)
[135546.078856] SYSC_sendto (net/socket.c:1657)
[135546.079596] ? SYSC_connect (net/socket.c:1628)
[135546.080510] ? trace_dump_stack (kernel/trace/trace.c:1926)
[135546.081397] ? ring_buffer_unlock_commit (kernel/trace/ring_buffer.c:2479 kernel/trace/ring_buffer.c:2558 kernel/trace/ring_buffer.c:2674)
[135546.082390] ? trace_buffer_unlock_commit (kernel/trace/trace.c:1749)
[135546.083410] ? trace_event_raw_event_sys_enter (include/trace/events/syscalls.h:16)
[135546.084481] ? do_audit_syscall_entry (include/trace/events/syscalls.h:16)
[135546.085438] ? trace_buffer_unlock_commit (kernel/trace/trace.c:1749)
[135546.085515] rds_ib_laddr_check(): addr 36.74.25.172 ret -99 node type -1

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/rds/connection.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/rds/connection.c b/net/rds/connection.c
index 378c3a6acf84..f5fb7d6b7c41 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -183,6 +183,12 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
 		}
 	}
 
+	if (trans == NULL) {
+		kmem_cache_free(rds_conn_slab, conn);
+		conn = ERR_PTR(-ENODEV);
+		goto out;
+	}
+
 	conn->c_trans = trans;
 
 	ret = trans->conn_alloc(conn, gfp);

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

* [PATCH 3.16.y-ckt 126/133] UBI: block: Add missing cache flushes
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (124 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 125/133] RDS: verify the underlying transport exists before creating a connection Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 127/133] usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared Luis Henriques
                   ` (6 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kevin Cernekee, Ezequiel Garcia, Richard Weinberger,
	Luis Henriques

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

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

From: Kevin Cernekee <cernekee@chromium.org>

commit 98fb1ffd8154890d7051750e61ff5548c3ee2ab2 upstream.

Block drivers are responsible for calling flush_dcache_page() on each
BIO request. This operation keeps the I$ coherent with the D$ on
architectures that don't have hardware coherency support. Without this
flush, random crashes are seen when executing user programs from an ext4
filesystem backed by a ubiblock device.

This patch is based on the change implemented in commit 2d4dc890b5c8
("block: add helpers to run flush_dcache_page() against a bio and a
request's pages").

Fixes: 9d54c8a33eec ("UBI: R/O block driver on top of UBI volumes")
Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
[ luis: backported to 3.16: used Kevin's backport to 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mtd/ubi/block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 8457df7ec5af..8b4a182d7cf9 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -255,6 +255,7 @@ static int do_ubiblock_request(struct ubiblock *dev, struct request *req)
 	mutex_lock(&dev->dev_mutex);
 	ret = ubiblock_read(dev, bio_data(req->bio), sec, len);
 	mutex_unlock(&dev->dev_mutex);
+	rq_flush_dcache_pages(req);
 
 	return ret;
 }

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

* [PATCH 3.16.y-ckt 127/133] usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (125 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 126/133] UBI: block: Add missing cache flushes Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 128/133] net/ipv6: Correct PIM6 mrt_lock handling Luis Henriques
                   ` (5 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eugene Shatokhin, David S. Miller, Luis Henriques

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

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

From: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>

commit f50791ac1aca1ac1b0370d62397b43e9f831421a upstream.

It is needed to check EVENT_NO_RUNTIME_PM bit of dev->flags in
usbnet_stop(), but its value should be read before it is cleared
when dev->flags is set to 0.

The problem was spotted and the fix was provided by
Oliver Neukum <oneukum@suse.de>.

Signed-off-by: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/usb/usbnet.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index c5a2ad29d53c..5d819dde448d 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -778,7 +778,7 @@ int usbnet_stop (struct net_device *net)
 {
 	struct usbnet		*dev = netdev_priv(net);
 	struct driver_info	*info = dev->driver_info;
-	int			retval, pm;
+	int			retval, pm, mpn;
 
 	clear_bit(EVENT_DEV_OPEN, &dev->flags);
 	netif_stop_queue (net);
@@ -809,6 +809,8 @@ int usbnet_stop (struct net_device *net)
 
 	usbnet_purge_paused_rxq(dev);
 
+	mpn = !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags);
+
 	/* deferred work (task, timer, softirq) must also stop.
 	 * can't flush_scheduled_work() until we drop rtnl (later),
 	 * else workers could deadlock; so make workers a NOP.
@@ -819,8 +821,7 @@ int usbnet_stop (struct net_device *net)
 	if (!pm)
 		usb_autopm_put_interface(dev->intf);
 
-	if (info->manage_power &&
-	    !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags))
+	if (info->manage_power && mpn)
 		info->manage_power(dev, 0);
 	else
 		usb_autopm_put_interface(dev->intf);

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

* [PATCH 3.16.y-ckt 128/133] net/ipv6: Correct PIM6 mrt_lock handling
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (126 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 127/133] usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 129/133] netlink, mmap: transform mmap skb into full skb on taps Luis Henriques
                   ` (4 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Richard Laing, David S. Miller, Luis Henriques

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

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

From: Richard Laing <richard.laing@alliedtelesis.co.nz>

commit 25b4a44c19c83d98e8c0807a7ede07c1f28eab8b upstream.

In the IPv6 multicast routing code the mrt_lock was not being released
correctly in the MFC iterator, as a result adding or deleting a MIF would
cause a hang because the mrt_lock could not be acquired.

This fix is a copy of the code for the IPv4 case and ensures that the lock
is released correctly.

Signed-off-by: Richard Laing <richard.laing@alliedtelesis.co.nz>
Acked-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/ipv6/ip6mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 8250474ab7dc..77eede59b617 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -552,7 +552,7 @@ static void ipmr_mfc_seq_stop(struct seq_file *seq, void *v)
 
 	if (it->cache == &mrt->mfc6_unres_queue)
 		spin_unlock_bh(&mfc_unres_lock);
-	else if (it->cache == mrt->mfc6_cache_array)
+	else if (it->cache == &mrt->mfc6_cache_array[it->ct])
 		read_unlock(&mrt_lock);
 }
 

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

* [PATCH 3.16.y-ckt 129/133] netlink, mmap: transform mmap skb into full skb on taps
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (127 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 128/133] net/ipv6: Correct PIM6 mrt_lock handling Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 130/133] sctp: fix race on protocol/netns initialization Luis Henriques
                   ` (3 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Borkmann, David S. Miller, Luis Henriques

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

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

From: Daniel Borkmann <daniel@iogearbox.net>

commit 1853c949646005b5959c483becde86608f548f24 upstream.

Ken-ichirou reported that running netlink in mmap mode for receive in
combination with nlmon will throw a NULL pointer dereference in
__kfree_skb() on nlmon_xmit(), in my case I can also trigger an "unable
to handle kernel paging request". The problem is the skb_clone() in
__netlink_deliver_tap_skb() for skbs that are mmaped.

I.e. the cloned skb doesn't have a destructor, whereas the mmap netlink
skb has it pointed to netlink_skb_destructor(), set in the handler
netlink_ring_setup_skb(). There, skb->head is being set to NULL, so
that in such cases, __kfree_skb() doesn't perform a skb_release_data()
via skb_release_all(), where skb->head is possibly being freed through
kfree(head) into slab allocator, although netlink mmap skb->head points
to the mmap buffer. Similarly, the same has to be done also for large
netlink skbs where the data area is vmalloced. Therefore, as discussed,
make a copy for these rather rare cases for now. This fixes the issue
on my and Ken-ichirou's test-cases.

Reference: http://thread.gmane.org/gmane.linux.network/371129
Fixes: bcbde0d449ed ("net: netlink: virtual tap device management")
Reported-by: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/netlink/af_netlink.c | 30 +++++++++++++++++++++++-------
 net/netlink/af_netlink.h |  9 +++++++++
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 329f48404fa0..5f5c976b369d 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -115,6 +115,24 @@ static inline struct hlist_head *nl_portid_hashfn(struct nl_portid_hash *hash, u
 	return &hash->table[jhash_1word(portid, hash->rnd) & hash->mask];
 }
 
+static struct sk_buff *netlink_to_full_skb(const struct sk_buff *skb,
+					   gfp_t gfp_mask)
+{
+	unsigned int len = skb_end_offset(skb);
+	struct sk_buff *new;
+
+	new = alloc_skb(len, gfp_mask);
+	if (new == NULL)
+		return NULL;
+
+	NETLINK_CB(new).portid = NETLINK_CB(skb).portid;
+	NETLINK_CB(new).dst_group = NETLINK_CB(skb).dst_group;
+	NETLINK_CB(new).creds = NETLINK_CB(skb).creds;
+
+	memcpy(skb_put(new, len), skb->data, len);
+	return new;
+}
+
 int netlink_add_tap(struct netlink_tap *nt)
 {
 	if (unlikely(nt->dev->type != ARPHRD_NETLINK))
@@ -199,7 +217,11 @@ static int __netlink_deliver_tap_skb(struct sk_buff *skb,
 	int ret = -ENOMEM;
 
 	dev_hold(dev);
-	nskb = skb_clone(skb, GFP_ATOMIC);
+
+	if (netlink_skb_is_mmaped(skb) || is_vmalloc_addr(skb->head))
+		nskb = netlink_to_full_skb(skb, GFP_ATOMIC);
+	else
+		nskb = skb_clone(skb, GFP_ATOMIC);
 	if (nskb) {
 		nskb->dev = dev;
 		nskb->protocol = htons((u16) sk->sk_protocol);
@@ -271,11 +293,6 @@ static void netlink_rcv_wake(struct sock *sk)
 }
 
 #ifdef CONFIG_NETLINK_MMAP
-static bool netlink_skb_is_mmaped(const struct sk_buff *skb)
-{
-	return NETLINK_CB(skb).flags & NETLINK_SKB_MMAPED;
-}
-
 static bool netlink_rx_is_mmaped(struct sock *sk)
 {
 	return nlk_sk(sk)->rx_ring.pg_vec != NULL;
@@ -827,7 +844,6 @@ static void netlink_ring_set_copied(struct sock *sk, struct sk_buff *skb)
 }
 
 #else /* CONFIG_NETLINK_MMAP */
-#define netlink_skb_is_mmaped(skb)	false
 #define netlink_rx_is_mmaped(sk)	false
 #define netlink_tx_is_mmaped(sk)	false
 #define netlink_mmap			sock_no_mmap
diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h
index 0b59d441f5b6..4b0a5eb0c6b4 100644
--- a/net/netlink/af_netlink.h
+++ b/net/netlink/af_netlink.h
@@ -67,6 +67,15 @@ struct nl_portid_hash {
 	u32			rnd;
 };
 
+static inline bool netlink_skb_is_mmaped(const struct sk_buff *skb)
+{
+#ifdef CONFIG_NETLINK_MMAP
+	return NETLINK_CB(skb).flags & NETLINK_SKB_MMAPED;
+#else
+	return false;
+#endif /* CONFIG_NETLINK_MMAP */
+}
+
 struct netlink_table {
 	struct nl_portid_hash	hash;
 	struct hlist_head	mc_list;

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

* [PATCH 3.16.y-ckt 130/133] sctp: fix race on protocol/netns initialization
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (128 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 129/133] netlink, mmap: transform mmap skb into full skb on taps Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 131/133] openvswitch: Zero flows on allocation Luis Henriques
                   ` (2 subsequent siblings)
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vlad Yasevich, Marcelo Ricardo Leitner, David S. Miller,
	Luis Henriques

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

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

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

commit 8e2d61e0aed2b7c4ecb35844fe07e0b2b762dee4 upstream.

Consider sctp module is unloaded and is being requested because an user
is creating a sctp socket.

During initialization, sctp will add the new protocol type and then
initialize pernet subsys:

        status = sctp_v4_protosw_init();
        if (status)
                goto err_protosw_init;

        status = sctp_v6_protosw_init();
        if (status)
                goto err_v6_protosw_init;

        status = register_pernet_subsys(&sctp_net_ops);

The problem is that after those calls to sctp_v{4,6}_protosw_init(), it
is possible for userspace to create SCTP sockets like if the module is
already fully loaded. If that happens, one of the possible effects is
that we will have readers for net->sctp.local_addr_list list earlier
than expected and sctp_net_init() does not take precautions while
dealing with that list, leading to a potential panic but not limited to
that, as sctp_sock_init() will copy a bunch of blank/partially
initialized values from net->sctp.

The race happens like this:

     CPU 0                           |  CPU 1
  socket()                           |
   __sock_create                     | socket()
    inet_create                      |  __sock_create
     list_for_each_entry_rcu(        |
        answer, &inetsw[sock->type], |
        list) {                      |   inet_create
      /* no hits */                  |
     if (unlikely(err)) {            |
      ...                            |
      request_module()               |
      /* socket creation is blocked  |
       * the module is fully loaded  |
       */                            |
       sctp_init                     |
        sctp_v4_protosw_init         |
         inet_register_protosw       |
          list_add_rcu(&p->list,     |
                       last_perm);   |
                                     |  list_for_each_entry_rcu(
                                     |     answer, &inetsw[sock->type],
        sctp_v6_protosw_init         |     list) {
                                     |     /* hit, so assumes protocol
                                     |      * is already loaded
                                     |      */
                                     |  /* socket creation continues
                                     |   * before netns is initialized
                                     |   */
        register_pernet_subsys       |

Simply inverting the initialization order between
register_pernet_subsys() and sctp_v4_protosw_init() is not possible
because register_pernet_subsys() will create a control sctp socket, so
the protocol must be already visible by then. Deferring the socket
creation to a work-queue is not good specially because we loose the
ability to handle its errors.

So, as suggested by Vlad, the fix is to split netns initialization in
two moments: defaults and control socket, so that the defaults are
already loaded by when we register the protocol, while control socket
initialization is kept at the same moment it is today.

Fixes: 4db67e808640 ("sctp: Make the address lists per network namespace")
Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sctp/protocol.c | 64 ++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 41 insertions(+), 23 deletions(-)

diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 6789d785e698..e30c2091a4e1 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1166,7 +1166,7 @@ static void sctp_v4_del_protocol(void)
 	unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
 }
 
-static int __net_init sctp_net_init(struct net *net)
+static int __net_init sctp_defaults_init(struct net *net)
 {
 	int status;
 
@@ -1259,12 +1259,6 @@ static int __net_init sctp_net_init(struct net *net)
 
 	sctp_dbg_objcnt_init(net);
 
-	/* Initialize the control inode/socket for handling OOTB packets.  */
-	if ((status = sctp_ctl_sock_init(net))) {
-		pr_err("Failed to initialize the SCTP control sock\n");
-		goto err_ctl_sock_init;
-	}
-
 	/* Initialize the local address list. */
 	INIT_LIST_HEAD(&net->sctp.local_addr_list);
 	spin_lock_init(&net->sctp.local_addr_lock);
@@ -1280,9 +1274,6 @@ static int __net_init sctp_net_init(struct net *net)
 
 	return 0;
 
-err_ctl_sock_init:
-	sctp_dbg_objcnt_exit(net);
-	sctp_proc_exit(net);
 err_init_proc:
 	cleanup_sctp_mibs(net);
 err_init_mibs:
@@ -1291,15 +1282,12 @@ err_sysctl_register:
 	return status;
 }
 
-static void __net_exit sctp_net_exit(struct net *net)
+static void __net_exit sctp_defaults_exit(struct net *net)
 {
 	/* Free the local address list */
 	sctp_free_addr_wq(net);
 	sctp_free_local_addr_list(net);
 
-	/* Free the control endpoint.  */
-	inet_ctl_sock_destroy(net->sctp.ctl_sock);
-
 	sctp_dbg_objcnt_exit(net);
 
 	sctp_proc_exit(net);
@@ -1307,9 +1295,32 @@ static void __net_exit sctp_net_exit(struct net *net)
 	sctp_sysctl_net_unregister(net);
 }
 
-static struct pernet_operations sctp_net_ops = {
-	.init = sctp_net_init,
-	.exit = sctp_net_exit,
+static struct pernet_operations sctp_defaults_ops = {
+	.init = sctp_defaults_init,
+	.exit = sctp_defaults_exit,
+};
+
+static int __net_init sctp_ctrlsock_init(struct net *net)
+{
+	int status;
+
+	/* Initialize the control inode/socket for handling OOTB packets.  */
+	status = sctp_ctl_sock_init(net);
+	if (status)
+		pr_err("Failed to initialize the SCTP control sock\n");
+
+	return status;
+}
+
+static void __net_init sctp_ctrlsock_exit(struct net *net)
+{
+	/* Free the control endpoint.  */
+	inet_ctl_sock_destroy(net->sctp.ctl_sock);
+}
+
+static struct pernet_operations sctp_ctrlsock_ops = {
+	.init = sctp_ctrlsock_init,
+	.exit = sctp_ctrlsock_exit,
 };
 
 /* Initialize the universe into something sensible.  */
@@ -1443,8 +1454,11 @@ static __init int sctp_init(void)
 	sctp_v4_pf_init();
 	sctp_v6_pf_init();
 
-	status = sctp_v4_protosw_init();
+	status = register_pernet_subsys(&sctp_defaults_ops);
+	if (status)
+		goto err_register_defaults;
 
+	status = sctp_v4_protosw_init();
 	if (status)
 		goto err_protosw_init;
 
@@ -1452,9 +1466,9 @@ static __init int sctp_init(void)
 	if (status)
 		goto err_v6_protosw_init;
 
-	status = register_pernet_subsys(&sctp_net_ops);
+	status = register_pernet_subsys(&sctp_ctrlsock_ops);
 	if (status)
-		goto err_register_pernet_subsys;
+		goto err_register_ctrlsock;
 
 	status = sctp_v4_add_protocol();
 	if (status)
@@ -1470,12 +1484,14 @@ out:
 err_v6_add_protocol:
 	sctp_v4_del_protocol();
 err_add_protocol:
-	unregister_pernet_subsys(&sctp_net_ops);
-err_register_pernet_subsys:
+	unregister_pernet_subsys(&sctp_ctrlsock_ops);
+err_register_ctrlsock:
 	sctp_v6_protosw_exit();
 err_v6_protosw_init:
 	sctp_v4_protosw_exit();
 err_protosw_init:
+	unregister_pernet_subsys(&sctp_defaults_ops);
+err_register_defaults:
 	sctp_v4_pf_exit();
 	sctp_v6_pf_exit();
 	sctp_sysctl_unregister();
@@ -1508,12 +1524,14 @@ static __exit void sctp_exit(void)
 	sctp_v6_del_protocol();
 	sctp_v4_del_protocol();
 
-	unregister_pernet_subsys(&sctp_net_ops);
+	unregister_pernet_subsys(&sctp_ctrlsock_ops);
 
 	/* Free protosw registrations */
 	sctp_v6_protosw_exit();
 	sctp_v4_protosw_exit();
 
+	unregister_pernet_subsys(&sctp_defaults_ops);
+
 	/* Unregister with socket layer. */
 	sctp_v6_pf_exit();
 	sctp_v4_pf_exit();

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

* [PATCH 3.16.y-ckt 131/133] openvswitch: Zero flows on allocation.
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (129 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 130/133] sctp: fix race on protocol/netns initialization Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 132/133] fib_rules: fix fib rule dumps across multiple skbs Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 133/133] parisc: Filter out spurious interrupts in PA-RISC irq handler Luis Henriques
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jesse Gross, David S. Miller, Luis Henriques

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

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

From: Jesse Gross <jesse@nicira.com>

commit ae5f2fb1d51fa128a460bcfbe3c56d7ab8bf6a43 upstream.

When support for megaflows was introduced, OVS needed to start
installing flows with a mask applied to them. Since masking is an
expensive operation, OVS also had an optimization that would only
take the parts of the flow keys that were covered by a non-zero
mask. The values stored in the remaining pieces should not matter
because they are masked out.

While this works fine for the purposes of matching (which must always
look at the mask), serialization to netlink can be problematic. Since
the flow and the mask are serialized separately, the uninitialized
portions of the flow can be encoded with whatever values happen to be
present.

In terms of functionality, this has little effect since these fields
will be masked out by definition. However, it leaks kernel memory to
userspace, which is a potential security vulnerability. It is also
possible that other code paths could look at the masked key and get
uninitialized data, although this does not currently appear to be an
issue in practice.

This removes the mask optimization for flows that are being installed.
This was always intended to be the case as the mask optimizations were
really targetting per-packet flow operations.

Fixes: 03f0d916 ("openvswitch: Mega flow implementation")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/openvswitch/datapath.c   |  4 ++--
 net/openvswitch/flow_table.c | 23 ++++++++++++-----------
 net/openvswitch/flow_table.h |  2 +-
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 4e6176d9a6cd..15a8a568018c 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -827,7 +827,7 @@ static int ovs_flow_cmd_new(struct sk_buff *skb, struct genl_info *info)
 	if (error)
 		goto err_kfree_flow;
 
-	ovs_flow_mask_key(&new_flow->key, &new_flow->unmasked_key, &mask);
+	ovs_flow_mask_key(&new_flow->key, &new_flow->unmasked_key, true, &mask);
 
 	/* Validate actions. */
 	acts = ovs_nla_alloc_flow_actions(nla_len(a[OVS_FLOW_ATTR_ACTIONS]));
@@ -961,7 +961,7 @@ static int ovs_flow_cmd_set(struct sk_buff *skb, struct genl_info *info)
 		if (IS_ERR(acts))
 			goto error;
 
-		ovs_flow_mask_key(&masked_key, &key, &mask);
+		ovs_flow_mask_key(&masked_key, &key, true, &mask);
 		error = ovs_nla_copy_actions(a[OVS_FLOW_ATTR_ACTIONS],
 					     &masked_key, 0, &acts);
 		if (error) {
diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index cf2d853646f0..740041a09b9d 100644
--- a/net/openvswitch/flow_table.c
+++ b/net/openvswitch/flow_table.c
@@ -56,20 +56,21 @@ static u16 range_n_bytes(const struct sw_flow_key_range *range)
 }
 
 void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src,
-		       const struct sw_flow_mask *mask)
+		       bool full, const struct sw_flow_mask *mask)
 {
-	const long *m = (const long *)((const u8 *)&mask->key +
-				mask->range.start);
-	const long *s = (const long *)((const u8 *)src +
-				mask->range.start);
-	long *d = (long *)((u8 *)dst + mask->range.start);
+	int start = full ? 0 : mask->range.start;
+	int len = full ? sizeof *dst : range_n_bytes(&mask->range);
+	const long *m = (const long *)((const u8 *)&mask->key + start);
+	const long *s = (const long *)((const u8 *)src + start);
+	long *d = (long *)((u8 *)dst + start);
 	int i;
 
-	/* The memory outside of the 'mask->range' are not set since
-	 * further operations on 'dst' only uses contents within
-	 * 'mask->range'.
+	/* If 'full' is true then all of 'dst' is fully initialized. Otherwise,
+	 * if 'full' is false the memory outside of the 'mask->range' is left
+	 * uninitialized. This can be used as an optimization when further
+	 * operations on 'dst' only use contents within 'mask->range'.
 	 */
-	for (i = 0; i < range_n_bytes(&mask->range); i += sizeof(long))
+	for (i = 0; i < len; i += sizeof(long))
 		*d++ = *s++ & *m++;
 }
 
@@ -418,7 +419,7 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti,
 	u32 hash;
 	struct sw_flow_key masked_key;
 
-	ovs_flow_mask_key(&masked_key, unmasked, mask);
+	ovs_flow_mask_key(&masked_key, unmasked, false, mask);
 	hash = flow_hash(&masked_key, key_start, key_end);
 	head = find_bucket(ti, hash);
 	hlist_for_each_entry_rcu(flow, head, hash_node[ti->node_ver]) {
diff --git a/net/openvswitch/flow_table.h b/net/openvswitch/flow_table.h
index 5918bff7f3f6..2f0cf200ede9 100644
--- a/net/openvswitch/flow_table.h
+++ b/net/openvswitch/flow_table.h
@@ -82,5 +82,5 @@ bool ovs_flow_cmp_unmasked_key(const struct sw_flow *flow,
 			       struct sw_flow_match *match);
 
 void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src,
-		       const struct sw_flow_mask *mask);
+		       bool full, const struct sw_flow_mask *mask);
 #endif /* flow_table.h */

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

* [PATCH 3.16.y-ckt 132/133] fib_rules: fix fib rule dumps across multiple skbs
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (130 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 131/133] openvswitch: Zero flows on allocation Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 133/133] parisc: Filter out spurious interrupts in PA-RISC irq handler Luis Henriques
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Wilson Kok, Roopa Prabhu, David S. Miller, Luis Henriques

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

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

From: Wilson Kok <wkok@cumulusnetworks.com>

commit 41fc014332d91ee90c32840bf161f9685b7fbf2b upstream.

dump_rules returns skb length and not error.
But when family == AF_UNSPEC, the caller of dump_rules
assumes that it returns an error. Hence, when family == AF_UNSPEC,
we continue trying to dump on -EMSGSIZE errors resulting in
incorrect dump idx carried between skbs belonging to the same dump.
This results in fib rule dump always only dumping rules that fit
into the first skb.

This patch fixes dump_rules to return error so that we exit correctly
and idx is correctly maintained between skbs that are part of the
same dump.

Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/fib_rules.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 185c341fafbd..aeedc3a961a1 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -621,15 +621,17 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
 {
 	int idx = 0;
 	struct fib_rule *rule;
+	int err = 0;
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(rule, &ops->rules_list, list) {
 		if (idx < cb->args[1])
 			goto skip;
 
-		if (fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
-				     cb->nlh->nlmsg_seq, RTM_NEWRULE,
-				     NLM_F_MULTI, ops) < 0)
+		err = fib_nl_fill_rule(skb, rule, NETLINK_CB(cb->skb).portid,
+				       cb->nlh->nlmsg_seq, RTM_NEWRULE,
+				       NLM_F_MULTI, ops);
+		if (err)
 			break;
 skip:
 		idx++;
@@ -638,7 +640,7 @@ skip:
 	cb->args[1] = idx;
 	rules_ops_put(ops);
 
-	return skb->len;
+	return err;
 }
 
 static int fib_nl_dumprule(struct sk_buff *skb, struct netlink_callback *cb)
@@ -654,7 +656,9 @@ static int fib_nl_dumprule(struct sk_buff *skb, struct netlink_callback *cb)
 		if (ops == NULL)
 			return -EAFNOSUPPORT;
 
-		return dump_rules(skb, cb, ops);
+		dump_rules(skb, cb, ops);
+
+		return skb->len;
 	}
 
 	rcu_read_lock();

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

* [PATCH 3.16.y-ckt 133/133] parisc: Filter out spurious interrupts in PA-RISC irq handler
  2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
                   ` (131 preceding siblings ...)
  2015-09-30  9:51 ` [PATCH 3.16.y-ckt 132/133] fib_rules: fix fib rule dumps across multiple skbs Luis Henriques
@ 2015-09-30  9:51 ` Luis Henriques
  132 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30  9:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: linux-parisc, Helge Deller, Luis Henriques

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

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

From: Helge Deller <deller@gmx.de>

commit b1b4e435e4ef7de77f07bf2a42c8380b960c2d44 upstream.

When detecting a serial port on newer PA-RISC machines (with iosapic) we have a
long way to go to find the right IRQ line, registering it, then registering the
serial port and the irq handler for the serial port. During this phase spurious
interrupts for the serial port may happen which then crashes the kernel because
the action handler might not have been set up yet.

So, basically it's a race condition between the serial port hardware and the
CPU which sets up the necessary fields in the irq sructs. The main reason for
this race is, that we unmask the serial port irqs too early without having set
up everything properly before (which isn't easily possible because we need the
IRQ number to register the serial ports).

This patch is a work-around for this problem. It adds checks to the CPU irq
handler to verify if the IRQ action field has been initialized already. If not,
we just skip this interrupt (which isn't critical for a serial port at bootup).
The real fix would probably involve rewriting all PA-RISC specific IRQ code
(for CPU, IOSAPIC, GSC and EISA) to use IRQ domains with proper parenting of
the irq chips and proper irq enabling along this line.

This bug has been in the PA-RISC port since the beginning, but the crashes
happened very rarely with currently used hardware.  But on the latest machine
which I bought (a C8000 workstation), which uses the fastest CPUs (4 x PA8900,
1GHz) and which has the largest possible L1 cache size (64MB each), the kernel
crashed at every boot because of this race. So, without this patch the machine
would currently be unuseable.

For the record, here is the flow logic:
1. serial_init_chip() in 8250_gsc.c calls iosapic_serial_irq().
2. iosapic_serial_irq() calls txn_alloc_irq() to find the irq.
3. iosapic_serial_irq() calls cpu_claim_irq() to register the CPU irq
4. cpu_claim_irq() unmasks the CPU irq (which it shouldn't!)
5. serial_init_chip() then registers the 8250 port.
Problems:
- In step 4 the CPU irq shouldn't have been registered yet, but after step 5
- If serial irq happens between 4 and 5 have finished, the kernel will crash

Cc: linux-parisc@vger.kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
[ luis: backported to 3.16: used Helge's backport ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/parisc/kernel/irq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index cfe056fe7f5c..34f06be569d9 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -507,8 +507,8 @@ void do_cpu_irq_mask(struct pt_regs *regs)
 	struct pt_regs *old_regs;
 	unsigned long eirr_val;
 	int irq, cpu = smp_processor_id();
-#ifdef CONFIG_SMP
 	struct irq_desc *desc;
+#ifdef CONFIG_SMP
 	cpumask_t dest;
 #endif
 
@@ -521,8 +521,12 @@ void do_cpu_irq_mask(struct pt_regs *regs)
 		goto set_out;
 	irq = eirr_to_irq(eirr_val);
 
-#ifdef CONFIG_SMP
+	/* Filter out spurious interrupts, mostly from serial port at bootup */
 	desc = irq_to_desc(irq);
+	if (unlikely(!desc->action))
+		goto set_out;
+
+#ifdef CONFIG_SMP
 	cpumask_copy(&dest, desc->irq_data.affinity);
 	if (irqd_is_per_cpu(&desc->irq_data) &&
 	    !cpu_isset(smp_processor_id(), dest)) {

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

* Re: [PATCH 3.16.y-ckt 081/133] stmmac: fix check for phydev being open
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 081/133] stmmac: fix check for phydev being open Luis Henriques
@ 2015-09-30 11:23   ` Sergei Shtylyov
  2015-09-30 12:20     ` Luis Henriques
  0 siblings, 1 reply; 140+ messages in thread
From: Sergei Shtylyov @ 2015-09-30 11:23 UTC (permalink / raw)
  To: Luis Henriques, linux-kernel, stable, kernel-team
  Cc: Giuseppe Cavallaro, David Miller, Alexey Brodkin

On 9/30/2015 12:50 PM, Luis Henriques wrote:

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

    NAK on the same grounds as the 3.10 and 3.14 patches.

> ------------------
>
> From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
>
> commit dfc50fcaad574e5c8c85cbc83eca1426b2413fa4 upstream.
>
> Current check of phydev with IS_ERR(phydev) may make not much sense
> because of_phy_connect() returns NULL on failure instead of error value.
>
> Still for checking result of phy_connect() IS_ERR() makes perfect sense.
>
> So let's use combined check IS_ERR_OR_NULL() that covers both cases.
>
> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: linux-kernel@vger.kernel.org
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 641086fc14b5..936cdee0c22e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -810,8 +810,11 @@ static int stmmac_init_phy(struct net_device *dev)
>
>   	phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link, interface);
>
> -	if (IS_ERR(phydev)) {
> +	if (IS_ERR_OR_NULL(phydev)) {
>   		pr_err("%s: Could not attach to PHY\n", dev->name);
> +		if (!phydev)
> +			return -ENODEV;
> +
>   		return PTR_ERR(phydev);
>   	}
>

MBR, Sergei


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

* Re: [PATCH 3.16.y-ckt 081/133] stmmac: fix check for phydev being open
  2015-09-30 11:23   ` Sergei Shtylyov
@ 2015-09-30 12:20     ` Luis Henriques
  0 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-09-30 12:20 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-kernel, stable, kernel-team, Giuseppe Cavallaro,
	David Miller, Alexey Brodkin

On Wed, Sep 30, 2015 at 02:23:17PM +0300, Sergei Shtylyov wrote:
> On 9/30/2015 12:50 PM, Luis Henriques wrote:
> 
> >3.16.7-ckt18 -stable review patch.  If anyone has any objections, please let me know.
> 
>    NAK on the same grounds as the 3.10 and 3.14 patches.
>

Ok, makes sense -- dropping this patch from the 3.16 queue.  Thanks!

Cheers,
--
Lu�s

> >------------------
> >
> >From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
> >
> >commit dfc50fcaad574e5c8c85cbc83eca1426b2413fa4 upstream.
> >
> >Current check of phydev with IS_ERR(phydev) may make not much sense
> >because of_phy_connect() returns NULL on failure instead of error value.
> >
> >Still for checking result of phy_connect() IS_ERR() makes perfect sense.
> >
> >So let's use combined check IS_ERR_OR_NULL() that covers both cases.
> >
> >Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> >Cc: linux-kernel@vger.kernel.org
> >Cc: David Miller <davem@davemloft.net>
> >Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> >Signed-off-by: David S. Miller <davem@davemloft.net>
> >Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
> >---
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> >index 641086fc14b5..936cdee0c22e 100644
> >--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> >+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> >@@ -810,8 +810,11 @@ static int stmmac_init_phy(struct net_device *dev)
> >
> >  	phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link, interface);
> >
> >-	if (IS_ERR(phydev)) {
> >+	if (IS_ERR_OR_NULL(phydev)) {
> >  		pr_err("%s: Could not attach to PHY\n", dev->name);
> >+		if (!phydev)
> >+			return -ENODEV;
> >+
> >  		return PTR_ERR(phydev);
> >  	}
> >
> 
> MBR, Sergei
> 

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

* Re: [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers
  2015-09-30  9:50 ` [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers Luis Henriques
@ 2015-10-15  3:23   ` Ben Hutchings
  2015-10-15  6:22     ` Gregory CLEMENT
  0 siblings, 1 reply; 140+ messages in thread
From: Ben Hutchings @ 2015-10-15  3:23 UTC (permalink / raw)
  To: Luis Henriques, linux-kernel, stable, kernel-team
  Cc: Gregory CLEMENT, Benjamin Cama

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
> 3.16.7-ckt18 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Benjamin Cama <benoar@dolka.fr>
> 
> commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
> 
> Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
[...]

But I don't think this was needed for 3.16-ckt, was it?

Ben.

-- 
Ben Hutchings
Who are all these weirdos? - David Bowie, reading IRC for the first time

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers
  2015-10-15  3:23   ` Ben Hutchings
@ 2015-10-15  6:22     ` Gregory CLEMENT
  2015-10-15  9:03       ` Benjamin Cama
  0 siblings, 1 reply; 140+ messages in thread
From: Gregory CLEMENT @ 2015-10-15  6:22 UTC (permalink / raw)
  To: Luis Henriques, Ben Hutchings
  Cc: linux-kernel, stable, kernel-team, Benjamin Cama

Hi Ben and Luis,
 
 On jeu., oct. 15 2015, Ben Hutchings <ben@decadent.org.uk> wrote:

> On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
>> 3.16.7-ckt18 -stable review patch.  If anyone has any objections, please let me know.
>> 
>> ------------------
>> 
>> From: Benjamin Cama <benoar@dolka.fr>
>> 
>> commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
>> 
>> Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
> [...]
>
> But I don't think this was needed for 3.16-ckt, was it?

Indeed it fixes a commit (a71b092a9c68 ("ARM: Convert handle_IRQ to use
__handle_domain_irq")) that was introduced in 3.18:

git tag --contains a71b092a9c68 | grep "^v3\." | sort | head -1
v3.18

So please Luis do not apply it on 3.16-ckt unless you already back port
the commit a71b092a9c68 ("ARM: Convert handle_IRQ to use
__handle_domain_irq") on this branch.

Thanks,

Gregory

>
> Ben.
>
> -- 
> Ben Hutchings
> Who are all these weirdos? - David Bowie, reading IRC for the first time

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ  numbers
  2015-10-15  6:22     ` Gregory CLEMENT
@ 2015-10-15  9:03       ` Benjamin Cama
  2015-10-19  8:39         ` Luis Henriques
  0 siblings, 1 reply; 140+ messages in thread
From: Benjamin Cama @ 2015-10-15  9:03 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: Luis Henriques, Ben Hutchings, linux-kernel, stable, kernel-team

Hi everyone,

Le 2015-10-15 08:22, Gregory CLEMENT a écrit :
>  On jeu., oct. 15 2015, Ben Hutchings <ben@decadent.org.uk> wrote:
>
>> On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
>>> 3.16.7-ckt18 -stable review patch.  If anyone has any objections, 
>>> please let me know.
>>>
>>> ------------------
>>>
>>> From: Benjamin Cama <benoar@dolka.fr>
>>>
>>> commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
>>>
>>> Since v3.18, attempts to deliver IRQ0 are rejected, breaking 
>>> orion5x.
>> [...]
>>
>> But I don't think this was needed for 3.16-ckt, was it?
>
> Indeed it fixes a commit (a71b092a9c68 ("ARM: Convert handle_IRQ to 
> use
> __handle_domain_irq")) that was introduced in 3.18:
>
> git tag --contains a71b092a9c68 | grep "^v3\." | sort | head -1
> v3.18
>
> So please Luis do not apply it on 3.16-ckt unless you already back 
> port
> the commit a71b092a9c68 ("ARM: Convert handle_IRQ to use
> __handle_domain_irq") on this branch.

Indeed it is not completely needed, but to be clear it "just" shifts 
the IRQs by one, so it shouldn't do any harm either. So it is up to you. 
I would understand that you choose not to apply it to be on the safe 
side. BTW, it seems f28d7de is required by my patch, appearing in 3.14; 
as I don't follow kernel development closely, I could not assure you my 
patch is completly safe for 3.16.

Regards,
--
benjamin

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

* Re: [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers
  2015-10-15  9:03       ` Benjamin Cama
@ 2015-10-19  8:39         ` Luis Henriques
  0 siblings, 0 replies; 140+ messages in thread
From: Luis Henriques @ 2015-10-19  8:39 UTC (permalink / raw)
  To: Benjamin Cama
  Cc: Gregory CLEMENT, Ben Hutchings, linux-kernel, stable, kernel-team

On Thu, Oct 15, 2015 at 11:03:19AM +0200, Benjamin Cama wrote:
> Hi everyone,
> 
> Le 2015-10-15 08:22, Gregory CLEMENT a �crit�:
> > On jeu., oct. 15 2015, Ben Hutchings <ben@decadent.org.uk> wrote:
> >
> >>On Wed, 2015-09-30 at 10:50 +0100, Luis Henriques wrote:
> >>>3.16.7-ckt18 -stable review patch.��If anyone has any objections,
> >>>please let me know.
> >>>
> >>>------------------
> >>>
> >>>From: Benjamin Cama <benoar@dolka.fr>
> >>>
> >>>commit 5be9fc23cdb42e1d383ecc8eae8a8ff70a752708 upstream.
> >>>
> >>>Since v3.18, attempts to deliver IRQ0 are rejected, breaking orion5x.
> >>[...]
> >>
> >>But I don't think this was needed for 3.16-ckt, was it?
> >
> >Indeed it fixes a commit (a71b092a9c68 ("ARM: Convert handle_IRQ to use
> >__handle_domain_irq")) that was introduced in 3.18:
> >
> >git tag --contains a71b092a9c68 | grep "^v3\." | sort | head -1
> >v3.18
> >
> >So please Luis do not apply it on 3.16-ckt unless you already back port
> >the commit a71b092a9c68 ("ARM: Convert handle_IRQ to use
> >__handle_domain_irq") on this branch.
> 
> Indeed it is not completely needed, but to be clear it "just" shifts the
> IRQs by one, so it shouldn't do any harm either. So it is up to you. I would
> understand that you choose not to apply it to be on the safe side. BTW, it
> seems f28d7de is required by my patch, appearing in 3.14; as I don't follow
> kernel development closely, I could not assure you my patch is completly
> safe for 3.16.
>

*Sigh*
Sorry for letting this commit getting in.  I'm reverting it for the next
3.16 kernel release.  Thank you all!

Cheers,
--
Lu�s

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

end of thread, other threads:[~2015-10-19  8:39 UTC | newest]

Thread overview: 140+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30  9:49 [3.16.y-ckt stable] Linux 3.16.7-ckt18 stable review Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 001/133] ipv6: addrconf: validate new MTU before applying it Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 002/133] virtio-net: drop NETIF_F_FRAGLIST Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 003/133] [media] v4l: omap3isp: Fix sub-device power management code Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 004/133] [media] rc-core: fix remove uevent generation Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 005/133] HID: cp2112: fix I2C_SMBUS_BYTE write Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 006/133] HID: cp2112: fix byte order in SMBUS operations Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 007/133] xtensa: fix threadptr reload on return to userspace Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 008/133] ARM: OMAP2+: DRA7: clockdomain: change l4per2_7xx_clkdm to SW_WKUP Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 009/133] mac80211: enable assoc check for mesh interfaces Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 010/133] PCI: Add dev_flags bit to access VPD through function 0 Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 011/133] PCI: Add VPD function 0 quirk for Intel Ethernet devices Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 012/133] staging: comedi: usbduxsigma: don't clobber ai_timer in command test Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 013/133] staging: comedi: usbduxsigma: don't clobber ao_timer " Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 014/133] clk: exynos4: Fix wrong clock for Exynos4x12 ADC Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 015/133] usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 016/133] Doc: ABI: testing: configfs-usb-gadget-loopback Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 017/133] Doc: ABI: testing: configfs-usb-gadget-sourcesink Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 018/133] serial: 8250_pci: Add support for Pericom PI7C9X795[1248] Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 019/133] KVM: MMU: fix validation of mmio page fault Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 020/133] auxdisplay: ks0108: fix refcount Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 021/133] devres: fix devres_get() Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 022/133] iio: adis16400: Fix adis16448 gyroscope scale Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 023/133] iio: Add inverse unit conversion macros Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 024/133] iio: adis16480: Fix scale factors Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 025/133] ideapad-laptop: Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 026/133] ASoC: rt5640: fix line out no sound issue Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 027/133] iio: industrialio-buffer: Fix iio_buffer_poll return value Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 028/133] iio: event: Remove negative error code from iio_event_poll Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 029/133] NFSv4: don't set SETATTR for O_RDONLY|O_EXCL Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 030/133] unshare: Unsharing a thread does not require unsharing a vm Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 031/133] fs: Set the size of empty dirs to 0 Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 032/133] x86/mce: Reenable CMCI banks when swiching back to interrupt mode Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 033/133] ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 034/133] regulator: pbias: Fix broken pbias disable functionality Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 035/133] serial: 8250: don't bind to SMSC IrCC IR port Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 036/133] serial: 8250: bind to ALi Fast Infrared Controller (ALI5123) Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 037/133] staging: comedi: adl_pci7x3x: fix digital output on PCI-7230 Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 038/133] blk-mq: fix buffer overflow when reading sysfs file of 'pending' Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 039/133] xtensa: fix kernel register spilling Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 040/133] NFS: nfs_set_pgio_error sometimes misses errors Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 041/133] NFS: Fix a NULL pointer dereference of migration recovery ops for v4.2 client Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 042/133] usb: host: ehci-sys: delete useless bus_to_hcd conversion Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 043/133] USB: symbolserial: Use usb_get_serial_port_data Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 044/133] USB: ftdi_sio: Added custom PID for CustomWare products Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 045/133] USB: qcserial: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 046/133] igb: Fix oops caused by missing queue pairing Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 047/133] HID: usbhid: Fix the check for HID_RESET_PENDING in hid_io_error Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 048/133] eCryptfs: Invalidate dcache entries when lower i_nlink is zero Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 049/133] libxfs: readahead of dir3 data blocks should use the read verifier Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 050/133] xfs: Fix xfs_attr_leafblock definition Luis Henriques
2015-09-30  9:49 ` [PATCH 3.16.y-ckt 051/133] arm64: kconfig: Move LIST_POISON to a safe value Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 052/133] Btrfs: check if previous transaction aborted to avoid fs corruption Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 053/133] ARM: orion5x: fix legacy orion5x IRQ numbers Luis Henriques
2015-10-15  3:23   ` Ben Hutchings
2015-10-15  6:22     ` Gregory CLEMENT
2015-10-15  9:03       ` Benjamin Cama
2015-10-19  8:39         ` Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 054/133] DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 055/133] xfs: Fix file type directory corruption for btree directories Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 056/133] sched: Fix cpu_active_mask/cpu_online_mask race Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 057/133] rtlwifi: rtl8192cu: Add new device ID Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 058/133] of/address: Don't loop forever in of_find_matching_node_by_address() Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 059/133] drivercore: Fix unregistration path of platform devices Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 060/133] arm64: flush FP/SIMD state correctly after execve() Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 061/133] xfs: return errors from partial I/O failures to files Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 062/133] ALSA: usb-audio: correct the value cache check Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 063/133] IB/qib: Change lkey table allocation to support more MRs Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 064/133] drm/radeon/atom: Send out the full AUX address Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 065/133] tg3: Fix temperature reporting Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 066/133] drm/i915: Always mark the object as dirty when used by the GPU Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 067/133] Add radeon suspend/resume quirk for HP Compaq dc5750 Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 068/133] IB/uverbs: reject invalid or unknown opcodes Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 069/133] hpfs: update ctime and mtime on directory modification Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 070/133] Input: evdev - do not report errors form flush() Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 071/133] crypto: ghash-clmulni: specify context size for ghash async algorithm Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 072/133] mm: check if section present during memory block registering Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 073/133] fs: create and use seq_show_option for escaping Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 074/133] ALSA: hda - Enable headphone jack detect on old Fujitsu laptops Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 075/133] ALSA: hda - Use ALC880_FIXUP_FUJITSU for FSC Amilo M1437 Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 076/133] rtc: s5m: fix to update ctrl register Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 077/133] scsi: fix scsi_error_handler vs. scsi_host_dev_release race Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 078/133] parisc: Use double word condition in 64bit CAS operation Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 079/133] vmscan: fix increasing nr_isolated incurred by putback unevictable pages Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 080/133] drm/i915: Limit the number of loops for reading a split 64bit register Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 081/133] stmmac: fix check for phydev being open Luis Henriques
2015-09-30 11:23   ` Sergei Shtylyov
2015-09-30 12:20     ` Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 082/133] hfs,hfsplus: cache pages correctly between bnode_create and bnode_free Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 083/133] hfs: fix B-tree corruption after insertion at position 0 Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 084/133] drm/qxl: validate monitors config modes Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 085/133] PCI: Fix TI816X class code quirk Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 086/133] Input: ambakmi - fix system PM by converting to modern callbacks Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 087/133] svcrdma: Fix send_reply() scatter/gather set-up Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 088/133] x86/mm: Initialize pmd_idx in page_table_range_init_count() Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 089/133] net: bcmgenet: Use correct dev_id for free_irq Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 090/133] powerpc/rtas: Introduce rtas_get_sensor_fast() for IRQ handlers Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 091/133] clk: versatile: off by one in clk_sp810_timerclken_of_get() Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 092/133] usb: gadget: m66592-udc: forever loop in set_feature() Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 093/133] windfarm: decrement client count when unregistering Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 094/133] perf hists: Update the column width for the "srcline" sort key Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 095/133] batman-adv: Make DAT capability changes atomic Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 096/133] batman-adv: Make NC " Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 097/133] batman-adv: Make TT " Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 098/133] batman-adv: fix multicast counter when purging originators Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 099/133] batman-adv: fix counter for multicast supporting nodes Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 100/133] batman-adv: Make MCAST capability changes atomic Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 101/133] batman-adv: Fix potential synchronization issues in mcast tvlv handler Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 102/133] batman-adv: Fix potentially broken skb network header access Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 103/133] net: fix endian check warning in etherdevice.h Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 104/133] powerpc/mm: Fix pte_pagesize_index() crash on 4K w/64K hash Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 105/133] mtd: pxa3xx_nand: add a default chunk size Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 106/133] ath10k: fix dma_mapping_error() handling Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 107/133] mmc: sdhci: also get preset value and driver type for MMC_DDR52 Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 108/133] perf stat: Get correct cpu id for print_aggr Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 109/133] ASoC: spear_pcm: Use devm_snd_dmaengine_pcm_register to fix resource leak Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 110/133] IB/mlx4: Fix potential deadlock when sending mad to wire Luis Henriques
2015-09-30  9:50 ` [PATCH 3.16.y-ckt 111/133] IB/mlx4: Forbid using sysfs to change RoCE pkeys Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 112/133] IB/mlx4: Use correct SL on AH query under RoCE Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 113/133] IB/uverbs: Fix race between ib_uverbs_open and remove_one Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 114/133] mmc: core: fix race condition in mmc_wait_data_done Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 115/133] ipv6: fix exthdrs offload registration in out_rt path Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 116/133] task_work: remove fifo ordering guarantee Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 117/133] fixed_phy: pass 'irq' to fixed_phy_add() Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 118/133] netlink, mmap: fix edge-case leakages in nf queue zero-copy Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 119/133] scsi_dh: fix randconfig build error Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 120/133] md: flush ->event_work before stopping array Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 121/133] md/raid10: always set reshape_safe when initializing reshape_position Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 122/133] perf/x86: Fix copy_from_user_nmi() return if range is not ok Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 123/133] ext4: fix loss of delalloc extent info in ext4_zero_range() Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 124/133] powerpc/MSI: Fix race condition in tearing down MSI interrupts Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 125/133] RDS: verify the underlying transport exists before creating a connection Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 126/133] UBI: block: Add missing cache flushes Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 127/133] usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 128/133] net/ipv6: Correct PIM6 mrt_lock handling Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 129/133] netlink, mmap: transform mmap skb into full skb on taps Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 130/133] sctp: fix race on protocol/netns initialization Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 131/133] openvswitch: Zero flows on allocation Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 132/133] fib_rules: fix fib rule dumps across multiple skbs Luis Henriques
2015-09-30  9:51 ` [PATCH 3.16.y-ckt 133/133] parisc: Filter out spurious interrupts in PA-RISC irq handler Luis Henriques

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