LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review
@ 2015-01-27 12:15 Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 001/126] spi: sh-msiof: Add runtime PM lock in initializing Luis Henriques
                   ` (125 more replies)
  0 siblings, 126 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 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-ckt5 stable kernel.

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

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

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

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

--
 arch/arm/boot/dts/berlin2q-marvell-dmp.dts       |  2 +
 arch/arm/boot/dts/berlin2q.dtsi                  | 63 ++++++++---------
 arch/arm/boot/dts/dra7-evm.dts                   | 10 +--
 arch/arm/boot/dts/dra7.dtsi                      |  2 +-
 arch/arm/boot/dts/imx25.dtsi                     |  2 +-
 arch/arm/boot/dts/imx51-babbage.dts              | 22 ++----
 arch/arm/boot/dts/s3c6410-mini6410.dts           |  4 --
 arch/arm/boot/dts/s3c64xx.dtsi                   |  1 -
 arch/arm/configs/multi_v7_defconfig              |  1 +
 arch/arm/include/asm/xen/page.h                  |  4 ++
 arch/arm/kernel/setup.c                          |  9 +++
 arch/arm/kernel/smp.c                            | 13 +++-
 arch/arm/mach-imx/clk-imx6q.c                    |  4 +-
 arch/arm/mach-imx/clk-imx6sx.c                   |  3 +
 arch/arm/mach-omap2/common.h                     |  1 +
 arch/arm/mach-omap2/omap-headsmp.S               | 21 ++++++
 arch/arm/mach-omap2/omap-smp.c                   | 13 +++-
 arch/arm/mach-omap2/pm44xx.c                     | 29 +++-----
 arch/arm/mach-omap2/timer.c                      |  8 +--
 arch/arm/mach-shmobile/setup-sh73a0.c            |  3 +
 arch/arm/xen/mm.c                                |  7 ++
 arch/arm64/kernel/efi.c                          |  2 +-
 arch/arm64/kernel/setup.c                        |  1 +
 arch/powerpc/kernel/udbg_16550.c                 |  6 +-
 arch/x86/include/asm/vsyscall.h                  |  2 +-
 arch/x86/include/asm/xen/page.h                  |  7 ++
 arch/x86/kernel/kprobes/core.c                   | 20 ++++--
 arch/x86/vdso/vma.c                              | 45 +++++++-----
 drivers/acpi/acpica/evxfgpe.c                    | 47 +++++++++++++
 drivers/acpi/device_pm.c                         |  2 +-
 drivers/acpi/scan.c                              | 42 ++++++-----
 drivers/clk/at91/clk-slow.c                      | 27 +++++++
 drivers/clk/berlin/bg2q.c                        |  1 -
 drivers/clk/clk.c                                |  5 +-
 drivers/gpu/drm/i915/i915_irq.c                  |  6 +-
 drivers/gpu/drm/i915/i915_reg.h                  | 12 ++--
 drivers/gpu/drm/i915/intel_ringbuffer.c          | 66 +++++++++++-------
 drivers/gpu/drm/nouveau/core/subdev/mc/nv4c.c    |  8 ---
 drivers/gpu/drm/radeon/atombios_crtc.c           |  8 +--
 drivers/gpu/drm/radeon/atombios_dp.c             |  4 ++
 drivers/gpu/drm/radeon/dce3_1_afmt.c             |  2 +-
 drivers/gpu/drm/radeon/kv_dpm.c                  | 10 ++-
 drivers/hid/hid-core.c                           |  1 +
 drivers/hid/hid-ids.h                            |  1 +
 drivers/hid/hid-input.c                          |  3 +
 drivers/hid/hid-kye.c                            |  4 ++
 drivers/hid/hid-roccat-pyra.c                    |  8 ++-
 drivers/hid/i2c-hid/i2c-hid.c                    |  5 --
 drivers/hid/usbhid/hid-quirks.c                  |  1 +
 drivers/md/bcache/btree.c                        |  2 +-
 drivers/misc/mei/hw-me.c                         | 12 ++++
 drivers/mmc/host/sdhci-pxav3.c                   | 19 +++--
 drivers/mmc/host/sdhci.c                         |  8 ++-
 drivers/mtd/nand/omap2.c                         |  7 --
 drivers/net/ethernet/atheros/alx/main.c          | 24 ++++---
 drivers/net/ethernet/broadcom/tg3.c              | 34 ++++-----
 drivers/net/ethernet/cisco/enic/enic_main.c      | 12 ++--
 drivers/net/ethernet/ti/cpsw.c                   | 30 ++++----
 drivers/net/ethernet/ti/cpsw_ale.c               | 10 ++-
 drivers/net/ethernet/ti/cpsw_ale.h               |  2 +-
 drivers/net/team/team.c                          | 16 ++++-
 drivers/net/wireless/iwlwifi/mvm/utils.c         |  2 +-
 drivers/net/xen-netback/xenbus.c                 |  1 +
 drivers/net/xen-netfront.c                       | 10 ++-
 drivers/reset/reset-sunxi.c                      |  4 ++
 drivers/rtc/rtc-isl12057.c                       |  4 +-
 drivers/scsi/scsi_error.c                        |  4 +-
 drivers/spi/spi-sh-msiof.c                       |  5 ++
 drivers/target/loopback/tcm_loop.c               | 23 +++---
 drivers/target/target_core_device.c              |  8 +--
 drivers/target/target_core_file.c                | 11 ++-
 drivers/target/target_core_iblock.c              |  2 +-
 drivers/target/target_core_sbc.c                 | 15 ----
 drivers/target/target_core_spc.c                 |  5 +-
 drivers/usb/dwc3/gadget.c                        |  6 +-
 drivers/usb/gadget/atmel_usba_udc.c              | 19 +++--
 drivers/usb/gadget/inode.c                       |  1 +
 drivers/usb/host/ehci-sched.c                    |  8 +--
 drivers/usb/host/pci-quirks.c                    | 18 ++++-
 drivers/usb/host/xhci-pci.c                      |  2 +
 drivers/usb/host/xhci.c                          |  9 +++
 drivers/usb/musb/musb_host.c                     |  1 -
 drivers/usb/serial/console.c                     | 16 +++--
 drivers/usb/serial/cp210x.c                      |  4 +-
 drivers/usb/serial/keyspan.c                     | 20 ++++--
 drivers/usb/serial/option.c                      | 11 ++-
 drivers/usb/serial/qcserial.c                    |  1 -
 drivers/usb/storage/unusual_uas.h                | 28 ++++++++
 drivers/vfio/pci/vfio_pci.c                      |  4 +-
 drivers/vhost/scsi.c                             | 24 ++++++-
 drivers/video/fbdev/core/fb_defio.c              |  5 +-
 drivers/video/logo/logo.c                        | 17 ++++-
 drivers/xen/swiotlb-xen.c                        |  7 +-
 fs/btrfs/delayed-inode.c                         |  8 +++
 fs/lockd/svc.c                                   |  8 +--
 fs/nfs/nfs4client.c                              | 17 +++--
 fs/nilfs2/inode.c                                | 32 ++++++---
 fs/nilfs2/namei.c                                | 15 +++-
 fs/notify/inode_mark.c                           | 17 +++--
 fs/ocfs2/namei.c                                 | 43 +++++++++---
 include/acpi/acpixf.h                            |  4 ++
 include/linux/mm.h                               |  2 +-
 include/linux/rmap.h                             | 10 +++
 include/linux/writeback.h                        |  1 -
 include/uapi/linux/in6.h                         |  3 +-
 include/uapi/linux/libc-compat.h                 |  3 +
 kernel/exit.c                                    | 12 +++-
 kernel/sched/deadline.c                          | 25 ++-----
 mm/memory.c                                      | 31 +++++----
 mm/mmap.c                                        | 13 ++--
 mm/page-writeback.c                              | 43 ++++--------
 mm/rmap.c                                        | 42 ++++++++++-
 mm/vmscan.c                                      | 24 ++++---
 net/batman-adv/fragmentation.c                   |  2 +-
 net/batman-adv/gateway_client.c                  |  2 +-
 net/bridge/br_multicast.c                        |  3 +-
 net/core/dev.c                                   | 89 +++++++++++++++++++++---
 net/core/skbuff.c                                |  1 +
 net/ipv4/ip_gre.c                                |  9 +--
 net/ipv4/tcp_output.c                            |  4 +-
 net/netfilter/ipset/ip_set_core.c                |  6 ++
 net/netfilter/nf_conntrack_proto_generic.c       | 26 ++++++-
 net/netlink/af_netlink.c                         | 54 +++++---------
 net/sunrpc/xdr.c                                 |  6 +-
 scripts/kernel-doc                               |  2 +-
 sound/firewire/fireworks/fireworks_transaction.c |  2 +-
 sound/pci/hda/hda_codec.c                        |  4 +-
 sound/pci/hda/patch_hdmi.c                       |  2 +
 sound/pci/hda/patch_sigmatel.c                   |  4 +-
 sound/soc/dwc/designware_i2s.c                   | 14 ++++
 sound/soc/fsl/eukrea-tlv320.c                    |  2 +-
 tools/perf/util/hist.h                           |  1 +
 tools/perf/util/session.c                        |  6 +-
 133 files changed, 1085 insertions(+), 546 deletions(-)

Aaron Plattner (1):
      ALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda

Alan Stern (2):
      SCSI: fix regression in scsi_send_eh_cmnd()
      USB: EHCI: fix initialization bug in iso_stream_schedule()

Alex Deucher (4):
      drm/radeon: KV has three PPLLs (v2)
      drm/radeon: fix sad_count check for dce3
      drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw
      drm/radeon: adjust default bapm settings for KV

Alexander Usyskin (1):
      mei: clean reset bit before reset

Alexander Y. Fomichev (2):
      net: prevent of emerging cross-namespace symlinks
      net: fix creation adjacent device symlinks

Amit Virdi (2):
      usb: dwc3: gadget: Fix TRB preparation during SG
      usb: dwc3: gadget: Stop TRB preparation after limit is reached

Andrew Jackson (1):
      ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap

Andy Lutomirski (2):
      x86_64, vdso: Fix the vdso address randomization algorithm
      x86, vdso: Use asm volatile in __getcpu

Anton Blanchard (1):
      powerpc: Fix bad NULL pointer check in udbg_uart_getc_poll()

Antonio Quartulli (1):
      batman-adv: avoid NULL dereferences and fix if check

Ard Biesheuvel (1):
      arm64/efi: add missing call to early_ioremap_reset()

Arnaud Ebalard (1):
      drivers/rtc/rtc-isl12057.c: fix masking of register values

Arseny Solokha (1):
      OHCI: add a quirk for ULi M5237 blocking on reset

Bo Shen (2):
      usb: gadget: udc: atmel: change setting for DMA
      usb: gadget: udc: atmel: fix possible IN hang issue

Boris Brezillon (1):
      clk: at91: keep slow clk enabled to prevent system hang

Chris Mason (1):
      Btrfs: don't delay inode ref updates during log replay

Chris Wilson (1):
      drm/i915: Evict CS TLBs between batches

Dan Carpenter (3):
      HID: roccat: potential out of bounds in pyra_sysfs_write_settings()
      ALSA: hda - using uninitialized data
      netfilter: ipset: small potential read beyond the end of buffer

David Miller (1):
      netlink: Always copy on mmap TX.

David Peterson (1):
      USB: cp210x: add IDs for CEL USB sticks and MeshWorks devices

David Vrabel (2):
      xen-netfront: use correct linear area after linearizing an skb
      Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single"

Dmitry Voytik (1):
      ARM: imx6q: drop unnecessary semicolon

Eric Dumazet (1):
      alx: fix alx_poll()

Eyal Shapira (1):
      iwlwifi: mvm: fix Rx with both chains

Fabio Estevam (3):
      ARM: dts: imx25: Fix the SPI1 clocks
      ARM: imx6sx: Set PLL2 as parent of QSPI clocks
      ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling

Felipe Balbi (1):
      net: ethernet: cpsw: fix hangs with interrupts

Florian Westphal (1):
      netfilter: conntrack: disable generic tracking for known protocols

Gary Bisson (1):
      ARM: clk-imx6q: fix video divider for rev T0 1.0

Geert Uytterhoeven (1):
      ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances

Giedrius Statkevičius (1):
      HID: Add a new id 0x501a for Genius MousePen i608X

Govindarajulu Varadarajan (1):
      enic: fix rx skb checksum

Hannes Reinecke (1):
      tcm_loop: Fixup tag handling

Hans de Goede (4):
      xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers
      uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013
      uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 with usb-id 0bc2:a013
      uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures

Herbert Xu (1):
      tcp: Do not apply TSO segment limit to non-TSO packets

Hisashi Nakamura (1):
      spi: sh-msiof: Add runtime PM lock in initializing

Ilia Mirkin (1):
      drm/nv4c/mc: disable msi

J. Bruce Fields (1):
      rpc: fix xdr_truncate_encode to handle buffer ending on page boundary

Jay Vosburgh (1):
      net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding

Jerry Hoemann (1):
      fsnotify: next_i is freed during fsnotify_unmount_inodes.

Jiri Olsa (1):
      perf session: Do not fail on processing out of order event

Jiri Pirko (1):
      team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin

Jisheng Zhang (4):
      ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host
      ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT
      ARM: dts: berlin: correct BG2Q's SM GPIO location.
      clk: berlin: bg2q: remove non-exist "smemc" gate clock

Johan Hovold (3):
      USB: keyspan: fix null-deref at probe
      USB: console: fix uninitialised ldisc semaphore
      USB: console: fix potential use after free

Johannes Berg (1):
      scripts/kernel-doc: don't eat struct members with __aligned

Johannes Weiner (1):
      mm: protect set_page_dirty() from ongoing truncation

Karl Relton (1):
      HID: add battery quirk for USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO keyboard

Kent Overstreet (1):
      bcache: Make sure to pass GFP_WAIT to mempool_alloc()

Konstantin Khlebnikov (2):
      mm: prevent endless growth of anon_vma hierarchy
      mm: fix corner case in anon_vma endless growing prevention

Krzysztof Kozlowski (1):
      mmc: sdhci: Fix sleep in atomic after inserting SD card

Lennart Sorensen (2):
      ARM: omap5/dra7xx: Fix frequency typos
      ARM: omap5/dra7xx: Enable booting secondary CPU in HYP mode

Linus Lüssing (1):
      bridge: fix netfilter/NF_BR_LOCAL_OUT for own, locally generated queries

Linus Torvalds (2):
      mm: propagate error from stack expansion even for guard page
      mm: Don't count the stack guard page towards RLIMIT_STACK

Lokesh Vutla (1):
      ARM: dts: DRA7: wdt: Fix compatible property for watchdog node

Luca Abeni (2):
      sched/deadline: Fix migration of SCHED_DEADLINE tasks
      sched/deadline: Avoid double-accounting in case of missed deadlines

Mario Schuknecht (1):
      usb: gadget: gadgetfs: Free memory allocated by memdup_user()

Mathias Nyman (1):
      xhci: Check if slot is already in default state before moving it there

Mika Westerberg (1):
      HID: i2c-hid: Do not free buffers in i2c_hid_stop()

Mugunthan V N (2):
      drivers: net: cpsw: fix multicast flush in dual emac mode
      ARM: dts: dra7-evm: fix qspi device tree partition size

Nicholas Bellinger (2):
      vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion
      target: Drop arbitrary maximum I/O size limit

Nishanth Menon (1):
      ARM: OMAP4: PM: Only do static dependency configuration in omap4_init_static_deps

Oleg Nesterov (1):
      exit: fix race between wait_consider_task() and wait_task_zombie()

Palik, Imre (1):
      xen-netback: fixing the propagation of the transmit shaper timeout

Pavel Machek (1):
      Revert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo"

Prashant Sreedharan (1):
      tg3: tg3_disable_ints using uninitialized mailbox value to disable interrupts

Preston Fick (1):
      USB: cp210x: fix ID for production CEL MeshConnect USB Stick

Rafael J. Wysocki (3):
      ACPI / PM: Fix PM initialization for devices that are not present
      ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake.
      ACPI / scan: No implicit wake notification for buttons

Reinhard Speyerer (1):
      USB: qcserial/option: make AT URCs work for Sierra Wireless MC73xx

Roger Quadros (1):
      mtd: nand: omap: Fix NAND enumeration on 3430 LDP

Ryusuke Konishi (1):
      nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races

Sebastian Andrzej Siewior (1):
      usb: musb: stuff leak of struct usb_hcd

Songjun Wu (1):
      usb: gadget: udc: atmel: fix possible oops when unloading module

Steev Klimaszewski (1):
      Add USB_EHCI_EXYNOS to multi_v7_defconfig

Stefano Stabellini (1):
      xen/arm/arm64: introduce xen_arch_need_swiotlb

Steven Rostedt (Red Hat) (1):
      ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing

Sven Eckelmann (1):
      batman-adv: Unify fragment size calculation

Takashi Iwai (2):
      ALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs
      ASoC: eukrea-tlv320: Fix of_node_put() call with uninitialized object

Takashi Sakamoto (1):
      ALSA: fireworks: fix an endianness bug for transaction length

Thomas Graf (2):
      netlink: Don't reorder loads/stores before marking mmap netlink frame as available
      net: Reset secmark when scrubbing packet

Thomas Petazzoni (1):
      mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks

Timo Teräs (1):
      gre: fix the inner mac header in nbma tunnel xmit path

Tomasz Figa (1):
      ARM: dts: Enable PWM node by default for s3c64xx

Tomeu Vizoso (1):
      clk: Don't try to use a struct clk* after it could have been freed

Tomi Valkeinen (2):
      video/logo: prevent use of logos after they have been freed
      video/fbdev: fix defio's fsync

Toshiaki Makita (1):
      net: Fix stacked vlan offload features computation

Trond Myklebust (2):
      LOCKD: Fix a race when initialising nlmsvc_timeout
      NFSv4.1: Fix client id trunking on Linux

Tyler Baker (1):
      reset: sunxi: fix spinlock initialization

Ville Syrjälä (1):
      drm/i915: Don't call intel_prepare_page_flip() multiple times on gen2-4

Vlastimil Babka (1):
      mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process being killed

Wei Yang (1):
      vfio-pci: Fix the check on pci device type in vfio_pci_probe()

Xiang Wang (1):
      mmc: sdhci-pxav3: fix error handling of sdhci_add_host

Xue jiufei (1):
      ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file

Zoltan Kiss (1):
      xen-netfront: Fix handling packets on compound pages with skb_linearize

stephen hemminger (1):
      in6: fix conflict with glibc

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

* [PATCH 3.16.y-ckt 001/126] spi: sh-msiof: Add runtime PM lock in initializing
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 002/126] drm/i915: Don't call intel_prepare_page_flip() multiple times on gen2-4 Luis Henriques
                   ` (124 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hisashi Nakamura, Yoshihiro Kaneko, Mark Brown, Luis Henriques

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

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

From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>

commit 015760563ec77bf17cec712fa94afdf53b285287 upstream.

SH-MSIOF driver is enabled autosuspend API of spi framework.
But autosuspend framework doesn't work during initializing.
So runtime PM lock is added in SH-MSIOF driver initializing.

Fixes: e2a0ba547ba31c (spi: sh-msiof: Convert to spi core auto_runtime_pm framework)
Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/spi/spi-sh-msiof.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 45b09142afe2..7f0f2ebf3cdc 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -421,6 +421,8 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
 	struct device_node	*np = spi->master->dev.of_node;
 	struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
 
+	pm_runtime_get_sync(&p->pdev->dev);
+
 	if (!np) {
 		/*
 		 * Use spi->controller_data for CS (same strategy as spi_gpio),
@@ -439,6 +441,9 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
 	if (spi->cs_gpio >= 0)
 		gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
 
+
+	pm_runtime_put_sync(&p->pdev->dev);
+
 	return 0;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 002/126] drm/i915: Don't call intel_prepare_page_flip() multiple times on gen2-4
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 001/126] spi: sh-msiof: Add runtime PM lock in initializing Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 003/126] x86_64, vdso: Fix the vdso address randomization algorithm Luis Henriques
                   ` (123 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ville Syrjälä, Jani Nikula, Luis Henriques

3.16.7-ckt5 -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 7d47559ee84b3ac206aa9e675606fafcd7c0b500 upstream.

The flip stall detector kicks in when pending>=INTEL_FLIP_COMPLETE. That
means if we first call intel_prepare_page_flip() but don't call
intel_finish_page_flip(), the next stall check will erroneosly think
the page flip was somehow stuck.

With enough debug spew emitted from the interrupt handler my 830 hangs
when this happens. My theory is that the previous vblank interrupt gets
sufficiently delayed that the handler will see the pending bit set in
IIR, but ISR still has the bit set as well (ie. the flip was processed
by CS but didn't complete yet). In this case the handler will proceed
to call intel_check_page_flip() immediately after
intel_prepare_page_flip(). It then tries to print a backtrace for the
stuck flip WARN, which apparetly results in way too much debug spew
delaying interrupt processing further. That then seems to cause an
endless loop in the interrupt handler, and the machine is dead until
the watchdog kicks in and reboots. At least limiting the number of
iterations of the loop in the interrupt handler also prevented the
hang.

So it seems better to not call intel_prepare_page_flip() without
immediately calling intel_finish_page_flip(). The IIR/ISR trickery
avoids races here so this is a perfectly safe thing to do.

v2: Fix typo in commit message (checkpatch)

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88381
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85888
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index b54f8563ebbb..085cb5645e66 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3723,8 +3723,6 @@ static bool i8xx_handle_vblank(struct drm_device *dev,
 	if ((iir & flip_pending) == 0)
 		return false;
 
-	intel_prepare_page_flip(dev, plane);
-
 	/* We detect FlipDone by looking for the change in PendingFlip from '1'
 	 * to '0' on the following vblank, i.e. IIR has the Pendingflip
 	 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence
@@ -3734,6 +3732,7 @@ static bool i8xx_handle_vblank(struct drm_device *dev,
 	if (I915_READ16(ISR) & flip_pending)
 		return false;
 
+	intel_prepare_page_flip(dev, plane);
 	intel_finish_page_flip(dev, pipe);
 
 	return true;
@@ -3908,8 +3907,6 @@ static bool i915_handle_vblank(struct drm_device *dev,
 	if ((iir & flip_pending) == 0)
 		return false;
 
-	intel_prepare_page_flip(dev, plane);
-
 	/* We detect FlipDone by looking for the change in PendingFlip from '1'
 	 * to '0' on the following vblank, i.e. IIR has the Pendingflip
 	 * asserted following the MI_DISPLAY_FLIP, but ISR is deasserted, hence
@@ -3919,6 +3916,7 @@ static bool i915_handle_vblank(struct drm_device *dev,
 	if (I915_READ(ISR) & flip_pending)
 		return false;
 
+	intel_prepare_page_flip(dev, plane);
 	intel_finish_page_flip(dev, pipe);
 
 	return true;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 003/126] x86_64, vdso: Fix the vdso address randomization algorithm
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 001/126] spi: sh-msiof: Add runtime PM lock in initializing Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 002/126] drm/i915: Don't call intel_prepare_page_flip() multiple times on gen2-4 Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 004/126] drm/nv4c/mc: disable msi Luis Henriques
                   ` (122 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Andy Lutomirski, Luis Henriques

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

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

From: Andy Lutomirski <luto@amacapital.net>

commit 394f56fe480140877304d342dec46d50dc823d46 upstream.

The theory behind vdso randomization is that it's mapped at a random
offset above the top of the stack.  To avoid wasting a page of
memory for an extra page table, the vdso isn't supposed to extend
past the lowest PMD into which it can fit.  Other than that, the
address should be a uniformly distributed address that meets all of
the alignment requirements.

The current algorithm is buggy: the vdso has about a 50% probability
of being at the very end of a PMD.  The current algorithm also has a
decent chance of failing outright due to incorrect handling of the
case where the top of the stack is near the top of its PMD.

This fixes the implementation.  The paxtest estimate of vdso
"randomisation" improves from 11 bits to 18 bits.  (Disclaimer: I
don't know what the paxtest code is actually calculating.)

It's worth noting that this algorithm is inherently biased: the vdso
is more likely to end up near the end of its PMD than near the
beginning.  Ideally we would either nix the PMD sharing requirement
or jointly randomize the vdso and the stack to reduce the bias.

In the mean time, this is a considerable improvement with basically
no risk of compatibility issues, since the allowed outputs of the
algorithm are unchanged.

As an easy test, doing this:

for i in `seq 10000`
  do grep -P vdso /proc/self/maps |cut -d- -f1
done |sort |uniq -d

used to produce lots of output (1445 lines on my most recent run).
A tiny subset looks like this:

7fffdfffe000
7fffe01fe000
7fffe05fe000
7fffe07fe000
7fffe09fe000
7fffe0bfe000
7fffe0dfe000

Note the suspicious fe000 endings.  With the fix, I get a much more
palatable 76 repeated addresses.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/vdso/vma.c | 45 +++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)

diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index 5a5176de8d0a..3ae68edd8c52 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -54,12 +54,17 @@ subsys_initcall(init_vdso);
 
 struct linux_binprm;
 
-/* Put the vdso above the (randomized) stack with another randomized offset.
-   This way there is no hole in the middle of address space.
-   To save memory make sure it is still in the same PTE as the stack top.
-   This doesn't give that many random bits.
-
-   Only used for the 64-bit and x32 vdsos. */
+/*
+ * Put the vdso above the (randomized) stack with another randomized
+ * offset.  This way there is no hole in the middle of address space.
+ * To save memory make sure it is still in the same PTE as the stack
+ * top.  This doesn't give that many random bits.
+ *
+ * Note that this algorithm is imperfect: the distribution of the vdso
+ * start address within a PMD is biased toward the end.
+ *
+ * Only used for the 64-bit and x32 vdsos.
+ */
 static unsigned long vdso_addr(unsigned long start, unsigned len)
 {
 #ifdef CONFIG_X86_32
@@ -67,22 +72,30 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
 #else
 	unsigned long addr, end;
 	unsigned offset;
-	end = (start + PMD_SIZE - 1) & PMD_MASK;
+
+	/*
+	 * Round up the start address.  It can start out unaligned as a result
+	 * of stack start randomization.
+	 */
+	start = PAGE_ALIGN(start);
+
+	/* Round the lowest possible end address up to a PMD boundary. */
+	end = (start + len + PMD_SIZE - 1) & PMD_MASK;
 	if (end >= TASK_SIZE_MAX)
 		end = TASK_SIZE_MAX;
 	end -= len;
-	/* This loses some more bits than a modulo, but is cheaper */
-	offset = get_random_int() & (PTRS_PER_PTE - 1);
-	addr = start + (offset << PAGE_SHIFT);
-	if (addr >= end)
-		addr = end;
+
+	if (end > start) {
+		offset = get_random_int() % (((end - start) >> PAGE_SHIFT) + 1);
+		addr = start + (offset << PAGE_SHIFT);
+	} else {
+		addr = start;
+	}
 
 	/*
-	 * page-align it here so that get_unmapped_area doesn't
-	 * align it wrongfully again to the next page. addr can come in 4K
-	 * unaligned here as a result of stack start randomization.
+	 * Forcibly align the final address in case we have a hardware
+	 * issue that requires alignment for performance reasons.
 	 */
-	addr = PAGE_ALIGN(addr);
 	addr = align_vdso_addr(addr);
 
 	return addr;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 004/126] drm/nv4c/mc: disable msi
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (2 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 003/126] x86_64, vdso: Fix the vdso address randomization algorithm Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 005/126] ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap Luis Henriques
                   ` (121 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ilia Mirkin, Ben Skeggs, Luis Henriques

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

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

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

commit 4761703bd04bbdf56396d264903cc5a1fdcb3c01 upstream.

Several users have, over time, reported issues with MSI on these IGPs.
They're old, rarely available, and MSI doesn't provide such huge
advantages on them. Just disable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74492
Fixes: fa8c9ac72fe ("drm/nv4c/mc: nv4x igp's have a different msi rearm register")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/nouveau/core/subdev/mc/nv4c.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/nv4c.c b/drivers/gpu/drm/nouveau/core/subdev/mc/nv4c.c
index a75c35ccf25c..165401c4045c 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/mc/nv4c.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/mc/nv4c.c
@@ -24,13 +24,6 @@
 
 #include "nv04.h"
 
-static void
-nv4c_mc_msi_rearm(struct nouveau_mc *pmc)
-{
-	struct nv04_mc_priv *priv = (void *)pmc;
-	nv_wr08(priv, 0x088050, 0xff);
-}
-
 struct nouveau_oclass *
 nv4c_mc_oclass = &(struct nouveau_mc_oclass) {
 	.base.handle = NV_SUBDEV(MC, 0x4c),
@@ -41,5 +34,4 @@ nv4c_mc_oclass = &(struct nouveau_mc_oclass) {
 		.fini = _nouveau_mc_fini,
 	},
 	.intr = nv04_mc_intr,
-	.msi_rearm = nv4c_mc_msi_rearm,
 }.base;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 005/126] ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (3 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 004/126] drm/nv4c/mc: disable msi Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 006/126] x86, vdso: Use asm volatile in __getcpu Luis Henriques
                   ` (120 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andrew Jackson, Mark Brown, Luis Henriques

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

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

From: Andrew Jackson <Andrew.Jackson@arm.com>

commit 3475c3d034d7f276a474c8bd53f44b48c8bf669d upstream.

Flush the FIFOs when the stream is prepared for use.  This avoids
an inadvertent swapping of the left/right channels if the FIFOs are
not empty at startup.

Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/dwc/designware_i2s.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index 25c31f1655f6..2f6357578616 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -263,6 +263,19 @@ static void dw_i2s_shutdown(struct snd_pcm_substream *substream,
 	snd_soc_dai_set_dma_data(dai, substream, NULL);
 }
 
+static int dw_i2s_prepare(struct snd_pcm_substream *substream,
+			  struct snd_soc_dai *dai)
+{
+	struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai);
+
+	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		i2s_write_reg(dev->i2s_base, TXFFR, 1);
+	else
+		i2s_write_reg(dev->i2s_base, RXFFR, 1);
+
+	return 0;
+}
+
 static int dw_i2s_trigger(struct snd_pcm_substream *substream,
 		int cmd, struct snd_soc_dai *dai)
 {
@@ -294,6 +307,7 @@ static struct snd_soc_dai_ops dw_i2s_dai_ops = {
 	.startup	= dw_i2s_startup,
 	.shutdown	= dw_i2s_shutdown,
 	.hw_params	= dw_i2s_hw_params,
+	.prepare	= dw_i2s_prepare,
 	.trigger	= dw_i2s_trigger,
 };
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 006/126] x86, vdso: Use asm volatile in __getcpu
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (4 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 005/126] ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 007/126] video/logo: prevent use of logos after they have been freed Luis Henriques
                   ` (119 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcelo Tosatti, Andy Lutomirski, Luis Henriques

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

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

From: Andy Lutomirski <luto@amacapital.net>

commit 1ddf0b1b11aa8a90cef6706e935fc31c75c406ba upstream.

In Linux 3.18 and below, GCC hoists the lsl instructions in the
pvclock code all the way to the beginning of __vdso_clock_gettime,
slowing the non-paravirt case significantly.  For unknown reasons,
presumably related to the removal of a branch, the performance issue
is gone as of

e76b027e6408 x86,vdso: Use LSL unconditionally for vgetcpu

but I don't trust GCC enough to expect the problem to stay fixed.

There should be no correctness issue, because the __getcpu calls in
__vdso_vlock_gettime were never necessary in the first place.

Note to stable maintainers: In 3.18 and below, depending on
configuration, gcc 4.9.2 generates code like this:

     9c3:       44 0f 03 e8             lsl    %ax,%r13d
     9c7:       45 89 eb                mov    %r13d,%r11d
     9ca:       0f 03 d8                lsl    %ax,%ebx

This patch won't apply as is to any released kernel, but I'll send a
trivial backported version if needed.

[
 Backported by Andy Lutomirski.  Should apply to all affected
 versions.  This fixes a functionality bug as well as a performance
 bug: buggy kernels can infinite loop in __vdso_clock_gettime on
 affected compilers.  See, for exammple:

 https://bugzilla.redhat.com/show_bug.cgi?id=1178975
]

Fixes: 51c19b4f5927 x86: vdso: pvclock gettime support
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
[ luis: backported to 3.16: used Andy's backport for stable kernels ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/include/asm/vsyscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/vsyscall.h b/arch/x86/include/asm/vsyscall.h
index 2a46ca720afc..2874be9aef0a 100644
--- a/arch/x86/include/asm/vsyscall.h
+++ b/arch/x86/include/asm/vsyscall.h
@@ -34,7 +34,7 @@ static inline unsigned int __getcpu(void)
 		native_read_tscp(&p);
 	} else {
 		/* Load per CPU data from GDT */
-		asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
+		asm volatile ("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
 	}
 
 	return p;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 007/126] video/logo: prevent use of logos after they have been freed
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (5 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 006/126] x86, vdso: Use asm volatile in __getcpu Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 008/126] video/fbdev: fix defio's fsync Luis Henriques
                   ` (118 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tomi Valkeinen, Luis Henriques

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

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

From: Tomi Valkeinen <tomi.valkeinen@ti.com>

commit 92b004d1aa9f367c372511ca0330f58216b25703 upstream.

If the probe of an fb driver has been deferred due to missing
dependencies, and the probe is later ran when a module is loaded, the
fbdev framework will try to find a logo to use.

However, the logos are __initdata, and have already been freed. This
causes sometimes page faults, if the logo memory is not mapped,
sometimes other random crashes as the logo data is invalid, and
sometimes nothing, if the fbdev decides to reject the logo (e.g. the
random value depicting the logo's height is too big).

This patch adds a late_initcall function to mark the logos as freed. In
reality the logos are freed later, and fbdev probe may be ran between
this late_initcall and the freeing of the logos. In that case we will
miss drawing the logo, even if it would be possible.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/video/logo/logo.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
index 940cd196eef5..10fbfd8ab963 100644
--- a/drivers/video/logo/logo.c
+++ b/drivers/video/logo/logo.c
@@ -21,6 +21,21 @@ static bool nologo;
 module_param(nologo, bool, 0);
 MODULE_PARM_DESC(nologo, "Disables startup logo");
 
+/*
+ * Logos are located in the initdata, and will be freed in kernel_init.
+ * Use late_init to mark the logos as freed to prevent any further use.
+ */
+
+static bool logos_freed;
+
+static int __init fb_logo_late_init(void)
+{
+	logos_freed = true;
+	return 0;
+}
+
+late_initcall(fb_logo_late_init);
+
 /* logo's are marked __initdata. Use __init_refok to tell
  * modpost that it is intended that this function uses data
  * marked __initdata.
@@ -29,7 +44,7 @@ const struct linux_logo * __init_refok fb_find_logo(int depth)
 {
 	const struct linux_logo *logo = NULL;
 
-	if (nologo)
+	if (nologo || logos_freed)
 		return NULL;
 
 	if (depth >= 1) {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 008/126] video/fbdev: fix defio's fsync
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (6 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 007/126] video/logo: prevent use of logos after they have been freed Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 009/126] Add USB_EHCI_EXYNOS to multi_v7_defconfig Luis Henriques
                   ` (117 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tomi Valkeinen, Luis Henriques

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

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

From: Tomi Valkeinen <tomi.valkeinen@ti.com>

commit 30ea9c5218651bc11cbdba7820be78f04e2d83bc upstream.

fb_deferred_io_fsync() returns the value of schedule_delayed_work() as
an error code, but schedule_delayed_work() does not return an error. It
returns true/false depending on whether the work was already queued.

Fix this by ignoring the return value of schedule_delayed_work().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/video/fbdev/core/fb_defio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c
index 900aa4ecd617..d6cab1fd9a47 100644
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -83,9 +83,10 @@ int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasy
 	cancel_delayed_work_sync(&info->deferred_work);
 
 	/* Run it immediately */
-	err = schedule_delayed_work(&info->deferred_work, 0);
+	schedule_delayed_work(&info->deferred_work, 0);
 	mutex_unlock(&inode->i_mutex);
-	return err;
+
+	return 0;
 }
 EXPORT_SYMBOL_GPL(fb_deferred_io_fsync);
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 009/126] Add USB_EHCI_EXYNOS to multi_v7_defconfig
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (7 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 008/126] video/fbdev: fix defio's fsync Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 010/126] SCSI: fix regression in scsi_send_eh_cmnd() Luis Henriques
                   ` (116 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Steev Klimaszewski, Arnd Bergmann, Luis Henriques

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

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

From: Steev Klimaszewski <threeway@gmail.com>

commit 007487f1fd43d84f26cda926081ca219a24ecbc4 upstream.

Currently we enable Exynos devices in the multi v7 defconfig, however, when
testing on my ODROID-U3, I noticed that USB was not working.  Enabling this
option causes USB to work, which enables networking support as well since the
ODROID-U3 has networking on the USB bus.

[arnd] Support for odroid-u3 was added in 3.10, so it would be nice to
backport this fix at least that far.

Signed-off-by: Steev Klimaszewski <steev@gentoo.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 534836497998..bc41efcd87c2 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -282,6 +282,7 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_MVEBU=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_EXYNOS=y
 CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_ISP1760_HCD=y
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 010/126] SCSI: fix regression in scsi_send_eh_cmnd()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (8 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 009/126] Add USB_EHCI_EXYNOS to multi_v7_defconfig Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 011/126] Btrfs: don't delay inode ref updates during log replay Luis Henriques
                   ` (115 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, James Bottomley, Luis Henriques

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

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

From: Alan Stern <stern@rowland.harvard.edu>

commit 511833acfc06c013d453e288f483c682c60ffbff upstream.

Commit ac61d1955934 (scsi: set correct completion code in
scsi_send_eh_cmnd()) introduced a bug.  It changed the stored return
value from a queuecommand call, but it didn't take into account that
the return value was used again later on.  This patch fixes the bug by
changing the later usage.

There is a big comment in the middle of scsi_send_eh_cmnd() which
does a good job of explaining how the routine works.  But it mentions
a "rtn = FAILURE" value that doesn't exist in the code.  This patch
adjusts the code to match the comment (I assume the comment is right
and the code is wrong).

This fixes Bugzilla #88341.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Андрей Аладьев <aladjev.andrew@gmail.com>
Tested-by: Андрей Аладьев <aladjev.andrew@gmail.com>
Fixes: ac61d19559349e205dad7b5122b281419aa74a82
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/scsi/scsi_error.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index b350eb8ec898..f0c7a970547f 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1026,7 +1026,7 @@ retry:
 		}
 		/* signal not to enter either branch of the if () below */
 		timeleft = 0;
-		rtn = NEEDS_RETRY;
+		rtn = FAILED;
 	} else {
 		timeleft = wait_for_completion_timeout(&done, timeout);
 		rtn = SUCCESS;
@@ -1067,7 +1067,7 @@ retry:
 			rtn = FAILED;
 			break;
 		}
-	} else if (!rtn) {
+	} else if (rtn != FAILED) {
 		scsi_abort_eh_cmnd(scmd);
 		rtn = FAILED;
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 011/126] Btrfs: don't delay inode ref updates during log replay
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (9 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 010/126] SCSI: fix regression in scsi_send_eh_cmnd() Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 012/126] net: ethernet: cpsw: fix hangs with interrupts Luis Henriques
                   ` (114 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Chris Mason, Luis Henriques

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

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

From: Chris Mason <clm@fb.com>

commit 6f8960541b1eb6054a642da48daae2320fddba93 upstream.

Commit 1d52c78afbb (Btrfs: try not to ENOSPC on log replay) added a
check to skip delayed inode updates during log replay because it
confuses the enospc code.  But the delayed processing will end up
ignoring delayed refs from log replay because the inode itself wasn't
put through the delayed code.

This can end up triggering a warning at commit time:

WARNING: CPU: 2 PID: 778 at fs/btrfs/delayed-inode.c:1410 btrfs_assert_delayed_root_empty+0x32/0x34()

Which is repeated for each commit because we never process the delayed
inode ref update.

The fix used here is to change btrfs_delayed_delete_inode_ref to return
an error if we're currently in log replay.  The caller will do the ref
deletion immediately and everything will work properly.

Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/btrfs/delayed-inode.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index a2e90f855d7d..e5856d792f8b 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1857,6 +1857,14 @@ int btrfs_delayed_delete_inode_ref(struct inode *inode)
 {
 	struct btrfs_delayed_node *delayed_node;
 
+	/*
+	 * we don't do delayed inode updates during log recovery because it
+	 * leads to enospc problems.  This means we also can't do
+	 * delayed inode refs
+	 */
+	if (BTRFS_I(inode)->root->fs_info->log_root_recovering)
+		return -EAGAIN;
+
 	delayed_node = btrfs_get_or_create_delayed_node(inode);
 	if (IS_ERR(delayed_node))
 		return PTR_ERR(delayed_node);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 012/126] net: ethernet: cpsw: fix hangs with interrupts
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (10 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 011/126] Btrfs: don't delay inode ref updates during log replay Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 013/126] ALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs Luis Henriques
                   ` (113 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Felipe Balbi, David S. Miller, Luis Henriques

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

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

From: Felipe Balbi <balbi@ti.com>

commit 7ce67a38f799d1fb332f672b117efbadedaa5352 upstream.

The CPSW IP implements pulse-signaled interrupts. Due to
that we must write a correct, pre-defined value to the
CPDMA_MACEOIVECTOR register so the controller generates
a pulse on the correct IRQ line to signal the End Of
Interrupt.

The way the driver is written today, all four IRQ lines
are requested using the same IRQ handler and, because of
that, we could fall into situations where a TX IRQ fires
but we tell the controller that we ended an RX IRQ (or
vice-versa). This situation triggers an IRQ storm on the
reserved IRQ 127 of INTC which will in turn call ack_bad_irq()
which will, then, print a ton of:

	unexpected IRQ trap at vector 00

In order to fix the problem, we are moving all calls to
cpdma_ctlr_eoi() inside the IRQ handler and making sure
we *always* write the correct value to the CPDMA_MACEOIVECTOR
register. Note that the algorithm assumes that IRQ numbers and
value-to-be-written-to-EOI are proportional, meaning that a
write of value 0 would trigger an EOI pulse for the RX_THRESHOLD
Interrupt and that's the IRQ number sitting in the 0-th index
of our irqs_table array.

This, however, is safe at least for current implementations of
CPSW so we will refrain from making the check smarter (and, as
a side-effect, slower) until we actually have a platform where
IRQ lines are swapped.

This patch has been tested for several days with AM335x- and
AM437x-based platforms. AM57x was left out because there are
still pending patches to enable ethernet in mainline for that
platform. A read of the TRM confirms the statement on previous
paragraph.

Reported-by: Yegor Yefremov <yegorslists@googlemail.com>
Fixes: 510a1e7 (drivers: net: davinci_cpdma: acknowledge interrupt properly)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/ti/cpsw.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index b988d16cd34e..869a0d43dbe5 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -726,6 +726,14 @@ static void cpsw_rx_handler(void *token, int len, int status)
 static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
 {
 	struct cpsw_priv *priv = dev_id;
+	int value = irq - priv->irqs_table[0];
+
+	/* NOTICE: Ending IRQ here. The trick with the 'value' variable above
+	 * is to make sure we will always write the correct value to the EOI
+	 * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2
+	 * for TX Interrupt and 3 for MISC Interrupt.
+	 */
+	cpdma_ctlr_eoi(priv->dma, value);
 
 	cpsw_intr_disable(priv);
 	if (priv->irq_enabled == true) {
@@ -755,8 +763,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
 	int			num_tx, num_rx;
 
 	num_tx = cpdma_chan_process(priv->txch, 128);
-	if (num_tx)
-		cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
 
 	num_rx = cpdma_chan_process(priv->rxch, budget);
 	if (num_rx < budget) {
@@ -764,7 +770,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
 
 		napi_complete(napi);
 		cpsw_intr_enable(priv);
-		cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
 		prim_cpsw = cpsw_get_slave_priv(priv, 0);
 		if (prim_cpsw->irq_enabled == false) {
 			prim_cpsw->irq_enabled = true;
@@ -1271,8 +1276,6 @@ static int cpsw_ndo_open(struct net_device *ndev)
 	napi_enable(&priv->napi);
 	cpdma_ctlr_start(priv->dma);
 	cpsw_intr_enable(priv);
-	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
-	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
 
 	prim_cpsw = cpsw_get_slave_priv(priv, 0);
 	if (prim_cpsw->irq_enabled == false) {
@@ -1539,9 +1542,6 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev)
 	cpdma_chan_start(priv->txch);
 	cpdma_ctlr_int_ctrl(priv->dma, true);
 	cpsw_intr_enable(priv);
-	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
-	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
-
 }
 
 static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p)
@@ -1581,9 +1581,6 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
 	cpsw_interrupt(ndev->irq, priv);
 	cpdma_ctlr_int_ctrl(priv->dma, true);
 	cpsw_intr_enable(priv);
-	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
-	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
-
 }
 #endif
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 013/126] ALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (11 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 012/126] net: ethernet: cpsw: fix hangs with interrupts Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 014/126] drm/radeon: KV has three PPLLs (v2) Luis Henriques
                   ` (112 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit c507de88f6a336bd7296c9ec0073b2d4af8b4f5e upstream.

stac_store_hints() does utterly wrong for masking the values for
gpio_dir and gpio_data, likely due to copy&paste errors.  Fortunately,
this feature is used very rarely, so the impact must be really small.

Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/patch_sigmatel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 619aec71b1e2..3075c765d19c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -599,9 +599,9 @@ static void stac_store_hints(struct hda_codec *codec)
 			spec->gpio_mask;
 	}
 	if (get_int_hint(codec, "gpio_dir", &spec->gpio_dir))
-		spec->gpio_mask &= spec->gpio_mask;
-	if (get_int_hint(codec, "gpio_data", &spec->gpio_data))
 		spec->gpio_dir &= spec->gpio_mask;
+	if (get_int_hint(codec, "gpio_data", &spec->gpio_data))
+		spec->gpio_data &= spec->gpio_mask;
 	if (get_int_hint(codec, "eapd_mask", &spec->eapd_mask))
 		spec->eapd_mask &= spec->gpio_mask;
 	if (get_int_hint(codec, "gpio_mute", &spec->gpio_mute))
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 014/126] drm/radeon: KV has three PPLLs (v2)
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (12 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 013/126] ALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 015/126] drm/radeon: fix sad_count check for dce3 Luis Henriques
                   ` (111 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit fbedf1c3fc3a1e9f249c2efe2f4553d8df9d86d3 upstream.

Enable all three in the driver.  Early documentation
indicated the 3rd one was used for something else, but
that is not the case.

v2: handle disable as well

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

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 30d242b25078..dce0d3918fa7 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -1851,10 +1851,9 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
 				return pll;
 		}
 		/* otherwise, pick one of the plls */
-		if ((rdev->family == CHIP_KAVERI) ||
-		    (rdev->family == CHIP_KABINI) ||
+		if ((rdev->family == CHIP_KABINI) ||
 		    (rdev->family == CHIP_MULLINS)) {
-			/* KB/KV/ML has PPLL1 and PPLL2 */
+			/* KB/ML has PPLL1 and PPLL2 */
 			pll_in_use = radeon_get_pll_use_mask(crtc);
 			if (!(pll_in_use & (1 << ATOM_PPLL2)))
 				return ATOM_PPLL2;
@@ -1863,7 +1862,7 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
 			DRM_ERROR("unable to allocate a PPLL\n");
 			return ATOM_PPLL_INVALID;
 		} else {
-			/* CI has PPLL0, PPLL1, and PPLL2 */
+			/* CI/KV has PPLL0, PPLL1, and PPLL2 */
 			pll_in_use = radeon_get_pll_use_mask(crtc);
 			if (!(pll_in_use & (1 << ATOM_PPLL2)))
 				return ATOM_PPLL2;
@@ -2154,6 +2153,7 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)
 	case ATOM_PPLL0:
 		/* disable the ppll */
 		if ((rdev->family == CHIP_ARUBA) ||
+		    (rdev->family == CHIP_KAVERI) ||
 		    (rdev->family == CHIP_BONAIRE) ||
 		    (rdev->family == CHIP_HAWAII))
 			atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 015/126] drm/radeon: fix sad_count check for dce3
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (13 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 014/126] drm/radeon: KV has three PPLLs (v2) Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 016/126] drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw Luis Henriques
                   ` (110 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 5665c3ebe5ee8a2c516925461f7214ba59c2e6d7 upstream.

Make it consistent with the sad code for other asics to deal
with monitors that don't report sads.

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

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

diff --git a/drivers/gpu/drm/radeon/dce3_1_afmt.c b/drivers/gpu/drm/radeon/dce3_1_afmt.c
index 13a27d971d35..9e2b5bfe4fa2 100644
--- a/drivers/gpu/drm/radeon/dce3_1_afmt.c
+++ b/drivers/gpu/drm/radeon/dce3_1_afmt.c
@@ -103,7 +103,7 @@ static void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder)
 	}
 
 	sad_count = drm_edid_to_sad(radeon_connector->edid, &sads);
-	if (sad_count < 0) {
+	if (sad_count <= 0) {
 		DRM_ERROR("Couldn't read SADs: %d\n", sad_count);
 		return;
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 016/126] drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (14 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 015/126] drm/radeon: fix sad_count check for dce3 Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 017/126] drm/radeon: adjust default bapm settings for KV Luis Henriques
                   ` (109 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 410cce2a6b82299b46ff316c6384e789ce275ecb upstream.

The check was already in place in the dp mode_valid check, but
radeon_dp_get_dp_link_clock() never returned the high clock
mode_valid was checking for because that function clipped the
clock based on the hw capabilities.  Add an explicit check
in the mode_valid function.

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

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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
index 67fb65428b1e..d011729f20b0 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -495,6 +495,10 @@ int radeon_dp_mode_valid_helper(struct drm_connector *connector,
 	struct radeon_connector_atom_dig *dig_connector;
 	int dp_clock;
 
+	if ((mode->clock > 340000) &&
+	    (!radeon_connector_is_dp12_capable(connector)))
+		return MODE_CLOCK_HIGH;
+
 	if (!radeon_connector->con_priv)
 		return MODE_CLOCK_HIGH;
 	dig_connector = radeon_connector->con_priv;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 017/126] drm/radeon: adjust default bapm settings for KV
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (15 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 016/126] drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 018/126] ACPI / PM: Fix PM initialization for devices that are not present Luis Henriques
                   ` (108 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 02ae7af53a451a1b0a51022c4693f5b339133e79 upstream.

Enabling bapm seems to cause clocking problems on some
KV configurations.  Disable it by default for now.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/kv_dpm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index e79b7ebf5894..d873f86a3045 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -2745,13 +2745,11 @@ int kv_dpm_init(struct radeon_device *rdev)
 	pi->enable_auto_thermal_throttling = true;
 	pi->disable_nb_ps3_in_battery = false;
 	if (radeon_bapm == -1) {
-		/* There are stability issues reported on with
-		 * bapm enabled on an asrock system.
-		 */
-		if (rdev->pdev->subsystem_vendor == 0x1849)
-			pi->bapm_enable = false;
-		else
+		/* only enable bapm on KB, ML by default */
+		if (rdev->family == CHIP_KABINI || rdev->family == CHIP_MULLINS)
 			pi->bapm_enable = true;
+		else
+			pi->bapm_enable = false;
 	} else if (radeon_bapm == 0) {
 		pi->bapm_enable = false;
 	} else {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 018/126] ACPI / PM: Fix PM initialization for devices that are not present
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (16 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 017/126] drm/radeon: adjust default bapm settings for KV Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 019/126] mm: propagate error from stack expansion even for guard page Luis Henriques
                   ` (107 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Rafael J. Wysocki, Luis Henriques

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

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

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

commit 1b1f3e1699a9886f1070f94171097ab4ccdbfc95 upstream.

If an ACPI device object whose _STA returns 0 (not present and not
functional) has _PR0 or _PS0, its power_manageable flag will be set
and acpi_bus_init_power() will return 0 for it.  Consequently, if
such a device object is passed to the ACPI device PM functions, they
will attempt to carry out the requested operation on the device,
although they should not do that for devices that are not present.

To fix that problem make acpi_bus_init_power() return an error code
for devices that are not present which will cause power_manageable to
be cleared for them as appropriate in acpi_bus_get_power_flags().
However, the lists of power resources should not be freed for the
device in that case, so modify acpi_bus_get_power_flags() to keep
those lists even if acpi_bus_init_power() returns an error.
Accordingly, when deciding whether or not the lists of power
resources need to be freed, acpi_free_power_resources_lists()
should check the power.flags.power_resources flag instead of
flags.power_manageable, so make that change too.

Furthermore, if acpi_bus_attach() sees that flags.initialized is
unset for the given device, it should reset the power management
settings of the device and re-initialize them from scratch instead
of relying on the previous settings (the device may have appeared
after being not present previously, for example), so make it use
the 'valid' flag of the D0 power state as the initial value of
flags.power_manageable for it and call acpi_bus_init_power() to
discover its current power state.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/acpi/device_pm.c |  2 +-
 drivers/acpi/scan.c      | 13 ++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 9ea7b99bc9a0..f702dcef4df9 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -257,7 +257,7 @@ int acpi_bus_init_power(struct acpi_device *device)
 
 	device->power.state = ACPI_STATE_UNKNOWN;
 	if (!acpi_device_is_present(device))
-		return 0;
+		return -ENXIO;
 
 	result = acpi_device_get_power(device, &state);
 	if (result)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 2e9ed9a4f13f..465712f3b7b4 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -869,7 +869,7 @@ static void acpi_free_power_resources_lists(struct acpi_device *device)
 	if (device->wakeup.flags.valid)
 		acpi_power_resources_list_free(&device->wakeup.resources);
 
-	if (!device->flags.power_manageable)
+	if (!device->power.flags.power_resources)
 		return;
 
 	for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
@@ -1588,10 +1588,8 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
 			device->power.flags.power_resources)
 		device->power.states[ACPI_STATE_D3_COLD].flags.os_accessible = 1;
 
-	if (acpi_bus_init_power(device)) {
-		acpi_free_power_resources_lists(device);
+	if (acpi_bus_init_power(device))
 		device->flags.power_manageable = 0;
-	}
 }
 
 static void acpi_bus_get_flags(struct acpi_device *device)
@@ -2159,13 +2157,18 @@ static void acpi_bus_attach(struct acpi_device *device)
 	/* Skip devices that are not present. */
 	if (!acpi_device_is_present(device)) {
 		device->flags.visited = false;
+		device->flags.power_manageable = 0;
 		return;
 	}
 	if (device->handler)
 		goto ok;
 
 	if (!device->flags.initialized) {
-		acpi_bus_update_power(device, NULL);
+		device->flags.power_manageable =
+			device->power.states[ACPI_STATE_D0].flags.valid;
+		if (acpi_bus_init_power(device))
+			device->flags.power_manageable = 0;
+
 		device->flags.initialized = true;
 	}
 	device->flags.visited = false;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 019/126] mm: propagate error from stack expansion even for guard page
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (17 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 018/126] ACPI / PM: Fix PM initialization for devices that are not present Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 020/126] ALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda Luis Henriques
                   ` (106 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Linus Torvalds, Luis Henriques

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

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

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

commit fee7e49d45149fba60156f5b59014f764d3e3728 upstream.

Jay Foad reports that the address sanitizer test (asan) sometimes gets
confused by a stack pointer that ends up being outside the stack vma
that is reported by /proc/maps.

This happens due to an interaction between RLIMIT_STACK and the guard
page: when we do the guard page check, we ignore the potential error
from the stack expansion, which effectively results in a missing guard
page, since the expected stack expansion won't have been done.

And since /proc/maps explicitly ignores the guard page (commit
d7824370e263: "mm: fix up some user-visible effects of the stack guard
page"), the stack pointer ends up being outside the reported stack area.

This is the minimal patch: it just propagates the error.  It also
effectively makes the guard page part of the stack limit, which in turn
measn that the actual real stack is one page less than the stack limit.

Let's see if anybody notices.  We could teach acct_stack_growth() to
allow an extra page for a grow-up/grow-down stack in the rlimit test,
but I don't want to add more complexity if it isn't needed.

Reported-and-tested-by: Jay Foad <jay.foad@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/linux/mm.h | 2 +-
 mm/memory.c        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index f988e4b189e1..663ad81d3c66 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1902,7 +1902,7 @@ extern int expand_downwards(struct vm_area_struct *vma,
 #if VM_GROWSUP
 extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
 #else
-  #define expand_upwards(vma, address) do { } while (0)
+  #define expand_upwards(vma, address) (0)
 #endif
 
 /* Look up the first VMA which satisfies  addr < vm_end,  NULL if none. */
diff --git a/mm/memory.c b/mm/memory.c
index 00a99f5614df..49787747ca33 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2601,7 +2601,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo
 		if (prev && prev->vm_end == address)
 			return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;
 
-		expand_downwards(vma, address - PAGE_SIZE);
+		return expand_downwards(vma, address - PAGE_SIZE);
 	}
 	if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) {
 		struct vm_area_struct *next = vma->vm_next;
@@ -2610,7 +2610,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo
 		if (next && next->vm_start == address + PAGE_SIZE)
 			return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM;
 
-		expand_upwards(vma, address + PAGE_SIZE);
+		return expand_upwards(vma, address + PAGE_SIZE);
 	}
 	return 0;
 }
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 020/126] ALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (18 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 019/126] mm: propagate error from stack expansion even for guard page Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 021/126] vfio-pci: Fix the check on pci device type in vfio_pci_probe() Luis Henriques
                   ` (105 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aaron Plattner, Takashi Iwai, Luis Henriques

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

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

From: Aaron Plattner <aplattner@nvidia.com>

commit 60834b73a9c2bbc2f514122ddc626f3350fb40cd upstream.

Vendor ID 0x10de0072 is used by a yet-to-be-named GPU chip.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/patch_hdmi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 210d411c0698..e80c0d60c14b 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -3342,6 +3342,7 @@ static const struct hda_codec_preset snd_hda_preset_hdmi[] = {
 { .id = 0x10de0067, .name = "MCP67 HDMI",	.patch = patch_nvhdmi_2ch },
 { .id = 0x10de0070, .name = "GPU 70 HDMI/DP",	.patch = patch_nvhdmi },
 { .id = 0x10de0071, .name = "GPU 71 HDMI/DP",	.patch = patch_nvhdmi },
+{ .id = 0x10de0072, .name = "GPU 72 HDMI/DP",	.patch = patch_nvhdmi },
 { .id = 0x10de8001, .name = "MCP73 HDMI",	.patch = patch_nvhdmi_2ch },
 { .id = 0x11069f80, .name = "VX900 HDMI/DP",	.patch = patch_via_hdmi },
 { .id = 0x11069f81, .name = "VX900 HDMI/DP",	.patch = patch_via_hdmi },
@@ -3401,6 +3402,7 @@ MODULE_ALIAS("snd-hda-codec-id:10de0060");
 MODULE_ALIAS("snd-hda-codec-id:10de0067");
 MODULE_ALIAS("snd-hda-codec-id:10de0070");
 MODULE_ALIAS("snd-hda-codec-id:10de0071");
+MODULE_ALIAS("snd-hda-codec-id:10de0072");
 MODULE_ALIAS("snd-hda-codec-id:10de8001");
 MODULE_ALIAS("snd-hda-codec-id:11069f80");
 MODULE_ALIAS("snd-hda-codec-id:11069f81");
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 021/126] vfio-pci: Fix the check on pci device type in vfio_pci_probe()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (19 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 020/126] ALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 022/126] rpc: fix xdr_truncate_encode to handle buffer ending on page boundary Luis Henriques
                   ` (104 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Wei Yang, Alex Williamson, Luis Henriques

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

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

From: Wei Yang <weiyang@linux.vnet.ibm.com>

commit 7c2e211f3c95b91912a92a8c6736343690042e2e upstream.

Current vfio-pci just supports normal pci device, so vfio_pci_probe() will
return if the pci device is not a normal device. While current code makes a
mistake. PCI_HEADER_TYPE is the offset in configuration space of the device
type, but we use this value to mask the type value.

This patch fixs this by do the check directly on the pci_dev->hdr_type.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/vfio/pci/vfio_pci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 010e0f8b8e4f..652ab678160e 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -810,13 +810,11 @@ static const struct vfio_device_ops vfio_pci_ops = {
 
 static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-	u8 type;
 	struct vfio_pci_device *vdev;
 	struct iommu_group *group;
 	int ret;
 
-	pci_read_config_byte(pdev, PCI_HEADER_TYPE, &type);
-	if ((type & PCI_HEADER_TYPE) != PCI_HEADER_TYPE_NORMAL)
+	if (pdev->hdr_type != PCI_HEADER_TYPE_NORMAL)
 		return -EINVAL;
 
 	group = iommu_group_get(&pdev->dev);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 022/126] rpc: fix xdr_truncate_encode to handle buffer ending on page boundary
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (20 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 021/126] vfio-pci: Fix the check on pci device type in vfio_pci_probe() Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 023/126] arm64/efi: add missing call to early_ioremap_reset() Luis Henriques
                   ` (103 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: J. Bruce Fields, Luis Henriques

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

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

From: "J. Bruce Fields" <bfields@redhat.com>

commit 49a068f82a1d30eb585d7804b05948376be6cf9a upstream.

A struct xdr_stream at a page boundary might point to the end of one
page or the beginning of the next, but xdr_truncate_encode isn't
prepared to handle the former.

This can cause corruption of NFSv4 READDIR replies in the case that a
readdir entry that would have exceeded the client's dircount/maxcount
limit would have ended exactly on a 4k page boundary.  You're more
likely to hit this case on large directories.

Other xdr_truncate_encode callers are probably also affected.

Reported-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
Tested-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
Fixes: 3e19ce762b53 "rpc: xdr_truncate_encode"
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sunrpc/xdr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 23fb4e75e245..25ef792dfee6 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -605,7 +605,7 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len)
 	struct kvec *head = buf->head;
 	struct kvec *tail = buf->tail;
 	int fraglen;
-	int new, old;
+	int new;
 
 	if (len > buf->len) {
 		WARN_ON_ONCE(1);
@@ -627,8 +627,8 @@ void xdr_truncate_encode(struct xdr_stream *xdr, size_t len)
 	buf->len -= fraglen;
 
 	new = buf->page_base + buf->page_len;
-	old = new + fraglen;
-	xdr->page_ptr -= (old >> PAGE_SHIFT) - (new >> PAGE_SHIFT);
+
+	xdr->page_ptr = buf->pages + (new >> PAGE_SHIFT);
 
 	if (buf->page_len && buf->len == len) {
 		xdr->p = page_address(*xdr->page_ptr);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 023/126] arm64/efi: add missing call to early_ioremap_reset()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (21 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 022/126] rpc: fix xdr_truncate_encode to handle buffer ending on page boundary Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 024/126] exit: fix race between wait_consider_task() and wait_task_zombie() Luis Henriques
                   ` (102 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Leif Lindholm, Ard Biesheuvel, Will Deacon, Luis Henriques

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

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

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

commit 0e63ea48b4d8035dd0e91a3fa6fb79458b47adfb upstream.

The early ioremap support introduced by patch bf4b558eba92
("arm64: add early_ioremap support") failed to add a call to
early_ioremap_reset() at an appropriate time. Without this call,
invocations of early_ioremap etc. that are done too late will go
unnoticed and may cause corruption.

This is exactly what happened when the first user of this feature
was added in patch f84d02755f5a ("arm64: add EFI runtime services").
The early mapping of the EFI memory map is unmapped during an early
initcall, at which time the early ioremap support is long gone.

Fix by adding the missing call to early_ioremap_reset() to
setup_arch(), and move the offending early_memunmap() to right after
the point where the early mapping of the EFI memory map is last used.

Fixes: f84d02755f5a ("arm64: add EFI runtime services")
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm64/kernel/efi.c   | 2 +-
 arch/arm64/kernel/setup.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index c0aead7d1a72..6b6bc795f72d 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -338,6 +338,7 @@ void __init efi_idmap_init(void)
 
 	/* boot time idmap_pg_dir is incomplete, so fill in missing parts */
 	efi_setup_idmap();
+	early_memunmap(memmap.map, memmap.map_end - memmap.map);
 }
 
 static int __init remap_region(efi_memory_desc_t *md, void **new)
@@ -395,7 +396,6 @@ static int __init arm64_enter_virtual_mode(void)
 
 	/* replace early memmap mapping with permanent mapping */
 	mapsize = memmap.map_end - memmap.map;
-	early_memunmap(memmap.map, mapsize);
 	memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map,
 						   mapsize);
 	memmap.map_end = memmap.map + mapsize;
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 9e03a1485cc3..209070d08ee3 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -390,6 +390,7 @@ void __init setup_arch(char **cmdline_p)
 	request_standard_resources();
 
 	efi_idmap_init();
+	early_ioremap_reset();
 
 	unflatten_device_tree();
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 024/126] exit: fix race between wait_consider_task() and wait_task_zombie()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (22 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 023/126] arm64/efi: add missing call to early_ioremap_reset() Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 025/126] mm: prevent endless growth of anon_vma hierarchy Luis Henriques
                   ` (101 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Oleg Nesterov, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Oleg Nesterov <oleg@redhat.com>

commit 3245d6acab981a2388ffb877c7ecc97e763c59d4 upstream.

wait_consider_task() checks EXIT_ZOMBIE after EXIT_DEAD/EXIT_TRACE and
both checks can fail if we race with EXIT_ZOMBIE -> EXIT_DEAD/EXIT_TRACE
change in between, gcc needs to reload p->exit_state after
security_task_wait().  In this case ->notask_error will be wrongly
cleared and do_wait() can hang forever if it was the last eligible
child.

Many thanks to Arne who carefully investigated the problem.

Note: this bug is very old but it was pure theoretical until commit
b3ab03160dfa ("wait: completely ignore the EXIT_DEAD tasks").  Before
this commit "-O2" was probably enough to guarantee that compiler won't
read ->exit_state twice.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Arne Goedeke <el@laramies.com>
Tested-by: Arne Goedeke <el@laramies.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>
---
 kernel/exit.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index e5c4668f1799..ab2472332043 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1294,9 +1294,15 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
 static int wait_consider_task(struct wait_opts *wo, int ptrace,
 				struct task_struct *p)
 {
+	/*
+	 * We can race with wait_task_zombie() from another thread.
+	 * Ensure that EXIT_ZOMBIE -> EXIT_DEAD/EXIT_TRACE transition
+	 * can't confuse the checks below.
+	 */
+	int exit_state = ACCESS_ONCE(p->exit_state);
 	int ret;
 
-	if (unlikely(p->exit_state == EXIT_DEAD))
+	if (unlikely(exit_state == EXIT_DEAD))
 		return 0;
 
 	ret = eligible_child(wo, p);
@@ -1317,7 +1323,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
 		return 0;
 	}
 
-	if (unlikely(p->exit_state == EXIT_TRACE)) {
+	if (unlikely(exit_state == EXIT_TRACE)) {
 		/*
 		 * ptrace == 0 means we are the natural parent. In this case
 		 * we should clear notask_error, debugger will notify us.
@@ -1344,7 +1350,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
 	}
 
 	/* slay zombie? */
-	if (p->exit_state == EXIT_ZOMBIE) {
+	if (exit_state == EXIT_ZOMBIE) {
 		/* we don't reap group leaders with subthreads */
 		if (!delay_group_leader(p)) {
 			/*
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 025/126] mm: prevent endless growth of anon_vma hierarchy
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (23 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 024/126] exit: fix race between wait_consider_task() and wait_task_zombie() Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 026/126] mm: protect set_page_dirty() from ongoing truncation Luis Henriques
                   ` (100 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Konstantin Khlebnikov, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Konstantin Khlebnikov <koct9i@gmail.com>

commit 7a3ef208e662f4b63d43a23f61a64a129c525bbc upstream.

Constantly forking task causes unlimited grow of anon_vma chain.  Each
next child allocates new level of anon_vmas and links vma to all
previous levels because pages might be inherited from any level.

This patch adds heuristic which decides to reuse existing anon_vma
instead of forking new one.  It adds counter anon_vma->degree which
counts linked vmas and directly descending anon_vmas and reuses anon_vma
if counter is lower than two.  As a result each anon_vma has either vma
or at least two descending anon_vmas.  In such trees half of nodes are
leafs with alive vmas, thus count of anon_vmas is no more than two times
bigger than count of vmas.

This heuristic reuses anon_vmas as few as possible because each reuse
adds false aliasing among vmas and rmap walker ought to scan more ptes
when it searches where page is might be mapped.

Link: http://lkml.kernel.org/r/20120816024610.GA5350@evergreen.ssec.wisc.edu
Fixes: 5beb49305251 ("mm: change anon_vma linking to fix multi-process server scalability issue")
[akpm@linux-foundation.org: fix typo, per Rik]
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-by: Daniel Forrest <dan.forrest@ssec.wisc.edu>
Tested-by: Michal Hocko <mhocko@suse.cz>
Tested-by: Jerome Marchand <jmarchan@redhat.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Rik van Riel <riel@redhat.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>
---
 include/linux/rmap.h | 10 ++++++++++
 mm/rmap.c            | 42 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index be574506e6a9..28349a8fd08b 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -37,6 +37,16 @@ struct anon_vma {
 	atomic_t refcount;
 
 	/*
+	 * Count of child anon_vmas and VMAs which points to this anon_vma.
+	 *
+	 * This counter is used for making decision about reusing anon_vma
+	 * instead of forking new one. See comments in function anon_vma_clone.
+	 */
+	unsigned degree;
+
+	struct anon_vma *parent;	/* Parent of this anon_vma */
+
+	/*
 	 * NOTE: the LSB of the rb_root.rb_node is set by
 	 * mm_take_all_locks() _after_ taking the above lock. So the
 	 * rb_root must only be read/written after taking the above lock
diff --git a/mm/rmap.c b/mm/rmap.c
index 78274432b48f..ab8e7984fa19 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -72,6 +72,8 @@ static inline struct anon_vma *anon_vma_alloc(void)
 	anon_vma = kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL);
 	if (anon_vma) {
 		atomic_set(&anon_vma->refcount, 1);
+		anon_vma->degree = 1;	/* Reference for first vma */
+		anon_vma->parent = anon_vma;
 		/*
 		 * Initialise the anon_vma root to point to itself. If called
 		 * from fork, the root will be reset to the parents anon_vma.
@@ -188,6 +190,8 @@ int anon_vma_prepare(struct vm_area_struct *vma)
 		if (likely(!vma->anon_vma)) {
 			vma->anon_vma = anon_vma;
 			anon_vma_chain_link(vma, avc, anon_vma);
+			/* vma reference or self-parent link for new root */
+			anon_vma->degree++;
 			allocated = NULL;
 			avc = NULL;
 		}
@@ -236,6 +240,14 @@ static inline void unlock_anon_vma_root(struct anon_vma *root)
 /*
  * Attach the anon_vmas from src to dst.
  * Returns 0 on success, -ENOMEM on failure.
+ *
+ * If dst->anon_vma is NULL this function tries to find and reuse existing
+ * anon_vma which has no vmas and only one child anon_vma. This prevents
+ * degradation of anon_vma hierarchy to endless linear chain in case of
+ * constantly forking task. On the other hand, an anon_vma with more than one
+ * child isn't reused even if there was no alive vma, thus rmap walker has a
+ * good chance of avoiding scanning the whole hierarchy when it searches where
+ * page is mapped.
  */
 int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
 {
@@ -256,7 +268,21 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src)
 		anon_vma = pavc->anon_vma;
 		root = lock_anon_vma_root(root, anon_vma);
 		anon_vma_chain_link(dst, avc, anon_vma);
+
+		/*
+		 * Reuse existing anon_vma if its degree lower than two,
+		 * that means it has no vma and only one anon_vma child.
+		 *
+		 * Do not chose parent anon_vma, otherwise first child
+		 * will always reuse it. Root anon_vma is never reused:
+		 * it has self-parent reference and at least one child.
+		 */
+		if (!dst->anon_vma && anon_vma != src->anon_vma &&
+				anon_vma->degree < 2)
+			dst->anon_vma = anon_vma;
 	}
+	if (dst->anon_vma)
+		dst->anon_vma->degree++;
 	unlock_anon_vma_root(root);
 	return 0;
 
@@ -280,6 +306,9 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
 	if (!pvma->anon_vma)
 		return 0;
 
+	/* Drop inherited anon_vma, we'll reuse existing or allocate new. */
+	vma->anon_vma = NULL;
+
 	/*
 	 * First, attach the new VMA to the parent VMA's anon_vmas,
 	 * so rmap can find non-COWed pages in child processes.
@@ -288,6 +317,10 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
 	if (error)
 		return error;
 
+	/* An existing anon_vma has been reused, all done then. */
+	if (vma->anon_vma)
+		return 0;
+
 	/* Then add our own anon_vma. */
 	anon_vma = anon_vma_alloc();
 	if (!anon_vma)
@@ -301,6 +334,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
 	 * lock any of the anon_vmas in this anon_vma tree.
 	 */
 	anon_vma->root = pvma->anon_vma->root;
+	anon_vma->parent = pvma->anon_vma;
 	/*
 	 * With refcounts, an anon_vma can stay around longer than the
 	 * process it belongs to. The root anon_vma needs to be pinned until
@@ -311,6 +345,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma)
 	vma->anon_vma = anon_vma;
 	anon_vma_lock_write(anon_vma);
 	anon_vma_chain_link(vma, avc, anon_vma);
+	anon_vma->parent->degree++;
 	anon_vma_unlock_write(anon_vma);
 
 	return 0;
@@ -341,12 +376,16 @@ void unlink_anon_vmas(struct vm_area_struct *vma)
 		 * Leave empty anon_vmas on the list - we'll need
 		 * to free them outside the lock.
 		 */
-		if (RB_EMPTY_ROOT(&anon_vma->rb_root))
+		if (RB_EMPTY_ROOT(&anon_vma->rb_root)) {
+			anon_vma->parent->degree--;
 			continue;
+		}
 
 		list_del(&avc->same_vma);
 		anon_vma_chain_free(avc);
 	}
+	if (vma->anon_vma)
+		vma->anon_vma->degree--;
 	unlock_anon_vma_root(root);
 
 	/*
@@ -357,6 +396,7 @@ void unlink_anon_vmas(struct vm_area_struct *vma)
 	list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) {
 		struct anon_vma *anon_vma = avc->anon_vma;
 
+		BUG_ON(anon_vma->degree);
 		put_anon_vma(anon_vma);
 
 		list_del(&avc->same_vma);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 026/126] mm: protect set_page_dirty() from ongoing truncation
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (24 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 025/126] mm: prevent endless growth of anon_vma hierarchy Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 027/126] mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process being killed Luis Henriques
                   ` (99 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johannes Weiner, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Johannes Weiner <hannes@cmpxchg.org>

commit 2d6d7f98284648c5ed113fe22a132148950b140f upstream.

Tejun, while reviewing the code, spotted the following race condition
between the dirtying and truncation of a page:

__set_page_dirty_nobuffers()       __delete_from_page_cache()
  if (TestSetPageDirty(page))
                                     page->mapping = NULL
				     if (PageDirty())
				       dec_zone_page_state(page, NR_FILE_DIRTY);
				       dec_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);
    if (page->mapping)
      account_page_dirtied(page)
        __inc_zone_page_state(page, NR_FILE_DIRTY);
	__inc_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE);

which results in an imbalance of NR_FILE_DIRTY and BDI_RECLAIMABLE.

Dirtiers usually lock out truncation, either by holding the page lock
directly, or in case of zap_pte_range(), by pinning the mapcount with
the page table lock held.  The notable exception to this rule, though,
is do_wp_page(), for which this race exists.  However, do_wp_page()
already waits for a locked page to unlock before setting the dirty bit,
in order to prevent a race where clear_page_dirty() misses the page bit
in the presence of dirty ptes.  Upgrade that wait to a fully locked
set_page_dirty() to also cover the situation explained above.

Afterwards, the code in set_page_dirty() dealing with a truncation race
is no longer needed.  Remove it.

Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Jan Kara <jack@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>
---
 include/linux/writeback.h |  1 -
 mm/memory.c               | 27 +++++++++++++++++----------
 mm/page-writeback.c       | 43 ++++++++++++-------------------------------
 3 files changed, 29 insertions(+), 42 deletions(-)

diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 5777c13849ba..0aa44e254a21 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -178,7 +178,6 @@ int write_cache_pages(struct address_space *mapping,
 		      struct writeback_control *wbc, writepage_t writepage,
 		      void *data);
 int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
-void set_page_dirty_balance(struct page *page);
 void writeback_set_ratelimit(void);
 void tag_pages_for_writeback(struct address_space *mapping,
 			     pgoff_t start, pgoff_t end);
diff --git a/mm/memory.c b/mm/memory.c
index 49787747ca33..dda1dc6d92dd 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2148,17 +2148,24 @@ reuse:
 		if (!dirty_page)
 			return ret;
 
-		/*
-		 * Yes, Virginia, this is actually required to prevent a race
-		 * with clear_page_dirty_for_io() from clearing the page dirty
-		 * bit after it clear all dirty ptes, but before a racing
-		 * do_wp_page installs a dirty pte.
-		 *
-		 * do_shared_fault is protected similarly.
-		 */
 		if (!page_mkwrite) {
-			wait_on_page_locked(dirty_page);
-			set_page_dirty_balance(dirty_page);
+			struct address_space *mapping;
+			int dirtied;
+
+			lock_page(dirty_page);
+			dirtied = set_page_dirty(dirty_page);
+			VM_BUG_ON_PAGE(PageAnon(dirty_page), dirty_page);
+			mapping = dirty_page->mapping;
+			unlock_page(dirty_page);
+
+			if (dirtied && mapping) {
+				/*
+				 * Some device drivers do not set page.mapping
+				 * but still dirty their pages
+				 */
+				balance_dirty_pages_ratelimited(mapping);
+			}
+
 			/* file_update_time outside page_lock */
 			if (vma->vm_file)
 				file_update_time(vma->vm_file);
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index e0c943014eb7..dfe512e911c8 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1544,16 +1544,6 @@ pause:
 		bdi_start_background_writeback(bdi);
 }
 
-void set_page_dirty_balance(struct page *page)
-{
-	if (set_page_dirty(page)) {
-		struct address_space *mapping = page_mapping(page);
-
-		if (mapping)
-			balance_dirty_pages_ratelimited(mapping);
-	}
-}
-
 static DEFINE_PER_CPU(int, bdp_ratelimits);
 
 /*
@@ -2143,32 +2133,25 @@ EXPORT_SYMBOL(account_page_writeback);
  * page dirty in that case, but not all the buffers.  This is a "bottom-up"
  * dirtying, whereas __set_page_dirty_buffers() is a "top-down" dirtying.
  *
- * Most callers have locked the page, which pins the address_space in memory.
- * But zap_pte_range() does not lock the page, however in that case the
- * mapping is pinned by the vma's ->vm_file reference.
- *
- * We take care to handle the case where the page was truncated from the
- * mapping by re-checking page_mapping() inside tree_lock.
+ * The caller must ensure this doesn't race with truncation.  Most will simply
+ * hold the page lock, but e.g. zap_pte_range() calls with the page mapped and
+ * the pte lock held, which also locks out truncation.
  */
 int __set_page_dirty_nobuffers(struct page *page)
 {
 	if (!TestSetPageDirty(page)) {
 		struct address_space *mapping = page_mapping(page);
-		struct address_space *mapping2;
 		unsigned long flags;
 
 		if (!mapping)
 			return 1;
 
 		spin_lock_irqsave(&mapping->tree_lock, flags);
-		mapping2 = page_mapping(page);
-		if (mapping2) { /* Race with truncate? */
-			BUG_ON(mapping2 != mapping);
-			WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page));
-			account_page_dirtied(page, mapping);
-			radix_tree_tag_set(&mapping->page_tree,
-				page_index(page), PAGECACHE_TAG_DIRTY);
-		}
+		BUG_ON(page_mapping(page) != mapping);
+		WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page));
+		account_page_dirtied(page, mapping);
+		radix_tree_tag_set(&mapping->page_tree, page_index(page),
+				   PAGECACHE_TAG_DIRTY);
 		spin_unlock_irqrestore(&mapping->tree_lock, flags);
 		if (mapping->host) {
 			/* !PageAnon && !swapper_space */
@@ -2325,12 +2308,10 @@ int clear_page_dirty_for_io(struct page *page)
 		/*
 		 * We carefully synchronise fault handlers against
 		 * installing a dirty pte and marking the page dirty
-		 * at this point. We do this by having them hold the
-		 * page lock at some point after installing their
-		 * pte, but before marking the page dirty.
-		 * Pages are always locked coming in here, so we get
-		 * the desired exclusion. See mm/memory.c:do_wp_page()
-		 * for more comments.
+		 * at this point.  We do this by having them hold the
+		 * page lock while dirtying the page, and pages are
+		 * always locked coming in here, so we get the desired
+		 * exclusion.
 		 */
 		if (TestClearPageDirty(page)) {
 			dec_zone_page_state(page, NR_FILE_DIRTY);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 027/126] mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process being killed
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (25 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 026/126] mm: protect set_page_dirty() from ongoing truncation Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 028/126] sched/deadline: Fix migration of SCHED_DEADLINE tasks Luis Henriques
                   ` (98 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vlastimil Babka, Vladimir Davydov, Mel Gorman, Johannes Weiner,
	Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Vlastimil Babka <vbabka@suse.cz>

commit 9e5e3661727eaf960d3480213f8e87c8d67b6956 upstream.

Charles Shirron and Paul Cassella from Cray Inc have reported kswapd
stuck in a busy loop with nothing left to balance, but
kswapd_try_to_sleep() failing to sleep.  Their analysis found the cause
to be a combination of several factors:

1. A process is waiting in throttle_direct_reclaim() on pgdat->pfmemalloc_wait

2. The process has been killed (by OOM in this case), but has not yet been
   scheduled to remove itself from the waitqueue and die.

3. kswapd checks for throttled processes in prepare_kswapd_sleep():

        if (waitqueue_active(&pgdat->pfmemalloc_wait)) {
                wake_up(&pgdat->pfmemalloc_wait);
		return false; // kswapd will not go to sleep
	}

   However, for a process that was already killed, wake_up() does not remove
   the process from the waitqueue, since try_to_wake_up() checks its state
   first and returns false when the process is no longer waiting.

4. kswapd is running on the same CPU as the only CPU that the process is
   allowed to run on (through cpus_allowed, or possibly single-cpu system).

5. CONFIG_PREEMPT_NONE=y kernel is used. If there's nothing to balance, kswapd
   encounters no voluntary preemption points and repeatedly fails
   prepare_kswapd_sleep(), blocking the process from running and removing
   itself from the waitqueue, which would let kswapd sleep.

So, the source of the problem is that we prevent kswapd from going to
sleep until there are processes waiting on the pfmemalloc_wait queue,
and a process waiting on a queue is guaranteed to be removed from the
queue only when it gets scheduled.  This was done to make sure that no
process is left sleeping on pfmemalloc_wait when kswapd itself goes to
sleep.

However, it isn't necessary to postpone kswapd sleep until the
pfmemalloc_wait queue actually empties.  To prevent processes from being
left sleeping, it's actually enough to guarantee that all processes
waiting on pfmemalloc_wait queue have been woken up by the time we put
kswapd to sleep.

This patch therefore fixes this issue by substituting 'wake_up' with
'wake_up_all' and removing 'return false' in the code snippet from
prepare_kswapd_sleep() above.  Note that if any process puts itself in
the queue after this waitqueue_active() check, or after the wake up
itself, it means that the process will also wake up kswapd - and since
we are under prepare_to_wait(), the wake up won't be missed.  Also we
update the comment prepare_kswapd_sleep() to hopefully more clearly
describe the races it is preventing.

Fixes: 5515061d22f0 ("mm: throttle direct reclaimers if PF_MEMALLOC reserves are low and swap is backed by network storage")
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/vmscan.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 0f16ffe8eb67..4e4e0b893ca6 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2903,18 +2903,20 @@ static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, long remaining,
 		return false;
 
 	/*
-	 * There is a potential race between when kswapd checks its watermarks
-	 * and a process gets throttled. There is also a potential race if
-	 * processes get throttled, kswapd wakes, a large process exits therby
-	 * balancing the zones that causes kswapd to miss a wakeup. If kswapd
-	 * is going to sleep, no process should be sleeping on pfmemalloc_wait
-	 * so wake them now if necessary. If necessary, processes will wake
-	 * kswapd and get throttled again
+	 * The throttled processes are normally woken up in balance_pgdat() as
+	 * soon as pfmemalloc_watermark_ok() is true. But there is a potential
+	 * race between when kswapd checks the watermarks and a process gets
+	 * throttled. There is also a potential race if processes get
+	 * throttled, kswapd wakes, a large process exits thereby balancing the
+	 * zones, which causes kswapd to exit balance_pgdat() before reaching
+	 * the wake up checks. If kswapd is going to sleep, no process should
+	 * be sleeping on pfmemalloc_wait, so wake them now if necessary. If
+	 * the wake up is premature, processes will wake kswapd and get
+	 * throttled again. The difference from wake ups in balance_pgdat() is
+	 * that here we are under prepare_to_wait().
 	 */
-	if (waitqueue_active(&pgdat->pfmemalloc_wait)) {
-		wake_up(&pgdat->pfmemalloc_wait);
-		return false;
-	}
+	if (waitqueue_active(&pgdat->pfmemalloc_wait))
+		wake_up_all(&pgdat->pfmemalloc_wait);
 
 	return pgdat_balanced(pgdat, order, classzone_idx);
 }
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 028/126] sched/deadline: Fix migration of SCHED_DEADLINE tasks
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (26 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 027/126] mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process being killed Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 029/126] sched/deadline: Avoid double-accounting in case of missed deadlines Luis Henriques
                   ` (97 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Luca Abeni, Peter Zijlstra (Intel),
	Dario Faggioli, Linus Torvalds, Ingo Molnar, Luis Henriques

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

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

From: Luca Abeni <luca.abeni@unitn.it>

commit 6a503c3be937d275113b702e0421e5b0720abe8a upstream.

According to global EDF, tasks should be migrated between runqueues
without checking if their scheduling deadlines and runtimes are valid.
However, SCHED_DEADLINE currently performs such a check:
a migration happens doing:

	deactivate_task(rq, next_task, 0);
	set_task_cpu(next_task, later_rq->cpu);
	activate_task(later_rq, next_task, 0);

which ends up calling dequeue_task_dl(), setting the new CPU, and then
calling enqueue_task_dl().

enqueue_task_dl() then calls enqueue_dl_entity(), which calls
update_dl_entity(), which can modify scheduling deadline and runtime,
breaking global EDF scheduling.

As a result, some of the properties of global EDF are not respected:
for example, a taskset {(30, 80), (40, 80), (120, 170)} scheduled on
two cores can have unbounded response times for the third task even
if 30/80+40/80+120/170 = 1.5809 < 2

This can be fixed by invoking update_dl_entity() only in case of
wakeup, or if this is a new SCHED_DEADLINE task.

Signed-off-by: Luca Abeni <luca.abeni@unitn.it>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@gmail.com>
Cc: Dario Faggioli <raistlin@linux.it>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1418813432-20797-2-git-send-email-luca.abeni@unitn.it
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/sched/deadline.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index fc4f98b1258f..a07b08ce8307 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -823,10 +823,10 @@ enqueue_dl_entity(struct sched_dl_entity *dl_se,
 	 * parameters of the task might need updating. Otherwise,
 	 * we want a replenishment of its runtime.
 	 */
-	if (!dl_se->dl_new && flags & ENQUEUE_REPLENISH)
-		replenish_dl_entity(dl_se, pi_se);
-	else
+	if (dl_se->dl_new || flags & ENQUEUE_WAKEUP)
 		update_dl_entity(dl_se, pi_se);
+	else if (flags & ENQUEUE_REPLENISH)
+		replenish_dl_entity(dl_se, pi_se);
 
 	__enqueue_dl_entity(dl_se);
 }
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 029/126] sched/deadline: Avoid double-accounting in case of missed deadlines
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (27 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 028/126] sched/deadline: Fix migration of SCHED_DEADLINE tasks Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 030/126] HID: roccat: potential out of bounds in pyra_sysfs_write_settings() Luis Henriques
                   ` (96 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Luca Abeni, Peter Zijlstra (Intel),
	Dario Faggioli, Linus Torvalds, Ingo Molnar, Luis Henriques

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

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

From: Luca Abeni <luca.abeni@unitn.it>

commit 269ad8015a6b2bb1cf9e684da4921eb6fa0a0c88 upstream.

The dl_runtime_exceeded() function is supposed to ckeck if
a SCHED_DEADLINE task must be throttled, by checking if its
current runtime is <= 0. However, it also checks if the
scheduling deadline has been missed (the current time is
larger than the current scheduling deadline), further
decreasing the runtime if this happens.
This "double accounting" is wrong:

- In case of partitioned scheduling (or single CPU), this
  happens if task_tick_dl() has been called later than expected
  (due to small HZ values). In this case, the current runtime is
  also negative, and replenish_dl_entity() can take care of the
  deadline miss by recharging the current runtime to a value smaller
  than dl_runtime

- In case of global scheduling on multiple CPUs, scheduling
  deadlines can be missed even if the task did not consume more
  runtime than expected, hence penalizing the task is wrong

This patch fix this problem by throttling a SCHED_DEADLINE task
only when its runtime becomes negative, and not modifying the runtime

Signed-off-by: Luca Abeni <luca.abeni@unitn.it>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@gmail.com>
Cc: Dario Faggioli <raistlin@linux.it>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1418813432-20797-3-git-send-email-luca.abeni@unitn.it
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/sched/deadline.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index a07b08ce8307..d10e40862f7f 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -567,24 +567,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se)
 static
 int dl_runtime_exceeded(struct rq *rq, struct sched_dl_entity *dl_se)
 {
-	int dmiss = dl_time_before(dl_se->deadline, rq_clock(rq));
-	int rorun = dl_se->runtime <= 0;
-
-	if (!rorun && !dmiss)
-		return 0;
-
-	/*
-	 * If we are beyond our current deadline and we are still
-	 * executing, then we have already used some of the runtime of
-	 * the next instance. Thus, if we do not account that, we are
-	 * stealing bandwidth from the system at each deadline miss!
-	 */
-	if (dmiss) {
-		dl_se->runtime = rorun ? dl_se->runtime : 0;
-		dl_se->runtime -= rq_clock(rq) - dl_se->deadline;
-	}
-
-	return 1;
+	return (dl_se->runtime <= 0);
 }
 
 extern bool sched_rt_bandwidth_account(struct rt_rq *rt_rq);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 030/126] HID: roccat: potential out of bounds in pyra_sysfs_write_settings()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (28 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 029/126] sched/deadline: Avoid double-accounting in case of missed deadlines Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 031/126] mm: Don't count the stack guard page towards RLIMIT_STACK Luis Henriques
                   ` (95 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Jiri Kosina, Luis Henriques

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 606185b20caf4c57d7e41e5a5ea4aff460aef2ab upstream.

This is a static checker fix.  We write some binary settings to the
sysfs file.  One of the settings is the "->startup_profile".  There
isn't any checking to make sure it fits into the
pyra->profile_settings[] array in the profile_activated() function.

I added a check to pyra_sysfs_write_settings() in both places because
I wasn't positive that the other callers were correct.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-roccat-pyra.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c
index 1a07e07d99a0..47d7e74231e5 100644
--- a/drivers/hid/hid-roccat-pyra.c
+++ b/drivers/hid/hid-roccat-pyra.c
@@ -35,6 +35,8 @@ static struct class *pyra_class;
 static void profile_activated(struct pyra_device *pyra,
 		unsigned int new_profile)
 {
+	if (new_profile >= ARRAY_SIZE(pyra->profile_settings))
+		return;
 	pyra->actual_profile = new_profile;
 	pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi;
 }
@@ -257,9 +259,11 @@ static ssize_t pyra_sysfs_write_settings(struct file *fp,
 	if (off != 0 || count != PYRA_SIZE_SETTINGS)
 		return -EINVAL;
 
-	mutex_lock(&pyra->pyra_lock);
-
 	settings = (struct pyra_settings const *)buf;
+	if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings))
+		return -EINVAL;
+
+	mutex_lock(&pyra->pyra_lock);
 
 	retval = pyra_set_settings(usb_dev, settings);
 	if (retval) {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 031/126] mm: Don't count the stack guard page towards RLIMIT_STACK
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (29 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 030/126] HID: roccat: potential out of bounds in pyra_sysfs_write_settings() Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 032/126] mm: fix corner case in anon_vma endless growing prevention Luis Henriques
                   ` (94 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jay Foad, Linus Torvalds, Luis Henriques

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

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

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

commit 690eac53daff34169a4d74fc7bfbd388c4896abb upstream.

Commit fee7e49d4514 ("mm: propagate error from stack expansion even for
guard page") made sure that we return the error properly for stack
growth conditions.  It also theorized that counting the guard page
towards the stack limit might break something, but also said "Let's see
if anybody notices".

Somebody did notice.  Apparently android-x86 sets the stack limit very
close to the limit indeed, and including the guard page in the rlimit
check causes the android 'zygote' process problems.

So this adds the (fairly trivial) code to make the stack rlimit check be
against the actual real stack size, rather than the size of the vma that
includes the guard page.

Reported-and-tested-by: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Jay Foad <jay.foad@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/mmap.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 4813ecec5a94..9f7b97613ca4 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2060,14 +2060,17 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns
 {
 	struct mm_struct *mm = vma->vm_mm;
 	struct rlimit *rlim = current->signal->rlim;
-	unsigned long new_start;
+	unsigned long new_start, actual_size;
 
 	/* address space limit tests */
 	if (!may_expand_vm(mm, grow))
 		return -ENOMEM;
 
 	/* Stack limit test */
-	if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
+	actual_size = size;
+	if (size && (vma->vm_flags & (VM_GROWSUP | VM_GROWSDOWN)))
+		actual_size -= PAGE_SIZE;
+	if (actual_size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
 		return -ENOMEM;
 
 	/* mlock limit tests */
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 032/126] mm: fix corner case in anon_vma endless growing prevention
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (30 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 031/126] mm: Don't count the stack guard page towards RLIMIT_STACK Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 033/126] xen/arm/arm64: introduce xen_arch_need_swiotlb Luis Henriques
                   ` (93 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Konstantin Khlebnikov, Daniel Forrest, Michal Hocko,
	Linus Torvalds, Luis Henriques

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

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

From: Konstantin Khlebnikov <koct9i@gmail.com>

commit b800c91a0517071156e772d4fb329ad33590da62 upstream.

Fix for BUG_ON(anon_vma->degree) splashes in unlink_anon_vmas() ("kernel
BUG at mm/rmap.c:399!") caused by commit 7a3ef208e662 ("mm: prevent
endless growth of anon_vma hierarchy")

Anon_vma_clone() is usually called for a copy of source vma in
destination argument.  If source vma has anon_vma it should be already
in dst->anon_vma.  NULL in dst->anon_vma is used as a sign that it's
called from anon_vma_fork().  In this case anon_vma_clone() finds
anon_vma for reusing.

Vma_adjust() calls it differently and this breaks anon_vma reusing
logic: anon_vma_clone() links vma to old anon_vma and updates degree
counters but vma_adjust() overrides vma->anon_vma right after that.  As
a result final unlink_anon_vmas() decrements degree for wrong anon_vma.

This patch assigns ->anon_vma before calling anon_vma_clone().

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-and-tested-by: Chris Clayton <chris2553@googlemail.com>
Reported-and-tested-by: Oded Gabbay <oded.gabbay@amd.com>
Reported-and-tested-by: Chih-Wei Huang <cwhuang@android-x86.org>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Daniel Forrest <dan.forrest@ssec.wisc.edu>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/mmap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 9f7b97613ca4..5f0712551402 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -749,10 +749,12 @@ again:			remove_next = 1 + (end > next->vm_end);
 		if (exporter && exporter->anon_vma && !importer->anon_vma) {
 			int error;
 
+			importer->anon_vma = exporter->anon_vma;
 			error = anon_vma_clone(importer, exporter);
-			if (error)
+			if (error) {
+				importer->anon_vma = NULL;
 				return error;
-			importer->anon_vma = exporter->anon_vma;
+			}
 		}
 	}
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 033/126] xen/arm/arm64: introduce xen_arch_need_swiotlb
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (31 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 032/126] mm: fix corner case in anon_vma endless growing prevention Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 034/126] perf session: Do not fail on processing out of order event Luis Henriques
                   ` (92 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Stefano Stabellini, Luis Henriques

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

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

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

commit a4dba130891271084344c12537731542ec77cb85 upstream.

Introduce an arch specific function to find out whether a particular dma
mapping operation needs to bounce on the swiotlb buffer.

On ARM and ARM64, if the page involved is a foreign page and the device
is not coherent, we need to bounce because at unmap time we cannot
execute any required cache maintenance operations (we don't know how to
find the pfn from the mfn).

No change of behaviour for x86.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[ stefano: The commit needs to be slightly modified because
  is_device_dma_coherent is not available on kernels < 3.19, so I just
  removed the call, thus assuming that the device is not coherent on arm
  (slower but safe) ]
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ luis: backported to 3.16: used backport by stefano ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/include/asm/xen/page.h | 4 ++++
 arch/arm/xen/mm.c               | 7 +++++++
 arch/x86/include/asm/xen/page.h | 7 +++++++
 drivers/xen/swiotlb-xen.c       | 5 ++++-
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index ded062f9b358..df89aa3b1f03 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -116,4 +116,8 @@ static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn)
 #define xen_remap(cookie, size) ioremap_cache((cookie), (size))
 #define xen_unmap(cookie) iounmap((cookie))
 
+bool xen_arch_need_swiotlb(struct device *dev,
+			   unsigned long pfn,
+			   unsigned long mfn);
+
 #endif /* _ASM_ARM_XEN_PAGE_H */
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c
index b0e77de99148..f8a576b1d9bb 100644
--- a/arch/arm/xen/mm.c
+++ b/arch/arm/xen/mm.c
@@ -16,6 +16,13 @@
 #include <asm/xen/hypercall.h>
 #include <asm/xen/interface.h>
 
+bool xen_arch_need_swiotlb(struct device *dev,
+			   unsigned long pfn,
+			   unsigned long mfn)
+{
+	return (pfn != mfn);
+}
+
 int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order,
 				 unsigned int address_bits,
 				 dma_addr_t *dma_handle)
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index c949923a5668..f58ef6c0613b 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -236,4 +236,11 @@ void make_lowmem_page_readwrite(void *vaddr);
 #define xen_remap(cookie, size) ioremap((cookie), (size));
 #define xen_unmap(cookie) iounmap((cookie))
 
+static inline bool xen_arch_need_swiotlb(struct device *dev,
+					 unsigned long pfn,
+					 unsigned long mfn)
+{
+	return false;
+}
+
 #endif /* _ASM_X86_XEN_PAGE_H */
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 9df5d6ec7eec..de37cc22b9a5 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -397,7 +397,9 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
 	 * buffering it.
 	 */
 	if (dma_capable(dev, dev_addr, size) &&
-	    !range_straddles_page_boundary(phys, size) && !swiotlb_force) {
+	    !range_straddles_page_boundary(phys, size) &&
+		!xen_arch_need_swiotlb(dev, PFN_DOWN(phys), PFN_DOWN(dev_addr)) &&
+		!swiotlb_force) {
 		/* we are not interested in the dma_addr returned by
 		 * xen_dma_map_page, only in the potential cache flushes executed
 		 * by the function. */
@@ -555,6 +557,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
 		dma_addr_t dev_addr = xen_phys_to_bus(paddr);
 
 		if (swiotlb_force ||
+		    xen_arch_need_swiotlb(hwdev, PFN_DOWN(paddr), PFN_DOWN(dev_addr)) ||
 		    !dma_capable(hwdev, dev_addr, sg->length) ||
 		    range_straddles_page_boundary(paddr, sg->length)) {
 			phys_addr_t map = swiotlb_tbl_map_single(hwdev,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 034/126] perf session: Do not fail on processing out of order event
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (32 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 033/126] xen/arm/arm64: introduce xen_arch_need_swiotlb Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 035/126] fsnotify: next_i is freed during fsnotify_unmount_inodes Luis Henriques
                   ` (91 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jiri Olsa, Andi Kleen, Corey Ashford, David Ahern,
	Frederic Weisbecker, Ingo Molnar, Linus Torvalds, Matt Fleming,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	Arnaldo Carvalho de Melo, Zhiqiang Zhang, Luis Henriques

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

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

From: Jiri Olsa <jolsa@kernel.org>

commit f61ff6c06dc8f32c7036013ad802c899ec590607 upstream.

Linus reported perf report command being interrupted due to processing
of 'out of order' event, with following error:

  Timestamp below last timeslice flush
  0x5733a8 [0x28]: failed to process type: 3

I could reproduce the issue and in my case it was caused by one CPU
(mmap) being behind during record and userspace mmap reader seeing the
data after other CPUs data were already stored.

This is expected under some circumstances because we need to limit the
number of events that we queue for reordering when we receive a
PERF_RECORD_FINISHED_ROUND or when we force flush due to memory
pressure.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1417016371-30249-1-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[zhangzhiqiang: backport to 3.10:
 - adjust context
 - commit f61ff6c06d struct events_stats was defined in tools/perf/util/event.h
   while 3.10 stable defined in tools/perf/util/hist.h.
 - 3.10 stable there is no pr_oe_time() which used for debug.
 - After the above adjustments, becomes same to the original patch:
   https://github.com/torvalds/linux/commit/f61ff6c06dc8f32c7036013ad802c899ec590607
]
Signed-off-by: Zhiqiang Zhang <zhangzhiqiang.zhang@huawei.com>
[ luis: backported to 3.16: used zhangzhiqiang backport to 3.10 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 tools/perf/util/hist.h    | 1 +
 tools/perf/util/session.c | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 742f49a85725..c6d42fa4d3dd 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -47,6 +47,7 @@ struct events_stats {
 	u32 nr_invalid_chains;
 	u32 nr_unknown_id;
 	u32 nr_unprocessable_samples;
+	u32 nr_unordered_events;
 };
 
 enum hist_column {
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 64a186edc7be..7a4517c4510d 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -638,8 +638,7 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
 		return -ETIME;
 
 	if (timestamp < s->ordered_samples.last_flush) {
-		printf("Warning: Timestamp below last timeslice flush\n");
-		return -EINVAL;
+		s->stats.nr_unordered_events++;
 	}
 
 	if (!list_empty(sc)) {
@@ -1136,6 +1135,9 @@ static void perf_session__warn_about_errors(const struct perf_session *session,
 			    "Do you have a KVM guest running and not using 'perf kvm'?\n",
 			    session->stats.nr_unprocessable_samples);
 	}
+
+	if (session->stats.nr_unordered_events != 0)
+		ui__warning("%u out of order events recorded.\n", session->stats.nr_unordered_events);
 }
 
 volatile int session_done;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 035/126] fsnotify: next_i is freed during fsnotify_unmount_inodes.
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (33 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 034/126] perf session: Do not fail on processing out of order event Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 036/126] drivers/rtc/rtc-isl12057.c: fix masking of register values Luis Henriques
                   ` (90 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jerry Hoemann, Jeff Kirsher, Ken Helias, Andrew Morton,
	Linus Torvalds, Jan Kara, Luis Henriques

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

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

From: Jerry Hoemann <jerry.hoemann@hp.com>

commit 6424babfd68dd8a83d9c60a5242d27038856599f upstream.

During file system stress testing on 3.10 and 3.12 based kernels, the
umount command occasionally hung in fsnotify_unmount_inodes in the
section of code:

                spin_lock(&inode->i_lock);
                if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) {
                        spin_unlock(&inode->i_lock);
                        continue;
                }

As this section of code holds the global inode_sb_list_lock, eventually
the system hangs trying to acquire the lock.

Multiple crash dumps showed:

The inode->i_state == 0x60 and i_count == 0 and i_sb_list would point
back at itself.  As this is not the value of list upon entry to the
function, the kernel never exits the loop.

To help narrow down problem, the call to list_del_init in
inode_sb_list_del was changed to list_del.  This poisons the pointers in
the i_sb_list and causes a kernel to panic if it transverse a freed
inode.

Subsequent stress testing paniced in fsnotify_unmount_inodes at the
bottom of the list_for_each_entry_safe loop showing next_i had become
free.

We believe the root cause of the problem is that next_i is being freed
during the window of time that the list_for_each_entry_safe loop
temporarily releases inode_sb_list_lock to call fsnotify and
fsnotify_inode_delete.

The code in fsnotify_unmount_inodes attempts to prevent the freeing of
inode and next_i by calling __iget.  However, the code doesn't do the
__iget call on next_i

	if i_count == 0 or
	if i_state & (I_FREEING | I_WILL_FREE)

The patch addresses this issue by advancing next_i in the above two cases
until we either find a next_i which we can __iget or we reach the end of
the list.  This makes the handling of next_i more closely match the
handling of the variable "inode."

The time to reproduce the hang is highly variable (from hours to days.) We
ran the stress test on a 3.10 kernel with the proposed patch for a week
without failure.

During list_for_each_entry_safe, next_i is becoming free causing
the loop to never terminate.  Advance next_i in those cases where
__iget is not done.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hp.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Ken Helias <kenhelias@firemail.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/notify/inode_mark.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
index 74825be65b7b..fbb9dfb7b1d2 100644
--- a/fs/notify/inode_mark.c
+++ b/fs/notify/inode_mark.c
@@ -288,20 +288,25 @@ void fsnotify_unmount_inodes(struct list_head *list)
 		spin_unlock(&inode->i_lock);
 
 		/* In case the dropping of a reference would nuke next_i. */
-		if ((&next_i->i_sb_list != list) &&
-		    atomic_read(&next_i->i_count)) {
+		while (&next_i->i_sb_list != list) {
 			spin_lock(&next_i->i_lock);
-			if (!(next_i->i_state & (I_FREEING | I_WILL_FREE))) {
+			if (!(next_i->i_state & (I_FREEING | I_WILL_FREE)) &&
+						atomic_read(&next_i->i_count)) {
 				__iget(next_i);
 				need_iput = next_i;
+				spin_unlock(&next_i->i_lock);
+				break;
 			}
 			spin_unlock(&next_i->i_lock);
+			next_i = list_entry(next_i->i_sb_list.next,
+						struct inode, i_sb_list);
 		}
 
 		/*
-		 * We can safely drop inode_sb_list_lock here because we hold
-		 * references on both inode and next_i.  Also no new inodes
-		 * will be added since the umount has begun.
+		 * We can safely drop inode_sb_list_lock here because either
+		 * we actually hold references on both inode and next_i or
+		 * end of list.  Also no new inodes will be added since the
+		 * umount has begun.
 		 */
 		spin_unlock(&inode_sb_list_lock);
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 036/126] drivers/rtc/rtc-isl12057.c: fix masking of register values
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (34 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 035/126] fsnotify: next_i is freed during fsnotify_unmount_inodes Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 037/126] ASoC: eukrea-tlv320: Fix of_node_put() call with uninitialized object Luis Henriques
                   ` (89 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Arnaud Ebalard, Mark Rutland, Alessandro Zummo, Peter Huewe,
	Linus Walleij, Thierry Reding, Mark Brown, Grant Likely,
	Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Arnaud Ebalard <arno@natisbad.org>

commit 5945b2880363ed7648e62aabba770ec57ff2a316 upstream.

When Intersil ISL12057 support was added by commit 70e123373c05 ("rtc: Add
support for Intersil ISL12057 I2C RTC chip"), two masks for time registers
values imported from the device were either wrong or omitted, leading to
additional bits from those registers to impact read values:

 - mask for hour register value when reading it in AM/PM mode. As
   AM/PM mode is not the usual mode used by the driver, this error
   would only have an impact on an externally configured RTC hour
   later read by the driver.
 - mask for month value. The lack of masking would provide an
   erroneous value if century bit is set.

This patch fixes those two masks.

Fixes: 70e123373c05 ("rtc: Add support for Intersil ISL12057 I2C RTC chip")
Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Peter Huewe <peter.huewe@infineon.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Grant Likely <grant.likely@linaro.org>
Acked-by: Uwe Kleine-König <uwe@kleine-koenig.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>
---
 drivers/rtc/rtc-isl12057.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-isl12057.c b/drivers/rtc/rtc-isl12057.c
index 455b601d731d..8c3f60737df8 100644
--- a/drivers/rtc/rtc-isl12057.c
+++ b/drivers/rtc/rtc-isl12057.c
@@ -88,7 +88,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 	tm->tm_min = bcd2bin(regs[ISL12057_REG_RTC_MN]);
 
 	if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_MIL) { /* AM/PM */
-		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x0f);
+		tm->tm_hour = bcd2bin(regs[ISL12057_REG_RTC_HR] & 0x1f);
 		if (regs[ISL12057_REG_RTC_HR] & ISL12057_REG_RTC_HR_PM)
 			tm->tm_hour += 12;
 	} else {					    /* 24 hour mode */
@@ -97,7 +97,7 @@ static void isl12057_rtc_regs_to_tm(struct rtc_time *tm, u8 *regs)
 
 	tm->tm_mday = bcd2bin(regs[ISL12057_REG_RTC_DT]);
 	tm->tm_wday = bcd2bin(regs[ISL12057_REG_RTC_DW]) - 1; /* starts at 1 */
-	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO]) - 1; /* starts at 1 */
+	tm->tm_mon  = bcd2bin(regs[ISL12057_REG_RTC_MO] & 0x1f) - 1; /* ditto */
 	tm->tm_year = bcd2bin(regs[ISL12057_REG_RTC_YR]) + 100;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 037/126] ASoC: eukrea-tlv320: Fix of_node_put() call with uninitialized object
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (35 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 036/126] drivers/rtc/rtc-isl12057.c: fix masking of register values Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 038/126] HID: i2c-hid: Do not free buffers in i2c_hid_stop() Luis Henriques
                   ` (88 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Takashi Iwai, Mark Brown, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 077661b6ed24e530dabc9db3ab3ae48fbaf19679 upstream.

The of_node_put() call in eukrea_tlv320_probe() may take an
uninitialized pointer, as compiler spotted out:
  sound/soc/fsl/eukrea-tlv320.c:221:14: warning: 'ssi_np' may be used uninitialized in this function [-Wuninitialized]

This patch adds the proper NULL initializations as a fix.
(codec_np is also NULL initialized just for consistency.)

Fixes: 66f232908de2 ('ASoC: eukrea-tlv320: Add DT support')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/fsl/eukrea-tlv320.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c
index eb093d5b85c4..54790461f39e 100644
--- a/sound/soc/fsl/eukrea-tlv320.c
+++ b/sound/soc/fsl/eukrea-tlv320.c
@@ -105,7 +105,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
 	int ret;
 	int int_port = 0, ext_port;
 	struct device_node *np = pdev->dev.of_node;
-	struct device_node *ssi_np, *codec_np;
+	struct device_node *ssi_np = NULL, *codec_np = NULL;
 
 	eukrea_tlv320.dev = &pdev->dev;
 	if (np) {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 038/126] HID: i2c-hid: Do not free buffers in i2c_hid_stop()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (36 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 037/126] ASoC: eukrea-tlv320: Fix of_node_put() call with uninitialized object Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 039/126] ALSA: fireworks: fix an endianness bug for transaction length Luis Henriques
                   ` (87 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mika Westerberg, Jiri Kosina, Luis Henriques

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

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

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

commit 5b44c53aeb791757072be4a267255cedfff594fd upstream.

When a hid driver that uses i2c-hid as transport is unloaded, the hid core
will call i2c_hid_stop() which releases all the buffers associated with the
device. This includes also the command buffer.

Now, when the i2c-hid driver itself is unloaded it tries to power down the
device by sending it PWR_SLEEP command. Since the command buffer is already
released we get following crash:

 [   79.691459] BUG: unable to handle kernel NULL pointer dereference at           (null)
 [   79.691532] IP: [<ffffffffa05bc049>] __i2c_hid_command+0x49/0x310 [i2c_hid]
 ...
 [   79.693467] Call Trace:
 [   79.693494]  [<ffffffff810424e1>] ? __unmask_ioapic+0x21/0x30
 [   79.693537]  [<ffffffff81042855>] ? unmask_ioapic+0x25/0x40
 [   79.693581]  [<ffffffffa05bc35b>] ? i2c_hid_set_power+0x4b/0xa0 [i2c_hid]
 [   79.693632]  [<ffffffffa05bc3cf>] ? i2c_hid_runtime_resume+0x1f/0x30 [i2c_hid]
 [   79.693689]  [<ffffffff814c08fb>] ? __rpm_callback+0x2b/0x70
 [   79.693733]  [<ffffffff814c0961>] ? rpm_callback+0x21/0x90
 [   79.693776]  [<ffffffff814c0dec>] ? rpm_resume+0x41c/0x600
 [   79.693820]  [<ffffffff814c1e1c>] ? __pm_runtime_resume+0x4c/0x80
 [   79.693868]  [<ffffffff814b8588>] ? __device_release_driver+0x28/0x100
 [   79.693917]  [<ffffffff814b8d90>] ? driver_detach+0xa0/0xb0
 [   79.693959]  [<ffffffff814b82cc>] ? bus_remove_driver+0x4c/0xb0
 [   79.694006]  [<ffffffff810d1cfd>] ? SyS_delete_module+0x11d/0x1d0
 [   79.694054]  [<ffffffff8165f107>] ? int_signal+0x12/0x17
 [   79.694095]  [<ffffffff8165ee69>] ? system_call_fastpath+0x12/0x17

Fix this so that we only free buffers when the i2c-hid driver itself is
removed.

Fixes: 34f439e4afcd ("HID: i2c-hid: add runtime PM support")
Reported-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/i2c-hid/i2c-hid.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 9bce5bf4182d..c56c7388d2d6 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -706,12 +706,7 @@ static int i2c_hid_start(struct hid_device *hid)
 
 static void i2c_hid_stop(struct hid_device *hid)
 {
-	struct i2c_client *client = hid->driver_data;
-	struct i2c_hid *ihid = i2c_get_clientdata(client);
-
 	hid->claimed = 0;
-
-	i2c_hid_free_buffers(ihid);
 }
 
 static int i2c_hid_open(struct hid_device *hid)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 039/126] ALSA: fireworks: fix an endianness bug for transaction length
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (37 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 038/126] HID: i2c-hid: Do not free buffers in i2c_hid_stop() Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 040/126] mtd: nand: omap: Fix NAND enumeration on 3430 LDP Luis Henriques
                   ` (86 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Takashi Sakamoto, Takashi Iwai, Luis Henriques

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

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

From: Takashi Sakamoto <o-takashi@sakamocchi.jp>

commit 92cb46584e104e2f4b14a44959109ffe13524a26 upstream.

Although the 't->length' is a big-endian value, it's used without any
conversion. This means that the driver always uses 'length' parameter.

Fixes: 555e8a8f7f14("ALSA: fireworks: Add command/response functionality into hwdep interface")
Reported-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/firewire/fireworks/fireworks_transaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/firewire/fireworks/fireworks_transaction.c b/sound/firewire/fireworks/fireworks_transaction.c
index 255dabc6fc33..2a85e4209f0b 100644
--- a/sound/firewire/fireworks/fireworks_transaction.c
+++ b/sound/firewire/fireworks/fireworks_transaction.c
@@ -124,7 +124,7 @@ copy_resp_to_buf(struct snd_efw *efw, void *data, size_t length, int *rcode)
 	spin_lock_irq(&efw->lock);
 
 	t = (struct snd_efw_transaction *)data;
-	length = min_t(size_t, t->length * sizeof(t->length), length);
+	length = min_t(size_t, be32_to_cpu(t->length) * sizeof(u32), length);
 
 	if (efw->push_ptr < efw->pull_ptr)
 		capacity = (unsigned int)(efw->pull_ptr - efw->push_ptr);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 040/126] mtd: nand: omap: Fix NAND enumeration on 3430 LDP
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (38 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 039/126] ALSA: fireworks: fix an endianness bug for transaction length Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 041/126] ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file Luis Henriques
                   ` (85 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Roger Quadros, Brian Norris, Luis Henriques

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

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

From: Roger Quadros <rogerq@ti.com>

commit 775a9134f4398ca98a10af8cc3cf9b664017267f upstream.

3430LDP has NAND flash with 32 bytes OOB size which is sufficient to hold
BCH8 codes but the small page check introduced in
commit b491da7233d5 ("mtd: nand: omap: clean-up ecc layout for BCH ecc schemes")
considers anything below 64 bytes unsuitable for BCH4/8/16. There is another
bug in that code where it doesn't skip the check for OMAP_ECC_HAM1_CODE_SW.

Get rid of that small page check code as it is insufficient and redundant
because we are checking for OOB available bytes vs ecc layout before calling
nand_scan_tail().

Fixes: b491da7233d5 ("mtd: nand: omap: clean-up ecc layout for BCH ecc schemes")

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mtd/nand/omap2.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index e2b9b345177a..575a015c8394 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1700,13 +1700,6 @@ static int omap_nand_probe(struct platform_device *pdev)
 		goto return_error;
 	}
 
-	/* check for small page devices */
-	if ((mtd->oobsize < 64) && (pdata->ecc_opt != OMAP_ECC_HAM1_CODE_HW)) {
-		pr_err("small page devices are not supported\n");
-		err = -EINVAL;
-		goto return_error;
-	}
-
 	/* re-populate low-level callbacks based on xfer modes */
 	switch (pdata->xfer_type) {
 	case NAND_OMAP_PREFETCH_POLLED:
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 041/126] ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (39 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 040/126] mtd: nand: omap: Fix NAND enumeration on 3430 LDP Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 042/126] powerpc: Fix bad NULL pointer check in udbg_uart_getc_poll() Luis Henriques
                   ` (84 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: joyce.xue, Mark Fasheh, Joel Becker, Andrew Morton,
	Linus Torvalds, Luis Henriques

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

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

From: Xue jiufei <xuejiufei@huawei.com>

commit 53dc20b9a3d928b0744dad5aee65b610de1cc85d upstream.

In ocfs2_link(), the parent directory inode passed to function
ocfs2_lookup_ino_from_name() is wrong.  Parameter dir is the parent of
new_dentry not old_dentry.  We should get old_dir from old_dentry and
lookup old_dentry in old_dir in case another node remove the old dentry.

With this change, hard linking works again, when paths are relative with
at least one subdirectory.  This is how the problem was reproducable:

  # mkdir a
  # mkdir b
  # touch a/test
  # ln a/test b/test
  ln: failed to create hard link `b/test' => `a/test': No such file or  directory

However when creating links in the same dir, it worked well.

Now the link gets created.

Fixes: 0e048316ff57 ("ocfs2: check existence of old dentry in ocfs2_link()")
Signed-off-by: joyce.xue <xuejiufei@huawei.com>
Reported-by: Szabo Aron - UBIT <aron@ubit.hu>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Tested-by: Aron Szabo <aron@ubit.hu>
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/ocfs2/namei.c | 43 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 35 insertions(+), 8 deletions(-)

diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 8add6f1030d7..a997d7f40608 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -94,6 +94,14 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb,
 				     struct inode *inode,
 				     const char *symname);
 
+static int ocfs2_double_lock(struct ocfs2_super *osb,
+			     struct buffer_head **bh1,
+			     struct inode *inode1,
+			     struct buffer_head **bh2,
+			     struct inode *inode2,
+			     int rename);
+
+static void ocfs2_double_unlock(struct inode *inode1, struct inode *inode2);
 /* An orphan dir name is an 8 byte value, printed as a hex string */
 #define OCFS2_ORPHAN_NAMELEN ((int)(2 * sizeof(u64)))
 
@@ -678,8 +686,10 @@ static int ocfs2_link(struct dentry *old_dentry,
 {
 	handle_t *handle;
 	struct inode *inode = old_dentry->d_inode;
+	struct inode *old_dir = old_dentry->d_parent->d_inode;
 	int err;
 	struct buffer_head *fe_bh = NULL;
+	struct buffer_head *old_dir_bh = NULL;
 	struct buffer_head *parent_fe_bh = NULL;
 	struct ocfs2_dinode *fe = NULL;
 	struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
@@ -696,19 +706,33 @@ static int ocfs2_link(struct dentry *old_dentry,
 
 	dquot_initialize(dir);
 
-	err = ocfs2_inode_lock_nested(dir, &parent_fe_bh, 1, OI_LS_PARENT);
+	err = ocfs2_double_lock(osb, &old_dir_bh, old_dir,
+			&parent_fe_bh, dir, 0);
 	if (err < 0) {
 		if (err != -ENOENT)
 			mlog_errno(err);
 		return err;
 	}
 
+	/* make sure both dirs have bhs
+	 * get an extra ref on old_dir_bh if old==new */
+	if (!parent_fe_bh) {
+		if (old_dir_bh) {
+			parent_fe_bh = old_dir_bh;
+			get_bh(parent_fe_bh);
+		} else {
+			mlog(ML_ERROR, "%s: no old_dir_bh!\n", osb->uuid_str);
+			err = -EIO;
+			goto out;
+		}
+	}
+
 	if (!dir->i_nlink) {
 		err = -ENOENT;
 		goto out;
 	}
 
-	err = ocfs2_lookup_ino_from_name(dir, old_dentry->d_name.name,
+	err = ocfs2_lookup_ino_from_name(old_dir, old_dentry->d_name.name,
 			old_dentry->d_name.len, &old_de_ino);
 	if (err) {
 		err = -ENOENT;
@@ -801,10 +825,11 @@ out_unlock_inode:
 	ocfs2_inode_unlock(inode, 1);
 
 out:
-	ocfs2_inode_unlock(dir, 1);
+	ocfs2_double_unlock(old_dir, dir);
 
 	brelse(fe_bh);
 	brelse(parent_fe_bh);
+	brelse(old_dir_bh);
 
 	ocfs2_free_dir_lookup_result(&lookup);
 
@@ -1072,14 +1097,15 @@ static int ocfs2_check_if_ancestor(struct ocfs2_super *osb,
 }
 
 /*
- * The only place this should be used is rename!
+ * The only place this should be used is rename and link!
  * if they have the same id, then the 1st one is the only one locked.
  */
 static int ocfs2_double_lock(struct ocfs2_super *osb,
 			     struct buffer_head **bh1,
 			     struct inode *inode1,
 			     struct buffer_head **bh2,
-			     struct inode *inode2)
+			     struct inode *inode2,
+			     int rename)
 {
 	int status;
 	int inode1_is_ancestor, inode2_is_ancestor;
@@ -1127,7 +1153,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
 		}
 		/* lock id2 */
 		status = ocfs2_inode_lock_nested(inode2, bh2, 1,
-						 OI_LS_RENAME1);
+				rename == 1 ? OI_LS_RENAME1 : OI_LS_PARENT);
 		if (status < 0) {
 			if (status != -ENOENT)
 				mlog_errno(status);
@@ -1136,7 +1162,8 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
 	}
 
 	/* lock id1 */
-	status = ocfs2_inode_lock_nested(inode1, bh1, 1, OI_LS_RENAME2);
+	status = ocfs2_inode_lock_nested(inode1, bh1, 1,
+			rename == 1 ?  OI_LS_RENAME2 : OI_LS_PARENT);
 	if (status < 0) {
 		/*
 		 * An error return must mean that no cluster locks
@@ -1252,7 +1279,7 @@ static int ocfs2_rename(struct inode *old_dir,
 
 	/* if old and new are the same, this'll just do one lock. */
 	status = ocfs2_double_lock(osb, &old_dir_bh, old_dir,
-				   &new_dir_bh, new_dir);
+				   &new_dir_bh, new_dir, 1);
 	if (status < 0) {
 		mlog_errno(status);
 		goto bail;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 042/126] powerpc: Fix bad NULL pointer check in udbg_uart_getc_poll()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (40 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 041/126] ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 043/126] HID: add battery quirk for USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO keyboard Luis Henriques
                   ` (83 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anton Blanchard, Michael Ellerman, Luis Henriques

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

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

From: Anton Blanchard <anton@samba.org>

commit cd32e2dcc9de6c27ecbbfc0e2079fb64b42bad5f upstream.

We have some code in udbg_uart_getc_poll() that tries to protect
against a NULL udbg_uart_in, but gets it all wrong.

Found with the LLVM static analyzer (scan-build).

Fixes: 309257484cc1 ("powerpc: Cleanup udbg_16550 and add support for LPC PIO-only UARTs")
Signed-off-by: Anton Blanchard <anton@samba.org>
[mpe: Add some newlines for readability while we're here]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/kernel/udbg_16550.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 6e7c4923b5ea..411116c38da4 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -69,8 +69,12 @@ static void udbg_uart_putc(char c)
 
 static int udbg_uart_getc_poll(void)
 {
-	if (!udbg_uart_in || !(udbg_uart_in(UART_LSR) & LSR_DR))
+	if (!udbg_uart_in)
+		return -1;
+
+	if (!(udbg_uart_in(UART_LSR) & LSR_DR))
 		return udbg_uart_in(UART_RBR);
+
 	return -1;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 043/126] HID: add battery quirk for USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO keyboard
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (41 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 042/126] powerpc: Fix bad NULL pointer check in udbg_uart_getc_poll() Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 044/126] ALSA: hda - using uninitialized data Luis Henriques
                   ` (82 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Karl Relton, Jiri Kosina, Luis Henriques

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

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

From: Karl Relton <karllinuxtest.relton@ntlworld.com>

commit da940db41dcf8c04166f711646df2f35376010aa upstream.

Apple bluetooth wireless keyboard (sold in UK) has always reported zero
for battery strength no matter what condition the batteries are actually
in. With this patch applied (applying same quirk as other Apple
keyboards), the battery strength is now correctly reported.

Signed-off-by: Karl Relton <karllinuxtest.relton@ntlworld.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-input.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 62e828655922..89ce91883eba 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -312,6 +312,9 @@ static const struct hid_device_id hid_battery_quirks[] = {
 			       USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI),
 	  HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
+			       USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO),
+	  HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
 		USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI),
 	  HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
 	{}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 044/126] ALSA: hda - using uninitialized data
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (42 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 043/126] HID: add battery quirk for USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO keyboard Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 045/126] nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races Luis Henriques
                   ` (81 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Takashi Iwai, Luis Henriques

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 69eba10e606a80665f8573221fec589430d9d1cb upstream.

In olden times the snd_hda_param_read() function always set "*start_id"
but in 2007 we introduced a new return and it causes uninitialized data
bugs in a couple of the callers: print_codec_info() and
hdmi_parse_codec().

Fixes: e8a7f136f5ed ('[ALSA] hda-intel - Improve HD-audio codec probing robustness')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/hda_codec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 4c20277a6835..fb9497a0062a 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -338,8 +338,10 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid,
 	unsigned int parm;
 
 	parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT);
-	if (parm == -1)
+	if (parm == -1) {
+		*start_id = 0;
 		return 0;
+	}
 	*start_id = (parm >> 16) & 0x7fff;
 	return (int)(parm & 0x7fff);
 }
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 045/126] nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (43 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 044/126] ALSA: hda - using uninitialized data Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 046/126] scripts/kernel-doc: don't eat struct members with __aligned Luis Henriques
                   ` (80 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ryusuke Konishi, Al Viro, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>

commit 705304a863cc41585508c0f476f6d3ec28cf7e00 upstream.

Same story as in commit 41080b5a2401 ("nfsd race fixes: ext2") (similar
ext2 fix) except that nilfs2 needs to use insert_inode_locked4() instead
of insert_inode_locked() and a bug of a check for dead inodes needs to
be fixed.

If nilfs_iget() is called from nfsd after nilfs_new_inode() calls
insert_inode_locked4(), nilfs_iget() will wait for unlock_new_inode() at
the end of nilfs_mkdir()/nilfs_create()/etc to unlock the inode.

If nilfs_iget() is called before nilfs_new_inode() calls
insert_inode_locked4(), it will create an in-core inode and read its
data from the on-disk inode.  But, nilfs_iget() will find i_nlink equals
zero and fail at nilfs_read_inode_common(), which will lead it to call
iget_failed() and cleanly fail.

However, this sanity check doesn't work as expected for reused on-disk
inodes because they leave a non-zero value in i_mode field and it
hinders the test of i_nlink.  This patch also fixes the issue by
removing the test on i_mode that nilfs2 doesn't need.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Al Viro <viro@zeniv.linux.org.uk>
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/nilfs2/inode.c | 32 ++++++++++++++++++++++++--------
 fs/nilfs2/namei.c | 15 ++++++++++++---
 2 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index d071e7f23de2..31b6b2953c59 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -49,6 +49,8 @@ struct nilfs_iget_args {
 	int for_gc;
 };
 
+static int nilfs_iget_test(struct inode *inode, void *opaque);
+
 void nilfs_inode_add_blocks(struct inode *inode, int n)
 {
 	struct nilfs_root *root = NILFS_I(inode)->i_root;
@@ -348,6 +350,17 @@ const struct address_space_operations nilfs_aops = {
 	.is_partially_uptodate  = block_is_partially_uptodate,
 };
 
+static int nilfs_insert_inode_locked(struct inode *inode,
+				     struct nilfs_root *root,
+				     unsigned long ino)
+{
+	struct nilfs_iget_args args = {
+		.ino = ino, .root = root, .cno = 0, .for_gc = 0
+	};
+
+	return insert_inode_locked4(inode, ino, nilfs_iget_test, &args);
+}
+
 struct inode *nilfs_new_inode(struct inode *dir, umode_t mode)
 {
 	struct super_block *sb = dir->i_sb;
@@ -383,7 +396,7 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode)
 	if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) {
 		err = nilfs_bmap_read(ii->i_bmap, NULL);
 		if (err < 0)
-			goto failed_bmap;
+			goto failed_after_creation;
 
 		set_bit(NILFS_I_BMAP, &ii->i_state);
 		/* No lock is needed; iget() ensures it. */
@@ -399,21 +412,24 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode)
 	spin_lock(&nilfs->ns_next_gen_lock);
 	inode->i_generation = nilfs->ns_next_generation++;
 	spin_unlock(&nilfs->ns_next_gen_lock);
-	insert_inode_hash(inode);
+	if (nilfs_insert_inode_locked(inode, root, ino) < 0) {
+		err = -EIO;
+		goto failed_after_creation;
+	}
 
 	err = nilfs_init_acl(inode, dir);
 	if (unlikely(err))
-		goto failed_acl; /* never occur. When supporting
+		goto failed_after_creation; /* never occur. When supporting
 				    nilfs_init_acl(), proper cancellation of
 				    above jobs should be considered */
 
 	return inode;
 
- failed_acl:
- failed_bmap:
+ failed_after_creation:
 	clear_nlink(inode);
+	unlock_new_inode(inode);
 	iput(inode);  /* raw_inode will be deleted through
-			 generic_delete_inode() */
+			 nilfs_evict_inode() */
 	goto failed;
 
  failed_ifile_create_inode:
@@ -461,8 +477,8 @@ int nilfs_read_inode_common(struct inode *inode,
 	inode->i_atime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec);
 	inode->i_ctime.tv_nsec = le32_to_cpu(raw_inode->i_ctime_nsec);
 	inode->i_mtime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec);
-	if (inode->i_nlink == 0 && inode->i_mode == 0)
-		return -EINVAL; /* this inode is deleted */
+	if (inode->i_nlink == 0)
+		return -ESTALE; /* this inode is deleted */
 
 	inode->i_blocks = le64_to_cpu(raw_inode->i_blocks);
 	ii->i_flags = le32_to_cpu(raw_inode->i_flags);
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index 9de78f08989e..0f84b257932c 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -51,9 +51,11 @@ static inline int nilfs_add_nondir(struct dentry *dentry, struct inode *inode)
 	int err = nilfs_add_link(dentry, inode);
 	if (!err) {
 		d_instantiate(dentry, inode);
+		unlock_new_inode(inode);
 		return 0;
 	}
 	inode_dec_link_count(inode);
+	unlock_new_inode(inode);
 	iput(inode);
 	return err;
 }
@@ -182,6 +184,7 @@ out:
 out_fail:
 	drop_nlink(inode);
 	nilfs_mark_inode_dirty(inode);
+	unlock_new_inode(inode);
 	iput(inode);
 	goto out;
 }
@@ -201,11 +204,15 @@ static int nilfs_link(struct dentry *old_dentry, struct inode *dir,
 	inode_inc_link_count(inode);
 	ihold(inode);
 
-	err = nilfs_add_nondir(dentry, inode);
-	if (!err)
+	err = nilfs_add_link(dentry, inode);
+	if (!err) {
+		d_instantiate(dentry, inode);
 		err = nilfs_transaction_commit(dir->i_sb);
-	else
+	} else {
+		inode_dec_link_count(inode);
+		iput(inode);
 		nilfs_transaction_abort(dir->i_sb);
+	}
 
 	return err;
 }
@@ -243,6 +250,7 @@ static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 
 	nilfs_mark_inode_dirty(inode);
 	d_instantiate(dentry, inode);
+	unlock_new_inode(inode);
 out:
 	if (!err)
 		err = nilfs_transaction_commit(dir->i_sb);
@@ -255,6 +263,7 @@ out_fail:
 	drop_nlink(inode);
 	drop_nlink(inode);
 	nilfs_mark_inode_dirty(inode);
+	unlock_new_inode(inode);
 	iput(inode);
 out_dir:
 	drop_nlink(dir);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 046/126] scripts/kernel-doc: don't eat struct members with __aligned
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (44 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 045/126] nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 047/126] ARM: dts: DRA7: wdt: Fix compatible property for watchdog node Luis Henriques
                   ` (79 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johannes Berg, Nishanth Menon, Randy Dunlap, Michal Marek,
	Andrew Morton, Linus Torvalds, Luis Henriques

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

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

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

commit 7b990789a4c3420fa57596b368733158e432d444 upstream.

The change from \d+ to .+ inside __aligned() means that the following
structure:

  struct test {
        u8 a __aligned(2);
        u8 b __aligned(2);
  };

essentially gets modified to

  struct test {
        u8 a;
  };

for purposes of kernel-doc, thus dropping a struct member, which in
turns causes warnings and invalid kernel-doc generation.

Fix this by replacing the catch-all (".") with anything that's not a
semicolon ("[^;]").

Fixes: 9dc30918b23f ("scripts/kernel-doc: handle struct member __aligned without numbers")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Michal Marek <mmarek@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>
---
 scripts/kernel-doc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 16a07cfa4d34..f2b1bf2f0608 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1753,7 +1753,7 @@ sub dump_struct($$) {
 	# strip kmemcheck_bitfield_{begin,end}.*;
 	$members =~ s/kmemcheck_bitfield_.*?;//gos;
 	# strip attributes
-	$members =~ s/__aligned\s*\(.+\)//gos;
+	$members =~ s/__aligned\s*\([^;]*\)//gos;
 
 	create_parameterlist($members, ';', $file);
 	check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 047/126] ARM: dts: DRA7: wdt: Fix compatible property for watchdog node
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (45 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 046/126] scripts/kernel-doc: don't eat struct members with __aligned Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 048/126] ARM: dts: Enable PWM node by default for s3c64xx Luis Henriques
                   ` (78 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lokesh Vutla, Tony Lindgren, Luis Henriques

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

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

From: Lokesh Vutla <lokeshvutla@ti.com>

commit be6688350a4470e417aaeca54d162652aab40ac5 upstream.

OMAP wdt driver supports only ti,omap3-wdt compatible. In DRA7 dt
wdt compatible property is defined as ti,omap4-wdt by mistake instead of
ti,omap3-wdt. Correcting the typo.

Fixes: 6e58b8f1daaf1a ("ARM: dts: DRA7: Add the dts files for dra7 SoC and dra7-evm board")
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/dra7.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index f21ef396902f..e46073edcfd4 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -452,7 +452,7 @@
 		};
 
 		wdt2: wdt@4ae14000 {
-			compatible = "ti,omap4-wdt";
+			compatible = "ti,omap3-wdt";
 			reg = <0x4ae14000 0x80>;
 			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
 			ti,hwmods = "wd_timer2";
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 048/126] ARM: dts: Enable PWM node by default for s3c64xx
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (46 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 047/126] ARM: dts: DRA7: wdt: Fix compatible property for watchdog node Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 049/126] ARM: OMAP4: PM: Only do static dependency configuration in omap4_init_static_deps Luis Henriques
                   ` (77 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tomasz Figa, Kukjin Kim, Luis Henriques

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

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

From: Tomasz Figa <tomasz.figa@gmail.com>

commit 5e794de514f56de1e78e979ca09c56a91aa2e9f1 upstream.

The PWM block is required for system clock source so it must be always
enabled. This patch fixes boot issues on SMDK6410 which did not have
the node enabled explicitly for other purposes.

Fixes: eeb93d02 ("clocksource: of: Respect device tree node status")

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/s3c6410-mini6410.dts | 4 ----
 arch/arm/boot/dts/s3c64xx.dtsi         | 1 -
 2 files changed, 5 deletions(-)

diff --git a/arch/arm/boot/dts/s3c6410-mini6410.dts b/arch/arm/boot/dts/s3c6410-mini6410.dts
index 57e00f9bce99..a25debb50401 100644
--- a/arch/arm/boot/dts/s3c6410-mini6410.dts
+++ b/arch/arm/boot/dts/s3c6410-mini6410.dts
@@ -198,10 +198,6 @@
 	status = "okay";
 };
 
-&pwm {
-	status = "okay";
-};
-
 &pinctrl0 {
 	gpio_leds: gpio-leds {
 		samsung,pins = "gpk-4", "gpk-5", "gpk-6", "gpk-7";
diff --git a/arch/arm/boot/dts/s3c64xx.dtsi b/arch/arm/boot/dts/s3c64xx.dtsi
index 4e3be4d3493d..4f1eff3420f6 100644
--- a/arch/arm/boot/dts/s3c64xx.dtsi
+++ b/arch/arm/boot/dts/s3c64xx.dtsi
@@ -168,7 +168,6 @@
 			clocks = <&clocks PCLK_PWM>;
 			samsung,pwm-outputs = <0>, <1>;
 			#pwm-cells = <3>;
-			status = "disabled";
 		};
 
 		pinctrl0: pinctrl@7f008000 {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 049/126] ARM: OMAP4: PM: Only do static dependency configuration in omap4_init_static_deps
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (47 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 048/126] ARM: dts: Enable PWM node by default for s3c64xx Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 050/126] Revert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo" Luis Henriques
                   ` (76 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nishanth Menon, Tony Lindgren, Luis Henriques

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

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

From: Nishanth Menon <nm@ti.com>

commit 9008d83fe9dc2e0f19b8ba17a423b3759d8e0fd7 upstream.

Commit 705814b5ea6f ("ARM: OMAP4+: PM: Consolidate OMAP4 PM code to
re-use it for OMAP5")

Moved logic generic for OMAP5+ as part of the init routine by
introducing omap4_pm_init. However, the patch left the powerdomain
initial setup, an unused omap4430 es1.0 check and a spurious log
"Power Management for TI OMAP4." in the original code.

Remove the duplicate code which is already present in omap4_pm_init from
omap4_init_static_deps.

As part of this change, also move the u-boot version print out of the
static dependency function to the omap4_pm_init function.

Fixes: 705814b5ea6f ("ARM: OMAP4+: PM: Consolidate OMAP4 PM code to re-use it for OMAP5")
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-omap2/pm44xx.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 0dda6cf8b855..05213880c972 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -150,26 +150,6 @@ static inline int omap4_init_static_deps(void)
 	struct clockdomain *ducati_clkdm, *l3_2_clkdm;
 	int ret = 0;
 
-	if (omap_rev() == OMAP4430_REV_ES1_0) {
-		WARN(1, "Power Management not supported on OMAP4430 ES1.0\n");
-		return -ENODEV;
-	}
-
-	pr_err("Power Management for TI OMAP4.\n");
-	/*
-	 * OMAP4 chip PM currently works only with certain (newer)
-	 * versions of bootloaders. This is due to missing code in the
-	 * kernel to properly reset and initialize some devices.
-	 * http://www.spinics.net/lists/arm-kernel/msg218641.html
-	 */
-	pr_warn("OMAP4 PM: u-boot >= v2012.07 is required for full PM support\n");
-
-	ret = pwrdm_for_each(pwrdms_setup, NULL);
-	if (ret) {
-		pr_err("Failed to setup powerdomains\n");
-		return ret;
-	}
-
 	/*
 	 * The dynamic dependency between MPUSS -> MEMIF and
 	 * MPUSS -> L4_PER/L3_* and DUCATI -> L3_* doesn't work as
@@ -233,6 +213,15 @@ int __init omap4_pm_init(void)
 
 	pr_info("Power Management for TI OMAP4+ devices.\n");
 
+	/*
+	 * OMAP4 chip PM currently works only with certain (newer)
+	 * versions of bootloaders. This is due to missing code in the
+	 * kernel to properly reset and initialize some devices.
+	 * http://www.spinics.net/lists/arm-kernel/msg218641.html
+	 */
+	if (cpu_is_omap44xx())
+		pr_warn("OMAP4 PM: u-boot >= v2012.07 is required for full PM support\n");
+
 	ret = pwrdm_for_each(pwrdms_setup, NULL);
 	if (ret) {
 		pr_err("Failed to setup powerdomains.\n");
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 050/126] Revert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo"
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (48 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 049/126] ARM: OMAP4: PM: Only do static dependency configuration in omap4_init_static_deps Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 051/126] HID: Add a new id 0x501a for Genius MousePen i608X Luis Henriques
                   ` (75 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Pavel Machek, Linus Torvalds, Luis Henriques

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

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

From: Pavel Machek <pavel@ucw.cz>

commit 4bf9636c39ac70da091d5a2e28d3448eaa7f115c upstream.

Commit 9fc2105aeaaf ("ARM: 7830/1: delay: don't bother reporting
bogomips in /proc/cpuinfo") breaks audio in python, and probably
elsewhere, with message

  FATAL: cannot locate cpu MHz in /proc/cpuinfo

I'm not the first one to hit it, see for example

  https://theredblacktree.wordpress.com/2014/08/10/fatal-cannot-locate-cpu-mhz-in-proccpuinfo/
  https://devtalk.nvidia.com/default/topic/765800/workaround-for-fatal-cannot-locate-cpu-mhz-in-proc-cpuinf/?offset=1

Reading original changelog, I have to say "Stop breaking working setups.
You know who you are!".

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/kernel/setup.c |  9 +++++++++
 arch/arm/kernel/smp.c   | 13 +++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 8a16ee5d8a95..acc83bb69476 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1022,6 +1022,15 @@ static int c_show(struct seq_file *m, void *v)
 		seq_printf(m, "model name\t: %s rev %d (%s)\n",
 			   cpu_name, cpuid & 15, elf_platform);
 
+#if defined(CONFIG_SMP)
+		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
+			   per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
+			   (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
+#else
+		seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
+			   loops_per_jiffy / (500000/HZ),
+			   (loops_per_jiffy / (5000/HZ)) % 100);
+#endif
 		/* dump out the processor features */
 		seq_puts(m, "Features\t: ");
 
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 7c4fada440f0..2eba35c2b860 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -388,8 +388,17 @@ asmlinkage void secondary_start_kernel(void)
 
 void __init smp_cpus_done(unsigned int max_cpus)
 {
-	printk(KERN_INFO "SMP: Total of %d processors activated.\n",
-	       num_online_cpus());
+	int cpu;
+	unsigned long bogosum = 0;
+
+	for_each_online_cpu(cpu)
+		bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
+
+	printk(KERN_INFO "SMP: Total of %d processors activated "
+	       "(%lu.%02lu BogoMIPS).\n",
+	       num_online_cpus(),
+	       bogosum / (500000/HZ),
+	       (bogosum / (5000/HZ)) % 100);
 
 	hyp_mode_check();
 }
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 051/126] HID: Add a new id 0x501a for Genius MousePen i608X
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (49 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 050/126] Revert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo" Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 052/126] netfilter: ipset: small potential read beyond the end of buffer Luis Henriques
                   ` (74 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Giedrius Statkevičius, Jiri Kosina, Luis Henriques

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

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

From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?=

commit 2bacedada682d5485424f5227f27a3d5d6eb551c upstream.

New Genius MousePen i608X devices have a new id 0x501a instead of the
old 0x5011 so add a new #define with "_2" appended and change required
places.

The remaining two checkpatch warnings about line length
being over 80 characters are present in the original files too and this
patch was made in the same style (no line break).

Just adding a new id and changing the required places should make the
new device work without any issues according to the bug report in the
following url.

This patch was made according to and fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=67111

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hid/hid-core.c          | 1 +
 drivers/hid/hid-ids.h           | 1 +
 drivers/hid/hid-kye.c           | 4 ++++
 drivers/hid/usbhid/hid-quirks.c | 1 +
 4 files changed, 7 insertions(+)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8ed66fd1ea87..85f70c62b3ab 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1793,6 +1793,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index ab9d3da01930..1bda12b7af69 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -523,6 +523,7 @@
 #define USB_DEVICE_ID_KYE_GPEN_560	0x5003
 #define USB_DEVICE_ID_KYE_EASYPEN_I405X	0x5010
 #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X	0x5011
+#define USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2	0x501a
 #define USB_DEVICE_ID_KYE_EASYPEN_M610X	0x5013
 
 #define USB_VENDOR_ID_LABTEC		0x1020
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c
index b92bf01a1ae8..158fcf577fae 100644
--- a/drivers/hid/hid-kye.c
+++ b/drivers/hid/hid-kye.c
@@ -323,6 +323,7 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 		}
 		break;
 	case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
+	case USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2:
 		if (*rsize == MOUSEPEN_I608X_RDESC_ORIG_SIZE) {
 			rdesc = mousepen_i608x_rdesc_fixed;
 			*rsize = sizeof(mousepen_i608x_rdesc_fixed);
@@ -415,6 +416,7 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	switch (id->product) {
 	case USB_DEVICE_ID_KYE_EASYPEN_I405X:
 	case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
+	case USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2:
 	case USB_DEVICE_ID_KYE_EASYPEN_M610X:
 		ret = kye_tablet_enable(hdev);
 		if (ret) {
@@ -446,6 +448,8 @@ static const struct hid_device_id kye_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
 				USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
+				USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
 				USB_DEVICE_ID_KYE_EASYPEN_M610X) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
 				USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) },
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 7f16acb84f90..f10dffa795cd 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -123,6 +123,7 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
+	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
 	{ USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD, HID_QUIRK_NO_INIT_REPORTS },
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 052/126] netfilter: ipset: small potential read beyond the end of buffer
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (50 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 051/126] HID: Add a new id 0x501a for Genius MousePen i608X Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 053/126] bridge: fix netfilter/NF_BR_LOCAL_OUT for own, locally generated queries Luis Henriques
                   ` (73 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Pablo Neira Ayuso, Luis Henriques

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

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

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 2196937e12b1b4ba139806d132647e1651d655df upstream.

We could be reading 8 bytes into a 4 byte buffer here.  It seems
harmless but adding a check is the right thing to do and it silences a
static checker warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/netfilter/ipset/ip_set_core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 6582dce828b5..6850c3c4d6d3 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -1838,6 +1838,12 @@ ip_set_sockfn_get(struct sock *sk, int optval, void __user *user, int *len)
 	if (*op < IP_SET_OP_VERSION) {
 		/* Check the version at the beginning of operations */
 		struct ip_set_req_version *req_version = data;
+
+		if (*len < sizeof(struct ip_set_req_version)) {
+			ret = -EINVAL;
+			goto done;
+		}
+
 		if (req_version->version != IPSET_PROTOCOL) {
 			ret = -EPROTO;
 			goto done;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 053/126] bridge: fix netfilter/NF_BR_LOCAL_OUT for own, locally generated queries
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (51 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 052/126] netfilter: ipset: small potential read beyond the end of buffer Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 054/126] bcache: Make sure to pass GFP_WAIT to mempool_alloc() Luis Henriques
                   ` (72 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Lüssing, Pablo Neira Ayuso, Luis Henriques

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

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

From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@web.de>

commit f0b4eeced518c632210ef2aea44fc92cc9e86cce upstream.

Ebtables on the OUTPUT chain (NF_BR_LOCAL_OUT) would not work as expected
for both locally generated IGMP and MLD queries. The IP header specific
filter options are off by 14 Bytes for netfilter (actual output on
interfaces is fine).

NF_HOOK() expects the skb->data to point to the IP header, not the
ethernet one (while dev_queue_xmit() does not). Luckily there is an
br_dev_queue_push_xmit() helper function already - let's just use that.

Introduced by eb1d16414339a6e113d89e2cca2556005d7ce919
("bridge: Add core IGMP snooping support")

Ebtables example:

$ ebtables -I OUTPUT -p IPv6 -o eth1 --logical-out br0 \
	--log --log-level 6 --log-ip6 --log-prefix="~EBT: " -j DROP

before (broken):

~EBT:  IN= OUT=eth1 MAC source = 02:04:64:a4:39:c2 \
	MAC dest = 33:33:00:00:00:01 proto = 0x86dd IPv6 \
	SRC=64a4:39c2:86dd:6000:0000:0020:0001:fe80 IPv6 \
	DST=0000:0000:0000:0004:64ff:fea4:39c2:ff02, \
	IPv6 priority=0x3, Next Header=2

after (working):

~EBT:  IN= OUT=eth1 MAC source = 02:04:64:a4:39:c2 \
	MAC dest = 33:33:00:00:00:01 proto = 0x86dd IPv6 \
	SRC=fe80:0000:0000:0000:0004:64ff:fea4:39c2 IPv6 \
	DST=ff02:0000:0000:0000:0000:0000:0000:0001, \
	IPv6 priority=0x0, Next Header=0

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/bridge/br_multicast.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index abfa0b65a111..eb73398dd237 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -813,10 +813,9 @@ static void __br_multicast_send_query(struct net_bridge *br,
 		return;
 
 	if (port) {
-		__skb_push(skb, sizeof(struct ethhdr));
 		skb->dev = port->dev;
 		NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
-			dev_queue_xmit);
+			br_dev_queue_push_xmit);
 	} else {
 		br_multicast_select_own_querier(br, ip, skb);
 		netif_rx(skb);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 054/126] bcache: Make sure to pass GFP_WAIT to mempool_alloc()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (52 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 053/126] bridge: fix netfilter/NF_BR_LOCAL_OUT for own, locally generated queries Luis Henriques
@ 2015-01-27 12:15 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 055/126] ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake Luis Henriques
                   ` (71 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:15 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Kent Overstreet, Gabriel de Perthuis, Luis Henriques

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

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

From: Kent Overstreet <kmo@daterainc.com>

commit bcf090e0040e30f8409e6a535a01e6473afb096f upstream.

this was very wrong - mempool_alloc() only guarantees success with GFP_WAIT.
bcache uses GFP_NOWAIT in various other places where we have a fallback,
circuits must've gotten crossed when writing this code or something.

Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Cc: Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/bcache/btree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 7347b6100961..5ef445d2d81e 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -202,7 +202,7 @@ void bch_btree_node_read_done(struct btree *b)
 	struct bset *i = btree_bset_first(b);
 	struct btree_iter *iter;
 
-	iter = mempool_alloc(b->c->fill_iter, GFP_NOWAIT);
+	iter = mempool_alloc(b->c->fill_iter, GFP_NOIO);
 	iter->size = b->c->sb.bucket_size / b->c->sb.block_size;
 	iter->used = 0;
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 055/126] ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake.
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (53 preceding siblings ...)
  2015-01-27 12:15 ` [PATCH 3.16.y-ckt 054/126] bcache: Make sure to pass GFP_WAIT to mempool_alloc() Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 056/126] ACPI / scan: No implicit wake notification for buttons Luis Henriques
                   ` (70 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Rafael J. Wysocki, Bob Moore, Lv Zheng, Joseph Salisbury, Luis Henriques

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

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

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

commit c12f07d17c12193256a99e20c9a0f130fb8f7be8 upstream.

ACPICA commit c49dbfed2bc069d0038ea7e1294409bfde7c2c8c

Some potential callers of acpi_setup_gpe_for_wake may know in advance that
there won't be any notify handlers installed for device wake notifications
from the given GPE (one example is a button GPE in Linux). For these cases,
acpi_mark_gpe_for_wake should be used instead of acpi_setup_gpe_for_wake.
This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
setup implicit wake notification for it (since there's no handler method).
Rafael Wysocki.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Cc: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/acpi/acpica/evxfgpe.c | 47 +++++++++++++++++++++++++++++++++++++++++++
 include/acpi/acpixf.h         |  4 ++++
 2 files changed, 51 insertions(+)

diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index cb534faf5369..e5e21b24bb2a 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -179,6 +179,53 @@ ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_mark_gpe_for_wake
+ *
+ * PARAMETERS:  gpe_device          - Parent GPE Device. NULL for GPE0/GPE1
+ *              gpe_number          - GPE level within the GPE block
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
+ *              sets the ACPI_GPE_CAN_WAKE flag.
+ *
+ * Some potential callers of acpi_setup_gpe_for_wake may know in advance that
+ * there won't be any notify handlers installed for device wake notifications
+ * from the given GPE (one example is a button GPE in Linux). For these cases,
+ * acpi_mark_gpe_for_wake should be used instead of acpi_setup_gpe_for_wake.
+ * This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
+ * setup implicit wake notification for it (since there's no handler method).
+ *
+ ******************************************************************************/
+acpi_status acpi_mark_gpe_for_wake(acpi_handle gpe_device, u32 gpe_number)
+{
+	struct acpi_gpe_event_info *gpe_event_info;
+	acpi_status status = AE_BAD_PARAMETER;
+	acpi_cpu_flags flags;
+
+	ACPI_FUNCTION_TRACE(acpi_mark_gpe_for_wake);
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+	/* Ensure that we have a valid GPE number */
+
+	gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
+	if (gpe_event_info) {
+
+		/* Mark the GPE as a possible wake event */
+
+		gpe_event_info->flags |= ACPI_GPE_CAN_WAKE;
+		status = AE_OK;
+	}
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+	return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_mark_gpe_for_wake)
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_setup_gpe_for_wake
  *
  * PARAMETERS:  wake_device         - Device associated with the GPE (via _PRW)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 35b525c19711..6c77a132b53b 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -658,6 +658,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 						u32 gpe_number))
 
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				acpi_mark_gpe_for_wake(acpi_handle gpe_device,
+						       u32 gpe_number))
+
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_setup_gpe_for_wake(acpi_handle
 							parent_device,
 							acpi_handle gpe_device,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 056/126] ACPI / scan: No implicit wake notification for buttons
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (54 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 055/126] ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 057/126] gre: fix the inner mac header in nbma tunnel xmit path Luis Henriques
                   ` (69 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Rafael J. Wysocki, Joseph Salisbury, Luis Henriques

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

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

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

commit bd9b2f9aff26c185c1f8e0cd08a850ee4ace391a upstream.

The ACPI device enumeration code in Linux assumes that buttons always
are wakeup devices, so it calls acpi_setup_gpe_for_wake() for them
which leads to undesirable side effects.  Namely, that function sets
up implicit device wake notification mechanism for a given GPE if
there is no handler method in the ACPI namespace, which from the
ACPICA's perspective means that there always is a way to handle
that GPE if enabled.  However, we don't handle wake notify events
for buttons, so if there are no handler methods for their GPEs in
the namespace, enabling a button GPE at run time leads to a GPE
storm in some cases (the GPE triggers, ACPICA carries out the
implicit wake notification for it which isn't handled, so the
GPE triggers again and so on).

To prevent that from happening use acpi_mark_gpe_for_wake()
instead of acpi_setup_gpe_for_wake() for buttons which will cause
ACPICA to only enable button GPEs if there are handler methods for
the in the namespace.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/acpi/scan.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 465712f3b7b4..f002835894c1 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1428,14 +1428,13 @@ static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
 			wakeup->sleep_state = sleep_state;
 		}
 	}
-	acpi_setup_gpe_for_wake(handle, wakeup->gpe_device, wakeup->gpe_number);
 
  out:
 	kfree(buffer.pointer);
 	return err;
 }
 
-static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
+static void acpi_wakeup_gpe_init(struct acpi_device *device)
 {
 	struct acpi_device_id button_device_ids[] = {
 		{"PNP0C0C", 0},
@@ -1443,29 +1442,33 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
 		{"PNP0C0E", 0},
 		{"", 0},
 	};
+	struct acpi_device_wakeup *wakeup = &device->wakeup;
 	acpi_status status;
 	acpi_event_status event_status;
 
-	device->wakeup.flags.notifier_present = 0;
+	wakeup->flags.notifier_present = 0;
 
 	/* Power button, Lid switch always enable wakeup */
 	if (!acpi_match_device_ids(device, button_device_ids)) {
-		device->wakeup.flags.run_wake = 1;
+		wakeup->flags.run_wake = 1;
 		if (!acpi_match_device_ids(device, &button_device_ids[1])) {
 			/* Do not use Lid/sleep button for S5 wakeup */
-			if (device->wakeup.sleep_state == ACPI_STATE_S5)
-				device->wakeup.sleep_state = ACPI_STATE_S4;
+			if (wakeup->sleep_state == ACPI_STATE_S5)
+				wakeup->sleep_state = ACPI_STATE_S4;
 		}
+		acpi_mark_gpe_for_wake(wakeup->gpe_device, wakeup->gpe_number);
 		device_set_wakeup_capable(&device->dev, true);
 		return;
 	}
 
-	status = acpi_get_gpe_status(device->wakeup.gpe_device,
-					device->wakeup.gpe_number,
-						&event_status);
-	if (status == AE_OK)
-		device->wakeup.flags.run_wake =
-				!!(event_status & ACPI_EVENT_FLAG_HANDLE);
+	acpi_setup_gpe_for_wake(device->handle, wakeup->gpe_device,
+				wakeup->gpe_number);
+	status = acpi_get_gpe_status(wakeup->gpe_device, wakeup->gpe_number,
+				     &event_status);
+	if (ACPI_FAILURE(status))
+		return;
+
+	wakeup->flags.run_wake = !!(event_status & ACPI_EVENT_FLAG_HANDLE);
 }
 
 static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
@@ -1485,7 +1488,7 @@ static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
 
 	device->wakeup.flags.valid = 1;
 	device->wakeup.prepare_count = 0;
-	acpi_bus_set_run_wake_flags(device);
+	acpi_wakeup_gpe_init(device);
 	/* Call _PSW/_DSW object to disable its ability to wake the sleeping
 	 * system for the ACPI device with the _PRW object.
 	 * The _PSW object is depreciated in ACPI 3.0 and is replaced by _DSW.
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 057/126] gre: fix the inner mac header in nbma tunnel xmit path
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (55 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 056/126] ACPI / scan: No implicit wake notification for buttons Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 058/126] netlink: Always copy on mmap TX Luis Henriques
                   ` (68 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Timo Teräs, Tom Herbert, Alexander Duyck, David S. Miller,
	Luis Henriques

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

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

From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>

commit 8a0033a947403569caeca45fa5e6f7ba60d51974 upstream.

The NBMA GRE tunnels temporarily push GRE header that contain the
per-packet NBMA destination on the skb via header ops early in xmit
path. It is the later pulled before the real GRE header is constructed.

The inner mac was thus set differently in nbma case: the GRE header
has been pushed by neighbor layer, and mac header points to beginning
of the temporary gre header (set by dev_queue_xmit).

Now that the offloads expect mac header to point to the gre payload,
fix the xmit patch to:
 - pull first the temporary gre header away
 - and reset mac header to point to gre payload

This fixes tso to work again with nbma tunnels.

Fixes: 14051f0452a2 ("gre: Use inner mac length when computing tunnel length")
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Cc: Tom Herbert <therbert@google.com>
Cc: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ip_gre.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 9b842544aea3..86ea90523a12 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -250,10 +250,6 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
 	struct ip_tunnel *tunnel = netdev_priv(dev);
 	const struct iphdr *tnl_params;
 
-	skb = gre_handle_offloads(skb, !!(tunnel->parms.o_flags&TUNNEL_CSUM));
-	if (IS_ERR(skb))
-		goto out;
-
 	if (dev->header_ops) {
 		/* Need space for new headers */
 		if (skb_cow_head(skb, dev->needed_headroom -
@@ -266,6 +262,7 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
 		 * to gre header.
 		 */
 		skb_pull(skb, tunnel->hlen + sizeof(struct iphdr));
+		skb_reset_mac_header(skb);
 	} else {
 		if (skb_cow_head(skb, dev->needed_headroom))
 			goto free_skb;
@@ -273,6 +270,10 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
 		tnl_params = &tunnel->parms.iph;
 	}
 
+	skb = gre_handle_offloads(skb, !!(tunnel->parms.o_flags&TUNNEL_CSUM));
+	if (IS_ERR(skb))
+		goto out;
+
 	__gre_xmit(skb, dev, tnl_params, skb->protocol);
 
 	return NETDEV_TX_OK;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 058/126] netlink: Always copy on mmap TX.
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (56 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 057/126] gre: fix the inner mac header in nbma tunnel xmit path Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 059/126] netlink: Don't reorder loads/stores before marking mmap netlink frame as available Luis Henriques
                   ` (67 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: David S. Miller, Luis Henriques

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

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

From: David Miller <davem@davemloft.net>

commit 4682a0358639b29cf69437ed909c6221f8c89847 upstream.

Checking the file f_count and the nlk->mapped count is not completely
sufficient to prevent the mmap'd area contents from changing from
under us during netlink mmap sendmsg() operations.

Be careful to sample the header's length field only once, because this
could change from under us as well.

Fixes: 5fd96123ee19 ("netlink: implement memory mapped sendmsg()")
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/netlink/af_netlink.c | 52 +++++++++++++++---------------------------------
 1 file changed, 16 insertions(+), 36 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 0ed3c2b65fb7..625593d866ac 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -510,14 +510,14 @@ out:
 	return err;
 }
 
-static void netlink_frame_flush_dcache(const struct nl_mmap_hdr *hdr)
+static void netlink_frame_flush_dcache(const struct nl_mmap_hdr *hdr, unsigned int nm_len)
 {
 #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1
 	struct page *p_start, *p_end;
 
 	/* First page is flushed through netlink_{get,set}_status */
 	p_start = pgvec_to_page(hdr + PAGE_SIZE);
-	p_end   = pgvec_to_page((void *)hdr + NL_MMAP_HDRLEN + hdr->nm_len - 1);
+	p_end   = pgvec_to_page((void *)hdr + NL_MMAP_HDRLEN + nm_len - 1);
 	while (p_start <= p_end) {
 		flush_dcache_page(p_start);
 		p_start++;
@@ -699,24 +699,16 @@ static int netlink_mmap_sendmsg(struct sock *sk, struct msghdr *msg,
 	struct nl_mmap_hdr *hdr;
 	struct sk_buff *skb;
 	unsigned int maxlen;
-	bool excl = true;
 	int err = 0, len = 0;
 
-	/* Netlink messages are validated by the receiver before processing.
-	 * In order to avoid userspace changing the contents of the message
-	 * after validation, the socket and the ring may only be used by a
-	 * single process, otherwise we fall back to copying.
-	 */
-	if (atomic_long_read(&sk->sk_socket->file->f_count) > 1 ||
-	    atomic_read(&nlk->mapped) > 1)
-		excl = false;
-
 	mutex_lock(&nlk->pg_vec_lock);
 
 	ring   = &nlk->tx_ring;
 	maxlen = ring->frame_size - NL_MMAP_HDRLEN;
 
 	do {
+		unsigned int nm_len;
+
 		hdr = netlink_current_frame(ring, NL_MMAP_STATUS_VALID);
 		if (hdr == NULL) {
 			if (!(msg->msg_flags & MSG_DONTWAIT) &&
@@ -724,35 +716,23 @@ static int netlink_mmap_sendmsg(struct sock *sk, struct msghdr *msg,
 				schedule();
 			continue;
 		}
-		if (hdr->nm_len > maxlen) {
+
+		nm_len = ACCESS_ONCE(hdr->nm_len);
+		if (nm_len > maxlen) {
 			err = -EINVAL;
 			goto out;
 		}
 
-		netlink_frame_flush_dcache(hdr);
+		netlink_frame_flush_dcache(hdr, nm_len);
 
-		if (likely(dst_portid == 0 && dst_group == 0 && excl)) {
-			skb = alloc_skb_head(GFP_KERNEL);
-			if (skb == NULL) {
-				err = -ENOBUFS;
-				goto out;
-			}
-			sock_hold(sk);
-			netlink_ring_setup_skb(skb, sk, ring, hdr);
-			NETLINK_CB(skb).flags |= NETLINK_SKB_TX;
-			__skb_put(skb, hdr->nm_len);
-			netlink_set_status(hdr, NL_MMAP_STATUS_RESERVED);
-			atomic_inc(&ring->pending);
-		} else {
-			skb = alloc_skb(hdr->nm_len, GFP_KERNEL);
-			if (skb == NULL) {
-				err = -ENOBUFS;
-				goto out;
-			}
-			__skb_put(skb, hdr->nm_len);
-			memcpy(skb->data, (void *)hdr + NL_MMAP_HDRLEN, hdr->nm_len);
-			netlink_set_status(hdr, NL_MMAP_STATUS_UNUSED);
+		skb = alloc_skb(nm_len, GFP_KERNEL);
+		if (skb == NULL) {
+			err = -ENOBUFS;
+			goto out;
 		}
+		__skb_put(skb, nm_len);
+		memcpy(skb->data, (void *)hdr + NL_MMAP_HDRLEN, nm_len);
+		netlink_set_status(hdr, NL_MMAP_STATUS_UNUSED);
 
 		netlink_increment_head(ring);
 
@@ -798,7 +778,7 @@ static void netlink_queue_mmaped_skb(struct sock *sk, struct sk_buff *skb)
 	hdr->nm_pid	= NETLINK_CB(skb).creds.pid;
 	hdr->nm_uid	= from_kuid(sk_user_ns(sk), NETLINK_CB(skb).creds.uid);
 	hdr->nm_gid	= from_kgid(sk_user_ns(sk), NETLINK_CB(skb).creds.gid);
-	netlink_frame_flush_dcache(hdr);
+	netlink_frame_flush_dcache(hdr, hdr->nm_len);
 	netlink_set_status(hdr, NL_MMAP_STATUS_VALID);
 
 	NETLINK_CB(skb).flags |= NETLINK_SKB_DELIVERED;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 059/126] netlink: Don't reorder loads/stores before marking mmap netlink frame as available
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (57 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 058/126] netlink: Always copy on mmap TX Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 060/126] in6: fix conflict with glibc Luis Henriques
                   ` (66 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Graf, David S. Miller, Luis Henriques

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

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

From: Thomas Graf <tgraf@suug.ch>

commit a18e6a186f53af06937a2c268c72443336f4ab56 upstream.

Each mmap Netlink frame contains a status field which indicates
whether the frame is unused, reserved, contains data or needs to
be skipped. Both loads and stores may not be reordeded and must
complete before the status field is changed and another CPU might
pick up the frame for use. Use an smp_mb() to cover needs of both
types of callers to netlink_set_status(), callers which have been
reading data frame from the frame, and callers which have been
filling or releasing and thus writing to the frame.

- Example code path requiring a smp_rmb():
  memcpy(skb->data, (void *)hdr + NL_MMAP_HDRLEN, hdr->nm_len);
  netlink_set_status(hdr, NL_MMAP_STATUS_UNUSED);

- Example code path requiring a smp_wmb():
  hdr->nm_uid	= from_kuid(sk_user_ns(sk), NETLINK_CB(skb).creds.uid);
  hdr->nm_gid	= from_kgid(sk_user_ns(sk), NETLINK_CB(skb).creds.gid);
  netlink_frame_flush_dcache(hdr);
  netlink_set_status(hdr, NL_MMAP_STATUS_VALID);

Fixes: f9c228 ("netlink: implement memory mapped recvmsg()")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 625593d866ac..256ce8b84456 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -535,9 +535,9 @@ static enum nl_mmap_status netlink_get_status(const struct nl_mmap_hdr *hdr)
 static void netlink_set_status(struct nl_mmap_hdr *hdr,
 			       enum nl_mmap_status status)
 {
+	smp_mb();
 	hdr->nm_status = status;
 	flush_dcache_page(pgvec_to_page(hdr));
-	smp_wmb();
 }
 
 static struct nl_mmap_hdr *
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 060/126] in6: fix conflict with glibc
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (58 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 059/126] netlink: Don't reorder loads/stores before marking mmap netlink frame as available Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 061/126] tg3: tg3_disable_ints using uninitialized mailbox value to disable interrupts Luis Henriques
                   ` (65 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Stephen Hemminger, David S. Miller, Luis Henriques

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

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

From: stephen hemminger <stephen@networkplumber.org>

commit 6d08acd2d32e3e877579315dc3202d7a5f336d98 upstream.

Resolve conflicts between glibc definition of IPV6 socket options
and those defined in Linux headers. Looks like earlier efforts to
solve this did not cover all the definitions.

It resolves warnings during iproute2 build.
Please consider for stable as well.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/uapi/linux/in6.h         | 3 ++-
 include/uapi/linux/libc-compat.h | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 0d8e0f0342dc..1a663d83d765 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -149,7 +149,7 @@ struct in6_flowlabel_req {
 /*
  *	IPV6 socket options
  */
-
+#if __UAPI_DEF_IPV6_OPTIONS
 #define IPV6_ADDRFORM		1
 #define IPV6_2292PKTINFO	2
 #define IPV6_2292HOPOPTS	3
@@ -196,6 +196,7 @@ struct in6_flowlabel_req {
 
 #define IPV6_IPSEC_POLICY	34
 #define IPV6_XFRM_POLICY	35
+#endif
 
 /*
  * Multicast:
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index c140620dad92..e28807ad17fa 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -69,6 +69,7 @@
 #define __UAPI_DEF_SOCKADDR_IN6		0
 #define __UAPI_DEF_IPV6_MREQ		0
 #define __UAPI_DEF_IPPROTO_V6		0
+#define __UAPI_DEF_IPV6_OPTIONS		0
 
 #else
 
@@ -82,6 +83,7 @@
 #define __UAPI_DEF_SOCKADDR_IN6		1
 #define __UAPI_DEF_IPV6_MREQ		1
 #define __UAPI_DEF_IPPROTO_V6		1
+#define __UAPI_DEF_IPV6_OPTIONS		1
 
 #endif /* _NETINET_IN_H */
 
@@ -103,6 +105,7 @@
 #define __UAPI_DEF_SOCKADDR_IN6		1
 #define __UAPI_DEF_IPV6_MREQ		1
 #define __UAPI_DEF_IPPROTO_V6		1
+#define __UAPI_DEF_IPV6_OPTIONS		1
 
 /* Definitions for xattr.h */
 #define __UAPI_DEF_XATTR		1
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 061/126] tg3: tg3_disable_ints using uninitialized mailbox value to disable interrupts
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (59 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 060/126] in6: fix conflict with glibc Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 062/126] batman-adv: Unify fragment size calculation Luis Henriques
                   ` (64 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Prashant Sreedharan, Michael Chan, David S. Miller, Luis Henriques

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

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

From: Prashant Sreedharan <prashant@broadcom.com>

commit 05b0aa579397b734f127af58e401a30784a1e315 upstream.

During driver load in tg3_init_one, if the driver detects DMA activity before
intializing the chip tg3_halt is called. As part of tg3_halt interrupts are
disabled using routine tg3_disable_ints. This routine was using mailbox value
which was not initialized (default value is 0). As a result driver was writing
0x00000001 to pci config space register 0, which is the vendor id / device id.

This driver bug was exposed because of the commit a7877b17a667 (PCI: Check only
the Vendor ID to identify Configuration Request Retry). Also this issue is only
seen in older generation chipsets like 5722 because config space write to offset
0 from driver is possible. The newer generation chips ignore writes to offset 0.
Also without commit a7877b17a667, for these older chips when a GRC reset is
issued the Bootcode would reprogram the vendor id/device id, which is the reason
this bug was masked earlier.

Fixed by initializing the interrupt mailbox registers before calling tg3_halt.

Please queue for -stable.

Reported-by: Nils Holland <nholland@tisys.org>
Reported-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: 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 | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 2a1adec84d0e..73f7bdd1ebc9 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -17773,23 +17773,6 @@ static int tg3_init_one(struct pci_dev *pdev,
 		goto err_out_apeunmap;
 	}
 
-	/*
-	 * Reset chip in case UNDI or EFI driver did not shutdown
-	 * DMA self test will enable WDMAC and we'll see (spurious)
-	 * pending DMA on the PCI bus at that point.
-	 */
-	if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) ||
-	    (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) {
-		tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);
-		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-	}
-
-	err = tg3_test_dma(tp);
-	if (err) {
-		dev_err(&pdev->dev, "DMA engine test failed, aborting\n");
-		goto err_out_apeunmap;
-	}
-
 	intmbx = MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW;
 	rcvmbx = MAILBOX_RCVRET_CON_IDX_0 + TG3_64BIT_REG_LOW;
 	sndmbx = MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW;
@@ -17834,6 +17817,23 @@ static int tg3_init_one(struct pci_dev *pdev,
 			sndmbx += 0xc;
 	}
 
+	/*
+	 * Reset chip in case UNDI or EFI driver did not shutdown
+	 * DMA self test will enable WDMAC and we'll see (spurious)
+	 * pending DMA on the PCI bus at that point.
+	 */
+	if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) ||
+	    (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) {
+		tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);
+		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+	}
+
+	err = tg3_test_dma(tp);
+	if (err) {
+		dev_err(&pdev->dev, "DMA engine test failed, aborting\n");
+		goto err_out_apeunmap;
+	}
+
 	tg3_init_coal(tp);
 
 	pci_set_drvdata(pdev, dev);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 062/126] batman-adv: Unify fragment size calculation
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (60 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 061/126] tg3: tg3_disable_ints using uninitialized mailbox value to disable interrupts Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 063/126] batman-adv: avoid NULL dereferences and fix if check Luis Henriques
                   ` (63 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sven Eckelmann, David S. Miller, Luis Henriques

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

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

From: Sven Eckelmann <sven@narfation.org>

commit 0402e444cd199389b7fe47be68a67b817e09e097 upstream.

The fragmentation code was replaced in 610bfc6bc99bc83680d190ebc69359a05fc7f605
("batman-adv: Receive fragmented packets and merge") by an implementation which
can handle up to 16 fragments of a packet. The packet is prepared for the split
in fragments by the function batadv_frag_send_packet and the actual split is
done by batadv_frag_create.

Both functions calculate the size of a fragment themself. But their calculation
differs because batadv_frag_send_packet also subtracts ETH_HLEN. Therefore,
the check in batadv_frag_send_packet "can a full fragment can be created?" may
return true even when batadv_frag_create cannot create a full fragment.

The function batadv_frag_create doesn't check the size of the skb before
splitting it and therefore might try to create a larger fragment than the
remaining buffer. This creates an integer underflow and an invalid len is given
to skb_split.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/fragmentation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index 57dd88db6bb7..d2b6d5066c33 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -434,7 +434,7 @@ bool batadv_frag_send_packet(struct sk_buff *skb,
 	 * fragments larger than BATADV_FRAG_MAX_FRAG_SIZE
 	 */
 	mtu = min_t(unsigned, mtu, BATADV_FRAG_MAX_FRAG_SIZE);
-	max_fragment_size = (mtu - header_size - ETH_HLEN);
+	max_fragment_size = mtu - header_size;
 	max_packet_size = max_fragment_size * BATADV_FRAG_MAX_FRAGMENTS;
 
 	/* Don't even try to fragment, if we need more than 16 fragments */
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 063/126] batman-adv: avoid NULL dereferences and fix if check
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (61 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 062/126] batman-adv: Unify fragment size calculation Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 064/126] net: Fix stacked vlan offload features computation Luis Henriques
                   ` (62 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Antonio Quartulli, Marek Lindner, David S. Miller, Luis Henriques

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

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

From: Antonio Quartulli <antonio@meshcoding.com>

commit 0d1644919578db525b9a7b6c8197ce02adbfce26 upstream.

Gateway having bandwidth_down equal to zero are not accepted
at all and so never added to the Gateway list.
For this reason checking the bandwidth_down member in
batadv_gw_out_of_range() is useless.

This is probably a copy/paste error and this check was supposed
to be "!gw_node" only. Moreover, the way the check is written
now may also lead to a NULL dereference.

Fix this by rewriting the if-condition properly.

Introduced by 414254e342a0d58144de40c3da777521ebaeeb07
("batman-adv: tvlv - gateway download/upload bandwidth container")

Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/batman-adv/gateway_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 90cff585b37d..e0bcf9e84273 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -810,7 +810,7 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
 		goto out;
 
 	gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
-	if (!gw_node->bandwidth_down == 0)
+	if (!gw_node)
 		goto out;
 
 	switch (atomic_read(&bat_priv->gw_mode)) {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 064/126] net: Fix stacked vlan offload features computation
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (62 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 063/126] batman-adv: avoid NULL dereferences and fix if check Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 065/126] net: Reset secmark when scrubbing packet Luis Henriques
                   ` (61 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Toshiaki Makita, David S. Miller, Luis Henriques

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

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

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>

commit 796f2da81bead71ffc91ef70912cd8d1827bf756 upstream.

When vlan tags are stacked, it is very likely that the outer tag is stored
in skb->vlan_tci and skb->protocol shows the inner tag's vlan_proto.
Currently netif_skb_features() first looks at skb->protocol even if there
is the outer tag in vlan_tci, thus it incorrectly retrieves the protocol
encapsulated by the inner vlan instead of the inner vlan protocol.
This allows GSO packets to be passed to HW and they end up being
corrupted.

Fixes: 58e998c6d239 ("offloading: Force software GSO for multiple vlan tags.")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/dev.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 2647b508eb4d..9785af6c54d4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2569,11 +2569,14 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
 	if (skb_shinfo(skb)->gso_segs > skb->dev->gso_max_segs)
 		features &= ~NETIF_F_GSO_MASK;
 
-	if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) {
-		struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
-		protocol = veh->h_vlan_encapsulated_proto;
-	} else if (!vlan_tx_tag_present(skb)) {
-		return harmonize_features(skb, features);
+	if (!vlan_tx_tag_present(skb)) {
+		if (unlikely(protocol == htons(ETH_P_8021Q) ||
+			     protocol == htons(ETH_P_8021AD))) {
+			struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
+			protocol = veh->h_vlan_encapsulated_proto;
+		} else {
+			return harmonize_features(skb, features);
+		}
 	}
 
 	features = netdev_intersect_features(features,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 065/126] net: Reset secmark when scrubbing packet
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (63 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 064/126] net: Fix stacked vlan offload features computation Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 066/126] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding Luis Henriques
                   ` (60 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Graf, David S. Miller, Luis Henriques

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

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

From: Thomas Graf <tgraf@suug.ch>

commit b8fb4e0648a2ab3734140342002f68fb0c7d1602 upstream.

skb_scrub_packet() is called when a packet switches between a context
such as between underlay and overlay, between namespaces, or between
L3 subnets.

While we already scrub the packet mark, connection tracking entry,
and cached destination, the security mark/context is left intact.

It seems wrong to inherit the security context of a packet when going
from overlay to underlay or across forwarding paths.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/skbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index f5f14d54d6a2..fe07faaed256 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3933,6 +3933,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
 	skb->ignore_df = 0;
 	skb_dst_drop(skb);
 	skb->mark = 0;
+	skb_init_secmark(skb);
 	secpath_reset(skb);
 	nf_reset(skb);
 	nf_reset_trace(skb);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 066/126] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (64 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 065/126] net: Reset secmark when scrubbing packet Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 067/126] tcp: Do not apply TSO segment limit to non-TSO packets Luis Henriques
                   ` (59 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jay Vosburgh, David S. Miller, Luis Henriques

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

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

From: Jay Vosburgh <jay.vosburgh@canonical.com>

commit 2c26d34bbcc0b3f30385d5587aa232289e2eed8e upstream.

When using VXLAN tunnels and a sky2 device, I have experienced
checksum failures of the following type:

[ 4297.761899] eth0: hw csum failure
[...]
[ 4297.765223] Call Trace:
[ 4297.765224]  <IRQ>  [<ffffffff8172f026>] dump_stack+0x46/0x58
[ 4297.765235]  [<ffffffff8162ba52>] netdev_rx_csum_fault+0x42/0x50
[ 4297.765238]  [<ffffffff8161c1a0>] ? skb_push+0x40/0x40
[ 4297.765240]  [<ffffffff8162325c>] __skb_checksum_complete+0xbc/0xd0
[ 4297.765243]  [<ffffffff8168c602>] tcp_v4_rcv+0x2e2/0x950
[ 4297.765246]  [<ffffffff81666ca0>] ? ip_rcv_finish+0x360/0x360

	These are reliably reproduced in a network topology of:

container:eth0 == host(OVS VXLAN on VLAN) == bond0 == eth0 (sky2) -> switch

	When VXLAN encapsulated traffic is received from a similarly
configured peer, the above warning is generated in the receive
processing of the encapsulated packet.  Note that the warning is
associated with the container eth0.

        The skbs from sky2 have ip_summed set to CHECKSUM_COMPLETE, and
because the packet is an encapsulated Ethernet frame, the checksum
generated by the hardware includes the inner protocol and Ethernet
headers.

	The receive code is careful to update the skb->csum, except in
__dev_forward_skb, as called by dev_forward_skb.  __dev_forward_skb
calls eth_type_trans, which in turn calls skb_pull_inline(skb, ETH_HLEN)
to skip over the Ethernet header, but does not update skb->csum when
doing so.

	This patch resolves the problem by adding a call to
skb_postpull_rcsum to update the skb->csum after the call to
eth_type_trans.

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 9785af6c54d4..a4ebbe7d4f15 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1686,6 +1686,7 @@ int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
 
 	skb_scrub_packet(skb, true);
 	skb->protocol = eth_type_trans(skb, dev);
+	skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
 
 	return 0;
 }
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 067/126] tcp: Do not apply TSO segment limit to non-TSO packets
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (65 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 066/126] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 068/126] xen-netback: fixing the propagation of the transmit shaper timeout Luis Henriques
                   ` (58 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Herbert Xu, David S. Miller, Luis Henriques

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

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

From: Herbert Xu <herbert@gondor.apana.org.au>

commit 843925f33fcc293d80acf2c5c8a78adf3344d49b upstream.

Thomas Jarosch reported IPsec TCP stalls when a PMTU event occurs.

In fact the problem was completely unrelated to IPsec.  The bug is
also reproducible if you just disable TSO/GSO.

The problem is that when the MSS goes down, existing queued packet
on the TX queue that have not been transmitted yet all look like
TSO packets and get treated as such.

This then triggers a bug where tcp_mss_split_point tells us to
generate a zero-sized packet on the TX queue.  Once that happens
we're screwed because the zero-sized packet can never be removed
by ACKs.

Fixes: 1485348d242 ("tcp: Apply device TSO segment limit earlier")
Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: used davem's backport to 3.18 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/tcp_output.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index a8794367cd20..64fb6e84127e 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1935,7 +1935,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
 		if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now)))
 			break;
 
-		if (tso_segs == 1) {
+		if (tso_segs == 1 || !sk->sk_gso_max_segs) {
 			if (unlikely(!tcp_nagle_test(tp, skb, mss_now,
 						     (tcp_skb_is_last(sk, skb) ?
 						      nonagle : TCP_NAGLE_PUSH))))
@@ -1971,7 +1971,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
 		}
 
 		limit = mss_now;
-		if (tso_segs > 1 && !tcp_urg_mode(tp))
+		if (tso_segs > 1 && sk->sk_gso_max_segs && !tcp_urg_mode(tp))
 			limit = tcp_mss_split_point(sk, skb, mss_now,
 						    min_t(unsigned int,
 							  cwnd_quota,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 068/126] xen-netback: fixing the propagation of the transmit shaper timeout
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (66 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 067/126] tcp: Do not apply TSO segment limit to non-TSO packets Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 069/126] alx: fix alx_poll() Luis Henriques
                   ` (57 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anthony Liguori, Imre Palik, David S. Miller, Luis Henriques

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

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

From: "Palik, Imre" <imrep@amazon.de>

commit 07ff890daeda31cf23173865edf50bcb03e100c3 upstream.

Since e9ce7cb6b107 ("xen-netback: Factor queue-specific data into queue struct"),
the transimt shaper timeout is always set to 0.  The value the user sets via
xenbus is never propagated to the transmit shaper.

This patch fixes the issue.

Cc: Anthony Liguori <aliguori@amazon.com>
Signed-off-by: Imre Palik <imrep@amazon.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/xen-netback/xenbus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 3d85acd84bad..9378a17c9553 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -549,6 +549,7 @@ static void connect(struct backend_info *be)
 		}
 
 		queue->remaining_credit = credit_bytes;
+		queue->credit_usec = credit_usec;
 
 		err = connect_rings(be, queue);
 		if (err) {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 069/126] alx: fix alx_poll()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (67 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 068/126] xen-netback: fixing the propagation of the transmit shaper timeout Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 070/126] team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin Luis Henriques
                   ` (56 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, David S. Miller, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit 7a05dc64e2e4c611d89007b125b20c0d2a4d31a5 upstream.

Commit d75b1ade567f ("net: less interrupt masking in NAPI") uncovered
wrong alx_poll() behavior.

A NAPI poll() handler is supposed to return exactly the budget when/if
napi_complete() has not been called.

It is also supposed to return number of frames that were received, so
that netdev_budget can have a meaning.

Also, in case of TX pressure, we still have to dequeue received
packets : alx_clean_rx_irq() has to be called even if
alx_clean_tx_irq(alx) returns false, otherwise device is half duplex.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: d75b1ade567f ("net: less interrupt masking in NAPI")
Reported-by: Oded Gabbay <oded.gabbay@amd.com>
Bisected-by: Oded Gabbay <oded.gabbay@amd.com>
Tested-by: Oded Gabbay <oded.gabbay@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/atheros/alx/main.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 49faa97a30c3..e751b5db0132 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -184,15 +184,16 @@ static void alx_schedule_reset(struct alx_priv *alx)
 	schedule_work(&alx->reset_wk);
 }
 
-static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
+static int alx_clean_rx_irq(struct alx_priv *alx, int budget)
 {
 	struct alx_rx_queue *rxq = &alx->rxq;
 	struct alx_rrd *rrd;
 	struct alx_buffer *rxb;
 	struct sk_buff *skb;
 	u16 length, rfd_cleaned = 0;
+	int work = 0;
 
-	while (budget > 0) {
+	while (work < budget) {
 		rrd = &rxq->rrd[rxq->rrd_read_idx];
 		if (!(rrd->word3 & cpu_to_le32(1 << RRD_UPDATED_SHIFT)))
 			break;
@@ -203,7 +204,7 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
 		    ALX_GET_FIELD(le32_to_cpu(rrd->word0),
 				  RRD_NOR) != 1) {
 			alx_schedule_reset(alx);
-			return 0;
+			return work;
 		}
 
 		rxb = &rxq->bufs[rxq->read_idx];
@@ -243,7 +244,7 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget)
 		}
 
 		napi_gro_receive(&alx->napi, skb);
-		budget--;
+		work++;
 
 next_pkt:
 		if (++rxq->read_idx == alx->rx_ringsz)
@@ -258,21 +259,22 @@ next_pkt:
 	if (rfd_cleaned)
 		alx_refill_rx_ring(alx, GFP_ATOMIC);
 
-	return budget > 0;
+	return work;
 }
 
 static int alx_poll(struct napi_struct *napi, int budget)
 {
 	struct alx_priv *alx = container_of(napi, struct alx_priv, napi);
 	struct alx_hw *hw = &alx->hw;
-	bool complete = true;
 	unsigned long flags;
+	bool tx_complete;
+	int work;
 
-	complete = alx_clean_tx_irq(alx) &&
-		   alx_clean_rx_irq(alx, budget);
+	tx_complete = alx_clean_tx_irq(alx);
+	work = alx_clean_rx_irq(alx, budget);
 
-	if (!complete)
-		return 1;
+	if (!tx_complete || work == budget)
+		return budget;
 
 	napi_complete(&alx->napi);
 
@@ -284,7 +286,7 @@ static int alx_poll(struct napi_struct *napi, int budget)
 
 	alx_post_write(hw);
 
-	return 0;
+	return work;
 }
 
 static irqreturn_t alx_intr_handle(struct alx_priv *alx, u32 intr)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 070/126] team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (68 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 069/126] alx: fix alx_poll() Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 071/126] enic: fix rx skb checksum Luis Henriques
                   ` (55 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jiri Pirko, Jiri Benc, David S. Miller, Luis Henriques

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

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

From: Jiri Pirko <jiri@resnulli.us>

commit b0d11b42785b70e19bc6a3122eead3f7969a7589 upstream.

This patch is fixing a race condition that may cause setting
count_pending to -1, which results in unwanted big bulk of arp messages
(in case of "notify peers").

Consider following scenario:

count_pending == 2
   CPU0                                           CPU1
					team_notify_peers_work
					  atomic_dec_and_test (dec count_pending to 1)
					  schedule_delayed_work
 team_notify_peers
   atomic_add (adding 1 to count_pending)
					team_notify_peers_work
					  atomic_dec_and_test (dec count_pending to 1)
					  schedule_delayed_work
					team_notify_peers_work
					  atomic_dec_and_test (dec count_pending to 0)
   schedule_delayed_work
					team_notify_peers_work
					  atomic_dec_and_test (dec count_pending to -1)

Fix this race by using atomic_dec_if_positive - that will prevent
count_pending running under 0.

Fixes: fc423ff00df3a1955441 ("team: add peer notification")
Fixes: 492b200efdd20b8fcfd  ("team: add support for sending multicast rejoins")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/team/team.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index cb2a00e1d95a..3dd334a29fcf 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -629,6 +629,7 @@ static int team_change_mode(struct team *team, const char *kind)
 static void team_notify_peers_work(struct work_struct *work)
 {
 	struct team *team;
+	int val;
 
 	team = container_of(work, struct team, notify_peers.dw.work);
 
@@ -636,9 +637,14 @@ static void team_notify_peers_work(struct work_struct *work)
 		schedule_delayed_work(&team->notify_peers.dw, 0);
 		return;
 	}
+	val = atomic_dec_if_positive(&team->notify_peers.count_pending);
+	if (val < 0) {
+		rtnl_unlock();
+		return;
+	}
 	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, team->dev);
 	rtnl_unlock();
-	if (!atomic_dec_and_test(&team->notify_peers.count_pending))
+	if (val)
 		schedule_delayed_work(&team->notify_peers.dw,
 				      msecs_to_jiffies(team->notify_peers.interval));
 }
@@ -669,6 +675,7 @@ static void team_notify_peers_fini(struct team *team)
 static void team_mcast_rejoin_work(struct work_struct *work)
 {
 	struct team *team;
+	int val;
 
 	team = container_of(work, struct team, mcast_rejoin.dw.work);
 
@@ -676,9 +683,14 @@ static void team_mcast_rejoin_work(struct work_struct *work)
 		schedule_delayed_work(&team->mcast_rejoin.dw, 0);
 		return;
 	}
+	val = atomic_dec_if_positive(&team->mcast_rejoin.count_pending);
+	if (val < 0) {
+		rtnl_unlock();
+		return;
+	}
 	call_netdevice_notifiers(NETDEV_RESEND_IGMP, team->dev);
 	rtnl_unlock();
-	if (!atomic_dec_and_test(&team->mcast_rejoin.count_pending))
+	if (val)
 		schedule_delayed_work(&team->mcast_rejoin.dw,
 				      msecs_to_jiffies(team->mcast_rejoin.interval));
 }
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 071/126] enic: fix rx skb checksum
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (69 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 070/126] team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 072/126] netfilter: conntrack: disable generic tracking for known protocols Luis Henriques
                   ` (54 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jiri Benc, Stefan Assmann, Govindarajulu Varadarajan,
	David S. Miller, Luis Henriques

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

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

From: Govindarajulu Varadarajan <_govind@gmx.com>

commit 17e96834fd35997ca7cdfbf15413bcd5a36ad448 upstream.

Hardware always provides compliment of IP pseudo checksum. Stack expects
whole packet checksum without pseudo checksum if CHECKSUM_COMPLETE is set.

This causes checksum error in nf & ovs.

kernel: qg-19546f09-f2: hw csum failure
kernel: CPU: 9 PID: 0 Comm: swapper/9 Tainted: GF          O--------------   3.10.0-123.8.1.el7.x86_64 #1
kernel: Hardware name: Cisco Systems Inc UCSB-B200-M3/UCSB-B200-M3, BIOS B200M3.2.2.3.0.080820141339 08/08/2014
kernel: ffff881218f40000 df68243feb35e3a8 ffff881237a43ab8 ffffffff815e237b
kernel: ffff881237a43ad0 ffffffff814cd4ca ffff8829ec71eb00 ffff881237a43af0
kernel: ffffffff814c6232 0000000000000286 ffff8829ec71eb00 ffff881237a43b00
kernel: Call Trace:
kernel: <IRQ>  [<ffffffff815e237b>] dump_stack+0x19/0x1b
kernel: [<ffffffff814cd4ca>] netdev_rx_csum_fault+0x3a/0x40
kernel: [<ffffffff814c6232>] __skb_checksum_complete_head+0x62/0x70
kernel: [<ffffffff814c6251>] __skb_checksum_complete+0x11/0x20
kernel: [<ffffffff8155a20c>] nf_ip_checksum+0xcc/0x100
kernel: [<ffffffffa049edc7>] icmp_error+0x1f7/0x35c [nf_conntrack_ipv4]
kernel: [<ffffffff814cf419>] ? netif_rx+0xb9/0x1d0
kernel: [<ffffffffa040eb7b>] ? internal_dev_recv+0xdb/0x130 [openvswitch]
kernel: [<ffffffffa04c8330>] nf_conntrack_in+0xf0/0xa80 [nf_conntrack]
kernel: [<ffffffff81509380>] ? inet_del_offload+0x40/0x40
kernel: [<ffffffffa049e302>] ipv4_conntrack_in+0x22/0x30 [nf_conntrack_ipv4]
kernel: [<ffffffff815005ca>] nf_iterate+0xaa/0xc0
kernel: [<ffffffff81509380>] ? inet_del_offload+0x40/0x40
kernel: [<ffffffff81500664>] nf_hook_slow+0x84/0x140
kernel: [<ffffffff81509380>] ? inet_del_offload+0x40/0x40
kernel: [<ffffffff81509dd4>] ip_rcv+0x344/0x380

Hardware verifies IP & tcp/udp header checksum but does not provide payload
checksum, use CHECKSUM_UNNECESSARY. Set it only if its valid IP tcp/udp packet.

Cc: Jiri Benc <jbenc@redhat.com>
Cc: Stefan Assmann <sassmann@redhat.com>
Reported-by: Sunil Choudhary <schoudha@redhat.com>
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Reviewed-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/cisco/enic/enic_main.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index f32f828b7f3d..fb9708d4b8b5 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1041,10 +1041,14 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq,
 				     PKT_HASH_TYPE_L4 : PKT_HASH_TYPE_L3);
 		}
 
-		if ((netdev->features & NETIF_F_RXCSUM) && !csum_not_calc) {
-			skb->csum = htons(checksum);
-			skb->ip_summed = CHECKSUM_COMPLETE;
-		}
+		/* Hardware does not provide whole packet checksum. It only
+		 * provides pseudo checksum. Since hw validates the packet
+		 * checksum but not provide us the checksum value. use
+		 * CHECSUM_UNNECESSARY.
+		 */
+		if ((netdev->features & NETIF_F_RXCSUM) && tcp_udp_csum_ok &&
+		    ipv4_csum_ok)
+			skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		if (vlan_stripped)
 			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 072/126] netfilter: conntrack: disable generic tracking for known protocols
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (70 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 071/126] enic: fix rx skb checksum Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 073/126] xen-netfront: Fix handling packets on compound pages with skb_linearize Luis Henriques
                   ` (53 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Florian Westphal, Daniel Borkmann, Pablo Neira Ayuso, Luis Henriques

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

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

From: Florian Westphal <fw@strlen.de>

commit db29a9508a9246e77087c5531e45b2c88ec6988b upstream.

Given following iptables ruleset:

-P FORWARD DROP
-A FORWARD -m sctp --dport 9 -j ACCEPT
-A FORWARD -p tcp --dport 80 -j ACCEPT
-A FORWARD -p tcp -m conntrack -m state ESTABLISHED,RELATED -j ACCEPT

One would assume that this allows SCTP on port 9 and TCP on port 80.
Unfortunately, if the SCTP conntrack module is not loaded, this allows
*all* SCTP communication, to pass though, i.e. -p sctp -j ACCEPT,
which we think is a security issue.

This is because on the first SCTP packet on port 9, we create a dummy
"generic l4" conntrack entry without any port information (since
conntrack doesn't know how to extract this information).

All subsequent packets that are unknown will then be in established
state since they will fallback to proto_generic and will match the
'generic' entry.

Our originally proposed version [1] completely disabled generic protocol
tracking, but Jozsef suggests to not track protocols for which a more
suitable helper is available, hence we now mitigate the issue for in
tree known ct protocol helpers only, so that at least NAT and direction
information will still be preserved for others.

 [1] http://www.spinics.net/lists/netfilter-devel/msg33430.html

Joint work with Daniel Borkmann.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/netfilter/nf_conntrack_proto_generic.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c
index d25f29377648..957c1db66652 100644
--- a/net/netfilter/nf_conntrack_proto_generic.c
+++ b/net/netfilter/nf_conntrack_proto_generic.c
@@ -14,6 +14,30 @@
 
 static unsigned int nf_ct_generic_timeout __read_mostly = 600*HZ;
 
+static bool nf_generic_should_process(u8 proto)
+{
+	switch (proto) {
+#ifdef CONFIG_NF_CT_PROTO_SCTP_MODULE
+	case IPPROTO_SCTP:
+		return false;
+#endif
+#ifdef CONFIG_NF_CT_PROTO_DCCP_MODULE
+	case IPPROTO_DCCP:
+		return false;
+#endif
+#ifdef CONFIG_NF_CT_PROTO_GRE_MODULE
+	case IPPROTO_GRE:
+		return false;
+#endif
+#ifdef CONFIG_NF_CT_PROTO_UDPLITE_MODULE
+	case IPPROTO_UDPLITE:
+		return false;
+#endif
+	default:
+		return true;
+	}
+}
+
 static inline struct nf_generic_net *generic_pernet(struct net *net)
 {
 	return &net->ct.nf_ct_proto.generic;
@@ -67,7 +91,7 @@ static int generic_packet(struct nf_conn *ct,
 static bool generic_new(struct nf_conn *ct, const struct sk_buff *skb,
 			unsigned int dataoff, unsigned int *timeouts)
 {
-	return true;
+	return nf_generic_should_process(nf_ct_protonum(ct));
 }
 
 #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 073/126] xen-netfront: Fix handling packets on compound pages with skb_linearize
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (71 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 072/126] netfilter: conntrack: disable generic tracking for known protocols Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 074/126] xen-netfront: use correct linear area after linearizing an skb Luis Henriques
                   ` (52 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Zoltan Kiss, Wei Liu, Ian Campbell, Paul Durrant, netdev,
	xen-devel, David S. Miller, Stefan Bader, Luis Henriques

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

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

From: Zoltan Kiss <zoltan.kiss@citrix.com>

commit 97a6d1bb2b658ac85ed88205ccd1ab809899884d upstream.

There is a long known problem with the netfront/netback interface: if the guest
tries to send a packet which constitues more than MAX_SKB_FRAGS + 1 ring slots,
it gets dropped. The reason is that netback maps these slots to a frag in the
frags array, which is limited by size. Having so many slots can occur since
compound pages were introduced, as the ring protocol slice them up into
individual (non-compound) page aligned slots. The theoretical worst case
scenario looks like this (note, skbs are limited to 64 Kb here):
linear buffer: at most PAGE_SIZE - 17 * 2 bytes, overlapping page boundary,
using 2 slots
first 15 frags: 1 + PAGE_SIZE + 1 bytes long, first and last bytes are at the
end and the beginning of a page, therefore they use 3 * 15 = 45 slots
last 2 frags: 1 + 1 bytes, overlapping page boundary, 2 * 2 = 4 slots
Although I don't think this 51 slots skb can really happen, we need a solution
which can deal with every scenario. In real life there is only a few slots
overdue, but usually it causes the TCP stream to be blocked, as the retry will
most likely have the same buffer layout.
This patch solves this problem by linearizing the packet. This is not the
fastest way, and it can fail much easier as it tries to allocate a big linear
area for the whole packet, but probably easier by an order of magnitude than
anything else. Probably this code path is not touched very frequently anyway.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/xen-netfront.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 7a4cd11e6a07..3e0019503440 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -623,9 +623,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
 		xennet_count_skb_frag_slots(skb);
 	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
-		net_alert_ratelimited(
-			"xennet: skb rides the rocket: %d slots\n", slots);
-		goto drop;
+		net_dbg_ratelimited("xennet: skb rides the rocket: %d slots, %d bytes\n",
+				    slots, skb->len);
+		if (skb_linearize(skb))
+			goto drop;
 	}
 
 	spin_lock_irqsave(&queue->tx_lock, flags);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 074/126] xen-netfront: use correct linear area after linearizing an skb
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (72 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 073/126] xen-netfront: Fix handling packets on compound pages with skb_linearize Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 075/126] usb: musb: stuff leak of struct usb_hcd Luis Henriques
                   ` (51 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Vrabel, David S. Miller, Stefan Bader, Luis Henriques

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

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

From: David Vrabel <david.vrabel@citrix.com>

commit 11d3d2a16cc1f05c6ece69a4392e99efb85666a6 upstream.

Commit 97a6d1bb2b658ac85ed88205ccd1ab809899884d (xen-netfront: Fix
handling packets on compound pages with skb_linearize) attempted to
fix a problem where an skb that would have required too many slots
would be dropped causing TCP connections to stall.

However, it filled in the first slot using the original buffer and not
the new one and would use the wrong offset and grant access to the
wrong page.

Netback would notice the malformed request and stop all traffic on the
VIF, reporting:

    vif vif-3-0 vif3.0: txreq.offset: 85e, size: 4002, end: 6144
    vif vif-3-0 vif3.0: fatal error; disabling device

Reported-by: Anthony Wright <anthony@overnetdata.com>
Tested-by: Anthony Wright <anthony@overnetdata.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/xen-netfront.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3e0019503440..fc49005ddb5d 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -627,6 +627,9 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
 				    slots, skb->len);
 		if (skb_linearize(skb))
 			goto drop;
+		data = skb->data;
+		offset = offset_in_page(data);
+		len = skb_headlen(skb);
 	}
 
 	spin_lock_irqsave(&queue->tx_lock, flags);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 075/126] usb: musb: stuff leak of struct usb_hcd
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (73 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 074/126] xen-netfront: use correct linear area after linearizing an skb Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 076/126] usb: gadget: gadgetfs: Free memory allocated by memdup_user() Luis Henriques
                   ` (50 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniel Mack, Sebastian Andrzej Siewior, Felipe Balbi, Luis Henriques

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

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

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

commit 68693b8ea4e284c46bff919ac62bd9ccdfdbb6ba upstream.

since the split of host+gadget mode in commit 74c2e9360058 ("usb: musb:
factor out hcd initalization") we leak the usb_hcd struct. We call now
musb_host_cleanup() which does basically usb_remove_hcd() and also sets
the hcd variable to NULL. Doing so makes the finall call to
musb_host_free() basically a nop and the usb_hcd remains around for ever
without anowner.
This patch drops that NULL assignment for that reason.

Fixes: 74c2e9360058 ("usb: musb: factor out hcd initalization")
Cc: Daniel Mack <zonque@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/musb/musb_host.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index eb06291a40c8..0ae35ab5c392 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -2662,7 +2662,6 @@ void musb_host_cleanup(struct musb *musb)
 	if (musb->port_mode == MUSB_PORT_MODE_GADGET)
 		return;
 	usb_remove_hcd(musb->hcd);
-	musb->hcd = NULL;
 }
 
 void musb_host_free(struct musb *musb)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 076/126] usb: gadget: gadgetfs: Free memory allocated by memdup_user()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (74 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 075/126] usb: musb: stuff leak of struct usb_hcd Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 077/126] usb: gadget: udc: atmel: change setting for DMA Luis Henriques
                   ` (49 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mario Schuknecht, Felipe Balbi, Luis Henriques

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

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

From: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>

commit b44be2462dbe3e23f0aedff64de52a1e8e47a1cd upstream.

Commit 3b74c73f8d6f053f422e85fce955b61fb181cfe7 switched over to memdup_user()
in ep_write() function and removed kfree (kbuf).
memdup_user() function allocates memory which is never freed.

Fixes: 3b74c73 (usb: gadget: inode: switch over to memdup_user())
Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/legacy/inode.c ->
    drivers/usb/gadget/inode.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/gadget/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 2e4ce7704908..c44dc6ef2500 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -450,6 +450,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 		data->name, len, (int) value);
 free1:
 	mutex_unlock(&data->lock);
+	kfree (kbuf);
 	return value;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 077/126] usb: gadget: udc: atmel: change setting for DMA
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (75 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 076/126] usb: gadget: gadgetfs: Free memory allocated by memdup_user() Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 078/126] [PATCH] usb: gadget: udc: atmel: fix possible IN hang issue Luis Henriques
                   ` (48 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Bo Shen, Felipe Balbi, Luis Henriques

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

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

From: Bo Shen <voice.shen@atmel.com>

commit f40afdddeb6c54ffd1e2920a5e93e363d6748db6 upstream.

According to the datasheet, when transfer using DMA, the control
setting for IN packet only need END_BUF_EN, END_BUF_IE, CH_EN,
while for OUT packet, need more two bits END_TR_EN and END_TR_IE
to be configured.

Fixes: 914a3f3b3754 (USB: add atmel_usba_udc driver)
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/udc/atmel_usba_udc.c ->
    drivers/usb/gadget/atmel_usba_udc.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/gadget/atmel_usba_udc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 76023ce449a3..9fff23fa1519 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -716,10 +716,10 @@ static int queue_dma(struct usba_udc *udc, struct usba_ep *ep,
 	req->using_dma = 1;
 	req->ctrl = USBA_BF(DMA_BUF_LEN, req->req.length)
 			| USBA_DMA_CH_EN | USBA_DMA_END_BUF_IE
-			| USBA_DMA_END_TR_EN | USBA_DMA_END_TR_IE;
+			| USBA_DMA_END_BUF_EN;
 
-	if (ep->is_in)
-		req->ctrl |= USBA_DMA_END_BUF_EN;
+	if (!ep->is_in)
+		req->ctrl |= USBA_DMA_END_TR_EN | USBA_DMA_END_TR_IE;
 
 	/*
 	 * Add this request to the queue and submit for DMA if
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 078/126] [PATCH] usb: gadget: udc: atmel: fix possible IN hang issue
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (76 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 077/126] usb: gadget: udc: atmel: change setting for DMA Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 079/126] ARM: imx6q: drop unnecessary semicolon Luis Henriques
                   ` (47 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Bo Shen, Felipe Balbi, Luis Henriques

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

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

From: Bo Shen <voice.shen@atmel.com>

commit 6785a1034461c2d2c205215f63a50a740896e55b upstream.

When receive data, the RXRDY in status register set by hardware
after a new packet has been stored in the endpoint FIFO. When it
is copied from FIFO, this bit is cleared which make the FIFO can
be accessed again.

In the receive_data() function, this bit RXRDY has been cleared.
So, after the receive_data() function return, this bit should
not be cleared again, or else it may cause the accessing FIFO
corrupt, which will make the data loss.

Fixes: 914a3f3b3754 (USB: add atmel_usba_udc driver)
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/udc/atmel_usba_udc.c ->
    drivers/usb/gadget/atmel_usba_udc.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/gadget/atmel_usba_udc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 9fff23fa1519..f34157a8dc22 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1572,7 +1572,6 @@ static void usba_ep_irq(struct usba_udc *udc, struct usba_ep *ep)
 	if ((epstatus & epctrl) & USBA_RX_BK_RDY) {
 		DBG(DBG_BUS, "%s: RX data ready\n", ep->ep.name);
 		receive_data(ep);
-		usba_ep_writel(ep, CLR_STA, USBA_RX_BK_RDY);
 	}
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 079/126] ARM: imx6q: drop unnecessary semicolon
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (77 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 078/126] [PATCH] usb: gadget: udc: atmel: fix possible IN hang issue Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 080/126] ARM: clk-imx6q: fix video divider for rev T0 1.0 Luis Henriques
                   ` (46 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dmitry Voytik, Shawn Guo, Luis Henriques

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

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

From: Dmitry Voytik <voytikd@gmail.com>

commit d2a10a1727b3948019128e83162f22c65859f1fd upstream.

Drop unnecessary semicolon after closing curly bracket.

Signed-off-by: Dmitry Voytik <voytikd@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
[ luis: 3.16-stable prereq for:
  9351c09fb16f "usb: gadget: udc: atmel: fix possible IN hang issue" ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-imx/clk-imx6q.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 8556c787e59c..e9f8dbc360f6 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -164,7 +164,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 		post_div_table[2].div = 1;
 		video_div_table[1].div = 1;
 		video_div_table[2].div = 1;
-	};
+	}
 
 	/*                   type                               name         parent_name  base     div_mask */
 	clk[pll1_sys]      = imx_clk_pllv3(IMX_PLLV3_SYS,	"pll1_sys",	"osc", base,        0x7f);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 080/126] ARM: clk-imx6q: fix video divider for rev T0 1.0
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (78 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 079/126] ARM: imx6q: drop unnecessary semicolon Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 081/126] ARM: dts: imx25: Fix the SPI1 clocks Luis Henriques
                   ` (45 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Gary Bisson, Shawn Guo, Luis Henriques

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

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

From: Gary Bisson <bisson.gary@gmail.com>

commit 81ef447950bf0955aca46f4a7617d8ce435cf0ce upstream.

The post dividers do not work on i.MX6Q rev T0 1.0 so they must be fixed
to 1. As the table index was wrong, a divider a of 4 could still be
requested which implied the clock not to be set properly. This is the
root cause of the HDMI not working at high resolution on rev T0 1.0 of
the SoC.

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-imx/clk-imx6q.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index e9f8dbc360f6..3433b10ca968 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -163,7 +163,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 		post_div_table[1].div = 1;
 		post_div_table[2].div = 1;
 		video_div_table[1].div = 1;
-		video_div_table[2].div = 1;
+		video_div_table[3].div = 1;
 	}
 
 	/*                   type                               name         parent_name  base     div_mask */
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 081/126] ARM: dts: imx25: Fix the SPI1 clocks
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (79 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 080/126] ARM: clk-imx6q: fix video divider for rev T0 1.0 Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 082/126] USB: cp210x: fix ID for production CEL MeshConnect USB Stick Luis Henriques
                   ` (44 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Fabio Estevam, Shawn Guo, Luis Henriques

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

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

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

commit 7a87e9cbc3a2f0ff0955815335e08c9862359130 upstream.

>From Documentation/devicetree/bindings/clock/imx25-clock.txt:

	cspi1_ipg		78
	cspi2_ipg		79
	cspi3_ipg		80

, so fix the SPI1 clocks accordingly to avoid a kernel hang when trying to
access SPI1.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/imx25.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
index bb74d9582b7e..37421df1686b 100644
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -162,7 +162,7 @@
 				#size-cells = <0>;
 				compatible = "fsl,imx25-cspi", "fsl,imx35-cspi";
 				reg = <0x43fa4000 0x4000>;
-				clocks = <&clks 62>, <&clks 62>;
+				clocks = <&clks 78>, <&clks 78>;
 				clock-names = "ipg", "per";
 				interrupts = <14>;
 				status = "disabled";
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 082/126] USB: cp210x: fix ID for production CEL MeshConnect USB Stick
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (80 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 081/126] ARM: dts: imx25: Fix the SPI1 clocks Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 083/126] USB: keyspan: fix null-deref at probe Luis Henriques
                   ` (43 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Preston Fick, Johan Hovold, Luis Henriques

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

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

From: Preston Fick <pffick@gmail.com>

commit 90441b4dbe90ba0c38111ea89fa093a8c9627801 upstream.

Fixing typo for MeshConnect IDs. The original PID (0x8875) is not in
production and is not needed. Instead it has been changed to the
official production PID (0x8857).

Signed-off-by: Preston Fick <pffick@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/cp210x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 5741e9405069..74d6587f643a 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -120,7 +120,7 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
 	{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
 	{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
-	{ USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */
+	{ USB_DEVICE(0x10C4, 0x8857) }, /* CEL MeshConnect USB Stick */
 	{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
 	{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
 	{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 083/126] USB: keyspan: fix null-deref at probe
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (81 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 082/126] USB: cp210x: fix ID for production CEL MeshConnect USB Stick Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 084/126] iwlwifi: mvm: fix Rx with both chains Luis Henriques
                   ` (42 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit b5122236bba8d7ef62153da5b55cc65d0944c61e upstream.

Fix null-pointer dereference during probe if the interface-status
completion handler is called before the individual ports have been set
up.

Fixes: f79b2d0fe81e ("USB: keyspan: fix NULL-pointer dereferences and
memory leaks")
Reported-by: Richard <richjunk@pacbell.net>
Tested-by: Richard <richjunk@pacbell.net>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/keyspan.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 077c714f1285..e07b15ed5814 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -410,6 +410,8 @@ static void	usa26_instat_callback(struct urb *urb)
 	}
 	port = serial->port[msg->port];
 	p_priv = usb_get_serial_port_data(port);
+	if (!p_priv)
+		goto resubmit;
 
 	/* Update handshaking pin state information */
 	old_dcd_state = p_priv->dcd_state;
@@ -420,7 +422,7 @@ static void	usa26_instat_callback(struct urb *urb)
 
 	if (old_dcd_state != p_priv->dcd_state)
 		tty_port_tty_hangup(&port->port, true);
-
+resubmit:
 	/* Resubmit urb so we continue receiving */
 	err = usb_submit_urb(urb, GFP_ATOMIC);
 	if (err != 0)
@@ -527,6 +529,8 @@ static void	usa28_instat_callback(struct urb *urb)
 	}
 	port = serial->port[msg->port];
 	p_priv = usb_get_serial_port_data(port);
+	if (!p_priv)
+		goto resubmit;
 
 	/* Update handshaking pin state information */
 	old_dcd_state = p_priv->dcd_state;
@@ -537,7 +541,7 @@ static void	usa28_instat_callback(struct urb *urb)
 
 	if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
 		tty_port_tty_hangup(&port->port, true);
-
+resubmit:
 		/* Resubmit urb so we continue receiving */
 	err = usb_submit_urb(urb, GFP_ATOMIC);
 	if (err != 0)
@@ -607,6 +611,8 @@ static void	usa49_instat_callback(struct urb *urb)
 	}
 	port = serial->port[msg->portNumber];
 	p_priv = usb_get_serial_port_data(port);
+	if (!p_priv)
+		goto resubmit;
 
 	/* Update handshaking pin state information */
 	old_dcd_state = p_priv->dcd_state;
@@ -617,7 +623,7 @@ static void	usa49_instat_callback(struct urb *urb)
 
 	if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
 		tty_port_tty_hangup(&port->port, true);
-
+resubmit:
 	/* Resubmit urb so we continue receiving */
 	err = usb_submit_urb(urb, GFP_ATOMIC);
 	if (err != 0)
@@ -855,6 +861,8 @@ static void	usa90_instat_callback(struct urb *urb)
 
 	port = serial->port[0];
 	p_priv = usb_get_serial_port_data(port);
+	if (!p_priv)
+		goto resubmit;
 
 	/* Update handshaking pin state information */
 	old_dcd_state = p_priv->dcd_state;
@@ -865,7 +873,7 @@ static void	usa90_instat_callback(struct urb *urb)
 
 	if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
 		tty_port_tty_hangup(&port->port, true);
-
+resubmit:
 	/* Resubmit urb so we continue receiving */
 	err = usb_submit_urb(urb, GFP_ATOMIC);
 	if (err != 0)
@@ -926,6 +934,8 @@ static void	usa67_instat_callback(struct urb *urb)
 
 	port = serial->port[msg->port];
 	p_priv = usb_get_serial_port_data(port);
+	if (!p_priv)
+		goto resubmit;
 
 	/* Update handshaking pin state information */
 	old_dcd_state = p_priv->dcd_state;
@@ -934,7 +944,7 @@ static void	usa67_instat_callback(struct urb *urb)
 
 	if (old_dcd_state != p_priv->dcd_state && old_dcd_state)
 		tty_port_tty_hangup(&port->port, true);
-
+resubmit:
 	/* Resubmit urb so we continue receiving */
 	err = usb_submit_urb(urb, GFP_ATOMIC);
 	if (err != 0)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 084/126] iwlwifi: mvm: fix Rx with both chains
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (82 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 083/126] USB: keyspan: fix null-deref at probe Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 085/126] ARM: imx6sx: Set PLL2 as parent of QSPI clocks Luis Henriques
                   ` (41 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eyal Shapira, Emmanuel Grumbach, Luis Henriques

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

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

From: Eyal Shapira <eyal@wizery.com>

commit c93edc639392df733c7d72db4376a9add775d18a upstream.

commit 5c90422439d6
"iwlwifi: mvm: don't allow diversity if BT Coex / TT forbid it"
broke Rx with 2 chains for diversity.
This had an impact on throughput where we're using only a single
stream (11a/b/g APs, single stream APs, static SMPS).

Fixes: 5c90422439d6 ("iwlwifi: mvm: don't allow diversity if BT Coex / TT forbid it")
Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/wireless/iwlwifi/mvm/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c
index aa9fc77e8413..3aba78dff0ba 100644
--- a/drivers/net/wireless/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/iwlwifi/mvm/utils.c
@@ -673,7 +673,7 @@ bool iwl_mvm_rx_diversity_allowed(struct iwl_mvm *mvm)
 	if (num_of_ant(mvm->fw->valid_rx_ant) == 1)
 		return false;
 
-	if (!mvm->cfg->rx_with_siso_diversity)
+	if (mvm->cfg->rx_with_siso_diversity)
 		return false;
 
 	ieee80211_iterate_active_interfaces_atomic(
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 085/126] ARM: imx6sx: Set PLL2 as parent of QSPI clocks
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (83 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 084/126] iwlwifi: mvm: fix Rx with both chains Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 086/126] ARM: omap5/dra7xx: Fix frequency typos Luis Henriques
                   ` (40 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Fabio Estevam, Shawn Guo, Luis Henriques

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

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

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

commit 7c168ed898931f6c3314d696e63cf993378ca192 upstream.

The default qspi2_clk_sel field of register CCM_CS2CDR contains '110' which is
marked as 'reserved', so we can't rely on the default value.

Provide a proper parent for QSPI clocks to avoid a kernel oops:

[    1.037920] Division by zero in kernel.
[    1.041807] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc7-next-20141204-00002-g5aa23e1 #2143
[    1.050967] Hardware name: Freescale i.MX6 SoloX (Device Tree)
[    1.056853] Backtrace:
[    1.059360] [<80011ea0>] (dump_backtrace) from [<8001203c>] (show_stack+0x18/0x1c)
[    1.066982]  r6:00000000 r5:00000000 r4:00000000 r3:00000000
[    1.072754] [<80012024>] (show_stack) from [<806b7100>] (dump_stack+0x88/0xa4)
[    1.080038] [<806b7078>] (dump_stack) from [<80011d20>] (__div0+0x18/0x20)
[    1.086958]  r5:be018500 r4:be017c00
[    1.090600] [<80011d08>] (__div0) from [<802aa418>] (Ldiv0+0x8/0x10)
[    1.097012] [<80504fbc>] (clk_divider_set_rate) from [<80503ddc>] (clk_change_rate+0x14c/0x17c)
[    1.105759]  r7:00000000 r6:00000000 r5:be018500 r4:00000000
[    1.111516] [<80503c90>] (clk_change_rate) from [<80503ea0>] (clk_set_rate+0x94/0x98)
[    1.119391]  r8:be7e0368 r7:00000000 r6:be11a000 r5:be018500 r4:00000000 r3:00000000
[    1.127290] [<80503e0c>] (clk_set_rate) from [<80410558>] (fsl_qspi_probe+0x23c/0x75c)
[    1.135260]  r5:be11a010 r4:be350010
[    1.138900] [<8041031c>] (fsl_qspi_probe) from [<80385a18>] (platform_drv_probe+0x50/0xac)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-imx/clk-imx6sx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c
index 72f8902235d1..ac8ea72f28ab 100644
--- a/arch/arm/mach-imx/clk-imx6sx.c
+++ b/arch/arm/mach-imx/clk-imx6sx.c
@@ -515,6 +515,9 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
 	clk_set_parent(clks[IMX6SX_CLK_GPU_CORE_SEL], clks[IMX6SX_CLK_PLL3_PFD0]);
 	clk_set_parent(clks[IMX6SX_CLK_GPU_AXI_SEL], clks[IMX6SX_CLK_PLL3_PFD0]);
 
+	clk_set_parent(clks[IMX6SX_CLK_QSPI1_SEL], clks[IMX6SX_CLK_PLL2_BUS]);
+	clk_set_parent(clks[IMX6SX_CLK_QSPI2_SEL], clks[IMX6SX_CLK_PLL2_BUS]);
+
 	/* Set initial power mode */
 	imx6q_set_lpm(WAIT_CLOCKED);
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 086/126] ARM: omap5/dra7xx: Fix frequency typos
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (84 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 085/126] ARM: imx6sx: Set PLL2 as parent of QSPI clocks Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 087/126] ARM: omap5/dra7xx: Enable booting secondary CPU in HYP mode Luis Henriques
                   ` (39 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Len Sorensen, Tony Lindgren, Luis Henriques

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

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

From: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>

commit 572b24e6d85d98cdc552f07e9fb9870d9460d81b upstream.

The switch statement of the possible list of SYSCLK1 frequencies is
missing a 0 in 4 out of the 7 frequencies.

Fixes: fa6d79d27614 ("ARM: OMAP: Add initialisation for the real-time counter")
Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-omap2/timer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 43d03fbf4c0b..b1418a2c06e5 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -513,11 +513,11 @@ static void __init realtime_counter_init(void)
 	rate = clk_get_rate(sys_clk);
 	/* Numerator/denumerator values refer TRM Realtime Counter section */
 	switch (rate) {
-	case 1200000:
+	case 12000000:
 		num = 64;
 		den = 125;
 		break;
-	case 1300000:
+	case 13000000:
 		num = 768;
 		den = 1625;
 		break;
@@ -529,11 +529,11 @@ static void __init realtime_counter_init(void)
 		num = 192;
 		den = 625;
 		break;
-	case 2600000:
+	case 26000000:
 		num = 384;
 		den = 1625;
 		break;
-	case 2700000:
+	case 27000000:
 		num = 256;
 		den = 1125;
 		break;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 087/126] ARM: omap5/dra7xx: Enable booting secondary CPU in HYP mode
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (85 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 086/126] ARM: omap5/dra7xx: Fix frequency typos Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 088/126] LOCKD: Fix a race when initialising nlmsvc_timeout Luis Henriques
                   ` (38 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Len Sorensen, Tony Lindgren, Luis Henriques

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

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

From: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>

commit 999f934de195a1506089b52c77429fdba25da688 upstream.

If the boot loader enables HYP mode on the boot CPU, the secondary CPU
also needs to call into the ROM to switch to HYP mode before booting.
The firmwares on the omap5 and dra7xx unfortunately do not take care
of this, so it has to be handled by the kernel.

This patch is based on "[PATCH 2/2] ARM: OMAP5: Add HYP mode entry support
for secondary CPUs" by Santosh Shilimkar <santosh.shilimkar@ti.com>,
except this version does not require a compile time CONFIG to control
if it should enable HYP mode or not, it simply does it based on the mode
of the boot CPU, so it works whether the CPU boots in SVC or HYP mode,
and should even work as a guest kernel inside kvm if qemu decides to
support emulating the omap5 or dra7xx.

Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-omap2/common.h       |  1 +
 arch/arm/mach-omap2/omap-headsmp.S | 21 +++++++++++++++++++++
 arch/arm/mach-omap2/omap-smp.c     | 13 +++++++++++--
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index dc571f1d3b8a..1582eb03e8b0 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -270,6 +270,7 @@ extern void omap4_cpu_die(unsigned int cpu);
 extern struct smp_operations omap4_smp_ops;
 
 extern void omap5_secondary_startup(void);
+extern void omap5_secondary_hyp_startup(void);
 #endif
 
 #if defined(CONFIG_SMP) && defined(CONFIG_PM)
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S
index 4993d4bfe9b2..6d1dffca6c7b 100644
--- a/arch/arm/mach-omap2/omap-headsmp.S
+++ b/arch/arm/mach-omap2/omap-headsmp.S
@@ -22,6 +22,7 @@
 
 /* Physical address needed since MMU not enabled yet on secondary core */
 #define AUX_CORE_BOOT0_PA			0x48281800
+#define API_HYP_ENTRY				0x102
 
 /*
  * OMAP5 specific entry point for secondary CPU to jump from ROM
@@ -41,6 +42,26 @@ wait:	ldr	r2, =AUX_CORE_BOOT0_PA	@ read from AuxCoreBoot0
 	b	secondary_startup
 ENDPROC(omap5_secondary_startup)
 /*
+ * Same as omap5_secondary_startup except we call into the ROM to
+ * enable HYP mode first.  This is called instead of
+ * omap5_secondary_startup if the primary CPU was put into HYP mode by
+ * the boot loader.
+ */
+ENTRY(omap5_secondary_hyp_startup)
+wait_2:	ldr	r2, =AUX_CORE_BOOT0_PA	@ read from AuxCoreBoot0
+	ldr	r0, [r2]
+	mov	r0, r0, lsr #5
+	mrc	p15, 0, r4, c0, c0, 5
+	and	r4, r4, #0x0f
+	cmp	r0, r4
+	bne	wait_2
+	ldr	r12, =API_HYP_ENTRY
+	adr	r0, hyp_boot
+	smc	#0
+hyp_boot:
+	b	secondary_startup
+ENDPROC(omap5_secondary_hyp_startup)
+/*
  * OMAP4 specific entry point for secondary CPU to jump from ROM
  * code.  This routine also provides a holding flag into which
  * secondary core is held until we're ready for it to initialise.
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 256e84ef0f67..5305ec7341ec 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -22,6 +22,7 @@
 #include <linux/irqchip/arm-gic.h>
 
 #include <asm/smp_scu.h>
+#include <asm/virt.h>
 
 #include "omap-secure.h"
 #include "omap-wakeupgen.h"
@@ -227,8 +228,16 @@ static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
 	if (omap_secure_apis_support())
 		omap_auxcoreboot_addr(virt_to_phys(startup_addr));
 	else
-		writel_relaxed(virt_to_phys(omap5_secondary_startup),
-			       base + OMAP_AUX_CORE_BOOT_1);
+		/*
+		 * If the boot CPU is in HYP mode then start secondary
+		 * CPU in HYP mode as well.
+		 */
+		if ((__boot_cpu_mode & MODE_MASK) == HYP_MODE)
+			writel_relaxed(virt_to_phys(omap5_secondary_hyp_startup),
+				       base + OMAP_AUX_CORE_BOOT_1);
+		else
+			writel_relaxed(virt_to_phys(omap5_secondary_startup),
+				       base + OMAP_AUX_CORE_BOOT_1);
 
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 088/126] LOCKD: Fix a race when initialising nlmsvc_timeout
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (86 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 087/126] ARM: omap5/dra7xx: Enable booting secondary CPU in HYP mode Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 089/126] NFSv4.1: Fix client id trunking on Linux Luis Henriques
                   ` (37 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bruce Fields, Trond Myklebust, Luis Henriques

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

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

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

commit 06bed7d18c2c07b3e3eeadf4bd357f6e806618cc upstream.

This commit fixes a race whereby nlmclnt_init() first starts the lockd
daemon, and then calls nlm_bind_host() with the expectation that
nlmsvc_timeout has already been initialised. Unfortunately, there is no
no synchronisation between lockd() and lockd_up() to guarantee that this
is the case.

Fix is to move the initialisation of nlmsvc_timeout into lockd_create_svc

Fixes: 9a1b6bf818e74 ("LOCKD: Don't call utsname()->nodename...")
Cc: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/lockd/svc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index ec9e082f9ecd..3f5a7248e771 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -137,10 +137,6 @@ lockd(void *vrqstp)
 
 	dprintk("NFS locking service started (ver " LOCKD_VERSION ").\n");
 
-	if (!nlm_timeout)
-		nlm_timeout = LOCKD_DFLT_TIMEO;
-	nlmsvc_timeout = nlm_timeout * HZ;
-
 	/*
 	 * The main request loop. We don't terminate until the last
 	 * NFS mount or NFS daemon has gone away.
@@ -346,6 +342,10 @@ static struct svc_serv *lockd_create_svc(void)
 		printk(KERN_WARNING
 			"lockd_up: no pid, %d users??\n", nlmsvc_users);
 
+	if (!nlm_timeout)
+		nlm_timeout = LOCKD_DFLT_TIMEO;
+	nlmsvc_timeout = nlm_timeout * HZ;
+
 	serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL);
 	if (!serv) {
 		printk(KERN_WARNING "lockd_up: create service failed\n");
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 089/126] NFSv4.1: Fix client id trunking on Linux
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (87 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 088/126] LOCKD: Fix a race when initialising nlmsvc_timeout Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 090/126] ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling Luis Henriques
                   ` (36 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chuck Lever, Trond Myklebust, Luis Henriques

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

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

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

commit 1fc0703af3143914a389bfa081c7acb09502ed5d upstream.

Currently, our trunking code will check for session trunking, but will
fail to detect client id trunking. This is a problem, because it means
that the client will fail to recognise that the two connections represent
shared state, even if they do not permit a shared session.
By removing the check for the server minor id, and only checking the
major id, we will end up doing the right thing in both cases: we close
down the new nfs_client and fall back to using the existing one.

Fixes: 05f4c350ee02e ("NFS: Discover NFSv4 server trunking when mounting")
Cc: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nfs/nfs4client.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 6e045d5ee950..79b077df7f6f 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -572,20 +572,14 @@ static bool nfs4_match_clientids(struct nfs_client *a, struct nfs_client *b)
 }
 
 /*
- * Returns true if the server owners match
+ * Returns true if the server major ids match
  */
 static bool
-nfs4_match_serverowners(struct nfs_client *a, struct nfs_client *b)
+nfs4_check_clientid_trunking(struct nfs_client *a, struct nfs_client *b)
 {
 	struct nfs41_server_owner *o1 = a->cl_serverowner;
 	struct nfs41_server_owner *o2 = b->cl_serverowner;
 
-	if (o1->minor_id != o2->minor_id) {
-		dprintk("NFS: --> %s server owner minor IDs do not match\n",
-			__func__);
-		return false;
-	}
-
 	if (o1->major_id_sz != o2->major_id_sz)
 		goto out_major_mismatch;
 	if (memcmp(o1->major_id, o2->major_id, o1->major_id_sz) != 0)
@@ -661,7 +655,12 @@ int nfs41_walk_client_list(struct nfs_client *new,
 		if (!nfs4_match_clientids(pos, new))
 			continue;
 
-		if (!nfs4_match_serverowners(pos, new))
+		/*
+		 * Note that session trunking is just a special subcase of
+		 * client id trunking. In either case, we want to fall back
+		 * to using the existing nfs_client.
+		 */
+		if (!nfs4_check_clientid_trunking(pos, new))
 			continue;
 
 		atomic_inc(&pos->cl_count);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 090/126] ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (88 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 089/126] NFSv4.1: Fix client id trunking on Linux Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 091/126] USB: cp210x: add IDs for CEL USB sticks and MeshWorks devices Luis Henriques
                   ` (35 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Fabio Estevam, Shawn Guo, Luis Henriques

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

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

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

commit 7a9f0604bd56936b2b18f49824e0e392dc7878c3 upstream.

GPIO2_5 is the reset GPIO for the USB3317 ULPI PHY. Instead of modelling it as
a regulator, the correct approach is to use the 'reset_gpios' property of the
"usb-nop-xceiv" node.

GPIO1_7 is the reset GPIO for the USB2517 USB hub. As we currently don't have
dt bindings to describe a HUB reset, let's keep using the regulator approach.

Rename the regulator to 'reg_hub_reset' to better describe its function and bind
it with the USB host1 port instead.

USB host support has been introduced by commit 9bf206a9d13be3 ("ARM: dts:
imx51-babbage: Add USB Host1 support"), which landed in 3.16 and it seems that
USB has only been functional due to previous bootloader initialization.

With this patch applied we can get USB host to work without relying on the
bootloader.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/imx51-babbage.dts | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index 181d77fa2fa6..bc7138a1efca 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -127,24 +127,12 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		reg_usbh1_vbus: regulator@0 {
-			compatible = "regulator-fixed";
-			pinctrl-names = "default";
-			pinctrl-0 = <&pinctrl_usbh1reg>;
-			reg = <0>;
-			regulator-name = "usbh1_vbus";
-			regulator-min-microvolt = <5000000>;
-			regulator-max-microvolt = <5000000>;
-			gpio = <&gpio2 5 GPIO_ACTIVE_HIGH>;
-			enable-active-high;
-		};
-
-		reg_usbotg_vbus: regulator@1 {
+		reg_hub_reset: regulator@0 {
 			compatible = "regulator-fixed";
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_usbotgreg>;
-			reg = <1>;
-			regulator-name = "usbotg_vbus";
+			reg = <0>;
+			regulator-name = "hub_reset";
 			regulator-min-microvolt = <5000000>;
 			regulator-max-microvolt = <5000000>;
 			gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
@@ -176,6 +164,7 @@
 			reg = <0>;
 			clocks = <&clks IMX5_CLK_DUMMY>;
 			clock-names = "main_clk";
+			reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
 		};
 	};
 };
@@ -419,7 +408,7 @@
 &usbh1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usbh1>;
-	vbus-supply = <&reg_usbh1_vbus>;
+	vbus-supply = <&reg_hub_reset>;
 	fsl,usbphy = <&usbh1phy>;
 	phy_type = "ulpi";
 	status = "okay";
@@ -429,7 +418,6 @@
 	dr_mode = "otg";
 	disable-over-current;
 	phy_type = "utmi_wide";
-	vbus-supply = <&reg_usbotg_vbus>;
 	status = "okay";
 };
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 091/126] USB: cp210x: add IDs for CEL USB sticks and MeshWorks devices
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (89 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 090/126] ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 092/126] vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion Luis Henriques
                   ` (34 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Peterson, Johan Hovold, Luis Henriques

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

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

From: David Peterson <david.peterson@cel.com>

commit 1ae78a4870989a354028cb17dabf819b595e70e3 upstream.

Added virtual com port VID/PID entries for CEL USB sticks and MeshWorks
devices.

Signed-off-by: David Peterson <david.peterson@cel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/cp210x.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 74d6587f643a..9e8708c5cbfa 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -120,10 +120,12 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
 	{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
 	{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
-	{ USB_DEVICE(0x10C4, 0x8857) }, /* CEL MeshConnect USB Stick */
+	{ USB_DEVICE(0x10C4, 0x8856) },	/* CEL EM357 ZigBee USB Stick - LR */
+	{ USB_DEVICE(0x10C4, 0x8857) },	/* CEL EM357 ZigBee USB Stick */
 	{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
 	{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
 	{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
+	{ USB_DEVICE(0x10C4, 0x8977) },	/* CEL MeshWorks DevKit Device */
 	{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
 	{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
 	{ USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 092/126] vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (90 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 091/126] USB: cp210x: add IDs for CEL USB sticks and MeshWorks devices Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 093/126] USB: qcserial/option: make AT URCs work for Sierra Wireless MC73xx Luis Henriques
                   ` (33 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christoph Hellwig, Michael S. Tsirkin, Paolo Bonzini,
	Nicholas Bellinger, Luis Henriques

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

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

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

commit 46243860806bdc2756f3ce8ac86b4d7c616bcd6c upstream.

While looking at hch's recent conversion to drop the MSG_*_TAG
definitions, I noticed a long standing bug in vhost-scsi where
the VIRTIO_SCSI_S_* attribute definitions where incorrectly
being passed directly into target_submit_cmd_map_sgls().

This patch adds the missing virtio-scsi to TCM/SAM task attribute
conversion.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ luis: backported to 3.16:
  - replaced TCM_*_TAG by MSG_*_TAG ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/vhost/scsi.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index a17f11850669..befe07b1e71d 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -909,6 +909,23 @@ vhost_scsi_map_iov_to_prot(struct tcm_vhost_cmd *cmd,
 	return 0;
 }
 
+static int vhost_scsi_to_tcm_attr(int attr)
+{
+	switch (attr) {
+	case VIRTIO_SCSI_S_SIMPLE:
+		return MSG_SIMPLE_TAG;
+	case VIRTIO_SCSI_S_ORDERED:
+		return MSG_ORDERED_TAG;
+	case VIRTIO_SCSI_S_HEAD:
+		return MSG_HEAD_TAG;
+	case VIRTIO_SCSI_S_ACA:
+		return MSG_ACA_TAG;
+	default:
+		break;
+	}
+	return MSG_SIMPLE_TAG;
+}
+
 static void tcm_vhost_submission_work(struct work_struct *work)
 {
 	struct tcm_vhost_cmd *cmd =
@@ -934,9 +951,10 @@ static void tcm_vhost_submission_work(struct work_struct *work)
 	rc = target_submit_cmd_map_sgls(se_cmd, tv_nexus->tvn_se_sess,
 			cmd->tvc_cdb, &cmd->tvc_sense_buf[0],
 			cmd->tvc_lun, cmd->tvc_exp_data_len,
-			cmd->tvc_task_attr, cmd->tvc_data_direction,
-			TARGET_SCF_ACK_KREF, sg_ptr, cmd->tvc_sgl_count,
-			NULL, 0, sg_prot_ptr, cmd->tvc_prot_sgl_count);
+			vhost_scsi_to_tcm_attr(cmd->tvc_task_attr),
+			cmd->tvc_data_direction, TARGET_SCF_ACK_KREF,
+			sg_ptr, cmd->tvc_sgl_count, NULL, 0, sg_prot_ptr,
+			cmd->tvc_prot_sgl_count);
 	if (rc < 0) {
 		transport_send_check_condition_and_sense(se_cmd,
 				TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 093/126] USB: qcserial/option: make AT URCs work for Sierra Wireless MC73xx
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (91 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 092/126] vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 094/126] ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host Luis Henriques
                   ` (32 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Reinhard Speyerer, Johan Hovold, Luis Henriques

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

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

From: Reinhard Speyerer <rspmn@arcor.de>

commit d80c0d14183516f184a5ac88e11008ee4c7d2a2e upstream.

As has been discussed in the thread starting with
https://lkml.kernel.org/g/549748e9.d+SiJzqu50f1r4lSAL043YSc@arcor.de
Sierra Wireless MC73xx devices with USB VID/PID 0x1199:0x68c0 require the
option_send_setup() code to be used on the USB interface for the AT port
to make unsolicited response codes work correctly. Move these devices from
the qcserial driver where they have been added by commit
70a3615fc07c2330ed7c1e922f3c44f4a67c0762 ("usb: qcserial: add Sierra Wireless
MC73xx") to the option driver and add a MC73xx-specific blacklist
to ensure that
1. the sendsetup code is not used for the DIAG/DM and NMEA interfaces
2. the option driver does not attach to the QMI/network interfaces

Signed-off-by: Reinhard Speyerer <rspmn@arcor.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/option.c   | 11 ++++++++++-
 drivers/usb/serial/qcserial.c |  1 -
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index e87219a0f2f7..0cdbb6c56674 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -234,6 +234,8 @@ static void option_instat_callback(struct urb *urb);
 
 #define QUALCOMM_VENDOR_ID			0x05C6
 
+#define SIERRA_VENDOR_ID			0x1199
+
 #define CMOTECH_VENDOR_ID			0x16d8
 #define CMOTECH_PRODUCT_6001			0x6001
 #define CMOTECH_PRODUCT_CMU_300			0x6002
@@ -511,7 +513,7 @@ enum option_blacklist_reason {
 		OPTION_BLACKLIST_RESERVED_IF = 2
 };
 
-#define MAX_BL_NUM  8
+#define MAX_BL_NUM  11
 struct option_blacklist_info {
 	/* bitfield of interface numbers for OPTION_BLACKLIST_SENDSETUP */
 	const unsigned long sendsetup;
@@ -600,6 +602,11 @@ static const struct option_blacklist_info telit_le920_blacklist = {
 	.reserved = BIT(1) | BIT(5),
 };
 
+static const struct option_blacklist_info sierra_mc73xx_blacklist = {
+	.sendsetup = BIT(0) | BIT(2),
+	.reserved = BIT(8) | BIT(10) | BIT(11),
+};
+
 static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -1097,6 +1104,8 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
 	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
 	{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
+	{ USB_DEVICE_INTERFACE_CLASS(SIERRA_VENDOR_ID, 0x68c0, 0xff),
+	  .driver_info = (kernel_ulong_t)&sierra_mc73xx_blacklist }, /* MC73xx */
 	{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
 	{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
 	{ USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index cb3e14780a7e..9c63897b3a56 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -142,7 +142,6 @@ static const struct usb_device_id id_table[] = {
 	{DEVICE_SWI(0x0f3d, 0x68a2)},	/* Sierra Wireless MC7700 */
 	{DEVICE_SWI(0x114f, 0x68a2)},	/* Sierra Wireless MC7750 */
 	{DEVICE_SWI(0x1199, 0x68a2)},	/* Sierra Wireless MC7710 */
-	{DEVICE_SWI(0x1199, 0x68c0)},	/* Sierra Wireless MC73xx */
 	{DEVICE_SWI(0x1199, 0x901c)},	/* Sierra Wireless EM7700 */
 	{DEVICE_SWI(0x1199, 0x901f)},	/* Sierra Wireless EM7355 */
 	{DEVICE_SWI(0x1199, 0x9040)},	/* Sierra Wireless Modem */
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 094/126] ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (92 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 093/126] USB: qcserial/option: make AT URCs work for Sierra Wireless MC73xx Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 095/126] ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT Luis Henriques
                   ` (31 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jisheng Zhang, Sebastian Hesselbarth, Luis Henriques

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

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

From: Jisheng Zhang <jszhang@marvell.com>

commit 96ed6046d3bf1113de3bdbd6dbb7f40e6d0ae0ef upstream.

On BG2Q, the sdhci2 host uses nfcecc for "io" clk and nfc for "core" clk.
The shdci2 can't work without this patch due to the "core" clk is gated.

Fixes: 0d859a6a9d14 ("ARM: dts: berlin: add the SDHCI nodes for the BG2Q")
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/berlin2q.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/berlin2q.dtsi b/arch/arm/boot/dts/berlin2q.dtsi
index 635a16a64cb4..39b181dc6fab 100644
--- a/arch/arm/boot/dts/berlin2q.dtsi
+++ b/arch/arm/boot/dts/berlin2q.dtsi
@@ -82,7 +82,8 @@
 			compatible = "mrvl,pxav3-mmc";
 			reg = <0xab1000 0x200>;
 			interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&chip CLKID_SDIO1XIN>;
+			clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>;
+			clock-names = "io", "core";
 			status = "disabled";
 		};
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 095/126] ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (93 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 094/126] ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 096/126] ARM: dts: berlin: correct BG2Q's SM GPIO location Luis Henriques
                   ` (30 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jisheng Zhang, Sebastian Hesselbarth, Luis Henriques

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

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

From: Jisheng Zhang <jszhang@marvell.com>

commit 5adba7c2daaecccf377e7ed5a2996caedd5384f1 upstream.

There's no card detection for the eMMC, so this patch adds the missing
broken-cd property. This patch also sets bus width as 8 to add
MMC_CAP_8_BIT_DATA in the Host capabilities.

Fixes: 3047086dfd56 ("ARM: dts: berlin: enable SD card reader and eMMC for the BG2Q DMP")
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/berlin2q-marvell-dmp.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/berlin2q-marvell-dmp.dts b/arch/arm/boot/dts/berlin2q-marvell-dmp.dts
index 995150f93795..22e5dfe77f09 100644
--- a/arch/arm/boot/dts/berlin2q-marvell-dmp.dts
+++ b/arch/arm/boot/dts/berlin2q-marvell-dmp.dts
@@ -30,6 +30,8 @@
 };
 
 &sdhci2 {
+	broken-cd;
+	bus-width = <8>;
 	non-removable;
 	status = "okay";
 };
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 096/126] ARM: dts: berlin: correct BG2Q's SM GPIO location.
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (94 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 095/126] ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 097/126] xhci: Check if slot is already in default state before moving it there Luis Henriques
                   ` (29 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jisheng Zhang, Sebastian Hesselbarth, Luis Henriques

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

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

From: Jisheng Zhang <jszhang@marvell.com>

commit 5138d5c562e3bfe30964e20ab46eec9f8b89225d upstream.

The gpio4 and gpio5 are in 0xf7fc0000 apb which is located in the SM domain.
This patch moves gpio4 and gpio5 to the correct location. This patch also
renames them as the following to match the names we internally used in
marvell:
	gpio4 -> sm_gpio1
	gpio5 -> sm_gpio0
	porte -> portf
	portf -> porte

This also matches what we did for BG2 and BG2CD's SM GPIO.

Fixes: cedf57fc4f2f ("ARM: dts: berlin: add the BG2Q GPIO nodes")
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/berlin2q.dtsi | 60 ++++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/arch/arm/boot/dts/berlin2q.dtsi b/arch/arm/boot/dts/berlin2q.dtsi
index 39b181dc6fab..dc773bb4b6cd 100644
--- a/arch/arm/boot/dts/berlin2q.dtsi
+++ b/arch/arm/boot/dts/berlin2q.dtsi
@@ -264,36 +264,6 @@
 				interrupt-parent = <&gic>;
 				interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
 			};
-
-			gpio4: gpio@5000 {
-				compatible = "snps,dw-apb-gpio";
-				reg = <0x5000 0x400>;
-				#address-cells = <1>;
-				#size-cells = <0>;
-
-				porte: gpio-port@4 {
-					compatible = "snps,dw-apb-gpio-port";
-					gpio-controller;
-					#gpio-cells = <2>;
-					snps,nr-gpios = <32>;
-					reg = <0>;
-				};
-			};
-
-			gpio5: gpio@c000 {
-				compatible = "snps,dw-apb-gpio";
-				reg = <0xc000 0x400>;
-				#address-cells = <1>;
-				#size-cells = <0>;
-
-				portf: gpio-port@5 {
-					compatible = "snps,dw-apb-gpio-port";
-					gpio-controller;
-					#gpio-cells = <2>;
-					snps,nr-gpios = <32>;
-					reg = <0>;
-				};
-			};
 		};
 
 		chip: chip-control@ea0000 {
@@ -312,6 +282,21 @@
 			ranges = <0 0xfc0000 0x10000>;
 			interrupt-parent = <&sic>;
 
+			sm_gpio1: gpio@5000 {
+				compatible = "snps,dw-apb-gpio";
+				reg = <0x5000 0x400>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				portf: gpio-port@5 {
+					compatible = "snps,dw-apb-gpio-port";
+					gpio-controller;
+					#gpio-cells = <2>;
+					snps,nr-gpios = <32>;
+					reg = <0>;
+				};
+			};
+
 			uart0: uart@9000 {
 				compatible = "snps,dw-apb-uart";
 				reg = <0x9000 0x100>;
@@ -336,6 +321,21 @@
 				status = "disabled";
 			};
 
+			sm_gpio0: gpio@c000 {
+				compatible = "snps,dw-apb-gpio";
+				reg = <0xc000 0x400>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				porte: gpio-port@4 {
+					compatible = "snps,dw-apb-gpio-port";
+					gpio-controller;
+					#gpio-cells = <2>;
+					snps,nr-gpios = <32>;
+					reg = <0>;
+				};
+			};
+
 			sysctrl: pin-controller@d000 {
 				compatible = "marvell,berlin2q-system-ctrl";
 				reg = <0xd000 0x100>;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 097/126] xhci: Check if slot is already in default state before moving it there
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (95 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 096/126] ARM: dts: berlin: correct BG2Q's SM GPIO location Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 098/126] USB: EHCI: fix initialization bug in iso_stream_schedule() Luis Henriques
                   ` (28 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mathias Nyman, Greg Kroah-Hartman, Luis Henriques

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

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit f161ead70fa6a62e432dff6e9dab8e3cfbeabea6 upstream.

Solves xhci error cases with debug messages:
xhci_hcd 0000:00:14.0: Setup ERROR: setup context command for slot 1.
usb 1-6: hub failed to enable device, error -22

xhci will give a context state error if we try to set a slot in default
state to the same default state with a special address device command.

Turns out this happends in several cases:
- retry reading the device rescriptor in hub_port_init()
- usb_reset_device() is called for a slot in default state
- in resume path, usb_port_resume() calls hub_port_init()

The default state is usually reached from most states with a reset device
command without any context state errors, but using the address device
command with BSA bit set (block set address) only works from the enabled
state and will otherwise cause context error.

solve this by checking if we are already in the default state before issuing
a address device BSA=1 command.

Fixes: 48fc7dbd52c0 ("usb: xhci: change enumeration scheme to 'new scheme'")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 5e5f0c1b6613..b61913116fe2 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3812,6 +3812,15 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
 		return -EINVAL;
 	}
 
+	if (setup == SETUP_CONTEXT_ONLY) {
+		slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx);
+		if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) ==
+		    SLOT_STATE_DEFAULT) {
+			xhci_dbg(xhci, "Slot already in default state\n");
+			return 0;
+		}
+	}
+
 	command = xhci_alloc_command(xhci, false, false, GFP_KERNEL);
 	if (!command)
 		return -ENOMEM;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 098/126] USB: EHCI: fix initialization bug in iso_stream_schedule()
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (96 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 097/126] xhci: Check if slot is already in default state before moving it there Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 099/126] xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers Luis Henriques
                   ` (27 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, Greg Kroah-Hartman, Luis Henriques

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

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

From: Alan Stern <stern@rowland.harvard.edu>

commit 6d89252a998a695ecb0348fc2d717dc33d90cae9 upstream.

Commit c3ee9b76aa93 (EHCI: improved logic for isochronous scheduling)
introduced the idea of using ehci->last_iso_frame as the origin (or
base) for the circular calculations involved in modifying the
isochronous schedule.  However, the new code it added used
ehci->last_iso_frame before the value was properly initialized.  This
patch rectifies the mistake by moving the initialization lines earlier
in iso_stream_schedule().

This fixes Bugzilla #72891.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Fixes: c3ee9b76aa93
Reported-by: Joe Bryant <tenminjoe@yahoo.com>
Tested-by: Joe Bryant <tenminjoe@yahoo.com>
Tested-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/ehci-sched.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index e113fd73aeae..c399606f154e 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1581,6 +1581,10 @@ iso_stream_schedule (
 	else
 		next = (now + 2 + 7) & ~0x07;	/* full frame cache */
 
+	/* If needed, initialize last_iso_frame so that this URB will be seen */
+	if (ehci->isoc_count == 0)
+		ehci->last_iso_frame = now >> 3;
+
 	/*
 	 * Use ehci->last_iso_frame as the base.  There can't be any
 	 * TDs scheduled for earlier than that.
@@ -1671,10 +1675,6 @@ iso_stream_schedule (
 	urb->start_frame = start & (mod - 1);
 	if (!stream->highspeed)
 		urb->start_frame >>= 3;
-
-	/* Make sure scan_isoc() sees these */
-	if (ehci->isoc_count == 0)
-		ehci->last_iso_frame = now >> 3;
 	return status;
 
  fail:
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 099/126] xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (97 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 098/126] USB: EHCI: fix initialization bug in iso_stream_schedule() Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 100/126] uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013 Luis Henriques
                   ` (26 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit 7f5c4d631aed243ca89c6673427954210b1628ec upstream.

Streams do not work reliabe on Fresco Logic FL1000G xhci controllers,
trying to use them results in errors like this:

21:37:33 kernel: xhci_hcd 0000:04:00.0: ERROR Transfer event for disabled endpoint or incorrect stream ring
21:37:33 kernel: xhci_hcd 0000:04:00.0: @00000000368b3570 9067b000 00000000 05000000 01078001
21:37:33 kernel: xhci_hcd 0000:04:00.0: ERROR Transfer event for disabled endpoint or incorrect stream ring
21:37:33 kernel: xhci_hcd 0000:04:00.0: @00000000368b3580 9067b400 00000000 05000000 01038001

As always I've ordered a pci-e addon card with a Fresco Logic controller for
myself to see if I can come up with a better fix then the big hammer, in
the mean time this will make uas devices work again (in usb-storage mode)
for FL1000G users.

Reported-by: Marcin Zajączkowski <mszpak@wp.pl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/host/xhci-pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index e614d1831e79..fd8c8e669cac 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -80,6 +80,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 				"must be suspended extra slowly",
 				pdev->revision);
 		}
+		if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK)
+			xhci->quirks |= XHCI_BROKEN_STREAMS;
 		/* Fresco Logic confirms: all revisions of this chip do not
 		 * support MSI, even though some of them claim to in their PCI
 		 * capabilities.
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 100/126] uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (98 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 099/126] xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 101/126] uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 " Luis Henriques
                   ` (25 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit e5797a3d079f3e5049140055d850691b5cc7d10a upstream.

This is yet another Seagate device which needs the US_FL_NO_ATA_1X quirk

Reported-by: Marcin Zajączkowski <mszpak@wp.pl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/storage/unusual_uas.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
index 18a283d6de1c..2918376a1979 100644
--- a/drivers/usb/storage/unusual_uas.h
+++ b/drivers/usb/storage/unusual_uas.h
@@ -68,6 +68,13 @@ UNUSUAL_DEV(0x0bc2, 0xa003, 0x0000, 0x9999,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_NO_ATA_1X),
 
+/* Reported-by: Marcin Zajączkowski <mszpak@wp.pl> */
+UNUSUAL_DEV(0x0bc2, 0xa013, 0x0000, 0x9999,
+		"Seagate",
+		"Backup Plus",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_NO_ATA_1X),
+
 /* https://bbs.archlinux.org/viewtopic.php?id=183190 */
 UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999,
 		"Seagate",
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 101/126] uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 with usb-id 0bc2:a013
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (99 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 100/126] uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013 Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 102/126] uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures Luis Henriques
                   ` (24 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit c6fa3945c8b5baf62f2e849104ecd6f3a1e5e407 upstream.

Like the JMicron JMS567 enclosures with the JMS566 choke on report-opcodes,
so avoid it.

Tested-and-reported-by: Takeo Nakayama <javhera@gmx.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/storage/unusual_uas.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
index 2918376a1979..2f0a3d35269a 100644
--- a/drivers/usb/storage/unusual_uas.h
+++ b/drivers/usb/storage/unusual_uas.h
@@ -111,6 +111,13 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_NO_ATA_1X),
 
+/* Reported-by: Takeo Nakayama <javhera@gmx.com> */
+UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999,
+		"JMicron",
+		"JMS566",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_NO_REPORT_OPCODES),
+
 /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
 UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
 		"Hitachi",
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 102/126] uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (100 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 101/126] uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 " Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 103/126] OHCI: add a quirk for ULi M5237 blocking on reset Luis Henriques
                   ` (23 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit 3ca8c717429b90f621aed28af029da4c3da378bc upstream.

Just like all previous UAS capable Seagate disk enclosures, these need the
US_FL_NO_ATA_1X to not crash when udev probes them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/storage/unusual_uas.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
index 2f0a3d35269a..1f430bb02ca1 100644
--- a/drivers/usb/storage/unusual_uas.h
+++ b/drivers/usb/storage/unusual_uas.h
@@ -75,6 +75,13 @@ UNUSUAL_DEV(0x0bc2, 0xa013, 0x0000, 0x9999,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_NO_ATA_1X),
 
+/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
+UNUSUAL_DEV(0x0bc2, 0xa0a4, 0x0000, 0x9999,
+		"Seagate",
+		"Backup Plus Desk",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_NO_ATA_1X),
+
 /* https://bbs.archlinux.org/viewtopic.php?id=183190 */
 UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999,
 		"Seagate",
@@ -89,6 +96,13 @@ UNUSUAL_DEV(0x0bc2, 0xab21, 0x0000, 0x9999,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_NO_ATA_1X),
 
+/* Reported-by: G. Richard Bellamy <rbellamy@pteradigm.com> */
+UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999,
+		"Seagate",
+		"BUP Fast HDD",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_NO_ATA_1X),
+
 /* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */
 UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999,
 		"JMicron",
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 103/126] OHCI: add a quirk for ULi M5237 blocking on reset
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (101 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 102/126] uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 104/126] mei: clean reset bit before reset Luis Henriques
                   ` (22 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Arseny Solokha, Greg Kroah-Hartman, Luis Henriques

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

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

From: Arseny Solokha <asolokha@kb.kras.ru>

commit 56abcab833fafcfaeb2f5b25e0364c1dec45f53e upstream.

Commit 8dccddbc2368 ("OHCI: final fix for NVIDIA problems (I hope)")
introduced into 3.1.9 broke boot on e.g. Freescale P2020DS development
board. The code path that was previously specific to NVIDIA controllers
had then become taken for all chips.

However, the M5237 installed on the board wedges solid when accessing
its base+OHCI_FMINTERVAL register, making it impossible to boot any
kernel newer than 3.1.8 on this particular and apparently other similar
machines.

Don't readl() and writel() base+OHCI_FMINTERVAL on PCI ID 10b9:5237.

The patch is suitable for the -next tree as well as all maintained
kernels up to 3.2 inclusive.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
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/pci-quirks.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 2f3acebb577a..f4e6b945136c 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -571,7 +571,8 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
 {
 	void __iomem *base;
 	u32 control;
-	u32 fminterval;
+	u32 fminterval = 0;
+	bool no_fminterval = false;
 	int cnt;
 
 	if (!mmio_resource_enabled(pdev, 0))
@@ -581,6 +582,13 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
 	if (base == NULL)
 		return;
 
+	/*
+	 * ULi M5237 OHCI controller locks the whole system when accessing
+	 * the OHCI_FMINTERVAL offset.
+	 */
+	if (pdev->vendor == PCI_VENDOR_ID_AL && pdev->device == 0x5237)
+		no_fminterval = true;
+
 	control = readl(base + OHCI_CONTROL);
 
 /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
@@ -619,7 +627,9 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
 	}
 
 	/* software reset of the controller, preserving HcFmInterval */
-	fminterval = readl(base + OHCI_FMINTERVAL);
+	if (!no_fminterval)
+		fminterval = readl(base + OHCI_FMINTERVAL);
+
 	writel(OHCI_HCR, base + OHCI_CMDSTATUS);
 
 	/* reset requires max 10 us delay */
@@ -628,7 +638,9 @@ static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
 			break;
 		udelay(1);
 	}
-	writel(fminterval, base + OHCI_FMINTERVAL);
+
+	if (!no_fminterval)
+		writel(fminterval, base + OHCI_FMINTERVAL);
 
 	/* Now the controller is safely in SUSPEND and nothing can wake it up */
 	iounmap(base);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 104/126] mei: clean reset bit before reset
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (102 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 103/126] OHCI: add a quirk for ULi M5237 blocking on reset Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 105/126] target: Drop arbitrary maximum I/O size limit Luis Henriques
                   ` (21 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexander Usyskin, Tomas Winkler, Greg Kroah-Hartman, Luis Henriques

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

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

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

commit b13a65ef190e488e2761d65bdd2e1fe8a3a125f5 upstream.

H_RST bit in H_CSR register may be found lit before reset is started,
for example if preceding reset flow hasn't completed.
In that case asserting H_RST will be ignored, therefore we need to clean
H_RST bit to start a successful reset sequence.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ luis: backported to 3.16:
  - replace dev->dev by &dev->pdev->dev ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/misc/mei/hw-me.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 6a2d272cea43..9d0cd32d885a 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -196,6 +196,18 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
 	struct mei_me_hw *hw = to_me_hw(dev);
 	u32 hcsr = mei_hcsr_read(hw);
 
+	/* H_RST may be found lit before reset is started,
+	 * for example if preceding reset flow hasn't completed.
+	 * In that case asserting H_RST will be ignored, therefore
+	 * we need to clean H_RST bit to start a successful reset sequence.
+	 */
+	if ((hcsr & H_RST) == H_RST) {
+		dev_warn(&dev->pdev->dev, "H_RST is set = 0x%08X", hcsr);
+		hcsr &= ~H_RST;
+		mei_me_reg_write(hw, H_CSR, hcsr);
+		hcsr = mei_hcsr_read(hw);
+	}
+
 	hcsr |= H_RST | H_IG | H_IS;
 
 	if (intr_enable)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 105/126] target: Drop arbitrary maximum I/O size limit
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (103 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 104/126] mei: clean reset bit before reset Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 106/126] usb: gadget: udc: atmel: fix possible oops when unloading module Luis Henriques
                   ` (20 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christoph Hellwig, Martin K. Petersen, Roland Dreier,
	Nicholas Bellinger, Luis Henriques

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

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

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

commit 046ba64285a4389ae5e9a7dfa253c6bff3d7c341 upstream.

This patch drops the arbitrary maximum I/O size limit in sbc_parse_cdb(),
which currently for fabric_max_sectors is hardcoded to 8192 (4 MB for 512
byte sector devices), and for hw_max_sectors is a backend driver dependent
value.

This limit is problematic because Linux initiators have only recently
started to honor block limits MAXIMUM TRANSFER LENGTH, and other non-Linux
based initiators (eg: MSFT Fibre Channel) can also generate I/Os larger
than 4 MB in size.

Currently when this happens, the following message will appear on the
target resulting in I/Os being returned with non recoverable status:

  SCSI OP 28h with too big sectors 16384 exceeds fabric_max_sectors: 8192

Instead, drop both [fabric,hw]_max_sector checks in sbc_parse_cdb(),
and convert the existing hw_max_sectors into a purely informational
attribute used to represent the granuality that backend driver and/or
subsystem code is splitting I/Os upon.

Also, update FILEIO with an explicit FD_MAX_BYTES check in fd_execute_rw()
to deal with the one special iovec limitiation case.

v2 changes:
  - Drop hw_max_sectors check in sbc_parse_cdb()

Reported-by: Lance Gropper <lance.gropper@qosserver.com>
Reported-by: Stefan Priebe <s.priebe@profihost.ag>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/target/target_core_device.c |  8 ++++----
 drivers/target/target_core_file.c   | 11 ++++++++++-
 drivers/target/target_core_iblock.c |  2 +-
 drivers/target/target_core_sbc.c    | 15 ---------------
 drivers/target/target_core_spc.c    |  5 +----
 5 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 15a1c133ec05..e205bdbe14b2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -1153,10 +1153,10 @@ int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
 				" changed for TCM/pSCSI\n", dev);
 		return -EINVAL;
 	}
-	if (optimal_sectors > dev->dev_attrib.fabric_max_sectors) {
+	if (optimal_sectors > dev->dev_attrib.hw_max_sectors) {
 		pr_err("dev[%p]: Passed optimal_sectors %u cannot be"
-			" greater than fabric_max_sectors: %u\n", dev,
-			optimal_sectors, dev->dev_attrib.fabric_max_sectors);
+			" greater than hw_max_sectors: %u\n", dev,
+			optimal_sectors, dev->dev_attrib.hw_max_sectors);
 		return -EINVAL;
 	}
 
@@ -1565,7 +1565,6 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
 				DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT;
 	dev->dev_attrib.max_write_same_len = DA_MAX_WRITE_SAME_LEN;
 	dev->dev_attrib.fabric_max_sectors = DA_FABRIC_MAX_SECTORS;
-	dev->dev_attrib.optimal_sectors = DA_FABRIC_MAX_SECTORS;
 
 	xcopy_lun = &dev->xcopy_lun;
 	xcopy_lun->lun_se_dev = dev;
@@ -1606,6 +1605,7 @@ int target_configure_device(struct se_device *dev)
 	dev->dev_attrib.hw_max_sectors =
 		se_dev_align_max_sectors(dev->dev_attrib.hw_max_sectors,
 					 dev->dev_attrib.hw_block_size);
+	dev->dev_attrib.optimal_sectors = dev->dev_attrib.hw_max_sectors;
 
 	dev->dev_index = scsi_get_new_index(SCSI_DEVICE_INDEX);
 	dev->creation_time = get_jiffies_64();
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 7d6cddaec525..6f9f0c499813 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -620,7 +620,16 @@ fd_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
 	struct fd_prot fd_prot;
 	sense_reason_t rc;
 	int ret = 0;
-
+	/*
+	 * We are currently limited by the number of iovecs (2048) per
+	 * single vfs_[writev,readv] call.
+	 */
+	if (cmd->data_length > FD_MAX_BYTES) {
+		pr_err("FILEIO: Not able to process I/O of %u bytes due to"
+		       "FD_MAX_BYTES: %u iovec count limitiation\n",
+			cmd->data_length, FD_MAX_BYTES);
+		return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
+	}
 	/*
 	 * Call vectorized fileio functions to map struct scatterlist
 	 * physical memory addresses to struct iovec virtual memory.
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 7e6b857c6b3f..be27773ab829 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -123,7 +123,7 @@ static int iblock_configure_device(struct se_device *dev)
 	q = bdev_get_queue(bd);
 
 	dev->dev_attrib.hw_block_size = bdev_logical_block_size(bd);
-	dev->dev_attrib.hw_max_sectors = UINT_MAX;
+	dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
 	dev->dev_attrib.hw_queue_depth = q->nr_requests;
 
 	/*
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index bd78d9235ac6..8368870dc01f 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -953,21 +953,6 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 
 	if (cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) {
 		unsigned long long end_lba;
-
-		if (sectors > dev->dev_attrib.fabric_max_sectors) {
-			printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
-				" big sectors %u exceeds fabric_max_sectors:"
-				" %u\n", cdb[0], sectors,
-				dev->dev_attrib.fabric_max_sectors);
-			return TCM_INVALID_CDB_FIELD;
-		}
-		if (sectors > dev->dev_attrib.hw_max_sectors) {
-			printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
-				" big sectors %u exceeds backend hw_max_sectors:"
-				" %u\n", cdb[0], sectors,
-				dev->dev_attrib.hw_max_sectors);
-			return TCM_INVALID_CDB_FIELD;
-		}
 check_lba:
 		end_lba = dev->transport->get_blocks(dev) + 1;
 		if (cmd->t_task_lba + sectors > end_lba) {
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index 6cd7222738fc..2f1c928210b3 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -505,7 +505,6 @@ static sense_reason_t
 spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
 {
 	struct se_device *dev = cmd->se_dev;
-	u32 max_sectors;
 	int have_tp = 0;
 	int opt, min;
 
@@ -539,9 +538,7 @@ spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
 	/*
 	 * Set MAXIMUM TRANSFER LENGTH
 	 */
-	max_sectors = min(dev->dev_attrib.fabric_max_sectors,
-			  dev->dev_attrib.hw_max_sectors);
-	put_unaligned_be32(max_sectors, &buf[8]);
+	put_unaligned_be32(dev->dev_attrib.hw_max_sectors, &buf[8]);
 
 	/*
 	 * Set OPTIMAL TRANSFER LENGTH
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 106/126] usb: gadget: udc: atmel: fix possible oops when unloading module
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (104 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 105/126] target: Drop arbitrary maximum I/O size limit Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 107/126] USB: console: fix uninitialised ldisc semaphore Luis Henriques
                   ` (19 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Songjun Wu, Nicolas Ferre, Felipe Balbi, Luis Henriques

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

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

From: Songjun Wu <songjun.wu@atmel.com>

commit 5fb694f96e7c19e66b1c55124b98812e32e3efa5 upstream.

When unloading the module 'g_hid.ko', the urb request will be dequeued and the
completion routine will be excuted. If there is no urb packet, the urb request
will not be added to the endpoint queue and the completion routine pointer in
urb request is NULL.

Accessing to this NULL function pointer will cause the Oops issue reported
below.

Add the code to check if the urb request is in the endpoint queue
or not. If the urb request is not in the endpoint queue, a negative
error code will be returned.

Here is the Oops log:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = dedf0000
[00000000] *pgd=3ede5831, *pte=00000000, *ppte=00000000
Internal error: Oops: 80000007 [#1] ARM
Modules linked in: g_hid(-) usb_f_hid libcomposite
CPU: 0 PID: 923 Comm: rmmod Not tainted 3.18.0+ #2
Hardware name: Atmel SAMA5 (Device Tree)
task: df6b1100 ti: dedf6000 task.ti: dedf6000
PC is at 0x0
LR is at usb_gadget_giveback_request+0xc/0x10
pc : [<00000000>]    lr : [<c02ace88>]    psr: 60000093
sp : dedf7eb0  ip : df572634  fp : 00000000
r10: 00000000  r9 : df52e210  r8 : 60000013
r7 : df6a9858  r6 : df52e210  r5 : df6a9858  r4 : df572600
r3 : 00000000  r2 : ffffff98  r1 : df572600  r0 : df6a9868
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 3edf0059  DAC: 00000015
Process rmmod (pid: 923, stack limit = 0xdedf6230)
Stack: (0xdedf7eb0 to 0xdedf8000)
7ea0:                                     00000000 c02adbbc df572580 deced608
7ec0: df572600 df6a9868 df572634 c02aed3c df577c00 c01b8608 00000000 df6be27c
7ee0: 00200200 00100100 bf0162f4 c000e544 dedf6000 00000000 00000000 bf010c00
7f00: bf0162cc bf00159c 00000000 df572980 df52e218 00000001 df5729b8 bf0031d0
[..]
[<c02ace88>] (usb_gadget_giveback_request) from [<c02adbbc>] (request_complete+0x64/0x88)
[<c02adbbc>] (request_complete) from [<c02aed3c>] (usba_ep_dequeue+0x70/0x128)
[<c02aed3c>] (usba_ep_dequeue) from [<bf010c00>] (hidg_unbind+0x50/0x7c [usb_f_hid])
[<bf010c00>] (hidg_unbind [usb_f_hid]) from [<bf00159c>] (remove_config.isra.6+0x98/0x9c [libcomposite])
[<bf00159c>] (remove_config.isra.6 [libcomposite]) from [<bf0031d0>] (__composite_unbind+0x34/0x98 [libcomposite])
[<bf0031d0>] (__composite_unbind [libcomposite]) from [<c02acee0>] (usb_gadget_remove_driver+0x50/0x78)
[<c02acee0>] (usb_gadget_remove_driver) from [<c02ad570>] (usb_gadget_unregister_driver+0x64/0x94)
[<c02ad570>] (usb_gadget_unregister_driver) from [<bf0160c0>] (hidg_cleanup+0x10/0x34 [g_hid])
[<bf0160c0>] (hidg_cleanup [g_hid]) from [<c0056748>] (SyS_delete_module+0x118/0x19c)
[<c0056748>] (SyS_delete_module) from [<c000e3c0>] (ret_fast_syscall+0x0/0x30)
Code: bad PC value

Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
[nicolas.ferre@atmel.com: reworked the commit message]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Fixes: 914a3f3b3754 ("USB: add atmel_usba_udc driver")
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ luis: backported to 3.16:
  - file rename: drivers/usb/gadget/udc/atmel_usba_udc.c ->
    drivers/usb/gadget/atmel_usba_udc.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/gadget/atmel_usba_udc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index f34157a8dc22..892bd9765f3b 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -828,7 +828,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
 {
 	struct usba_ep *ep = to_usba_ep(_ep);
 	struct usba_udc *udc = ep->udc;
-	struct usba_request *req = to_usba_req(_req);
+	struct usba_request *req;
 	unsigned long flags;
 	u32 status;
 
@@ -837,6 +837,16 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
 
 	spin_lock_irqsave(&udc->lock, flags);
 
+	list_for_each_entry(req, &ep->queue, queue) {
+		if (&req->req == _req)
+			break;
+	}
+
+	if (&req->req != _req) {
+		spin_unlock_irqrestore(&udc->lock, flags);
+		return -EINVAL;
+	}
+
 	if (req->using_dma) {
 		/*
 		 * If this request is currently being transferred,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 107/126] USB: console: fix uninitialised ldisc semaphore
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (105 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 106/126] usb: gadget: udc: atmel: fix possible oops when unloading module Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 108/126] USB: console: fix potential use after free Luis Henriques
                   ` (18 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit d269d4434c72ed0da3a9b1230c30da82c4918c63 upstream.

The USB console currently allocates a temporary fake tty which is used
to pass terminal settings to the underlying serial driver.

The tty struct is not fully initialised, something which can lead to a
lockdep warning (or worse) if a serial driver tries to acquire a
line-discipline reference:

	usbserial: USB Serial support registered for pl2303
	pl2303 1-2.1:1.0: pl2303 converter detected
	usb 1-2.1: pl2303 converter now attached to ttyUSB0
	INFO: trying to register non-static key.
	the code is fine but needs lockdep annotation.
	turning off the locking correctness validator.
	CPU: 0 PID: 68 Comm: udevd Tainted: G        W      3.18.0-rc5 #10
	[<c0016f04>] (unwind_backtrace) from [<c0013978>] (show_stack+0x20/0x24)
	[<c0013978>] (show_stack) from [<c0449794>] (dump_stack+0x24/0x28)
	[<c0449794>] (dump_stack) from [<c006f730>] (__lock_acquire+0x1e50/0x2004)
	[<c006f730>] (__lock_acquire) from [<c0070128>] (lock_acquire+0xe4/0x18c)
	[<c0070128>] (lock_acquire) from [<c027c6f8>] (ldsem_down_read_trylock+0x78/0x90)
	[<c027c6f8>] (ldsem_down_read_trylock) from [<c027a1cc>] (tty_ldisc_ref+0x24/0x58)
	[<c027a1cc>] (tty_ldisc_ref) from [<c0340760>] (usb_serial_handle_dcd_change+0x48/0xe8)
	[<c0340760>] (usb_serial_handle_dcd_change) from [<bf000484>] (pl2303_read_int_callback+0x210/0x220 [pl2303])
	[<bf000484>] (pl2303_read_int_callback [pl2303]) from [<c031624c>] (__usb_hcd_giveback_urb+0x80/0x140)
	[<c031624c>] (__usb_hcd_giveback_urb) from [<c0316fc0>] (usb_giveback_urb_bh+0x98/0xd4)
	[<c0316fc0>] (usb_giveback_urb_bh) from [<c0042e44>] (tasklet_hi_action+0x9c/0x108)
	[<c0042e44>] (tasklet_hi_action) from [<c0042380>] (__do_softirq+0x148/0x42c)
	[<c0042380>] (__do_softirq) from [<c00429cc>] (irq_exit+0xd8/0x114)
	[<c00429cc>] (irq_exit) from [<c007ae58>] (__handle_domain_irq+0x84/0xdc)
	[<c007ae58>] (__handle_domain_irq) from [<c000879c>] (omap_intc_handle_irq+0xd8/0xe0)
	[<c000879c>] (omap_intc_handle_irq) from [<c0014544>] (__irq_svc+0x44/0x7c)
	Exception stack(0xdf4e7f08 to 0xdf4e7f50)
	7f00:                   debc0b80 df4e7f5c 00000000 00000000 debc0b80 be8da96c
	7f20: 00000000 00000128 c000fc84 df4e6000 00000000 df4e7f94 00000004 df4e7f50
	7f40: c038ebc0 c038d74c 600f0013 ffffffff
	[<c0014544>] (__irq_svc) from [<c038d74c>] (___sys_sendmsg.part.29+0x0/0x2e0)
	[<c038d74c>] (___sys_sendmsg.part.29) from [<c038ec08>] (SyS_sendmsg+0x18/0x1c)
	[<c038ec08>] (SyS_sendmsg) from [<c000fa00>] (ret_fast_syscall+0x0/0x48)
	console [ttyUSB0] enabled

Fixes: 36697529b5bb ("tty: Replace ldisc locking with ldisc_sem")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/console.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 8d7fc48b1f30..e56f394b58d8 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -140,6 +140,7 @@ static int usb_console_setup(struct console *co, char *options)
 			tty_port_tty_set(&port->port, tty);
 			tty->driver = usb_serial_tty_driver;
 			tty->index = co->index;
+			init_ldsem(&tty->ldisc_sem);
 			if (tty_init_termios(tty)) {
 				retval = -ENOMEM;
 				goto free_tty;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 108/126] USB: console: fix potential use after free
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (106 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 107/126] USB: console: fix uninitialised ldisc semaphore Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 109/126] mmc: sdhci-pxav3: fix error handling of sdhci_add_host Luis Henriques
                   ` (17 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit 32a4bf2e81ec378e5925d4e069e0677a6c86a6ad upstream.

Use tty kref to release the fake tty in usb_console_setup to avoid use
after free if the underlying serial driver has acquired a reference.

Note that using the tty destructor release_one_tty requires some more
state to be initialised.

Fixes: 4a90f09b20f4 ("tty: usb-serial krefs")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/serial/console.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index e56f394b58d8..29fa1c3d0089 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -46,6 +46,8 @@ static struct console usbcons;
  * ------------------------------------------------------------
  */
 
+static const struct tty_operations usb_console_fake_tty_ops = {
+};
 
 /*
  * The parsing of the command line works exactly like the
@@ -137,14 +139,17 @@ static int usb_console_setup(struct console *co, char *options)
 				goto reset_open_count;
 			}
 			kref_init(&tty->kref);
-			tty_port_tty_set(&port->port, tty);
 			tty->driver = usb_serial_tty_driver;
 			tty->index = co->index;
 			init_ldsem(&tty->ldisc_sem);
+			INIT_LIST_HEAD(&tty->tty_files);
+			kref_get(&tty->driver->kref);
+			tty->ops = &usb_console_fake_tty_ops;
 			if (tty_init_termios(tty)) {
 				retval = -ENOMEM;
-				goto free_tty;
+				goto put_tty;
 			}
+			tty_port_tty_set(&port->port, tty);
 		}
 
 		/* only call the device specific open if this
@@ -162,7 +167,7 @@ static int usb_console_setup(struct console *co, char *options)
 			serial->type->set_termios(tty, port, &dummy);
 
 			tty_port_tty_set(&port->port, NULL);
-			kfree(tty);
+			tty_kref_put(tty);
 		}
 		set_bit(ASYNCB_INITIALIZED, &port->port.flags);
 	}
@@ -178,8 +183,8 @@ static int usb_console_setup(struct console *co, char *options)
 
  fail:
 	tty_port_tty_set(&port->port, NULL);
- free_tty:
-	kfree(tty);
+ put_tty:
+	tty_kref_put(tty);
  reset_open_count:
 	port->port.count = 0;
 	usb_autopm_put_interface(serial->interface);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 109/126] mmc: sdhci-pxav3: fix error handling of sdhci_add_host
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (107 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 108/126] USB: console: fix potential use after free Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 110/126] mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks Luis Henriques
                   ` (16 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Xiang Wang, Ulf Hansson, Luis Henriques

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

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

From: Xiang Wang <wangx@marvell.com>

commit 87d2163dae1f2388c7ccda5269be8d58e24382dd upstream.

Commit 0dcaa2499b7d111bd70da5b0976c34210c850fb3 improved error
handling of sdhci_add_host. However, "err_of_parse" and "err_cd_req"
should be placed after "pm_runtime_disable(&pdev->dev)".

Signed-off-by: Xiang Wang <wangx@marvell.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[ luis: 3.16-stable prereq for:
  aa8165f91442 "mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks" ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-pxav3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 10846b04809a..6675be324cbc 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -382,11 +382,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_of_parse:
-err_cd_req:
 err_add_host:
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
+err_of_parse:
+err_cd_req:
 	clk_disable_unprepare(clk);
 	clk_put(clk);
 err_clk_get:
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 110/126] mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (108 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 109/126] mmc: sdhci-pxav3: fix error handling of sdhci_add_host Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 111/126] mmc: sdhci: Fix sleep in atomic after inserting SD card Luis Henriques
                   ` (15 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Petazzoni, Ulf Hansson, Luis Henriques

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

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

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

commit aa8165f914420f143476305a01894b017d3abe6b upstream.

In commit 5491ce3f79ee ("mmc: sdhci-pxav3: add support for the Armada
38x SDHCI controller"), the sdhci-pxav3 driver was extended to include
support for the SDHCI controller found in the Armada 38x
processor. This mainly involved adding some MBus window related
configuration.

However, this configuration is currently done too early in ->probe():
it is done before clocks are enabled, while this configuration
involves touching the registers of the controller, which will hang the
SoC if the clock is disabled. It wasn't noticed until now because the
bootloader typically leaves gatable clocks enabled, but in situations
where we have a deferred probe (due to a CD GPIO that cannot be taken,
for example), then the probe will be re-tried later, after a clock
disable has been done in the exit path of the failed probe attempt of
the device. This second probe() will hang the system due to the clock
being disabled.

This can for example be produced on Armada 385 GP, which has a CD GPIO
connected to an I2C PCA9555. If the driver for the PCA9555 is not
compiled into the kernel, then we will have the following sequence of
events:

  1. The SDHCI probes
  2. It does the MBus configuration (which works, because the clock is
     left enabled by the bootloader)
  3. It enables the clock
  4. It tries to get the CD GPIO, which fails due to the driver being
     missing, so -EPROBE_DEFER is returned.
  5. Before returning -EPROBE_DEFER, the driver cleans up what was
     done, which includes disabling the clock.
  6. Later on, the SDHCI probe is tried again.
  7. It does the MBus configuration, which hangs because the clock is
     no longer enabled.

This commit does the obvious fix of doing the MBus configuration after
the clock has been enabled by the driver.

Fixes: 5491ce3f79ee ("mmc: sdhci-pxav3: add support for the Armada 38x SDHCI controller")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-pxav3.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 6675be324cbc..bdfdf5273252 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -297,13 +297,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 		return PTR_ERR(host);
 	}
 
-	if (of_device_is_compatible(np, "marvell,armada-380-sdhci")) {
-		ret = mv_conf_mbus_windows(pdev, mv_mbus_dram_info());
-		if (ret < 0)
-			goto err_mbus_win;
-	}
-
-
 	pltfm_host = sdhci_priv(host);
 	pltfm_host->priv = pxa;
 
@@ -316,6 +309,12 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 	pltfm_host->clk = clk;
 	clk_prepare_enable(clk);
 
+	if (of_device_is_compatible(np, "marvell,armada-380-sdhci")) {
+		ret = mv_conf_mbus_windows(pdev, mv_mbus_dram_info());
+		if (ret < 0)
+			goto err_mbus_win;
+	}
+
 	/* enable 1/8V DDR capable */
 	host->mmc->caps |= MMC_CAP_1_8V_DDR;
 
@@ -387,10 +386,10 @@ err_add_host:
 	pm_runtime_disable(&pdev->dev);
 err_of_parse:
 err_cd_req:
+err_mbus_win:
 	clk_disable_unprepare(clk);
 	clk_put(clk);
 err_clk_get:
-err_mbus_win:
 	sdhci_pltfm_free(pdev);
 	kfree(pxa);
 	return ret;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 111/126] mmc: sdhci: Fix sleep in atomic after inserting SD card
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (109 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 110/126] mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 112/126] clk: at91: keep slow clk enabled to prevent system hang Luis Henriques
                   ` (14 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Krzysztof Kozlowski, Ulf Hansson, Luis Henriques

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

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

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

commit 2836766a9d0bd02c66073f8dd44796e6cc23848d upstream.

Sleep in atomic context happened on Trats2 board after inserting or
removing SD card because mmc_gpio_get_cd() was called under spin lock.

Fix this by moving card detection earlier, before acquiring spin lock.
The mmc_gpio_get_cd() call does not have to be protected by spin lock
because it does not access any sdhci internal data.
The sdhci_do_get_cd() call access host flags (SDHCI_DEVICE_DEAD). After
moving it out side of spin lock it could theoretically race with driver
removal but still there is no actual protection against manual card
eject.

Dmesg after inserting SD card:
[   41.663414] BUG: sleeping function called from invalid context at drivers/gpio/gpiolib.c:1511
[   41.670469] in_atomic(): 1, irqs_disabled(): 128, pid: 30, name: kworker/u8:1
[   41.677580] INFO: lockdep is turned off.
[   41.681486] irq event stamp: 61972
[   41.684872] hardirqs last  enabled at (61971): [<c0490ee0>] _raw_spin_unlock_irq+0x24/0x5c
[   41.693118] hardirqs last disabled at (61972): [<c04907ac>] _raw_spin_lock_irq+0x18/0x54
[   41.701190] softirqs last  enabled at (61648): [<c0026fd4>] __do_softirq+0x234/0x2c8
[   41.708914] softirqs last disabled at (61631): [<c00273a0>] irq_exit+0xd0/0x114
[   41.716206] Preemption disabled at:[<  (null)>]   (null)
[   41.721500]
[   41.722985] CPU: 3 PID: 30 Comm: kworker/u8:1 Tainted: G        W      3.18.0-rc5-next-20141121 #883
[   41.732111] Workqueue: kmmcd mmc_rescan
[   41.735945] [<c0014d2c>] (unwind_backtrace) from [<c0011c80>] (show_stack+0x10/0x14)
[   41.743661] [<c0011c80>] (show_stack) from [<c0489d14>] (dump_stack+0x70/0xbc)
[   41.750867] [<c0489d14>] (dump_stack) from [<c0228b74>] (gpiod_get_raw_value_cansleep+0x18/0x30)
[   41.759628] [<c0228b74>] (gpiod_get_raw_value_cansleep) from [<c03646e8>] (mmc_gpio_get_cd+0x38/0x58)
[   41.768821] [<c03646e8>] (mmc_gpio_get_cd) from [<c036d378>] (sdhci_request+0x50/0x1a4)
[   41.776808] [<c036d378>] (sdhci_request) from [<c0357934>] (mmc_start_request+0x138/0x268)
[   41.785051] [<c0357934>] (mmc_start_request) from [<c0357cc8>] (mmc_wait_for_req+0x58/0x1a0)
[   41.793469] [<c0357cc8>] (mmc_wait_for_req) from [<c0357e68>] (mmc_wait_for_cmd+0x58/0x78)
[   41.801714] [<c0357e68>] (mmc_wait_for_cmd) from [<c0361c00>] (mmc_io_rw_direct_host+0x98/0x124)
[   41.810480] [<c0361c00>] (mmc_io_rw_direct_host) from [<c03620f8>] (sdio_reset+0x2c/0x64)
[   41.818641] [<c03620f8>] (sdio_reset) from [<c035a3d8>] (mmc_rescan+0x254/0x2e4)
[   41.826028] [<c035a3d8>] (mmc_rescan) from [<c003a0e0>] (process_one_work+0x180/0x3f4)
[   41.833920] [<c003a0e0>] (process_one_work) from [<c003a3bc>] (worker_thread+0x34/0x4b0)
[   41.841991] [<c003a3bc>] (worker_thread) from [<c003fed8>] (kthread+0xe4/0x104)
[   41.849285] [<c003fed8>] (kthread) from [<c000f268>] (ret_from_fork+0x14/0x2c)
[   42.038276] mmc0: new high speed SDHC card at address 1234

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 94144a465dd0 ("mmc: sdhci: add get_cd() implementation")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 47055f3f01b8..1d92337f5e4d 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1308,6 +1308,8 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 
 	sdhci_runtime_pm_get(host);
 
+	present = mmc_gpio_get_cd(host->mmc);
+
 	spin_lock_irqsave(&host->lock, flags);
 
 	WARN_ON(host->mrq != NULL);
@@ -1336,7 +1338,6 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	 *     zero: cd-gpio is used, and card is removed
 	 *     one: cd-gpio is used, and card is present
 	 */
-	present = mmc_gpio_get_cd(host->mmc);
 	if (present < 0) {
 		/* If polling, assume that the card is always present. */
 		if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
@@ -2047,15 +2048,18 @@ static void sdhci_card_event(struct mmc_host *mmc)
 {
 	struct sdhci_host *host = mmc_priv(mmc);
 	unsigned long flags;
+	int present;
 
 	/* First check if client has provided their own card event */
 	if (host->ops->card_event)
 		host->ops->card_event(host);
 
+	present = sdhci_do_get_cd(host);
+
 	spin_lock_irqsave(&host->lock, flags);
 
 	/* Check host->mrq first in case we are runtime suspended */
-	if (host->mrq && !sdhci_do_get_cd(host)) {
+	if (host->mrq && !present) {
 		pr_err("%s: Card removed during transfer!\n",
 			mmc_hostname(host->mmc));
 		pr_err("%s: Resetting controller.\n",
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 112/126] clk: at91: keep slow clk enabled to prevent system hang
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (110 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 111/126] mmc: sdhci: Fix sleep in atomic after inserting SD card Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 113/126] clk: berlin: bg2q: remove non-exist "smemc" gate clock Luis Henriques
                   ` (13 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Boris Brezillon, Michael Turquette, Luis Henriques

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

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

From: Boris Brezillon <boris.brezillon@free-electrons.com>

commit dca1a4b5ff6e2c25adeff366eb06270dadeab3db upstream.

All slow clk users are not properly claiming it (get + prepare + enable)
before using it.
If all users properly claiming this clock release it, the clock is
disabled, but faulty users still depends on it, and the system hangs.

This fix prevents the slow clock from being disabled, and should solve the
hanging issue, but offending drivers should be patched to properly claim
this clock.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/clk/at91/clk-slow.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c
index 0300c46ee247..ef8d458cd74a 100644
--- a/drivers/clk/at91/clk-slow.c
+++ b/drivers/clk/at91/clk-slow.c
@@ -70,6 +70,7 @@ struct clk_sam9x5_slow {
 
 #define to_clk_sam9x5_slow(hw) container_of(hw, struct clk_sam9x5_slow, hw)
 
+static struct clk *slow_clk;
 
 static int clk_slow_osc_prepare(struct clk_hw *hw)
 {
@@ -357,6 +358,8 @@ at91_clk_register_sam9x5_slow(void __iomem *sckcr,
 	clk = clk_register(NULL, &slowck->hw);
 	if (IS_ERR(clk))
 		kfree(slowck);
+	else
+		slow_clk = clk;
 
 	return clk;
 }
@@ -433,6 +436,8 @@ at91_clk_register_sam9260_slow(struct at91_pmc *pmc,
 	clk = clk_register(NULL, &slowck->hw);
 	if (IS_ERR(clk))
 		kfree(slowck);
+	else
+		slow_clk = clk;
 
 	return clk;
 }
@@ -465,3 +470,25 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
 
 	of_clk_add_provider(np, of_clk_src_simple_get, clk);
 }
+
+/*
+ * FIXME: All slow clk users are not properly claiming it (get + prepare +
+ * enable) before using it.
+ * If all users properly claiming this clock decide that they don't need it
+ * anymore (or are removed), it is disabled while faulty users are still
+ * requiring it, and the system hangs.
+ * Prevent this clock from being disabled until all users are properly
+ * requesting it.
+ * Once this is done we should remove this function and the slow_clk variable.
+ */
+static int __init of_at91_clk_slow_retain(void)
+{
+	if (!slow_clk)
+		return 0;
+
+	__clk_get(slow_clk);
+	clk_prepare_enable(slow_clk);
+
+	return 0;
+}
+arch_initcall(of_at91_clk_slow_retain);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 113/126] clk: berlin: bg2q: remove non-exist "smemc" gate clock
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (111 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 112/126] clk: at91: keep slow clk enabled to prevent system hang Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 114/126] drivers: net: cpsw: fix multicast flush in dual emac mode Luis Henriques
                   ` (12 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jisheng Zhang, Michael Turquette, Luis Henriques

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

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

From: Jisheng Zhang <jszhang@marvell.com>

commit b71e8ecd57c8aae5b1815782c47b74ffe3efc09a upstream.

The "smemc" clock is removed on BG2Q SoCs. In fact, bit19 of clkenable
register is for nfc. Current code use bit19 for non-exist "smemc"
incorrectly, this prevents eMMC from working due to the sdhci's
"core" clk is still gated.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/clk/berlin/bg2q.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/berlin/bg2q.c b/drivers/clk/berlin/bg2q.c
index 21784e4eb3f0..440ef81ab15c 100644
--- a/drivers/clk/berlin/bg2q.c
+++ b/drivers/clk/berlin/bg2q.c
@@ -285,7 +285,6 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = {
 	{ "pbridge",	"perif",	15, CLK_IGNORE_UNUSED },
 	{ "sdio",	"perif",	16, CLK_IGNORE_UNUSED },
 	{ "nfc",	"perif",	18 },
-	{ "smemc",	"perif",	19 },
 	{ "pcie",	"perif",	22 },
 };
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 114/126] drivers: net: cpsw: fix multicast flush in dual emac mode
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (112 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 113/126] clk: berlin: bg2q: remove non-exist "smemc" gate clock Luis Henriques
@ 2015-01-27 12:16 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 115/126] usb: dwc3: gadget: Fix TRB preparation during SG Luis Henriques
                   ` (11 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:16 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mugunthan V N, David S. Miller, Luis Henriques

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

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

From: Mugunthan V N <mugunthanvnm@ti.com>

commit 25906052d953d3fbdb7e19480b9de5e6bb949f3f upstream.

Since ALE table is a common resource for both the interfaces in Dual EMAC
mode and while bringing up the second interface in cpsw_ndo_set_rx_mode()
all the multicast entries added by the first interface is flushed out and
only second interface multicast addresses are added. Fixing this by
flushing multicast addresses based on dual EMAC port vlans which will not
affect the other emac port multicast addresses.

Fixes: d9ba8f9 (driver: net: ethernet: cpsw: dual emac interface implementation)
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/ti/cpsw.c     | 11 +++++++++--
 drivers/net/ethernet/ti/cpsw_ale.c | 10 +++++++++-
 drivers/net/ethernet/ti/cpsw_ale.h |  2 +-
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 869a0d43dbe5..c944fbd0e30c 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -606,7 +606,7 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable)
 
 			/* Clear all mcast from ALE */
 			cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS <<
-						 priv->host_port);
+						 priv->host_port, -1);
 
 			/* Flood All Unicast Packets to Host port */
 			cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1);
@@ -630,6 +630,12 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable)
 static void cpsw_ndo_set_rx_mode(struct net_device *ndev)
 {
 	struct cpsw_priv *priv = netdev_priv(ndev);
+	int vid;
+
+	if (priv->data.dual_emac)
+		vid = priv->slaves[priv->emac_port].port_vlan;
+	else
+		vid = priv->data.default_vlan;
 
 	if (ndev->flags & IFF_PROMISC) {
 		/* Enable promiscuous mode */
@@ -641,7 +647,8 @@ static void cpsw_ndo_set_rx_mode(struct net_device *ndev)
 	}
 
 	/* Clear all mcast from ALE */
-	cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port);
+	cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port,
+				 vid);
 
 	if (!netdev_mc_empty(ndev)) {
 		struct netdev_hw_addr *ha;
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 7f893069c418..4eceb7e42c80 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -236,7 +236,7 @@ static void cpsw_ale_flush_mcast(struct cpsw_ale *ale, u32 *ale_entry,
 		cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
 }
 
-int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask)
+int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS];
 	int ret, idx;
@@ -247,6 +247,14 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask)
 		if (ret != ALE_TYPE_ADDR && ret != ALE_TYPE_VLAN_ADDR)
 			continue;
 
+		/* if vid passed is -1 then remove all multicast entry from
+		 * the table irrespective of vlan id, if a valid vlan id is
+		 * passed then remove only multicast added to that vlan id.
+		 * if vlan id doesn't match then move on to next entry.
+		 */
+		if (vid != -1 && cpsw_ale_get_vlan_id(ale_entry) != vid)
+			continue;
+
 		if (cpsw_ale_get_mcast(ale_entry)) {
 			u8 addr[6];
 
diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h
index de409c33b250..e701358fd00b 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.h
+++ b/drivers/net/ethernet/ti/cpsw_ale.h
@@ -88,7 +88,7 @@ void cpsw_ale_stop(struct cpsw_ale *ale);
 
 int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout);
 int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask);
-int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask);
+int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid);
 int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port,
 		       int flags, u16 vid);
 int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 115/126] usb: dwc3: gadget: Fix TRB preparation during SG
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (113 preceding siblings ...)
  2015-01-27 12:16 ` [PATCH 3.16.y-ckt 114/126] drivers: net: cpsw: fix multicast flush in dual emac mode Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 116/126] usb: dwc3: gadget: Stop TRB preparation after limit is reached Luis Henriques
                   ` (10 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Amit Virdi, Felipe Balbi, Luis Henriques

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

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

From: Amit Virdi <amit.virdi@st.com>

commit ec512fb8e5611fed1df2895f90317ce6797d6b32 upstream.

When scatter gather (SG) is used, multiple TRBs are prepared from one DWC3
request (dwc3_request). So while preparing TRBs, the 'last' flag should be set
only when it is the last TRB being prepared from the last dwc3_request entry.

The current implementation uses list_is_last to check if the dwc3_request is the
last entry from the request_list. However, list_is_last returns false for the
last entry too. This is because, while preparing the first TRB from a request,
the function dwc3_prepare_one_trb modifies the request's next and prev pointers
while moving the URB to req_queued. Hence, list_is_last always returns false no
matter what.

The correct way is not to access the modified pointers of dwc3_request but to
use list_empty macro instead.

Fixes: e5ba5ec833aa (usb: dwc3: gadget: fix scatter gather implementation)
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/dwc3/gadget.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 9a565f0e3532..9b833a43212a 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -970,8 +970,7 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
 
 				if (i == (request->num_mapped_sgs - 1) ||
 						sg_is_last(s)) {
-					if (list_is_last(&req->list,
-							&dep->request_list))
+					if (list_empty(&dep->request_list))
 						last_one = true;
 					chain = false;
 				}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 116/126] usb: dwc3: gadget: Stop TRB preparation after limit is reached
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (114 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 115/126] usb: dwc3: gadget: Fix TRB preparation during SG Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 117/126] ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing Luis Henriques
                   ` (9 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Amit Virdi, Felipe Balbi, Luis Henriques

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

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

From: Amit Virdi <amit.virdi@st.com>

commit 39e60635a01520e8c8ed3946a28c2b98e6a46f79 upstream.

DWC3 gadget sets up a pool of 32 TRBs for each EP during initialization. This
means, the max TRBs that can be submitted for an EP is fixed to 32. Since the
request queue for an EP is a linked list, any number of requests can be queued
to it by the gadget layer.  However, the dwc3 driver must not submit TRBs more
than the pool it has created for. This limit wasn't respected when SG was used
resulting in submitting more than the max TRBs, eventually leading to
non-transfer of the TRBs submitted over the max limit.

Root cause:
When SG is used, there are two loops iterating to prepare TRBs:
 - Outer loop over the request_list
 - Inner loop over the SG list
The code was missing break to get out of the outer loop.

Fixes: eeb720fb21d6 (usb: dwc3: gadget: add support for SG lists)
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/dwc3/gadget.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 9b833a43212a..c24c0bb7f6f3 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -988,6 +988,9 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
 				if (last_one)
 					break;
 			}
+
+			if (last_one)
+				break;
 		} else {
 			dma = req->request.dma;
 			length = req->request.length;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 117/126] ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (115 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 116/126] usb: dwc3: gadget: Stop TRB preparation after limit is reached Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 118/126] reset: sunxi: fix spinlock initialization Luis Henriques
                   ` (8 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Steven Rostedt, Luis Henriques

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

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

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

commit 237d28db036e411f22c03cfd5b0f6dc2aa9bf3bc upstream.

If the function graph tracer traces a jprobe callback, the system will
crash. This can easily be demonstrated by compiling the jprobe
sample module that is in the kernel tree, loading it and running the
function graph tracer.

 # modprobe jprobe_example.ko
 # echo function_graph > /sys/kernel/debug/tracing/current_tracer
 # ls

The first two commands end up in a nice crash after the first fork.
(do_fork has a jprobe attached to it, so "ls" just triggers that fork)

The problem is caused by the jprobe_return() that all jprobe callbacks
must end with. The way jprobes works is that the function a jprobe
is attached to has a breakpoint placed at the start of it (or it uses
ftrace if fentry is supported). The breakpoint handler (or ftrace callback)
will copy the stack frame and change the ip address to return to the
jprobe handler instead of the function. The jprobe handler must end
with jprobe_return() which swaps the stack and does an int3 (breakpoint).
This breakpoint handler will then put back the saved stack frame,
simulate the instruction at the beginning of the function it added
a breakpoint to, and then continue on.

For function tracing to work, it hijakes the return address from the
stack frame, and replaces it with a hook function that will trace
the end of the call. This hook function will restore the return
address of the function call.

If the function tracer traces the jprobe handler, the hook function
for that handler will not be called, and its saved return address
will be used for the next function. This will result in a kernel crash.

To solve this, pause function tracing before the jprobe handler is called
and unpause it before it returns back to the function it probed.

Some other updates:

Used a variable "saved_sp" to hold kcb->jprobe_saved_sp. This makes the
code look a bit cleaner and easier to understand (various tries to fix
this bug required this change).

Note, if fentry is being used, jprobes will change the ip address before
the function graph tracer runs and it will not be able to trace the
function that the jprobe is probing.

Link: http://lkml.kernel.org/r/20150114154329.552437962@goodmis.org

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kernel/kprobes/core.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 67e6d19ef1be..93d2c04c6f8f 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -1018,6 +1018,15 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
 	regs->flags &= ~X86_EFLAGS_IF;
 	trace_hardirqs_off();
 	regs->ip = (unsigned long)(jp->entry);
+
+	/*
+	 * jprobes use jprobe_return() which skips the normal return
+	 * path of the function, and this messes up the accounting of the
+	 * function graph tracer to get messed up.
+	 *
+	 * Pause function graph tracing while performing the jprobe function.
+	 */
+	pause_graph_tracing();
 	return 1;
 }
 NOKPROBE_SYMBOL(setjmp_pre_handler);
@@ -1046,24 +1055,25 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
 	struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
 	u8 *addr = (u8 *) (regs->ip - 1);
 	struct jprobe *jp = container_of(p, struct jprobe, kp);
+	void *saved_sp = kcb->jprobe_saved_sp;
 
 	if ((addr > (u8 *) jprobe_return) &&
 	    (addr < (u8 *) jprobe_return_end)) {
-		if (stack_addr(regs) != kcb->jprobe_saved_sp) {
+		if (stack_addr(regs) != saved_sp) {
 			struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
 			printk(KERN_ERR
 			       "current sp %p does not match saved sp %p\n",
-			       stack_addr(regs), kcb->jprobe_saved_sp);
+			       stack_addr(regs), saved_sp);
 			printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
 			show_regs(saved_regs);
 			printk(KERN_ERR "Current registers\n");
 			show_regs(regs);
 			BUG();
 		}
+		/* It's OK to start function graph tracing again */
+		unpause_graph_tracing();
 		*regs = kcb->jprobe_saved_regs;
-		memcpy((kprobe_opcode_t *)(kcb->jprobe_saved_sp),
-		       kcb->jprobes_stack,
-		       MIN_STACK_SIZE(kcb->jprobe_saved_sp));
+		memcpy(saved_sp, kcb->jprobes_stack, MIN_STACK_SIZE(saved_sp));
 		preempt_enable_no_resched();
 		return 1;
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 118/126] reset: sunxi: fix spinlock initialization
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (116 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 117/126] ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 119/126] clk: Don't try to use a struct clk* after it could have been freed Luis Henriques
                   ` (7 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tyler Baker, Kevin Hilman, Olof Johansson, Luis Henriques

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

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

From: Tyler Baker <tyler.baker@linaro.org>

commit 41544f9f38f19cb46dc9a8fa37c58677a0300899 upstream.

Call spin_lock_init() before the spinlocks are used, both in early init
and probe functions preventing a lockdep splat.

I have been observing lockdep complaining [1] during boot on my a80 optimus [2]
when CONFIG_PROVE_LOCKING has been enabled. This patch resolves the splat,
and has been tested on a few other sunxi platforms without issue.

[1] http://storage.kernelci.org/next/next-20150107/arm-multi_v7_defconfig+CONFIG_PROVE_LOCKING=y/lab-tbaker/boot-sun9i-a80-optimus.html
[2] http://kernelci.org/boot/?a80-optimus

Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/reset/reset-sunxi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c
index a94e7a7820b4..51272b5d7552 100644
--- a/drivers/reset/reset-sunxi.c
+++ b/drivers/reset/reset-sunxi.c
@@ -102,6 +102,8 @@ static int sunxi_reset_init(struct device_node *np)
 		goto err_alloc;
 	}
 
+	spin_lock_init(&data->lock);
+
 	data->rcdev.owner = THIS_MODULE;
 	data->rcdev.nr_resets = size * 32;
 	data->rcdev.ops = &sunxi_reset_ops;
@@ -157,6 +159,8 @@ static int sunxi_reset_probe(struct platform_device *pdev)
 	if (IS_ERR(data->membase))
 		return PTR_ERR(data->membase);
 
+	spin_lock_init(&data->lock);
+
 	data->rcdev.owner = THIS_MODULE;
 	data->rcdev.nr_resets = resource_size(res) * 32;
 	data->rcdev.ops = &sunxi_reset_ops;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 119/126] clk: Don't try to use a struct clk* after it could have been freed
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (117 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 118/126] reset: sunxi: fix spinlock initialization Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 120/126] tcm_loop: Fixup tag handling Luis Henriques
                   ` (6 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tomeu Vizoso, Michael Turquette, Luis Henriques

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

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

From: Tomeu Vizoso <tomeu.vizoso@collabora.com>

commit 10cdfe54dab034311c8e2fad9ba2dffbe616caa9 upstream.

As __clk_release could call kfree on clk and then we wouldn't have a safe way
of getting the module that owns the clock.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: fcb0ee6a3d33 ("clk: Implement clk_unregister")
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/clk/clk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 4cc83ef7ef61..1dee8d2086fb 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2234,14 +2234,17 @@ int __clk_get(struct clk *clk)
 
 void __clk_put(struct clk *clk)
 {
+	struct module *owner;
+
 	if (!clk || WARN_ON_ONCE(IS_ERR(clk)))
 		return;
 
 	clk_prepare_lock();
+	owner = clk->owner;
 	kref_put(&clk->ref, __clk_release);
 	clk_prepare_unlock();
 
-	module_put(clk->owner);
+	module_put(owner);
 }
 
 /***        clk rate change notifiers        ***/
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 120/126] tcm_loop: Fixup tag handling
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (118 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 119/126] clk: Don't try to use a struct clk* after it could have been freed Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 121/126] net: prevent of emerging cross-namespace symlinks Luis Henriques
                   ` (5 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hannes Reinecke, Nicholas Bellinger, Luis Henriques

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

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

From: Hannes Reinecke <hare@suse.de>

commit 6375f8908255ea7438b60bb5998e6b3e1628500d upstream.

The SCSI command tag is set to the tag assigned from the block
layer, not the SCSI-II tag message. So we need to convert
it into the correct SCSI-II tag message based on the
device flags, not the tag value itself.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ luis: backported to 3.16:
  - adjusted context, as commit 506787a2c7da ("tcm_loop: Fix wrong I_T
    nexus association") had already been applied to 3.16 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/target/loopback/tcm_loop.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 6177ed38121e..939c4af2d487 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -153,18 +153,11 @@ static int tcm_loop_change_queue_type(struct scsi_device *sdev, int tag)
 /*
  * Locate the SAM Task Attr from struct scsi_cmnd *
  */
-static int tcm_loop_sam_attr(struct scsi_cmnd *sc)
-{
-	if (sc->device->tagged_supported) {
-		switch (sc->tag) {
-		case HEAD_OF_QUEUE_TAG:
-			return MSG_HEAD_TAG;
-		case ORDERED_QUEUE_TAG:
-			return MSG_ORDERED_TAG;
-		default:
-			break;
-		}
-	}
+static int tcm_loop_sam_attr(struct scsi_cmnd *sc, int tag)
+{
+	if (sc->device->tagged_supported &&
+	    sc->device->ordered_tags && tag >= 0)
+		return MSG_ORDERED_TAG;
 
 	return MSG_SIMPLE_TAG;
 }
@@ -227,7 +220,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
 
 	rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd,
 			&tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun,
-			transfer_length, tcm_loop_sam_attr(sc),
+			transfer_length, tcm_loop_sam_attr(sc, tl_cmd->sc_cmd_tag),
 			sc->sc_data_direction, 0,
 			scsi_sglist(sc), scsi_sg_count(sc),
 			sgl_bidi, sgl_bidi_count,
@@ -266,7 +259,7 @@ static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
 	}
 
 	tl_cmd->sc = sc;
-	tl_cmd->sc_cmd_tag = sc->tag;
+	tl_cmd->sc_cmd_tag = sc->request->tag;
 	INIT_WORK(&tl_cmd->work, tcm_loop_submission_work);
 	queue_work(tcm_loop_workqueue, &tl_cmd->work);
 	return 0;
@@ -366,7 +359,7 @@ static int tcm_loop_abort_task(struct scsi_cmnd *sc)
 	tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
 	tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
 	ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
-				 sc->tag, TMR_ABORT_TASK);
+				 sc->request->tag, TMR_ABORT_TASK);
 	return (ret == TMR_FUNCTION_COMPLETE) ? SUCCESS : FAILED;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 121/126] net: prevent of emerging cross-namespace symlinks
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (119 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 120/126] tcm_loop: Fixup tag handling Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 122/126] net: fix creation adjacent device symlinks Luis Henriques
                   ` (4 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexander Y. Fomichev, David S. Miller, Miquel van Smoorenburg,
	Luis Henriques

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

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

From: "Alexander Y. Fomichev" <git.user@gmail.com>

commit 4c75431ac3520631f1d9e74aa88407e6374dbbc4 upstream.

Code manipulating sysfs symlinks on adjacent net_devices(s)
currently doesn't take into account that devices potentially
belong to different namespaces.

This patch trying to fix an issue as follows:
- check for net_ns before creating / deleting symlink.
  for now only netdev_adjacent_rename_links and
  __netdev_adjacent_dev_remove are affected, afaics
  __netdev_adjacent_dev_insert implies both net_devs
  belong to the same namespace.
- Drop all existing symlinks to / from all adj_devs before
  switching namespace and recreate them just after.

Signed-off-by: Alexander Y. Fomichev <git.user@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Miquel van Smoorenburg <mikevs@xs4all.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/dev.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index a4ebbe7d4f15..1a9b82061128 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4885,7 +4885,8 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev,
 	if (adj->master)
 		sysfs_remove_link(&(dev->dev.kobj), "master");
 
-	if (netdev_adjacent_is_neigh_list(dev, dev_list))
+	if (netdev_adjacent_is_neigh_list(dev, dev_list) &&
+	    net_eq(dev_net(dev),dev_net(adj_dev)))
 		netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list);
 
 	list_del_rcu(&adj->list);
@@ -5155,11 +5156,65 @@ void netdev_upper_dev_unlink(struct net_device *dev,
 }
 EXPORT_SYMBOL(netdev_upper_dev_unlink);
 
+void netdev_adjacent_add_links(struct net_device *dev)
+{
+	struct netdev_adjacent *iter;
+
+	struct net *net = dev_net(dev);
+
+	list_for_each_entry(iter, &dev->adj_list.upper, list) {
+		if (!net_eq(net,dev_net(iter->dev)))
+			continue;
+		netdev_adjacent_sysfs_add(iter->dev, dev,
+					  &iter->dev->adj_list.lower);
+		netdev_adjacent_sysfs_add(dev, iter->dev,
+					  &dev->adj_list.upper);
+	}
+
+	list_for_each_entry(iter, &dev->adj_list.lower, list) {
+		if (!net_eq(net,dev_net(iter->dev)))
+			continue;
+		netdev_adjacent_sysfs_add(iter->dev, dev,
+					  &iter->dev->adj_list.upper);
+		netdev_adjacent_sysfs_add(dev, iter->dev,
+					  &dev->adj_list.lower);
+	}
+}
+
+void netdev_adjacent_del_links(struct net_device *dev)
+{
+	struct netdev_adjacent *iter;
+
+	struct net *net = dev_net(dev);
+
+	list_for_each_entry(iter, &dev->adj_list.upper, list) {
+		if (!net_eq(net,dev_net(iter->dev)))
+			continue;
+		netdev_adjacent_sysfs_del(iter->dev, dev->name,
+					  &iter->dev->adj_list.lower);
+		netdev_adjacent_sysfs_del(dev, iter->dev->name,
+					  &dev->adj_list.upper);
+	}
+
+	list_for_each_entry(iter, &dev->adj_list.lower, list) {
+		if (!net_eq(net,dev_net(iter->dev)))
+			continue;
+		netdev_adjacent_sysfs_del(iter->dev, dev->name,
+					  &iter->dev->adj_list.upper);
+		netdev_adjacent_sysfs_del(dev, iter->dev->name,
+					  &dev->adj_list.lower);
+	}
+}
+
 void netdev_adjacent_rename_links(struct net_device *dev, char *oldname)
 {
 	struct netdev_adjacent *iter;
 
+	struct net *net = dev_net(dev);
+
 	list_for_each_entry(iter, &dev->adj_list.upper, list) {
+		if (!net_eq(net,dev_net(iter->dev)))
+			continue;
 		netdev_adjacent_sysfs_del(iter->dev, oldname,
 					  &iter->dev->adj_list.lower);
 		netdev_adjacent_sysfs_add(iter->dev, dev,
@@ -5167,6 +5222,8 @@ void netdev_adjacent_rename_links(struct net_device *dev, char *oldname)
 	}
 
 	list_for_each_entry(iter, &dev->adj_list.lower, list) {
+		if (!net_eq(net,dev_net(iter->dev)))
+			continue;
 		netdev_adjacent_sysfs_del(iter->dev, oldname,
 					  &iter->dev->adj_list.upper);
 		netdev_adjacent_sysfs_add(iter->dev, dev,
@@ -6770,6 +6827,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 
 	/* Send a netdev-removed uevent to the old namespace */
 	kobject_uevent(&dev->dev.kobj, KOBJ_REMOVE);
+	netdev_adjacent_del_links(dev);
 
 	/* Actually switch the network namespace */
 	dev_net_set(dev, net);
@@ -6784,6 +6842,7 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
 
 	/* Send a netdev-add uevent to the new namespace */
 	kobject_uevent(&dev->dev.kobj, KOBJ_ADD);
+	netdev_adjacent_add_links(dev);
 
 	/* Fixup kobjects */
 	err = device_rename(&dev->dev, dev->name);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 122/126] net: fix creation adjacent device symlinks
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (120 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 121/126] net: prevent of emerging cross-namespace symlinks Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 123/126] drm/i915: Evict CS TLBs between batches Luis Henriques
                   ` (3 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexander Fomichev, David S. Miller, Miquel van Smoorenburg,
	Luis Henriques

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

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

From: "Alexander Y. Fomichev" <git.user@gmail.com>

commit 7ce64c79c4decdeb1afe0bf2f6ef834b382871d1 upstream.

__netdev_adjacent_dev_insert may add adjust device of different net
namespace, without proper check it leads to emergence of broken
sysfs links from/to devices in another namespace.
Fix: rewrite netdev_adjacent_is_neigh_list macro as a function,
     move net_eq check into netdev_adjacent_is_neigh_list.
     (thanks David)
     related to: 4c75431ac3520631f1d9e74aa88407e6374dbbc4

Signed-off-by: Alexander Fomichev <git.user@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Miquel van Smoorenburg <mikevs@xs4all.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/dev.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 1a9b82061128..2d93b9de1d7b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4799,9 +4799,14 @@ static void netdev_adjacent_sysfs_del(struct net_device *dev,
 	sysfs_remove_link(&(dev->dev.kobj), linkname);
 }
 
-#define netdev_adjacent_is_neigh_list(dev, dev_list) \
-		(dev_list == &dev->adj_list.upper || \
-		 dev_list == &dev->adj_list.lower)
+static inline bool netdev_adjacent_is_neigh_list(struct net_device *dev,
+						 struct net_device *adj_dev,
+						 struct list_head *dev_list)
+{
+	return (dev_list == &dev->adj_list.upper ||
+		dev_list == &dev->adj_list.lower) &&
+		net_eq(dev_net(dev), dev_net(adj_dev));
+}
 
 static int __netdev_adjacent_dev_insert(struct net_device *dev,
 					struct net_device *adj_dev,
@@ -4831,7 +4836,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
 	pr_debug("dev_hold for %s, because of link added from %s to %s\n",
 		 adj_dev->name, dev->name, adj_dev->name);
 
-	if (netdev_adjacent_is_neigh_list(dev, dev_list)) {
+	if (netdev_adjacent_is_neigh_list(dev, adj_dev, dev_list)) {
 		ret = netdev_adjacent_sysfs_add(dev, adj_dev, dev_list);
 		if (ret)
 			goto free_adj;
@@ -4852,7 +4857,7 @@ static int __netdev_adjacent_dev_insert(struct net_device *dev,
 	return 0;
 
 remove_symlinks:
-	if (netdev_adjacent_is_neigh_list(dev, dev_list))
+	if (netdev_adjacent_is_neigh_list(dev, adj_dev, dev_list))
 		netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list);
 free_adj:
 	kfree(adj);
@@ -4885,8 +4890,7 @@ static void __netdev_adjacent_dev_remove(struct net_device *dev,
 	if (adj->master)
 		sysfs_remove_link(&(dev->dev.kobj), "master");
 
-	if (netdev_adjacent_is_neigh_list(dev, dev_list) &&
-	    net_eq(dev_net(dev),dev_net(adj_dev)))
+	if (netdev_adjacent_is_neigh_list(dev, adj_dev, dev_list))
 		netdev_adjacent_sysfs_del(dev, adj_dev->name, dev_list);
 
 	list_del_rcu(&adj->list);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 123/126] drm/i915: Evict CS TLBs between batches
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (121 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 122/126] net: fix creation adjacent device symlinks Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 124/126] Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single" Luis Henriques
                   ` (2 subsequent siblings)
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Daniel Vetter, Ville Syrjälä,
	Jani Nikula, Luis Henriques

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

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

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

commit c4d69da167fa967749aeb70bc0e94a457e5d00c1 upstream.

Running igt, I was encountering the invalid TLB bug on my 845g, despite
that it was using the CS workaround. Examining the w/a buffer in the
error state, showed that the copy from the user batch into the
workaround itself was suffering from the invalid TLB bug (the first
cacheline was broken with the first two words reversed). Time to try a
fresh approach. This extends the workaround to write into each page of
our scratch buffer in order to overflow the TLB and evict the invalid
entries. This could be refined to only do so after we update the GTT,
but for simplicity, we do it before each batch.

I suspect this supersedes our current workaround, but for safety keep
doing both.

v2: The magic number shall be 2.

This doesn't conclusively prove that it is the mythical TLB bug we've
been trying to workaround for so long, that it requires touching a number
of pages to prevent the corruption indicates to me that it is TLB
related, but the corruption (the reversed cacheline) is more subtle than
a TLB bug, where we would expect it to read the wrong page entirely.

Oh well, it prevents a reliable hang for me and so probably for others
as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.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_reg.h         | 12 ++++--
 drivers/gpu/drm/i915/intel_ringbuffer.c | 66 +++++++++++++++++++--------------
 2 files changed, 47 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 4fcff20cab98..37dacd14c208 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -330,16 +330,20 @@
 #define GFX_OP_DESTBUFFER_INFO	 ((0x3<<29)|(0x1d<<24)|(0x8e<<16)|1)
 #define GFX_OP_DRAWRECT_INFO     ((0x3<<29)|(0x1d<<24)|(0x80<<16)|(0x3))
 #define GFX_OP_DRAWRECT_INFO_I965  ((0x7900<<16)|0x2)
-#define SRC_COPY_BLT_CMD                ((2<<29)|(0x43<<22)|4)
+
+#define COLOR_BLT_CMD			(2<<29 | 0x40<<22 | (5-2))
+#define SRC_COPY_BLT_CMD		((2<<29)|(0x43<<22)|4)
 #define XY_SRC_COPY_BLT_CMD		((2<<29)|(0x53<<22)|6)
 #define XY_MONO_SRC_COPY_IMM_BLT	((2<<29)|(0x71<<22)|5)
-#define XY_SRC_COPY_BLT_WRITE_ALPHA	(1<<21)
-#define XY_SRC_COPY_BLT_WRITE_RGB	(1<<20)
+#define   BLT_WRITE_A			(2<<20)
+#define   BLT_WRITE_RGB			(1<<20)
+#define   BLT_WRITE_RGBA		(BLT_WRITE_RGB | BLT_WRITE_A)
 #define   BLT_DEPTH_8			(0<<24)
 #define   BLT_DEPTH_16_565		(1<<24)
 #define   BLT_DEPTH_16_1555		(2<<24)
 #define   BLT_DEPTH_32			(3<<24)
-#define   BLT_ROP_GXCOPY		(0xcc<<16)
+#define   BLT_ROP_SRC_COPY		(0xcc<<16)
+#define   BLT_ROP_COLOR_COPY		(0xf0<<16)
 #define XY_SRC_COPY_BLT_SRC_TILED	(1<<15) /* 965+ only */
 #define XY_SRC_COPY_BLT_DST_TILED	(1<<11) /* 965+ only */
 #define CMD_OP_DISPLAYBUFFER_INFO ((0x0<<29)|(0x14<<23)|2)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index db8e92f27289..6a7a35acdfa7 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1247,54 +1247,66 @@ i965_dispatch_execbuffer(struct intel_engine_cs *ring,
 
 /* Just userspace ABI convention to limit the wa batch bo to a resonable size */
 #define I830_BATCH_LIMIT (256*1024)
+#define I830_TLB_ENTRIES (2)
+#define I830_WA_SIZE max(I830_TLB_ENTRIES*4096, I830_BATCH_LIMIT)
 static int
 i830_dispatch_execbuffer(struct intel_engine_cs *ring,
 				u64 offset, u32 len,
 				unsigned flags)
 {
+	u32 cs_offset = ring->scratch.gtt_offset;
 	int ret;
 
-	if (flags & I915_DISPATCH_PINNED) {
-		ret = intel_ring_begin(ring, 4);
-		if (ret)
-			return ret;
+	ret = intel_ring_begin(ring, 6);
+	if (ret)
+		return ret;
 
-		intel_ring_emit(ring, MI_BATCH_BUFFER);
-		intel_ring_emit(ring, offset | (flags & I915_DISPATCH_SECURE ? 0 : MI_BATCH_NON_SECURE));
-		intel_ring_emit(ring, offset + len - 8);
-		intel_ring_emit(ring, MI_NOOP);
-		intel_ring_advance(ring);
-	} else {
-		u32 cs_offset = ring->scratch.gtt_offset;
+	/* Evict the invalid PTE TLBs */
+	intel_ring_emit(ring, COLOR_BLT_CMD | BLT_WRITE_RGBA);
+	intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_COLOR_COPY | 4096);
+	intel_ring_emit(ring, I830_TLB_ENTRIES << 16 | 4); /* load each page */
+	intel_ring_emit(ring, cs_offset);
+	intel_ring_emit(ring, 0xdeadbeef);
+	intel_ring_emit(ring, MI_NOOP);
+	intel_ring_advance(ring);
 
+	if ((flags & I915_DISPATCH_PINNED) == 0) {
 		if (len > I830_BATCH_LIMIT)
 			return -ENOSPC;
 
-		ret = intel_ring_begin(ring, 9+3);
+		ret = intel_ring_begin(ring, 6 + 2);
 		if (ret)
 			return ret;
-		/* Blit the batch (which has now all relocs applied) to the stable batch
-		 * scratch bo area (so that the CS never stumbles over its tlb
-		 * invalidation bug) ... */
-		intel_ring_emit(ring, XY_SRC_COPY_BLT_CMD |
-				XY_SRC_COPY_BLT_WRITE_ALPHA |
-				XY_SRC_COPY_BLT_WRITE_RGB);
-		intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_GXCOPY | 4096);
-		intel_ring_emit(ring, 0);
-		intel_ring_emit(ring, (DIV_ROUND_UP(len, 4096) << 16) | 1024);
+
+		/* Blit the batch (which has now all relocs applied) to the
+		 * stable batch scratch bo area (so that the CS never
+		 * stumbles over its tlb invalidation bug) ...
+		 */
+		intel_ring_emit(ring, SRC_COPY_BLT_CMD | BLT_WRITE_RGBA);
+		intel_ring_emit(ring, BLT_DEPTH_32 | BLT_ROP_SRC_COPY | 4096);
+		intel_ring_emit(ring, DIV_ROUND_UP(len, 4096) << 16 | 1024);
 		intel_ring_emit(ring, cs_offset);
-		intel_ring_emit(ring, 0);
 		intel_ring_emit(ring, 4096);
 		intel_ring_emit(ring, offset);
+
 		intel_ring_emit(ring, MI_FLUSH);
+		intel_ring_emit(ring, MI_NOOP);
+		intel_ring_advance(ring);
 
 		/* ... and execute it. */
-		intel_ring_emit(ring, MI_BATCH_BUFFER);
-		intel_ring_emit(ring, cs_offset | (flags & I915_DISPATCH_SECURE ? 0 : MI_BATCH_NON_SECURE));
-		intel_ring_emit(ring, cs_offset + len - 8);
-		intel_ring_advance(ring);
+		offset = cs_offset;
 	}
 
+	ret = intel_ring_begin(ring, 4);
+	if (ret)
+		return ret;
+
+	intel_ring_emit(ring, MI_BATCH_BUFFER);
+	intel_ring_emit(ring, offset | (flags & I915_DISPATCH_SECURE ? 0 : MI_BATCH_NON_SECURE));
+	intel_ring_emit(ring, offset + len - 8);
+	intel_ring_emit(ring, MI_NOOP);
+	intel_ring_advance(ring);
+
 	return 0;
 }
 
@@ -2033,7 +2045,7 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
 		struct drm_i915_gem_object *obj;
 		int ret;
 
-		obj = i915_gem_alloc_object(dev, I830_BATCH_LIMIT);
+		obj = i915_gem_alloc_object(dev, I830_WA_SIZE);
 		if (obj == NULL) {
 			DRM_ERROR("Failed to allocate batch bo\n");
 			return -ENOMEM;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 124/126] Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single"
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (122 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 123/126] drm/i915: Evict CS TLBs between batches Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 125/126] ARM: dts: dra7-evm: fix qspi device tree partition size Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 126/126] ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances Luis Henriques
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Vrabel, Ian Campbell, Luis Henriques

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

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

From: David Vrabel <david.vrabel@citrix.com>

commit dbdd74763f1faf799fbb9ed30423182e92919378 upstream.

This reverts commit 2c3fc8d26dd09b9d7069687eead849ee81c78e46.

This commit broke on x86 PV because entries in the generic SWIOTLB are
indexed using (pseudo-)physical address not DMA address and these are
not the same in a x86 PV guest.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/xen/swiotlb-xen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index de37cc22b9a5..c9d0d5a0e662 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b/drivers/xen/swiotlb-xen.c
@@ -451,7 +451,7 @@ static void xen_unmap_single(struct device *hwdev, dma_addr_t dev_addr,
 
 	/* NOTE: We use dev_addr here, not paddr! */
 	if (is_xen_swiotlb_buffer(dev_addr)) {
-		swiotlb_tbl_unmap_single(hwdev, dev_addr, size, dir);
+		swiotlb_tbl_unmap_single(hwdev, paddr, size, dir);
 		return;
 	}
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 125/126] ARM: dts: dra7-evm: fix qspi device tree partition size
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (123 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 124/126] Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single" Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 126/126] ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances Luis Henriques
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mugunthan V N, Tony Lindgren, Luis Henriques

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

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

From: Mugunthan V N <mugunthanvnm@ti.com>

commit 69d2626f97b7f017ee4416b7dc071e9499c2c944 upstream.

64KiB is allocated for qspi dtb partition which is not
sufficient, so updating the partition table size to 512KiB
for device tree partition.

This also aligns the QSPI partition definitions between
kernel and U-Boot.

Fixes: dc2dd5b8 ("ARM: dts: dra7: Add qspi device")

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/dra7-evm.dts | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 780d66119f3c..6944a6e9e162 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -377,23 +377,23 @@
 		};
 		partition@5 {
 			label = "QSPI.u-boot-spl-os";
-			reg = <0x00140000 0x00010000>;
+			reg = <0x00140000 0x00080000>;
 		};
 		partition@6 {
 			label = "QSPI.u-boot-env";
-			reg = <0x00150000 0x00010000>;
+			reg = <0x001c0000 0x00010000>;
 		};
 		partition@7 {
 			label = "QSPI.u-boot-env.backup1";
-			reg = <0x00160000 0x0010000>;
+			reg = <0x001d0000 0x0010000>;
 		};
 		partition@8 {
 			label = "QSPI.kernel";
-			reg = <0x00170000 0x0800000>;
+			reg = <0x001e0000 0x0800000>;
 		};
 		partition@9 {
 			label = "QSPI.file-system";
-			reg = <0x00970000 0x01690000>;
+			reg = <0x009e0000 0x01620000>;
 		};
 	};
 };
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 126/126] ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances
  2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
                   ` (124 preceding siblings ...)
  2015-01-27 12:17 ` [PATCH 3.16.y-ckt 125/126] ARM: dts: dra7-evm: fix qspi device tree partition size Luis Henriques
@ 2015-01-27 12:17 ` Luis Henriques
  125 siblings, 0 replies; 127+ messages in thread
From: Luis Henriques @ 2015-01-27 12:17 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Geert Uytterhoeven, Simon Horman, Luis Henriques

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

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

From: Geert Uytterhoeven <geert+renesas@glider.be>

commit b0ddb319db3d7a1943445f0de0a45c07a7f3457a upstream.

The sh73a0 INTC can't mask interrupts properly most likely due to a
hardware bug. Set the .control_parent flag to delegate masking to the
parent interrupt controller, like was already done for irqpin1.

Without this, accessing the three-axis digital accelerometer ADXL345
on kzm9g through /dev/input/event1 causes an interrupt storm, which
requires a power-cycle to recover from.

This was inspired by a patch for arch/arm/boot/dts/sh73a0.dtsi from
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Fixes: 341eb5465f67437a ("ARM: shmobile: INTC External IRQ pin driver on sh73a0")
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mach-shmobile/setup-sh73a0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index ad00724a2269..f8584664369a 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -576,6 +576,7 @@ static struct platform_device ipmmu_device = {
 
 static struct renesas_intc_irqpin_config irqpin0_platform_data = {
 	.irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */
+	.control_parent = true,
 };
 
 static struct resource irqpin0_resources[] = {
@@ -637,6 +638,7 @@ static struct platform_device irqpin1_device = {
 
 static struct renesas_intc_irqpin_config irqpin2_platform_data = {
 	.irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */
+	.control_parent = true,
 };
 
 static struct resource irqpin2_resources[] = {
@@ -667,6 +669,7 @@ static struct platform_device irqpin2_device = {
 
 static struct renesas_intc_irqpin_config irqpin3_platform_data = {
 	.irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */
+	.control_parent = true,
 };
 
 static struct resource irqpin3_resources[] = {
-- 
2.1.4


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

end of thread, other threads:[~2015-01-27 12:53 UTC | newest]

Thread overview: 127+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 12:15 [3.16.y-ckt stable] Linux 3.16.7-ckt5 stable review Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 001/126] spi: sh-msiof: Add runtime PM lock in initializing Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 002/126] drm/i915: Don't call intel_prepare_page_flip() multiple times on gen2-4 Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 003/126] x86_64, vdso: Fix the vdso address randomization algorithm Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 004/126] drm/nv4c/mc: disable msi Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 005/126] ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 006/126] x86, vdso: Use asm volatile in __getcpu Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 007/126] video/logo: prevent use of logos after they have been freed Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 008/126] video/fbdev: fix defio's fsync Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 009/126] Add USB_EHCI_EXYNOS to multi_v7_defconfig Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 010/126] SCSI: fix regression in scsi_send_eh_cmnd() Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 011/126] Btrfs: don't delay inode ref updates during log replay Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 012/126] net: ethernet: cpsw: fix hangs with interrupts Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 013/126] ALSA: hda - Fix wrong gpio_dir & gpio_mask hint setups for IDT/STAC codecs Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 014/126] drm/radeon: KV has three PPLLs (v2) Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 015/126] drm/radeon: fix sad_count check for dce3 Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 016/126] drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 017/126] drm/radeon: adjust default bapm settings for KV Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 018/126] ACPI / PM: Fix PM initialization for devices that are not present Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 019/126] mm: propagate error from stack expansion even for guard page Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 020/126] ALSA: hda - Add new GPU codec ID 0x10de0072 to snd-hda Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 021/126] vfio-pci: Fix the check on pci device type in vfio_pci_probe() Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 022/126] rpc: fix xdr_truncate_encode to handle buffer ending on page boundary Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 023/126] arm64/efi: add missing call to early_ioremap_reset() Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 024/126] exit: fix race between wait_consider_task() and wait_task_zombie() Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 025/126] mm: prevent endless growth of anon_vma hierarchy Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 026/126] mm: protect set_page_dirty() from ongoing truncation Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 027/126] mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process being killed Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 028/126] sched/deadline: Fix migration of SCHED_DEADLINE tasks Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 029/126] sched/deadline: Avoid double-accounting in case of missed deadlines Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 030/126] HID: roccat: potential out of bounds in pyra_sysfs_write_settings() Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 031/126] mm: Don't count the stack guard page towards RLIMIT_STACK Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 032/126] mm: fix corner case in anon_vma endless growing prevention Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 033/126] xen/arm/arm64: introduce xen_arch_need_swiotlb Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 034/126] perf session: Do not fail on processing out of order event Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 035/126] fsnotify: next_i is freed during fsnotify_unmount_inodes Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 036/126] drivers/rtc/rtc-isl12057.c: fix masking of register values Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 037/126] ASoC: eukrea-tlv320: Fix of_node_put() call with uninitialized object Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 038/126] HID: i2c-hid: Do not free buffers in i2c_hid_stop() Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 039/126] ALSA: fireworks: fix an endianness bug for transaction length Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 040/126] mtd: nand: omap: Fix NAND enumeration on 3430 LDP Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 041/126] ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 042/126] powerpc: Fix bad NULL pointer check in udbg_uart_getc_poll() Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 043/126] HID: add battery quirk for USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO keyboard Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 044/126] ALSA: hda - using uninitialized data Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 045/126] nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 046/126] scripts/kernel-doc: don't eat struct members with __aligned Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 047/126] ARM: dts: DRA7: wdt: Fix compatible property for watchdog node Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 048/126] ARM: dts: Enable PWM node by default for s3c64xx Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 049/126] ARM: OMAP4: PM: Only do static dependency configuration in omap4_init_static_deps Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 050/126] Revert "ARM: 7830/1: delay: don't bother reporting bogomips in /proc/cpuinfo" Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 051/126] HID: Add a new id 0x501a for Genius MousePen i608X Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 052/126] netfilter: ipset: small potential read beyond the end of buffer Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 053/126] bridge: fix netfilter/NF_BR_LOCAL_OUT for own, locally generated queries Luis Henriques
2015-01-27 12:15 ` [PATCH 3.16.y-ckt 054/126] bcache: Make sure to pass GFP_WAIT to mempool_alloc() Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 055/126] ACPICA: Add new GPE public interface - acpi_mark_gpe_for_wake Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 056/126] ACPI / scan: No implicit wake notification for buttons Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 057/126] gre: fix the inner mac header in nbma tunnel xmit path Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 058/126] netlink: Always copy on mmap TX Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 059/126] netlink: Don't reorder loads/stores before marking mmap netlink frame as available Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 060/126] in6: fix conflict with glibc Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 061/126] tg3: tg3_disable_ints using uninitialized mailbox value to disable interrupts Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 062/126] batman-adv: Unify fragment size calculation Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 063/126] batman-adv: avoid NULL dereferences and fix if check Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 064/126] net: Fix stacked vlan offload features computation Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 065/126] net: Reset secmark when scrubbing packet Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 066/126] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 067/126] tcp: Do not apply TSO segment limit to non-TSO packets Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 068/126] xen-netback: fixing the propagation of the transmit shaper timeout Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 069/126] alx: fix alx_poll() Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 070/126] team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 071/126] enic: fix rx skb checksum Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 072/126] netfilter: conntrack: disable generic tracking for known protocols Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 073/126] xen-netfront: Fix handling packets on compound pages with skb_linearize Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 074/126] xen-netfront: use correct linear area after linearizing an skb Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 075/126] usb: musb: stuff leak of struct usb_hcd Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 076/126] usb: gadget: gadgetfs: Free memory allocated by memdup_user() Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 077/126] usb: gadget: udc: atmel: change setting for DMA Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 078/126] [PATCH] usb: gadget: udc: atmel: fix possible IN hang issue Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 079/126] ARM: imx6q: drop unnecessary semicolon Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 080/126] ARM: clk-imx6q: fix video divider for rev T0 1.0 Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 081/126] ARM: dts: imx25: Fix the SPI1 clocks Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 082/126] USB: cp210x: fix ID for production CEL MeshConnect USB Stick Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 083/126] USB: keyspan: fix null-deref at probe Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 084/126] iwlwifi: mvm: fix Rx with both chains Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 085/126] ARM: imx6sx: Set PLL2 as parent of QSPI clocks Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 086/126] ARM: omap5/dra7xx: Fix frequency typos Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 087/126] ARM: omap5/dra7xx: Enable booting secondary CPU in HYP mode Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 088/126] LOCKD: Fix a race when initialising nlmsvc_timeout Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 089/126] NFSv4.1: Fix client id trunking on Linux Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 090/126] ARM: dts: imx51-babbage: Fix ULPI PHY reset modelling Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 091/126] USB: cp210x: add IDs for CEL USB sticks and MeshWorks devices Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 092/126] vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 093/126] USB: qcserial/option: make AT URCs work for Sierra Wireless MC73xx Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 094/126] ARM: dts: berlin: fix io clk and add missing core clk for BG2Q sdhci2 host Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 095/126] ARM: dts: berlin: add broken-cd and set bus width for eMMC in Marvell DMP DT Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 096/126] ARM: dts: berlin: correct BG2Q's SM GPIO location Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 097/126] xhci: Check if slot is already in default state before moving it there Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 098/126] USB: EHCI: fix initialization bug in iso_stream_schedule() Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 099/126] xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 100/126] uas: Add US_FL_NO_ATA_1X for Seagate devices with usb-id 0bc2:a013 Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 101/126] uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS566 " Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 102/126] uas: Add US_FL_NO_ATA_1X for 2 more Seagate disk enclosures Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 103/126] OHCI: add a quirk for ULi M5237 blocking on reset Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 104/126] mei: clean reset bit before reset Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 105/126] target: Drop arbitrary maximum I/O size limit Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 106/126] usb: gadget: udc: atmel: fix possible oops when unloading module Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 107/126] USB: console: fix uninitialised ldisc semaphore Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 108/126] USB: console: fix potential use after free Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 109/126] mmc: sdhci-pxav3: fix error handling of sdhci_add_host Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 110/126] mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 111/126] mmc: sdhci: Fix sleep in atomic after inserting SD card Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 112/126] clk: at91: keep slow clk enabled to prevent system hang Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 113/126] clk: berlin: bg2q: remove non-exist "smemc" gate clock Luis Henriques
2015-01-27 12:16 ` [PATCH 3.16.y-ckt 114/126] drivers: net: cpsw: fix multicast flush in dual emac mode Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 115/126] usb: dwc3: gadget: Fix TRB preparation during SG Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 116/126] usb: dwc3: gadget: Stop TRB preparation after limit is reached Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 117/126] ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 118/126] reset: sunxi: fix spinlock initialization Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 119/126] clk: Don't try to use a struct clk* after it could have been freed Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 120/126] tcm_loop: Fixup tag handling Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 121/126] net: prevent of emerging cross-namespace symlinks Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 122/126] net: fix creation adjacent device symlinks Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 123/126] drm/i915: Evict CS TLBs between batches Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 124/126] Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single" Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 125/126] ARM: dts: dra7-evm: fix qspi device tree partition size Luis Henriques
2015-01-27 12:17 ` [PATCH 3.16.y-ckt 126/126] ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances 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).