linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [3.13.y.z extended stable] Linux 3.13.11.9 stable review
@ 2014-10-09 21:00 Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 001/163] regulatory: add NUL to alpha2 Kamal Mostafa
                   ` (162 more replies)
  0 siblings, 163 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa

This is the start of the review cycle for the Linux 3.13.11.9 stable kernel.

This version contains 163 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.13.y-review;a=shortlog

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

The review period for version 3.13.11.9 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.13.y.z extended stable kernel version,
see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Kamal

--
 arch/arm/include/asm/tls.h                         |  64 ++++++
 arch/arm/kernel/irq.c                              |   2 +-
 arch/arm/kernel/process.c                          |   2 +
 arch/arm/kernel/thumbee.c                          |   2 +-
 arch/arm/kernel/traps.c                            |  17 +-
 arch/arm/mm/alignment.c                            |   3 +
 arch/arm64/kernel/irq.c                            |   2 +-
 arch/arm64/kernel/process.c                        |  18 ++
 arch/arm64/kernel/sys_compat.c                     |   6 +
 arch/ia64/pci/fixup.c                              |   3 +-
 arch/mips/boot/compressed/decompress.c             |   1 +
 arch/mips/kernel/mcount.S                          |  12 ++
 arch/parisc/Makefile                               |   7 +-
 arch/parisc/kernel/syscall.S                       | 233 ++++++++++++++++++++-
 arch/x86/include/asm/vga.h                         |   6 -
 arch/x86/kernel/smpboot.c                          |   3 +
 arch/x86/pci/fixup.c                               |   4 +-
 block/genhd.c                                      |  24 ++-
 block/partition-generic.c                          |   2 +-
 drivers/acpi/acpi_cmos_rtc.c                       |   2 +-
 drivers/ata/ahci.c                                 |  10 +
 drivers/ata/ata_piix.c                             |   8 +
 drivers/cpufreq/integrator-cpufreq.c               |   4 +-
 drivers/gpu/drm/ast/ast_main.c                     |   3 +-
 drivers/gpu/drm/i915/i915_gem.c                    |  11 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c                |  14 +-
 drivers/gpu/drm/i915/i915_reg.h                    |  12 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c            |  66 +++---
 drivers/gpu/drm/i915/intel_tv.c                    |   4 +
 drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c     |   1 -
 drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c      |   1 +
 drivers/gpu/drm/nouveau/nouveau_vga.c              |   9 +
 drivers/gpu/drm/radeon/cik.c                       |   4 +-
 drivers/gpu/drm/radeon/cik_sdma.c                  |   7 -
 drivers/gpu/drm/radeon/ni_dma.c                    |   6 -
 drivers/gpu/drm/radeon/r600_dma.c                  |   9 -
 drivers/gpu/drm/radeon/radeon_atombios.c           |  33 ++-
 drivers/gpu/drm/radeon/radeon_device.c             |  11 +-
 drivers/gpu/drm/radeon/radeon_semaphore.c          |   2 +-
 drivers/gpu/vga/vga_switcheroo.c                   |   6 +
 drivers/gpu/vga/vgaarb.c                           |  38 +++-
 drivers/iio/accel/bma180.c                         |   2 +-
 drivers/iio/adc/ad_sigma_delta.c                   |   2 +-
 drivers/iio/adc/at91_adc.c                         |  10 +-
 .../iio/common/hid-sensors/hid-sensor-trigger.c    |   3 +-
 drivers/iio/common/st_sensors/st_sensors_trigger.c |   2 +-
 drivers/iio/gyro/itg3200_buffer.c                  |   2 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c      |   2 +-
 drivers/iio/inkern.c                               |   2 +-
 drivers/iio/magnetometer/st_magn_core.c            |  52 +++--
 drivers/infiniband/hw/qib/qib_debugfs.c            |   3 +-
 drivers/infiniband/hw/qib/qib_qp.c                 |   8 -
 drivers/infiniband/ulp/isert/ib_isert.c            |   7 +-
 drivers/input/keyboard/atkbd.c                     |   8 -
 drivers/input/mouse/elantech.c                     |   7 +
 drivers/input/serio/i8042-x86ia64io.h              |  15 ++
 drivers/input/serio/serport.c                      |  45 +++-
 drivers/iommu/arm-smmu.c                           |  12 +-
 drivers/iommu/fsl_pamu_domain.c                    |  10 +-
 drivers/md/dm-cache-target.c                       |   4 +-
 drivers/md/raid1.c                                 |  40 ++--
 drivers/md/raid5.c                                 |  18 +-
 drivers/media/i2c/adv7604.c                        |   2 +-
 drivers/media/pci/cx18/cx18-driver.c               |   1 +
 drivers/media/v4l2-core/videobuf2-core.c           |   2 +-
 drivers/media/v4l2-core/videobuf2-dma-sg.c         |   2 +-
 drivers/net/can/at91_can.c                         |   8 +-
 drivers/net/can/flexcan.c                          |  41 +++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c   |  25 ++-
 drivers/net/wireless/iwlwifi/dvm/rxon.c            |  12 ++
 drivers/net/wireless/iwlwifi/iwl-config.h          |   2 +
 drivers/net/wireless/iwlwifi/iwl-nvm-parse.c       |   4 +-
 drivers/net/wireless/iwlwifi/mvm/tx.c              |   8 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c        |   1 +
 drivers/phy/phy-twl4030-usb.c                      |  33 +--
 drivers/scsi/libiscsi.c                            |  10 +
 drivers/spi/spi-dw.c                               |   1 +
 drivers/spi/spi-fsl-espi.c                         |  15 +-
 drivers/spi/spi-fsl-spi.c                          |  10 +-
 drivers/spi/spi-sirf.c                             |   4 +-
 drivers/staging/iio/meter/ade7758_trigger.c        |   2 +-
 drivers/staging/imx-drm/ipuv3-plane.c              |   3 +-
 drivers/target/iscsi/iscsi_target.c                |   4 +-
 drivers/target/iscsi/iscsi_target_parameters.c     |   2 +-
 drivers/usb/core/hub.c                             |   4 +-
 drivers/usb/dwc3/core.c                            |  13 +-
 drivers/usb/dwc3/dwc3-omap.c                       |   2 +-
 drivers/usb/gadget/fusb300_udc.h                   |   2 +-
 drivers/usb/host/ehci-hcd.c                        |   2 -
 drivers/usb/host/xhci-hub.c                        |   8 +-
 drivers/usb/host/xhci-mem.c                        |   3 +-
 drivers/usb/host/xhci.c                            |  12 +-
 drivers/usb/phy/phy-tegra-usb.c                    |   4 +-
 drivers/usb/serial/ftdi_sio.c                      |   3 +
 drivers/usb/serial/ftdi_sio_ids.h                  |  12 ++
 drivers/usb/serial/sierra.c                        |   9 +-
 drivers/usb/serial/zte_ev.c                        |   8 +
 drivers/usb/storage/unusual_devs.h                 |  38 ++++
 drivers/uwb/lc-dev.c                               |  13 +-
 drivers/video/efifb.c                              |  39 ----
 drivers/xen/manage.c                               |   7 -
 fs/buffer.c                                        |   6 +-
 fs/cifs/cifsglob.h                                 |   5 -
 fs/cifs/inode.c                                    |   5 +-
 fs/cifs/readdir.c                                  |   4 +-
 fs/cifs/smb1ops.c                                  |   2 +-
 fs/cifs/smb2file.c                                 |   2 +-
 fs/cifs/smb2inode.c                                |   2 +-
 fs/cifs/smb2maperror.c                             |   2 +
 fs/cifs/smb2ops.c                                  |   2 +-
 fs/cifs/smb2pdu.c                                  |   2 +-
 fs/eventpoll.c                                     |   3 +-
 fs/lockd/svc.c                                     |   4 +-
 fs/namei.c                                         |  71 ++++---
 fs/nfs/client.c                                    |  12 +-
 fs/nfs/nfs4client.c                                |  38 ++--
 fs/nfs/nfs4proc.c                                  |  30 +--
 fs/nilfs2/inode.c                                  |   7 +-
 fs/notify/fdinfo.c                                 |   4 +-
 fs/ocfs2/dlm/dlmmaster.c                           |  18 +-
 include/linux/dcache.h                             |   7 +-
 include/linux/iio/trigger.h                        |   4 +-
 include/linux/jiffies.h                            |  12 --
 include/linux/vga_switcheroo.h                     |   2 +
 include/linux/workqueue.h                          |   2 +-
 include/net/regulatory.h                           |   2 +-
 init/Kconfig                                       |   2 +
 kernel/cgroup.c                                    |   5 +
 kernel/events/core.c                               |  14 +-
 kernel/fork.c                                      |   5 +-
 kernel/futex.c                                     |   1 +
 kernel/kcmp.c                                      |   7 +-
 kernel/time.c                                      |  54 ++---
 kernel/time/alarmtimer.c                           |  34 ++-
 lib/lzo/lzo1x_decompress_safe.c                    | 103 +++++----
 mm/huge_memory.c                                   |   7 +-
 mm/memcontrol.c                                    |  33 ++-
 mm/memory.c                                        |   2 +-
 mm/migrate.c                                       |   5 +-
 mm/page_alloc.c                                    |   7 +-
 mm/percpu-vm.c                                     |  22 +-
 mm/percpu.c                                        |   2 +
 mm/shmem.c                                         |   4 +-
 mm/slab.c                                          |  11 +-
 net/ceph/mon_client.c                              |   8 +
 net/mac80211/mlme.c                                |   3 +-
 sound/core/pcm_lib.c                               |   8 +-
 sound/pci/hda/patch_sigmatel.c                     |  17 +-
 sound/soc/davinci/davinci-mcasp.c                  |  11 +-
 sound/soc/samsung/i2s.c                            |  16 +-
 sound/soc/soc-core.c                               |   2 +-
 151 files changed, 1345 insertions(+), 583 deletions(-)

Al Cooper (1):
      usb: xhci: Fix OOPS in xhci error handling code

Al Viro (2):
      don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu()
      be careful with nd->inode in path_init() and follow_dotdot_rcu()

Alan Stern (1):
      USB: EHCI: unlink QHs even after the controller has stopped

Alban Crequy (1):
      cgroup: reject cgroup names with '\n'

Alex Deucher (9):
      drm/radeon: add connector quirk for fujitsu board
      drm/radeon/dpm: set the thermal type properly for special configs
      drm/radeon: don't reset dma on NI/SI init
      drm/radeon: don't reset sdma on CIK init
      drm/radeon: don't reset dma on r6xx-evergreen init
      vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops
      drm/radeon/px: fix module unload
      drm/nouveau/runpm: fix module unload
      drm/radeon/cik: use a separate counter for CP init timeout

Andreas Rohner (1):
      nilfs2: fix data loss with mmap()

Andrew Hunter (1):
      jiffies: Fix timeval conversion to jiffies

Andrey Vagin (2):
      fsnotify/fdinfo: use named constants instead of hardcoded values
      fs/notify: don't show f_handle if exportfs_encode_inode_fh failed

Anssi Hannula (1):
      dm cache: fix race causing dirty blocks to be marked as clean

Anton Altaparmakov (1):
      Fix nasty 32-bit overflow bug in buffer i/o code.

Arnd Bergmann (1):
      cpufreq: integrator: fix integrator_cpufreq_remove return type

Aurelien Jarno (1):
      MIPS: ZBOOT: add missing <linux/string.h> include

Axel Lin (2):
      spi: fsl: Don't use devm_kzalloc in master->setup callback
      spi: dw: Don't use devm_kzalloc in master->setup callback

Ben Skeggs (1):
      drm/nouveau: ltc/gf100-: fix cbc issues on certain boards

Bjørn Mork (2):
      USB: sierra: avoid CDC class functions on "68A3" devices
      USB: sierra: add 1199:68AA device ID

Bruno Prémont (2):
      x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup()
      vgaarb: Don't default exclusively to first video device with mem+io

Charles Keepax (1):
      ASoC: samsung-i2s: Check secondary DAI exists before referencing

Chris Wilson (3):
      drm/i915: Evict CS TLBs between batches
      drm/i915: Fix SRC_COPY width on 830/845g
      drm/i915: Flush the PTEs after updating them before suspend

Christian König (1):
      drm/radeon: fix semaphore value init

Clemens Ladisch (1):
      ALSA: pcm: fix fifo_size frame calculation

Cong Wang (2):
      nfs: fix kernel warning when removing proc entry
      perf: Fix a race condition in perf_remove_from_context()

Daniel Vetter (1):
      drm/i915: Fix EIO/wedged handling in gem fault handler

David Dueck (1):
      can: at91_can: add missing prepare and unprepare of the clock

David Jander (2):
      can: flexcan: correctly initialize mailboxes
      can: flexcan: implement workaround for errata ERR005829

David Rientjes (1):
      mm, slab: initialize object alignment on cache creation

Denis CIOCCA (1):
      iio:magnetometer: bugfix magnetometers gain values

Dmitry Torokhov (1):
      Input: atkbd - do not try 'deactivate' keyboard on any LG laptops

Eliad Peller (2):
      regulatory: add NUL to alpha2
      iwlwifi: increase DEFAULT_MAX_TX_POWER

Emmanuel Grumbach (1):
      Revert "iwlwifi: dvm: don't enable CTS to self"

Eyal Shapira (1):
      iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate

Felipe Balbi (4):
      usb: dwc3: core: fix order of PM runtime calls
      usb: dwc3: core: fix ordering for PHY suspend
      usb: dwc3: omap: fix ordering for runtime pm calls
      usb: host: xhci: fix compliance mode workaround

Guy Martin (1):
      parisc: Implement new LWS CAS supporting 64 bit operations.

Hans Verkuil (3):
      [media] cx18: fix kernel oops with tda8290 tuner
      [media] videobuf2-dma-sg: fix for wrong GFP mask to sg_alloc_table_from_pages
      [media] adv7604: fix inverted condition

Hans de Goede (3):
      Input: elantech - fix detection of touchpad on ASUS s301l
      Input: i8042 - add Fujitsu U574 to no_timeout dmi table
      Input: i8042 - add nomux quirk for Avatar AVIU-145A6

Honggang Li (1):
      percpu: free percpu allocation info for uniprocessor system

J. Bruce Fields (1):
      lockd: fix rpcbind crash on lockd startup failure

James Ralston (2):
      ahci: Add Device IDs for Intel 9 Series PCH
      ata_piix: Add Device IDs for Intel 9 Series PCH

Joe Lawrence (1):
      usb: hub: take hub->hdev reference when processing from eventlist

Joern Engel (1):
      iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure

Johan Hovold (2):
      USB: zte_ev: fix removed PIDs
      USB: ftdi_sio: add support for NOVITUS Bono E thermal printer

Johannes Berg (1):
      Revert "mac80211: disable uAPSD if all ACs are under ACM"

Johannes Pointner (1):
      iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name

Johannes Weiner (2):
      mm: memcontrol: do not iterate uninitialized memcgs
      mm: page_alloc: fix zone allocation fairness on UP

John David Anglin (1):
      parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds

John Sung (1):
      Input: serport - add compat handling for SPIOCSTYPE ioctl

Joseph Qi (1):
      ocfs2/dlm: do not get resource spinlock if lockres is new

Josh Triplett (2):
      init/Kconfig: Hide printk log config if CONFIG_PRINTK=n
      init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu

Keith Busch (1):
      block: Fix dev_t minor allocation lifetime

Larry Finger (1):
      rtlwifi: rtl8192cu: Add new ID

Lee, Chun-Yi (1):
      ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses

Ludovic Desroches (1):
      iio: adc: at91: don't use the last converted data register

Marc Kleine-Budde (2):
      can: flexcan: mark TX mailbox as TX_INACTIVE
      can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-complete

Mark (4):
      storage: Add single-LUN quirk for Jaz USB Adapter
      USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter
      USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter
      USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters

Markos Chandras (1):
      MIPS: mcount: Adjust stack pointer for static trace in MIPS32

Mathias Nyman (2):
      xhci: Fix null pointer dereference if xhci initialization fails
      xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices

Mel Gorman (2):
      mm: migrate: Close race between migration completion and mprotect
      mm: numa: Do not mark PTEs pte_numa when splitting huge pages

Mike Christie (1):
      [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu

Mike Marciniszyn (1):
      IB/qib: Correct reference counting in debugfs qp_stats

Miklos Szeredi (2):
      vfs: add d_is_dir()
      shmem: fix nlink for rename overwrite directory

Murali Karicheri (1):
      ahci: add pcid for Marvel 0x9182 controller

Nathan Lynch (2):
      ARM: 8148/1: flush TLS and thumbee register state during exec
      ARM: 8178/1: fix set_tls for !CONFIG_KUSER_HELPERS

NeilBrown (9):
      md/raid1: intialise start_next_window for READ case to avoid hang
      md/raid1:  be more cautious where we read-balance during resync.
      md/raid1: clean up request counts properly in close_sync()
      md/raid1: make sure resync waits for conflicting writes to complete.
      md/raid1: Don't use next_resync to determine how far resync has progressed
      md/raid1: update next_resync under resync_lock.
      md/raid1: count resync requests in nr_pending.
      md/raid1: fix_read_error should act on all non-faulty devices.
      md/raid5: disable 'DISCARD' by default due to safety concerns.

Nicholas Bellinger (1):
      iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid

Nicolas Iooss (1):
      eventpoll: fix uninitialized variable in epoll_ctl

Olav Haugan (1):
      iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1

Pavel Shilovsky (3):
      CIFS: Fix directory rename error
      CIFS: Fix wrong restart readdir for SMB1
      CIFS: Fix wrong filename length for SMB2

Peter Feiner (1):
      mm: softdirty: keep bit when zapping file pte

Peter Ujfalusi (1):
      ASoC: davinci-mcasp: Correct rx format unit configuration

Peter Zijlstra (1):
      perf: fix perf bug in fork()

Qipan Li (1):
      spi: sirf: enable RX_IO_DMA_INT interrupt

Rasmus Villemoes (2):
      usb: gadget: fusb300_udc.h: Fix typo in include guard
      kcmp: fix standard comparison bug

Richard Larocque (3):
      alarmtimer: Return relative times in timer_gettime
      alarmtimer: Do not signal SIGEV_NONE timers
      alarmtimer: Lock k_itimer during timer callback

Robin Murphy (1):
      ARM: 8165/1: alignment: don't break misaligned NEON load/store

Ross Lagerwall (1):
      xen/manage: Always freeze/thaw processes when suspend/resuming

Russell King (1):
      imx-drm: ipuv3-plane: fix ipu_plane_dpms()

Sage Weil (1):
      libceph: gracefully handle large reply messages from the mon

Sagi Grimberg (2):
      Target/iser: Get isert_conn reference once got to connected_handler
      Target/iser: Don't put isert_conn inside disconnected handler

Srinivas Pandruvada (8):
      iio:trigger: modify return value for iio_trigger_get
      iio: accel: bma180: Fix indio_dev->trig assignment
      iio: adc: ad_sigma_delta: Fix indio_dev->trig assignment
      iio: hid_sensor_hub: Fix indio_dev->trig assignment
      iio: st_sensors: Fix indio_dev->trig assignment
      iio: gyro: itg3200: Fix indio_dev->trig assignment
      iio: inv_mpu6050: Fix indio_dev->trig assignment
      iio: meter: ade7758: Fix indio_dev->trig assignment

Steve Dickson (1):
      NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists()

Steve French (1):
      Fix problem recognizing symlinks

Sudeep Holla (2):
      arm64: use irq_set_affinity with force=false when migrating irqs
      ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs

Sylwester Nawrocki (1):
      ASoC: samsung-i2s: Maintain CDCLK settings across i2s_{shutdown/startup}

Takashi Iwai (1):
      ALSA: hda - Fix invalid pin powermap without jack detection

Taylor Braun-Jones (1):
      USB: ftdi_sio: Add support for GE Healthcare Nemo Tracker device

Tejun Heo (3):
      percpu: fix pcpu_alloc_pages() failure path
      percpu: perform tlb flush after pcpu_map_pages() failure
      workqueue: apply __WQ_ORDERED to create_singlethread_workqueue()

Thierry Reding (1):
      usb: phy: tegra: Avoid use of sizeof(void)

Thomas Gleixner (1):
      futex: Unlock hb->lock in futex_wait_requeue_pi() error path

Thomas Pugliese (1):
      uwb: init beacon cache entry before registering uwb device

Tony Lindgren (1):
      usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down

Trond Myklebust (1):
      NFSv4: Fix another bug in the close/open_downgrade code

Varun Sethi (1):
      iommu/fsl: Fix warning resulting from adding PCI device twice

Ville Syrjälä (1):
      drm/i915: Wait for vblank before enabling the TV encoder

Vladimir Murzin (1):
      iommu/arm-smmu: remove pgtable_page_{c,d}tor()

Wanpeng Li (1):
      sched: Fix unreleased llc_shared_mask bit during CPU hotplug

Will Deacon (1):
      arm64: flush TLS registers during exec

Willy Tarreau (2):
      Revert "lzo: properly check for overruns"
      lzo: check for length overrun in variable length encoding.

Xiubo Li (1):
      ASoC: core: fix possible ZERO_SIZE_PTR pointer dereferencing error.

Y.C. Chen (2):
      drm/ast: open key before detect chips
      drm/ast: AST2000 cannot be detected correctly

Yaniv Rosner (1):
      bnx2x: Fix link for KR with swapped polarity lane

Zhaowei Yuan (1):
      [media] vb2: fix plane index sanity check in vb2_plane_cookie()

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

* [PATCH 3.13 001/163] regulatory: add NUL to alpha2
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 002/163] percpu: fix pcpu_alloc_pages() failure path Kamal Mostafa
                   ` (161 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eliad Peller, Johannes Berg, Kamal Mostafa

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

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

From: Eliad Peller <eliad@wizery.com>

commit a5fe8e7695dc3f547e955ad2b662e3e72969e506 upstream.

alpha2 is defined as 2-chars array, but is used in multiple
places as string (e.g. with nla_put_string calls), which
might leak kernel data.

Solve it by simply adding an extra char for the NULL
terminator, making such operations safe.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/net/regulatory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index f17ed59..3e827aa 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -106,7 +106,7 @@ struct ieee80211_reg_rule {
 struct ieee80211_regdomain {
 	struct rcu_head rcu_head;
 	u32 n_reg_rules;
-	char alpha2[2];
+	char alpha2[3];
 	u8 dfs_region;
 	struct ieee80211_reg_rule reg_rules[];
 };
-- 
1.9.1


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

* [PATCH 3.13 002/163] percpu: fix pcpu_alloc_pages() failure path
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 001/163] regulatory: add NUL to alpha2 Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 003/163] percpu: perform tlb flush after pcpu_map_pages() failure Kamal Mostafa
                   ` (160 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tejun Heo, Kamal Mostafa

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

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

From: Tejun Heo <tj@kernel.org>

commit f0d279654dea22b7a6ad34b9334aee80cda62cde upstream.

When pcpu_alloc_pages() fails midway, pcpu_free_pages() is invoked to
free what has already been allocated.  The invocation is across the
whole requested range and pcpu_free_pages() will try to free all
non-NULL pages; unfortunately, this is incorrect as
pcpu_get_pages_and_bitmap(), unlike what its comment suggests, doesn't
clear the pages array and thus the array may have entries from the
previous invocations making the partial failure path free incorrect
pages.

Fix it by open-coding the partial freeing of the already allocated
pages.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/percpu-vm.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c
index 3707c71..8d9bb2c 100644
--- a/mm/percpu-vm.c
+++ b/mm/percpu-vm.c
@@ -108,7 +108,7 @@ static int pcpu_alloc_pages(struct pcpu_chunk *chunk,
 			    int page_start, int page_end)
 {
 	const gfp_t gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_COLD;
-	unsigned int cpu;
+	unsigned int cpu, tcpu;
 	int i;
 
 	for_each_possible_cpu(cpu) {
@@ -116,14 +116,23 @@ static int pcpu_alloc_pages(struct pcpu_chunk *chunk,
 			struct page **pagep = &pages[pcpu_page_idx(cpu, i)];
 
 			*pagep = alloc_pages_node(cpu_to_node(cpu), gfp, 0);
-			if (!*pagep) {
-				pcpu_free_pages(chunk, pages, populated,
-						page_start, page_end);
-				return -ENOMEM;
-			}
+			if (!*pagep)
+				goto err;
 		}
 	}
 	return 0;
+
+err:
+	while (--i >= page_start)
+		__free_page(pages[pcpu_page_idx(cpu, i)]);
+
+	for_each_possible_cpu(tcpu) {
+		if (tcpu == cpu)
+			break;
+		for (i = page_start; i < page_end; i++)
+			__free_page(pages[pcpu_page_idx(tcpu, i)]);
+	}
+	return -ENOMEM;
 }
 
 /**
-- 
1.9.1


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

* [PATCH 3.13 003/163] percpu: perform tlb flush after pcpu_map_pages() failure
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 001/163] regulatory: add NUL to alpha2 Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 002/163] percpu: fix pcpu_alloc_pages() failure path Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 004/163] percpu: free percpu allocation info for uniprocessor system Kamal Mostafa
                   ` (159 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Tejun Heo, Kamal Mostafa

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

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

From: Tejun Heo <tj@kernel.org>

commit 849f5169097e1ba35b90ac9df76b5bb6f9c0aabd upstream.

If pcpu_map_pages() fails midway, it unmaps the already mapped pages.
Currently, it doesn't flush tlb after the partial unmapping.  This may
be okay in most cases as the established mapping hasn't been used at
that point but it can go wrong and when it goes wrong it'd be
extremely difficult to track down.

Flush tlb after the partial unmapping.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/percpu-vm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c
index 8d9bb2c..5110816 100644
--- a/mm/percpu-vm.c
+++ b/mm/percpu-vm.c
@@ -272,6 +272,7 @@ err:
 		__pcpu_unmap_pages(pcpu_chunk_addr(chunk, tcpu, page_start),
 				   page_end - page_start);
 	}
+	pcpu_post_unmap_tlb_flush(chunk, page_start, page_end);
 	return err;
 }
 
-- 
1.9.1


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

* [PATCH 3.13 004/163] percpu: free percpu allocation info for uniprocessor system
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (2 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 003/163] percpu: perform tlb flush after pcpu_map_pages() failure Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 005/163] cgroup: reject cgroup names with '\n' Kamal Mostafa
                   ` (158 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Honggang Li, Tejun Heo, Kamal Mostafa

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

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

From: Honggang Li <enjoymindful@gmail.com>

commit 3189eddbcafcc4d827f7f19facbeddec4424eba8 upstream.

Currently, only SMP system free the percpu allocation info.
Uniprocessor system should free it too. For example, one x86 UML
virtual machine with 256MB memory, UML kernel wastes one page memory.

Signed-off-by: Honggang Li <enjoymindful@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/percpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/percpu.c b/mm/percpu.c
index 7d6ce15..02a89cb 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1911,6 +1911,8 @@ void __init setup_per_cpu_areas(void)
 
 	if (pcpu_setup_first_chunk(ai, fc) < 0)
 		panic("Failed to initialize percpu areas.");
+
+	pcpu_free_alloc_info(ai);
 }
 
 #endif	/* CONFIG_SMP */
-- 
1.9.1


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

* [PATCH 3.13 005/163] cgroup: reject cgroup names with '\n'
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (3 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 004/163] percpu: free percpu allocation info for uniprocessor system Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 006/163] vfs: add d_is_dir() Kamal Mostafa
                   ` (157 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alban Crequy, Tejun Heo, Kamal Mostafa

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

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

From: Alban Crequy <alban.crequy@collabora.co.uk>

commit 71b1fb5c4473a5b1e601d41b109bdfe001ec82e0 upstream.

/proc/<pid>/cgroup contains one cgroup path on each line. If cgroup names are
allowed to contain "\n", applications cannot parse /proc/<pid>/cgroup safely.

Signed-off-by: Alban Crequy <alban.crequy@collabora.co.uk>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ kamal: backport to 3.13-stable: fixed in cgroup_create() ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/cgroup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index b44dd49..8e5e0a9 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4350,6 +4350,11 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
 	struct cgroup_subsys *ss;
 	struct super_block *sb = root->sb;
 
+	/* Do not accept '\n' to prevent making /proc/<pid>/cgroup unparsable.
+	 */
+	if (strchr(dentry->d_name.name, '\n'))
+		return -EINVAL;
+
 	/* allocate the cgroup and its ID, 0 is reserved for the root */
 	cgrp = kzalloc(sizeof(*cgrp), GFP_KERNEL);
 	if (!cgrp)
-- 
1.9.1


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

* [PATCH 3.13 006/163] vfs: add d_is_dir()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (4 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 005/163] cgroup: reject cgroup names with '\n' Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 007/163] CIFS: Fix directory rename error Kamal Mostafa
                   ` (156 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Kamal Mostafa

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

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit 44b1d53043c482225196e8a9cd9f35163a1b3336 upstream.

Add d_is_dir(dentry) helper which is analogous to S_ISDIR().

To avoid confusion, rename d_is_directory() to d_can_lookup().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reviewed-by: J. Bruce Fields <bfields@redhat.com>
[ kamal: 3.13-stable prereq for a9c8259 "CIFS: Fix directory rename error" ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/namei.c             | 23 +++++++++++------------
 include/linux/dcache.h |  7 ++++++-
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index 31673f4..c0cd08d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1786,7 +1786,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 			if (err)
 				return err;
 		}
-		if (!d_is_directory(nd->path.dentry)) {
+		if (!d_can_lookup(nd->path.dentry)) {
 			err = -ENOTDIR; 
 			break;
 		}
@@ -1807,7 +1807,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
 		struct dentry *root = nd->root.dentry;
 		struct inode *inode = root->d_inode;
 		if (*name) {
-			if (!d_is_directory(root))
+			if (!d_can_lookup(root))
 				return -ENOTDIR;
 			retval = inode_permission(inode, MAY_EXEC);
 			if (retval)
@@ -1863,7 +1863,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
 		dentry = f.file->f_path.dentry;
 
 		if (*name) {
-			if (!d_is_directory(dentry)) {
+			if (!d_can_lookup(dentry)) {
 				fdput(f);
 				return -ENOTDIR;
 			}
@@ -1945,7 +1945,7 @@ static int path_lookupat(int dfd, const char *name,
 		err = complete_walk(nd);
 
 	if (!err && nd->flags & LOOKUP_DIRECTORY) {
-		if (!d_is_directory(nd->path.dentry)) {
+		if (!d_can_lookup(nd->path.dentry)) {
 			path_put(&nd->path);
 			err = -ENOTDIR;
 		}
@@ -2405,11 +2405,11 @@ static int may_delete(struct inode *dir, struct dentry *victim, bool isdir)
 	    IS_IMMUTABLE(inode) || IS_SWAPFILE(inode))
 		return -EPERM;
 	if (isdir) {
-		if (!d_is_directory(victim) && !d_is_autodir(victim))
+		if (!d_is_dir(victim))
 			return -ENOTDIR;
 		if (IS_ROOT(victim))
 			return -EBUSY;
-	} else if (d_is_directory(victim) || d_is_autodir(victim))
+	} else if (d_is_dir(victim))
 		return -EISDIR;
 	if (IS_DEADDIR(dir))
 		return -ENOENT;
@@ -3007,11 +3007,10 @@ finish_open:
 	}
 	audit_inode(name, nd->path.dentry, 0);
 	error = -EISDIR;
-	if ((open_flag & O_CREAT) &&
-	    (d_is_directory(nd->path.dentry) || d_is_autodir(nd->path.dentry)))
+	if ((open_flag & O_CREAT) && d_is_dir(nd->path.dentry))
 		goto out;
 	error = -ENOTDIR;
-	if ((nd->flags & LOOKUP_DIRECTORY) && !d_is_directory(nd->path.dentry))
+	if ((nd->flags & LOOKUP_DIRECTORY) && !d_can_lookup(nd->path.dentry))
 		goto out;
 	if (!S_ISREG(nd->inode->i_mode))
 		will_truncate = false;
@@ -3735,7 +3734,7 @@ exit1:
 slashes:
 	if (d_is_negative(dentry))
 		error = -ENOENT;
-	else if (d_is_directory(dentry) || d_is_autodir(dentry))
+	else if (d_is_dir(dentry))
 		error = -EISDIR;
 	else
 		error = -ENOTDIR;
@@ -4114,7 +4113,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 	       struct inode **delegated_inode)
 {
 	int error;
-	int is_dir = d_is_directory(old_dentry) || d_is_autodir(old_dentry);
+	int is_dir = d_is_dir(old_dentry);
 	const unsigned char *old_name;
 
 	if (old_dentry->d_inode == new_dentry->d_inode)
@@ -4207,7 +4206,7 @@ retry_deleg:
 	if (d_is_negative(old_dentry))
 		goto exit4;
 	/* unless the source is a directory trailing slashes give -ENOTDIR */
-	if (!d_is_directory(old_dentry) && !d_is_autodir(old_dentry)) {
+	if (!d_is_dir(old_dentry)) {
 		error = -ENOTDIR;
 		if (oldnd.last.name[oldnd.last.len])
 			goto exit4;
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index bf72e9a..3b50cac 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -429,7 +429,7 @@ static inline unsigned __d_entry_type(const struct dentry *dentry)
 	return dentry->d_flags & DCACHE_ENTRY_TYPE;
 }
 
-static inline bool d_is_directory(const struct dentry *dentry)
+static inline bool d_can_lookup(const struct dentry *dentry)
 {
 	return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE;
 }
@@ -439,6 +439,11 @@ static inline bool d_is_autodir(const struct dentry *dentry)
 	return __d_entry_type(dentry) == DCACHE_AUTODIR_TYPE;
 }
 
+static inline bool d_is_dir(const struct dentry *dentry)
+{
+	return d_can_lookup(dentry) || d_is_autodir(dentry);
+}
+
 static inline bool d_is_symlink(const struct dentry *dentry)
 {
 	return __d_entry_type(dentry) == DCACHE_SYMLINK_TYPE;
-- 
1.9.1


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

* [PATCH 3.13 007/163] CIFS: Fix directory rename error
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (5 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 006/163] vfs: add d_is_dir() Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 008/163] usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down Kamal Mostafa
                   ` (155 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Pavel Shilovsky, Steve French, Kamal Mostafa

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

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

From: Pavel Shilovsky <pshilovsky@samba.org>

commit a07d322059db66b84c9eb4f98959df468e88b34b upstream.

CIFS servers process nlink counts differently for files and directories.
In cifs_rename() if we the request fails on the existing target, we
try to remove it through cifs_unlink() but this is not what we want
to do for directories. As the result the following sequence of commands

mkdir {1,2}; mv -T 1 2; rmdir {1,2}; mkdir {1,2}; echo foo > 2/bar

and XFS test generic/023 fail with -ENOENT error. That's why the second
mkdir reuses the existing inode (target inode of the mv -T command) with
S_DEAD flag.

Fix this by checking whether the target is directory or not and
calling cifs_rmdir() rather than cifs_unlink() for directories.

Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/cifs/inode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 36d2b1d..3be49dd 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1682,7 +1682,10 @@ cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
 unlink_target:
 	/* Try unlinking the target dentry if it's not negative */
 	if (target_dentry->d_inode && (rc == -EACCES || rc == -EEXIST)) {
-		tmprc = cifs_unlink(target_dir, target_dentry);
+		if (d_is_dir(target_dentry))
+			tmprc = cifs_rmdir(target_dir, target_dentry);
+		else
+			tmprc = cifs_unlink(target_dir, target_dentry);
 		if (tmprc)
 			goto cifs_rename_exit;
 		rc = cifs_do_rename(xid, source_dentry, from_name,
-- 
1.9.1


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

* [PATCH 3.13 008/163] usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (6 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 007/163] CIFS: Fix directory rename error Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 009/163] rtlwifi: rtl8192cu: Add new ID Kamal Mostafa
                   ` (154 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tony Lindgren, Kishon Vijay Abraham I, Kamal Mostafa

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

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

From: Tony Lindgren <tony@atomide.com>

commit 85601b8d81e24ce9ae2d31e93f35468ab7616b18 upstream.

Commit 249751f22380 ("usb: phy: twl4030-usb: poll for ID disconnect")
added twl4030_id_workaround_work() to deal with lost interrupts
after ID pin goes down. Looks like commit f1ddc24c9e33 ("usb: phy:
twl4030-usb: remove *set_suspend* and *phy_init* ops") changed
things around for the generic phy framework, and delayed work no
longer got called except initially during boot.

The PHY connect and disconnect interrupts for twl4030-usb are not
working after disconnecting a USB-A cable from the board, and the
deeper idle states for omap are blocked as the USB controller
stays busy.

The issue can be solved by calling delayed work from twl4030_usb_irq()
when ID pin is down and the PHY is not asleep like we already do
in twl4030_id_workaround_work().

But as both twl4030_usb_irq() and twl4030_id_workaround_work()
already do pretty much the same thing, let's call twl4030_usb_irq()
from twl4030_id_workaround_work() instead of adding some more
duplicate code. We also must call sysfs_notify() only when we have
an interrupt and not from the delayed work as notified by
Grazvydas Ignotas <notasas@gmail.com>.

Fixes: f1ddc24c9e33 ("usb: phy: twl4030-usb: remove *set_suspend* and *phy_init* ops")
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/phy/phy-twl4030-usb.c | 33 ++++++++++-----------------------
 1 file changed, 10 insertions(+), 23 deletions(-)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index daf65e6..70b513a 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -560,7 +560,15 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
 		 */
 		omap_musb_mailbox(status);
 	}
-	sysfs_notify(&twl->dev->kobj, NULL, "vbus");
+
+	/* don't schedule during sleep - irq works right then */
+	if (status == OMAP_MUSB_ID_GROUND && !twl->asleep) {
+		cancel_delayed_work(&twl->id_workaround_work);
+		schedule_delayed_work(&twl->id_workaround_work, HZ);
+	}
+
+	if (irq)
+		sysfs_notify(&twl->dev->kobj, NULL, "vbus");
 
 	return IRQ_HANDLED;
 }
@@ -569,29 +577,8 @@ static void twl4030_id_workaround_work(struct work_struct *work)
 {
 	struct twl4030_usb *twl = container_of(work, struct twl4030_usb,
 		id_workaround_work.work);
-	enum omap_musb_vbus_id_status status;
-	bool status_changed = false;
-
-	status = twl4030_usb_linkstat(twl);
-
-	spin_lock_irq(&twl->lock);
-	if (status >= 0 && status != twl->linkstat) {
-		twl->linkstat = status;
-		status_changed = true;
-	}
-	spin_unlock_irq(&twl->lock);
-
-	if (status_changed) {
-		dev_dbg(twl->dev, "handle missing status change to %d\n",
-				status);
-		omap_musb_mailbox(status);
-	}
 
-	/* don't schedule during sleep - irq works right then */
-	if (status == OMAP_MUSB_ID_GROUND && !twl->asleep) {
-		cancel_delayed_work(&twl->id_workaround_work);
-		schedule_delayed_work(&twl->id_workaround_work, HZ);
-	}
+	twl4030_usb_irq(0, twl);
 }
 
 static int twl4030_phy_init(struct phy *phy)
-- 
1.9.1


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

* [PATCH 3.13 009/163] rtlwifi: rtl8192cu: Add new ID
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (7 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 008/163] usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 010/163] CIFS: Fix wrong restart readdir for SMB1 Kamal Mostafa
                   ` (153 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Larry Finger, Nico Baggus, John W. Linville, Kamal Mostafa

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

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

From: Larry Finger <Larry.Finger@lwfinger.net>

commit c66517165610b911e4c6d268f28d8c640832dbd1 upstream.

The Sitecom WLA-2102 adapter uses this driver.

Reported-by: Nico Baggus <nico-linux@noci.xs4all.nl>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Nico Baggus <nico-linux@noci.xs4all.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index c613110..f583167 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -317,6 +317,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
 	{RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
 	{RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
 	{RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
+	{RTL_USB_DEVICE(0x0df6, 0x0070, rtl92cu_hal_cfg)}, /*Sitecom - 150N */
 	{RTL_USB_DEVICE(0x0df6, 0x0077, rtl92cu_hal_cfg)}, /*Sitecom-WLA2100V2*/
 	{RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
 	{RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/
-- 
1.9.1


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

* [PATCH 3.13 010/163] CIFS: Fix wrong restart readdir for SMB1
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (8 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 009/163] rtlwifi: rtl8192cu: Add new ID Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 011/163] CIFS: Fix wrong filename length for SMB2 Kamal Mostafa
                   ` (152 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dan Carpenter, Pavel Shilovsky, Steve French, Kamal Mostafa

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

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

From: Pavel Shilovsky <pshilovsky@samba.org>

commit f736906a7669a77cf8cabdcbcf1dc8cb694e12ef upstream.

The existing code calls server->ops->close() that is not
right. This causes XFS test generic/310 to fail. Fix this
by using server->ops->closedir() function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/cifs/readdir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index b2d1430..e327a92 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -596,8 +596,8 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon, loff_t pos,
 		if (server->ops->dir_needs_close(cfile)) {
 			cfile->invalidHandle = true;
 			spin_unlock(&cifs_file_list_lock);
-			if (server->ops->close)
-				server->ops->close(xid, tcon, &cfile->fid);
+			if (server->ops->close_dir)
+				server->ops->close_dir(xid, tcon, &cfile->fid);
 		} else
 			spin_unlock(&cifs_file_list_lock);
 		if (cfile->srch_inf.ntwrk_buf_start) {
-- 
1.9.1


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

* [PATCH 3.13 011/163] CIFS: Fix wrong filename length for SMB2
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (9 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 010/163] CIFS: Fix wrong restart readdir for SMB1 Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 012/163] Revert "mac80211: disable uAPSD if all ACs are under ACM" Kamal Mostafa
                   ` (151 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Pavel Shilovsky, Steve French, Kamal Mostafa

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

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

From: Pavel Shilovsky <pshilovsky@samba.org>

commit 1bbe4997b13de903c421c1cc78440e544b5f9064 upstream.

The existing code uses the old MAX_NAME constant. This causes
XFS test generic/013 to fail. Fix it by replacing MAX_NAME with
PATH_MAX that SMB1 uses. Also remove an unused MAX_NAME constant
definition.

Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/cifs/cifsglob.h  | 5 -----
 fs/cifs/smb2file.c  | 2 +-
 fs/cifs/smb2inode.c | 2 +-
 fs/cifs/smb2ops.c   | 2 +-
 fs/cifs/smb2pdu.c   | 2 +-
 5 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 292a62f..60aa9b9 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -70,11 +70,6 @@
 #define SERVER_NAME_LENGTH 40
 #define SERVER_NAME_LEN_WITH_NULL     (SERVER_NAME_LENGTH + 1)
 
-/* used to define string lengths for reversing unicode strings */
-/*         (256+1)*2 = 514                                     */
-/*           (max path length + 1 for null) * 2 for unicode    */
-#define MAX_NAME 514
-
 /* SMB echo "timeout" -- FIXME: tunable? */
 #define SMB_ECHO_INTERVAL (60 * HZ)
 
diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c
index 3f17b45..4599294 100644
--- a/fs/cifs/smb2file.c
+++ b/fs/cifs/smb2file.c
@@ -50,7 +50,7 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms,
 		goto out;
 	}
 
-	smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + MAX_NAME * 2,
+	smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + PATH_MAX * 2,
 			    GFP_KERNEL);
 	if (smb2_data == NULL) {
 		rc = -ENOMEM;
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index 84c012a..215f8d3 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -131,7 +131,7 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
 	*adjust_tz = false;
 	*symlink = false;
 
-	smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + MAX_NAME * 2,
+	smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + PATH_MAX * 2,
 			    GFP_KERNEL);
 	if (smb2_data == NULL)
 		return -ENOMEM;
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index a628cf8..34a17d4 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -339,7 +339,7 @@ smb2_query_file_info(const unsigned int xid, struct cifs_tcon *tcon,
 	int rc;
 	struct smb2_file_all_info *smb2_data;
 
-	smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + MAX_NAME * 2,
+	smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + PATH_MAX * 2,
 			    GFP_KERNEL);
 	if (smb2_data == NULL)
 		return -ENOMEM;
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 2c4bb71..3adcb22 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1540,7 +1540,7 @@ SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon,
 {
 	return query_info(xid, tcon, persistent_fid, volatile_fid,
 			  FILE_ALL_INFORMATION,
-			  sizeof(struct smb2_file_all_info) + MAX_NAME * 2,
+			  sizeof(struct smb2_file_all_info) + PATH_MAX * 2,
 			  sizeof(struct smb2_file_all_info), data);
 }
 
-- 
1.9.1


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

* [PATCH 3.13 012/163] Revert "mac80211: disable uAPSD if all ACs are under ACM"
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (10 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 011/163] CIFS: Fix wrong filename length for SMB2 Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 013/163] ahci: Add Device IDs for Intel 9 Series PCH Kamal Mostafa
                   ` (150 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johannes Berg, Kamal Mostafa

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

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

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

commit bb512ad0732232f1d2693bb68f31a76bed8f22ae upstream.

This reverts commit 24aa11ab8ae03292d38ec0dbd9bc2ac49fe8a6dd.

That commit was wrong since it uses data that hasn't even been set
up yet, but might be a hold-over from a previous connection.

Additionally, it seems like a driver-specific workaround that
shouldn't have been in mac80211 to start with.

Fixes: 24aa11ab8ae0 ("mac80211: disable uAPSD if all ACs are under ACM")
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/mac80211/mlme.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index fcdd5de..6c126fc 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -4219,8 +4219,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
 	rcu_read_unlock();
 
 	if (bss->wmm_used && bss->uapsd_supported &&
-	    (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_UAPSD) &&
-	    sdata->wmm_acm != 0xff) {
+	    (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_UAPSD)) {
 		assoc_data->uapsd = true;
 		ifmgd->flags |= IEEE80211_STA_UAPSD_ENABLED;
 	} else {
-- 
1.9.1


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

* [PATCH 3.13 013/163] ahci: Add Device IDs for Intel 9 Series PCH
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (11 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 012/163] Revert "mac80211: disable uAPSD if all ACs are under ACM" Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 014/163] ata_piix: " Kamal Mostafa
                   ` (149 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: James Ralston, Tejun Heo, Kamal Mostafa

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

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

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

commit 1b071a0947dbce5c184c12262e02540fbc493457 upstream.

This patch adds the AHCI mode SATA Device IDs for the Intel 9 Series PCH.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/ahci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 5e98993..95c297b 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -304,6 +304,14 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, 0x9c85), board_ahci }, /* Wildcat Point-LP RAID */
 	{ PCI_VDEVICE(INTEL, 0x9c87), board_ahci }, /* Wildcat Point-LP RAID */
 	{ PCI_VDEVICE(INTEL, 0x9c8f), board_ahci }, /* Wildcat Point-LP RAID */
+	{ PCI_VDEVICE(INTEL, 0x8c82), board_ahci }, /* 9 Series AHCI */
+	{ PCI_VDEVICE(INTEL, 0x8c83), board_ahci }, /* 9 Series AHCI */
+	{ PCI_VDEVICE(INTEL, 0x8c84), board_ahci }, /* 9 Series RAID */
+	{ PCI_VDEVICE(INTEL, 0x8c85), board_ahci }, /* 9 Series RAID */
+	{ PCI_VDEVICE(INTEL, 0x8c86), board_ahci }, /* 9 Series RAID */
+	{ PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */
+	{ PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
+	{ PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */
 
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
 	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-- 
1.9.1


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

* [PATCH 3.13 014/163] ata_piix: Add Device IDs for Intel 9 Series PCH
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (12 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 013/163] ahci: Add Device IDs for Intel 9 Series PCH Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 015/163] Revert "iwlwifi: dvm: don't enable CTS to self" Kamal Mostafa
                   ` (148 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: James Ralston, Tejun Heo, Kamal Mostafa

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

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

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

commit 6cad1376954e591c3c41500c4e586e183e7ffe6d upstream.

This patch adds the IDE mode SATA Device IDs for the Intel 9 Series PCH.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/ata_piix.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 6334c8d..39f76b9 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -340,6 +340,14 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	{ 0x8086, 0x0F21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt },
 	/* SATA Controller IDE (Coleto Creek) */
 	{ 0x8086, 0x23a6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
+	/* SATA Controller IDE (9 Series) */
+	{ 0x8086, 0x8c88, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb },
+	/* SATA Controller IDE (9 Series) */
+	{ 0x8086, 0x8c89, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb },
+	/* SATA Controller IDE (9 Series) */
+	{ 0x8086, 0x8c80, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
+	/* SATA Controller IDE (9 Series) */
+	{ 0x8086, 0x8c81, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
 
 	{ }	/* terminate list */
 };
-- 
1.9.1


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

* [PATCH 3.13 015/163] Revert "iwlwifi: dvm: don't enable CTS to self"
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (13 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 014/163] ata_piix: " Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 016/163] USB: zte_ev: fix removed PIDs Kamal Mostafa
                   ` (147 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Emmanuel Grumbach, Kamal Mostafa

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

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

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

commit f47f46d7b09cf1d09e4b44b6cc4dd7d68a08028c upstream.

This reverts commit 43d826ca5979927131685cc2092c7ce862cb91cd.

This commit caused packet loss.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/wireless/iwlwifi/dvm/rxon.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/wireless/iwlwifi/dvm/rxon.c b/drivers/net/wireless/iwlwifi/dvm/rxon.c
index 6a5b759..d7ce2f1 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rxon.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rxon.c
@@ -1068,6 +1068,13 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 	/* recalculate basic rates */
 	iwl_calc_basic_rates(priv, ctx);
 
+	/*
+	 * force CTS-to-self frames protection if RTS-CTS is not preferred
+	 * one aggregation protection method
+	 */
+	if (!priv->hw_params.use_rts_for_aggregation)
+		ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
+
 	if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
 	    !(ctx->staging.flags & RXON_FLG_BAND_24G_MSK))
 		ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK;
@@ -1473,6 +1480,11 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
 	else
 		ctx->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
 
+	if (bss_conf->use_cts_prot)
+		ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
+	else
+		ctx->staging.flags &= ~RXON_FLG_SELF_CTS_EN;
+
 	memcpy(ctx->staging.bssid_addr, bss_conf->bssid, ETH_ALEN);
 
 	if (vif->type == NL80211_IFTYPE_AP ||
-- 
1.9.1


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

* [PATCH 3.13 016/163] USB: zte_ev: fix removed PIDs
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (14 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 015/163] Revert "iwlwifi: dvm: don't enable CTS to self" Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 017/163] USB: ftdi_sio: add support for NOVITUS Bono E thermal printer Kamal Mostafa
                   ` (146 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa

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

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

From: Johan Hovold <johan@kernel.org>

commit 4df0ea41af9dce89daa9f1cb968884b346d168c9 upstream.

Add back some PIDs that were mistakingly remove when reverting commit
73228a0538a7 ("USB: option,zte_ev: move most ZTE CDMA devices to
zte_ev"), which apparently did more than its commit message claimed in
that it not only moved some PIDs from option to zte_ev but also added
some new ones.

Fixes: 63a901c06e3c ("Revert "USB: option,zte_ev: move most ZTE CDMA
devices to zte_ev"")

Reported-by: Lei Liu <lei35151@163.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/zte_ev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/serial/zte_ev.c b/drivers/usb/serial/zte_ev.c
index 88dd32c..d6a3fbd 100644
--- a/drivers/usb/serial/zte_ev.c
+++ b/drivers/usb/serial/zte_ev.c
@@ -273,6 +273,14 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port)
 }
 
 static const struct usb_device_id id_table[] = {
+	{ USB_DEVICE(0x19d2, 0xffec) },
+	{ USB_DEVICE(0x19d2, 0xffee) },
+	{ USB_DEVICE(0x19d2, 0xfff6) },
+	{ USB_DEVICE(0x19d2, 0xfff7) },
+	{ USB_DEVICE(0x19d2, 0xfff8) },
+	{ USB_DEVICE(0x19d2, 0xfff9) },
+	{ USB_DEVICE(0x19d2, 0xfffb) },
+	{ USB_DEVICE(0x19d2, 0xfffc) },
 	/* MG880 */
 	{ USB_DEVICE(0x19d2, 0xfffd) },
 	{ },
-- 
1.9.1


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

* [PATCH 3.13 017/163] USB: ftdi_sio: add support for NOVITUS Bono E thermal printer
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (15 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 016/163] USB: zte_ev: fix removed PIDs Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 018/163] USB: sierra: avoid CDC class functions on "68A3" devices Kamal Mostafa
                   ` (145 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Kamal Mostafa

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

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

From: Johan Hovold <johan@kernel.org>

commit ee444609dbae8afee420c3243ce4c5f442efb622 upstream.

Add device id for NOVITUS Bono E thermal printer.

Reported-by: Emanuel Koczwara <poczta@emanuelkoczwara.pl>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/ftdi_sio.c     | 1 +
 drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index d429761..7bdfa9c 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -742,6 +742,7 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
 	{ USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
+	{ USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) },
 	{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) },
 	{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) },
 	{ USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 70b0b1d..8927a5c 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -837,6 +837,12 @@
 #define TELLDUS_TELLSTICK_PID		0x0C30	/* RF control dongle 433 MHz using FT232RL */
 
 /*
+ * NOVITUS printers
+ */
+#define NOVITUS_VID			0x1a28
+#define NOVITUS_BONO_E_PID		0x6010
+
+/*
  * RT Systems programming cables for various ham radios
  */
 #define RTSYSTEMS_VID		0x2100	/* Vendor ID */
-- 
1.9.1


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

* [PATCH 3.13 018/163] USB: sierra: avoid CDC class functions on "68A3" devices
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (16 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 017/163] USB: ftdi_sio: add support for NOVITUS Bono E thermal printer Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 019/163] USB: sierra: add 1199:68AA device ID Kamal Mostafa
                   ` (144 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bjørn Mork, Johan Hovold, Kamal Mostafa

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

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

From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>

commit 049255f51644c1105775af228396d187402a5934 upstream.

Sierra Wireless Direct IP devices using the 68A3 product ID
can be configured for modes including a CDC ECM class function.
The known example uses interface numbers 12 and 13 for the ECM
control and data interfaces respectively, consistent with CDC
MBIM function interface numbering on other Sierra devices.

It seems cleaner to restrict this driver to the ff/ff/ff
vendor specific interfaces rather than increasing the already
long interface number blacklist.  This should be more future
proof if Sierra adds more class functions using interface
numbers not yet in the blacklist.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/sierra.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index b6910b7..aa69283 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -281,14 +281,16 @@ static const struct usb_device_id id_table[] = {
 	/* Sierra Wireless HSPA Non-Composite Device */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)},
 	{ USB_DEVICE(0x1199, 0x6893) },	/* Sierra Wireless Device */
-	{ USB_DEVICE(0x1199, 0x68A3), 	/* Sierra Wireless Direct IP modems */
+	/* Sierra Wireless Direct IP modems */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68A3, 0xFF, 0xFF, 0xFF),
 	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
 	},
 	/* AT&T Direct IP LTE modems */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF),
 	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
 	},
-	{ USB_DEVICE(0x0f3d, 0x68A3), 	/* Airprime/Sierra Wireless Direct IP modems */
+	/* Airprime/Sierra Wireless Direct IP modems */
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68A3, 0xFF, 0xFF, 0xFF),
 	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
 	},
 
-- 
1.9.1


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

* [PATCH 3.13 019/163] USB: sierra: add 1199:68AA device ID
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (17 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 018/163] USB: sierra: avoid CDC class functions on "68A3" devices Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 020/163] iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1 Kamal Mostafa
                   ` (143 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bjørn Mork, Johan Hovold, Kamal Mostafa

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

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

From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no>

commit 5b3da69285c143b7ea76b3b9f73099ff1093ab73 upstream.

This VID:PID is used for some Direct IP devices behaving
identical to the already supported 0F3D:68AA devices.

Reported-by: Lars Melin <larsm17@gmail.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/sierra.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index aa69283..c0a59fd 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -285,6 +285,9 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68A3, 0xFF, 0xFF, 0xFF),
 	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
 	},
+	{ USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68AA, 0xFF, 0xFF, 0xFF),
+	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
+	},
 	/* AT&T Direct IP LTE modems */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF),
 	  .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
-- 
1.9.1


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

* [PATCH 3.13 020/163] iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (18 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 019/163] USB: sierra: add 1199:68AA device ID Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 021/163] iommu/arm-smmu: remove pgtable_page_{c,d}tor() Kamal Mostafa
                   ` (142 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Olav Haugan, Will Deacon, Kamal Mostafa

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

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

From: Olav Haugan <ohaugan@codeaurora.org>

commit 1fc870c7efa364862c3bc792cfbdb38afea26742 upstream.

Stage-1 context banks do not have the SMMU_CBn_TCR[SL0] field since it
is only applicable to stage-2 context banks.

This patch ensures that we don't set the reserved TCR bits for stage-1
translations.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iommu/arm-smmu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 0d3e4e6..91739bf 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -793,8 +793,11 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain)
 	reg |= TTBCR_EAE |
 	      (TTBCR_SH_IS << TTBCR_SH0_SHIFT) |
 	      (TTBCR_RGN_WBWA << TTBCR_ORGN0_SHIFT) |
-	      (TTBCR_RGN_WBWA << TTBCR_IRGN0_SHIFT) |
-	      (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
+	      (TTBCR_RGN_WBWA << TTBCR_IRGN0_SHIFT);
+
+	if (!stage1)
+		reg |= (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
+
 	writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR);
 
 	/* MAIR0 (stage-1 only) */
-- 
1.9.1


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

* [PATCH 3.13 021/163] iommu/arm-smmu: remove pgtable_page_{c,d}tor()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (19 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 020/163] iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1 Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 022/163] xen/manage: Always freeze/thaw processes when suspend/resuming Kamal Mostafa
                   ` (141 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vladimir Murzin, Will Deacon, Kamal Mostafa

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

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

From: Vladimir Murzin <vladimir.murzin@arm.com>

commit 93b14135cf24668b45eb57348312b627a8539bc4 upstream.

If split page table lock for PTE tables is enabled (CONFIG_SPLIT_PTLOCK_CPUS
<=NR_CPUS) pgtable_page_ctor() leads to non-atomic allocation for ptlock with
a spinlock held, resulting in:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 466 at kernel/locking/lockdep.c:2742 lockdep_trace_alloc+0xd8/0xf4()
DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
Modules linked in:
CPU: 0 PID: 466 Comm: dma0chan0-copy0 Not tainted 3.16.0-3d47efb-clean-pl330-dma_test-ve-a15-a32-slr-m
c-on-3+ #55
[<80014748>] (unwind_backtrace) from [<80011640>] (show_stack+0x10/0x14)
[<80011640>] (show_stack) from [<802bf864>] (dump_stack+0x80/0xb4)
[<802bf864>] (dump_stack) from [<8002385c>] (warn_slowpath_common+0x64/0x88)
[<8002385c>] (warn_slowpath_common) from [<80023914>] (warn_slowpath_fmt+0x30/0x40)
[<80023914>] (warn_slowpath_fmt) from [<8005d818>] (lockdep_trace_alloc+0xd8/0xf4)
[<8005d818>] (lockdep_trace_alloc) from [<800d3d78>] (kmem_cache_alloc+0x24/0x144)
[<800d3d78>] (kmem_cache_alloc) from [<800bfae4>] (ptlock_alloc+0x18/0x2c)
[<800bfae4>] (ptlock_alloc) from [<802b1ec0>] (arm_smmu_handle_mapping+0x4c0/0x690)
[<802b1ec0>] (arm_smmu_handle_mapping) from [<802b0cd8>] (iommu_map+0xe0/0x148)
[<802b0cd8>] (iommu_map) from [<80019098>] (arm_coherent_iommu_map_page+0x160/0x278)
[<80019098>] (arm_coherent_iommu_map_page) from [<801f4d78>] (dmatest_func+0x60c/0x1098)
[<801f4d78>] (dmatest_func) from [<8003f8ac>] (kthread+0xcc/0xe8)
[<8003f8ac>] (kthread) from [<8000e868>] (ret_from_fork+0x14/0x2c)
---[ end trace ce0d27e6f434acf8 ]--

Split page tables lock is not used in the driver. In fact, page tables are
guarded with domain lock, so remove calls to pgtable_page_{c,d}tor().

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iommu/arm-smmu.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 91739bf..176c9ea 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -946,7 +946,6 @@ out_free_domain:
 static void arm_smmu_free_ptes(pmd_t *pmd)
 {
 	pgtable_t table = pmd_pgtable(*pmd);
-	pgtable_page_dtor(table);
 	__free_page(table);
 }
 
@@ -1231,10 +1230,6 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_device *smmu, pmd_t *pmd,
 			return -ENOMEM;
 
 		arm_smmu_flush_pgtable(smmu, page_address(table), PAGE_SIZE);
-		if (!pgtable_page_ctor(table)) {
-			__free_page(table);
-			return -ENOMEM;
-		}
 		pmd_populate(NULL, pmd, table);
 		arm_smmu_flush_pgtable(smmu, pmd, sizeof(*pmd));
 	}
-- 
1.9.1


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

* [PATCH 3.13 022/163] xen/manage: Always freeze/thaw processes when suspend/resuming
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (20 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 021/163] iommu/arm-smmu: remove pgtable_page_{c,d}tor() Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 023/163] usb: gadget: fusb300_udc.h: Fix typo in include guard Kamal Mostafa
                   ` (140 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ross Lagerwall, David Vrabel, Kamal Mostafa

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

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

From: Ross Lagerwall <ross.lagerwall@citrix.com>

commit 61a734d305e16944b42730ef582a7171dc733321 upstream.

Always freeze processes when suspending and thaw processes when resuming
to prevent a race noticeable with HVM guests.

This prevents a deadlock where the khubd kthread (which is designed to
be freezable) acquires a usb device lock and then tries to allocate
memory which requires the disk which hasn't been resumed yet.
Meanwhile, the xenwatch thread deadlocks waiting for the usb device
lock.

Freezing processes fixes this because the khubd thread is only thawed
after the xenwatch thread finishes resuming all the devices.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/xen/manage.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 0bc8086..a344372 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -110,16 +110,11 @@ static void do_suspend(void)
 
 	shutting_down = SHUTDOWN_SUSPEND;
 
-#ifdef CONFIG_PREEMPT
-	/* If the kernel is preemptible, we need to freeze all the processes
-	   to prevent them from being in the middle of a pagetable update
-	   during suspend. */
 	err = freeze_processes();
 	if (err) {
 		pr_err("%s: freeze failed %d\n", __func__, err);
 		goto out;
 	}
-#endif
 
 	err = dpm_suspend_start(PMSG_FREEZE);
 	if (err) {
@@ -172,10 +167,8 @@ out_resume:
 	dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
 
 out_thaw:
-#ifdef CONFIG_PREEMPT
 	thaw_processes();
 out:
-#endif
 	shutting_down = SHUTDOWN_INVALID;
 }
 #endif	/* CONFIG_HIBERNATE_CALLBACKS */
-- 
1.9.1


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

* [PATCH 3.13 023/163] usb: gadget: fusb300_udc.h: Fix typo in include guard
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (21 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 022/163] xen/manage: Always freeze/thaw processes when suspend/resuming Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 024/163] usb: phy: tegra: Avoid use of sizeof(void) Kamal Mostafa
                   ` (139 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Rasmus Villemoes, Felipe Balbi, Kamal Mostafa

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

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

From: Rasmus Villemoes <linux@rasmusvillemoes.dk>

commit f0798d6a04867ad8db8b41ddea45627d2c8cffe3 upstream.

Clearly this was meant to be an include guard, but a trailing
underscore was missing. It has been this way since the file was
introduced in 0fe6f1d1 ("usb: udc: add Faraday fusb300 driver").

Fixes: 0fe6f1d1 ("usb: udc: add Faraday fusb300 driver")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/gadget/fusb300_udc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/fusb300_udc.h b/drivers/usb/gadget/fusb300_udc.h
index ae811d8..ad39f89 100644
--- a/drivers/usb/gadget/fusb300_udc.h
+++ b/drivers/usb/gadget/fusb300_udc.h
@@ -12,7 +12,7 @@
 
 
 #ifndef __FUSB300_UDC_H__
-#define __FUSB300_UDC_H_
+#define __FUSB300_UDC_H__
 
 #include <linux/kernel.h>
 
-- 
1.9.1


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

* [PATCH 3.13 024/163] usb: phy: tegra: Avoid use of sizeof(void)
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (22 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 023/163] usb: gadget: fusb300_udc.h: Fix typo in include guard Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 025/163] arm64: use irq_set_affinity with force=false when migrating irqs Kamal Mostafa
                   ` (138 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thierry Reding, Felipe Balbi, Kamal Mostafa

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

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

From: Thierry Reding <treding@nvidia.com>

commit 9ce9ec95fb9b82e09b55a52f1bb8a362bf8f74d8 upstream.

The PHY configuration is stored in an opaque "config" field, but when
allocating the structure, its proper size needs to be known. In the case
of UTMI, the proper structure is tegra_utmip_config of which a local
variable already exists, so we can use that to obtain the size from.

Fixes the following warning from the sparse checker:

	drivers/usb/phy/phy-tegra-usb.c:882:17: warning: expression using sizeof(void)

Fixes: 81d5dfe6d8b3 (usb: phy: tegra: Read UTMIP parameters from device tree)
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/phy/phy-tegra-usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index bbe4f8e..8834b70 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -881,8 +881,8 @@ static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy,
 		return -ENOMEM;
 	}
 
-	tegra_phy->config = devm_kzalloc(&pdev->dev,
-		sizeof(*tegra_phy->config), GFP_KERNEL);
+	tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config),
+					 GFP_KERNEL);
 	if (!tegra_phy->config) {
 		dev_err(&pdev->dev,
 			"unable to allocate memory for USB UTMIP config\n");
-- 
1.9.1


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

* [PATCH 3.13 025/163] arm64: use irq_set_affinity with force=false when migrating irqs
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (23 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 024/163] usb: phy: tegra: Avoid use of sizeof(void) Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 026/163] block: Fix dev_t minor allocation lifetime Kamal Mostafa
                   ` (137 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sudeep Holla, Catalin Marinas, Will Deacon, Kamal Mostafa

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

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

From: Sudeep Holla <sudeep.holla@arm.com>

commit 3d8afe3099ebc602848aa7f09235cce3a9a023ce upstream.

The arm64 interrupt migration code on cpu offline calls
irqchip.irq_set_affinity() with the argument force=true. Originally
this argument had no effect because it was not used by any interrupt
chip driver and there was no semantics defined.

This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu
affinity of interrupts") which made the force argument useful to route
interrupts to not yet online cpus without checking the target cpu
against the cpu online mask. The following commit ffde1de64012
("irqchip: gic: Support forced affinity setting") implemented this for
the GIC interrupt controller.

As a consequence the cpu offline irq migration fails if CPU0 is
offlined, because CPU0 is still set in the affinity mask and the
validation against cpu online mask is skipped to the force argument
being true. The following first_cpu(mask) selection always selects
CPU0 as the target.

Commit 601c942176d8("arm64: use cpu_online_mask when using forced
irq_set_affinity") intended to fix the above mentioned issue but
introduced another issue where affinity can be migrated to a wrong
CPU due to unconditional copy of cpu_online_mask.

As with for arm, solve the issue by calling irq_set_affinity() with
force=false from the CPU offline irq migration code so the GIC driver
validates the affinity mask against CPU online mask and therefore
removes CPU0 from the possible target candidates. Also revert the
changes done in the commit 601c942176d8 as it's no longer needed.

Tested on Juno platform.

Fixes: 601c942176d8("arm64: use cpu_online_mask when using forced
	irq_set_affinity")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[ kamal: backport to 3.13-stable: only need the irq_set_affinity(false) fix ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm64/kernel/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c
index 473e5db..dfa6e3e 100644
--- a/arch/arm64/kernel/irq.c
+++ b/arch/arm64/kernel/irq.c
@@ -105,7 +105,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	c = irq_data_get_irq_chip(d);
 	if (!c->irq_set_affinity)
 		pr_debug("IRQ%u: unable to set affinity\n", d->irq);
-	else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
+	else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
 		cpumask_copy(d->affinity, affinity);
 
 	return ret;
-- 
1.9.1


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

* [PATCH 3.13 026/163] block: Fix dev_t minor allocation lifetime
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (24 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 025/163] arm64: use irq_set_affinity with force=false when migrating irqs Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:09   ` Jens Axboe
  2014-10-09 21:00 ` [PATCH 3.13 027/163] usb: dwc3: core: fix order of PM runtime calls Kamal Mostafa
                   ` (136 subsequent siblings)
  162 siblings, 1 reply; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Keith Busch, Jens Axboe, Kamal Mostafa

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

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

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

commit 2da78092dda13f1efd26edbbf99a567776913750 upstream.

Releases the dev_t minor when all references are closed to prevent
another device from acquiring the same major/minor.

Since the partition's release may be invoked from call_rcu's soft-irq
context, the ext_dev_idr's mutex had to be replaced with a spinlock so
as not so sleep.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 block/genhd.c             | 24 ++++++++++++++----------
 block/partition-generic.c |  2 +-
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 791f419..09da5e4 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -28,10 +28,10 @@ struct kobject *block_depr;
 /* for extended dynamic devt allocation, currently only one major is used */
 #define NR_EXT_DEVT		(1 << MINORBITS)
 
-/* For extended devt allocation.  ext_devt_mutex prevents look up
+/* For extended devt allocation.  ext_devt_lock prevents look up
  * results from going away underneath its user.
  */
-static DEFINE_MUTEX(ext_devt_mutex);
+static DEFINE_SPINLOCK(ext_devt_lock);
 static DEFINE_IDR(ext_devt_idr);
 
 static struct device_type disk_type;
@@ -420,9 +420,13 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt)
 	}
 
 	/* allocate ext devt */
-	mutex_lock(&ext_devt_mutex);
-	idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_KERNEL);
-	mutex_unlock(&ext_devt_mutex);
+	idr_preload(GFP_KERNEL);
+
+	spin_lock(&ext_devt_lock);
+	idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT);
+	spin_unlock(&ext_devt_lock);
+
+	idr_preload_end();
 	if (idx < 0)
 		return idx == -ENOSPC ? -EBUSY : idx;
 
@@ -447,9 +451,9 @@ void blk_free_devt(dev_t devt)
 		return;
 
 	if (MAJOR(devt) == BLOCK_EXT_MAJOR) {
-		mutex_lock(&ext_devt_mutex);
+		spin_lock(&ext_devt_lock);
 		idr_remove(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
-		mutex_unlock(&ext_devt_mutex);
+		spin_unlock(&ext_devt_lock);
 	}
 }
 
@@ -665,7 +669,6 @@ void del_gendisk(struct gendisk *disk)
 		sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk)));
 	pm_runtime_set_memalloc_noio(disk_to_dev(disk), false);
 	device_del(disk_to_dev(disk));
-	blk_free_devt(disk_to_dev(disk)->devt);
 }
 EXPORT_SYMBOL(del_gendisk);
 
@@ -690,13 +693,13 @@ struct gendisk *get_gendisk(dev_t devt, int *partno)
 	} else {
 		struct hd_struct *part;
 
-		mutex_lock(&ext_devt_mutex);
+		spin_lock(&ext_devt_lock);
 		part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
 		if (part && get_disk(part_to_disk(part))) {
 			*partno = part->partno;
 			disk = part_to_disk(part);
 		}
-		mutex_unlock(&ext_devt_mutex);
+		spin_unlock(&ext_devt_lock);
 	}
 
 	return disk;
@@ -1098,6 +1101,7 @@ static void disk_release(struct device *dev)
 {
 	struct gendisk *disk = dev_to_disk(dev);
 
+	blk_free_devt(dev->devt);
 	disk_release_events(disk);
 	kfree(disk->random);
 	disk_replace_part_tbl(disk, NULL);
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 789cdea..0d9e5f9 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -211,6 +211,7 @@ static const struct attribute_group *part_attr_groups[] = {
 static void part_release(struct device *dev)
 {
 	struct hd_struct *p = dev_to_part(dev);
+	blk_free_devt(dev->devt);
 	free_part_stats(p);
 	free_part_info(p);
 	kfree(p);
@@ -253,7 +254,6 @@ void delete_partition(struct gendisk *disk, int partno)
 	rcu_assign_pointer(ptbl->last_lookup, NULL);
 	kobject_put(part->holder_dir);
 	device_del(part_to_dev(part));
-	blk_free_devt(part_devt(part));
 
 	hd_struct_put(part);
 }
-- 
1.9.1


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

* [PATCH 3.13 027/163] usb: dwc3: core: fix order of PM runtime calls
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (25 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 026/163] block: Fix dev_t minor allocation lifetime Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 028/163] usb: dwc3: core: fix ordering for PHY suspend Kamal Mostafa
                   ` (135 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Felipe Balbi, Kamal Mostafa

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

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

From: Felipe Balbi <balbi@ti.com>

commit fed33afce0eda44a46ae24d93aec1b5198c0bac4 upstream.

Currently, we disable pm_runtime before all register
accesses are done, this is dangerous and might lead
to abort exceptions due to the driver trying to access
a register which is clocked by a clock which was long
gated.

Fix that by moving pm_runtime_put_sync() and pm_runtime_disable()
as the last thing we do before returning from our ->remove()
method.

Fixes: 72246da (usb: Introduce DesignWare USB3 DRD Driver)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/dwc3/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index a49217a..8c9c4cf 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -586,9 +586,6 @@ static int dwc3_remove(struct platform_device *pdev)
 	usb_phy_set_suspend(dwc->usb2_phy, 1);
 	usb_phy_set_suspend(dwc->usb3_phy, 1);
 
-	pm_runtime_put_sync(&pdev->dev);
-	pm_runtime_disable(&pdev->dev);
-
 	dwc3_debugfs_exit(dwc);
 
 	switch (dwc->dr_mode) {
@@ -611,6 +608,9 @@ static int dwc3_remove(struct platform_device *pdev)
 	dwc3_free_event_buffers(dwc);
 	dwc3_core_exit(dwc);
 
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+
 	return 0;
 }
 
-- 
1.9.1


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

* [PATCH 3.13 028/163] usb: dwc3: core: fix ordering for PHY suspend
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (26 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 027/163] usb: dwc3: core: fix order of PM runtime calls Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 029/163] usb: dwc3: omap: fix ordering for runtime pm calls Kamal Mostafa
                   ` (134 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Felipe Balbi, Kamal Mostafa

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

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

From: Felipe Balbi <balbi@ti.com>

commit dc99f16f076559235c92d3eb66d03d1310faea08 upstream.

We can't suspend the PHYs before dwc3_core_exit_mode()
has been called, that's because the host and/or device
sides might still need to communicate with the far end
link partner.

Fixes: 8ba007a (usb: dwc3: core: enable the USB2 and USB3 phy in probe)
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/dwc3/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 8c9c4cf..f074755 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -583,9 +583,6 @@ static int dwc3_remove(struct platform_device *pdev)
 {
 	struct dwc3	*dwc = platform_get_drvdata(pdev);
 
-	usb_phy_set_suspend(dwc->usb2_phy, 1);
-	usb_phy_set_suspend(dwc->usb3_phy, 1);
-
 	dwc3_debugfs_exit(dwc);
 
 	switch (dwc->dr_mode) {
@@ -606,6 +603,10 @@ static int dwc3_remove(struct platform_device *pdev)
 
 	dwc3_event_buffers_cleanup(dwc);
 	dwc3_free_event_buffers(dwc);
+
+	usb_phy_set_suspend(dwc->usb2_phy, 1);
+	usb_phy_set_suspend(dwc->usb3_phy, 1);
+
 	dwc3_core_exit(dwc);
 
 	pm_runtime_put_sync(&pdev->dev);
-- 
1.9.1


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

* [PATCH 3.13 029/163] usb: dwc3: omap: fix ordering for runtime pm calls
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (27 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 028/163] usb: dwc3: core: fix ordering for PHY suspend Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 030/163] iommu/fsl: Fix warning resulting from adding PCI device twice Kamal Mostafa
                   ` (133 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Felipe Balbi, Kamal Mostafa

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

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

From: Felipe Balbi <balbi@ti.com>

commit 81a60b7f5c143ab3cdcd9943c9b4b7c63c32fc31 upstream.

we don't to gate clocks until our children are
done with their remove path.

Fixes: af310e9 (usb: dwc3: omap: use runtime API's to enable clocks)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/dwc3/dwc3-omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 7f7ea62..2a0422b 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -592,9 +592,9 @@ static int dwc3_omap_remove(struct platform_device *pdev)
 	if (omap->extcon_id_dev.edev)
 		extcon_unregister_interest(&omap->extcon_id_dev);
 	dwc3_omap_disable_irqs(omap);
+	device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-	device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
 
 	return 0;
 }
-- 
1.9.1


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

* [PATCH 3.13 030/163] iommu/fsl: Fix warning resulting from adding PCI device twice
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (28 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 029/163] usb: dwc3: omap: fix ordering for runtime pm calls Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 031/163] ahci: add pcid for Marvel 0x9182 controller Kamal Mostafa
                   ` (132 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Varun Sethi, Joerg Roedel, Kamal Mostafa

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

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

From: Varun Sethi <Varun.Sethi@freescale.com>

commit 5a9137a66b521d667236e95c307b92af532fe600 upstream.

iommu_group_get_for_dev determines the iommu group for the PCI device and adds
the device to the group.

In the PAMU driver we were again adding the device to the same group without checking
if the device already had an iommu group. This resulted in the following warning.

sysfs: cannot create duplicate filename '/devices/ffe200000.pcie/pci0000:00/0000:00:00.0/iommu_group'
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc3-00002-g7505cea-dirty #126
task: c0000001fe0a0000 ti: c0000001fe044000 task.ti: c0000001fe044000
NIP: c00000000018879c LR: c000000000188798 CTR: c00000000001ea50
REGS: c0000001fe047040 TRAP: 0700   Not tainted  (3.17.0-rc3-00002-g7505cea-dirty)
MSR: 0000000080029000 <CE,EE,ME>  CR: 24ad8e22  XER: 20000000
SOFTE: 1
GPR00: c000000000188798 c0000001fe0472c0 c0000000009a52e0 0000000000000065
GPR04: 0000000000000001 0000000000000000 3a30303a00000000 0000000027000000
GPR08: 2f696f6d00000000 c0000000008d3830 c0000000009b3938 c0000000009bb3d0
GPR12: 0000000028ad8e24 c00000000fff4000 c00000000000205c 0000000000000000
GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR20: 0000000000000000 0000000000000000 0000000000000000 c0000000008a4c70
GPR24: c0000000007e9010 c0000001fe0140a8 ffffffffffffffef 0000000000000001
GPR28: c0000001fe22ebb8 c0000000007e9010 c00000000090bf10 c0000001fe220000
NIP [c00000000018879c] .sysfs_warn_dup+0x74/0xa4
LR [c000000000188798] .sysfs_warn_dup+0x70/0xa4
Call Trace:
[c0000001fe0472c0] [c000000000188798] .sysfs_warn_dup+0x70/0xa4 (unreliable)
[c0000001fe047350] [c000000000188d34] .sysfs_do_create_link_sd.clone.2+0x168/0x174
[c0000001fe047400] [c0000000004b3cf8] .iommu_group_add_device+0x78/0x244
[c0000001fe0474b0] [c0000000004b6964] .fsl_pamu_add_device+0x88/0x1a8
[c0000001fe047570] [c0000000004b3960] .iommu_bus_notifier+0xdc/0x15c
[c0000001fe047600] [c000000000059848] .notifier_call_chain+0x8c/0xe8
[c0000001fe0476a0] [c000000000059d04] .__blocking_notifier_call_chain+0x58/0x84
[c0000001fe047750] [c00000000036619c] .device_add+0x464/0x5c8
[c0000001fe047820] [c000000000300ebc] .pci_device_add+0x14c/0x17c
[c0000001fe0478c0] [c000000000300fbc] .pci_scan_single_device+0xd0/0xf4
[c0000001fe047970] [c00000000030104c] .pci_scan_slot+0x6c/0x18c
[c0000001fe047a10] [c00000000030226c] .pci_scan_child_bus+0x40/0x114
[c0000001fe047ac0] [c000000000021974] .pcibios_scan_phb+0x240/0x2c8
[c0000001fe047b70] [c00000000085a970] .pcibios_init+0x64/0xc8
[c0000001fe047c00] [c000000000001884] .do_one_initcall+0xbc/0x224
[c0000001fe047d00] [c000000000852d50] .kernel_init_freeable+0x14c/0x21c
[c0000001fe047db0] [c000000000002078] .kernel_init+0x1c/0xfa4
[c0000001fe047e30] [c000000000000884] .ret_from_kernel_thread+0x58/0xd4
Instruction dump:
7c7f1b79 4182001c 7fe4fb78 7f83e378 38a01000 4bffc905 60000000 7c641b78
e87e8008 7fa5eb78 48482ff5 60000000 <0fe00000> 7fe3fb78 4bf7bd39 60000000

Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iommu/fsl_pamu_domain.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index c857c30..42bebf9 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -1050,7 +1050,7 @@ static int fsl_pamu_add_device(struct device *dev)
 	struct iommu_group *group = NULL;
 	struct pci_dev *pdev;
 	const u32 *prop;
-	int ret, len;
+	int ret = 0, len;
 
 	/*
 	 * For platform devices we allocate a separate group for
@@ -1073,7 +1073,13 @@ static int fsl_pamu_add_device(struct device *dev)
 	if (!group || IS_ERR(group))
 		return PTR_ERR(group);
 
-	ret = iommu_group_add_device(group, dev);
+	/*
+	 * Check if device has already been added to an iommu group.
+	 * Group could have already been created for a PCI device in
+	 * the iommu_group_get_for_dev path.
+	 */
+	if (!dev->iommu_group)
+		ret = iommu_group_add_device(group, dev);
 
 	iommu_group_put(group);
 	return ret;
-- 
1.9.1


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

* [PATCH 3.13 031/163] ahci: add pcid for Marvel 0x9182 controller
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (29 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 030/163] iommu/fsl: Fix warning resulting from adding PCI device twice Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 032/163] drm/i915: Fix EIO/wedged handling in gem fault handler Kamal Mostafa
                   ` (131 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Murali Karicheri, Tejun Heo, Santosh Shilimkar, Kamal Mostafa

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

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

From: Murali Karicheri <m-karicheri2@ti.com>

commit c5edfff9db6f4d2c35c802acb4abe0df178becee upstream.

Keystone K2E EVM uses Marvel 0x9182 controller. This requires support
for the ID in the ahci driver.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/ata/ahci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 95c297b..e455090 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -449,6 +449,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a),
 	  .driver_data = board_ahci_yes_fbs },			/* 88se9172 */
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172),
+	  .driver_data = board_ahci_yes_fbs },			/* 88se9182 */
+	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9182),
 	  .driver_data = board_ahci_yes_fbs },			/* 88se9172 */
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9192),
 	  .driver_data = board_ahci_yes_fbs },			/* 88se9172 on some Gigabyte */
-- 
1.9.1


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

* [PATCH 3.13 032/163] drm/i915: Fix EIO/wedged handling in gem fault handler
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (30 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 031/163] ahci: add pcid for Marvel 0x9182 controller Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 033/163] ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses Kamal Mostafa
                   ` (130 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Daniel Vetter, Jani Nikula, Kamal Mostafa

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

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

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

commit 2232f0315c6688f5ff6b2067ea88d97542034873 upstream.

In

commit 1f83fee08d625f8d0130f9fe5ef7b17c2e022f3c
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Nov 15 17:17:22 2012 +0100

    drm/i915: clear up wedged transitions

I've accidentally inverted the EIO/wedged handling in the fault
handler: We want to return the EIO as a SIGBUS only if it's not
because of the gpu having died, to prevent userspace from unduly
dying.

In my defence the comment right above is completely misleading, so fix
both.

v2: Drop the WARN_ON, it's not actually a bug to e.g. receive an -EIO
when swap-in fails.

v3: Don't remove too much ... oops.

Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e716cd0..f264654 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1424,10 +1424,13 @@ unlock:
 out:
 	switch (ret) {
 	case -EIO:
-		/* If this -EIO is due to a gpu hang, give the reset code a
-		 * chance to clean up the mess. Otherwise return the proper
-		 * SIGBUS. */
-		if (i915_terminally_wedged(&dev_priv->gpu_error))
+		/*
+		 * We eat errors when the gpu is terminally wedged to avoid
+		 * userspace unduly crashing (gl has no provisions for mmaps to
+		 * fail). But any other -EIO isn't ours (e.g. swap in failure)
+		 * and so needs to be reported.
+		 */
+		if (!i915_terminally_wedged(&dev_priv->gpu_error))
 			return VM_FAULT_SIGBUS;
 	case -EAGAIN:
 		/*
-- 
1.9.1


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

* [PATCH 3.13 033/163] ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (31 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 032/163] drm/i915: Fix EIO/wedged handling in gem fault handler Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:00 ` [PATCH 3.13 034/163] drm/i915: Evict CS TLBs between batches Kamal Mostafa
                   ` (129 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lee, Chun-Yi, Rafael J. Wysocki, Kamal Mostafa

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

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

From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>

commit 9389f46e9782ea5e56fbd7b2e59ba7c08f3ba86b upstream.

The value64 parameter is an u64 point that used to transfer the value
for write to CMOS, or used to return the value that's read from CMOS.

The value64 is an u64 point, so don't need get address again. It causes
acpi_cmos_rtc_space_handler always return 0 to reader and didn't write
expected value to CMOS.

Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/acpi/acpi_cmos_rtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_cmos_rtc.c b/drivers/acpi/acpi_cmos_rtc.c
index 84190ed..aff69d9 100644
--- a/drivers/acpi/acpi_cmos_rtc.c
+++ b/drivers/acpi/acpi_cmos_rtc.c
@@ -35,7 +35,7 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
 		      void *handler_context, void *region_context)
 {
 	int i;
-	u8 *value = (u8 *)&value64;
+	u8 *value = (u8 *)value64;
 
 	if (address > 0xff || !value64)
 		return AE_BAD_PARAMETER;
-- 
1.9.1


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

* [PATCH 3.13 034/163] drm/i915: Evict CS TLBs between batches
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (32 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 033/163] ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses Kamal Mostafa
@ 2014-10-09 21:00 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 035/163] drm/i915: Wait for vblank before enabling the TV encoder Kamal Mostafa
                   ` (128 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:00 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Daniel Vetter, Ville Syrjälä,
	Jani Nikula, Kamal Mostafa

3.13.11.9 -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>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@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 7047e35..6d637e7 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -300,16 +300,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 dfb8546..a4ec035 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1180,54 +1180,66 @@ i965_dispatch_execbuffer(struct intel_ring_buffer *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_ring_buffer *ring,
 				u32 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;
 }
 
@@ -1953,7 +1965,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;
-- 
1.9.1


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

* [PATCH 3.13 035/163] drm/i915: Wait for vblank before enabling the TV encoder
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (33 preceding siblings ...)
  2014-10-09 21:00 ` [PATCH 3.13 034/163] drm/i915: Evict CS TLBs between batches Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 036/163] lockd: fix rpcbind crash on lockd startup failure Kamal Mostafa
                   ` (127 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Bartlett, Ville Syrjälä, Jani Nikula, Kamal Mostafa

3.13.11.9 -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 7a98948f3b536ca9a077e84966ddc0e9f53726df upstream.

The vblank waits in intel_tv_detect_type() are timing out for some
reason. This is a regression caused removing seemingly useless vblank
waits from the modeset seqeuence in:

 commit 56ef52cad5e37fca89638e4bad598a994ecc3d9f
 Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
 Date:   Thu May 8 19:23:15 2014 +0300

    drm/i915: Kill vblank waits after pipe enable on gmch platforms

So it turns out they weren't all entirely useless. Apparently the pipe
has to go through one full frame before we enable the TV port. Add a
vblank wait to intel_enable_tv() to make sure that happens.

Another approach was attempted by placing the vblank wait just after
enabling the port. The theory behind that attempt was that we need to
let the port stay enabled for one full frame before disabling it again
during load detection. But that didn't work, and we definitely must
have the vblank wait before enabling the port.

Cc: Alan Bartlett <ajb@elrepo.org>
Tested-by: Alan Bartlett <ajb@elrepo.org>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79311
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/i915/intel_tv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 99faac5..5e1d30e 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -854,6 +854,10 @@ intel_enable_tv(struct intel_encoder *encoder)
 	struct drm_device *dev = encoder->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	/* Prevents vblank waits from timing out in intel_tv_detect_type() */
+	intel_wait_for_vblank(encoder->base.dev,
+			      to_intel_crtc(encoder->base.crtc)->pipe);
+
 	I915_WRITE(TV_CTL, I915_READ(TV_CTL) | TV_ENC_ENABLE);
 }
 
-- 
1.9.1


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

* [PATCH 3.13 036/163] lockd: fix rpcbind crash on lockd startup failure
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (34 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 035/163] drm/i915: Wait for vblank before enabling the TV encoder Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 037/163] drm/radeon: fix semaphore value init Kamal Mostafa
                   ` (126 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: J. Bruce Fields, Kamal Mostafa

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

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

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

commit 7c17705e77b12b20fb8afb7c1b15dcdb126c0c12 upstream.

Nikita Yuschenko reported that booting a kernel with init=/bin/sh and
then nfs mounting without portmap or rpcbind running using a busybox
mount resulted in:

  # mount -t nfs 10.30.130.21:/opt /mnt
  svc: failed to register lockdv1 RPC service (errno 111).
  lockd_up: makesock failed, error=-111
  Unable to handle kernel paging request for data at address 0x00000030
  Faulting instruction address: 0xc055e65c
  Oops: Kernel access of bad area, sig: 11 [#1]
  MPC85xx CDS
  Modules linked in:
  CPU: 0 PID: 1338 Comm: mount Not tainted 3.10.44.cge #117
  task: cf29cea0 ti: cf35c000 task.ti: cf35c000
  NIP: c055e65c LR: c0566490 CTR: c055e648
  REGS: cf35dad0 TRAP: 0300   Not tainted  (3.10.44.cge)
  MSR: 00029000 <CE,EE,ME>  CR: 22442488  XER: 20000000
  DEAR: 00000030, ESR: 00000000

  GPR00: c05606f4 cf35db80 cf29cea0 cf0ded80 cf0dedb8 00000001 1dec3086
  00000000
  GPR08: 00000000 c07b1640 00000007 1dec3086 22442482 100b9758 00000000
  10090ae8
  GPR16: 00000000 000186a5 00000000 00000000 100c3018 bfa46edc 100b0000
  bfa46ef0
  GPR24: cf386ae0 c07834f0 00000000 c0565f88 00000001 cf0dedb8 00000000
  cf0ded80
  NIP [c055e65c] call_start+0x14/0x34
  LR [c0566490] __rpc_execute+0x70/0x250
  Call Trace:
  [cf35db80] [00000080] 0x80 (unreliable)
  [cf35dbb0] [c05606f4] rpc_run_task+0x9c/0xc4
  [cf35dbc0] [c0560840] rpc_call_sync+0x50/0xb8
  [cf35dbf0] [c056ee90] rpcb_register_call+0x54/0x84
  [cf35dc10] [c056f24c] rpcb_register+0xf8/0x10c
  [cf35dc70] [c0569e18] svc_unregister.isra.23+0x100/0x108
  [cf35dc90] [c0569e38] svc_rpcb_cleanup+0x18/0x30
  [cf35dca0] [c0198c5c] lockd_up+0x1dc/0x2e0
  [cf35dcd0] [c0195348] nlmclnt_init+0x2c/0xc8
  [cf35dcf0] [c015bb5c] nfs_start_lockd+0x98/0xec
  [cf35dd20] [c015ce6c] nfs_create_server+0x1e8/0x3f4
  [cf35dd90] [c0171590] nfs3_create_server+0x10/0x44
  [cf35dda0] [c016528c] nfs_try_mount+0x158/0x1e4
  [cf35de20] [c01670d0] nfs_fs_mount+0x434/0x8c8
  [cf35de70] [c00cd3bc] mount_fs+0x20/0xbc
  [cf35de90] [c00e4f88] vfs_kern_mount+0x50/0x104
  [cf35dec0] [c00e6e0c] do_mount+0x1d0/0x8e0
  [cf35df10] [c00e75ac] SyS_mount+0x90/0xd0
  [cf35df40] [c000ccf4] ret_from_syscall+0x0/0x3c

The addition of svc_shutdown_net() resulted in two calls to
svc_rpcb_cleanup(); the second is no longer necessary and crashes when
it calls rpcb_register_call with clnt=NULL.

Reported-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
Fixes: 679b033df484 "lockd: ensure we tear down any live sockets when socket creation fails during lockd_up"
Acked-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/lockd/svc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 6bf06a0..223e1cb 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -253,13 +253,11 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net)
 
 	error = make_socks(serv, net);
 	if (error < 0)
-		goto err_socks;
+		goto err_bind;
 	set_grace_period(net);
 	dprintk("lockd_up_net: per-net data created; net=%p\n", net);
 	return 0;
 
-err_socks:
-	svc_rpcb_cleanup(serv, net);
 err_bind:
 	ln->nlmsvc_users--;
 	return error;
-- 
1.9.1


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

* [PATCH 3.13 037/163] drm/radeon: fix semaphore value init
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (35 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 036/163] lockd: fix rpcbind crash on lockd startup failure Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 038/163] drm/radeon: add connector quirk for fujitsu board Kamal Mostafa
                   ` (125 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christian König, Alex Deucher, Kamal Mostafa

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

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

From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>

commit f229407da79315c18a2f25f485e1a1b9fdda1e92 upstream.

Semaphore values have 64 bits, not 32. This fixes a very subtle bug
that disables synchronization when the upper 32bits wasn't zero.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-By: Grigori Goronzy <greg@chown.ath.cx>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_semaphore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_semaphore.c b/drivers/gpu/drm/radeon/radeon_semaphore.c
index 9006b32..eb7b600 100644
--- a/drivers/gpu/drm/radeon/radeon_semaphore.c
+++ b/drivers/gpu/drm/radeon/radeon_semaphore.c
@@ -34,7 +34,7 @@
 int radeon_semaphore_create(struct radeon_device *rdev,
 			    struct radeon_semaphore **semaphore)
 {
-	uint32_t *cpu_addr;
+	uint64_t *cpu_addr;
 	int i, r;
 
 	*semaphore = kmalloc(sizeof(struct radeon_semaphore), GFP_KERNEL);
-- 
1.9.1


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

* [PATCH 3.13 038/163] drm/radeon: add connector quirk for fujitsu board
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (36 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 037/163] drm/radeon: fix semaphore value init Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 039/163] imx-drm: ipuv3-plane: fix ipu_plane_dpms() Kamal Mostafa
                   ` (124 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

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

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

commit 1952f24d0fa6292d65f886887af87ba8ac79b3ba upstream.

Vbios connector table lists non-existent VGA port.

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83184

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_atombios.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 4af5a78..9e53064 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -464,6 +464,13 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
 		}
 	}
 
+	/* Fujitsu D3003-S2 board lists DVI-I as DVI-I and VGA */
+	if ((dev->pdev->device == 0x9805) &&
+	    (dev->pdev->subsystem_vendor == 0x1734) &&
+	    (dev->pdev->subsystem_device == 0x11bd)) {
+		if (*connector_type == DRM_MODE_CONNECTOR_VGA)
+			return false;
+	}
 
 	return true;
 }
-- 
1.9.1


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

* [PATCH 3.13 039/163] imx-drm: ipuv3-plane: fix ipu_plane_dpms()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (37 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 038/163] drm/radeon: add connector quirk for fujitsu board Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 040/163] usb: host: xhci: fix compliance mode workaround Kamal Mostafa
                   ` (123 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Russell King, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Russell King <rmk+kernel@arm.linux.org.uk>

commit 3a44a2058747d71385eb69691c7f977cb58cc293 upstream.

When unbinding imx-drm, the following oops was observed:

Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = e995c000
[00000004] *pgd=4fea5831
Internal error: Oops: 817 [#1] SMP ARM
Modules linked in: bnep rfcomm bluetooth nfsd exportfs hid_cypress brcmfmac brcmutil snd_soc_fsl_ssi snd_soc_fsl_spdif imx_pcm_fiq imx_pcm_dma snd_soc_sgtl5000 imx_sdma imx2_wdt imx_ldb(C) imx_thermal snd_soc_imx_sgtl5000 snd_soc_imx_spdif snd_soc_imx_audmux
CPU: 1 PID: 779 Comm: bash Tainted: G         C    3.16.0-rc2+ #1230
task: ea9eb180 ti: ea378000 task.ti: ea378000
PC is at ipu_dp_put+0x10/0x18
LR is at ipu_plane_dpms+0x60/0x8c
pc : [<c0350d20>]    lr : [<c04bd9e8>]    psr: 200f0013
sp : ea379d80  ip : ea379d90  fp : ea379d8c
r10: 00100100  r9 : 00000000  r8 : 00200200
r7 : e9ba0264  r6 : e9ba01f8  r5 : 00000000  r4 : ea34b800
r3 : 00000000  r2 : 00000000  r1 : 0000009b  r0 : 00000000
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 3995c04a  DAC: 00000015
Process bash (pid: 779, stack limit = 0xea378240)
Stack: (0xea379d80 to 0xea37a000)
...
Backtrace:
[<c0350d10>] (ipu_dp_put) from [<c04bd9e8>] (ipu_plane_dpms+0x60/0x8c)
[<c04bd988>] (ipu_plane_dpms) from [<c04bda40>] (ipu_disable_plane+0x2c/0x60)
[<c04bda14>] (ipu_disable_plane) from [<c04bda9c>] (ipu_plane_destroy+0x28/0x60)
[<c04bda74>] (ipu_plane_destroy) from [<c033ff84>] (drm_mode_config_cleanup+0x1b8/0x250)
[<c033fdcc>] (drm_mode_config_cleanup) from [<c04bc234>] (imx_drm_driver_unload+0x44/0x4c)
[<c04bc1f0>] (imx_drm_driver_unload) from [<c03394a4>] (drm_dev_unregister+0x2c/0xa0)
[<c0339478>] (drm_dev_unregister) from [<c0339f8c>] (drm_put_dev+0x30/0x6c)
[<c0339f5c>] (drm_put_dev) from [<c04bc1cc>] (imx_drm_unbind+0x14/0x18)
[<c04bc1b8>] (imx_drm_unbind) from [<c03530b4>] (component_master_del+0xbc/0xd8)
...
Code: e1a0c00d e92dd800 e24cb004 e3a03000 (e5c03004)

This is caused by a missing check in ipu_plane_dpms for a NULL pointer.

Fixes: b8d181e408af ("staging: drm/imx: add drm plane support")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/staging/imx-drm/ipuv3-plane.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c
index d97454a..69ed0d9 100644
--- a/drivers/staging/imx-drm/ipuv3-plane.c
+++ b/drivers/staging/imx-drm/ipuv3-plane.c
@@ -269,7 +269,8 @@ static void ipu_plane_dpms(struct ipu_plane *ipu_plane, int mode)
 
 		ipu_idmac_put(ipu_plane->ipu_ch);
 		ipu_dmfc_put(ipu_plane->dmfc);
-		ipu_dp_put(ipu_plane->dp);
+		if (ipu_plane->dp)
+			ipu_dp_put(ipu_plane->dp);
 	}
 }
 
-- 
1.9.1


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

* [PATCH 3.13 040/163] usb: host: xhci: fix compliance mode workaround
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (38 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 039/163] imx-drm: ipuv3-plane: fix ipu_plane_dpms() Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 041/163] Input: elantech - fix detection of touchpad on ASUS s301l Kamal Mostafa
                   ` (122 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alexis R. Cortes, Felipe Balbi, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Felipe Balbi <balbi@ti.com>

commit 96908589a8b2584b1185f834d365f5cc360e8226 upstream.

Commit 71c731a (usb: host: xhci: Fix Compliance Mode
on SN65LVP3502CP Hardware) implemented a workaround
for a known issue with Texas Instruments' USB 3.0
redriver IC but it left a condition where any xHCI
host would be taken out of reset if port was placed
in compliance mode and there was no device connected
to the port.

That condition would trigger a fake connection to a
non-existent device so that usbcore would trigger a
warm reset of the port, thus taking the link out of
reset.

This has the side-effect of preventing any xHCI host
connected to a Linux machine from starting and running
the USB 3.0 Electrical Compliance Suite because the
port will mysteriously taken out of compliance mode
and, thus, xHCI won't step through the necessary
compliance patterns for link validation.

This patch fixes the issue by just adding a missing
check for XHCI_COMP_MODE_QUIRK inside
xhci_hub_report_usb3_link_state() when PORT_CAS isn't
set.

This patch should be backported to all kernels containing
commit 71c731a.

Fixes: 71c731a (usb: host: xhci: Fix Compliance Mode on SN65LVP3502CP Hardware)
Cc: Alexis R. Cortes <alexis.cortes@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci-hub.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index d0997e3..e44be08 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -471,7 +471,8 @@ static void xhci_hub_report_usb2_link_state(u32 *status, u32 status_reg)
 }
 
 /* Updates Link Status for super Speed port */
-static void xhci_hub_report_usb3_link_state(u32 *status, u32 status_reg)
+static void xhci_hub_report_usb3_link_state(struct xhci_hcd *xhci,
+		u32 *status, u32 status_reg)
 {
 	u32 pls = status_reg & PORT_PLS_MASK;
 
@@ -510,7 +511,8 @@ static void xhci_hub_report_usb3_link_state(u32 *status, u32 status_reg)
 		 * in which sometimes the port enters compliance mode
 		 * caused by a delay on the host-device negotiation.
 		 */
-		if (pls == USB_SS_PORT_LS_COMP_MOD)
+		if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) &&
+				(pls == USB_SS_PORT_LS_COMP_MOD))
 			pls |= USB_PORT_STAT_CONNECTION;
 	}
 
@@ -670,7 +672,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
 	}
 	/* Update Port Link State */
 	if (hcd->speed == HCD_USB3) {
-		xhci_hub_report_usb3_link_state(&status, raw_port_status);
+		xhci_hub_report_usb3_link_state(xhci, &status, raw_port_status);
 		/*
 		 * Verify if all USB3 Ports Have entered U0 already.
 		 * Delete Compliance Mode Timer if so.
-- 
1.9.1


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

* [PATCH 3.13 041/163] Input: elantech - fix detection of touchpad on ASUS s301l
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (39 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 040/163] usb: host: xhci: fix compliance mode workaround Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 042/163] USB: ftdi_sio: Add support for GE Healthcare Nemo Tracker device Kamal Mostafa
                   ` (121 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Dmitry Torokhov, Kamal Mostafa

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

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

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

commit 271329b3c798b2102120f5df829071c211ef00ed upstream.

Adjust Elantech signature validation to account fo rnewer models of
touchpads.

Reported-and-tested-by: Màrius Monton <marius.monton@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/input/mouse/elantech.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 233516a..0b75b57 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1253,6 +1253,13 @@ static bool elantech_is_signature_valid(const unsigned char *param)
 	if (param[1] == 0)
 		return true;
 
+	/*
+	 * Some models have a revision higher then 20. Meaning param[2] may
+	 * be 10 or 20, skip the rates check for these.
+	 */
+	if (param[0] == 0x46 && (param[1] & 0xef) == 0x0f && param[2] < 40)
+		return true;
+
 	for (i = 0; i < ARRAY_SIZE(rates); i++)
 		if (param[2] == rates[i])
 			return false;
-- 
1.9.1


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

* [PATCH 3.13 042/163] USB: ftdi_sio: Add support for GE Healthcare Nemo Tracker device
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (40 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 041/163] Input: elantech - fix detection of touchpad on ASUS s301l Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 043/163] uwb: init beacon cache entry before registering uwb device Kamal Mostafa
                   ` (120 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Taylor Braun-Jones, Johan Hovold, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Taylor Braun-Jones <taylor.braun-jones@ge.com>

commit 9c491c372d677b6420e0f8c6361fe422791662cc upstream.

Signed-off-by: Taylor Braun-Jones <taylor.braun-jones@ge.com>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/ftdi_sio.c     | 2 ++
 drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 7bdfa9c..c903b0b 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -954,6 +954,8 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) },
 	/* Infineon Devices */
 	{ USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_PID, 1) },
+	/* GE Healthcare devices */
+	{ USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) },
 	{ }					/* Terminating entry */
 };
 
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 8927a5c..5937b2d 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1391,3 +1391,9 @@
  * ekey biometric systems GmbH (http://ekey.net/)
  */
 #define FTDI_EKEY_CONV_USB_PID		0xCB08	/* Converter USB */
+
+/*
+ * GE Healthcare devices
+ */
+#define GE_HEALTHCARE_VID		0x1901
+#define GE_HEALTHCARE_NEMO_TRACKER_PID	0x0015
-- 
1.9.1


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

* [PATCH 3.13 043/163] uwb: init beacon cache entry before registering uwb device
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (41 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 042/163] USB: ftdi_sio: Add support for GE Healthcare Nemo Tracker device Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 044/163] nfs: fix kernel warning when removing proc entry Kamal Mostafa
                   ` (119 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Pugliese, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Thomas Pugliese <thomas.pugliese@gmail.com>

commit 675f0ab2fe5a0f7325208e60b617a5f32b86d72c upstream.

Make sure the uwb_dev->bce entry is set before calling uwb_dev_add in
uwbd_dev_onair so that usermode will only see the device after it is
properly initialized.  This fixes a kernel panic that can occur if
usermode tries to access the IEs sysfs attribute of a UWB device before
the driver has had a chance to set the beacon cache entry.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/uwb/lc-dev.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/uwb/lc-dev.c b/drivers/uwb/lc-dev.c
index 80079b8..d0303f0 100644
--- a/drivers/uwb/lc-dev.c
+++ b/drivers/uwb/lc-dev.c
@@ -431,16 +431,19 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce)
 	uwb_dev->mac_addr = *bce->mac_addr;
 	uwb_dev->dev_addr = bce->dev_addr;
 	dev_set_name(&uwb_dev->dev, "%s", macbuf);
+
+	/* plug the beacon cache */
+	bce->uwb_dev = uwb_dev;
+	uwb_dev->bce = bce;
+	uwb_bce_get(bce);		/* released in uwb_dev_sys_release() */
+
 	result = uwb_dev_add(uwb_dev, &rc->uwb_dev.dev, rc);
 	if (result < 0) {
 		dev_err(dev, "new device %s: cannot instantiate device\n",
 			macbuf);
 		goto error_dev_add;
 	}
-	/* plug the beacon cache */
-	bce->uwb_dev = uwb_dev;
-	uwb_dev->bce = bce;
-	uwb_bce_get(bce);		/* released in uwb_dev_sys_release() */
+
 	dev_info(dev, "uwb device (mac %s dev %s) connected to %s %s\n",
 		 macbuf, devbuf, rc->uwb_dev.dev.parent->bus->name,
 		 dev_name(rc->uwb_dev.dev.parent));
@@ -448,6 +451,8 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce)
 	return;
 
 error_dev_add:
+	bce->uwb_dev = NULL;
+	uwb_bce_put(bce);
 	kfree(uwb_dev);
 	return;
 }
-- 
1.9.1


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

* [PATCH 3.13 044/163] nfs: fix kernel warning when removing proc entry
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (42 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 043/163] uwb: init beacon cache entry before registering uwb device Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 045/163] drm/radeon/dpm: set the thermal type properly for special configs Kamal Mostafa
                   ` (118 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric W. Biederman, Trond Myklebust, Dan Aloni, Cong Wang, Kamal Mostafa

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

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

From: Cong Wang <xiyou.wangcong@gmail.com>

commit 21e81002f9788a3af591416b6dec60d7b67f2fb2 upstream.

I saw the following kernel warning:

[ 1852.321222] ------------[ cut here ]------------
[ 1852.326527] WARNING: CPU: 0 PID: 118 at fs/proc/generic.c:521 remove_proc_entry+0x154/0x16b()
[ 1852.335630] remove_proc_entry: removing non-empty directory 'fs/nfsfs', leaking at least 'volumes'
[ 1852.344084] CPU: 0 PID: 118 Comm: kworker/u8:2 Not tainted 3.16.0+ #540
[ 1852.350036] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 1852.354992] Workqueue: netns cleanup_net
[ 1852.358701]  0000000000000000 ffff880116f2fbd0 ffffffff819c03e9 ffff880116f2fc18
[ 1852.366474]  ffff880116f2fc08 ffffffff810744ee ffffffff811e0e6e ffff8800d4e96238
[ 1852.373507]  ffffffff81dbe665 ffff8800d46a5948 0000000000000005 ffff880116f2fc68
[ 1852.380224] Call Trace:
[ 1852.381976]  [<ffffffff819c03e9>] dump_stack+0x4d/0x66
[ 1852.385495]  [<ffffffff810744ee>] warn_slowpath_common+0x7a/0x93
[ 1852.389869]  [<ffffffff811e0e6e>] ? remove_proc_entry+0x154/0x16b
[ 1852.393987]  [<ffffffff8107457b>] warn_slowpath_fmt+0x4c/0x4e
[ 1852.397999]  [<ffffffff811e0e6e>] remove_proc_entry+0x154/0x16b
[ 1852.402034]  [<ffffffff8129c73d>] nfs_fs_proc_net_exit+0x53/0x56
[ 1852.406136]  [<ffffffff812a103b>] nfs_net_exit+0x12/0x1d
[ 1852.409774]  [<ffffffff81785bc9>] ops_exit_list+0x44/0x55
[ 1852.413529]  [<ffffffff81786389>] cleanup_net+0xee/0x182
[ 1852.417198]  [<ffffffff81088c9e>] process_one_work+0x209/0x40d
[ 1852.502320]  [<ffffffff81088bf7>] ? process_one_work+0x162/0x40d
[ 1852.587629]  [<ffffffff810890c1>] worker_thread+0x1f0/0x2c7
[ 1852.673291]  [<ffffffff81088ed1>] ? process_scheduled_works+0x2f/0x2f
[ 1852.759470]  [<ffffffff8108e079>] kthread+0xc9/0xd1
[ 1852.843099]  [<ffffffff8109427f>] ? finish_task_switch+0x3a/0xce
[ 1852.926518]  [<ffffffff8108dfb0>] ? __kthread_parkme+0x61/0x61
[ 1853.008565]  [<ffffffff819cbeac>] ret_from_fork+0x7c/0xb0
[ 1853.076477]  [<ffffffff8108dfb0>] ? __kthread_parkme+0x61/0x61
[ 1853.140653] ---[ end trace 69c4c6617f78e32d ]---

It looks wrong that we add "/proc/net/nfsfs" in nfs_fs_proc_net_init()
while remove "/proc/fs/nfsfs" in nfs_fs_proc_net_exit().

Fixes: commit 65b38851a17 (NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes)
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Dan Aloni <dan@kernelim.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
[Trond: replace uses of remove_proc_entry() with remove_proc_subtree()
as suggested by Al Viro]
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/nfs/client.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 180d1ec..6e37cd0 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1404,24 +1404,18 @@ int nfs_fs_proc_net_init(struct net *net)
 	p = proc_create("volumes", S_IFREG|S_IRUGO,
 			nn->proc_nfsfs, &nfs_volume_list_fops);
 	if (!p)
-		goto error_2;
+		goto error_1;
 	return 0;
 
-error_2:
-	remove_proc_entry("servers", nn->proc_nfsfs);
 error_1:
-	remove_proc_entry("fs/nfsfs", NULL);
+	remove_proc_subtree("nfsfs", net->proc_net);
 error_0:
 	return -ENOMEM;
 }
 
 void nfs_fs_proc_net_exit(struct net *net)
 {
-	struct nfs_net *nn = net_generic(net, nfs_net_id);
-
-	remove_proc_entry("volumes", nn->proc_nfsfs);
-	remove_proc_entry("servers", nn->proc_nfsfs);
-	remove_proc_entry("fs/nfsfs", NULL);
+	remove_proc_subtree("nfsfs", net->proc_net);
 }
 
 /*
-- 
1.9.1


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

* [PATCH 3.13 045/163] drm/radeon/dpm: set the thermal type properly for special configs
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (43 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 044/163] nfs: fix kernel warning when removing proc entry Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 046/163] dm cache: fix race causing dirty blocks to be marked as clean Kamal Mostafa
                   ` (117 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

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

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

commit ff4377924f7e587c61bcbc704eafecf6c7bd2e00 upstream.

On systems with special thermal configurations make sure we make
note of the thermal setup.  This is required for proper firmware
configuration on these systems.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_atombios.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 9e53064..2f7e9b8 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -2288,19 +2288,31 @@ static void radeon_atombios_add_pplib_thermal_controller(struct radeon_device *r
 				 (controller->ucFanParameters &
 				  ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with");
 			rdev->pm.int_thermal_type = THERMAL_TYPE_KV;
-		} else if ((controller->ucType ==
-			    ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO) ||
-			   (controller->ucType ==
-			    ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL) ||
-			   (controller->ucType ==
-			    ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL)) {
-			DRM_INFO("Special thermal controller config\n");
+		} else if (controller->ucType ==
+			   ATOM_PP_THERMALCONTROLLER_EXTERNAL_GPIO) {
+			DRM_INFO("External GPIO thermal controller %s fan control\n",
+				 (controller->ucFanParameters &
+				  ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with");
+			rdev->pm.int_thermal_type = THERMAL_TYPE_EXTERNAL_GPIO;
+		} else if (controller->ucType ==
+			   ATOM_PP_THERMALCONTROLLER_ADT7473_WITH_INTERNAL) {
+			DRM_INFO("ADT7473 with internal thermal controller %s fan control\n",
+				 (controller->ucFanParameters &
+				  ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with");
+			rdev->pm.int_thermal_type = THERMAL_TYPE_ADT7473_WITH_INTERNAL;
+		} else if (controller->ucType ==
+			   ATOM_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL) {
+			DRM_INFO("EMC2103 with internal thermal controller %s fan control\n",
+				 (controller->ucFanParameters &
+				  ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with");
+			rdev->pm.int_thermal_type = THERMAL_TYPE_EMC2103_WITH_INTERNAL;
 		} else if (controller->ucType < ARRAY_SIZE(pp_lib_thermal_controller_names)) {
 			DRM_INFO("Possible %s thermal controller at 0x%02x %s fan control\n",
 				 pp_lib_thermal_controller_names[controller->ucType],
 				 controller->ucI2cAddress >> 1,
 				 (controller->ucFanParameters &
 				  ATOM_PP_FANPARAMETERS_NOFAN) ? "without" : "with");
+			rdev->pm.int_thermal_type = THERMAL_TYPE_EXTERNAL;
 			i2c_bus = radeon_lookup_i2c_gpio(rdev, controller->ucI2cLine);
 			rdev->pm.i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
 			if (rdev->pm.i2c_bus) {
-- 
1.9.1


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

* [PATCH 3.13 046/163] dm cache: fix race causing dirty blocks to be marked as clean
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (44 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 045/163] drm/radeon/dpm: set the thermal type properly for special configs Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 047/163] libceph: gracefully handle large reply messages from the mon Kamal Mostafa
                   ` (116 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anssi Hannula, Mike Snitzer, Kamal Mostafa

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

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

From: Anssi Hannula <anssi.hannula@iki.fi>

commit 40aa978eccec61347cd47b97c598df49acde8be5 upstream.

When a writeback or a promotion of a block is completed, the cell of
that block is removed from the prison, the block is marked as clean, and
the clear_dirty() callback of the cache policy is called.

Unfortunately, performing those actions in this order allows an incoming
new write bio for that block to come in before clearing the dirty status
is completed and therefore possibly causing one of these two scenarios:

Scenario A:

Thread 1                      Thread 2
cell_defer()                  .
- cell removed from prison    .
- detained bios queued        .
.                             incoming write bio
.                             remapped to cache
.                             set_dirty() called,
.                               but block already dirty
.                               => it does nothing
clear_dirty()                 .
- block marked clean          .
- policy clear_dirty() called .

Result: Block is marked clean even though it is actually dirty. No
writeback will occur.

Scenario B:

Thread 1                      Thread 2
cell_defer()                  .
- cell removed from prison    .
- detained bios queued        .
clear_dirty()                 .
- block marked clean          .
.                             incoming write bio
.                             remapped to cache
.                             set_dirty() called
.                             - block marked dirty
.                             - policy set_dirty() called
- policy clear_dirty() called .

Result: Block is properly marked as dirty, but policy thinks it is clean
and therefore never asks us to writeback it.
This case is visible in "dmsetup status" dirty block count (which
normally decreases to 0 on a quiet device).

Fix these issues by calling clear_dirty() before calling cell_defer().
Incoming bios for that block will then be detained in the cell and
released only after clear_dirty() has completed, so the race will not
occur.

Found by inspecting the code after noticing spurious dirty counts
(scenario B).

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Acked-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/dm-cache-target.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index ae73ee5..99474ef 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -881,8 +881,8 @@ static void migration_success_pre_commit(struct dm_cache_migration *mg)
 	struct cache *cache = mg->cache;
 
 	if (mg->writeback) {
-		cell_defer(cache, mg->old_ocell, false);
 		clear_dirty(cache, mg->old_oblock, mg->cblock);
+		cell_defer(cache, mg->old_ocell, false);
 		cleanup_migration(mg);
 		return;
 
@@ -937,13 +937,13 @@ static void migration_success_post_commit(struct dm_cache_migration *mg)
 		}
 
 	} else {
+		clear_dirty(cache, mg->new_oblock, mg->cblock);
 		if (mg->requeue_holder)
 			cell_defer(cache, mg->new_ocell, true);
 		else {
 			bio_endio(mg->new_ocell->holder, 0);
 			cell_defer(cache, mg->new_ocell, false);
 		}
-		clear_dirty(cache, mg->new_oblock, mg->cblock);
 		cleanup_migration(mg);
 	}
 }
-- 
1.9.1


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

* [PATCH 3.13 047/163] libceph: gracefully handle large reply messages from the mon
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (45 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 046/163] dm cache: fix race causing dirty blocks to be marked as clean Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 048/163] Input: serport - add compat handling for SPIOCSTYPE ioctl Kamal Mostafa
                   ` (115 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Sage Weil, Kamal Mostafa

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

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

From: Sage Weil <sage@redhat.com>

commit 73c3d4812b4c755efeca0140f606f83772a39ce4 upstream.

We preallocate a few of the message types we get back from the mon.  If we
get a larger message than we are expecting, fall back to trying to allocate
a new one instead of blindly using the one we have.

Signed-off-by: Sage Weil <sage@redhat.com>
Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/ceph/mon_client.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
index 2ac9ef3..dbcbf5a 100644
--- a/net/ceph/mon_client.c
+++ b/net/ceph/mon_client.c
@@ -1041,7 +1041,15 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
 	if (!m) {
 		pr_info("alloc_msg unknown type %d\n", type);
 		*skip = 1;
+	} else if (front_len > m->front_alloc_len) {
+		pr_warning("mon_alloc_msg front %d > prealloc %d (%u#%llu)\n",
+			   front_len, m->front_alloc_len,
+			   (unsigned int)con->peer_name.type,
+			   le64_to_cpu(con->peer_name.num));
+		ceph_msg_put(m);
+		m = ceph_msg_new(type, front_len, GFP_NOFS, false);
 	}
+
 	return m;
 }
 
-- 
1.9.1


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

* [PATCH 3.13 048/163] Input: serport - add compat handling for SPIOCSTYPE ioctl
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (46 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 047/163] libceph: gracefully handle large reply messages from the mon Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 049/163] usb: hub: take hub->hdev reference when processing from eventlist Kamal Mostafa
                   ` (114 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: John Sung, Dmitry Torokhov, Kamal Mostafa

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

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

From: John Sung <penmount.touch@gmail.com>

commit a80d8b02751060a178bb1f7a6b7a93645a7a308b upstream.

When running a 32-bit inputattach utility in a 64-bit system, there will be
error code "inputattach: can't set device type". This is caused by the
serport device driver not supporting compat_ioctl, so that SPIOCSTYPE ioctl
fails.

Signed-off-by: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/input/serio/serport.c | 45 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 38 insertions(+), 7 deletions(-)

diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
index 8755f5f..e4ecf3b 100644
--- a/drivers/input/serio/serport.c
+++ b/drivers/input/serio/serport.c
@@ -21,6 +21,7 @@
 #include <linux/init.h>
 #include <linux/serio.h>
 #include <linux/tty.h>
+#include <linux/compat.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Input device TTY line discipline");
@@ -196,28 +197,55 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, u
 	return 0;
 }
 
+static void serport_set_type(struct tty_struct *tty, unsigned long type)
+{
+	struct serport *serport = tty->disc_data;
+
+	serport->id.proto = type & 0x000000ff;
+	serport->id.id    = (type & 0x0000ff00) >> 8;
+	serport->id.extra = (type & 0x00ff0000) >> 16;
+}
+
 /*
  * serport_ldisc_ioctl() allows to set the port protocol, and device ID
  */
 
-static int serport_ldisc_ioctl(struct tty_struct * tty, struct file * file, unsigned int cmd, unsigned long arg)
+static int serport_ldisc_ioctl(struct tty_struct *tty, struct file *file,
+			       unsigned int cmd, unsigned long arg)
 {
-	struct serport *serport = (struct serport*) tty->disc_data;
-	unsigned long type;
-
 	if (cmd == SPIOCSTYPE) {
+		unsigned long type;
+
 		if (get_user(type, (unsigned long __user *) arg))
 			return -EFAULT;
 
-		serport->id.proto = type & 0x000000ff;
-		serport->id.id	  = (type & 0x0000ff00) >> 8;
-		serport->id.extra = (type & 0x00ff0000) >> 16;
+		serport_set_type(tty, type);
+		return 0;
+	}
+
+	return -EINVAL;
+}
+
+#ifdef CONFIG_COMPAT
+#define COMPAT_SPIOCSTYPE	_IOW('q', 0x01, compat_ulong_t)
+static long serport_ldisc_compat_ioctl(struct tty_struct *tty,
+				       struct file *file,
+				       unsigned int cmd, unsigned long arg)
+{
+	if (cmd == COMPAT_SPIOCSTYPE) {
+		void __user *uarg = compat_ptr(arg);
+		compat_ulong_t compat_type;
+
+		if (get_user(compat_type, (compat_ulong_t __user *)uarg))
+			return -EFAULT;
 
+		serport_set_type(tty, compat_type);
 		return 0;
 	}
 
 	return -EINVAL;
 }
+#endif
 
 static void serport_ldisc_write_wakeup(struct tty_struct * tty)
 {
@@ -241,6 +269,9 @@ static struct tty_ldisc_ops serport_ldisc = {
 	.close =	serport_ldisc_close,
 	.read =		serport_ldisc_read,
 	.ioctl =	serport_ldisc_ioctl,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl =	serport_ldisc_compat_ioctl,
+#endif
 	.receive_buf =	serport_ldisc_receive,
 	.write_wakeup =	serport_ldisc_write_wakeup
 };
-- 
1.9.1


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

* [PATCH 3.13 049/163] usb: hub: take hub->hdev reference when processing from eventlist
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (47 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 048/163] Input: serport - add compat handling for SPIOCSTYPE ioctl Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 050/163] eventpoll: fix uninitialized variable in epoll_ctl Kamal Mostafa
                   ` (113 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joe Lawrence, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Joe Lawrence <joe.lawrence@stratus.com>

commit c605f3cdff53a743f6d875b76956b239deca1272 upstream.

During surprise device hotplug removal tests, it was observed that
hub_events may try to call usb_lock_device on a device that has already
been freed. Protect the usb_device by taking out a reference (under the
hub_event_lock) when hub_events pulls it off the list, returning the
reference after hub_events is finished using it.

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Suggested-by: David Bulkow <david.bulkow@stratus.com> for using kref
Suggested-by: Alan Stern <stern@rowland.harvard.edu> for placement
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/core/hub.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index a80e195..9f179ea 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4729,9 +4729,10 @@ static void hub_events(void)
 
 		hub = list_entry(tmp, struct usb_hub, event_list);
 		kref_get(&hub->kref);
+		hdev = hub->hdev;
+		usb_get_dev(hdev);
 		spin_unlock_irq(&hub_event_lock);
 
-		hdev = hub->hdev;
 		hub_dev = hub->intfdev;
 		intf = to_usb_interface(hub_dev);
 		dev_dbg(hub_dev, "state %d ports %d chg %04x evt %04x\n",
@@ -4944,6 +4945,7 @@ static void hub_events(void)
 		usb_autopm_put_interface(intf);
  loop_disconnected:
 		usb_unlock_device(hdev);
+		usb_put_dev(hdev);
 		kref_put(&hub->kref, hub_release);
 
 	} /* end while (1) */
-- 
1.9.1


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

* [PATCH 3.13 050/163] eventpoll: fix uninitialized variable in epoll_ctl
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (48 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 049/163] usb: hub: take hub->hdev reference when processing from eventlist Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 051/163] kcmp: fix standard comparison bug Kamal Mostafa
                   ` (112 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nicolas Iooss, Alexander Viro, Arve Hjønnevåg,
	Andrew Morton, Linus Torvalds, Kamal Mostafa

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

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

From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>

commit c680e41b3a2e944185c74bf60531e3d316d3ecc4 upstream.

When calling epoll_ctl with operation EPOLL_CTL_DEL, structure epds is
not initialized but ep_take_care_of_epollwakeup reads its event field.
When this unintialized field has EPOLLWAKEUP bit set, a capability check
is done for CAP_BLOCK_SUSPEND in ep_take_care_of_epollwakeup.  This
produces unexpected messages in the audit log, such as (on a system
running SELinux):

    type=AVC msg=audit(1408212798.866:410): avc:  denied
    { block_suspend } for  pid=7754 comm="dbus-daemon" capability=36
    scontext=unconfined_u:unconfined_r:unconfined_t
    tcontext=unconfined_u:unconfined_r:unconfined_t
    tclass=capability2 permissive=1

    type=SYSCALL msg=audit(1408212798.866:410): arch=c000003e syscall=233
    success=yes exit=0 a0=3 a1=2 a2=9 a3=7fffd4d66ec0 items=0 ppid=1
    pid=7754 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
    fsgid=0 tty=(none) ses=3 comm="dbus-daemon"
    exe="/usr/bin/dbus-daemon"
    subj=unconfined_u:unconfined_r:unconfined_t key=(null)

("arch=c000003e syscall=233 a1=2" means "epoll_ctl(op=EPOLL_CTL_DEL)")

Remove use of epds in epoll_ctl when op == EPOLL_CTL_DEL.

Fixes: 4d7e30d98939 ("epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/eventpoll.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index ead0046..f50d79e 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1852,7 +1852,8 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
 		goto error_tgt_fput;
 
 	/* Check if EPOLLWAKEUP is allowed */
-	ep_take_care_of_epollwakeup(&epds);
+	if (ep_op_has_event(op))
+		ep_take_care_of_epollwakeup(&epds);
 
 	/*
 	 * We have to check that the file structure underneath the file descriptor
-- 
1.9.1


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

* [PATCH 3.13 051/163] kcmp: fix standard comparison bug
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (49 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 050/163] eventpoll: fix uninitialized variable in epoll_ctl Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 052/163] fsnotify/fdinfo: use named constants instead of hardcoded values Kamal Mostafa
                   ` (111 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Rasmus Villemoes, Andrew Morton, Linus Torvalds, Kamal Mostafa

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

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

From: Rasmus Villemoes <linux@rasmusvillemoes.dk>

commit acbbe6fbb240a927ee1f5994f04d31267d422215 upstream.

The C operator <= defines a perfectly fine total ordering on the set of
values representable in a long.  However, unlike its namesake in the
integers, it is not translation invariant, meaning that we do not have
"b <= c" iff "a+b <= a+c" for all a,b,c.

This means that it is always wrong to try to boil down the relationship
between two longs to a question about the sign of their difference,
because the resulting relation [a LEQ b iff a-b <= 0] is neither
anti-symmetric or transitive.  The former is due to -LONG_MIN==LONG_MIN
(take any two a,b with a-b = LONG_MIN; then a LEQ b and b LEQ a, but a !=
b).  The latter can either be seen observing that x LEQ x+1 for all x,
implying x LEQ x+1 LEQ x+2 ...  LEQ x-1 LEQ x; or more directly with the
simple example a=LONG_MIN, b=0, c=1, for which a-b < 0, b-c < 0, but a-c >
0.

Note that it makes absolutely no difference that a transmogrying bijection
has been applied before the comparison is done.  In fact, had the
obfuscation not been done, one could probably not observe the bug
(assuming all values being compared always lie in one half of the address
space, the mathematical value of a-b is always representable in a long).
As it stands, one can easily obtain three file descriptors exhibiting the
non-transitivity of kcmp().

Side note 1: I can't see that ensuring the MSB of the multiplier is
set serves any purpose other than obfuscating the obfuscating code.

Side note 2:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <sys/syscall.h>

enum kcmp_type {
        KCMP_FILE,
        KCMP_VM,
        KCMP_FILES,
        KCMP_FS,
        KCMP_SIGHAND,
        KCMP_IO,
        KCMP_SYSVSEM,
        KCMP_TYPES,
};
pid_t pid;

int kcmp(pid_t pid1, pid_t pid2, int type,
	 unsigned long idx1, unsigned long idx2)
{
	return syscall(SYS_kcmp, pid1, pid2, type, idx1, idx2);
}
int cmp_fd(int fd1, int fd2)
{
	int c = kcmp(pid, pid, KCMP_FILE, fd1, fd2);
	if (c < 0) {
		perror("kcmp");
		exit(1);
	}
	assert(0 <= c && c < 3);
	return c;
}
int cmp_fdp(const void *a, const void *b)
{
	static const int normalize[] = {0, -1, 1};
	return normalize[cmp_fd(*(int*)a, *(int*)b)];
}
#define MAX 100 /* This is plenty; I've seen it trigger for MAX==3 */
int main(int argc, char *argv[])
{
	int r, s, count = 0;
	int REL[3] = {0,0,0};
	int fd[MAX];
	pid = getpid();
	while (count < MAX) {
		r = open("/dev/null", O_RDONLY);
		if (r < 0)
			break;
		fd[count++] = r;
	}
	printf("opened %d file descriptors\n", count);
	for (r = 0; r < count; ++r) {
		for (s = r+1; s < count; ++s) {
			REL[cmp_fd(fd[r], fd[s])]++;
		}
	}
	printf("== %d\t< %d\t> %d\n", REL[0], REL[1], REL[2]);
	qsort(fd, count, sizeof(fd[0]), cmp_fdp);
	memset(REL, 0, sizeof(REL));

	for (r = 0; r < count; ++r) {
		for (s = r+1; s < count; ++s) {
			REL[cmp_fd(fd[r], fd[s])]++;
		}
	}
	printf("== %d\t< %d\t> %d\n", REL[0], REL[1], REL[2]);
	return (REL[0] + REL[2] != 0);
}

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/kcmp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/kcmp.c b/kernel/kcmp.c
index e30ac0f..0aa69ea 100644
--- a/kernel/kcmp.c
+++ b/kernel/kcmp.c
@@ -44,11 +44,12 @@ static long kptr_obfuscate(long v, int type)
  */
 static int kcmp_ptr(void *v1, void *v2, enum kcmp_type type)
 {
-	long ret;
+	long t1, t2;
 
-	ret = kptr_obfuscate((long)v1, type) - kptr_obfuscate((long)v2, type);
+	t1 = kptr_obfuscate((long)v1, type);
+	t2 = kptr_obfuscate((long)v2, type);
 
-	return (ret < 0) | ((ret > 0) << 1);
+	return (t1 < t2) | ((t1 > t2) << 1);
 }
 
 /* The caller must have pinned the task */
-- 
1.9.1


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

* [PATCH 3.13 052/163] fsnotify/fdinfo: use named constants instead of hardcoded values
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (50 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 051/163] kcmp: fix standard comparison bug Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 053/163] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed Kamal Mostafa
                   ` (110 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andrey Vagin, Alexander Viro, Andrew Morton, Linus Torvalds,
	Kamal Mostafa

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

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

From: Andrey Vagin <avagin@openvz.org>

commit 1fc98d11cac6dd66342e5580cb2687e5b1e9a613 upstream.

MAX_HANDLE_SZ is equal to 128, but currently the size of pad is only 64
bytes, so exportfs_encode_inode_fh can return an error.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Alexander 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: Kamal Mostafa <kamal@canonical.com>
---
 fs/notify/fdinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
index 238a593..660d33b 100644
--- a/fs/notify/fdinfo.c
+++ b/fs/notify/fdinfo.c
@@ -42,7 +42,7 @@ static int show_mark_fhandle(struct seq_file *m, struct inode *inode)
 {
 	struct {
 		struct file_handle handle;
-		u8 pad[64];
+		u8 pad[MAX_HANDLE_SZ];
 	} f;
 	int size, ret, i;
 
@@ -50,7 +50,7 @@ static int show_mark_fhandle(struct seq_file *m, struct inode *inode)
 	size = f.handle.handle_bytes >> 2;
 
 	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
-	if ((ret == 255) || (ret == -ENOSPC)) {
+	if ((ret == FILEID_INVALID) || (ret == -ENOSPC)) {
 		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
 		return 0;
 	}
-- 
1.9.1


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

* [PATCH 3.13 053/163] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (51 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 052/163] fsnotify/fdinfo: use named constants instead of hardcoded values Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 054/163] arm64: flush TLS registers during exec Kamal Mostafa
                   ` (109 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andrey Vagin, Alexander Viro, Andrew Morton, Linus Torvalds,
	Kamal Mostafa

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

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

From: Andrey Vagin <avagin@openvz.org>

commit 7e8824816bda16bb11ff5ff1e1212d642e57b0b3 upstream.

Currently we handle only ENOSPC.  In case of other errors the file_handle
variable isn't filled properly and we will show a part of stack.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Alexander 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: Kamal Mostafa <kamal@canonical.com>
---
 fs/notify/fdinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
index 660d33b..9d7e2b9 100644
--- a/fs/notify/fdinfo.c
+++ b/fs/notify/fdinfo.c
@@ -50,7 +50,7 @@ static int show_mark_fhandle(struct seq_file *m, struct inode *inode)
 	size = f.handle.handle_bytes >> 2;
 
 	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
-	if ((ret == FILEID_INVALID) || (ret == -ENOSPC)) {
+	if ((ret == FILEID_INVALID) || (ret < 0)) {
 		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
 		return 0;
 	}
-- 
1.9.1


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

* [PATCH 3.13 054/163] arm64: flush TLS registers during exec
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (52 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 053/163] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 055/163] storage: Add single-LUN quirk for Jaz USB Adapter Kamal Mostafa
                   ` (108 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Will Deacon, Kamal Mostafa

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

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

From: Will Deacon <will.deacon@arm.com>

commit eb35bdd7bca29a13c8ecd44e6fd747a84ce675db upstream.

Nathan reports that we leak TLS information from the parent context
during an exec, as we don't clear the TLS registers when flushing the
thread state.

This patch updates the flushing code so that we:

  (1) Unconditionally zero the tpidr_el0 register (since this is fully
      context switched for native tasks and zeroed for compat tasks)

  (2) Zero the tp_value state in thread_info before clearing the
      tpidrr0_el0 register for compat tasks (since this is only writable
      by the set_tls compat syscall and therefore not fully switched).

A missing compiler barrier is also added to the compat set_tls syscall.

Acked-by: Nathan Lynch <Nathan_Lynch@mentor.com>
Reported-by: Nathan Lynch <Nathan_Lynch@mentor.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm64/kernel/process.c    | 18 ++++++++++++++++++
 arch/arm64/kernel/sys_compat.c |  6 ++++++
 2 files changed, 24 insertions(+)

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index de17c89..938704d 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -190,9 +190,27 @@ void exit_thread(void)
 {
 }
 
+static void tls_thread_flush(void)
+{
+	asm ("msr tpidr_el0, xzr");
+
+	if (is_compat_task()) {
+		current->thread.tp_value = 0;
+
+		/*
+		 * We need to ensure ordering between the shadow state and the
+		 * hardware state, so that we don't corrupt the hardware state
+		 * with a stale shadow state during context switch.
+		 */
+		barrier();
+		asm ("msr tpidrro_el0, xzr");
+	}
+}
+
 void flush_thread(void)
 {
 	fpsimd_flush_thread();
+	tls_thread_flush();
 	flush_ptrace_hw_breakpoint(current);
 }
 
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c
index 26e9c4e..7803992 100644
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -79,6 +79,12 @@ long compat_arm_syscall(struct pt_regs *regs)
 
 	case __ARM_NR_compat_set_tls:
 		current->thread.tp_value = regs->regs[0];
+
+		/*
+		 * Protect against register corruption from context switch.
+		 * See comment in tls_thread_flush.
+		 */
+		barrier();
 		asm ("msr tpidrro_el0, %0" : : "r" (regs->regs[0]));
 		return 0;
 
-- 
1.9.1


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

* [PATCH 3.13 055/163] storage: Add single-LUN quirk for Jaz USB Adapter
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (53 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 054/163] arm64: flush TLS registers during exec Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 056/163] xhci: Fix null pointer dereference if xhci initialization fails Kamal Mostafa
                   ` (107 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Knibbs, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Mark <markk@clara.co.uk>

commit c66f1c62e85927357e7b3f4c701614dcb5c498a2 upstream.

The Iomega Jaz USB Adapter is a SCSI-USB converter cable. The hardware
seems to be identical to e.g. the Microtech XpressSCSI, using a Shuttle/
SCM chip set. However its firmware restricts it to only work with Jaz
drives.

On connecting the cable a message like this appears four times in the log:
 reset full speed USB device number 4 using uhci_hcd

That's non-fatal but the US_FL_SINGLE_LUN quirk fixes it.

Signed-off-by: Mark Knibbs <markk@clara.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/storage/unusual_devs.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index e2d0050..d168f51 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -741,6 +741,12 @@ UNUSUAL_DEV(  0x059b, 0x0001, 0x0100, 0x0100,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_SINGLE_LUN ),
 
+UNUSUAL_DEV(  0x059b, 0x0040, 0x0100, 0x0100,
+		"Iomega",
+		"Jaz USB Adapter",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_SINGLE_LUN ),
+
 /* Reported by <Hendryk.Pfeiffer@gmx.de> */
 UNUSUAL_DEV(  0x059f, 0x0643, 0x0000, 0x0000,
 		"LaCie",
-- 
1.9.1


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

* [PATCH 3.13 056/163] xhci: Fix null pointer dereference if xhci initialization fails
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (54 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 055/163] storage: Add single-LUN quirk for Jaz USB Adapter Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 057/163] usb: xhci: Fix OOPS in xhci error handling code Kamal Mostafa
                   ` (106 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit c207e7c50f31113c24a9f536fcab1e8a256985d7 upstream.

If xhci initialization fails before the roothub bandwidth
domains (xhci->rh_bw[i]) are allocated it will oops when
trying to access rh_bw members in xhci_mem_cleanup().

Reported-by: Manuel Reimer <manuel.reimer@gmx.de>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 4483e6a..837c333 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1723,7 +1723,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
 	}
 
 	num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
-	for (i = 0; i < num_ports; i++) {
+	for (i = 0; i < num_ports && xhci->rh_bw; i++) {
 		struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
 		for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
 			struct list_head *ep = &bwt->interval_bw[j].endpoints;
-- 
1.9.1


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

* [PATCH 3.13 057/163] usb: xhci: Fix OOPS in xhci error handling code
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (55 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 056/163] xhci: Fix null pointer dereference if xhci initialization fails Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 058/163] xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices Kamal Mostafa
                   ` (105 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Al Cooper, Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Al Cooper <alcooperx@gmail.com>

commit 0eda06c7c17ae48d7db69beef57f6e2b20bc3c72 upstream.

The xhci driver will OOPS on resume from S2/S3 if dma_alloc_coherent()
is out of memory. This is a result of two things:
1. xhci_mem_cleanup() in xhci-mem.c free's xhci->lpm_command if
it's not NULL, but doesn't set it to NULL after the free.
2. xhci_mem_cleanup() is called twice on resume, once for normal
restart and once from xhci_mem_init() if dma_alloc_coherent() fails,
resulting in a free of xhci->lpm_command that has already been freed.
The fix is to set xhci->lpm_command to NULL after freeing it.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci-mem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 837c333..06d0d1e 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1711,6 +1711,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
 
 	if (xhci->lpm_command)
 		xhci_free_command(xhci, xhci->lpm_command);
+	xhci->lpm_command = NULL;
 	xhci->cmd_ring_reserved_trbs = 0;
 	if (xhci->cmd_ring)
 		xhci_ring_free(xhci, xhci->cmd_ring);
-- 
1.9.1


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

* [PATCH 3.13 058/163] xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (56 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 057/163] usb: xhci: Fix OOPS in xhci error handling code Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 059/163] drm/ast: open key before detect chips Kamal Mostafa
                   ` (104 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mathias Nyman, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit 96044694b8511bc2b04df0776b4ba295cfe005c0 upstream.

Resuming from hibernate (S4) will restart and re-initialize xHC.
The device contexts are freed and will be re-allocated later during device reset.

Usb core will disable link pm in device resume before device reset, which will
try to change the max exit latency, accessing the device contexts before they are re-allocated.

There is no need to zero (disable) the max exit latency when disabling hw lpm
for a freshly re-initialized xHC. So check that device context exists before
doing anything. The max exit latency will be set again after device reset when usb core
enables the link pm.

Reported-by: Imre Deak <imre.deak@intel.com>
Tested-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/xhci.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index a879287..959e769 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3917,13 +3917,21 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
 	int ret;
 
 	spin_lock_irqsave(&xhci->lock, flags);
-	if (max_exit_latency == xhci->devs[udev->slot_id]->current_mel) {
+
+	virt_dev = xhci->devs[udev->slot_id];
+
+	/*
+	 * virt_dev might not exists yet if xHC resumed from hibernate (S4) and
+	 * xHC was re-initialized. Exit latency will be set later after
+	 * hub_port_finish_reset() is done and xhci->devs[] are re-allocated
+	 */
+
+	if (!virt_dev || max_exit_latency == virt_dev->current_mel) {
 		spin_unlock_irqrestore(&xhci->lock, flags);
 		return 0;
 	}
 
 	/* Attempt to issue an Evaluate Context command to change the MEL. */
-	virt_dev = xhci->devs[udev->slot_id];
 	command = xhci->lpm_command;
 	ctrl_ctx = xhci_get_input_control_ctx(xhci, command->in_ctx);
 	if (!ctrl_ctx) {
-- 
1.9.1


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

* [PATCH 3.13 059/163] drm/ast: open key before detect chips
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (57 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 058/163] xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 060/163] drm/ast: AST2000 cannot be detected correctly Kamal Mostafa
                   ` (103 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Y.C. Chen, Dave Airlie, Kamal Mostafa

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

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

From: "Y.C. Chen" <yc_chen@aspeedtech.com>

commit 8f372e250ae5f4a5faf87ca1a629d0ae59db65b6 upstream.

Some config settings like 3rd TX chips will not get correctly
if the extended reg is protected

Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
Reviewed-by: Egbert Eich <eich@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/ast/ast_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index af0b868..df1266d 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -66,6 +66,7 @@ uint8_t ast_get_index_reg_mask(struct ast_private *ast,
 static int ast_detect_chip(struct drm_device *dev)
 {
 	struct ast_private *ast = dev->dev_private;
+	ast_open_key(ast);
 
 	if (dev->pdev->device == PCI_CHIP_AST1180) {
 		ast->chip = AST1100;
-- 
1.9.1


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

* [PATCH 3.13 060/163] drm/ast: AST2000 cannot be detected correctly
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (58 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 059/163] drm/ast: open key before detect chips Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 061/163] futex: Unlock hb->lock in futex_wait_requeue_pi() error path Kamal Mostafa
                   ` (102 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Y.C. Chen, Dave Airlie, Kamal Mostafa

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

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

From: "Y.C. Chen" <yc_chen@aspeedtech.com>

commit 83502a5d34386f7c6973bc70e1c423f55f5a2e3a upstream.

Type error and cause AST2000 cannot be detected correctly

Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
Reviewed-by: Egbert Eich <eich@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/ast/ast_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index df1266d..4e09386 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -101,7 +101,7 @@ static int ast_detect_chip(struct drm_device *dev)
 			}
 			ast->vga2_clone = false;
 		} else {
-			ast->chip = 2000;
+			ast->chip = AST2000;
 			DRM_INFO("AST 2000 detected\n");
 		}
 	}
-- 
1.9.1


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

* [PATCH 3.13 061/163] futex: Unlock hb->lock in futex_wait_requeue_pi() error path
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (59 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 060/163] drm/ast: AST2000 cannot be detected correctly Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 062/163] jiffies: Fix timeval conversion to jiffies Kamal Mostafa
                   ` (101 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, Kamal Mostafa

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

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

From: Thomas Gleixner <tglx@linutronix.de>

commit 13c42c2f43b19aab3195f2d357db00d1e885eaa8 upstream.

futex_wait_requeue_pi() calls futex_wait_setup(). If
futex_wait_setup() succeeds it returns with hb->lock held and
preemption disabled. Now the sanity check after this does:

        if (match_futex(&q.key, &key2)) {
	   	ret = -EINVAL;
		goto out_put_keys;
	}

which releases the keys but does not release hb->lock.

So we happily return to user space with hb->lock held and therefor
preemption disabled.

Unlock hb->lock before taking the exit route.

Reported-by: Dave "Trinity" Jones <davej@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1409112318500.4178@nanos
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[ kamal: backport to 3.13-stable: queue_unlock() args ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/futex.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/futex.c b/kernel/futex.c
index c265aac..4741b1f 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2465,6 +2465,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
 	 * shared futexes. We need to compare the keys:
 	 */
 	if (match_futex(&q.key, &key2)) {
+		queue_unlock(&q, hb);
 		ret = -EINVAL;
 		goto out_put_keys;
 	}
-- 
1.9.1


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

* [PATCH 3.13 062/163] jiffies: Fix timeval conversion to jiffies
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (60 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 061/163] futex: Unlock hb->lock in futex_wait_requeue_pi() error path Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 063/163] alarmtimer: Return relative times in timer_gettime Kamal Mostafa
                   ` (100 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Ingo Molnar, Paul Turner, Richard Cochran,
	Prarit Bhargava, Andrew Hunter, John Stultz, Kamal Mostafa

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

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

From: Andrew Hunter <ahh@google.com>

commit d78c9300c51d6ceed9f6d078d4e9366f259de28c upstream.

timeval_to_jiffies tried to round a timeval up to an integral number
of jiffies, but the logic for doing so was incorrect: intervals
corresponding to exactly N jiffies would become N+1. This manifested
itself particularly repeatedly stopping/starting an itimer:

setitimer(ITIMER_PROF, &val, NULL);
setitimer(ITIMER_PROF, NULL, &val);

would add a full tick to val, _even if it was exactly representable in
terms of jiffies_ (say, the result of a previous rounding.)  Doing
this repeatedly would cause unbounded growth in val.  So fix the math.

Here's what was wrong with the conversion: we essentially computed
(eliding seconds)

jiffies = usec  * (NSEC_PER_USEC/TICK_NSEC)

by using scaling arithmetic, which took the best approximation of
NSEC_PER_USEC/TICK_NSEC with denominator of 2^USEC_JIFFIE_SC =
x/(2^USEC_JIFFIE_SC), and computed:

jiffies = (usec * x) >> USEC_JIFFIE_SC

and rounded this calculation up in the intermediate form (since we
can't necessarily exactly represent TICK_NSEC in usec.) But the
scaling arithmetic is a (very slight) *over*approximation of the true
value; that is, instead of dividing by (1 usec/ 1 jiffie), we
effectively divided by (1 usec/1 jiffie)-epsilon (rounding
down). This would normally be fine, but we want to round timeouts up,
and we did so by adding 2^USEC_JIFFIE_SC - 1 before the shift; this
would be fine if our division was exact, but dividing this by the
slightly smaller factor was equivalent to adding just _over_ 1 to the
final result (instead of just _under_ 1, as desired.)

In particular, with HZ=1000, we consistently computed that 10000 usec
was 11 jiffies; the same was true for any exact multiple of
TICK_NSEC.

We could possibly still round in the intermediate form, adding
something less than 2^USEC_JIFFIE_SC - 1, but easier still is to
convert usec->nsec, round in nanoseconds, and then convert using
time*spec*_to_jiffies.  This adds one constant multiplication, and is
not observably slower in microbenchmarks on recent x86 hardware.

Tested: the following program:

int main() {
  struct itimerval zero = {{0, 0}, {0, 0}};
  /* Initially set to 10 ms. */
  struct itimerval initial = zero;
  initial.it_interval.tv_usec = 10000;
  setitimer(ITIMER_PROF, &initial, NULL);
  /* Save and restore several times. */
  for (size_t i = 0; i < 10; ++i) {
    struct itimerval prev;
    setitimer(ITIMER_PROF, &zero, &prev);
    /* on old kernels, this goes up by TICK_USEC every iteration */
    printf("previous value: %ld %ld %ld %ld\n",
           prev.it_interval.tv_sec, prev.it_interval.tv_usec,
           prev.it_value.tv_sec, prev.it_value.tv_usec);
    setitimer(ITIMER_PROF, &prev, NULL);
  }
    return 0;
}

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Turner <pjt@google.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Reviewed-by: Paul Turner <pjt@google.com>
Reported-by: Aaron Jacobs <jacobsa@google.com>
Signed-off-by: Andrew Hunter <ahh@google.com>
[jstultz: Tweaked to apply to 3.17-rc]
Signed-off-by: John Stultz <john.stultz@linaro.org>
[ kamal: backport to 3.13-stable: kernel/time.c ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/linux/jiffies.h | 12 -----------
 kernel/time.c           | 54 +++++++++++++++++++++++++++----------------------
 2 files changed, 30 insertions(+), 36 deletions(-)

diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index d235e88..8acbb7b 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -258,23 +258,11 @@ extern unsigned long preset_lpj;
 #define SEC_JIFFIE_SC (32 - SHIFT_HZ)
 #endif
 #define NSEC_JIFFIE_SC (SEC_JIFFIE_SC + 29)
-#define USEC_JIFFIE_SC (SEC_JIFFIE_SC + 19)
 #define SEC_CONVERSION ((unsigned long)((((u64)NSEC_PER_SEC << SEC_JIFFIE_SC) +\
                                 TICK_NSEC -1) / (u64)TICK_NSEC))
 
 #define NSEC_CONVERSION ((unsigned long)((((u64)1 << NSEC_JIFFIE_SC) +\
                                         TICK_NSEC -1) / (u64)TICK_NSEC))
-#define USEC_CONVERSION  \
-                    ((unsigned long)((((u64)NSEC_PER_USEC << USEC_JIFFIE_SC) +\
-                                        TICK_NSEC -1) / (u64)TICK_NSEC))
-/*
- * USEC_ROUND is used in the timeval to jiffie conversion.  See there
- * for more details.  It is the scaled resolution rounding value.  Note
- * that it is a 64-bit value.  Since, when it is applied, we are already
- * in jiffies (albit scaled), it is nothing but the bits we will shift
- * off.
- */
-#define USEC_ROUND (u64)(((u64)1 << USEC_JIFFIE_SC) - 1)
 /*
  * The maximum jiffie value is (MAX_INT >> 1).  Here we translate that
  * into seconds.  The 64-bit case will overflow if we are not careful,
diff --git a/kernel/time.c b/kernel/time.c
index 7c7964c..3c49ab4 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -496,17 +496,20 @@ EXPORT_SYMBOL(usecs_to_jiffies);
  * that a remainder subtract here would not do the right thing as the
  * resolution values don't fall on second boundries.  I.e. the line:
  * nsec -= nsec % TICK_NSEC; is NOT a correct resolution rounding.
+ * Note that due to the small error in the multiplier here, this
+ * rounding is incorrect for sufficiently large values of tv_nsec, but
+ * well formed timespecs should have tv_nsec < NSEC_PER_SEC, so we're
+ * OK.
  *
  * Rather, we just shift the bits off the right.
  *
  * The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec
  * value to a scaled second value.
  */
-unsigned long
-timespec_to_jiffies(const struct timespec *value)
+static unsigned long
+__timespec_to_jiffies(unsigned long sec, long nsec)
 {
-	unsigned long sec = value->tv_sec;
-	long nsec = value->tv_nsec + TICK_NSEC - 1;
+	nsec = nsec + TICK_NSEC - 1;
 
 	if (sec >= MAX_SEC_IN_JIFFIES){
 		sec = MAX_SEC_IN_JIFFIES;
@@ -517,6 +520,13 @@ timespec_to_jiffies(const struct timespec *value)
 		 (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
 
 }
+
+unsigned long
+timespec_to_jiffies(const struct timespec *value)
+{
+	return __timespec_to_jiffies(value->tv_sec, value->tv_nsec);
+}
+
 EXPORT_SYMBOL(timespec_to_jiffies);
 
 void
@@ -533,31 +543,27 @@ jiffies_to_timespec(const unsigned long jiffies, struct timespec *value)
 }
 EXPORT_SYMBOL(jiffies_to_timespec);
 
-/* Same for "timeval"
+/*
+ * We could use a similar algorithm to timespec_to_jiffies (with a
+ * different multiplier for usec instead of nsec). But this has a
+ * problem with rounding: we can't exactly add TICK_NSEC - 1 to the
+ * usec value, since it's not necessarily integral.
  *
- * Well, almost.  The problem here is that the real system resolution is
- * in nanoseconds and the value being converted is in micro seconds.
- * Also for some machines (those that use HZ = 1024, in-particular),
- * there is a LARGE error in the tick size in microseconds.
-
- * The solution we use is to do the rounding AFTER we convert the
- * microsecond part.  Thus the USEC_ROUND, the bits to be shifted off.
- * Instruction wise, this should cost only an additional add with carry
- * instruction above the way it was done above.
+ * We could instead round in the intermediate scaled representation
+ * (i.e. in units of 1/2^(large scale) jiffies) but that's also
+ * perilous: the scaling introduces a small positive error, which
+ * combined with a division-rounding-upward (i.e. adding 2^(scale) - 1
+ * units to the intermediate before shifting) leads to accidental
+ * overflow and overestimates.
+ *
+ * At the cost of one additional multiplication by a constant, just
+ * use the timespec implementation.
  */
 unsigned long
 timeval_to_jiffies(const struct timeval *value)
 {
-	unsigned long sec = value->tv_sec;
-	long usec = value->tv_usec;
-
-	if (sec >= MAX_SEC_IN_JIFFIES){
-		sec = MAX_SEC_IN_JIFFIES;
-		usec = 0;
-	}
-	return (((u64)sec * SEC_CONVERSION) +
-		(((u64)usec * USEC_CONVERSION + USEC_ROUND) >>
-		 (USEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
+	return __timespec_to_jiffies(value->tv_sec,
+				     value->tv_usec * NSEC_PER_USEC);
 }
 EXPORT_SYMBOL(timeval_to_jiffies);
 
-- 
1.9.1


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

* [PATCH 3.13 063/163] alarmtimer: Return relative times in timer_gettime
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (61 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 062/163] jiffies: Fix timeval conversion to jiffies Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 064/163] alarmtimer: Do not signal SIGEV_NONE timers Kamal Mostafa
                   ` (99 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Ingo Molnar, Richard Cochran, Prarit Bhargava,
	Sharvil Nanavati, Richard Larocque, John Stultz, Kamal Mostafa

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

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

From: Richard Larocque <rlarocque@google.com>

commit e86fea764991e00a03ff1e56409ec9cacdbda4c9 upstream.

Returns the time remaining for an alarm timer, rather than the time at
which it is scheduled to expire.  If the timer has already expired or it
is not currently scheduled, the it_value's members are set to zero.

This new behavior matches that of the other posix-timers and the POSIX
specifications.

This is a change in user-visible behavior, and may break existing
applications.  Hopefully, few users rely on the old incorrect behavior.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Sharvil Nanavati <sharvil@google.com>
Signed-off-by: Richard Larocque <rlarocque@google.com>
[jstultz: minor style tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/alarmtimer.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index fe75444..6745174 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -541,18 +541,22 @@ static int alarm_timer_create(struct k_itimer *new_timer)
  * @new_timer: k_itimer pointer
  * @cur_setting: itimerspec data to fill
  *
- * Copies the itimerspec data out from the k_itimer
+ * Copies out the current itimerspec data
  */
 static void alarm_timer_get(struct k_itimer *timr,
 				struct itimerspec *cur_setting)
 {
-	memset(cur_setting, 0, sizeof(struct itimerspec));
+	ktime_t relative_expiry_time =
+		alarm_expires_remaining(&(timr->it.alarm.alarmtimer));
 
-	cur_setting->it_interval =
-			ktime_to_timespec(timr->it.alarm.interval);
-	cur_setting->it_value =
-		ktime_to_timespec(timr->it.alarm.alarmtimer.node.expires);
-	return;
+	if (ktime_to_ns(relative_expiry_time) > 0) {
+		cur_setting->it_value = ktime_to_timespec(relative_expiry_time);
+	} else {
+		cur_setting->it_value.tv_sec = 0;
+		cur_setting->it_value.tv_nsec = 0;
+	}
+
+	cur_setting->it_interval = ktime_to_timespec(timr->it.alarm.interval);
 }
 
 /**
-- 
1.9.1


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

* [PATCH 3.13 064/163] alarmtimer: Do not signal SIGEV_NONE timers
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (62 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 063/163] alarmtimer: Return relative times in timer_gettime Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 065/163] alarmtimer: Lock k_itimer during timer callback Kamal Mostafa
                   ` (98 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Ingo Molnar, Richard Cochran, Prarit Bhargava,
	Sharvil Nanavati, Richard Larocque, John Stultz, Kamal Mostafa

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

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

From: Richard Larocque <rlarocque@google.com>

commit 265b81d23a46c39df0a735a3af4238954b41a4c2 upstream.

Avoids sending a signal to alarm timers created with sigev_notify set to
SIGEV_NONE by checking for that special case in the timeout callback.

The regular posix timers avoid sending signals to SIGEV_NONE timers by
not scheduling any callbacks for them in the first place.  Although it
would be possible to do something similar for alarm timers, it's simpler
to handle this as a special case in the timeout.

Prior to this patch, the alarm timer would ignore the sigev_notify value
and try to deliver signals to the process anyway.  Even worse, the
sanity check for the value of sigev_signo is skipped when SIGEV_NONE was
specified, so the signal number could be bogus.  If sigev_signo was an
unitialized value (as it often would be if SIGEV_NONE is used), then
it's hard to predict which signal will be sent.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Sharvil Nanavati <sharvil@google.com>
Signed-off-by: Richard Larocque <rlarocque@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/alarmtimer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 6745174..f7bdb14 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -466,8 +466,10 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
 {
 	struct k_itimer *ptr = container_of(alarm, struct k_itimer,
 						it.alarm.alarmtimer);
-	if (posix_timer_event(ptr, 0) != 0)
-		ptr->it_overrun++;
+	if ((ptr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) {
+		if (posix_timer_event(ptr, 0) != 0)
+			ptr->it_overrun++;
+	}
 
 	/* Re-add periodic timers */
 	if (ptr->it.alarm.interval.tv64) {
-- 
1.9.1


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

* [PATCH 3.13 065/163] alarmtimer: Lock k_itimer during timer callback
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (63 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 064/163] alarmtimer: Do not signal SIGEV_NONE timers Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 066/163] parisc: Implement new LWS CAS supporting 64 bit operations Kamal Mostafa
                   ` (97 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Ingo Molnar, Richard Cochran, Prarit Bhargava,
	Sharvil Nanavati, Richard Larocque, John Stultz, Kamal Mostafa

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

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

From: Richard Larocque <rlarocque@google.com>

commit 474e941bed9262f5fa2394f9a4a67e24499e5926 upstream.

Locks the k_itimer's it_lock member when handling the alarm timer's
expiry callback.

The regular posix timers defined in posix-timers.c have this lock held
during timout processing because their callbacks are routed through
posix_timer_fn().  The alarm timers follow a different path, so they
ought to grab the lock somewhere else.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Sharvil Nanavati <sharvil@google.com>
Signed-off-by: Richard Larocque <rlarocque@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/alarmtimer.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index f7bdb14..cd45a07 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -464,8 +464,12 @@ static enum alarmtimer_type clock2alarm(clockid_t clockid)
 static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
 							ktime_t now)
 {
+	unsigned long flags;
 	struct k_itimer *ptr = container_of(alarm, struct k_itimer,
 						it.alarm.alarmtimer);
+	enum alarmtimer_restart result = ALARMTIMER_NORESTART;
+
+	spin_lock_irqsave(&ptr->it_lock, flags);
 	if ((ptr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) {
 		if (posix_timer_event(ptr, 0) != 0)
 			ptr->it_overrun++;
@@ -475,9 +479,11 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
 	if (ptr->it.alarm.interval.tv64) {
 		ptr->it_overrun += alarm_forward(alarm, now,
 						ptr->it.alarm.interval);
-		return ALARMTIMER_RESTART;
+		result = ALARMTIMER_RESTART;
 	}
-	return ALARMTIMER_NORESTART;
+	spin_unlock_irqrestore(&ptr->it_lock, flags);
+
+	return result;
 }
 
 /**
-- 
1.9.1


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

* [PATCH 3.13 066/163] parisc: Implement new LWS CAS supporting 64 bit operations.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (64 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 065/163] alarmtimer: Lock k_itimer during timer callback Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 067/163] don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu() Kamal Mostafa
                   ` (96 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Guy Martin, Helge Deller, Kamal Mostafa

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

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

From: Guy Martin <gmsoft@tuxicoman.be>

commit 89206491201cbd1571009b36292af781cef74c1b upstream.

The current LWS cas only works correctly for 32bit. The new LWS allows
for CAS operations of variable size.

Signed-off-by: Guy Martin <gmsoft@tuxicoman.be>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/parisc/kernel/syscall.S | 233 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 229 insertions(+), 4 deletions(-)

diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index 8387860..7ef22e3 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -74,7 +74,7 @@ ENTRY(linux_gateway_page)
 	/* ADDRESS 0xb0 to 0xb8, lws uses two insns for entry */
 	/* Light-weight-syscall entry must always be located at 0xb0 */
 	/* WARNING: Keep this number updated with table size changes */
-#define __NR_lws_entries (2)
+#define __NR_lws_entries (3)
 
 lws_entry:
 	gate	lws_start, %r0		/* increase privilege */
@@ -502,7 +502,7 @@ lws_exit:
 
 	
 	/***************************************************
-		Implementing CAS as an atomic operation:
+		Implementing 32bit CAS as an atomic operation:
 
 		%r26 - Address to examine
 		%r25 - Old value to check (old)
@@ -659,6 +659,230 @@ cas_action:
 	ASM_EXCEPTIONTABLE_ENTRY(2b-linux_gateway_page, 3b-linux_gateway_page)
 
 
+	/***************************************************
+		New CAS implementation which uses pointers and variable size
+		information. The value pointed by old and new MUST NOT change
+		while performing CAS. The lock only protect the value at %r26.
+
+		%r26 - Address to examine
+		%r25 - Pointer to the value to check (old)
+		%r24 - Pointer to the value to set (new)
+		%r23 - Size of the variable (0/1/2/3 for 8/16/32/64 bit)
+		%r28 - Return non-zero on failure
+		%r21 - Kernel error code
+
+		%r21 has the following meanings:
+
+		EAGAIN - CAS is busy, ldcw failed, try again.
+		EFAULT - Read or write failed.
+
+		Scratch: r20, r22, r28, r29, r1, fr4 (32bit for 64bit CAS only)
+
+	****************************************************/
+
+	/* ELF32 Process entry path */
+lws_compare_and_swap_2:
+#ifdef CONFIG_64BIT
+	/* Clip the input registers */
+	depdi	0, 31, 32, %r26
+	depdi	0, 31, 32, %r25
+	depdi	0, 31, 32, %r24
+	depdi	0, 31, 32, %r23
+#endif
+
+	/* Check the validity of the size pointer */
+	subi,>>= 4, %r23, %r0
+	b,n	lws_exit_nosys
+
+	/* Jump to the functions which will load the old and new values into
+	   registers depending on the their size */
+	shlw	%r23, 2, %r29
+	blr	%r29, %r0
+	nop
+
+	/* 8bit load */
+4:	ldb	0(%sr3,%r25), %r25
+	b	cas2_lock_start
+5:	ldb	0(%sr3,%r24), %r24
+	nop
+	nop
+	nop
+	nop
+	nop
+
+	/* 16bit load */
+6:	ldh	0(%sr3,%r25), %r25
+	b	cas2_lock_start
+7:	ldh	0(%sr3,%r24), %r24
+	nop
+	nop
+	nop
+	nop
+	nop
+
+	/* 32bit load */
+8:	ldw	0(%sr3,%r25), %r25
+	b	cas2_lock_start
+9:	ldw	0(%sr3,%r24), %r24
+	nop
+	nop
+	nop
+	nop
+	nop
+
+	/* 64bit load */
+#ifdef CONFIG_64BIT
+10:	ldd	0(%sr3,%r25), %r25
+11:	ldd	0(%sr3,%r24), %r24
+#else
+	/* Load new value into r22/r23 - high/low */
+10:	ldw	0(%sr3,%r25), %r22
+11:	ldw	4(%sr3,%r25), %r23
+	/* Load new value into fr4 for atomic store later */
+12:	flddx	0(%sr3,%r24), %fr4
+#endif
+
+cas2_lock_start:
+	/* Load start of lock table */
+	ldil	L%lws_lock_start, %r20
+	ldo	R%lws_lock_start(%r20), %r28
+
+	/* Extract four bits from r26 and hash lock (Bits 4-7) */
+	extru  %r26, 27, 4, %r20
+
+	/* Find lock to use, the hash is either one of 0 to
+	   15, multiplied by 16 (keep it 16-byte aligned)
+	   and add to the lock table offset. */
+	shlw	%r20, 4, %r20
+	add	%r20, %r28, %r20
+
+	rsm	PSW_SM_I, %r0			/* Disable interrupts */
+	/* COW breaks can cause contention on UP systems */
+	LDCW	0(%sr2,%r20), %r28		/* Try to acquire the lock */
+	cmpb,<>,n	%r0, %r28, cas2_action	/* Did we get it? */
+cas2_wouldblock:
+	ldo	2(%r0), %r28			/* 2nd case */
+	ssm	PSW_SM_I, %r0
+	b	lws_exit			/* Contended... */
+	ldo	-EAGAIN(%r0), %r21		/* Spin in userspace */
+
+	/*
+		prev = *addr;
+		if ( prev == old )
+		  *addr = new;
+		return prev;
+	*/
+
+	/* NOTES:
+		This all works becuse intr_do_signal
+		and schedule both check the return iasq
+		and see that we are on the kernel page
+		so this process is never scheduled off
+		or is ever sent any signal of any sort,
+		thus it is wholly atomic from usrspaces
+		perspective
+	*/
+cas2_action:
+	/* Jump to the correct function */
+	blr	%r29, %r0
+	/* Set %r28 as non-zero for now */
+	ldo	1(%r0),%r28
+
+	/* 8bit CAS */
+13:	ldb,ma	0(%sr3,%r26), %r29
+	sub,=	%r29, %r25, %r0
+	b,n	cas2_end
+14:	stb,ma	%r24, 0(%sr3,%r26)
+	b	cas2_end
+	copy	%r0, %r28
+	nop
+	nop
+
+	/* 16bit CAS */
+15:	ldh,ma	0(%sr3,%r26), %r29
+	sub,=	%r29, %r25, %r0
+	b,n	cas2_end
+16:	sth,ma	%r24, 0(%sr3,%r26)
+	b	cas2_end
+	copy	%r0, %r28
+	nop
+	nop
+
+	/* 32bit CAS */
+17:	ldw,ma	0(%sr3,%r26), %r29
+	sub,=	%r29, %r25, %r0
+	b,n	cas2_end
+18:	stw,ma	%r24, 0(%sr3,%r26)
+	b	cas2_end
+	copy	%r0, %r28
+	nop
+	nop
+
+	/* 64bit CAS */
+#ifdef CONFIG_64BIT
+19:	ldd,ma	0(%sr3,%r26), %r29
+	sub,=	%r29, %r25, %r0
+	b,n	cas2_end
+20:	std,ma	%r24, 0(%sr3,%r26)
+	copy	%r0, %r28
+#else
+	/* Compare first word */
+19:	ldw,ma	0(%sr3,%r26), %r29
+	sub,=	%r29, %r22, %r0
+	b,n	cas2_end
+	/* Compare second word */
+20:	ldw,ma	4(%sr3,%r26), %r29
+	sub,=	%r29, %r23, %r0
+	b,n	cas2_end
+	/* Perform the store */
+21:	fstdx	%fr4, 0(%sr3,%r26)
+	copy	%r0, %r28
+#endif
+
+cas2_end:
+	/* Free lock */
+	stw,ma	%r20, 0(%sr2,%r20)
+	/* Enable interrupts */
+	ssm	PSW_SM_I, %r0
+	/* Return to userspace, set no error */
+	b	lws_exit
+	copy	%r0, %r21
+
+22:
+	/* Error occurred on load or store */
+	/* Free lock */
+	stw	%r20, 0(%sr2,%r20)
+	ssm	PSW_SM_I, %r0
+	ldo	1(%r0),%r28
+	b	lws_exit
+	ldo	-EFAULT(%r0),%r21	/* set errno */
+	nop
+	nop
+	nop
+
+	/* Exception table entries, for the load and store, return EFAULT.
+	   Each of the entries must be relocated. */
+	ASM_EXCEPTIONTABLE_ENTRY(4b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(5b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(6b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(7b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(8b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(9b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(10b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(11b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(13b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(14b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(15b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(16b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(17b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(18b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(19b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(20b-linux_gateway_page, 22b-linux_gateway_page)
+#ifndef CONFIG_64BIT
+	ASM_EXCEPTIONTABLE_ENTRY(12b-linux_gateway_page, 22b-linux_gateway_page)
+	ASM_EXCEPTIONTABLE_ENTRY(21b-linux_gateway_page, 22b-linux_gateway_page)
+#endif
+
 	/* Make sure nothing else is placed on this page */
 	.align PAGE_SIZE
 END(linux_gateway_page)
@@ -675,8 +899,9 @@ ENTRY(end_linux_gateway_page)
 	/* Light-weight-syscall table */
 	/* Start of lws table. */
 ENTRY(lws_table)
-	LWS_ENTRY(compare_and_swap32)	/* 0 - ELF32 Atomic compare and swap */
-	LWS_ENTRY(compare_and_swap64)	/* 1 - ELF64 Atomic compare and swap */
+	LWS_ENTRY(compare_and_swap32)		/* 0 - ELF32 Atomic 32bit CAS */
+	LWS_ENTRY(compare_and_swap64)		/* 1 - ELF64 Atomic 32bit CAS */
+	LWS_ENTRY(compare_and_swap_2)		/* 2 - ELF32 Atomic 64bit CAS */
 END(lws_table)
 	/* End of lws table */
 
-- 
1.9.1


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

* [PATCH 3.13 067/163] don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (65 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 066/163] parisc: Implement new LWS CAS supporting 64 bit operations Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 068/163] be careful with nd->inode in path_init() and follow_dotdot_rcu() Kamal Mostafa
                   ` (95 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Al Viro, Kamal Mostafa

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

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 7bd88377d482e1eae3c5329b12e33cfd664fa6a9 upstream.

return the value instead, and have path_init() do the assignment.  Broken by
"vfs: Fix absolute RCU path walk failures due to uninitialized seq number",
which was Cc-stable with 2.6.38+ as destination.  This one should go where
it went.

To avoid dummy value returned in case when root is already set (it would do
no harm, actually, since the only caller that doesn't ignore the return value
is guaranteed to have nd->root *not* set, but it's more obvious that way),
lift the check into callers.  And do the same to set_root(), to keep them
in sync.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/namei.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index c0cd08d..aed3458 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -630,24 +630,22 @@ static int complete_walk(struct nameidata *nd)
 
 static __always_inline void set_root(struct nameidata *nd)
 {
-	if (!nd->root.mnt)
-		get_fs_root(current->fs, &nd->root);
+	get_fs_root(current->fs, &nd->root);
 }
 
 static int link_path_walk(const char *, struct nameidata *);
 
-static __always_inline void set_root_rcu(struct nameidata *nd)
+static __always_inline unsigned set_root_rcu(struct nameidata *nd)
 {
-	if (!nd->root.mnt) {
-		struct fs_struct *fs = current->fs;
-		unsigned seq;
+	struct fs_struct *fs = current->fs;
+	unsigned seq, res;
 
-		do {
-			seq = read_seqcount_begin(&fs->seq);
-			nd->root = fs->root;
-			nd->seq = __read_seqcount_begin(&nd->root.dentry->d_seq);
-		} while (read_seqcount_retry(&fs->seq, seq));
-	}
+	do {
+		seq = read_seqcount_begin(&fs->seq);
+		nd->root = fs->root;
+		res = __read_seqcount_begin(&nd->root.dentry->d_seq);
+	} while (read_seqcount_retry(&fs->seq, seq));
+	return res;
 }
 
 static void path_put_conditional(struct path *path, struct nameidata *nd)
@@ -847,7 +845,8 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
 			return PTR_ERR(s);
 		}
 		if (*s == '/') {
-			set_root(nd);
+			if (!nd->root.mnt)
+				set_root(nd);
 			path_put(&nd->path);
 			nd->path = nd->root;
 			path_get(&nd->root);
@@ -1120,7 +1119,8 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
 
 static int follow_dotdot_rcu(struct nameidata *nd)
 {
-	set_root_rcu(nd);
+	if (!nd->root.mnt)
+		set_root_rcu(nd);
 
 	while (1) {
 		if (nd->path.dentry == nd->root.dentry &&
@@ -1232,7 +1232,8 @@ static void follow_mount(struct path *path)
 
 static void follow_dotdot(struct nameidata *nd)
 {
-	set_root(nd);
+	if (!nd->root.mnt)
+		set_root(nd);
 
 	while(1) {
 		struct dentry *old = nd->path.dentry;
@@ -1831,7 +1832,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
 	if (*name=='/') {
 		if (flags & LOOKUP_RCU) {
 			rcu_read_lock();
-			set_root_rcu(nd);
+			nd->seq = set_root_rcu(nd);
 		} else {
 			set_root(nd);
 			path_get(&nd->root);
-- 
1.9.1


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

* [PATCH 3.13 068/163] be careful with nd->inode in path_init() and follow_dotdot_rcu()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (66 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 067/163] don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu() Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 069/163] iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name Kamal Mostafa
                   ` (94 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Al Viro, Kamal Mostafa

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

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

From: Al Viro <viro@zeniv.linux.org.uk>

commit 4023bfc9f351a7994fb6a7d515476c320f94a574 upstream.

in the former we simply check if dentry is still valid after picking
its ->d_inode; in the latter we fetch ->d_inode in the same places
where we fetch dentry and its ->d_seq, under the same checks.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/namei.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index aed3458..eaabb52 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1119,6 +1119,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
 
 static int follow_dotdot_rcu(struct nameidata *nd)
 {
+	struct inode *inode = nd->inode;
 	if (!nd->root.mnt)
 		set_root_rcu(nd);
 
@@ -1132,6 +1133,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
 			struct dentry *parent = old->d_parent;
 			unsigned seq;
 
+			inode = parent->d_inode;
 			seq = read_seqcount_begin(&parent->d_seq);
 			if (read_seqcount_retry(&old->d_seq, nd->seq))
 				goto failed;
@@ -1141,6 +1143,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
 		}
 		if (!follow_up_rcu(&nd->path))
 			break;
+		inode = nd->path.dentry->d_inode;
 		nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
 	}
 	while (d_mountpoint(nd->path.dentry)) {
@@ -1150,11 +1153,12 @@ static int follow_dotdot_rcu(struct nameidata *nd)
 			break;
 		nd->path.mnt = &mounted->mnt;
 		nd->path.dentry = mounted->mnt.mnt_root;
+		inode = nd->path.dentry->d_inode;
 		nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
 		if (!read_seqretry(&mount_lock, nd->m_seq))
 			goto failed;
 	}
-	nd->inode = nd->path.dentry->d_inode;
+	nd->inode = inode;
 	return 0;
 
 failed:
@@ -1883,7 +1887,14 @@ static int path_init(int dfd, const char *name, unsigned int flags,
 	}
 
 	nd->inode = nd->path.dentry->d_inode;
-	return 0;
+	if (!(flags & LOOKUP_RCU))
+		return 0;
+	if (likely(!read_seqcount_retry(&nd->path.dentry->d_seq, nd->seq)))
+		return 0;
+	if (!(nd->flags & LOOKUP_ROOT))
+		nd->root.mnt = NULL;
+	rcu_read_unlock();
+	return -ECHILD;
 }
 
 static inline int lookup_last(struct nameidata *nd, struct path *path)
-- 
1.9.1


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

* [PATCH 3.13 069/163] iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (67 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 068/163] be careful with nd->inode in path_init() and follow_dotdot_rcu() Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 070/163] iio:trigger: modify return value for iio_trigger_get Kamal Mostafa
                   ` (93 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johannes Pointner, Jonathan Cameron, Kamal Mostafa

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

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

From: Johannes Pointner <johannes.pointner@gmail.com>

commit 872687f626e033b4ddfaec1e410057cfc6636d77 upstream.

Fixes: a2c12493ed7e ('iio: of_iio_channel_get_by_name() returns non-null pointers for error legs')

which improperly assumes that of_iio_channel_get_by_name must always
return NULL and thus now hides -EPROBE_DEFER.

Signed-off-by: Johannes Pointner <johannes.pointner@br-automation.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/inkern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index 1e8e94d..4fc88e6 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -178,7 +178,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np,
 			index = of_property_match_string(np, "io-channel-names",
 							 name);
 		chan = of_iio_channel_get(np, index);
-		if (!IS_ERR(chan))
+		if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER)
 			break;
 		else if (name && index >= 0) {
 			pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
-- 
1.9.1


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

* [PATCH 3.13 070/163] iio:trigger: modify return value for iio_trigger_get
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (68 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 069/163] iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 071/163] iio: accel: bma180: Fix indio_dev->trig assignment Kamal Mostafa
                   ` (92 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit f153566570fb9e32c2f59182883f4f66048788fb upstream.

Instead of a void function, return the trigger pointer.

Whilst not in of itself a fix, this makes the following set of
7 fixes cleaner than they would otherwise be.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/linux/iio/trigger.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index 369cf2c..68f46cd 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -84,10 +84,12 @@ static inline void iio_trigger_put(struct iio_trigger *trig)
 	put_device(&trig->dev);
 }
 
-static inline void iio_trigger_get(struct iio_trigger *trig)
+static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig)
 {
 	get_device(&trig->dev);
 	__module_get(trig->ops->owner);
+
+	return trig;
 }
 
 /**
-- 
1.9.1


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

* [PATCH 3.13 071/163] iio: accel: bma180: Fix indio_dev->trig assignment
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (69 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 070/163] iio:trigger: modify return value for iio_trigger_get Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 072/163] iio: adc: ad_sigma_delta: " Kamal Mostafa
                   ` (91 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit 0668a4e4d297328ce08b44d91d160537596115e2 upstream.

This can result in wrong reference count for trigger device, call
iio_trigger_get to increment reference.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/accel/bma180.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index 93ff0ba..d079baa 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -566,7 +566,7 @@ static int bma180_probe(struct i2c_client *client,
 	trig->ops = &bma180_trigger_ops;
 	iio_trigger_set_drvdata(trig, indio_dev);
 	data->trig = trig;
-	indio_dev->trig = trig;
+	indio_dev->trig = iio_trigger_get(trig);
 
 	ret = iio_trigger_register(trig);
 	if (ret)
-- 
1.9.1


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

* [PATCH 3.13 072/163] iio: adc: ad_sigma_delta: Fix indio_dev->trig assignment
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (70 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 071/163] iio: accel: bma180: Fix indio_dev->trig assignment Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 073/163] iio: hid_sensor_hub: " Kamal Mostafa
                   ` (90 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit 9e5846be33277802c0c76e5c12825d0e4d27f639 upstream.

This can result in wrong reference count for trigger device, call
iio_trigger_get to increment reference.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/adc/ad_sigma_delta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
index 9a4e0e3..eb799a4 100644
--- a/drivers/iio/adc/ad_sigma_delta.c
+++ b/drivers/iio/adc/ad_sigma_delta.c
@@ -472,7 +472,7 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev)
 		goto error_free_irq;
 
 	/* select default trigger */
-	indio_dev->trig = sigma_delta->trig;
+	indio_dev->trig = iio_trigger_get(sigma_delta->trig);
 
 	return 0;
 
-- 
1.9.1


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

* [PATCH 3.13 073/163] iio: hid_sensor_hub: Fix indio_dev->trig assignment
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (71 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 072/163] iio: adc: ad_sigma_delta: " Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 074/163] iio: st_sensors: " Kamal Mostafa
                   ` (89 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit 55a6f9ddfdea0d2d343cd1b39baf8aa752664b6e upstream.

This can result in wrong reference count for trigger device, call
iio_trigger_get to increment reference.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index 7dcf839..1be235b 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -99,7 +99,8 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
 		dev_err(&indio_dev->dev, "Trigger Register Failed\n");
 		goto error_free_trig;
 	}
-	indio_dev->trig = attrb->trigger = trig;
+	attrb->trigger = trig;
+	indio_dev->trig = iio_trigger_get(trig);
 
 	return ret;
 
-- 
1.9.1


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

* [PATCH 3.13 074/163] iio: st_sensors: Fix indio_dev->trig assignment
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (72 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 073/163] iio: hid_sensor_hub: " Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 075/163] iio: gyro: itg3200: " Kamal Mostafa
                   ` (88 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit f0e84acd7056e6d7ade551c6439531606ae30a46 upstream.

This can result in wrong reference count for trigger device, call
iio_trigger_get to increment reference.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/common/st_sensors/st_sensors_trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c
index 8fc3a97..8d8ca6f 100644
--- a/drivers/iio/common/st_sensors/st_sensors_trigger.c
+++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c
@@ -49,7 +49,7 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev,
 		dev_err(&indio_dev->dev, "failed to register iio trigger.\n");
 		goto iio_trigger_register_error;
 	}
-	indio_dev->trig = sdata->trig;
+	indio_dev->trig = iio_trigger_get(sdata->trig);
 
 	return 0;
 
-- 
1.9.1


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

* [PATCH 3.13 075/163] iio: gyro: itg3200: Fix indio_dev->trig assignment
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (73 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 074/163] iio: st_sensors: " Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 076/163] iio: inv_mpu6050: " Kamal Mostafa
                   ` (87 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit 0b4dce2ee694a991ef38203ec5ff91a738518cb3 upstream.

This can result in wrong reference count for trigger device, call
iio_trigger_get to increment reference.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/gyro/itg3200_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c
index e3b3c50..eef50e9 100644
--- a/drivers/iio/gyro/itg3200_buffer.c
+++ b/drivers/iio/gyro/itg3200_buffer.c
@@ -132,7 +132,7 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev)
 		goto error_free_irq;
 
 	/* select default trigger */
-	indio_dev->trig = st->trig;
+	indio_dev->trig = iio_trigger_get(st->trig);
 
 	return 0;
 
-- 
1.9.1


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

* [PATCH 3.13 076/163] iio: inv_mpu6050: Fix indio_dev->trig assignment
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (74 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 075/163] iio: gyro: itg3200: " Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 077/163] iio: meter: ade7758: " Kamal Mostafa
                   ` (86 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit b07e3b3850b2e1f09c19f54d3ed7210d9f529e2c upstream.

This can result in wrong reference count for trigger device, call
iio_trigger_get to increment reference.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
index 03b9372..926fcce 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
@@ -135,7 +135,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
 	ret = iio_trigger_register(st->trig);
 	if (ret)
 		goto error_free_irq;
-	indio_dev->trig = st->trig;
+	indio_dev->trig = iio_trigger_get(st->trig);
 
 	return 0;
 
-- 
1.9.1


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

* [PATCH 3.13 077/163] iio: meter: ade7758: Fix indio_dev->trig assignment
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (75 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 076/163] iio: inv_mpu6050: " Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 078/163] MIPS: ZBOOT: add missing <linux/string.h> include Kamal Mostafa
                   ` (85 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Srinivas Pandruvada, Jonathan Cameron, Kamal Mostafa

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

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

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

commit 0495081179212b758775df752e657ea71dcae020 upstream.

This can result in wrong reference count for trigger device, call
iio_trigger_get to increment reference.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/staging/iio/meter/ade7758_trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c
index 7a94ddd..8c4f289 100644
--- a/drivers/staging/iio/meter/ade7758_trigger.c
+++ b/drivers/staging/iio/meter/ade7758_trigger.c
@@ -85,7 +85,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev)
 	ret = iio_trigger_register(st->trig);
 
 	/* select default trigger */
-	indio_dev->trig = st->trig;
+	indio_dev->trig = iio_trigger_get(st->trig);
 	if (ret)
 		goto error_free_irq;
 
-- 
1.9.1


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

* [PATCH 3.13 078/163] MIPS: ZBOOT: add missing <linux/string.h> include
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (76 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 077/163] iio: meter: ade7758: " Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 079/163] spi: fsl: Don't use devm_kzalloc in master->setup callback Kamal Mostafa
                   ` (84 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Aurelien Jarno, linux-mips, Ralf Baechle, Kamal Mostafa

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

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

From: Aurelien Jarno <aurelien@aurel32.net>

commit 29593fd5a8149462ed6fad0d522234facdaee6c8 upstream.

Commit dc4d7b37 (MIPS: ZBOOT: gather string functions into string.c)
moved the string related functions into a separate file, which might
cause the following build error, depending on the configuration:

| CC      arch/mips/boot/compressed/decompress.o
| In file included from linux/arch/mips/boot/compressed/../../../../lib/decompress_unxz.c:234:0,
|                  from linux/arch/mips/boot/compressed/decompress.c:67:
| linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c: In function 'fill_temp':
| linux/arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:162:2: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration]
| cc1: some warnings being treated as errors
| linux/scripts/Makefile.build:308: recipe for target 'arch/mips/boot/compressed/decompress.o' failed
| make[6]: *** [arch/mips/boot/compressed/decompress.o] Error 1
| linux/arch/mips/Makefile:308: recipe for target 'vmlinuz' failed

It does not fail with the standard configuration, as when
CONFIG_DYNAMIC_DEBUG is not enabled <linux/string.h> gets included in
include/linux/dynamic_debug.h. There might be other ways for it to
get indirectly included.

We can't add the include directly in xz_dec_stream.c as some
architectures might want to use a different version for the boot/
directory (see for example arch/x86/boot/string.h).

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7420/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/mips/boot/compressed/decompress.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c
index a8c6fd6..193ceae 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -13,6 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/string.h>
 
 #include <asm/addrspace.h>
 
-- 
1.9.1


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

* [PATCH 3.13 079/163] spi: fsl: Don't use devm_kzalloc in master->setup callback
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (77 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 078/163] MIPS: ZBOOT: add missing <linux/string.h> include Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 080/163] spi: dw: " Kamal Mostafa
                   ` (83 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Axel Lin, Mark Brown, Kamal Mostafa

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

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

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

commit d9f26748128c73ec6bed2846ca52fb1c2edc3ced upstream.

device_add() expects that any memory allocated via devm_* API is only
done in the device's probe function.

Fix below boot warning:
[    3.092348] WARNING: at drivers/base/dd.c:286
[    3.096637] Modules linked in:
[    3.099697] CPU: 0 PID: 25 Comm: kworker/u2:1 Tainted: G W 3.16.1-s3k-drv-999-svn5771_knld-999 #158
[ 3.109610] Workqueue: deferwq deferred_probe_work_func
[    3.114736] task: c787f020 ti: c790c000 task.ti: c790c000
[    3.120062] NIP: c01df158 LR: c01df144 CTR: 00000000
[    3.124983] REGS: c790db30 TRAP: 0700   Tainted: G        W (3.16.1-s3k-drv-999-svn5771_knld-999)
[    3.134162] MSR: 00029032 <EE,ME,IR,DR,RI>  CR: 22002082 XER: 20000000
[    3.140703]
[    3.140703] GPR00: 00000001 c790dbe0 c787f020 00000044 00000054 00000308 c056da0e 20737069
[    3.140703] GPR08: 33323736 000ebfe0 00000308 000ebfdf 22002082 00000000 c046c5a0 c046c608
[    3.140703] GPR16: c046c614 c046c620 c046c62c c046c638 c046c648 c046c654 c046c68c c046c6c4
[    3.140703] GPR24: 00000000 00000000 00000003 c0401aa0 c0596638 c059662c c054e7a8 c7996800
[    3.170102] NIP [c01df158] driver_probe_device+0xf8/0x334
[    3.175431] LR [c01df144] driver_probe_device+0xe4/0x334
[    3.180633] Call Trace:
[    3.183093] [c790dbe0] [c01df144] driver_probe_device+0xe4/0x334 (unreliable)
[    3.190147] [c790dc10] [c01dd15c] bus_for_each_drv+0x7c/0xc0
[    3.195741] [c790dc40] [c01df5fc] device_attach+0xcc/0xf8
[    3.201076] [c790dc60] [c01dd6d4] bus_probe_device+0xb4/0xc4
[    3.206666] [c790dc80] [c01db9f8] device_add+0x270/0x564
[    3.211923] [c790dcc0] [c0219e84] spi_add_device+0xc0/0x190
[    3.217427] [c790dce0] [c021a79c] spi_register_master+0x720/0x834
[    3.223455] [c790dd40] [c021cb48] of_fsl_spi_probe+0x55c/0x614
[    3.229234] [c790dda0] [c01e0d2c] platform_drv_probe+0x30/0x74
[    3.234987] [c790ddb0] [c01df18c] driver_probe_device+0x12c/0x334
[    3.241008] [c790dde0] [c01dd15c] bus_for_each_drv+0x7c/0xc0
[    3.246602] [c790de10] [c01df5fc] device_attach+0xcc/0xf8
[    3.251937] [c790de30] [c01dd6d4] bus_probe_device+0xb4/0xc4
[    3.257536] [c790de50] [c01de9d8] deferred_probe_work_func+0x98/0xe0
[    3.263816] [c790de70] [c00305b8] process_one_work+0x18c/0x440
[    3.269577] [c790dea0] [c0030a00] worker_thread+0x194/0x67c
[    3.275105] [c790def0] [c0039198] kthread+0xd0/0xe4
[    3.279911] [c790df40] [c000c6d0] ret_from_kernel_thread+0x5c/0x64
[    3.285970] Instruction dump:
[    3.288900] 80de0000 419e01d0 3b7b0038 3c60c046 7f65db78 38635264 48211b99 813f00a0
[    3.296559] 381f00a0 7d290278 3169ffff 7c0b4910 <0f000000> 93df0044 7fe3fb78 4bfffd4d

Reported-by: leroy christophe <christophe.leroy@c-s.fr>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
[ kamal: backport to 3.13-stable: was not using devm_kzalloc but did need
  the kfree fix. ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/spi/spi-fsl-espi.c | 15 ++++++++++++---
 drivers/spi/spi-fsl-spi.c  | 10 +++++++---
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index 80d8f40..e9f6654 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -456,16 +456,16 @@ static int fsl_espi_setup(struct spi_device *spi)
 	int retval;
 	u32 hw_mode;
 	u32 loop_mode;
-	struct spi_mpc8xxx_cs *cs = spi->controller_state;
+	struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
 
 	if (!spi->max_speed_hz)
 		return -EINVAL;
 
 	if (!cs) {
-		cs = kzalloc(sizeof *cs, GFP_KERNEL);
+		cs = kzalloc(sizeof(*cs), GFP_KERNEL);
 		if (!cs)
 			return -ENOMEM;
-		spi->controller_state = cs;
+		spi_set_ctldata(spi, cs);
 	}
 
 	mpc8xxx_spi = spi_master_get_devdata(spi->master);
@@ -500,6 +500,14 @@ static int fsl_espi_setup(struct spi_device *spi)
 	return 0;
 }
 
+static void fsl_espi_cleanup(struct spi_device *spi)
+{
+	struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
+
+	kfree(cs);
+	spi_set_ctldata(spi, NULL);
+}
+
 void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
 {
 	struct fsl_espi_reg *reg_base = mspi->reg_base;
@@ -607,6 +615,7 @@ static struct spi_master * fsl_espi_probe(struct device *dev,
 
 	master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16);
 	master->setup = fsl_espi_setup;
+	master->cleanup = fsl_espi_cleanup;
 
 	mpc8xxx_spi = spi_master_get_devdata(master);
 	mpc8xxx_spi->spi_do_one_msg = fsl_espi_do_one_msg;
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 119f7af..a18cc09 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -420,16 +420,16 @@ static int fsl_spi_setup(struct spi_device *spi)
 	struct fsl_spi_reg *reg_base;
 	int retval;
 	u32 hw_mode;
-	struct spi_mpc8xxx_cs	*cs = spi->controller_state;
+	struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
 
 	if (!spi->max_speed_hz)
 		return -EINVAL;
 
 	if (!cs) {
-		cs = kzalloc(sizeof *cs, GFP_KERNEL);
+		cs = kzalloc(sizeof(*cs), GFP_KERNEL);
 		if (!cs)
 			return -ENOMEM;
-		spi->controller_state = cs;
+		spi_set_ctldata(spi, cs);
 	}
 	mpc8xxx_spi = spi_master_get_devdata(spi->master);
 
@@ -491,9 +491,13 @@ static int fsl_spi_setup(struct spi_device *spi)
 static void fsl_spi_cleanup(struct spi_device *spi)
 {
 	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
+	struct spi_mpc8xxx_cs *cs = spi_get_ctldata(spi);
 
 	if (mpc8xxx_spi->type == TYPE_GRLIB && gpio_is_valid(spi->cs_gpio))
 		gpio_free(spi->cs_gpio);
+
+	kfree(cs);
+	spi_set_ctldata(spi, NULL);
 }
 
 static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
-- 
1.9.1


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

* [PATCH 3.13 080/163] spi: dw: Don't use devm_kzalloc in master->setup callback
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (78 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 079/163] spi: fsl: Don't use devm_kzalloc in master->setup callback Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 081/163] ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs Kamal Mostafa
                   ` (82 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Axel Lin, Mark Brown, Kamal Mostafa

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

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

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

commit a97c883a16da7e0691a3be5465926c92a8da4da6 upstream.

device_add() expects that any memory allocated via devm_* API is only
done in the device's probe function.

Fix below boot warning:
WARNING: CPU: 1 PID: 1 at drivers/base/dd.c:286 driver_probe_device+0x2b4/0x2f4()
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.16.0-10474-g835c90b-dirty #160
[<c0016364>] (unwind_backtrace) from [<c001251c>] (show_stack+0x20/0x24)
[<c001251c>] (show_stack) from [<c04eaefc>] (dump_stack+0x7c/0x98)
[<c04eaefc>] (dump_stack) from [<c0023d4c>] (warn_slowpath_common+0x78/0x9c)
[<c0023d4c>] (warn_slowpath_common) from [<c0023d9c>] (warn_slowpath_null+0x2c/0x34)
[<c0023d9c>] (warn_slowpath_null) from [<c0302c60>] (driver_probe_device+0x2b4/0x2f4)
[<c0302c60>] (driver_probe_device) from [<c0302d90>] (__device_attach+0x50/0x54)
[<c0302d90>] (__device_attach) from [<c0300e60>] (bus_for_each_drv+0x54/0x9c)
[<c0300e60>] (bus_for_each_drv) from [<c0302958>] (device_attach+0x84/0x90)
[<c0302958>] (device_attach) from [<c0301f10>] (bus_probe_device+0x94/0xb8)
[<c0301f10>] (bus_probe_device) from [<c03000c0>] (device_add+0x434/0x4fc)
[<c03000c0>] (device_add) from [<c0342dd4>] (spi_add_device+0x98/0x164)
[<c0342dd4>] (spi_add_device) from [<c03444a4>] (spi_register_master+0x598/0x768)
[<c03444a4>] (spi_register_master) from [<c03446b4>] (devm_spi_register_master+0x40/0x80)
[<c03446b4>] (devm_spi_register_master) from [<c0346214>] (dw_spi_add_host+0x1a8/0x258)
[<c0346214>] (dw_spi_add_host) from [<c0346920>] (dw_spi_mmio_probe+0x1d4/0x294)
[<c0346920>] (dw_spi_mmio_probe) from [<c0304560>] (platform_drv_probe+0x3c/0x6c)
[<c0304560>] (platform_drv_probe) from [<c0302a98>] (driver_probe_device+0xec/0x2f4)
[<c0302a98>] (driver_probe_device) from [<c0302d3c>] (__driver_attach+0x9c/0xa0)
[<c0302d3c>] (__driver_attach) from [<c0300f0c>] (bus_for_each_dev+0x64/0x98)
[<c0300f0c>] (bus_for_each_dev) from [<c0302518>] (driver_attach+0x2c/0x30)
[<c0302518>] (driver_attach) from [<c0302134>] (bus_add_driver+0xdc/0x1f4)
[<c0302134>] (bus_add_driver) from [<c03035c8>] (driver_register+0x88/0x104)
[<c03035c8>] (driver_register) from [<c030445c>] (__platform_driver_register+0x58/0x6c)
[<c030445c>] (__platform_driver_register) from [<c0700f00>] (dw_spi_mmio_driver_init+0x18/0x20)
[<c0700f00>] (dw_spi_mmio_driver_init) from [<c0008914>] (do_one_initcall+0x90/0x1d4)
[<c0008914>] (do_one_initcall) from [<c06d7d90>] (kernel_init_freeable+0x178/0x248)
[<c06d7d90>] (kernel_init_freeable) from [<c04e687c>] (kernel_init+0x18/0xfc)
[<c04e687c>] (kernel_init) from [<c000ecd8>] (ret_from_fork+0x14/0x20)

Reported-by: Thor Thayer <tthayer@opensource.altera.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
[ kamal: backport to 3.13-stable: was not using devm_kzalloc; only needed
  the set-NULL in dw_spi_cleanup. ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/spi/spi-dw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index b897c4ad..07fa943 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -675,6 +675,7 @@ static void dw_spi_cleanup(struct spi_device *spi)
 {
 	struct chip_data *chip = spi_get_ctldata(spi);
 	kfree(chip);
+	spi_set_ctldata(spi, NULL);
 }
 
 static int init_queue(struct dw_spi *dws)
-- 
1.9.1


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

* [PATCH 3.13 081/163] ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (79 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 080/163] spi: dw: " Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 082/163] [media] cx18: fix kernel oops with tda8290 tuner Kamal Mostafa
                   ` (81 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sudeep Holla, Russell King, Kamal Mostafa

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

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

From: Sudeep Holla <sudeep.holla@arm.com>

commit a040803a9d6b8c1876d3487a5cb69602ebcbb82c upstream.

Since commit 1dbfa187dad ("ARM: irq migration: force migration off CPU
going down") the ARM interrupt migration code on cpu offline calls
irqchip.irq_set_affinity() with the argument force=true. At the point
of this change the argument had no effect because it was not used by
any interrupt chip driver and there was no semantics defined.

This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu
affinity of interrupts") which made the force argument useful to route
interrupts to not yet online cpus without checking the target cpu
against the cpu online mask. The following commit ffde1de64012
("irqchip: gic: Support forced affinity setting") implemented this for
the GIC interrupt controller.

As a consequence the ARM cpu offline irq migration fails if CPU0 is
offlined, because CPU0 is still set in the affinity mask and the
validataion against cpu online mask is skipped to the force argument
being true. The following first_cpu(mask) selection always selects
CPU0 as the target.

Solve the issue by calling irq_set_affinity() with force=false from
the CPU offline irq migration code so the GIC driver validates the
affinity mask against CPU online mask and therefore removes CPU0 from
the possible target candidates.

Tested on TC2 hotpluging CPU0 in and out. Without this patch the system
locks up as the IRQs are not migrated away from CPU0.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm/kernel/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 9723d17..1e782bd 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -163,7 +163,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	c = irq_data_get_irq_chip(d);
 	if (!c->irq_set_affinity)
 		pr_debug("IRQ%u: unable to set affinity\n", d->irq);
-	else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
+	else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
 		cpumask_copy(d->affinity, affinity);
 
 	return ret;
-- 
1.9.1


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

* [PATCH 3.13 082/163] [media] cx18: fix kernel oops with tda8290 tuner
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (80 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 081/163] ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 083/163] ASoC: davinci-mcasp: Correct rx format unit configuration Kamal Mostafa
                   ` (80 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa

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

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

From: Hans Verkuil <hans.verkuil@cisco.com>

commit 6a03dc92cc2edfa2257502557b9f714893987383 upstream.

This was caused by an uninitialized setup.config field.

Based on a suggestion from Devin Heitmueller.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Thanks-to: Devin Heitmueller <dheitmueller@kernellabs.com>
Reported-by: Scott Robinson <scott.robinson55@gmail.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/media/pci/cx18/cx18-driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 716bdc5..83f5074 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -1091,6 +1091,7 @@ static int cx18_probe(struct pci_dev *pci_dev,
 		setup.addr = ADDR_UNSET;
 		setup.type = cx->options.tuner;
 		setup.mode_mask = T_ANALOG_TV;  /* matches TV tuners */
+		setup.config = NULL;
 		if (cx->options.radio > 0)
 			setup.mode_mask |= T_RADIO;
 		setup.tuner_callback = (setup.type == TUNER_XC2028) ?
-- 
1.9.1


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

* [PATCH 3.13 083/163] ASoC: davinci-mcasp: Correct rx format unit configuration
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (81 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 082/163] [media] cx18: fix kernel oops with tda8290 tuner Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 084/163] spi: sirf: enable RX_IO_DMA_INT interrupt Kamal Mostafa
                   ` (79 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Ujfalusi, Mark Brown, Kamal Mostafa

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

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

From: Peter Ujfalusi <peter.ujfalusi@ti.com>

commit fe0a29e163a5d045c73faab682a8dac71c2f8012 upstream.

In case of capture we should not use rotation. The reverse and mask is
enough to get the data align correctly from the bus to MCU:
Format	  data from bus    after reverse (XRBUF)
S16_LE:  |LSB|MSB|xxx|xxx|  |xxx|xxx|MSB|LSB|
S24_3LE: |LSB|DAT|MSB|xxx|  |xxx|MSB|DAT|LSB|
S24_LE:  |LSB|DAT|MSB|xxx|  |xxx|MSB|DAT|LSB|
S32_LE:  |LSB|DAT|DAT|MSB|  |MSB|DAT|DAT|LSB|

With this patch all supported formats will work for playback and capture.

Reported-by: Jyri Sarha <jsarha@ti.com> (broken S24_3LE capture)
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/soc/davinci/davinci-mcasp.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 71e14bb3..9de1fe6 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -632,8 +632,17 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
 {
 	u32 fmt;
 	u32 tx_rotate = (word_length / 4) & 0x7;
-	u32 rx_rotate = (32 - word_length) / 4;
 	u32 mask = (1ULL << word_length) - 1;
+	/*
+	 * For captured data we should not rotate, inversion and masking is
+	 * enoguh to get the data to the right position:
+	 * Format	  data from bus		after reverse (XRBUF)
+	 * S16_LE:	|LSB|MSB|xxx|xxx|	|xxx|xxx|MSB|LSB|
+	 * S24_3LE:	|LSB|DAT|MSB|xxx|	|xxx|MSB|DAT|LSB|
+	 * S24_LE:	|LSB|DAT|MSB|xxx|	|xxx|MSB|DAT|LSB|
+	 * S32_LE:	|LSB|DAT|DAT|MSB|	|MSB|DAT|DAT|LSB|
+	 */
+	u32 rx_rotate = 0;
 
 	/*
 	 * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
-- 
1.9.1


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

* [PATCH 3.13 084/163] spi: sirf: enable RX_IO_DMA_INT interrupt
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (82 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 083/163] ASoC: davinci-mcasp: Correct rx format unit configuration Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 085/163] perf: Fix a race condition in perf_remove_from_context() Kamal Mostafa
                   ` (78 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Qipan Li, Barry Song, Mark Brown, Kamal Mostafa

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

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

From: Qipan Li <Qipan.Li@csr.com>

commit f2a08b404691ef3e7be6ce81c185335cfc68b6db upstream.

in spi interrupt handler, we need check RX_IO_DMA status to ensure
rx fifo have received the specify count data.

if not set, the while statement in spi isr function will keep loop,
at last, make the kernel hang.

[The code is actually there in the interrupt handler but apparently it
needs the interrupt unmasking so the handler sees the status -- broonie]

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
[ kamal: backport to 3.13-stable: applied to spi_sirfsoc_transfer's pio path. ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/spi/spi-sirf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index ed5e501..10bd831 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -366,7 +366,9 @@ static int spi_sirfsoc_transfer(struct spi_device *spi, struct spi_transfer *t)
 		writel(SIRFSOC_SPI_RX_OFLOW_INT_EN | SIRFSOC_SPI_TX_UFLOW_INT_EN |
 			SIRFSOC_SPI_RXFIFO_THD_INT_EN | SIRFSOC_SPI_TXFIFO_THD_INT_EN |
 			SIRFSOC_SPI_FRM_END_INT_EN | SIRFSOC_SPI_RXFIFO_FULL_INT_EN |
-			SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN, sspi->base + SIRFSOC_SPI_INT_EN);
+			SIRFSOC_SPI_TXFIFO_EMPTY_INT_EN |
+			SIRFSOC_SPI_RX_IO_DMA_INT_EN,
+			sspi->base + SIRFSOC_SPI_INT_EN);
 	}
 
 	writel(SIRFSOC_SPI_RX_EN | SIRFSOC_SPI_TX_EN, sspi->base + SIRFSOC_SPI_TX_RX_EN);
-- 
1.9.1


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

* [PATCH 3.13 085/163] perf: Fix a race condition in perf_remove_from_context()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (83 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 084/163] spi: sirf: enable RX_IO_DMA_INT interrupt Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 086/163] ASoC: samsung-i2s: Maintain CDCLK settings across i2s_{shutdown/startup} Kamal Mostafa
                   ` (77 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Cong Wang, Cong Wang, Peter Zijlstra, Paul Mackerras,
	Arnaldo Carvalho de Melo, Linus Torvalds, Ingo Molnar,
	Kamal Mostafa

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

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

From: Cong Wang <cwang@twopensource.com>

commit 3577af70a2ce4853d58e57d832e687d739281479 upstream.

We saw a kernel soft lockup in perf_remove_from_context(),
it looks like the `perf` process, when exiting, could not go
out of the retry loop. Meanwhile, the target process was forking
a child. So either the target process should execute the smp
function call to deactive the event (if it was running) or it should
do a context switch which deactives the event.

It seems we optimize out a context switch in perf_event_context_sched_out(),
and what's more important, we still test an obsolete task pointer when
retrying, so no one actually would deactive that event in this situation.
Fix it directly by reloading the task pointer in perf_remove_from_context().

This should cure the above soft lockup.

Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1409696840-843-1-git-send-email-xiyou.wangcong@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/events/core.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index f8519d6..38f0d1b 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1503,6 +1503,11 @@ retry:
 	 */
 	if (ctx->is_active) {
 		raw_spin_unlock_irq(&ctx->lock);
+		/*
+		 * Reload the task pointer, it might have been changed by
+		 * a concurrent perf_event_context_sched_out().
+		 */
+		task = ctx->task;
 		goto retry;
 	}
 
@@ -1942,6 +1947,11 @@ retry:
 	 */
 	if (ctx->is_active) {
 		raw_spin_unlock_irq(&ctx->lock);
+		/*
+		 * Reload the task pointer, it might have been changed by
+		 * a concurrent perf_event_context_sched_out().
+		 */
+		task = ctx->task;
 		goto retry;
 	}
 
-- 
1.9.1


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

* [PATCH 3.13 086/163] ASoC: samsung-i2s: Maintain CDCLK settings across i2s_{shutdown/startup}
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (84 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 085/163] perf: Fix a race condition in perf_remove_from_context() Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 087/163] ASoC: samsung-i2s: Check secondary DAI exists before referencing Kamal Mostafa
                   ` (76 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chen Zhen, Sylwester Nawrocki, Mark Brown, Kamal Mostafa

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

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

From: Sylwester Nawrocki <s.nawrocki@samsung.com>

commit b97c60abf9a561f86ae71bd741add02673cc1a08 upstream.

Currently configuration of the CDCLK pad is being overwritten in
the i2s_shutdown() callback in order to gate the SoC output clock.
However if an ASoC machine driver doesn't restore that clock
settings each time after opening the sound device this results
in the CDCLK pin being permanently configured into input mode.
I.e. the output clock will always stay disabled.
Fix that by saving the CDCLKCON bit state in i2s_shutdown() and
and restoring it in the i2s_startup() callback.

Signed-off-by: Chen Zhen <zhen1.chen@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
[ kamal: 3.13-stable prereq for
  133c268 "ASoC: samsung-i2s: Check secondary DAI exists before referencing". ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/soc/samsung/i2s.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 27ca0aa..69160f7 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -70,6 +70,8 @@ struct i2s_dai {
 #define DAI_OPENED	(1 << 0) /* Dai is opened */
 #define DAI_MANAGER	(1 << 1) /* Dai is the manager */
 	unsigned mode;
+	/* CDCLK pin direction: 0  - input, 1 - output */
+	unsigned int cdclk_out:1;
 	/* Driver for this DAI */
 	struct snd_soc_dai_driver i2s_dai_drv;
 	/* DMA parameters */
@@ -732,6 +734,9 @@ static int i2s_startup(struct snd_pcm_substream *substream,
 
 	spin_unlock_irqrestore(&lock, flags);
 
+	if (!is_opened(other) && i2s->cdclk_out)
+		i2s_set_sysclk(dai, SAMSUNG_I2S_CDCLK,
+				0, SND_SOC_CLOCK_OUT);
 	return 0;
 }
 
@@ -747,9 +752,13 @@ static void i2s_shutdown(struct snd_pcm_substream *substream,
 	i2s->mode &= ~DAI_OPENED;
 	i2s->mode &= ~DAI_MANAGER;
 
-	if (is_opened(other))
+	if (is_opened(other)) {
 		other->mode |= DAI_MANAGER;
-
+	} else {
+		u32 mod = readl(i2s->addr + I2SMOD);
+		i2s->cdclk_out = !(mod & MOD_CDCLKCON);
+		other->cdclk_out = i2s->cdclk_out;
+	}
 	/* Reset any constraint on RFS and BFS */
 	i2s->rfs = 0;
 	i2s->bfs = 0;
-- 
1.9.1


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

* [PATCH 3.13 087/163] ASoC: samsung-i2s: Check secondary DAI exists before referencing
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (85 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 086/163] ASoC: samsung-i2s: Maintain CDCLK settings across i2s_{shutdown/startup} Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 088/163] ALSA: hda - Fix invalid pin powermap without jack detection Kamal Mostafa
                   ` (75 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Charles Keepax, Mark Brown, Kamal Mostafa

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

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

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

commit 133c2681c4a0c1b589d138c2fdd0f131bdce20ed upstream.

In a couple of places the driver is missing a check to ensure there is a
secondary DAI before it de-references the pointer to it, causing a null
pointer de-reference. This patch adds a check to avoid this.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/soc/samsung/i2s.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 69160f7..81c04c5 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -460,7 +460,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
 		if (dir == SND_SOC_CLOCK_IN)
 			rfs = 0;
 
-		if ((rfs && other->rfs && (other->rfs != rfs)) ||
+		if ((rfs && other && other->rfs && (other->rfs != rfs)) ||
 				(any_active(i2s) &&
 				(((dir == SND_SOC_CLOCK_IN)
 					&& !(mod & MOD_CDCLKCON)) ||
@@ -757,7 +757,8 @@ static void i2s_shutdown(struct snd_pcm_substream *substream,
 	} else {
 		u32 mod = readl(i2s->addr + I2SMOD);
 		i2s->cdclk_out = !(mod & MOD_CDCLKCON);
-		other->cdclk_out = i2s->cdclk_out;
+		if (other)
+			other->cdclk_out = i2s->cdclk_out;
 	}
 	/* Reset any constraint on RFS and BFS */
 	i2s->rfs = 0;
-- 
1.9.1


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

* [PATCH 3.13 088/163] ALSA: hda - Fix invalid pin powermap without jack detection
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (86 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 087/163] ASoC: samsung-i2s: Check secondary DAI exists before referencing Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 089/163] Input: atkbd - do not try 'deactivate' keyboard on any LG laptops Kamal Mostafa
                   ` (74 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 7a9744cb455e6faa287e148394b4b422a6f3c5c4 upstream.

When a driver is set up without the jack detection explicitly (either
by passing a model option or via a specific fixup), the pin powermap
of IDT/STAC codecs is set up wrongly, resulting in the silence
output.  It's because of a logic failure in stac_init_power_map().
It tries to avoid creating a callback for the pins that have other
auto-hp and auto-mic callbacks, but the check is done in a wrong way
at a wrong time.  The stac_init_power_map() should be called after
creating other jack detection ctls, and the jack callback should be
created only for jack-detectable widgets.

This patch fixes the check in stac_init_power_map() and its callee
at the right place, after snd_hda_gen_build_controls().

Reported-by: Adam Richter <adam_richter2004@yahoo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/pci/hda/patch_sigmatel.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index c7b0ba6..4b62db6 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -541,8 +541,8 @@ static void stac_init_power_map(struct hda_codec *codec)
 		if (snd_hda_jack_tbl_get(codec, nid))
 			continue;
 		if (def_conf == AC_JACK_PORT_COMPLEX &&
-		    !(spec->vref_mute_led_nid == nid ||
-		      is_jack_detectable(codec, nid))) {
+		    spec->vref_mute_led_nid != nid &&
+		    is_jack_detectable(codec, nid)) {
 			snd_hda_jack_detect_enable_callback(codec, nid,
 							    STAC_PWR_EVENT,
 							    jack_update_power);
@@ -4194,11 +4194,18 @@ static int stac_parse_auto_config(struct hda_codec *codec)
 			return err;
 	}
 
-	stac_init_power_map(codec);
-
 	return 0;
 }
 
+static int stac_build_controls(struct hda_codec *codec)
+{
+	int err = snd_hda_gen_build_controls(codec);
+
+	if (err < 0)
+		return err;
+	stac_init_power_map(codec);
+	return 0;
+}
 
 static int stac_init(struct hda_codec *codec)
 {
@@ -4332,7 +4339,7 @@ static void stac_set_power_state(struct hda_codec *codec, hda_nid_t fg,
 #endif /* CONFIG_PM */
 
 static const struct hda_codec_ops stac_patch_ops = {
-	.build_controls = snd_hda_gen_build_controls,
+	.build_controls = stac_build_controls,
 	.build_pcms = snd_hda_gen_build_pcms,
 	.init = stac_init,
 	.free = stac_free,
-- 
1.9.1


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

* [PATCH 3.13 089/163] Input: atkbd - do not try 'deactivate' keyboard on any LG laptops
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (87 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 088/163] ALSA: hda - Fix invalid pin powermap without jack detection Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 090/163] Input: i8042 - add Fujitsu U574 to no_timeout dmi table Kamal Mostafa
                   ` (73 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Dmitry Torokhov, Kamal Mostafa

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

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

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

commit c01206796139e2b1feb7539bc72174fef1c6dc6e upstream.

We are getting more and more reports about LG laptops not having
functioning keyboard if we try to deactivate keyboard during probe.
Given that having keyboard deactivated is merely "nice to have"
instead of a hard requirement for probing, let's disable it on all
LG boxes instead of trying to hunt down particular models.

This change is prompted by patches trying to add "LG Electronics"/"ROCKY"
and "LG Electronics"/"LW60-F27B" to the DMI list.

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

Reported-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Reported-by: Georgios Tsalikis <georgios@tsalikis.net>
Tested-by: Jaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/input/keyboard/atkbd.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 2dd1d0d..6f5d795 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -1791,14 +1791,6 @@ static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = {
 	{
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "LW25-B7HV"),
-		},
-		.callback = atkbd_deactivate_fixup,
-	},
-	{
-		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "P1-J273B"),
 		},
 		.callback = atkbd_deactivate_fixup,
 	},
-- 
1.9.1


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

* [PATCH 3.13 090/163] Input: i8042 - add Fujitsu U574 to no_timeout dmi table
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (88 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 089/163] Input: atkbd - do not try 'deactivate' keyboard on any LG laptops Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 091/163] Input: i8042 - add nomux quirk for Avatar AVIU-145A6 Kamal Mostafa
                   ` (72 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Dmitry Torokhov, Kamal Mostafa

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

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

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

commit cc18a69c92d0972bc2fc5a047ee3be1e8398171b upstream.

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

Reported-by: Jason Robinson <mail@jasonrobinson.me>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/input/serio/i8042-x86ia64io.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 0ec9abb..dc37b32 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -601,6 +601,14 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
 		},
 	},
+	{
+		/* Fujitsu U574 laptop */
+		/* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
+		},
+	},
 	{ }
 };
 
-- 
1.9.1


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

* [PATCH 3.13 091/163] Input: i8042 - add nomux quirk for Avatar AVIU-145A6
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (89 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 090/163] Input: i8042 - add Fujitsu U574 to no_timeout dmi table Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 092/163] iio: adc: at91: don't use the last converted data register Kamal Mostafa
                   ` (71 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Dmitry Torokhov, Kamal Mostafa

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

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

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

commit d2682118f4bb3ceb835f91c1a694407a31bb7378 upstream.

The sys_vendor / product_name are somewhat generic unfortunately, so this
may lead to some false positives. But nomux usually does no harm, where as
not having it clearly is causing problems on the Avatar AVIU-145A6.

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

Reported-by: Hugo P <saurosii@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/input/serio/i8042-x86ia64io.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index dc37b32..1291673 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -458,6 +458,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
 		},
 	},
+	{
+		/* Avatar AVIU-145A6 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
+		},
+	},
 	{ }
 };
 
-- 
1.9.1


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

* [PATCH 3.13 092/163] iio: adc: at91: don't use the last converted data register
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (90 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 091/163] Input: i8042 - add nomux quirk for Avatar AVIU-145A6 Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 093/163] iio:magnetometer: bugfix magnetometers gain values Kamal Mostafa
                   ` (70 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ludovic Desroches, Jonathan Cameron, Kamal Mostafa

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

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

From: Ludovic Desroches <ludovic.desroches@atmel.com>

commit d4f51956ac8ad302db9b0c4e4232775b1baa7b44 upstream.

If touchscreen mode is enabled and a conversion is requested on another
channel, the result in the last converted data register can be a
touchscreen relative value. Starting a conversion involves to do a
conversion for all active channel. It starts with ADC channels and ends
with touchscreen channels. Then if ADC_LCD register is not read quickly,
its content may be a touchscreen conversion.
To remove this temporal constraint, the conversion value is taken from
the channel data register.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
[ kamal: backport to 3.13-stable: no _9x5_interrupt handler ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/adc/at91_adc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index e6bf77d..059946e 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -78,6 +78,7 @@ struct at91_adc_state {
 	bool			done;
 	int			irq;
 	u16			last_value;
+	int			chnb;
 	struct mutex		lock;
 	u8			num_channels;
 	void __iomem		*reg_base;
@@ -151,7 +152,7 @@ void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
 		disable_irq_nosync(irq);
 		iio_trigger_poll(idev->trig, iio_get_time_ns());
 	} else {
-		st->last_value = at91_adc_readl(st, AT91_ADC_LCDR);
+		st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb));
 		st->done = true;
 		wake_up_interruptible(&st->wq_data_avail);
 	}
@@ -230,7 +231,7 @@ static irqreturn_t at91_adc_interrupt(int irq, void *private)
 		AT91_ADC_IER_YRDY |
 		AT91_ADC_IER_PRDY;
 
-	if (status & st->registers->drdy_mask)
+	if (status & GENMASK(st->num_channels - 1, 0))
 		handle_adc_eoc_trigger(irq, idev);
 
 	if (status & AT91_ADC_IER_PEN) {
@@ -501,9 +502,10 @@ static int at91_adc_read_raw(struct iio_dev *idev,
 	case IIO_CHAN_INFO_RAW:
 		mutex_lock(&st->lock);
 
+		st->chnb = chan->channel;
 		at91_adc_writel(st, AT91_ADC_CHER,
 				AT91_ADC_CH(chan->channel));
-		at91_adc_writel(st, AT91_ADC_IER, st->registers->drdy_mask);
+		at91_adc_writel(st, AT91_ADC_IER, BIT(chan->channel));
 		at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START);
 
 		ret = wait_event_interruptible_timeout(st->wq_data_avail,
@@ -520,7 +522,7 @@ static int at91_adc_read_raw(struct iio_dev *idev,
 
 		at91_adc_writel(st, AT91_ADC_CHDR,
 				AT91_ADC_CH(chan->channel));
-		at91_adc_writel(st, AT91_ADC_IDR, st->registers->drdy_mask);
+		at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel));
 
 		st->last_value = 0;
 		st->done = false;
-- 
1.9.1


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

* [PATCH 3.13 093/163] iio:magnetometer: bugfix magnetometers gain values
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (91 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 092/163] iio: adc: at91: don't use the last converted data register Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:01 ` [PATCH 3.13 094/163] drm/i915: Fix SRC_COPY width on 830/845g Kamal Mostafa
                   ` (69 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Denis Ciocca, Jonathan Cameron, Kamal Mostafa

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

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

From: Denis CIOCCA <denis.ciocca@st.com>

commit a31d0928999fbf33b3a6042e8bcb7b7f7e07d094 upstream.

This patch fix gains values. The first driver was designed using
engineering samples, in mass production the values are changed.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/iio/magnetometer/st_magn_core.c | 52 +++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index 52bbcfa..476aa13 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -42,7 +42,8 @@
 #define ST_MAGN_FS_AVL_5600MG			5600
 #define ST_MAGN_FS_AVL_8000MG			8000
 #define ST_MAGN_FS_AVL_8100MG			8100
-#define ST_MAGN_FS_AVL_10000MG			10000
+#define ST_MAGN_FS_AVL_12000MG			12000
+#define ST_MAGN_FS_AVL_16000MG			16000
 
 /* CUSTOM VALUES FOR SENSOR 1 */
 #define ST_MAGN_1_WAI_EXP			0x3c
@@ -69,20 +70,20 @@
 #define ST_MAGN_1_FS_AVL_4700_VAL		0x05
 #define ST_MAGN_1_FS_AVL_5600_VAL		0x06
 #define ST_MAGN_1_FS_AVL_8100_VAL		0x07
-#define ST_MAGN_1_FS_AVL_1300_GAIN_XY		1100
-#define ST_MAGN_1_FS_AVL_1900_GAIN_XY		855
-#define ST_MAGN_1_FS_AVL_2500_GAIN_XY		670
-#define ST_MAGN_1_FS_AVL_4000_GAIN_XY		450
-#define ST_MAGN_1_FS_AVL_4700_GAIN_XY		400
-#define ST_MAGN_1_FS_AVL_5600_GAIN_XY		330
-#define ST_MAGN_1_FS_AVL_8100_GAIN_XY		230
-#define ST_MAGN_1_FS_AVL_1300_GAIN_Z		980
-#define ST_MAGN_1_FS_AVL_1900_GAIN_Z		760
-#define ST_MAGN_1_FS_AVL_2500_GAIN_Z		600
-#define ST_MAGN_1_FS_AVL_4000_GAIN_Z		400
-#define ST_MAGN_1_FS_AVL_4700_GAIN_Z		355
-#define ST_MAGN_1_FS_AVL_5600_GAIN_Z		295
-#define ST_MAGN_1_FS_AVL_8100_GAIN_Z		205
+#define ST_MAGN_1_FS_AVL_1300_GAIN_XY		909
+#define ST_MAGN_1_FS_AVL_1900_GAIN_XY		1169
+#define ST_MAGN_1_FS_AVL_2500_GAIN_XY		1492
+#define ST_MAGN_1_FS_AVL_4000_GAIN_XY		2222
+#define ST_MAGN_1_FS_AVL_4700_GAIN_XY		2500
+#define ST_MAGN_1_FS_AVL_5600_GAIN_XY		3030
+#define ST_MAGN_1_FS_AVL_8100_GAIN_XY		4347
+#define ST_MAGN_1_FS_AVL_1300_GAIN_Z		1020
+#define ST_MAGN_1_FS_AVL_1900_GAIN_Z		1315
+#define ST_MAGN_1_FS_AVL_2500_GAIN_Z		1666
+#define ST_MAGN_1_FS_AVL_4000_GAIN_Z		2500
+#define ST_MAGN_1_FS_AVL_4700_GAIN_Z		2816
+#define ST_MAGN_1_FS_AVL_5600_GAIN_Z		3389
+#define ST_MAGN_1_FS_AVL_8100_GAIN_Z		4878
 #define ST_MAGN_1_MULTIREAD_BIT			false
 
 /* CUSTOM VALUES FOR SENSOR 2 */
@@ -105,10 +106,12 @@
 #define ST_MAGN_2_FS_MASK			0x60
 #define ST_MAGN_2_FS_AVL_4000_VAL		0x00
 #define ST_MAGN_2_FS_AVL_8000_VAL		0x01
-#define ST_MAGN_2_FS_AVL_10000_VAL		0x02
-#define ST_MAGN_2_FS_AVL_4000_GAIN		430
-#define ST_MAGN_2_FS_AVL_8000_GAIN		230
-#define ST_MAGN_2_FS_AVL_10000_GAIN		230
+#define ST_MAGN_2_FS_AVL_12000_VAL		0x02
+#define ST_MAGN_2_FS_AVL_16000_VAL		0x03
+#define ST_MAGN_2_FS_AVL_4000_GAIN		146
+#define ST_MAGN_2_FS_AVL_8000_GAIN		292
+#define ST_MAGN_2_FS_AVL_12000_GAIN		438
+#define ST_MAGN_2_FS_AVL_16000_GAIN		584
 #define ST_MAGN_2_MULTIREAD_BIT			false
 #define ST_MAGN_2_OUT_X_L_ADDR			0x28
 #define ST_MAGN_2_OUT_Y_L_ADDR			0x2a
@@ -266,9 +269,14 @@ static const struct st_sensors st_magn_sensors[] = {
 					.gain = ST_MAGN_2_FS_AVL_8000_GAIN,
 				},
 				[2] = {
-					.num = ST_MAGN_FS_AVL_10000MG,
-					.value = ST_MAGN_2_FS_AVL_10000_VAL,
-					.gain = ST_MAGN_2_FS_AVL_10000_GAIN,
+					.num = ST_MAGN_FS_AVL_12000MG,
+					.value = ST_MAGN_2_FS_AVL_12000_VAL,
+					.gain = ST_MAGN_2_FS_AVL_12000_GAIN,
+				},
+				[3] = {
+					.num = ST_MAGN_FS_AVL_16000MG,
+					.value = ST_MAGN_2_FS_AVL_16000_VAL,
+					.gain = ST_MAGN_2_FS_AVL_16000_GAIN,
 				},
 			},
 		},
-- 
1.9.1


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

* [PATCH 3.13 094/163] drm/i915: Fix SRC_COPY width on 830/845g
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (92 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 093/163] iio:magnetometer: bugfix magnetometers gain values Kamal Mostafa
@ 2014-10-09 21:01 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 095/163] Target/iser: Get isert_conn reference once got to connected_handler Kamal Mostafa
                   ` (68 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:01 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Thomas Richter, Jani Nikula, Kamal Mostafa

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

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

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

commit 611a7a4fd8b5fb6b25ab1f8bdcde61800a7feacf upstream.

One small change I forgot to make in

commit c4d69da167fa967749aeb70bc0e94a457e5d00c1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Sep 8 14:25:41 2014 +0100

    drm/i915: Evict CS TLBs between batches

was to update the copy width for the compact BLT copy instruction.

Reported-by: Thomas Richter <thor@math.tu-berlin.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Thomas Richter <thor@math.tu-berlin.de>
Cc: Jani Nikula <jani.nikula@intel.com>
Tested-by: Thomas Richter <thor@math.tu-berlin.de>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index a4ec035..82b58dd 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1217,7 +1217,7 @@ i830_dispatch_execbuffer(struct intel_ring_buffer *ring,
 		 */
 		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, DIV_ROUND_UP(len, 4096) << 16 | 4096);
 		intel_ring_emit(ring, cs_offset);
 		intel_ring_emit(ring, 4096);
 		intel_ring_emit(ring, offset);
-- 
1.9.1


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

* [PATCH 3.13 095/163] Target/iser: Get isert_conn reference once got to connected_handler
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (93 preceding siblings ...)
  2014-10-09 21:01 ` [PATCH 3.13 094/163] drm/i915: Fix SRC_COPY width on 830/845g Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 096/163] Target/iser: Don't put isert_conn inside disconnected handler Kamal Mostafa
                   ` (67 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa

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

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

From: Sagi Grimberg <sagig@mellanox.com>

commit c2f88b17a1d97ca4ecd96cc22333a7a4f1407d39 upstream.

In case the connection didn't reach connected state, disconnected
handler will never be invoked thus the second kref_put on
isert_conn will be missing.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 5199f4e..a4210f9 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -501,7 +501,6 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 	init_completion(&isert_conn->conn_wait);
 	init_completion(&isert_conn->conn_wait_comp_err);
 	kref_init(&isert_conn->conn_kref);
-	kref_get(&isert_conn->conn_kref);
 	mutex_init(&isert_conn->conn_mutex);
 	spin_lock_init(&isert_conn->conn_lock);
 
@@ -642,7 +641,9 @@ isert_connect_release(struct isert_conn *isert_conn)
 static void
 isert_connected_handler(struct rdma_cm_id *cma_id)
 {
-	return;
+	struct isert_conn *isert_conn = cma_id->context;
+
+	kref_get(&isert_conn->conn_kref);
 }
 
 static void
-- 
1.9.1


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

* [PATCH 3.13 096/163] Target/iser: Don't put isert_conn inside disconnected handler
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (94 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 095/163] Target/iser: Get isert_conn reference once got to connected_handler Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 097/163] ARM: 8148/1: flush TLS and thumbee register state during exec Kamal Mostafa
                   ` (66 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sagi Grimberg, Nicholas Bellinger, Kamal Mostafa

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

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

From: Sagi Grimberg <sagig@mellanox.com>

commit 0fc4ea701fcf5bc51ace4e288af5be741465f776 upstream.

disconnected_handler is invoked on several CM events (such
as DISCONNECTED, DEVICE_REMOVAL, TIMEWAIT_EXIT...). Since
multiple  events can occur while before isert_free_conn is
invoked, we might put all isert_conn references and free
the connection too early.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index a4210f9..44b883f 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -695,7 +695,6 @@ isert_disconnect_work(struct work_struct *work)
 
 wake_up:
 	complete(&isert_conn->conn_wait);
-	isert_put_conn(isert_conn);
 }
 
 static void
@@ -2777,6 +2776,7 @@ static void isert_wait_conn(struct iscsi_conn *conn)
 	wait_for_completion(&isert_conn->conn_wait_comp_err);
 
 	wait_for_completion(&isert_conn->conn_wait);
+	isert_put_conn(isert_conn);
 }
 
 static void isert_free_conn(struct iscsi_conn *conn)
-- 
1.9.1


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

* [PATCH 3.13 097/163] ARM: 8148/1: flush TLS and thumbee register state during exec
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (95 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 096/163] Target/iser: Don't put isert_conn inside disconnected handler Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 098/163] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() Kamal Mostafa
                   ` (65 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nathan Lynch, Russell King, Kamal Mostafa

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

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

From: Nathan Lynch <nathan_lynch@mentor.com>

commit fbfb872f5f417cea48760c535e0ff027c88b507a upstream.

The TPIDRURO and TPIDRURW registers need to be flushed during exec;
otherwise TLS information is potentially leaked.  TPIDRURO in
particular needs careful treatment.  Since flush_thread basically
needs the same code used to set the TLS in arm_syscall, pull that into
a common set_tls helper in tls.h and use it in both places.

Similarly, TEEHBR needs to be cleared during exec as well.  Clearing
its save slot in thread_info isn't right as there is no guarantee
that a thread switch will occur before the new program runs.  Just
setting the register directly is sufficient.

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm/include/asm/tls.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++
 arch/arm/kernel/process.c  |  2 ++
 arch/arm/kernel/thumbee.c  |  2 +-
 arch/arm/kernel/traps.c    | 17 +------------
 4 files changed, 66 insertions(+), 17 deletions(-)

diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
index 83259b8..36172ad 100644
--- a/arch/arm/include/asm/tls.h
+++ b/arch/arm/include/asm/tls.h
@@ -1,6 +1,9 @@
 #ifndef __ASMARM_TLS_H
 #define __ASMARM_TLS_H
 
+#include <linux/compiler.h>
+#include <asm/thread_info.h>
+
 #ifdef __ASSEMBLY__
 #include <asm/asm-offsets.h>
 	.macro switch_tls_none, base, tp, tpuser, tmp1, tmp2
@@ -50,6 +53,47 @@
 #endif
 
 #ifndef __ASSEMBLY__
+
+static inline void set_tls(unsigned long val)
+{
+	struct thread_info *thread;
+
+	thread = current_thread_info();
+
+	thread->tp_value[0] = val;
+
+	/*
+	 * This code runs with preemption enabled and therefore must
+	 * be reentrant with respect to switch_tls.
+	 *
+	 * We need to ensure ordering between the shadow state and the
+	 * hardware state, so that we don't corrupt the hardware state
+	 * with a stale shadow state during context switch.
+	 *
+	 * If we're preempted here, switch_tls will load TPIDRURO from
+	 * thread_info upon resuming execution and the following mcr
+	 * is merely redundant.
+	 */
+	barrier();
+
+	if (!tls_emu) {
+		if (has_tls_reg) {
+			asm("mcr p15, 0, %0, c13, c0, 3"
+			    : : "r" (val));
+		} else {
+			/*
+			 * User space must never try to access this
+			 * directly.  Expect your app to break
+			 * eventually if you do so.  The user helper
+			 * at 0xffff0fe0 must be used instead.  (see
+			 * entry-armv.S for details)
+			 */
+			*((unsigned int *)0xffff0ff0) = val;
+		}
+
+	}
+}
+
 static inline unsigned long get_tpuser(void)
 {
 	unsigned long reg = 0;
@@ -59,5 +103,23 @@ static inline unsigned long get_tpuser(void)
 
 	return reg;
 }
+
+static inline void set_tpuser(unsigned long val)
+{
+	/* Since TPIDRURW is fully context-switched (unlike TPIDRURO),
+	 * we need not update thread_info.
+	 */
+	if (has_tls_reg && !tls_emu) {
+		asm("mcr p15, 0, %0, c13, c0, 2"
+		    : : "r" (val));
+	}
+}
+
+static inline void flush_tls(void)
+{
+	set_tls(0);
+	set_tpuser(0);
+}
+
 #endif
 #endif	/* __ASMARM_TLS_H */
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 92f7b15..5f6e650 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -334,6 +334,8 @@ void flush_thread(void)
 	memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
 	memset(&thread->fpstate, 0, sizeof(union fp_state));
 
+	flush_tls();
+
 	thread_notify(THREAD_NOTIFY_FLUSH, thread);
 }
 
diff --git a/arch/arm/kernel/thumbee.c b/arch/arm/kernel/thumbee.c
index 7b8403b..80f0d69 100644
--- a/arch/arm/kernel/thumbee.c
+++ b/arch/arm/kernel/thumbee.c
@@ -45,7 +45,7 @@ static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void
 
 	switch (cmd) {
 	case THREAD_NOTIFY_FLUSH:
-		thread->thumbee_state = 0;
+		teehbr_write(0);
 		break;
 	case THREAD_NOTIFY_SWITCH:
 		current_thread_info()->thumbee_state = teehbr_read();
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 4636d56..318fc36 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -578,7 +578,6 @@ do_cache_op(unsigned long start, unsigned long end, int flags)
 #define NR(x) ((__ARM_NR_##x) - __ARM_NR_BASE)
 asmlinkage int arm_syscall(int no, struct pt_regs *regs)
 {
-	struct thread_info *thread = current_thread_info();
 	siginfo_t info;
 
 	if ((no >> 16) != (__ARM_NR_BASE>> 16))
@@ -629,21 +628,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
 		return regs->ARM_r0;
 
 	case NR(set_tls):
-		thread->tp_value[0] = regs->ARM_r0;
-		if (tls_emu)
-			return 0;
-		if (has_tls_reg) {
-			asm ("mcr p15, 0, %0, c13, c0, 3"
-				: : "r" (regs->ARM_r0));
-		} else {
-			/*
-			 * User space must never try to access this directly.
-			 * Expect your app to break eventually if you do so.
-			 * The user helper at 0xffff0fe0 must be used instead.
-			 * (see entry-armv.S for details)
-			 */
-			*((unsigned int *)0xffff0ff0) = regs->ARM_r0;
-		}
+		set_tls(regs->ARM_r0);
 		return 0;
 
 #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG
-- 
1.9.1


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

* [PATCH 3.13 098/163] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (96 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 097/163] ARM: 8148/1: flush TLS and thumbee register state during exec Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 099/163] vgaarb: Don't default exclusively to first video device with mem+io Kamal Mostafa
                   ` (64 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bruno Prémont, Bjorn Helgaas, Kamal Mostafa

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

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

From: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= <bonbons@linux-vserver.org>

commit 20cde694027e7477cc532833e38ab9fcaa83fb64 upstream.

Commit b4aa0163056b ("efifb: Implement vga_default_device() (v2)") added
efifb vga_default_device() so EFI systems that do not load shadow VBIOS or
setup VGA get proper value for boot_vga PCI sysfs attribute on the
corresponding PCI device.

Xorg doesn't detect devices when boot_vga=0, e.g., on some EFI systems such
as MacBookAir2,1.  Xorg detects the GPU and finds the DRI device but then
bails out with "no devices detected".

Note: When vga_default_device() is set boot_vga PCI sysfs attribute
reflects its state.  When unset this attribute is 1 whenever
IORESOURCE_ROM_SHADOW flag is set.

With introduction of sysfb/simplefb/simpledrm efifb is getting obsolete
while having native drivers for the GPU also makes selecting sysfb/efifb
optional.

Remove the efifb implementation of vga_default_device() and initialize
vgaarb's vga_default_device() with the PCI GPU that matches boot
screen_info in pci_fixup_video().

[bhelgaas: remove unused "dev" in efifb_setup()]
Fixes: b4aa0163056b ("efifb: Implement vga_default_device() (v2)")
Tested-by: Anibal Francisco Martinez Cortina <linuxkid.zeuz@gmail.com>
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Matthew Garrett <matthew.garrett@nebula.com>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/ia64/pci/fixup.c      | 22 ++++++++++++++++++++++
 arch/x86/include/asm/vga.h |  6 ------
 arch/x86/pci/fixup.c       | 21 +++++++++++++++++++++
 drivers/video/efifb.c      | 39 ---------------------------------------
 4 files changed, 43 insertions(+), 45 deletions(-)

diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index 5dc969d..62fb9ba 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -5,6 +5,7 @@
 
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/screen_info.h>
 
 #include <asm/machvec.h>
 
@@ -38,6 +39,27 @@ static void pci_fixup_video(struct pci_dev *pdev)
 	if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
 		return;
 
+	if (!vga_default_device()) {
+		resource_size_t start, end;
+		int i;
+
+		/* Does firmware framebuffer belong to us? */
+		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+			if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
+				continue;
+
+			start = pci_resource_start(pdev, i);
+			end  = pci_resource_end(pdev, i);
+
+			if (!start || !end)
+				continue;
+
+			if (screen_info.lfb_base >= start &&
+			    (screen_info.lfb_base + screen_info.lfb_size) < end)
+				vga_set_default_device(pdev);
+		}
+	}
+
 	/* Is VGA routed to us? */
 	bus = pdev->bus;
 	while (bus) {
diff --git a/arch/x86/include/asm/vga.h b/arch/x86/include/asm/vga.h
index 44282fb..c4b9dc2 100644
--- a/arch/x86/include/asm/vga.h
+++ b/arch/x86/include/asm/vga.h
@@ -17,10 +17,4 @@
 #define vga_readb(x) (*(x))
 #define vga_writeb(x, y) (*(y) = (x))
 
-#ifdef CONFIG_FB_EFI
-#define __ARCH_HAS_VGA_DEFAULT_DEVICE
-extern struct pci_dev *vga_default_device(void);
-extern void vga_set_default_device(struct pci_dev *pdev);
-#endif
-
 #endif /* _ASM_X86_VGA_H */
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index b046e07..4ee44d4 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -325,6 +325,27 @@ static void pci_fixup_video(struct pci_dev *pdev)
 	struct pci_bus *bus;
 	u16 config;
 
+	if (!vga_default_device()) {
+		resource_size_t start, end;
+		int i;
+
+		/* Does firmware framebuffer belong to us? */
+		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+			if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
+				continue;
+
+			start = pci_resource_start(pdev, i);
+			end  = pci_resource_end(pdev, i);
+
+			if (!start || !end)
+				continue;
+
+			if (screen_info.lfb_base >= start &&
+			    (screen_info.lfb_base + screen_info.lfb_size) < end)
+				vga_set_default_device(pdev);
+		}
+	}
+
 	/* Is VGA routed to us? */
 	bus = pdev->bus;
 	while (bus) {
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index cd7c0df..201ab4f 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -19,8 +19,6 @@
 
 static bool request_mem_succeeded = false;
 
-static struct pci_dev *default_vga;
-
 static struct fb_var_screeninfo efifb_defined = {
 	.activate		= FB_ACTIVATE_NOW,
 	.height			= -1,
@@ -85,23 +83,10 @@ static struct fb_ops efifb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 };
 
-struct pci_dev *vga_default_device(void)
-{
-	return default_vga;
-}
-
-EXPORT_SYMBOL_GPL(vga_default_device);
-
-void vga_set_default_device(struct pci_dev *pdev)
-{
-	default_vga = pdev;
-}
-
 static int efifb_setup(char *options)
 {
 	char *this_opt;
 	int i;
-	struct pci_dev *dev = NULL;
 
 	if (options && *options) {
 		while ((this_opt = strsep(&options, ",")) != NULL) {
@@ -127,30 +112,6 @@ static int efifb_setup(char *options)
 		}
 	}
 
-	for_each_pci_dev(dev) {
-		int i;
-
-		if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
-			continue;
-
-		for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
-			resource_size_t start, end;
-
-			if (!(pci_resource_flags(dev, i) & IORESOURCE_MEM))
-				continue;
-
-			start = pci_resource_start(dev, i);
-			end  = pci_resource_end(dev, i);
-
-			if (!start || !end)
-				continue;
-
-			if (screen_info.lfb_base >= start &&
-			    (screen_info.lfb_base + screen_info.lfb_size) < end)
-				default_vga = dev;
-		}
-	}
-
 	return 0;
 }
 
-- 
1.9.1


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

* [PATCH 3.13 099/163] vgaarb: Don't default exclusively to first video device with mem+io
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (97 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 098/163] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 100/163] iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid Kamal Mostafa
                   ` (63 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bruno Prémont, Bjorn Helgaas, Matthew Garrett, Kamal Mostafa

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

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

From: =?UTF-8?q?Bruno=20Pr=C3=A9mont?= <bonbons@linux-vserver.org>

commit 86fd887b7fe350819dae5b55e7fef05b511c8656 upstream.

Commit 20cde694027e ("x86, ia64: Move EFI_FB vga_default_device()
initialization to pci_vga_fixup()") moved boot video device detection from
efifb to x86 and ia64 pci/fixup.c.

For dual-GPU Apple computers above change represents a regression as code
in efifb did forcefully override vga_default_device while the merge did not
(vgaarb happens prior to PCI fixup).

To improve on initial device selection by vgaarb (it cannot know if PCI
device not behind bridges see/decode legacy VGA I/O or not), move the
screen_info based check from pci_video_fixup() to vgaarb's init function and
use it to refine/override decision taken while adding the individual PCI
VGA devices.  This way PCI fixup has no reason to adjust vga_default_device
anymore but can depend on its value for flagging shadowed VBIOS.

This has the nice benefit of removing duplicated code but does introduce a
would cause compile to fail without it.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=84461
Reported-and-Tested-By: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/ia64/pci/fixup.c    | 23 +----------------------
 arch/x86/pci/fixup.c     | 25 +------------------------
 drivers/gpu/vga/vgaarb.c | 38 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 39 insertions(+), 47 deletions(-)

diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index 62fb9ba..25cf65f 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -39,27 +39,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
 	if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
 		return;
 
-	if (!vga_default_device()) {
-		resource_size_t start, end;
-		int i;
-
-		/* Does firmware framebuffer belong to us? */
-		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-			if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
-				continue;
-
-			start = pci_resource_start(pdev, i);
-			end  = pci_resource_end(pdev, i);
-
-			if (!start || !end)
-				continue;
-
-			if (screen_info.lfb_base >= start &&
-			    (screen_info.lfb_base + screen_info.lfb_size) < end)
-				vga_set_default_device(pdev);
-		}
-	}
-
 	/* Is VGA routed to us? */
 	bus = pdev->bus;
 	while (bus) {
@@ -85,7 +64,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
 	pci_read_config_word(pdev, PCI_COMMAND, &config);
 	if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
 		pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
-		dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
+		dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
 	}
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 4ee44d4..ed4de42 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -325,27 +325,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
 	struct pci_bus *bus;
 	u16 config;
 
-	if (!vga_default_device()) {
-		resource_size_t start, end;
-		int i;
-
-		/* Does firmware framebuffer belong to us? */
-		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
-			if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM))
-				continue;
-
-			start = pci_resource_start(pdev, i);
-			end  = pci_resource_end(pdev, i);
-
-			if (!start || !end)
-				continue;
-
-			if (screen_info.lfb_base >= start &&
-			    (screen_info.lfb_base + screen_info.lfb_size) < end)
-				vga_set_default_device(pdev);
-		}
-	}
-
 	/* Is VGA routed to us? */
 	bus = pdev->bus;
 	while (bus) {
@@ -371,9 +350,7 @@ static void pci_fixup_video(struct pci_dev *pdev)
 	pci_read_config_word(pdev, PCI_COMMAND, &config);
 	if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
 		pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
-		dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
-		if (!vga_default_device())
-			vga_set_default_device(pdev);
+		dev_printk(KERN_DEBUG, &pdev->dev, "Video device with shadowed ROM\n");
 	}
 }
 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index af02597..366641d 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -41,6 +41,7 @@
 #include <linux/poll.h>
 #include <linux/miscdevice.h>
 #include <linux/slab.h>
+#include <linux/screen_info.h>
 
 #include <linux/uaccess.h>
 
@@ -580,8 +581,11 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
 	 */
 #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
 	if (vga_default == NULL &&
-	    ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK))
+	    ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) {
+		pr_info("vgaarb: setting as boot device: PCI:%s\n",
+			pci_name(pdev));
 		vga_set_default_device(pdev);
+	}
 #endif
 
 	vga_arbiter_check_bridge_sharing(vgadev);
@@ -1316,6 +1320,38 @@ static int __init vga_arb_device_init(void)
 	pr_info("vgaarb: loaded\n");
 
 	list_for_each_entry(vgadev, &vga_list, list) {
+#if defined(CONFIG_X86) || defined(CONFIG_IA64)
+		/* Override I/O based detection done by vga_arbiter_add_pci_device()
+		 * as it may take the wrong device (e.g. on Apple system under EFI).
+		 *
+		 * Select the device owning the boot framebuffer if there is one.
+		 */
+		resource_size_t start, end;
+		int i;
+
+		/* Does firmware framebuffer belong to us? */
+		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+			if (!(pci_resource_flags(vgadev->pdev, i) & IORESOURCE_MEM))
+				continue;
+
+			start = pci_resource_start(vgadev->pdev, i);
+			end  = pci_resource_end(vgadev->pdev, i);
+
+			if (!start || !end)
+				continue;
+
+			if (screen_info.lfb_base < start ||
+			    (screen_info.lfb_base + screen_info.lfb_size) >= end)
+				continue;
+			if (!vga_default_device())
+				pr_info("vgaarb: setting as boot device: PCI:%s\n",
+					pci_name(vgadev->pdev));
+			else if (vgadev->pdev != vga_default_device())
+				pr_info("vgaarb: overriding boot device: PCI:%s\n",
+					pci_name(vgadev->pdev));
+			vga_set_default_device(vgadev->pdev);
+		}
+#endif
 		if (vgadev->bridge_has_one_vga)
 			pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev));
 		else
-- 
1.9.1


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

* [PATCH 3.13 100/163] iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (98 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 099/163] vgaarb: Don't default exclusively to first video device with mem+io Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 101/163] iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure Kamal Mostafa
                   ` (62 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Nicholas Bellinger, Kamal Mostafa

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

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

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

commit b53b0d99d6fbf7d44330395349a895521cfdbc96 upstream.

This patch fixes a bug in iscsit_logout_post_handler_diffcid() where
a pointer used as storage for list_for_each_entry() was incorrectly
being used to determine if no matching entry had been found.

This patch changes iscsit_logout_post_handler_diffcid() to key off
bool conn_found to determine if the function needs to exit early.

Reported-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/target/iscsi/iscsi_target.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 6c727b9..bc45c3a 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4512,6 +4512,7 @@ static void iscsit_logout_post_handler_diffcid(
 {
 	struct iscsi_conn *l_conn;
 	struct iscsi_session *sess = conn->sess;
+	bool conn_found = false;
 
 	if (!sess)
 		return;
@@ -4520,12 +4521,13 @@ static void iscsit_logout_post_handler_diffcid(
 	list_for_each_entry(l_conn, &sess->sess_conn_list, conn_list) {
 		if (l_conn->cid == cid) {
 			iscsit_inc_conn_usage_count(l_conn);
+			conn_found = true;
 			break;
 		}
 	}
 	spin_unlock_bh(&sess->conn_lock);
 
-	if (!l_conn)
+	if (!conn_found)
 		return;
 
 	if (l_conn->sock)
-- 
1.9.1


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

* [PATCH 3.13 101/163] iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (99 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 100/163] iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 102/163] NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists() Kamal Mostafa
                   ` (61 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joern Engel, Nicholas Bellinger, Kamal Mostafa

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

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

From: Joern Engel <joern@logfs.org>

commit 8ae757d09c45102b347a1bc2867f54ffc1ab8fda upstream.

In iscsi_copy_param_list() a failed iscsi_param_list memory allocation
currently invokes iscsi_release_param_list() to cleanup, and will promptly
trigger a NULL pointer dereference.

Instead, go ahead and return for the first iscsi_copy_param_list()
failure case.

Found by coverity.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/target/iscsi/iscsi_target_parameters.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c
index 4d2e23f..43b7e6a 100644
--- a/drivers/target/iscsi/iscsi_target_parameters.c
+++ b/drivers/target/iscsi/iscsi_target_parameters.c
@@ -601,7 +601,7 @@ int iscsi_copy_param_list(
 	param_list = kzalloc(sizeof(struct iscsi_param_list), GFP_KERNEL);
 	if (!param_list) {
 		pr_err("Unable to allocate memory for struct iscsi_param_list.\n");
-		goto err_out;
+		return -1;
 	}
 	INIT_LIST_HEAD(&param_list->param_list);
 	INIT_LIST_HEAD(&param_list->extra_response_list);
-- 
1.9.1


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

* [PATCH 3.13 102/163] NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (100 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 101/163] iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 103/163] NFSv4: Fix another bug in the close/open_downgrade code Kamal Mostafa
                   ` (60 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Steve Dickson, Trond Myklebust, Kamal Mostafa

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

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

From: Steve Dickson <steved@redhat.com>

commit 080af20cc945d110f9912d01cf6b66f94a375b8d upstream.

There is a race between nfs4_state_manager() and
nfs_server_remove_lists() that happens during a nfsv3 mount.

The v3 mount notices there is already a supper block so
nfs_server_remove_lists() called which uses the nfs_client_lock
spin lock to synchronize access to the client list.

At the same time nfs4_state_manager() is running through
the client list looking for work to do, using the same
lock. When nfs4_state_manager() wins the race to the
list, a v3 client pointer is found and not ignored
properly which causes the panic.

Moving some protocol checks before the state checking
avoids the panic.

Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/nfs/nfs4client.c | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 4c7bd2c..af6013c 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -485,6 +485,16 @@ int nfs40_walk_client_list(struct nfs_client *new,
 
 	spin_lock(&nn->nfs_client_lock);
 	list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
+
+		if (pos->rpc_ops != new->rpc_ops)
+			continue;
+
+		if (pos->cl_proto != new->cl_proto)
+			continue;
+
+		if (pos->cl_minorversion != new->cl_minorversion)
+			continue;
+
 		/* If "pos" isn't marked ready, we can't trust the
 		 * remaining fields in "pos" */
 		if (pos->cl_cons_state > NFS_CS_READY) {
@@ -504,15 +514,6 @@ int nfs40_walk_client_list(struct nfs_client *new,
 		if (pos->cl_cons_state != NFS_CS_READY)
 			continue;
 
-		if (pos->rpc_ops != new->rpc_ops)
-			continue;
-
-		if (pos->cl_proto != new->cl_proto)
-			continue;
-
-		if (pos->cl_minorversion != new->cl_minorversion)
-			continue;
-
 		if (pos->cl_clientid != new->cl_clientid)
 			continue;
 
@@ -618,6 +619,16 @@ int nfs41_walk_client_list(struct nfs_client *new,
 
 	spin_lock(&nn->nfs_client_lock);
 	list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
+
+		if (pos->rpc_ops != new->rpc_ops)
+			continue;
+
+		if (pos->cl_proto != new->cl_proto)
+			continue;
+
+		if (pos->cl_minorversion != new->cl_minorversion)
+			continue;
+
 		/* If "pos" isn't marked ready, we can't trust the
 		 * remaining fields in "pos", especially the client
 		 * ID and serverowner fields.  Wait for CREATE_SESSION
@@ -643,15 +654,6 @@ int nfs41_walk_client_list(struct nfs_client *new,
 		if (pos->cl_cons_state != NFS_CS_READY)
 			continue;
 
-		if (pos->rpc_ops != new->rpc_ops)
-			continue;
-
-		if (pos->cl_proto != new->cl_proto)
-			continue;
-
-		if (pos->cl_minorversion != new->cl_minorversion)
-			continue;
-
 		if (!nfs4_match_clientids(pos, new))
 			continue;
 
-- 
1.9.1


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

* [PATCH 3.13 103/163] NFSv4: Fix another bug in the close/open_downgrade code
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (101 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 102/163] NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists() Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 104/163] drm/radeon: don't reset dma on NI/SI init Kamal Mostafa
                   ` (59 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Trond Myklebust, Kamal Mostafa

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

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

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

commit cd9288ffaea4359d5cfe2b8d264911506aed26a4 upstream.

James Drew reports another bug whereby the NFS client is now sending
an OPEN_DOWNGRADE in a situation where it should really have sent a
CLOSE: the client is opening the file for O_RDWR, but then trying to
do a downgrade to O_RDONLY, which is not allowed by the NFSv4 spec.

Reported-by: James Drews <drews@engr.wisc.edu>
Link: http://lkml.kernel.org/r/541AD7E5.8020409@engr.wisc.edu
Fixes: aee7af356e15 (NFSv4: Fix problems with close in the presence...)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/nfs/nfs4proc.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 663ab1d..b6ed520 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2557,23 +2557,23 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
 	is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags);
 	is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags);
 	is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags);
-	/* Calculate the current open share mode */
-	calldata->arg.fmode = 0;
-	if (is_rdonly || is_rdwr)
-		calldata->arg.fmode |= FMODE_READ;
-	if (is_wronly || is_rdwr)
-		calldata->arg.fmode |= FMODE_WRITE;
 	/* Calculate the change in open mode */
+	calldata->arg.fmode = 0;
 	if (state->n_rdwr == 0) {
-		if (state->n_rdonly == 0) {
-			call_close |= is_rdonly || is_rdwr;
-			calldata->arg.fmode &= ~FMODE_READ;
-		}
-		if (state->n_wronly == 0) {
-			call_close |= is_wronly || is_rdwr;
-			calldata->arg.fmode &= ~FMODE_WRITE;
-		}
-	}
+		if (state->n_rdonly == 0)
+			call_close |= is_rdonly;
+		else if (is_rdonly)
+			calldata->arg.fmode |= FMODE_READ;
+		if (state->n_wronly == 0)
+			call_close |= is_wronly;
+		else if (is_wronly)
+			calldata->arg.fmode |= FMODE_WRITE;
+	} else if (is_rdwr)
+		calldata->arg.fmode |= FMODE_READ|FMODE_WRITE;
+
+	if (calldata->arg.fmode == 0)
+		call_close |= is_rdwr;
+
 	if (!nfs4_valid_open_stateid(state))
 		call_close = 0;
 	spin_unlock(&state->owner->so_lock);
-- 
1.9.1


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

* [PATCH 3.13 104/163] drm/radeon: don't reset dma on NI/SI init
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (102 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 103/163] NFSv4: Fix another bug in the close/open_downgrade code Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 105/163] drm/radeon: don't reset sdma on CIK init Kamal Mostafa
                   ` (58 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

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

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

commit 31a25e2caf9367365fcb0e57fd8fa5a42e9b73e4 upstream.

Otherwise we may lose the DMA golden settings which can
lead to hangs, etc.

bug:
https://www.libreoffice.org/bugzilla/show_bug.cgi?id=83500

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/ni_dma.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni_dma.c b/drivers/gpu/drm/radeon/ni_dma.c
index bdeb65e..ddc946b 100644
--- a/drivers/gpu/drm/radeon/ni_dma.c
+++ b/drivers/gpu/drm/radeon/ni_dma.c
@@ -120,12 +120,6 @@ int cayman_dma_resume(struct radeon_device *rdev)
 	u32 reg_offset, wb_offset;
 	int i, r;
 
-	/* Reset dma */
-	WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA | SOFT_RESET_DMA1);
-	RREG32(SRBM_SOFT_RESET);
-	udelay(50);
-	WREG32(SRBM_SOFT_RESET, 0);
-
 	for (i = 0; i < 2; i++) {
 		if (i == 0) {
 			ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX];
-- 
1.9.1


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

* [PATCH 3.13 105/163] drm/radeon: don't reset sdma on CIK init
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (103 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 104/163] drm/radeon: don't reset dma on NI/SI init Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 106/163] drm/radeon: don't reset dma on r6xx-evergreen init Kamal Mostafa
                   ` (57 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

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

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

commit 799028d5d85384cce140323be633c8d5f079193f upstream.

Otherwise we may lose the DMA golden settings which can
lead to hangs, etc.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/cik_sdma.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c
index d528dcf..9fd95c7 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -388,13 +388,6 @@ int cik_sdma_resume(struct radeon_device *rdev)
 {
 	int r;
 
-	/* Reset dma */
-	WREG32(SRBM_SOFT_RESET, SOFT_RESET_SDMA | SOFT_RESET_SDMA1);
-	RREG32(SRBM_SOFT_RESET);
-	udelay(50);
-	WREG32(SRBM_SOFT_RESET, 0);
-	RREG32(SRBM_SOFT_RESET);
-
 	r = cik_sdma_load_microcode(rdev);
 	if (r)
 		return r;
-- 
1.9.1


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

* [PATCH 3.13 106/163] drm/radeon: don't reset dma on r6xx-evergreen init
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (104 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 105/163] drm/radeon: don't reset sdma on CIK init Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 107/163] vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops Kamal Mostafa
                   ` (56 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

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

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

commit c1789a2e66a4209fe5035eca11fdd729b2ffdd82 upstream.

Otherwise we may lose the DMA golden settings which can
lead to hangs, etc.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/r600_dma.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_dma.c b/drivers/gpu/drm/radeon/r600_dma.c
index 7844d15..616d37a 100644
--- a/drivers/gpu/drm/radeon/r600_dma.c
+++ b/drivers/gpu/drm/radeon/r600_dma.c
@@ -116,15 +116,6 @@ int r600_dma_resume(struct radeon_device *rdev)
 	u32 rb_bufsz;
 	int r;
 
-	/* Reset dma */
-	if (rdev->family >= CHIP_RV770)
-		WREG32(SRBM_SOFT_RESET, RV770_SOFT_RESET_DMA);
-	else
-		WREG32(SRBM_SOFT_RESET, SOFT_RESET_DMA);
-	RREG32(SRBM_SOFT_RESET);
-	udelay(50);
-	WREG32(SRBM_SOFT_RESET, 0);
-
 	WREG32(DMA_SEM_INCOMPLETE_TIMER_CNTL, 0);
 	WREG32(DMA_SEM_WAIT_FAIL_TIMER_CNTL, 0);
 
-- 
1.9.1


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

* [PATCH 3.13 107/163] vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (105 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 106/163] drm/radeon: don't reset dma on r6xx-evergreen init Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 108/163] drm/radeon/px: fix module unload Kamal Mostafa
                   ` (55 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alex Deucher, Pali Rohár, Ben Skeggs, Kamal Mostafa

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

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

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

commit 766a53d059d1500c9755c8af017bd411bd8f1b20 upstream.

Drivers should call this on unload to unregister pmops.

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

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 6 ++++++
 include/linux/vga_switcheroo.h   | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 6866448..37ac7b5 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -660,6 +660,12 @@ int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *
 }
 EXPORT_SYMBOL(vga_switcheroo_init_domain_pm_ops);
 
+void vga_switcheroo_fini_domain_pm_ops(struct device *dev)
+{
+	dev->pm_domain = NULL;
+}
+EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops);
+
 static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index 502073a..b483abd 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -64,6 +64,7 @@ int vga_switcheroo_get_client_state(struct pci_dev *dev);
 void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic);
 
 int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
+void vga_switcheroo_fini_domain_pm_ops(struct device *dev);
 int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain);
 #else
 
@@ -82,6 +83,7 @@ static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return
 static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {}
 
 static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
+static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {}
 static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
 
 #endif
-- 
1.9.1


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

* [PATCH 3.13 108/163] drm/radeon/px: fix module unload
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (106 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 107/163] vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 109/163] drm/nouveau/runpm: " Kamal Mostafa
                   ` (54 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alex Deucher, Pali Rohár, Ben Skeggs, Kamal Mostafa

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

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

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

commit 2e97140dd58cab8772bf77d73eabda213e45202d upstream.

Use the new vga_switcheroo_fini_domain_pm_ops function
to unregister the pm ops.

Based on a patch from:
Pali Rohár <pali.rohar@gmail.com>

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

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_device.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 716293c..974f710 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1309,7 +1309,7 @@ int radeon_device_init(struct radeon_device *rdev,
 
 	r = radeon_init(rdev);
 	if (r)
-		return r;
+		goto failed;
 
 	r = radeon_ib_ring_tests(rdev);
 	if (r)
@@ -1329,7 +1329,7 @@ int radeon_device_init(struct radeon_device *rdev,
 		radeon_agp_disable(rdev);
 		r = radeon_init(rdev);
 		if (r)
-			return r;
+			goto failed;
 	}
 	if ((radeon_testing & 1)) {
 		if (rdev->accel_working)
@@ -1350,6 +1350,11 @@ int radeon_device_init(struct radeon_device *rdev,
 			DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n");
 	}
 	return 0;
+
+failed:
+	if (runtime)
+		vga_switcheroo_fini_domain_pm_ops(rdev->dev);
+	return r;
 }
 
 static void radeon_debugfs_remove_files(struct radeon_device *rdev);
@@ -1370,6 +1375,8 @@ void radeon_device_fini(struct radeon_device *rdev)
 	radeon_bo_evict_vram(rdev);
 	radeon_fini(rdev);
 	vga_switcheroo_unregister_client(rdev->pdev);
+	if (rdev->flags & RADEON_IS_PX)
+		vga_switcheroo_fini_domain_pm_ops(rdev->dev);
 	vga_client_register(rdev->pdev, NULL, NULL, NULL);
 	if (rdev->rio_mem)
 		pci_iounmap(rdev->pdev, rdev->rio_mem);
-- 
1.9.1


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

* [PATCH 3.13 109/163] drm/nouveau/runpm: fix module unload
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (107 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 108/163] drm/radeon/px: fix module unload Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 110/163] [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu Kamal Mostafa
                   ` (53 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Ben Skeggs, Kamal Mostafa

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

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

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

commit 53beaa01e0fe8e4202f43485a03b32fcf5dfea74 upstream.

Use the new vga_switcheroo_fini_domain_pm_ops function
to unregister the pm ops.

Based on a patch from:
Pali Rohár <pali.rohar@gmail.com>

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

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/nouveau/nouveau_vga.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index 81638d7..13790ea 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -98,7 +98,16 @@ void
 nouveau_vga_fini(struct nouveau_drm *drm)
 {
 	struct drm_device *dev = drm->dev;
+	bool runtime = false;
+
+	if (nouveau_runtime_pm == 1)
+		runtime = true;
+	if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm()))
+		runtime = true;
+
 	vga_switcheroo_unregister_client(dev->pdev);
+	if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
+		vga_switcheroo_fini_domain_pm_ops(drm->dev->dev);
 	vga_client_register(dev->pdev, NULL, NULL, NULL);
 }
 
-- 
1.9.1


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

* [PATCH 3.13 110/163] [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (108 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 109/163] drm/nouveau/runpm: " Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 111/163] USB: EHCI: unlink QHs even after the controller has stopped Kamal Mostafa
                   ` (52 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mike Christie, Christoph Hellwig, James Bottomley, Kamal Mostafa

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

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

From: Mike Christie <michaelc@cs.wisc.edu>

commit db9bfd64b14a3a8f1868d2164518fdeab1b26ad1 upstream.

This patches fixes a potential buffer overrun in __iscsi_conn_send_pdu.
This function is used by iscsi drivers and userspace to send iscsi PDUs/
commands. For login commands, we have a set buffer size. For all other
commands we do not support data buffers.

This was reported by Dan Carpenter here:
http://www.spinics.net/lists/linux-scsi/msg66838.html

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/scsi/libiscsi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index e399561..b69b233 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -717,11 +717,21 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
 			return NULL;
 		}
 
+		if (data_size > ISCSI_DEF_MAX_RECV_SEG_LEN) {
+			iscsi_conn_printk(KERN_ERR, conn, "Invalid buffer len of %u for login task. Max len is %u\n", data_size, ISCSI_DEF_MAX_RECV_SEG_LEN);
+			return NULL;
+		}
+
 		task = conn->login_task;
 	} else {
 		if (session->state != ISCSI_STATE_LOGGED_IN)
 			return NULL;
 
+		if (data_size != 0) {
+			iscsi_conn_printk(KERN_ERR, conn, "Can not send data buffer of len %u for op 0x%x\n", data_size, opcode);
+			return NULL;
+		}
+
 		BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
 		BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
 
-- 
1.9.1


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

* [PATCH 3.13 111/163] USB: EHCI: unlink QHs even after the controller has stopped
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (109 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 110/163] [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 112/163] USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter Kamal Mostafa
                   ` (51 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, Greg Kroah-Hartman, Kamal Mostafa

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

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

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

commit 7312b5ddd47fee2356baa78c5516ef8e04eed452 upstream.

Old code in ehci-hcd tries to expedite disabling endpoints after the
controller has stopped, by destroying the endpoint's associated QH
without first unlinking the QH.  This was necessary back when the
driver wasn't so careful about keeping track of the controller's
state.

But now we are careful about it, and the driver knows that when the
controller isn't running, no unlinking delay is needed.  Furthermore,
skipping the unlink step will trigger a BUG() in qh_destroy() when the
preceding QH is released, because the link pointer will be non-NULL.

Removing the lines that skip the unlinking step and go directly to
QH_STATE_IDLE fixes the problem.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Joe Lawrence <joe.lawrence@stratus.com>
Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/host/ehci-hcd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 4dfd6fb..86e6d39 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -973,8 +973,6 @@ rescan:
 	}
 
 	qh->exception = 1;
-	if (ehci->rh_state < EHCI_RH_RUNNING)
-		qh->qh_state = QH_STATE_IDLE;
 	switch (qh->qh_state) {
 	case QH_STATE_LINKED:
 		WARN_ON(!list_empty(&qh->qtd_list));
-- 
1.9.1


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

* [PATCH 3.13 112/163] USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (110 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 111/163] USB: EHCI: unlink QHs even after the controller has stopped Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 113/163] USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter Kamal Mostafa
                   ` (50 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Knibbs, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Mark <markk@clara.co.uk>

commit 67d365a57a51fb9dece6a5ceb504aa381cae1e5b upstream.

The Adaptec USBConnect 2000 is another SCSI-USB converter which uses
Shuttle Technology/SCM Microsystems chips. The US_FL_SCM_MULT_TARG quirk is
required to use SCSI devices with ID other than 0.

I don't have a USBConnect 2000, but based on the other entries for Shuttle/
SCM-based converters this patch is very likely correct. I used 0x0000 and
0x9999 for bcdDeviceMin and bcdDeviceMax because I'm not sure which
bcdDevice value the product uses.

Signed-off-by: Mark Knibbs <markk@clara.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/storage/unusual_devs.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index d168f51..e0fdb52 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -101,6 +101,12 @@ UNUSUAL_DEV(  0x03f0, 0x4002, 0x0001, 0x0001,
 		"PhotoSmart R707",
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY),
 
+UNUSUAL_DEV(  0x03f3, 0x0001, 0x0000, 0x9999,
+		"Adaptec",
+		"USBConnect 2000",
+		USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+		US_FL_SCM_MULT_TARG ),
+
 /* Reported by Sebastian Kapfer <sebastian_kapfer@gmx.net>
  * and Olaf Hering <olh@suse.de> (different bcd's, same vendor/product)
  * for USB floppies that need the SINGLE_LUN enforcement.
-- 
1.9.1


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

* [PATCH 3.13 113/163] USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (111 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 112/163] USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 114/163] USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters Kamal Mostafa
                   ` (49 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Knibbs, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Mark <markk@clara.co.uk>

commit b6a3ed677991558ce09046397a7c4d70530d15b3 upstream.

Hi,

The Ariston Technologies iConnect 025 and iConnect 050 (also known as e.g.
iSCSI-50) are SCSI-USB converters which use Shuttle Technology/SCM
Microsystems chips. Only the connectors differ; both have the same USB ID.
The US_FL_SCM_MULT_TARG quirk is required to use SCSI devices with ID other
than 0.

I don't have one of these, but based on the other entries for Shuttle/
SCM-based converters this patch is very likely correct. I used 0x0000 and
0x9999 for bcdDeviceMin and bcdDeviceMax because I'm not sure which
bcdDevice value the products use.

Signed-off-by: Mark Knibbs <markk@clara.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/storage/unusual_devs.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index e0fdb52..49d14dc 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1986,6 +1986,12 @@ UNUSUAL_DEV(  0x177f, 0x0400, 0x0000, 0x0000,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ),
 
+UNUSUAL_DEV(  0x1822, 0x0001, 0x0000, 0x9999,
+		"Ariston Technologies",
+		"iConnect USB to SCSI adapter",
+		USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+		US_FL_SCM_MULT_TARG ),
+
 /* Reported by Hans de Goede <hdegoede@redhat.com>
  * These Appotech controllers are found in Picture Frames, they provide a
  * (buggy) emulation of a cdrom drive which contains the windows software
-- 
1.9.1


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

* [PATCH 3.13 114/163] USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (112 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 113/163] USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 115/163] drm/nouveau: ltc/gf100-: fix cbc issues on certain boards Kamal Mostafa
                   ` (48 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mark Knibbs, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Mark <markk@clara.co.uk>

commit c80b4495c61636edc58fe1ce300f09f24db28e10 upstream.

This patch adds quirks for Entrega Technologies (later Xircom PortGear) USB-
SCSI converters. They use Shuttle Technology EUSB-01/EUSB-S1 chips. The
US_FL_SCM_MULT_TARG quirk is needed to allow multiple devices on the SCSI
chain to be accessed. Without it only the (single) device with SCSI ID 0
can be used.

The standalone converter sold by Entrega had model number U1-SC25. Xircom
acquired Entrega and re-branded the product line PortGear. The PortGear USB
to SCSI Converter (model PGSCSI) is internally identical to the Entrega
product, but later models may use a different USB ID. The Entrega-branded
units have USB ID 1645:0007, as does my Xircom PGSCSI, but the Windows and
Macintosh drivers also support 085A:0028.

Entrega also sold the "Mac USB Dock", which provides two USB ports, a Mac
(8-pin mini-DIN) serial port and a SCSI port. It appears to the computer as
a four-port hub, USB-serial, and USB-SCSI converters. The USB-SCSI part may
have initially used the same ID as the standalone U1-SC25 (1645:0007), but
later production used 085A:0026.

My Xircom PortGear PGSCSI has bcdDevice=0x0100. Units with bcdDevice=0x0133
probably also exist.

This patch adds quirks for 1645:0007, 085A:0026 and 085A:0028. The Windows
driver INF file also mentions 085A:0032 "PortStation SCSI Module", but I
couldn't find any mention of that actually existing in the wild; perhaps it
was cancelled before release?

Signed-off-by: Mark Knibbs <markk@clara.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/storage/unusual_devs.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 49d14dc..c1258d9 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1125,6 +1125,18 @@ UNUSUAL_DEV(  0x0851, 0x1543, 0x0200, 0x0200,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_NOT_LOCKABLE),
 
+UNUSUAL_DEV(  0x085a, 0x0026, 0x0100, 0x0133,
+		"Xircom",
+		"PortGear USB-SCSI (Mac USB Dock)",
+		USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+		US_FL_SCM_MULT_TARG ),
+
+UNUSUAL_DEV(  0x085a, 0x0028, 0x0100, 0x0133,
+		"Xircom",
+		"PortGear USB to SCSI Converter",
+		USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+		US_FL_SCM_MULT_TARG ),
+
 /* Submitted by Jan De Luyck <lkml@kcore.org> */
 UNUSUAL_DEV(  0x08bd, 0x1100, 0x0000, 0x0000,
 		"CITIZEN",
@@ -1964,6 +1976,14 @@ UNUSUAL_DEV(  0x152d, 0x2329, 0x0100, 0x0100,
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_IGNORE_RESIDUE | US_FL_SANE_SENSE ),
 
+/* Entrega Technologies U1-SC25 (later Xircom PortGear PGSCSI)
+ * and Mac USB Dock USB-SCSI */
+UNUSUAL_DEV(  0x1645, 0x0007, 0x0100, 0x0133,
+		"Entrega Technologies",
+		"USB to SCSI Converter",
+		USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init,
+		US_FL_SCM_MULT_TARG ),
+
 /* Reported by Robert Schedel <r.schedel@yahoo.de>
  * Note: this is a 'super top' device like the above 14cd/6600 device */
 UNUSUAL_DEV(  0x1652, 0x6600, 0x0201, 0x0201,
-- 
1.9.1


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

* [PATCH 3.13 115/163] drm/nouveau: ltc/gf100-: fix cbc issues on certain boards
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (113 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 114/163] USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 116/163] bnx2x: Fix link for KR with swapped polarity lane Kamal Mostafa
                   ` (47 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Ben Skeggs, Dave Airlie, Kamal Mostafa

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

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

From: Ben Skeggs <bskeggs@redhat.com>

commit fe3d9c4b87bb98222a502cc585844a0b950786fb upstream.

A mismatch between FB and LTC's idea of how big a large page is causes
issues such as black "holes" in rendering to occur on some boards
(those where LTC is configured for 64KiB large pages) when compression
is used.

Confirmed to fix at least the GK107 MBP.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
[ kamal: backport to 3.13-stable: subdev/ltc/ not present in 3.13 ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c | 1 -
 drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c  | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
index b2ec741..65c00d2 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
@@ -198,7 +198,6 @@ nvc0_bar_init(struct nouveau_object *object)
 
 	nv_mask(priv, 0x000200, 0x00000100, 0x00000000);
 	nv_mask(priv, 0x000200, 0x00000100, 0x00000100);
-	nv_mask(priv, 0x100c80, 0x00000001, 0x00000000);
 
 	nv_wr32(priv, 0x001704, 0x80000000 | priv->bar[1].mem->addr >> 12);
 	nv_wr32(priv, 0x001714, 0xc0000000 | priv->bar[0].mem->addr >> 12);
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
index e5fc37c..ebe1aa6 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
@@ -45,6 +45,7 @@ nvc0_fb_init(struct nouveau_object *object)
 
 	if (priv->r100c10_page)
 		nv_wr32(priv, 0x100c10, priv->r100c10 >> 8);
+	nv_mask(priv, 0x100c80, 0x00000001, 0x00000000); /* 128KiB lpg */
 	return 0;
 }
 
-- 
1.9.1


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

* [PATCH 3.13 116/163] bnx2x: Fix link for KR with swapped polarity lane
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (114 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 115/163] drm/nouveau: ltc/gf100-: fix cbc issues on certain boards Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 117/163] iwlwifi: increase DEFAULT_MAX_TX_POWER Kamal Mostafa
                   ` (46 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yaniv Rosner, Yuval Mintz, Ariel Elior, David S. Miller,
	Leann Ogasawara, Brad Figg, Kamal Mostafa

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

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

From: Yaniv Rosner <yaniv.rosner@qlogic.com>

commit dad91ee478c7f39e04a33272732147b8c274bb58 upstream.

This avoids clearing the RX polarity setting in KR mode when polarity lane
is swapped, as otherwise this will result in failed link.

Signed-off-by: Yaniv Rosner <yaniv.rosner@qlogic.com>
Signed-off-by: Yuval Mintz <yuval.mintz@qlogic.com>
Signed-off-by: Ariel Elior <ariel.elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Leann Ogasawara <leann.ogasawara@canonical.com>
Cc: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 25 ++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 11fc795..26bb478 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -3749,7 +3749,8 @@ static void bnx2x_warpcore_restart_AN_KR(struct bnx2x_phy *phy,
 static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
 					struct link_params *params,
 					struct link_vars *vars) {
-	u16 lane, i, cl72_ctrl, an_adv = 0;
+	u16 lane, i, cl72_ctrl, an_adv = 0, val;
+	u32 wc_lane_config;
 	struct bnx2x *bp = params->bp;
 	static struct bnx2x_reg_set reg_set[] = {
 		{MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7},
@@ -3868,15 +3869,27 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
 		/* Enable Auto-Detect to support 1G over CL37 as well */
 		bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
 				 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10);
-
+		wc_lane_config = REG_RD(bp, params->shmem_base +
+					offsetof(struct shmem_region, dev_info.
+					shared_hw_config.wc_lane_config));
+		bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
+				MDIO_WC_REG_RX0_PCI_CTRL + (lane << 4), &val);
 		/* Force cl48 sync_status LOW to avoid getting stuck in CL73
 		 * parallel-detect loop when CL73 and CL37 are enabled.
 		 */
-		CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
-				  MDIO_AER_BLOCK_AER_REG, 0);
+		val |= 1 << 11;
+
+		/* Restore Polarity settings in case it was run over by
+		 * previous link owner
+		 */
+		if (wc_lane_config &
+		    (SHARED_HW_CFG_RX_LANE0_POL_FLIP_ENABLED << lane))
+			val |= 3 << 2;
+		else
+			val &= ~(3 << 2);
 		bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
-				 MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI, 0x0800);
-		bnx2x_set_aer_mmd(params, phy);
+				 MDIO_WC_REG_RX0_PCI_CTRL + (lane << 4),
+				 val);
 
 		bnx2x_disable_kr2(params, vars, phy);
 	}
-- 
1.9.1


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

* [PATCH 3.13 117/163] iwlwifi: increase DEFAULT_MAX_TX_POWER
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (115 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 116/163] bnx2x: Fix link for KR with swapped polarity lane Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 118/163] iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate Kamal Mostafa
                   ` (45 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eliad Peller, Emmanuel Grumbach, Kamal Mostafa

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

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

From: Eliad Peller <eliad@wizery.com>

commit 22d059a5c7c5de61e53c88e30b65e55fbfd91e91 upstream.

The chip is able to transmit up to 22dBm, so set
the constant appropriately.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/wireless/iwlwifi/iwl-config.h    | 2 ++
 drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h
index 03fd9aa..5e2d76f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/iwlwifi/iwl-config.h
@@ -119,6 +119,8 @@ enum iwl_led_mode {
 #define IWL_LONG_WD_TIMEOUT	10000
 #define IWL_MAX_WD_TIMEOUT	120000
 
+#define IWL_DEFAULT_MAX_TX_POWER 22
+
 /* Antenna presence definitions */
 #define	ANT_NONE	0x0
 #define	ANT_A		BIT(0)
diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
index 4a1cf13..6dac0f6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
@@ -118,8 +118,6 @@ static const u8 iwl_nvm_channels[] = {
 #define LAST_2GHZ_HT_PLUS	9
 #define LAST_5GHZ_HT		161
 
-#define DEFAULT_MAX_TX_POWER 16
-
 /* rate data (static) */
 static struct ieee80211_rate iwl_cfg80211_rates[] = {
 	{ .bitrate = 1 * 10, .hw_value = 0, .hw_value_short = 0, },
@@ -242,7 +240,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
 		 * Default value - highest tx power value.  max_power
 		 * is not used in mvm, and is used for backwards compatibility
 		 */
-		channel->max_power = DEFAULT_MAX_TX_POWER;
+		channel->max_power = IWL_DEFAULT_MAX_TX_POWER;
 		is_5ghz = channel->band == IEEE80211_BAND_5GHZ;
 		IWL_DEBUG_EEPROM(dev,
 				 "Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x %ddBm): Ad-Hoc %ssupported\n",
-- 
1.9.1


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

* [PATCH 3.13 118/163] iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (116 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 117/163] iwlwifi: increase DEFAULT_MAX_TX_POWER Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 119/163] workqueue: apply __WQ_ORDERED to create_singlethread_workqueue() Kamal Mostafa
                   ` (44 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eyal Shapira, Emmanuel Grumbach, Kamal Mostafa

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

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

From: Eyal Shapira <eyal@wizery.com>

commit aa11bbf3df026d6b1c6b528bef634fd9de7c2619 upstream.

Using the LQ table which is initially set according to
the rssi could lead to EAPOLs being sent in high legacy
rates like 54mbps.
It's better to avoid sending EAPOLs in high rates as it reduces
the chances of a successful 4-Way handshake.
Avoid this and treat them like other mgmt frames which would
initially get sent at the basic rate.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/wireless/iwlwifi/mvm/tx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
index c8f6974..edf9f7b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -173,10 +173,14 @@ static void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm,
 
 	/*
 	 * for data packets, rate info comes from the table inside the fw. This
-	 * table is controlled by LINK_QUALITY commands
+	 * table is controlled by LINK_QUALITY commands. Exclude ctrl port
+	 * frames like EAPOLs which should be treated as mgmt frames. This
+	 * avoids them being sent initially in high rates which increases the
+	 * chances for completion of the 4-Way handshake.
 	 */
 
-	if (ieee80211_is_data(fc) && sta) {
+	if (ieee80211_is_data(fc) && sta &&
+	    !(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO)) {
 		tx_cmd->initial_rate_index = 0;
 		tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE);
 		return;
-- 
1.9.1


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

* [PATCH 3.13 119/163] workqueue: apply __WQ_ORDERED to create_singlethread_workqueue()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (117 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 118/163] iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 120/163] can: flexcan: mark TX mailbox as TX_INACTIVE Kamal Mostafa
                   ` (43 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tejun Heo, Oleg Nesterov, Gustavo Luiz Duarte, Tomas Henzl,
	Kamal Mostafa

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

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

From: Tejun Heo <tj@kernel.org>

commit e09c2c295468476a239d13324ce9042ec4de05eb upstream.

create_singlethread_workqueue() is a compat interface for single
threaded workqueue which maps to ordered workqueue w/ rescuer in the
current implementation.  create_singlethread_workqueue() currently
implemented by invoking alloc_workqueue() w/ appropriate parameters.

8719dceae2f9 ("workqueue: reject adjusting max_active or applying
attrs to ordered workqueues") introduced __WQ_ORDERED to protect
ordered workqueues against dynamic attribute changes which can break
ordering guarantees but forgot to apply it to
create_singlethread_workqueue().  This in itself is okay as nobody
currently uses dynamic attribute change on workqueues created with
create_singlethread_workqueue().

However, 4c16bd327c ("workqueue: implement NUMA affinity for unbound
workqueues") broke singlethreaded guarantee for ordered workqueues
through allocating a separate pool_workqueue on each NUMA node by
default.  A later change 8a2b75384444 ("workqueue: fix ordered
workqueues in NUMA setups") fixed it by allocating only one global
pool_workqueue if __WQ_ORDERED is set.

Combined, the __WQ_ORDERED omission in create_singlethread_workqueue()
became critical breaking its single threadedness and ordering
guarantee.

Let's make create_singlethread_workqueue() wrap
alloc_ordered_workqueue() instead so that it inherits __WQ_ORDERED and
can implicitly track future ordered_workqueue changes.

v2: I missed that __WQ_ORDERED now protects against pwq splitting
    across NUMA nodes and incorrectly described the patch as a
    nice-to-have fix to protect against future dynamic attribute
    usages.  Oleg pointed out that this is actually a critical
    breakage due to 8a2b75384444 ("workqueue: fix ordered workqueues
    in NUMA setups").

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Mike Anderson <mike.anderson@us.ibm.com>
Cc: Oleg Nesterov <onestero@redhat.com>
Cc: Gustavo Luiz Duarte <gduarte@redhat.com>
Cc: Tomas Henzl <thenzl@redhat.com>
Fixes: 4c16bd327c ("workqueue: implement NUMA affinity for unbound workqueues")
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/linux/workqueue.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 594521b..eff358e 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -455,7 +455,7 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
 	alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, \
 			1, (name))
 #define create_singlethread_workqueue(name)				\
-	alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1, (name))
+	alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name)
 
 extern void destroy_workqueue(struct workqueue_struct *wq);
 
-- 
1.9.1


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

* [PATCH 3.13 120/163] can: flexcan: mark TX mailbox as TX_INACTIVE
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (118 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 119/163] workqueue: apply __WQ_ORDERED to create_singlethread_workqueue() Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 121/163] can: flexcan: correctly initialize mailboxes Kamal Mostafa
                   ` (42 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Marc Kleine-Budde, Kamal Mostafa

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

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

From: Marc Kleine-Budde <mkl@pengutronix.de>

commit c32fe4ad3e4861b2bfa1f44114c564935a123dda upstream.

This patch fixes the initialization of the TX mailbox. It is now correctly
initialized as TX_INACTIVE not RX_EMPTY.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/can/flexcan.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index d1fd213..c847e80 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -136,6 +136,17 @@
 
 /* FLEXCAN message buffers */
 #define FLEXCAN_MB_CNT_CODE(x)		(((x) & 0xf) << 24)
+#define FLEXCAN_MB_CODE_RX_INACTIVE	(0x0 << 24)
+#define FLEXCAN_MB_CODE_RX_EMPTY	(0x4 << 24)
+#define FLEXCAN_MB_CODE_RX_FULL		(0x2 << 24)
+#define FLEXCAN_MB_CODE_RX_OVERRRUN	(0x6 << 24)
+#define FLEXCAN_MB_CODE_RX_RANSWER	(0xa << 24)
+
+#define FLEXCAN_MB_CODE_TX_INACTIVE	(0x8 << 24)
+#define FLEXCAN_MB_CODE_TX_ABORT	(0x9 << 24)
+#define FLEXCAN_MB_CODE_TX_DATA		(0xc << 24)
+#define FLEXCAN_MB_CODE_TX_TANSWER	(0xe << 24)
+
 #define FLEXCAN_MB_CNT_SRR		BIT(22)
 #define FLEXCAN_MB_CNT_IDE		BIT(21)
 #define FLEXCAN_MB_CNT_RTR		BIT(20)
@@ -809,8 +820,8 @@ static int flexcan_chip_start(struct net_device *dev)
 	netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
 	flexcan_write(reg_ctrl, &regs->ctrl);
 
-	/* Abort any pending TX, mark Mailbox as INACTIVE */
-	flexcan_write(FLEXCAN_MB_CNT_CODE(0x4),
+	/* mark TX mailbox as INACTIVE */
+	flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
 		      &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
 
 	/* acceptance mask/acceptance code (accept everything) */
-- 
1.9.1


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

* [PATCH 3.13 121/163] can: flexcan: correctly initialize mailboxes
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (119 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 120/163] can: flexcan: mark TX mailbox as TX_INACTIVE Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 122/163] can: flexcan: implement workaround for errata ERR005829 Kamal Mostafa
                   ` (41 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Jander, Marc Kleine-Budde, Kamal Mostafa

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

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

From: David Jander <david@protonic.nl>

commit fc05b884a31dbf259cc73cc856e634ec3acbebb6 upstream.

Apparently mailboxes may contain random data at startup, causing some of them
being prepared for message reception. This causes overruns being missed or even
confusing the IRQ check for trasmitted messages, increasing the transmit
counter instead of the error counter.

This patch initializes all mailboxes after the FIFO as RX_INACTIVE.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/can/flexcan.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index c847e80..6360356 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -749,6 +749,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	struct flexcan_regs __iomem *regs = priv->base;
 	int err;
 	u32 reg_mcr, reg_ctrl;
+	int i;
 
 	/* enable module */
 	err = flexcan_chip_enable(priv);
@@ -820,6 +821,12 @@ static int flexcan_chip_start(struct net_device *dev)
 	netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
 	flexcan_write(reg_ctrl, &regs->ctrl);
 
+	/* clear and invalidate all mailboxes first */
+	for (i = FLEXCAN_TX_BUF_ID; i < ARRAY_SIZE(regs->cantxfg); i++) {
+		flexcan_write(FLEXCAN_MB_CODE_RX_INACTIVE,
+			      &regs->cantxfg[i].can_ctrl);
+	}
+
 	/* mark TX mailbox as INACTIVE */
 	flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
 		      &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
-- 
1.9.1


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

* [PATCH 3.13 122/163] can: flexcan: implement workaround for errata ERR005829
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (120 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 121/163] can: flexcan: correctly initialize mailboxes Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 123/163] can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-complete Kamal Mostafa
                   ` (40 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Jander, Marc Kleine-Budde, Kamal Mostafa

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

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

From: David Jander <david@protonic.nl>

commit 25e924450fcb23c11c07c95ea8964dd9f174652e upstream.

This patch implements the workaround mentioned in ERR005829:

    ERR005829: FlexCAN: FlexCAN does not transmit a message that is enabled to
    be transmitted in a specific moment during the arbitration process.

Workaround: The workaround consists of two extra steps after setting up a
message for transmission:

Step 8: Reserve the first valid mailbox as an inactive mailbox (CODE=0b1000).
If RX FIFO is disabled, this mailbox must be message buffer 0. Otherwise, the
first valid mailbox can be found using the "RX FIFO filters" table in the
FlexCAN chapter of the chip reference manual.

Step 9: Write twice INACTIVE code (0b1000) into the first valid mailbox.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/can/flexcan.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 6360356..3a1859b 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -125,7 +125,9 @@
 	 FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
 
 /* FLEXCAN interrupt flag register (IFLAG) bits */
-#define FLEXCAN_TX_BUF_ID		8
+/* Errata ERR005829 step7: Reserve first valid MB */
+#define FLEXCAN_TX_BUF_RESERVED		8
+#define FLEXCAN_TX_BUF_ID		9
 #define FLEXCAN_IFLAG_BUF(x)		BIT(x)
 #define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW	BIT(7)
 #define FLEXCAN_IFLAG_RX_FIFO_WARN	BIT(6)
@@ -383,6 +385,14 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	flexcan_write(can_id, &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
 	flexcan_write(ctrl, &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
 
+	/* Errata ERR005829 step8:
+	 * Write twice INACTIVE(0x8) code to first MB.
+	 */
+	flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
+		      &regs->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl);
+	flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
+		      &regs->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl);
+
 	return NETDEV_TX_OK;
 }
 
@@ -827,6 +837,10 @@ static int flexcan_chip_start(struct net_device *dev)
 			      &regs->cantxfg[i].can_ctrl);
 	}
 
+	/* Errata ERR005829: mark first TX mailbox as INACTIVE */
+	flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
+		      &regs->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl);
+
 	/* mark TX mailbox as INACTIVE */
 	flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
 		      &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
-- 
1.9.1


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

* [PATCH 3.13 123/163] can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-complete
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (121 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 122/163] can: flexcan: implement workaround for errata ERR005829 Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 124/163] can: at91_can: add missing prepare and unprepare of the clock Kamal Mostafa
                   ` (39 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Marc Kleine-Budde, Kamal Mostafa

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

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

From: Marc Kleine-Budde <mkl@pengutronix.de>

commit de5944883ebbedbf5adc8497659772f5da7b7d72 upstream.

After sending a RTR frame the TX mailbox becomes a RX_EMPTY mailbox. To avoid
side effects when the RX-FIFO is full, this patch puts the TX mailbox into
TX_INACTIVE mode in the transmission complete interrupt handler. This, of
course, leaves a race window between the actual completion of the transmission
and the handling of tx-complete interrupt. However this is the best we can do
without busy polling the tx complete interrupt.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/can/flexcan.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 3a1859b..deea3a9 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -702,6 +702,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 		stats->tx_bytes += can_get_echo_skb(dev, 0);
 		stats->tx_packets++;
 		can_led_event(dev, CAN_LED_EVENT_TX);
+		/* after sending a RTR frame mailbox is in RX mode */
+		flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
+			      &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
 		flexcan_write((1 << FLEXCAN_TX_BUF_ID), &regs->iflag1);
 		netif_wake_queue(dev);
 	}
-- 
1.9.1


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

* [PATCH 3.13 124/163] can: at91_can: add missing prepare and unprepare of the clock
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (122 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 123/163] can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-complete Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 125/163] IB/qib: Correct reference counting in debugfs qp_stats Kamal Mostafa
                   ` (38 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Dueck, Anthony Harivel, Marc Kleine-Budde, Kamal Mostafa

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

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

From: David Dueck <davidcdueck@googlemail.com>

commit e77980e50bc2850599d4d9c0192b67a9ffd6daac upstream.

In order to make the driver work with the common clock framework, this patch
converts the clk_enable()/clk_disable() to
clk_prepare_enable()/clk_disable_unprepare(). While there, add the missing
error handling.

Signed-off-by: David Dueck <davidcdueck@googlemail.com>
Signed-off-by: Anthony Harivel <anthony.harivel@emtrion.de>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/can/at91_can.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index cf0f63e..5e76a95 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1120,7 +1120,9 @@ static int at91_open(struct net_device *dev)
 	struct at91_priv *priv = netdev_priv(dev);
 	int err;
 
-	clk_enable(priv->clk);
+	err = clk_prepare_enable(priv->clk);
+	if (err)
+		return err;
 
 	/* check or determine and set bittime */
 	err = open_candev(dev);
@@ -1146,7 +1148,7 @@ static int at91_open(struct net_device *dev)
  out_close:
 	close_candev(dev);
  out:
-	clk_disable(priv->clk);
+	clk_disable_unprepare(priv->clk);
 
 	return err;
 }
@@ -1163,7 +1165,7 @@ static int at91_close(struct net_device *dev)
 	at91_chip_stop(dev, CAN_STATE_STOPPED);
 
 	free_irq(dev->irq, dev);
-	clk_disable(priv->clk);
+	clk_disable_unprepare(priv->clk);
 
 	close_candev(dev);
 
-- 
1.9.1


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

* [PATCH 3.13 125/163] IB/qib: Correct reference counting in debugfs qp_stats
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (123 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 124/163] can: at91_can: add missing prepare and unprepare of the clock Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 126/163] [media] videobuf2-dma-sg: fix for wrong GFP mask to sg_alloc_table_from_pages Kamal Mostafa
                   ` (37 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mike Marciniszyn, Roland Dreier, Kamal Mostafa

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

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

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

commit 85cbb7c728bf39c45a9789b88c9471c0d7a58b0e upstream.

This particular reference count is not needed with the rcu protection,
and the current code leaks a reference count, causing a hang in
qib_qp_destroy().

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/infiniband/hw/qib/qib_debugfs.c | 3 ++-
 drivers/infiniband/hw/qib/qib_qp.c      | 8 --------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_debugfs.c b/drivers/infiniband/hw/qib/qib_debugfs.c
index 799a0c3..6abd3ed 100644
--- a/drivers/infiniband/hw/qib/qib_debugfs.c
+++ b/drivers/infiniband/hw/qib/qib_debugfs.c
@@ -193,6 +193,7 @@ static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos)
 	struct qib_qp_iter *iter;
 	loff_t n = *pos;
 
+	rcu_read_lock();
 	iter = qib_qp_iter_init(s->private);
 	if (!iter)
 		return NULL;
@@ -224,7 +225,7 @@ static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr,
 
 static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr)
 {
-	/* nothing for now */
+	rcu_read_unlock();
 }
 
 static int _qp_stats_seq_show(struct seq_file *s, void *iter_ptr)
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c
index 3cca55b..2c018ba 100644
--- a/drivers/infiniband/hw/qib/qib_qp.c
+++ b/drivers/infiniband/hw/qib/qib_qp.c
@@ -1324,7 +1324,6 @@ int qib_qp_iter_next(struct qib_qp_iter *iter)
 	struct qib_qp *pqp = iter->qp;
 	struct qib_qp *qp;
 
-	rcu_read_lock();
 	for (; n < dev->qp_table_size; n++) {
 		if (pqp)
 			qp = rcu_dereference(pqp->next);
@@ -1332,18 +1331,11 @@ int qib_qp_iter_next(struct qib_qp_iter *iter)
 			qp = rcu_dereference(dev->qp_table[n]);
 		pqp = qp;
 		if (qp) {
-			if (iter->qp)
-				atomic_dec(&iter->qp->refcount);
-			atomic_inc(&qp->refcount);
-			rcu_read_unlock();
 			iter->qp = qp;
 			iter->n = n;
 			return 0;
 		}
 	}
-	rcu_read_unlock();
-	if (iter->qp)
-		atomic_dec(&iter->qp->refcount);
 	return ret;
 }
 
-- 
1.9.1


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

* [PATCH 3.13 126/163] [media] videobuf2-dma-sg: fix for wrong GFP mask to sg_alloc_table_from_pages
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (124 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 125/163] IB/qib: Correct reference counting in debugfs qp_stats Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 127/163] [media] vb2: fix plane index sanity check in vb2_plane_cookie() Kamal Mostafa
                   ` (36 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa

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

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

From: Hans Verkuil <hverkuil@xs4all.nl>

commit 47bc59c52b005f546343c373370a7eec6a2b0f84 upstream.

sg_alloc_table_from_pages() only allocates a sg_table, so it should just use
GFP_KERNEL, not gfp_flags. If gfp_flags contains __GFP_DMA32 then mm/sl[au]b.c
will call BUG_ON:

[  358.027515] ------------[ cut here ]------------
[  358.027546] kernel BUG at mm/slub.c:1416!
[  358.027558] invalid opcode: 0000 [#1] PREEMPT SMP
[  358.027576] Modules linked in: mt2131 s5h1409 tda8290 tuner cx25840 cx23885 btcx_risc altera_ci tda18271 altera_stapl videobuf2_dvb tveeprom cx2341x videobuf2_dma_sg dvb_core rc_core videobuf2_memops videobuf2_core nouveau zr36067 videocodec v4l2_common videodev media x86_pkg_temp_thermal cfbfillrect cfbimgblt cfbcopyarea ttm drm_kms_helper processor button isci
[  358.027712] CPU: 19 PID: 3654 Comm: cat Not tainted 3.16.0-rc6-telek #167
[  358.027723] Hardware name: ASUSTeK COMPUTER INC. Z9PE-D8 WS/Z9PE-D8 WS, BIOS 5404 02/10/2014
[  358.027741] task: ffff880897c7d960 ti: ffff88089b4d4000 task.ti: ffff88089b4d4000
[  358.027753] RIP: 0010:[<ffffffff81196040>]  [<ffffffff81196040>] new_slab+0x280/0x320
[  358.027776] RSP: 0018:ffff88089b4d7ae8  EFLAGS: 00010002
[  358.027787] RAX: ffff880897c7d960 RBX: 0000000000000000 RCX: ffff88089b4d7b50
[  358.027798] RDX: 00000000ffffffff RSI: 0000000000000004 RDI: ffff88089f803b00
[  358.027809] RBP: ffff88089b4d7bb8 R08: 0000000000000000 R09: 0000000100400040
[  358.027821] R10: 0000160000000000 R11: ffff88109bc02c40 R12: 0000000000000001
[  358.027832] R13: ffff88089f8000c0 R14: ffff88089f803b00 R15: ffff8810bfcf4be0
[  358.027845] FS:  00007f83fe5c0700(0000) GS:ffff8810bfce0000(0000) knlGS:0000000000000000
[  358.027858] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  358.027868] CR2: 0000000001dfd568 CR3: 0000001097d5a000 CR4: 00000000000407e0
[  358.027878] Stack:
[  358.027885]  ffffffff81198860 ffff8810bfcf4be0 ffff880897c7d960 0000000000001b00
[  358.027905]  ffff880897c7d960 0000000000000000 ffff8810bfcf4bf0 0000000000000000
[  358.027924]  0000000000000000 0000000100000100 ffffffff813ef84a 00000004ffffffff
[  358.027944] Call Trace:
[  358.027956]  [<ffffffff81198860>] ? __slab_alloc+0x400/0x4e0
[  358.027973]  [<ffffffff813ef84a>] ? sg_kmalloc+0x1a/0x30
[  358.027985]  [<ffffffff81198f17>] __kmalloc+0x127/0x150
[  358.027997]  [<ffffffff813ef84a>] ? sg_kmalloc+0x1a/0x30
[  358.028009]  [<ffffffff813ef84a>] sg_kmalloc+0x1a/0x30
[  358.028023]  [<ffffffff813eff84>] __sg_alloc_table+0x74/0x180
[  358.028035]  [<ffffffff813ef830>] ? sg_kfree+0x20/0x20
[  358.028048]  [<ffffffff813f00af>] sg_alloc_table+0x1f/0x60
[  358.028061]  [<ffffffff813f0174>] sg_alloc_table_from_pages+0x84/0x1f0
[  358.028077]  [<ffffffffa007c3f9>] vb2_dma_sg_alloc+0x159/0x230 [videobuf2_dma_sg]
[  358.028095]  [<ffffffffa003d55a>] __vb2_queue_alloc+0x10a/0x680 [videobuf2_core]
[  358.028113]  [<ffffffffa003e110>] __reqbufs.isra.14+0x220/0x3e0 [videobuf2_core]
[  358.028130]  [<ffffffffa003e79d>] __vb2_init_fileio+0xbd/0x380 [videobuf2_core]
[  358.028147]  [<ffffffffa003f563>] __vb2_perform_fileio+0x5b3/0x6e0 [videobuf2_core]
[  358.028164]  [<ffffffffa003f871>] vb2_fop_read+0xb1/0x100 [videobuf2_core]
[  358.028184]  [<ffffffffa06dd2e5>] v4l2_read+0x65/0xb0 [videodev]
[  358.028198]  [<ffffffff811a243f>] vfs_read+0x8f/0x170
[  358.028210]  [<ffffffff811a30a1>] SyS_read+0x41/0xb0
[  358.028224]  [<ffffffff818f02e9>] system_call_fastpath+0x16/0x1b
[  358.028234] Code: 66 90 e9 dc fd ff ff 0f 1f 40 00 41 8b 4d 68 e9 d5 fe ff ff 0f 1f 80 00 00 00 00 f0 41 80 4d 00 40 e9 03 ff ff ff 0f 1f 44 00 00 <0f> 0b 66 0f 1f 44 00 00 44 89 c6 4c 89 45 d0 e8 0c 82 ff ff 48
[  358.028415] RIP  [<ffffffff81196040>] new_slab+0x280/0x320
[  358.028432]  RSP <ffff88089b4d7ae8>
[  358.032208] ---[ end trace 6443240199c706e4 ]---

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/media/v4l2-core/videobuf2-dma-sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c
index 0d3a8ff..2970d76 100644
--- a/drivers/media/v4l2-core/videobuf2-dma-sg.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c
@@ -112,7 +112,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size, gfp_t gfp_fla
 		goto fail_pages_alloc;
 
 	ret = sg_alloc_table_from_pages(&buf->sg_table, buf->pages,
-			buf->num_pages, 0, size, gfp_flags);
+			buf->num_pages, 0, size, GFP_KERNEL);
 	if (ret)
 		goto fail_table_alloc;
 
-- 
1.9.1


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

* [PATCH 3.13 127/163] [media] vb2: fix plane index sanity check in vb2_plane_cookie()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (125 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 126/163] [media] videobuf2-dma-sg: fix for wrong GFP mask to sg_alloc_table_from_pages Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 128/163] [media] adv7604: fix inverted condition Kamal Mostafa
                   ` (35 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Zhaowei Yuan, Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa

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

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

From: Zhaowei Yuan <zhaowei.yuan@samsung.com>

commit a9ae4692eda4b99f85757b15d60971ff78a0a0e2 upstream.

It's also invalid when plane_no is equal to vb->num_planes

Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/media/v4l2-core/videobuf2-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 0edc165..7db9b5b 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -885,7 +885,7 @@ void *vb2_plane_cookie(struct vb2_buffer *vb, unsigned int plane_no)
 {
 	struct vb2_queue *q = vb->vb2_queue;
 
-	if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv)
+	if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)
 		return NULL;
 
 	return call_memop(q, cookie, vb->planes[plane_no].mem_priv);
-- 
1.9.1


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

* [PATCH 3.13 128/163] [media] adv7604: fix inverted condition
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (126 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 127/163] [media] vb2: fix plane index sanity check in vb2_plane_cookie() Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 129/163] md/raid1: intialise start_next_window for READ case to avoid hang Kamal Mostafa
                   ` (34 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans Verkuil, Mauro Carvalho Chehab, Kamal Mostafa

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

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

From: Hans Verkuil <hverkuil@xs4all.nl>

commit 77639ff2b3404a913b8037d230a384798b854bae upstream.

The log_status function should show HDMI information, but the test checking for
an HDMI input was inverted. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/media/i2c/adv7604.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index a324106b..20676ae 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -1752,7 +1752,7 @@ static int adv7604_log_status(struct v4l2_subdev *sd)
 	v4l2_info(sd, "HDCP keys read: %s%s\n",
 			(hdmi_read(sd, 0x04) & 0x20) ? "yes" : "no",
 			(hdmi_read(sd, 0x04) & 0x10) ? "ERROR" : "");
-	if (!is_hdmi(sd)) {
+	if (is_hdmi(sd)) {
 		bool audio_pll_locked = hdmi_read(sd, 0x04) & 0x01;
 		bool audio_sample_packet_detect = hdmi_read(sd, 0x18) & 0x01;
 		bool audio_mute = io_read(sd, 0x65) & 0x40;
-- 
1.9.1


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

* [PATCH 3.13 129/163] md/raid1: intialise start_next_window for READ case to avoid hang
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (127 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 128/163] [media] adv7604: fix inverted condition Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 130/163] md/raid1: be more cautious where we read-balance during resync Kamal Mostafa
                   ` (33 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit f0cc9a057151892b885be21a1d19b0185568281d upstream.

r1_bio->start_next_window is not initialised in the READ
case, so allow_barrier may incorrectly decrement
   conf->current_window_requests
which can cause raise_barrier() to block forever.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Reported-by: Brassow Jonathan <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index f4d5e52..b806da4 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1187,6 +1187,7 @@ read_again:
 				   atomic_read(&bitmap->behind_writes) == 0);
 		}
 		r1_bio->read_disk = rdisk;
+		r1_bio->start_next_window = 0;
 
 		read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev);
 		bio_trim(read_bio, r1_bio->sector - bio->bi_sector,
-- 
1.9.1


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

* [PATCH 3.13 130/163] md/raid1:  be more cautious where we read-balance during resync.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (128 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 129/163] md/raid1: intialise start_next_window for READ case to avoid hang Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 131/163] md/raid1: clean up request counts properly in close_sync() Kamal Mostafa
                   ` (32 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit c6d119cf1b5a778e9ed60a006e2a434fcc4471a2 upstream.

commit 79ef3a8aa1cb1523cc231c9a90a278333c21f761 made
it possible for reads to happen concurrently with resync.
This means that we need to be more careful where read_balancing
is allowed during resync - we can no longer be sure that any
resync that has already started will definitely finish.

So keep read_balancing to before recovery_cp, which is conservative
but safe.

This bug makes it possible to read from a device that doesn't
have up-to-date data, so it can cause data corruption.
So it is suitable for any kernel since 3.11.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b806da4..e124f01 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -542,11 +542,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
 	has_nonrot_disk = 0;
 	choose_next_idle = 0;
 
-	if (conf->mddev->recovery_cp < MaxSector &&
-	    (this_sector + sectors >= conf->next_resync))
-		choose_first = 1;
-	else
-		choose_first = 0;
+	choose_first = (conf->mddev->recovery_cp < this_sector + sectors);
 
 	for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) {
 		sector_t dist;
-- 
1.9.1


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

* [PATCH 3.13 131/163] md/raid1: clean up request counts properly in close_sync()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (129 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 130/163] md/raid1: be more cautious where we read-balance during resync Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 132/163] md/raid1: make sure resync waits for conflicting writes to complete Kamal Mostafa
                   ` (31 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit 669cc7ba77864e7b1ac39c9f2b2afb8730f341f4 upstream.

If there are outstanding writes when close_sync is called,
the change to ->start_next_window might cause them to
decrement the wrong counter when they complete.  Fix this
by merging the two counters into the one that will be decremented.

Having an incorrect value in a counter can cause raise_barrier()
to hangs, so this is suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index e124f01..2414a79 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1544,8 +1544,13 @@ static void close_sync(struct r1conf *conf)
 	mempool_destroy(conf->r1buf_pool);
 	conf->r1buf_pool = NULL;
 
+	spin_lock_irq(&conf->resync_lock);
 	conf->next_resync = 0;
 	conf->start_next_window = MaxSector;
+	conf->current_window_requests +=
+		conf->next_window_requests;
+	conf->next_window_requests = 0;
+	spin_unlock_irq(&conf->resync_lock);
 }
 
 static int raid1_spare_active(struct mddev *mddev)
-- 
1.9.1


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

* [PATCH 3.13 132/163] md/raid1: make sure resync waits for conflicting writes to complete.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (130 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 131/163] md/raid1: clean up request counts properly in close_sync() Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 133/163] md/raid1: Don't use next_resync to determine how far resync has progressed Kamal Mostafa
                   ` (30 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: majianpeng, NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit 2f73d3c55d09ce60647b96ad2a9b539c95a530ee upstream.

The resync/recovery process for raid1 was recently changed
so that writes could happen in parallel with resync providing
they were in different regions of the device.

There is a problem though:  While a write request will always
wait for conflicting resync to complete, a resync request
will *not* always wait for conflicting writes to complete.

Two changes are needed to fix this:

1/ raise_barrier (which waits until it is safe to do resync)
   must wait until current_window_requests is zero
2/ wait_battier (which waits at the start of a new write request)
   must update current_window_requests if the request could
   possible conflict with a concurrent resync.

As concurrent writes and resync can lead to data loss,
this patch is suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Cc: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
[ kamal: backport to 3.13-stable: no bi_iter struct ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 2414a79..c85ac43 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -847,10 +847,12 @@ static void raise_barrier(struct r1conf *conf)
 	 * C: next_resync + RESYNC_SECTORS > start_next_window, meaning
 	 *    next resync will reach to the window which normal bios are
 	 *    handling.
+	 * D: while there are any active requests in the current window.
 	 */
 	wait_event_lock_irq(conf->wait_barrier,
 			    !conf->array_frozen &&
 			    conf->barrier < RESYNC_DEPTH &&
+			    conf->current_window_requests == 0 &&
 			    (conf->start_next_window >=
 			     conf->next_resync + RESYNC_SECTORS),
 			    conf->resync_lock);
@@ -917,8 +919,8 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio)
 	}
 
 	if (bio && bio_data_dir(bio) == WRITE) {
-		if (conf->next_resync + NEXT_NORMALIO_DISTANCE
-		    <= bio->bi_sector) {
+		if (bio->bi_sector >=
+		    conf->next_resync) {
 			if (conf->start_next_window == MaxSector)
 				conf->start_next_window =
 					conf->next_resync +
-- 
1.9.1


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

* [PATCH 3.13 133/163] md/raid1: Don't use next_resync to determine how far resync has progressed
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (131 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 132/163] md/raid1: make sure resync waits for conflicting writes to complete Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 134/163] md/raid1: update next_resync under resync_lock Kamal Mostafa
                   ` (29 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit 235549605eb7f1c5a37cef8b09d12e6d412c5cd6 upstream.

next_resync is (approximately) the location for the next resync request.
However it does *not* reliably determine the earliest location
at which resync might be happening.
This is because resync requests can complete out of order, and
we only limit the number of current requests, not the distance
from the earliest pending request to the latest.

mddev->curr_resync_completed is a reliable indicator of the earliest
position at which resync could be happening.   It is updated less
frequently, but is actually reliable which is more important.

So use it to determine if a write request is before the region
being resynced and so safe from conflict.

This error can allow resync IO to interfere with normal IO which
could lead to data corruption. Hence: stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Signed-off-by: NeilBrown <neilb@suse.de>
[ kamal: backport to 3.13-stable: no bi_iter struct ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index c85ac43..11d0bd8 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -877,12 +877,10 @@ static bool need_to_wait_for_sync(struct r1conf *conf, struct bio *bio)
 	if (conf->array_frozen || !bio)
 		wait = true;
 	else if (conf->barrier && bio_data_dir(bio) == WRITE) {
-		if (conf->next_resync < RESYNC_WINDOW_SECTORS)
-			wait = true;
-		else if ((conf->next_resync - RESYNC_WINDOW_SECTORS
-				>= bio_end_sector(bio)) ||
-			 (conf->next_resync + NEXT_NORMALIO_DISTANCE
-				<= bio->bi_sector))
+		if ((conf->mddev->curr_resync_completed
+		     >= bio_end_sector(bio)) ||
+		    (conf->next_resync + NEXT_NORMALIO_DISTANCE
+		     <= bio->bi_sector))
 			wait = false;
 		else
 			wait = true;
@@ -920,7 +918,7 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio)
 
 	if (bio && bio_data_dir(bio) == WRITE) {
 		if (bio->bi_sector >=
-		    conf->next_resync) {
+		    conf->mddev->curr_resync_completed) {
 			if (conf->start_next_window == MaxSector)
 				conf->start_next_window =
 					conf->next_resync +
-- 
1.9.1


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

* [PATCH 3.13 134/163] md/raid1: update next_resync under resync_lock.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (132 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 133/163] md/raid1: Don't use next_resync to determine how far resync has progressed Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 135/163] md/raid1: count resync requests in nr_pending Kamal Mostafa
                   ` (28 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit c2fd4c94deedb89ac1746c4a53219be499372c06 upstream.

raise_barrier() uses next_resync as part of its calculations, so it
really should be updated first, instead of afterwards.

next_resync is always used under resync_lock so update it under
resync lock to, just before it is used.  That is safest.

This could cause normal IO and resync IO to interact badly so
it suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 11d0bd8..5ad11da 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -829,7 +829,7 @@ static void flush_pending_writes(struct r1conf *conf)
  *    there is no normal IO happeing.  It must arrange to call
  *    lower_barrier when the particular background IO completes.
  */
-static void raise_barrier(struct r1conf *conf)
+static void raise_barrier(struct r1conf *conf, sector_t sector_nr)
 {
 	spin_lock_irq(&conf->resync_lock);
 
@@ -839,6 +839,7 @@ static void raise_barrier(struct r1conf *conf)
 
 	/* block any new IO from starting */
 	conf->barrier++;
+	conf->next_resync = sector_nr;
 
 	/* For these conditions we must wait:
 	 * A: while the array is in frozen state
@@ -2540,9 +2541,8 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
 
 	bitmap_cond_end_sync(mddev->bitmap, sector_nr);
 	r1_bio = mempool_alloc(conf->r1buf_pool, GFP_NOIO);
-	raise_barrier(conf);
 
-	conf->next_resync = sector_nr;
+	raise_barrier(conf, sector_nr);
 
 	rcu_read_lock();
 	/*
-- 
1.9.1


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

* [PATCH 3.13 135/163] md/raid1: count resync requests in nr_pending.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (133 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 134/163] md/raid1: update next_resync under resync_lock Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 136/163] md/raid1: fix_read_error should act on all non-faulty devices Kamal Mostafa
                   ` (27 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit 34e97f170149bfa14979581c4c748bc9b4b79d5b upstream.

Both normal IO and resync IO can be retried with reschedule_retry()
and so be counted into ->nr_queued, but only normal IO gets counted in
->nr_pending.

Before the recent improvement to RAID1 resync there could only
possibly have been one or the other on the queue.  When handling a
read failure it could only be normal IO.  So when handle_read_error()
called freeze_array() the fact that freeze_array only compares
->nr_queued against ->nr_pending was safe.

But now that these two types can interleave, we can have both normal
and resync IO requests queued, so we need to count them both in
nr_pending.

This error can lead to freeze_array() hanging if there is a read
error, so it is suitable for -stable.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
Reported-by: Brassow Jonathan <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 5ad11da..2cf4f69 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -858,6 +858,7 @@ static void raise_barrier(struct r1conf *conf, sector_t sector_nr)
 			     conf->next_resync + RESYNC_SECTORS),
 			    conf->resync_lock);
 
+	conf->nr_pending++;
 	spin_unlock_irq(&conf->resync_lock);
 }
 
@@ -867,6 +868,7 @@ static void lower_barrier(struct r1conf *conf)
 	BUG_ON(conf->barrier <= 0);
 	spin_lock_irqsave(&conf->resync_lock, flags);
 	conf->barrier--;
+	conf->nr_pending--;
 	spin_unlock_irqrestore(&conf->resync_lock, flags);
 	wake_up(&conf->wait_barrier);
 }
-- 
1.9.1


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

* [PATCH 3.13 136/163] md/raid1: fix_read_error should act on all non-faulty devices.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (134 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 135/163] md/raid1: count resync requests in nr_pending Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 137/163] ALSA: pcm: fix fifo_size frame calculation Kamal Mostafa
                   ` (26 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit b8cb6b4c121e1bf1963c16ed69e7adcb1bc301cd upstream.

If a devices is being recovered it is not InSync and is not Faulty.

If a read error is experienced on that device, fix_read_error()
will be called, but it ignores non-InSync devices.  So it will
neither fix the error nor fail the device.

It is incorrect that fix_read_error() ignores non-InSync devices.
It should only ignore Faulty devices.  So fix it.

This became a bug when we allowed reading from a device that was being
recovered.  It is suitable for any subsequent -stable kernel.

Fixes: da8840a747c0dbf49506ec906757a6b87b9741e9
Reported-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Tested-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 2cf4f69..e4885c0 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2154,7 +2154,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
 			d--;
 			rdev = conf->mirrors[d].rdev;
 			if (rdev &&
-			    test_bit(In_sync, &rdev->flags))
+			    !test_bit(Faulty, &rdev->flags))
 				r1_sync_page_io(rdev, sect, s,
 						conf->tmppage, WRITE);
 		}
@@ -2166,7 +2166,7 @@ static void fix_read_error(struct r1conf *conf, int read_disk,
 			d--;
 			rdev = conf->mirrors[d].rdev;
 			if (rdev &&
-			    test_bit(In_sync, &rdev->flags)) {
+			    !test_bit(Faulty, &rdev->flags)) {
 				if (r1_sync_page_io(rdev, sect, s,
 						    conf->tmppage, READ)) {
 					atomic_add(s, &rdev->corrected_errors);
-- 
1.9.1


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

* [PATCH 3.13 137/163] ALSA: pcm: fix fifo_size frame calculation
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (135 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 136/163] md/raid1: fix_read_error should act on all non-faulty devices Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 138/163] Fix nasty 32-bit overflow bug in buffer i/o code Kamal Mostafa
                   ` (25 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Clemens Ladisch, Takashi Iwai, Kamal Mostafa

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

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

From: Clemens Ladisch <clemens@ladisch.de>

commit a9960e6a293e6fc3ed414643bb4e4106272e4d0a upstream.

The calculated frame size was wrong because snd_pcm_format_physical_width()
actually returns the number of bits, not bytes.

Use snd_pcm_format_size() instead, which not only returns bytes, but also
simplifies the calculation.

Fixes: 8bea869c5e56 ("ALSA: PCM midlevel: improve fifo_size handling")
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/core/pcm_lib.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index a210467..e1ef106 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1783,14 +1783,16 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream,
 {
 	struct snd_pcm_hw_params *params = arg;
 	snd_pcm_format_t format;
-	int channels, width;
+	int channels;
+	ssize_t frame_size;
 
 	params->fifo_size = substream->runtime->hw.fifo_size;
 	if (!(substream->runtime->hw.info & SNDRV_PCM_INFO_FIFO_IN_FRAMES)) {
 		format = params_format(params);
 		channels = params_channels(params);
-		width = snd_pcm_format_physical_width(format);
-		params->fifo_size /= width * channels;
+		frame_size = snd_pcm_format_size(format, channels);
+		if (frame_size > 0)
+			params->fifo_size /= (unsigned)frame_size;
 	}
 	return 0;
 }
-- 
1.9.1


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

* [PATCH 3.13 138/163] Fix nasty 32-bit overflow bug in buffer i/o code.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (136 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 137/163] ALSA: pcm: fix fifo_size frame calculation Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 139/163] drm/radeon/cik: use a separate counter for CP init timeout Kamal Mostafa
                   ` (24 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anton Altaparmakov, Linus Torvalds, Kamal Mostafa

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

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

From: Anton Altaparmakov <aia21@cam.ac.uk>

commit f2d5a94436cc7cc0221b9a81bba2276a25187dd3 upstream.

On 32-bit architectures, the legacy buffer_head functions are not always
handling the sector number with the proper 64-bit types, and will thus
fail on 4TB+ disks.

Any code that uses __getblk() (and thus bread(), breadahead(),
sb_bread(), sb_breadahead(), sb_getblk()), and calls it using a 64-bit
block on a 32-bit arch (where "long" is 32-bit) causes an inifinite loop
in __getblk_slow() with an infinite stream of errors logged to dmesg
like this:

  __find_get_block_slow() failed. block=6740375944, b_blocknr=2445408648
  b_state=0x00000020, b_size=512
  device sda1 blocksize: 512

Note how in hex block is 0x191C1F988 and b_blocknr is 0x91C1F988 i.e. the
top 32-bits are missing (in this case the 0x1 at the top).

This is because grow_dev_page() is broken and has a 32-bit overflow due
to shifting the page index value (a pgoff_t - which is just 32 bits on
32-bit architectures) left-shifted as the block number.  But the top
bits to get lost as the pgoff_t is not type cast to sector_t / 64-bit
before the shift.

This patch fixes this issue by type casting "index" to sector_t before
doing the left shift.

Note this is not a theoretical bug but has been seen in the field on a
4TiB hard drive with logical sector size 512 bytes.

This patch has been verified to fix the infinite loop problem on 3.17-rc5
kernel using a 4TB disk image mounted using "-o loop".  Without this patch
doing a "find /nt" where /nt is an NTFS volume causes the inifinite loop
100% reproducibly whilst with the patch it works fine as expected.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/buffer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index aeeea65..be90719 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1029,7 +1029,8 @@ grow_dev_page(struct block_device *bdev, sector_t block,
 		bh = page_buffers(page);
 		if (bh->b_size == size) {
 			end_block = init_page_buffers(page, bdev,
-						index << sizebits, size);
+						(sector_t)index << sizebits,
+						size);
 			goto done;
 		}
 		if (!try_to_free_buffers(page))
@@ -1050,7 +1051,8 @@ grow_dev_page(struct block_device *bdev, sector_t block,
 	 */
 	spin_lock(&inode->i_mapping->private_lock);
 	link_dev_buffers(page, bh);
-	end_block = init_page_buffers(page, bdev, index << sizebits, size);
+	end_block = init_page_buffers(page, bdev, (sector_t)index << sizebits,
+			size);
 	spin_unlock(&inode->i_mapping->private_lock);
 done:
 	ret = (block < end_block) ? 1 : -ENXIO;
-- 
1.9.1


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

* [PATCH 3.13 139/163] drm/radeon/cik: use a separate counter for CP init timeout
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (137 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 138/163] Fix nasty 32-bit overflow bug in buffer i/o code Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 140/163] parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds Kamal Mostafa
                   ` (23 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

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

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

commit 370ce45b5986118fa496dddbcd7039e1aa1a418f upstream.

Otherwise we may fail to init the second compute ring.

Noticed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/radeon/cik.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 4c5828b..e54f8da 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -4327,7 +4327,7 @@ struct bonaire_mqd
  */
 static int cik_cp_compute_resume(struct radeon_device *rdev)
 {
-	int r, i, idx;
+	int r, i, j, idx;
 	u32 tmp;
 	bool use_doorbell = true;
 	u64 hqd_gpu_addr;
@@ -4446,7 +4446,7 @@ static int cik_cp_compute_resume(struct radeon_device *rdev)
 		mqd->queue_state.cp_hqd_pq_wptr= 0;
 		if (RREG32(CP_HQD_ACTIVE) & 1) {
 			WREG32(CP_HQD_DEQUEUE_REQUEST, 1);
-			for (i = 0; i < rdev->usec_timeout; i++) {
+			for (j = 0; j < rdev->usec_timeout; j++) {
 				if (!(RREG32(CP_HQD_ACTIVE) & 1))
 					break;
 				udelay(1);
-- 
1.9.1


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

* [PATCH 3.13 140/163] parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (138 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 139/163] drm/radeon/cik: use a separate counter for CP init timeout Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 141/163] sched: Fix unreleased llc_shared_mask bit during CPU hotplug Kamal Mostafa
                   ` (22 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: John David Anglin, Helge Deller, Kamal Mostafa

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

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

From: John David Anglin <dave.anglin@bell.net>

commit d26a7730b5874a5fa6779c62f4ad7c5065a94723 upstream.

In spite of what the GCC manual says, the -mfast-indirect-calls has
never been supported in the 64-bit parisc compiler. Indirect calls have
always been done using function descriptors irrespective of the
-mfast-indirect-calls option.

Recently, it was noticed that a function descriptor was always requested
when the -mfast-indirect-calls option was specified. This caused
problems when the option was used in  application code and doesn't make
any sense because the whole point of the option is to avoid using a
function descriptor for indirect calls.

Fixing this broke 64-bit kernel builds.

I will fix GCC but for now we need the attached change. This results in
the same kernel code as before.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/parisc/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 7187664..5db8882 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -48,7 +48,12 @@ cflags-y	:= -pipe
 
 # These flags should be implied by an hppa-linux configuration, but they
 # are not in gcc 3.2.
-cflags-y	+= -mno-space-regs -mfast-indirect-calls
+cflags-y	+= -mno-space-regs
+
+# -mfast-indirect-calls is only relevant for 32-bit kernels.
+ifndef CONFIG_64BIT
+cflags-y	+= -mfast-indirect-calls
+endif
 
 # Currently we save and restore fpregs on all kernel entry/interruption paths.
 # If that gets optimized, we might need to disable the use of fpregs in the
-- 
1.9.1


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

* [PATCH 3.13 141/163] sched: Fix unreleased llc_shared_mask bit during CPU hotplug
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (139 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 140/163] parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 142/163] MIPS: mcount: Adjust stack pointer for static trace in MIPS32 Kamal Mostafa
                   ` (21 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Wanpeng Li, David Rientjes, Prarit Bhargava, Steven Rostedt,
	Peter Zijlstra, Ingo Molnar, Kamal Mostafa

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

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

From: Wanpeng Li <wanpeng.li@linux.intel.com>

commit 03bd4e1f7265548832a76e7919a81f3137c44fd1 upstream.

The following bug can be triggered by hot adding and removing a large number of
xen domain0's vcpus repeatedly:

	BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 IP: [..] find_busiest_group
	PGD 5a9d5067 PUD 13067 PMD 0
	Oops: 0000 [#3] SMP
	[...]
	Call Trace:
	load_balance
	? _raw_spin_unlock_irqrestore
	idle_balance
	__schedule
	schedule
	schedule_timeout
	? lock_timer_base
	schedule_timeout_uninterruptible
	msleep
	lock_device_hotplug_sysfs
	online_store
	dev_attr_store
	sysfs_write_file
	vfs_write
	SyS_write
	system_call_fastpath

Last level cache shared mask is built during CPU up and the
build_sched_domain() routine takes advantage of it to setup
the sched domain CPU topology.

However, llc_shared_mask is not released during CPU disable,
which leads to an invalid sched domainCPU topology.

This patch fix it by releasing the llc_shared_mask correctly
during CPU disable.

Yasuaki also reported that this can happen on real hardware:

  https://lkml.org/lkml/2014/7/22/1018

His case is here:

	==
	Here is an example on my system.
	My system has 4 sockets and each socket has 15 cores and HT is
	enabled. In this case, each core of sockes is numbered as
	follows:

		 | CPU#
	Socket#0 | 0-14 , 60-74
	Socket#1 | 15-29, 75-89
	Socket#2 | 30-44, 90-104
	Socket#3 | 45-59, 105-119

	Then llc_shared_mask of CPU#30 has 0x3fff80000001fffc0000000.

	It means that last level cache of Socket#2 is shared with
	CPU#30-44 and 90-104.

	When hot-removing socket#2 and #3, each core of sockets is
	numbered as follows:

		 | CPU#
	Socket#0 | 0-14 , 60-74
	Socket#1 | 15-29, 75-89

	But llc_shared_mask is not cleared. So llc_shared_mask of CPU#30
	remains having 0x3fff80000001fffc0000000.

	After that, when hot-adding socket#2 and #3, each core of
	sockets is numbered as follows:

		 | CPU#
	Socket#0 | 0-14 , 60-74
	Socket#1 | 15-29, 75-89
	Socket#2 | 30-59
	Socket#3 | 90-119

	Then llc_shared_mask of CPU#30 becomes
	0x3fff8000fffffffc0000000. It means that last level cache of
	Socket#2 is shared with CPU#30-59 and 90-104. So the mask has
	the wrong value.

Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
Tested-by: Linn Crosetto <linn@hp.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Steven Rostedt <srostedt@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1411547885-48165-1-git-send-email-wanpeng.li@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/kernel/smpboot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a965665..36d0440 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1287,6 +1287,9 @@ static void remove_siblinginfo(int cpu)
 
 	for_each_cpu(sibling, cpu_sibling_mask(cpu))
 		cpumask_clear_cpu(cpu, cpu_sibling_mask(sibling));
+	for_each_cpu(sibling, cpu_llc_shared_mask(cpu))
+		cpumask_clear_cpu(cpu, cpu_llc_shared_mask(sibling));
+	cpumask_clear(cpu_llc_shared_mask(cpu));
 	cpumask_clear(cpu_sibling_mask(cpu));
 	cpumask_clear(cpu_core_mask(cpu));
 	c->phys_proc_id = 0;
-- 
1.9.1


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

* [PATCH 3.13 142/163] MIPS: mcount: Adjust stack pointer for static trace in MIPS32
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (140 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 141/163] sched: Fix unreleased llc_shared_mask bit during CPU hotplug Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 143/163] nilfs2: fix data loss with mmap() Kamal Mostafa
                   ` (20 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Markos Chandras, linux-mips, Ralf Baechle, Kamal Mostafa

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

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

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

commit 8a574cfa2652545eb95595d38ac2a0bb501af0ae upstream.

Every mcount() call in the MIPS 32-bit kernel is done as follows:

[...]
move at, ra
jal _mcount
addiu sp, sp, -8
[...]

but upon returning from the mcount() function, the stack pointer
is not adjusted properly. This is explained in details in 58b69401c797
(MIPS: Function tracer: Fix broken function tracing).

Commit ad8c396936e3 ("MIPS: Unbreak function tracer for 64-bit kernel.)
fixed the stack manipulation for 64-bit but it didn't fix it completely
for MIPS32.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7792/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/mips/kernel/mcount.S | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
index 539b629..8f89ff4 100644
--- a/arch/mips/kernel/mcount.S
+++ b/arch/mips/kernel/mcount.S
@@ -123,7 +123,11 @@ NESTED(_mcount, PT_SIZE, ra)
 	 nop
 #endif
 	b	ftrace_stub
+#ifdef CONFIG_32BIT
+	 addiu sp, sp, 8
+#else
 	 nop
+#endif
 
 static_trace:
 	MCOUNT_SAVE_REGS
@@ -133,6 +137,9 @@ static_trace:
 	 move	a1, AT		/* arg2: parent's return address */
 
 	MCOUNT_RESTORE_REGS
+#ifdef CONFIG_32BIT
+	addiu sp, sp, 8
+#endif
 	.globl ftrace_stub
 ftrace_stub:
 	RETURN_BACK
@@ -177,6 +184,11 @@ NESTED(ftrace_graph_caller, PT_SIZE, ra)
 	jal	prepare_ftrace_return
 	 nop
 	MCOUNT_RESTORE_REGS
+#ifndef CONFIG_DYNAMIC_FTRACE
+#ifdef CONFIG_32BIT
+	addiu sp, sp, 8
+#endif
+#endif
 	RETURN_BACK
 	END(ftrace_graph_caller)
 
-- 
1.9.1


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

* [PATCH 3.13 143/163] nilfs2: fix data loss with mmap()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (141 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 142/163] MIPS: mcount: Adjust stack pointer for static trace in MIPS32 Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 144/163] ocfs2/dlm: do not get resource spinlock if lockres is new Kamal Mostafa
                   ` (19 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Andreas Rohner, Ryusuke Konishi, Andrew Morton, Linus Torvalds,
	Kamal Mostafa

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

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

From: Andreas Rohner <andreas.rohner@gmx.net>

commit 56d7acc792c0d98f38f22058671ee715ff197023 upstream.

This bug leads to reproducible silent data loss, despite the use of
msync(), sync() and a clean unmount of the file system.  It is easily
reproducible with the following script:

  ----------------[BEGIN SCRIPT]--------------------
  mkfs.nilfs2 -f /dev/sdb
  mount /dev/sdb /mnt

  dd if=/dev/zero bs=1M count=30 of=/mnt/testfile

  umount /mnt
  mount /dev/sdb /mnt
  CHECKSUM_BEFORE="$(md5sum /mnt/testfile)"

  /root/mmaptest/mmaptest /mnt/testfile 30 10 5

  sync
  CHECKSUM_AFTER="$(md5sum /mnt/testfile)"
  umount /mnt
  mount /dev/sdb /mnt
  CHECKSUM_AFTER_REMOUNT="$(md5sum /mnt/testfile)"
  umount /mnt

  echo "BEFORE MMAP:\t$CHECKSUM_BEFORE"
  echo "AFTER MMAP:\t$CHECKSUM_AFTER"
  echo "AFTER REMOUNT:\t$CHECKSUM_AFTER_REMOUNT"
  ----------------[END SCRIPT]--------------------

The mmaptest tool looks something like this (very simplified, with
error checking removed):

  ----------------[BEGIN mmaptest]--------------------
  data = mmap(NULL, file_size - file_offset, PROT_READ | PROT_WRITE,
              MAP_SHARED, fd, file_offset);

  for (i = 0; i < write_count; ++i) {
        memcpy(data + i * 4096, buf, sizeof(buf));
        msync(data, file_size - file_offset, MS_SYNC))
  }
  ----------------[END mmaptest]--------------------

The output of the script looks something like this:

  BEFORE MMAP:    281ed1d5ae50e8419f9b978aab16de83  /mnt/testfile
  AFTER MMAP:     6604a1c31f10780331a6850371b3a313  /mnt/testfile
  AFTER REMOUNT:  281ed1d5ae50e8419f9b978aab16de83  /mnt/testfile

So it is clear, that the changes done using mmap() do not survive a
remount.  This can be reproduced a 100% of the time.  The problem was
introduced in commit 136e8770cd5d ("nilfs2: fix issue of
nilfs_set_page_dirty() for page at EOF boundary").

If the page was read with mpage_readpage() or mpage_readpages() for
example, then it has no buffers attached to it.  In that case
page_has_buffers(page) in nilfs_set_page_dirty() will be false.
Therefore nilfs_set_file_dirty() is never called and the pages are never
collected and never written to disk.

This patch fixes the problem by also calling nilfs_set_file_dirty() if the
page has no buffers attached to it.

[akpm@linux-foundation.org: s/PAGE_SHIFT/PAGE_CACHE_SHIFT/]
Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
Tested-by: Andreas Rohner <andreas.rohner@gmx.net>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/nilfs2/inode.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 7e350c5..1e0bbae 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -24,6 +24,7 @@
 #include <linux/buffer_head.h>
 #include <linux/gfp.h>
 #include <linux/mpage.h>
+#include <linux/pagemap.h>
 #include <linux/writeback.h>
 #include <linux/aio.h>
 #include "nilfs.h"
@@ -219,10 +220,10 @@ static int nilfs_writepage(struct page *page, struct writeback_control *wbc)
 
 static int nilfs_set_page_dirty(struct page *page)
 {
+	struct inode *inode = page->mapping->host;
 	int ret = __set_page_dirty_nobuffers(page);
 
 	if (page_has_buffers(page)) {
-		struct inode *inode = page->mapping->host;
 		unsigned nr_dirty = 0;
 		struct buffer_head *bh, *head;
 
@@ -245,6 +246,10 @@ static int nilfs_set_page_dirty(struct page *page)
 
 		if (nr_dirty)
 			nilfs_set_file_dirty(inode, nr_dirty);
+	} else if (ret) {
+		unsigned nr_dirty = 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits);
+
+		nilfs_set_file_dirty(inode, nr_dirty);
 	}
 	return ret;
 }
-- 
1.9.1


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

* [PATCH 3.13 144/163] ocfs2/dlm: do not get resource spinlock if lockres is new
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (142 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 143/163] nilfs2: fix data loss with mmap() Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 145/163] mm, slab: initialize object alignment on cache creation Kamal Mostafa
                   ` (18 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joseph Qi, Joel Becker, Mark Fasheh, Andrew Morton,
	Linus Torvalds, Kamal Mostafa

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

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

From: Joseph Qi <joseph.qi@huawei.com>

commit 5760a97c7143c208fa3a8f8cad0ed7dd672ebd28 upstream.

There is a deadlock case which reported by Guozhonghua:
  https://oss.oracle.com/pipermail/ocfs2-devel/2014-September/010079.html

This case is caused by &res->spinlock and &dlm->master_lock
misordering in different threads.

It was introduced by commit 8d400b81cc83 ("ocfs2/dlm: Clean up refmap
helpers").  Since lockres is new, it doesn't not require the
&res->spinlock.  So remove it.

Fixes: 8d400b81cc83 ("ocfs2/dlm: Clean up refmap helpers")
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: joyce.xue <xuejiufei@huawei.com>
Reported-by: Guozhonghua <guozhonghua@h3c.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/ocfs2/dlm/dlmmaster.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index af3f7aa..1be3398 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -650,12 +650,9 @@ void dlm_lockres_clear_refmap_bit(struct dlm_ctxt *dlm,
 	clear_bit(bit, res->refmap);
 }
 
-
-void dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
+static void __dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
 				   struct dlm_lock_resource *res)
 {
-	assert_spin_locked(&res->spinlock);
-
 	res->inflight_locks++;
 
 	mlog(0, "%s: res %.*s, inflight++: now %u, %ps()\n", dlm->name,
@@ -663,6 +660,13 @@ void dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
 	     __builtin_return_address(0));
 }
 
+void dlm_lockres_grab_inflight_ref(struct dlm_ctxt *dlm,
+				   struct dlm_lock_resource *res)
+{
+	assert_spin_locked(&res->spinlock);
+	__dlm_lockres_grab_inflight_ref(dlm, res);
+}
+
 void dlm_lockres_drop_inflight_ref(struct dlm_ctxt *dlm,
 				   struct dlm_lock_resource *res)
 {
@@ -852,10 +856,8 @@ lookup:
 	/* finally add the lockres to its hash bucket */
 	__dlm_insert_lockres(dlm, res);
 
-	/* Grab inflight ref to pin the resource */
-	spin_lock(&res->spinlock);
-	dlm_lockres_grab_inflight_ref(dlm, res);
-	spin_unlock(&res->spinlock);
+	/* since this lockres is new it doesn't not require the spinlock */
+	__dlm_lockres_grab_inflight_ref(dlm, res);
 
 	/* get an extra ref on the mle in case this is a BLOCK
 	 * if so, the creator of the BLOCK may try to put the last
-- 
1.9.1


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

* [PATCH 3.13 145/163] mm, slab: initialize object alignment on cache creation
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (143 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 144/163] ocfs2/dlm: do not get resource spinlock if lockres is new Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 146/163] mm: softdirty: keep bit when zapping file pte Kamal Mostafa
                   ` (17 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Rientjes, Pekka Enberg, Joonsoo Kim, Andrew Morton,
	Linus Torvalds, Kamal Mostafa

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

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

From: David Rientjes <rientjes@google.com>

commit d4a5fca592b9ab52b90bb261a90af3c8f53be011 upstream.

Since commit 4590685546a3 ("mm/sl[aou]b: Common alignment code"), the
"ralign" automatic variable in __kmem_cache_create() may be used as
uninitialized.

The proper alignment defaults to BYTES_PER_WORD and can be overridden by
SLAB_RED_ZONE or the alignment specified by the caller.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=85031

Signed-off-by: David Rientjes <rientjes@google.com>
Reported-by: Andrei Elovikov <a.elovikov@gmail.com>
Acked-by: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/slab.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index eb043bf..f985e8f 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2139,7 +2139,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep, gfp_t gfp)
 int
 __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
 {
-	size_t left_over, freelist_size, ralign;
+	size_t left_over, freelist_size;
+	size_t ralign = BYTES_PER_WORD;
 	gfp_t gfp;
 	int err;
 	size_t size = cachep->size;
@@ -2172,14 +2173,6 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags)
 		size &= ~(BYTES_PER_WORD - 1);
 	}
 
-	/*
-	 * Redzoning and user store require word alignment or possibly larger.
-	 * Note this will be overridden by architecture or caller mandated
-	 * alignment if either is greater than BYTES_PER_WORD.
-	 */
-	if (flags & SLAB_STORE_USER)
-		ralign = BYTES_PER_WORD;
-
 	if (flags & SLAB_RED_ZONE) {
 		ralign = REDZONE_ALIGN;
 		/* If redzoning, ensure that the second redzone is suitably
-- 
1.9.1


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

* [PATCH 3.13 146/163] mm: softdirty: keep bit when zapping file pte
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (144 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 145/163] mm, slab: initialize object alignment on cache creation Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 147/163] shmem: fix nlink for rename overwrite directory Kamal Mostafa
                   ` (16 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Feiner, Pavel Emelyanov, Jamie Liu, Hugh Dickins,
	Andrew Morton, Linus Torvalds, Kamal Mostafa

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

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

From: Peter Feiner <pfeiner@google.com>

commit dbab31aa2ceec2d201966fa0b552f151310ba5f4 upstream.

This fixes the same bug as b43790eedd31 ("mm: softdirty: don't forget to
save file map softdiry bit on unmap") and 9aed8614af5a ("mm/memory.c:
don't forget to set softdirty on file mapped fault") where the return
value of pte_*mksoft_dirty was being ignored.

To be sure that no other pte/pmd "mk" function return values were being
ignored, I annotated the functions in arch/x86/include/asm/pgtable.h
with __must_check and rebuilt.

The userspace effect of this bug is that the softdirty mark might be
lost if a file mapped pte get zapped.

Signed-off-by: Peter Feiner <pfeiner@google.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Jamie Liu <jamieliu@google.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index d411f0d..e3c11e4 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1119,7 +1119,7 @@ again:
 						addr) != page->index) {
 				pte_t ptfile = pgoff_to_pte(page->index);
 				if (pte_soft_dirty(ptent))
-					pte_file_mksoft_dirty(ptfile);
+					ptfile = pte_file_mksoft_dirty(ptfile);
 				set_pte_at(mm, addr, pte, ptfile);
 			}
 			if (PageAnon(page))
-- 
1.9.1


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

* [PATCH 3.13 147/163] shmem: fix nlink for rename overwrite directory
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (145 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 146/163] mm: softdirty: keep bit when zapping file pte Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 148/163] ARM: 8165/1: alignment: don't break misaligned NEON load/store Kamal Mostafa
                   ` (15 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Miklos Szeredi, Al Viro, Kamal Mostafa

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

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

From: Miklos Szeredi <mszeredi@suse.cz>

commit b928095b0a7cff7fb9fcf4c706348ceb8ab2c295 upstream.

If overwriting an empty directory with rename, then need to drop the extra
nlink.

Test prog:

#include <stdio.h>
#include <fcntl.h>
#include <err.h>
#include <sys/stat.h>

int main(void)
{
	const char *test_dir1 = "test-dir1";
	const char *test_dir2 = "test-dir2";
	int res;
	int fd;
	struct stat statbuf;

	res = mkdir(test_dir1, 0777);
	if (res == -1)
		err(1, "mkdir(\"%s\")", test_dir1);

	res = mkdir(test_dir2, 0777);
	if (res == -1)
		err(1, "mkdir(\"%s\")", test_dir2);

	fd = open(test_dir2, O_RDONLY);
	if (fd == -1)
		err(1, "open(\"%s\")", test_dir2);

	res = rename(test_dir1, test_dir2);
	if (res == -1)
		err(1, "rename(\"%s\", \"%s\")", test_dir1, test_dir2);

	res = fstat(fd, &statbuf);
	if (res == -1)
		err(1, "fstat(%i)", fd);

	if (statbuf.st_nlink != 0) {
		fprintf(stderr, "nlink is %lu, should be 0\n", statbuf.st_nlink);
		return 1;
	}

	return 0;
}

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/shmem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index de64924..bed15b5 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2157,8 +2157,10 @@ static int shmem_rename(struct inode *old_dir, struct dentry *old_dentry, struct
 
 	if (new_dentry->d_inode) {
 		(void) shmem_unlink(new_dir, new_dentry);
-		if (they_are_dirs)
+		if (they_are_dirs) {
+			drop_nlink(new_dentry->d_inode);
 			drop_nlink(old_dir);
+		}
 	} else if (they_are_dirs) {
 		drop_nlink(old_dir);
 		inc_nlink(new_dir);
-- 
1.9.1


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

* [PATCH 3.13 148/163] ARM: 8165/1: alignment: don't break misaligned NEON load/store
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (146 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 147/163] shmem: fix nlink for rename overwrite directory Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 149/163] ASoC: core: fix possible ZERO_SIZE_PTR pointer dereferencing error Kamal Mostafa
                   ` (14 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Robin Murphy, Russell King, Kamal Mostafa

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

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

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

commit 5ca918e5e3f9df4634077c06585c42bc6a8d699a upstream.

The alignment fixup incorrectly decodes faulting ARM VLDn/VSTn
instructions (where the optional alignment hint is given but incorrect)
as LDR/STR, leading to register corruption. Detect these and correctly
treat them as unhandled, so that userspace gets the fault it expects.

Reported-by: Simon Hosie <simon.hosie@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm/mm/alignment.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 9240364..d301662 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -40,6 +40,7 @@
  * This code is not portable to processors with late data abort handling.
  */
 #define CODING_BITS(i)	(i & 0x0e000000)
+#define COND_BITS(i)	(i & 0xf0000000)
 
 #define LDST_I_BIT(i)	(i & (1 << 26))		/* Immediate constant	*/
 #define LDST_P_BIT(i)	(i & (1 << 24))		/* Preindex		*/
@@ -817,6 +818,8 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 		break;
 
 	case 0x04000000:	/* ldr or str immediate */
+		if (COND_BITS(instr) == 0xf0000000) /* NEON VLDn, VSTn */
+			goto bad;
 		offset.un = OFFSET_BITS(instr);
 		handler = do_alignment_ldrstr;
 		break;
-- 
1.9.1


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

* [PATCH 3.13 149/163] ASoC: core: fix possible ZERO_SIZE_PTR pointer dereferencing error.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (147 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 148/163] ARM: 8165/1: alignment: don't break misaligned NEON load/store Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 150/163] cpufreq: integrator: fix integrator_cpufreq_remove return type Kamal Mostafa
                   ` (13 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Xiubo Li, Mark Brown, Kamal Mostafa

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

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

From: Xiubo Li <Li.Xiubo@freescale.com>

commit 6596aa047b624aeec2ea321962cfdecf9953a383 upstream.

Since we cannot make sure the 'params->num_regs' will always be none
zero here, and then if it equals to zero, the kmemdup() will return
ZERO_SIZE_PTR, which equals to ((void *)16).

So this patch fix this with just doing the zero check before calling
kmemdup().

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a66783e..a3830d1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3236,7 +3236,7 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
 	unsigned int val;
 	void *data;
 
-	if (!codec->using_regmap)
+	if (!codec->using_regmap || !params->num_regs)
 		return -EINVAL;
 
 	len = params->num_regs * codec->val_bytes;
-- 
1.9.1


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

* [PATCH 3.13 150/163] cpufreq: integrator: fix integrator_cpufreq_remove return type
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (148 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 149/163] ASoC: core: fix possible ZERO_SIZE_PTR pointer dereferencing error Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 151/163] drm/i915: Flush the PTEs after updating them before suspend Kamal Mostafa
                   ` (12 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Arnd Bergmann, Rafael J. Wysocki, Kamal Mostafa

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit d62dbf77f7dfaa6fb455b4b9828069a11965929c upstream.

When building this driver as a module, we get a helpful warning
about the return type:

drivers/cpufreq/integrator-cpufreq.c:232:2: warning: initialization from incompatible pointer type
  .remove = __exit_p(integrator_cpufreq_remove),

If the remove callback returns void, the caller gets an undefined
value as it expects an integer to be returned. This fixes the
problem by passing down the value from cpufreq_unregister_driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/cpufreq/integrator-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/integrator-cpufreq.c b/drivers/cpufreq/integrator-cpufreq.c
index 7d8ab000d..572955f 100644
--- a/drivers/cpufreq/integrator-cpufreq.c
+++ b/drivers/cpufreq/integrator-cpufreq.c
@@ -212,9 +212,9 @@ static int __init integrator_cpufreq_probe(struct platform_device *pdev)
 	return cpufreq_register_driver(&integrator_driver);
 }
 
-static void __exit integrator_cpufreq_remove(struct platform_device *pdev)
+static int __exit integrator_cpufreq_remove(struct platform_device *pdev)
 {
-	cpufreq_unregister_driver(&integrator_driver);
+	return cpufreq_unregister_driver(&integrator_driver);
 }
 
 static const struct of_device_id integrator_cpufreq_match[] = {
-- 
1.9.1


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

* [PATCH 3.13 151/163] drm/i915: Flush the PTEs after updating them before suspend
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (149 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 150/163] cpufreq: integrator: fix integrator_cpufreq_remove return type Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 152/163] ARM: 8178/1: fix set_tls for !CONFIG_KUSER_HELPERS Kamal Mostafa
                   ` (11 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Chris Wilson, Takashi Iwai, Paulo Zanoni, Todd Previte,
	Daniel Vetter, Jani Nikula, Kamal Mostafa

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

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

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

commit 91e56499304f3d612053a9cf17f350868182c7d8 upstream.

As we use WC updates of the PTE, we are responsible for notifying the
hardware when to flush its TLBs. Do so after we zap all the PTEs before
suspend (and the BIOS tries to read our GTT).

Fixes a regression from

commit 828c79087cec61eaf4c76bb32c222fbe35ac3930
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Wed Oct 16 09:21:30 2013 -0700

    drm/i915: Disable GGTT PTEs on GEN6+ suspend

that survived and continue to cause harm even after

commit e568af1c626031925465a5caaab7cca1303d55c7
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Mar 26 20:08:20 2014 +0100

    drm/i915: Undo gtt scratch pte unmapping again

v2: Trivial rebase.
v3: Fixes requires pointer dances.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82340
Tested-by: ming.yao@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Todd Previte <tprevite@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index e79720d..db362d1 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -813,6 +813,16 @@ void i915_check_and_clear_faults(struct drm_device *dev)
 	POSTING_READ(RING_FAULT_REG(&dev_priv->ring[RCS]));
 }
 
+static void i915_ggtt_flush(struct drm_i915_private *dev_priv)
+{
+	if (INTEL_INFO(dev_priv->dev)->gen < 6) {
+		intel_gtt_chipset_flush();
+	} else {
+		I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
+		POSTING_READ(GFX_FLSH_CNTL_GEN6);
+	}
+}
+
 void i915_gem_suspend_gtt_mappings(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -829,6 +839,8 @@ void i915_gem_suspend_gtt_mappings(struct drm_device *dev)
 				       dev_priv->gtt.base.start / PAGE_SIZE,
 				       dev_priv->gtt.base.total / PAGE_SIZE,
 				       true);
+
+	i915_ggtt_flush(dev_priv);
 }
 
 void i915_gem_restore_gtt_mappings(struct drm_device *dev)
@@ -849,7 +861,7 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev)
 		i915_gem_gtt_bind_object(obj, obj->cache_level);
 	}
 
-	i915_gem_chipset_flush(dev);
+	i915_ggtt_flush(dev_priv);
 }
 
 int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj)
-- 
1.9.1


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

* [PATCH 3.13 152/163] ARM: 8178/1: fix set_tls for !CONFIG_KUSER_HELPERS
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (150 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 151/163] drm/i915: Flush the PTEs after updating them before suspend Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 153/163] md/raid5: disable 'DISCARD' by default due to safety concerns Kamal Mostafa
                   ` (10 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Nathan Lynch, Russell King, Kamal Mostafa

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

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

From: Nathan Lynch <nathan_lynch@mentor.com>

commit 9cc6d9e5daaa147a9a3e31557efcb331989e77be upstream.

Joachim Eastwood reports that commit fbfb872f5f41 "ARM: 8148/1: flush
TLS and thumbee register state during exec" causes a boot-time crash
on a Cortex-M4 nommu system:

Freeing unused kernel memory: 68K (281e5000 - 281f6000)
Unhandled exception: IPSR = 00000005 LR = fffffff1
CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-rc6-00313-gd2205fa30aa7 #191
task: 29834000 ti: 29832000 task.ti: 29832000
PC is at flush_thread+0x2e/0x40
LR is at flush_thread+0x21/0x40
pc : [<2800954a>] lr : [<2800953d>] psr: 4100000b
sp : 29833d60 ip : 00000000 fp : 00000001
r10: 00003cf8 r9 : 29b1f000 r8 : 00000000
r7 : 29b0bc00 r6 : 29834000 r5 : 29832000 r4 : 29832000
r3 : ffff0ff0 r2 : 29832000 r1 : 00000000 r0 : 282121f0
xPSR: 4100000b
CPU: 0 PID: 1 Comm: swapper Not tainted 3.17.0-rc6-00313-gd2205fa30aa7 #191
[<2800afa5>] (unwind_backtrace) from [<2800a327>] (show_stack+0xb/0xc)
[<2800a327>] (show_stack) from [<2800a963>] (__invalid_entry+0x4b/0x4c)

The problem is that set_tls is attempting to clear the TLS location in
the kernel-user helper page, which isn't set up on V7M.

Fix this by guarding the write to the kuser helper page with
a CONFIG_KUSER_HELPERS ifdef.

Fixes: fbfb872f5f41 ARM: 8148/1: flush TLS and thumbee register state during exec

Reported-by: Joachim Eastwood <manabian@gmail.com>
Tested-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm/include/asm/tls.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
index 36172ad..5f833f7 100644
--- a/arch/arm/include/asm/tls.h
+++ b/arch/arm/include/asm/tls.h
@@ -81,6 +81,7 @@ static inline void set_tls(unsigned long val)
 			asm("mcr p15, 0, %0, c13, c0, 3"
 			    : : "r" (val));
 		} else {
+#ifdef CONFIG_KUSER_HELPERS
 			/*
 			 * User space must never try to access this
 			 * directly.  Expect your app to break
@@ -89,6 +90,7 @@ static inline void set_tls(unsigned long val)
 			 * entry-armv.S for details)
 			 */
 			*((unsigned int *)0xffff0ff0) = val;
+#endif
 		}
 
 	}
-- 
1.9.1


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

* [PATCH 3.13 153/163] md/raid5: disable 'DISCARD' by default due to safety concerns.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (151 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 152/163] ARM: 8178/1: fix set_tls for !CONFIG_KUSER_HELPERS Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:02 ` [PATCH 3.13 154/163] mm: migrate: Close race between migration completion and mprotect Kamal Mostafa
                   ` (9 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Shaohua Li, Martin K. Petersen, Mike Snitzer, Heinz Mauelshagen,
	NeilBrown, Kamal Mostafa

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

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

From: NeilBrown <neilb@suse.de>

commit 8e0e99ba64c7ba46133a7c8a3e3f7de01f23bd93 upstream.

It has come to my attention (thanks Martin) that 'discard_zeroes_data'
is only a hint.  Some devices in some cases don't do what it
says on the label.

The use of DISCARD in RAID5 depends on reads from discarded regions
being predictably zero.  If a write to a previously discarded region
performs a read-modify-write cycle it assumes that the parity block
was consistent with the data blocks.  If all were zero, this would
be the case.  If some are and some aren't this would not be the case.
This could lead to data corruption after a device failure when
data needs to be reconstructed from the parity.

As we cannot trust 'discard_zeroes_data', ignore it by default
and so disallow DISCARD on all raid4/5/6 arrays.

As many devices are trustworthy, and as there are benefits to using
DISCARD, add a module parameter to over-ride this caution and cause
DISCARD to work if discard_zeroes_data is set.

If a site want to enable DISCARD on some arrays but not on others they
should select DISCARD support at the filesystem level, and set the
raid456 module parameter.
    raid456.devices_handle_discard_safely=Y

As this is a data-safety issue, I believe this patch is suitable for
-stable.
DISCARD support for RAID456 was added in 3.7

Cc: Shaohua Li <shli@kernel.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Heinz Mauelshagen <heinzm@redhat.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Fixes: 620125f2bf8ff0c4969b79653b54d7bcc9d40637
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/md/raid5.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index fd900ef..498ccf3 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -64,6 +64,10 @@
 #define cpu_to_group(cpu) cpu_to_node(cpu)
 #define ANY_GROUP NUMA_NO_NODE
 
+static bool devices_handle_discard_safely = false;
+module_param(devices_handle_discard_safely, bool, 0644);
+MODULE_PARM_DESC(devices_handle_discard_safely,
+		 "Set to Y if all devices in each array reliably return zeroes on reads from discarded regions");
 static struct workqueue_struct *raid5_wq;
 /*
  * Stripe cache
@@ -6114,7 +6118,7 @@ static int run(struct mddev *mddev)
 		mddev->queue->limits.discard_granularity = stripe;
 		/*
 		 * unaligned part of discard request will be ignored, so can't
-		 * guarantee discard_zerors_data
+		 * guarantee discard_zeroes_data
 		 */
 		mddev->queue->limits.discard_zeroes_data = 0;
 
@@ -6139,6 +6143,18 @@ static int run(struct mddev *mddev)
 			    !bdev_get_queue(rdev->bdev)->
 						limits.discard_zeroes_data)
 				discard_supported = false;
+			/* Unfortunately, discard_zeroes_data is not currently
+			 * a guarantee - just a hint.  So we only allow DISCARD
+			 * if the sysadmin has confirmed that only safe devices
+			 * are in use by setting a module parameter.
+			 */
+			if (!devices_handle_discard_safely) {
+				if (discard_supported) {
+					pr_info("md/raid456: discard support disabled due to uncertainty.\n");
+					pr_info("Set raid456.devices_handle_discard_safely=Y to override.\n");
+				}
+				discard_supported = false;
+			}
 		}
 
 		if (discard_supported &&
-- 
1.9.1


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

* [PATCH 3.13 154/163] mm: migrate: Close race between migration completion and mprotect
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (152 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 153/163] md/raid5: disable 'DISCARD' by default due to safety concerns Kamal Mostafa
@ 2014-10-09 21:02 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 155/163] mm: numa: Do not mark PTEs pte_numa when splitting huge pages Kamal Mostafa
                   ` (8 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:02 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mel Gorman, Linus Torvalds, Kamal Mostafa

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

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

From: Mel Gorman <mgorman@suse.de>

commit d3cb8bf6081b8b7a2dabb1264fe968fd870fa595 upstream.

A migration entry is marked as write if pte_write was true at the time the
entry was created. The VMA protections are not double checked when migration
entries are being removed as mprotect marks write-migration-entries as
read. It means that potentially we take a spurious fault to mark PTEs write
again but it's straight-forward. However, there is a race between write
migrations being marked read and migrations finishing. This potentially
allows a PTE to be write that should have been read. Close this race by
double checking the VMA permissions using maybe_mkwrite when migration
completes.

[torvalds@linux-foundation.org: use maybe_mkwrite]
Signed-off-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/migrate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 9194375..62047f8 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -164,8 +164,11 @@ static int remove_migration_pte(struct page *new, struct vm_area_struct *vma,
 	pte = pte_mkold(mk_pte(new, vma->vm_page_prot));
 	if (pte_swp_soft_dirty(*ptep))
 		pte = pte_mksoft_dirty(pte);
+
+	/* Recheck VMA as permissions can change since migration started  */
 	if (is_write_migration_entry(entry))
-		pte = pte_mkwrite(pte);
+		pte = maybe_mkwrite(pte, vma);
+
 #ifdef CONFIG_HUGETLB_PAGE
 	if (PageHuge(new)) {
 		pte = pte_mkhuge(pte);
-- 
1.9.1


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

* [PATCH 3.13 155/163] mm: numa: Do not mark PTEs pte_numa when splitting huge pages
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (153 preceding siblings ...)
  2014-10-09 21:02 ` [PATCH 3.13 154/163] mm: migrate: Close race between migration completion and mprotect Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 156/163] Fix problem recognizing symlinks Kamal Mostafa
                   ` (7 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mel Gorman, Linus Torvalds, Kamal Mostafa

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

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

From: Mel Gorman <mgorman@suse.de>

commit abc40bd2eeb77eb7c2effcaf63154aad929a1d5f upstream.

This patch reverts 1ba6e0b50b ("mm: numa: split_huge_page: transfer the
NUMA type from the pmd to the pte"). If a huge page is being split due
a protection change and the tail will be in a PROT_NONE vma then NUMA
hinting PTEs are temporarily created in the protected VMA.

 VM_RW|VM_PROTNONE
|-----------------|
      ^
      split here

In the specific case above, it should get fixed up by change_pte_range()
but there is a window of opportunity for weirdness to happen. Similarly,
if a huge page is shrunk and split during a protection update but before
pmd_numa is cleared then a pte_numa can be left behind.

Instead of adding complexity trying to deal with the case, this patch
will not mark PTEs NUMA when splitting a huge page. NUMA hinting faults
will not be triggered which is marginal in comparison to the complexity
in dealing with the corner cases during THP split.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/huge_memory.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index a2256e0..64a7f9c 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1823,6 +1823,11 @@ static int __split_huge_page_map(struct page *page,
 		for (i = 0; i < HPAGE_PMD_NR; i++, haddr += PAGE_SIZE) {
 			pte_t *pte, entry;
 			BUG_ON(PageCompound(page+i));
+			/*
+			 * Note that pmd_numa is not transferred deliberately
+			 * to avoid any possibility that pte_numa leaks to
+			 * a PROT_NONE VMA by accident.
+			 */
 			entry = mk_pte(page + i, vma->vm_page_prot);
 			entry = maybe_mkwrite(pte_mkdirty(entry), vma);
 			if (!pmd_write(*pmd))
@@ -1831,8 +1836,6 @@ static int __split_huge_page_map(struct page *page,
 				BUG_ON(page_mapcount(page) != 1);
 			if (!pmd_young(*pmd))
 				entry = pte_mkold(entry);
-			if (pmd_numa(*pmd))
-				entry = pte_mknuma(entry);
 			pte = pte_offset_map(&_pmd, haddr);
 			BUG_ON(!pte_none(*pte));
 			set_pte_at(mm, haddr, pte, entry);
-- 
1.9.1


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

* [PATCH 3.13 156/163] Fix problem recognizing symlinks
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (154 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 155/163] mm: numa: Do not mark PTEs pte_numa when splitting huge pages Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 157/163] mm: memcontrol: do not iterate uninitialized memcgs Kamal Mostafa
                   ` (6 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Steve French, Kamal Mostafa

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

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

From: Steve French <smfrench@gmail.com>

commit 19e81573fca7b87ced7701e01ba164b968d929bd upstream.

Changeset eb85d94bd introduced a problem where if a cifs open
fails during query info of a file we
will still try to close the file (happens with certain types
of reparse points) even though the file handle is not valid.

In addition for SMB2/SMB3 we were not mapping the return code returned
by Windows when trying to open a file (like a Windows NFS symlink)
which is a reparse point.

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/cifs/smb1ops.c      | 2 +-
 fs/cifs/smb2maperror.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index c66a726..0503edf 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -579,7 +579,7 @@ cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
 			cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
 		if (tmprc == -EOPNOTSUPP)
 			*symlink = true;
-		else
+		else if (tmprc == 0)
 			CIFSSMBClose(xid, tcon, netfid);
 	}
 
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index a689514..a491814 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -256,6 +256,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
 	{STATUS_DLL_MIGHT_BE_INCOMPATIBLE, -EIO,
 	"STATUS_DLL_MIGHT_BE_INCOMPATIBLE"},
 	{STATUS_STOPPED_ON_SYMLINK, -EOPNOTSUPP, "STATUS_STOPPED_ON_SYMLINK"},
+	{STATUS_IO_REPARSE_TAG_NOT_HANDLED, -EOPNOTSUPP,
+	"STATUS_REPARSE_NOT_HANDLED"},
 	{STATUS_DEVICE_REQUIRES_CLEANING, -EIO,
 	"STATUS_DEVICE_REQUIRES_CLEANING"},
 	{STATUS_DEVICE_DOOR_OPEN, -EIO, "STATUS_DEVICE_DOOR_OPEN"},
-- 
1.9.1


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

* [PATCH 3.13 157/163] mm: memcontrol: do not iterate uninitialized memcgs
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (155 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 156/163] Fix problem recognizing symlinks Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 158/163] perf: fix perf bug in fork() Kamal Mostafa
                   ` (5 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johannes Weiner, Tejun Heo, Hugh Dickins, Peter Zijlstra,
	Andrew Morton, Linus Torvalds, Kamal Mostafa

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

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

From: Johannes Weiner <hannes@cmpxchg.org>

commit 2f7dd7a4100ad4affcb141605bef178ab98ccb18 upstream.

The cgroup iterators yield css objects that have not yet gone through
css_online(), but they are not complete memcgs at this point and so the
memcg iterators should not return them.  Commit d8ad30559715 ("mm/memcg:
iteration skip memcgs not yet fully initialized") set out to implement
exactly this, but it uses CSS_ONLINE, a cgroup-internal flag that does
not meet the ordering requirements for memcg, and so the iterator may
skip over initialized groups, or return partially initialized memcgs.

The cgroup core can not reasonably provide a clear answer on whether the
object around the css has been fully initialized, as that depends on
controller-specific locking and lifetime rules.  Thus, introduce a
memcg-specific flag that is set after the memcg has been initialized in
css_online(), and read before mem_cgroup_iter() callers access the memcg
members.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: Johannes' 3.12 backport applied to 3.13-stable ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/memcontrol.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index a106a2d..6cbf902 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -251,6 +251,9 @@ struct mem_cgroup {
 	/* vmpressure notifications */
 	struct vmpressure vmpressure;
 
+	/* css_online() has been completed */
+	int initialized;
+
 	/*
 	 * the counter to account for mem+swap usage.
 	 */
@@ -1108,9 +1111,23 @@ skip_node:
 	 * skipping css reference should be safe.
 	 */
 	if (next_css) {
-		if ((next_css == &root->css) ||
-		    ((next_css->flags & CSS_ONLINE) && css_tryget(next_css)))
-			return mem_cgroup_from_css(next_css);
+		struct mem_cgroup *memcg = mem_cgroup_from_css(next_css);
+
+		if (next_css == &root->css)
+			return memcg;
+
+		if (css_tryget(next_css)) {
+			if (memcg->initialized) {
+				/*
+				 * Make sure the memcg is initialized:
+				 * mem_cgroup_css_online() orders the the
+				 * initialization against setting the flag.
+				 */
+				smp_rmb();
+				return memcg;
+			}
+			css_put(next_css);
+		}
 
 		prev_css = next_css;
 		goto skip_node;
@@ -6341,6 +6358,16 @@ mem_cgroup_css_online(struct cgroup_subsys_state *css)
 
 	error = memcg_init_kmem(memcg, &mem_cgroup_subsys);
 	mutex_unlock(&memcg_create_mutex);
+
+	if (!error) {
+		/*
+		 * Make sure the memcg is initialized: mem_cgroup_iter()
+		 * orders reading memcg->initialized against its callers
+		 * reading the memcg members.
+		 */
+		smp_wmb();
+		memcg->initialized = 1;
+	}
 	return error;
 }
 
-- 
1.9.1


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

* [PATCH 3.13 158/163] perf: fix perf bug in fork()
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (156 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 157/163] mm: memcontrol: do not iterate uninitialized memcgs Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 159/163] mm: page_alloc: fix zone allocation fairness on UP Kamal Mostafa
                   ` (4 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Zijlstra (Intel),
	Ingo Molnar, Andrew Morton, Linus Torvalds, Kamal Mostafa

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

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

From: Peter Zijlstra <peterz@infradead.org>

commit 6c72e3501d0d62fc064d3680e5234f3463ec5a86 upstream.

Oleg noticed that a cleanup by Sylvain actually uncovered a bug; by
calling perf_event_free_task() when failing sched_fork() we will not yet
have done the memset() on ->perf_event_ctxp[] and will therefore try and
'free' the inherited contexts, which are still in use by the parent
process.  This is bad..

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Sylvain 'ythier' Hitier <sylvain.hitier@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/events/core.c | 4 +++-
 kernel/fork.c        | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 38f0d1b..6acd7d9 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7808,8 +7808,10 @@ int perf_event_init_task(struct task_struct *child)
 
 	for_each_task_context_nr(ctxn) {
 		ret = perf_event_init_context(child, ctxn);
-		if (ret)
+		if (ret) {
+			perf_event_free_task(child);
 			return ret;
+		}
 	}
 
 	return 0;
diff --git a/kernel/fork.c b/kernel/fork.c
index d0ca776..5726bf1 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1323,7 +1323,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
 		goto bad_fork_cleanup_policy;
 	retval = audit_alloc(p);
 	if (retval)
-		goto bad_fork_cleanup_policy;
+		goto bad_fork_cleanup_perf;
 	/* copy all the process information */
 	retval = copy_semundo(clone_flags, p);
 	if (retval)
@@ -1522,8 +1522,9 @@ bad_fork_cleanup_semundo:
 	exit_sem(p);
 bad_fork_cleanup_audit:
 	audit_free(p);
-bad_fork_cleanup_policy:
+bad_fork_cleanup_perf:
 	perf_event_free_task(p);
+bad_fork_cleanup_policy:
 #ifdef CONFIG_NUMA
 	mpol_put(p->mempolicy);
 bad_fork_cleanup_cgroup:
-- 
1.9.1


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

* [PATCH 3.13 159/163] mm: page_alloc: fix zone allocation fairness on UP
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (157 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 158/163] perf: fix perf bug in fork() Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 160/163] init/Kconfig: Hide printk log config if CONFIG_PRINTK=n Kamal Mostafa
                   ` (3 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johannes Weiner, Andrew Morton, Kamal Mostafa

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

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

From: Johannes Weiner <hannes@cmpxchg.org>

commit abe5f972912d086c080be4bde67750630b6fb38b upstream.

The zone allocation batches can easily underflow due to higher-order
allocations or spills to remote nodes.  On SMP that's fine, because
underflows are expected from concurrency and dealt with by returning 0.
But on UP, zone_page_state will just return a wrapped unsigned long, which
will get past the <= 0 check and then consider the zone eligible until its
watermarks are hit.

3a025760fc15 ("mm: page_alloc: spill to remote nodes before waking
kswapd") already made the counter-resetting use atomic_long_read() to
accomodate underflows from remote spills, but it didn't go all the way
with it.  Make it clear that these batches are expected to go negative
regardless of concurrency, and use atomic_long_read() everywhere.

Fixes: 81c0a2bb515f ("mm: page_alloc: fair zone allocator policy")
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ kamal: Johannes' 3.12 backport applied to 3.13-stable ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 mm/page_alloc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9aad4f1..38dca81 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1932,7 +1932,7 @@ zonelist_scan:
 		if (alloc_flags & ALLOC_FAIR) {
 			if (!zone_local(preferred_zone, zone))
 				continue;
-			if (zone_page_state(zone, NR_ALLOC_BATCH) <= 0)
+			if (atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]) <= 0)
 				continue;
 		}
 		/*
@@ -5599,9 +5599,8 @@ static void __setup_per_zone_wmarks(void)
 		zone->watermark[WMARK_HIGH] = min_wmark_pages(zone) + (tmp >> 1);
 
 		__mod_zone_page_state(zone, NR_ALLOC_BATCH,
-				      high_wmark_pages(zone) -
-				      low_wmark_pages(zone) -
-				      zone_page_state(zone, NR_ALLOC_BATCH));
+			high_wmark_pages(zone) - low_wmark_pages(zone) -
+			atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]));
 
 		setup_zone_migrate_reserve(zone);
 		spin_unlock_irqrestore(&zone->lock, flags);
-- 
1.9.1


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

* [PATCH 3.13 160/163] init/Kconfig: Hide printk log config if CONFIG_PRINTK=n
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (158 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 159/163] mm: page_alloc: fix zone allocation fairness on UP Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 161/163] init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu Kamal Mostafa
                   ` (2 subsequent siblings)
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Josh Triplett, Kamal Mostafa

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

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

From: Josh Triplett <josh@joshtriplett.org>

commit 361e9dfbaae84b0b246ed18d1ab7c82a1a41b53e upstream.

The buffers sized by CONFIG_LOG_BUF_SHIFT and
CONFIG_LOG_CPU_MAX_BUF_SHIFT do not exist if CONFIG_PRINTK=n, so don't
ask about their size at all.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
[ kamal: backport to 3.13-stable: only LOG_BUF_SHIFT ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init/Kconfig b/init/Kconfig
index c3a1d7c..bb3a9f1 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -783,6 +783,7 @@ config LOG_BUF_SHIFT
 	int "Kernel log buffer size (16 => 64KB, 17 => 128KB)"
 	range 12 21
 	default 17
+	depends on PRINTK
 	help
 	  Select kernel log buffer size as a power of 2.
 	  Examples:
-- 
1.9.1


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

* [PATCH 3.13 161/163] init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (159 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 160/163] init/Kconfig: Hide printk log config if CONFIG_PRINTK=n Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 162/163] Revert "lzo: properly check for overruns" Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding Kamal Mostafa
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Josh Triplett, Kamal Mostafa

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

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

From: Josh Triplett <josh@joshtriplett.org>

commit 62b4d2041117f35ab2409c9f5c4b8d3dc8e59d0f upstream.

commit 03b8c7b623c80af264c4c8d6111e5c6289933666 ("futex: Allow
architectures to skip futex_atomic_cmpxchg_inatomic() test") added the
HAVE_FUTEX_CMPXCHG symbol right below FUTEX.  This placed it right in
the middle of the options for the EXPERT menu.  However,
HAVE_FUTEX_CMPXCHG does not depend on EXPERT or FUTEX, so Kconfig stops
placing items in the EXPERT menu, and displays the remaining several
EXPERT items (starting with EPOLL) directly in the General Setup menu.

Since both users of HAVE_FUTEX_CMPXCHG only select it "if FUTEX", make
HAVE_FUTEX_CMPXCHG itself depend on FUTEX.  With this change, the
subsequent items display as part of the EXPERT menu again; the EMBEDDED
menu now appears as the next top-level item in the General Setup menu,
which makes General Setup much shorter and more usable.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/init/Kconfig b/init/Kconfig
index bb3a9f1..819800e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1402,6 +1402,7 @@ config FUTEX
 
 config HAVE_FUTEX_CMPXCHG
 	bool
+	depends on FUTEX
 	help
 	  Architectures should select this if futex_atomic_cmpxchg_inatomic()
 	  is implemented and always working. This removes a couple of runtime
-- 
1.9.1


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

* [PATCH 3.13 162/163] Revert "lzo: properly check for overruns"
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (160 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 161/163] init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-09 21:03 ` [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding Kamal Mostafa
  162 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Don A. Bailey, Willy Tarreau, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Willy Tarreau <w@1wt.eu>

commit af958a38a60c7ca3d8a39c918c1baa2ff7b6b233 upstream.

This reverts commit 206a81c ("lzo: properly check for overruns").

As analysed by Willem Pinckaers, this fix is still incomplete on
certain rare corner cases, and it is easier to restart from the
original code.

Reported-by: Willem Pinckaers <willem@lekkertech.net>
Cc: "Don A. Bailey" <donb@securitymouse.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 lib/lzo/lzo1x_decompress_safe.c | 62 ++++++++++++++---------------------------
 1 file changed, 21 insertions(+), 41 deletions(-)

diff --git a/lib/lzo/lzo1x_decompress_safe.c b/lib/lzo/lzo1x_decompress_safe.c
index 8563081..569985d 100644
--- a/lib/lzo/lzo1x_decompress_safe.c
+++ b/lib/lzo/lzo1x_decompress_safe.c
@@ -19,31 +19,11 @@
 #include <linux/lzo.h>
 #include "lzodefs.h"
 
-#define HAVE_IP(t, x)					\
-	(((size_t)(ip_end - ip) >= (size_t)(t + x)) &&	\
-	 (((t + x) >= t) && ((t + x) >= x)))
-
-#define HAVE_OP(t, x)					\
-	(((size_t)(op_end - op) >= (size_t)(t + x)) &&	\
-	 (((t + x) >= t) && ((t + x) >= x)))
-
-#define NEED_IP(t, x)					\
-	do {						\
-		if (!HAVE_IP(t, x))			\
-			goto input_overrun;		\
-	} while (0)
-
-#define NEED_OP(t, x)					\
-	do {						\
-		if (!HAVE_OP(t, x))			\
-			goto output_overrun;		\
-	} while (0)
-
-#define TEST_LB(m_pos)					\
-	do {						\
-		if ((m_pos) < out)			\
-			goto lookbehind_overrun;	\
-	} while (0)
+#define HAVE_IP(x)      ((size_t)(ip_end - ip) >= (size_t)(x))
+#define HAVE_OP(x)      ((size_t)(op_end - op) >= (size_t)(x))
+#define NEED_IP(x)      if (!HAVE_IP(x)) goto input_overrun
+#define NEED_OP(x)      if (!HAVE_OP(x)) goto output_overrun
+#define TEST_LB(m_pos)  if ((m_pos) < out) goto lookbehind_overrun
 
 int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
 			  unsigned char *out, size_t *out_len)
@@ -78,14 +58,14 @@ int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
 					while (unlikely(*ip == 0)) {
 						t += 255;
 						ip++;
-						NEED_IP(1, 0);
+						NEED_IP(1);
 					}
 					t += 15 + *ip++;
 				}
 				t += 3;
 copy_literal_run:
 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
-				if (likely(HAVE_IP(t, 15) && HAVE_OP(t, 15))) {
+				if (likely(HAVE_IP(t + 15) && HAVE_OP(t + 15))) {
 					const unsigned char *ie = ip + t;
 					unsigned char *oe = op + t;
 					do {
@@ -101,8 +81,8 @@ copy_literal_run:
 				} else
 #endif
 				{
-					NEED_OP(t, 0);
-					NEED_IP(t, 3);
+					NEED_OP(t);
+					NEED_IP(t + 3);
 					do {
 						*op++ = *ip++;
 					} while (--t > 0);
@@ -115,7 +95,7 @@ copy_literal_run:
 				m_pos -= t >> 2;
 				m_pos -= *ip++ << 2;
 				TEST_LB(m_pos);
-				NEED_OP(2, 0);
+				NEED_OP(2);
 				op[0] = m_pos[0];
 				op[1] = m_pos[1];
 				op += 2;
@@ -139,10 +119,10 @@ copy_literal_run:
 				while (unlikely(*ip == 0)) {
 					t += 255;
 					ip++;
-					NEED_IP(1, 0);
+					NEED_IP(1);
 				}
 				t += 31 + *ip++;
-				NEED_IP(2, 0);
+				NEED_IP(2);
 			}
 			m_pos = op - 1;
 			next = get_unaligned_le16(ip);
@@ -157,10 +137,10 @@ copy_literal_run:
 				while (unlikely(*ip == 0)) {
 					t += 255;
 					ip++;
-					NEED_IP(1, 0);
+					NEED_IP(1);
 				}
 				t += 7 + *ip++;
-				NEED_IP(2, 0);
+				NEED_IP(2);
 			}
 			next = get_unaligned_le16(ip);
 			ip += 2;
@@ -174,7 +154,7 @@ copy_literal_run:
 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
 		if (op - m_pos >= 8) {
 			unsigned char *oe = op + t;
-			if (likely(HAVE_OP(t, 15))) {
+			if (likely(HAVE_OP(t + 15))) {
 				do {
 					COPY8(op, m_pos);
 					op += 8;
@@ -184,7 +164,7 @@ copy_literal_run:
 					m_pos += 8;
 				} while (op < oe);
 				op = oe;
-				if (HAVE_IP(6, 0)) {
+				if (HAVE_IP(6)) {
 					state = next;
 					COPY4(op, ip);
 					op += next;
@@ -192,7 +172,7 @@ copy_literal_run:
 					continue;
 				}
 			} else {
-				NEED_OP(t, 0);
+				NEED_OP(t);
 				do {
 					*op++ = *m_pos++;
 				} while (op < oe);
@@ -201,7 +181,7 @@ copy_literal_run:
 #endif
 		{
 			unsigned char *oe = op + t;
-			NEED_OP(t, 0);
+			NEED_OP(t);
 			op[0] = m_pos[0];
 			op[1] = m_pos[1];
 			op += 2;
@@ -214,15 +194,15 @@ match_next:
 		state = next;
 		t = next;
 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
-		if (likely(HAVE_IP(6, 0) && HAVE_OP(4, 0))) {
+		if (likely(HAVE_IP(6) && HAVE_OP(4))) {
 			COPY4(op, ip);
 			op += t;
 			ip += t;
 		} else
 #endif
 		{
-			NEED_IP(t, 3);
-			NEED_OP(t, 0);
+			NEED_IP(t + 3);
+			NEED_OP(t);
 			while (t > 0) {
 				*op++ = *ip++;
 				t--;
-- 
1.9.1


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

* [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
                   ` (161 preceding siblings ...)
  2014-10-09 21:03 ` [PATCH 3.13 162/163] Revert "lzo: properly check for overruns" Kamal Mostafa
@ 2014-10-09 21:03 ` Kamal Mostafa
  2014-10-10  5:30   ` Willy Tarreau
  162 siblings, 1 reply; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:03 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Don A. Bailey, Willy Tarreau, Greg Kroah-Hartman, Kamal Mostafa

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

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

From: Willy Tarreau <w@1wt.eu>

commit 72cf90124e87d975d0b2114d930808c58b4c05e4 upstream.

This fix ensures that we never meet an integer overflow while adding
255 while parsing a variable length encoding. It works differently from
commit 206a81c ("lzo: properly check for overruns") because instead of
ensuring that we don't overrun the input, which is tricky to guarantee
due to many assumptions in the code, it simply checks that the cumulated
number of 255 read cannot overflow by bounding this number.

The MAX_255_COUNT is the maximum number of times we can add 255 to a base
count without overflowing an integer. The multiply will overflow when
multiplying 255 by more than MAXINT/255. The sum will overflow earlier
depending on the base count. Since the base count is taken from a u8
and a few bits, it is safe to assume that it will always be lower than
or equal to 2*255, thus we can always prevent any overflow by accepting
two less 255 steps.

This patch also reduces the CPU overhead and actually increases performance
by 1.1% compared to the initial code, while the previous fix costs 3.1%
(measured on x86_64).

The fix needs to be backported to all currently supported stable kernels.

Reported-by: Willem Pinckaers <willem@lekkertech.net>
Cc: "Don A. Bailey" <donb@securitymouse.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 lib/lzo/lzo1x_decompress_safe.c | 43 +++++++++++++++++++++++++++++++++++------
 1 file changed, 37 insertions(+), 6 deletions(-)

diff --git a/lib/lzo/lzo1x_decompress_safe.c b/lib/lzo/lzo1x_decompress_safe.c
index 569985d..a1c387f 100644
--- a/lib/lzo/lzo1x_decompress_safe.c
+++ b/lib/lzo/lzo1x_decompress_safe.c
@@ -25,6 +25,16 @@
 #define NEED_OP(x)      if (!HAVE_OP(x)) goto output_overrun
 #define TEST_LB(m_pos)  if ((m_pos) < out) goto lookbehind_overrun
 
+/* This MAX_255_COUNT is the maximum number of times we can add 255 to a base
+ * count without overflowing an integer. The multiply will overflow when
+ * multiplying 255 by more than MAXINT/255. The sum will overflow earlier
+ * depending on the base count. Since the base count is taken from a u8
+ * and a few bits, it is safe to assume that it will always be lower than
+ * or equal to 2*255, thus we can always prevent any overflow by accepting
+ * two less 255 steps. See Documentation/lzo.txt for more information.
+ */
+#define MAX_255_COUNT      ((((size_t)~0) / 255) - 2)
+
 int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
 			  unsigned char *out, size_t *out_len)
 {
@@ -55,12 +65,19 @@ int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
 		if (t < 16) {
 			if (likely(state == 0)) {
 				if (unlikely(t == 0)) {
+					size_t offset;
+					const unsigned char *ip_last = ip;
+
 					while (unlikely(*ip == 0)) {
-						t += 255;
 						ip++;
 						NEED_IP(1);
 					}
-					t += 15 + *ip++;
+					offset = ip - ip_last;
+					if (unlikely(offset > MAX_255_COUNT))
+						return LZO_E_ERROR;
+
+					offset = (offset << 8) - offset;
+					t += offset + 15 + *ip++;
 				}
 				t += 3;
 copy_literal_run:
@@ -116,12 +133,19 @@ copy_literal_run:
 		} else if (t >= 32) {
 			t = (t & 31) + (3 - 1);
 			if (unlikely(t == 2)) {
+				size_t offset;
+				const unsigned char *ip_last = ip;
+
 				while (unlikely(*ip == 0)) {
-					t += 255;
 					ip++;
 					NEED_IP(1);
 				}
-				t += 31 + *ip++;
+				offset = ip - ip_last;
+				if (unlikely(offset > MAX_255_COUNT))
+					return LZO_E_ERROR;
+
+				offset = (offset << 8) - offset;
+				t += offset + 31 + *ip++;
 				NEED_IP(2);
 			}
 			m_pos = op - 1;
@@ -134,12 +158,19 @@ copy_literal_run:
 			m_pos -= (t & 8) << 11;
 			t = (t & 7) + (3 - 1);
 			if (unlikely(t == 2)) {
+				size_t offset;
+				const unsigned char *ip_last = ip;
+
 				while (unlikely(*ip == 0)) {
-					t += 255;
 					ip++;
 					NEED_IP(1);
 				}
-				t += 7 + *ip++;
+				offset = ip - ip_last;
+				if (unlikely(offset > MAX_255_COUNT))
+					return LZO_E_ERROR;
+
+				offset = (offset << 8) - offset;
+				t += offset + 7 + *ip++;
 				NEED_IP(2);
 			}
 			next = get_unaligned_le16(ip);
-- 
1.9.1


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

* Re: [PATCH 3.13 026/163] block: Fix dev_t minor allocation lifetime
  2014-10-09 21:00 ` [PATCH 3.13 026/163] block: Fix dev_t minor allocation lifetime Kamal Mostafa
@ 2014-10-09 21:09   ` Jens Axboe
  2014-10-09 21:15     ` Kamal Mostafa
  0 siblings, 1 reply; 174+ messages in thread
From: Jens Axboe @ 2014-10-09 21:09 UTC (permalink / raw)
  To: Kamal Mostafa, linux-kernel, stable, kernel-team; +Cc: Keith Busch

On 10/09/2014 03:00 PM, Kamal Mostafa wrote:
> 3.13.11.9 -stable review patch.  If anyone has any objections, please let me know.

You need this one as well, like I told Greg the other day:

commit 46f341ffcfb5d8530f7d1e60f3be06cce6661b62
Author: Jens Axboe <axboe@fb.com>
Date:   Tue Sep 16 13:38:51 2014 -0600

    genhd: fix leftover might_sleep() in blk_free_devt()

    Commit 2da78092 changed the locking from a mutex to a spinlock,
    so we now longer sleep in this context. But there was a leftover
    might_sleep() in there, which now triggers since we do the final
    free from an RCU callback. Get rid of it.

    Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
    Signed-off-by: Jens Axboe <axboe@fb.com>

-- 
Jens Axboe


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

* Re: [PATCH 3.13 026/163] block: Fix dev_t minor allocation lifetime
  2014-10-09 21:09   ` Jens Axboe
@ 2014-10-09 21:15     ` Kamal Mostafa
  0 siblings, 0 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-09 21:15 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, stable, kernel-team, Keith Busch

On Thu, 2014-10-09 at 15:09 -0600, Jens Axboe wrote:
> On 10/09/2014 03:00 PM, Kamal Mostafa wrote:
> > 3.13.11.9 -stable review patch.  If anyone has any objections, please let me know.
> 
> You need this one as well, like I told Greg the other day:


Okay, this one is now queued for 3.13.11.9 also.  Thanks Jens!

 -Kamal


> commit 46f341ffcfb5d8530f7d1e60f3be06cce6661b62
> Author: Jens Axboe <axboe@fb.com>
> Date:   Tue Sep 16 13:38:51 2014 -0600
> 
>     genhd: fix leftover might_sleep() in blk_free_devt()
> 
>     Commit 2da78092 changed the locking from a mutex to a spinlock,
>     so we now longer sleep in this context. But there was a leftover
>     might_sleep() in there, which now triggers since we do the final
>     free from an RCU callback. Get rid of it.
> 
>     Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
>     Signed-off-by: Jens Axboe <axboe@fb.com>
> 



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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-09 21:03 ` [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding Kamal Mostafa
@ 2014-10-10  5:30   ` Willy Tarreau
  2014-10-13 17:31     ` Kamal Mostafa
  0 siblings, 1 reply; 174+ messages in thread
From: Willy Tarreau @ 2014-10-10  5:30 UTC (permalink / raw)
  To: Kamal Mostafa; +Cc: linux-kernel, stable, kernel-team, Greg Kroah-Hartman

Hi Kamal,

[ removed Don Bailey from the CC who's certainly not interested in this ]

On Thu, Oct 09, 2014 at 02:03:08PM -0700, Kamal Mostafa wrote:
> 3.13.11.9 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Willy Tarreau <w@1wt.eu>
> 
> commit 72cf90124e87d975d0b2114d930808c58b4c05e4 upstream.

(...)

This one (and the accompanying revert) are still not present in more
recent stable kernels, so I find it surprizing that you're proposing
to integrate them now. If someone upgrades from 3.13.11.9 to 3.14.21
or 3.16.5, they'd expect to keep all fixes but will lose this one, so
this is a bit confusing. Is there any reason you're not tracking fixes
from more recent versions like Jiri, Li, Ben and I are doing ?

Thanks,
Willy


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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-10  5:30   ` Willy Tarreau
@ 2014-10-13 17:31     ` Kamal Mostafa
  2014-10-13 18:48       ` Willy Tarreau
  2014-10-14  1:52       ` Greg Kroah-Hartman
  0 siblings, 2 replies; 174+ messages in thread
From: Kamal Mostafa @ 2014-10-13 17:31 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel, stable, kernel-team, Greg Kroah-Hartman

On Fri, 2014-10-10 at 07:30 +0200, Willy Tarreau wrote:
> Hi Kamal,
> 
> [ removed Don Bailey from the CC who's certainly not interested in this ]
> 
> On Thu, Oct 09, 2014 at 02:03:08PM -0700, Kamal Mostafa wrote:
> > 3.13.11.9 -stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Willy Tarreau <w@1wt.eu>
> > 
> > commit 72cf90124e87d975d0b2114d930808c58b4c05e4 upstream.
> 
> (...)

Hi Willy-

Thanks very much for reviewing this.

> This one (and the accompanying revert) are still not present in more
> recent stable kernels, so I find it surprizing that you're proposing
> to integrate them now.

I can hold out those lzo fixes until the next 3.13-stable if you prefer.
But fwiw...

>  If someone upgrades from 3.13.11.9 to 3.14.21
> or 3.16.5, they'd expect to keep all fixes but will lose this one, so
> this is a bit confusing.

I think those sorts of scheduling mismatches and discrepancies between
stable versions are pretty common.  Examples:  The top 11 commits in
v3.12.30 have not yet been applied[0] to any of the newer stable
branches;  Many of the commits in v3.10.57 have not yet been applied[1]
to linux-3.12.y but have been released in other newer stables.

>  Is there any reason you're not tracking fixes
> from more recent versions like Jiri, Li, Ben and I are doing ?

We (the Canonical stable maintainers) have always tracked the "cc:
stable" fixes directly from mainline, not from the more-recent-version
branches.  Given the examples above, it seems that the kernel.org
maintainers are doing that too, yes?

 -Kamal

[0] linux-3.12.y  1d08848..99ed1bd  (part of the big mm patch set)
[1] linux-3.10.y  07d209b..7dd3111  (various "cc: stable" patches)



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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-13 17:31     ` Kamal Mostafa
@ 2014-10-13 18:48       ` Willy Tarreau
  2014-10-14  1:52       ` Greg Kroah-Hartman
  1 sibling, 0 replies; 174+ messages in thread
From: Willy Tarreau @ 2014-10-13 18:48 UTC (permalink / raw)
  To: Kamal Mostafa; +Cc: linux-kernel, stable, kernel-team, Greg Kroah-Hartman

Hi Kamal,

On Mon, Oct 13, 2014 at 10:31:03AM -0700, Kamal Mostafa wrote:
> > This one (and the accompanying revert) are still not present in more
> > recent stable kernels, so I find it surprizing that you're proposing
> > to integrate them now.
> 
> I can hold out those lzo fixes until the next 3.13-stable if you prefer.

It would be better in my opinion.

> But fwiw...
> 
> >  If someone upgrades from 3.13.11.9 to 3.14.21
> > or 3.16.5, they'd expect to keep all fixes but will lose this one, so
> > this is a bit confusing.
> 
> I think those sorts of scheduling mismatches and discrepancies between
> stable versions are pretty common.

I don't think so. In my opinion when this happens it's mostly a mistake.

> Examples:  The top 11 commits in
> v3.12.30 have not yet been applied[0] to any of the newer stable
> branches;

I think this doesn't happen often and probably it's just a matter of
reporting it when it happens so that maintainers double-check on their
side.

> Many of the commits in v3.10.57 have not yet been applied[1]
> to linux-3.12.y but have been released in other newer stables.

In Jiri's defense, he's in the middle of two versions managed by Greg,
so when Greg sends a batch of 3.10+3.14 releases, there is a small
window where 3.12 can be lagging a bit. But I think that this is
different from having patches that are not in the most recent
versions because users are much less likely to upgrade from one of
Greg's maintained kernels to any of ours than the opposite.

> >  Is there any reason you're not tracking fixes
> > from more recent versions like Jiri, Li, Ben and I are doing ?
> 
> We (the Canonical stable maintainers) have always tracked the "cc:
> stable" fixes directly from mainline, not from the more-recent-version
> branches.  Given the examples above, it seems that the kernel.org
> maintainers are doing that too, yes?

Possible, I don't know for others though I know that Greg tends to
be picky about mistakes like this not to happen too often, so I
suspect there's a bit of care there. I'm personally in a special
situation considering that I'm on the tail so the amount of changes
to apply to certain patches to backport them suggests that I more
often pick them from 3.2 or 3.4 than mainline (except for the ones
that I receive directly).

I can't speak for Greg but I think that sometimes if you notice that
you're merging a patch which is missing in most recent -stable branches,
it would be nice to send a reminder about it, as it's certainly possible
that one slips through from time to time.
 
Thanks,
Willy


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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-13 17:31     ` Kamal Mostafa
  2014-10-13 18:48       ` Willy Tarreau
@ 2014-10-14  1:52       ` Greg Kroah-Hartman
  2014-10-14  8:58         ` Luis Henriques
  1 sibling, 1 reply; 174+ messages in thread
From: Greg Kroah-Hartman @ 2014-10-14  1:52 UTC (permalink / raw)
  To: Kamal Mostafa; +Cc: Willy Tarreau, linux-kernel, stable, kernel-team

On Mon, Oct 13, 2014 at 10:31:03AM -0700, Kamal Mostafa wrote:
> On Fri, 2014-10-10 at 07:30 +0200, Willy Tarreau wrote:
> > Hi Kamal,
> > 
> > [ removed Don Bailey from the CC who's certainly not interested in this ]
> > 
> > On Thu, Oct 09, 2014 at 02:03:08PM -0700, Kamal Mostafa wrote:
> > > 3.13.11.9 -stable review patch.  If anyone has any objections, please let me know.
> > > 
> > > ------------------
> > > 
> > > From: Willy Tarreau <w@1wt.eu>
> > > 
> > > commit 72cf90124e87d975d0b2114d930808c58b4c05e4 upstream.
> > 
> > (...)
> 
> Hi Willy-
> 
> Thanks very much for reviewing this.
> 
> > This one (and the accompanying revert) are still not present in more
> > recent stable kernels, so I find it surprizing that you're proposing
> > to integrate them now.
> 
> I can hold out those lzo fixes until the next 3.13-stable if you prefer.

Please do so.

> But fwiw...
> 
> >  If someone upgrades from 3.13.11.9 to 3.14.21
> > or 3.16.5, they'd expect to keep all fixes but will lose this one, so
> > this is a bit confusing.
> 
> I think those sorts of scheduling mismatches and discrepancies between
> stable versions are pretty common.  Examples:  The top 11 commits in
> v3.12.30 have not yet been applied[0] to any of the newer stable
> branches;

Those -mm patches from Mel are "special", I'm taking it slow in merging
them, doing lots of local testing and code review, and not all of them
even are relevant for 3.14, so don't take the acceptance /
non-acceptance of them as any kind of "proof" of anything at all.

> Many of the commits in v3.10.57 have not yet been applied[1]
> to linux-3.12.y but have been released in other newer stables.

That's because I am ahead of Jiri, which will almost always happen due
to our different workflows and time available to spend on stable
kernels.

> >  Is there any reason you're not tracking fixes
> > from more recent versions like Jiri, Li, Ben and I are doing ?
> 
> We (the Canonical stable maintainers) have always tracked the "cc:
> stable" fixes directly from mainline, not from the more-recent-version
> branches.  Given the examples above, it seems that the kernel.org
> maintainers are doing that too, yes?

You have included patches in your release that are not in _any_ public
release on kernel.org yet.  Which is fine, you are allowed to do
whatever you want, but that goes against the existing rules of stable
patches that we have been following for well over the past year for when
it is acceptable to add a patch to a stable release.

Yet another reason I _strongly_ urge you to mark your kernels with some
type of "name" to help reduce the confusion of others that your kernels
might be somehow associated with kernel.org releases.

greg k-h

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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-14  1:52       ` Greg Kroah-Hartman
@ 2014-10-14  8:58         ` Luis Henriques
  2014-10-16  8:10           ` Jiri Slaby
  2014-10-16 14:22           ` Greg Kroah-Hartman
  0 siblings, 2 replies; 174+ messages in thread
From: Luis Henriques @ 2014-10-14  8:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Kamal Mostafa, kernel-team, Willy Tarreau, stable, linux-kernel

On Tue, Oct 14, 2014 at 03:52:33AM +0200, Greg Kroah-Hartman wrote:
> On Mon, Oct 13, 2014 at 10:31:03AM -0700, Kamal Mostafa wrote:
> > On Fri, 2014-10-10 at 07:30 +0200, Willy Tarreau wrote:
> > > Hi Kamal,
> > > 
> > > [ removed Don Bailey from the CC who's certainly not interested in this ]
> > > 
> > > On Thu, Oct 09, 2014 at 02:03:08PM -0700, Kamal Mostafa wrote:
> > > > 3.13.11.9 -stable review patch.  If anyone has any objections, please let me know.
> > > > 
> > > > ------------------
> > > > 
> > > > From: Willy Tarreau <w@1wt.eu>
> > > > 
> > > > commit 72cf90124e87d975d0b2114d930808c58b4c05e4 upstream.
> > > 
> > > (...)
> > 
> > Hi Willy-
> > 
> > Thanks very much for reviewing this.
> > 
> > > This one (and the accompanying revert) are still not present in more
> > > recent stable kernels, so I find it surprizing that you're proposing
> > > to integrate them now.
> > 
> > I can hold out those lzo fixes until the next 3.13-stable if you prefer.
> 
> Please do so.
> 
> > But fwiw...
> > 
> > >  If someone upgrades from 3.13.11.9 to 3.14.21
> > > or 3.16.5, they'd expect to keep all fixes but will lose this one, so
> > > this is a bit confusing.
> > 
> > I think those sorts of scheduling mismatches and discrepancies between
> > stable versions are pretty common.  Examples:  The top 11 commits in
> > v3.12.30 have not yet been applied[0] to any of the newer stable
> > branches;
> 
> Those -mm patches from Mel are "special", I'm taking it slow in merging
> them, doing lots of local testing and code review, and not all of them
> even are relevant for 3.14, so don't take the acceptance /
> non-acceptance of them as any kind of "proof" of anything at all.
> 
> > Many of the commits in v3.10.57 have not yet been applied[1]
> > to linux-3.12.y but have been released in other newer stables.
> 
> That's because I am ahead of Jiri, which will almost always happen due
> to our different workflows and time available to spend on stable
> kernels.
> 
> > >  Is there any reason you're not tracking fixes
> > > from more recent versions like Jiri, Li, Ben and I are doing ?
> > 
> > We (the Canonical stable maintainers) have always tracked the "cc:
> > stable" fixes directly from mainline, not from the more-recent-version
> > branches.  Given the examples above, it seems that the kernel.org
> > maintainers are doing that too, yes?
> 
> You have included patches in your release that are not in _any_ public
> release on kernel.org yet.  Which is fine, you are allowed to do
> whatever you want, but that goes against the existing rules of stable
> patches that we have been following for well over the past year for when
> it is acceptable to add a patch to a stable release.
> 

Could you please provide us with examples of commits in one of our
extended stable trees that is not on any other public release at
kernel.org?  We really try hard to follow the process defined for the
official stable kernels, so if this has happen in the past it was
definitely a mistake from our side, and we would love to get your
feedback during the review cycles.

My understanding is that Kamal queued this specific patch because its
related with a security issue (CVE-2014-4608): the original fix is
being reverted upstream and he is queuing this revert and the
alternative fix.  Anyway, since Willy objected, its likely Kamal will
postpone including these patches in the 3.13 kernel.

Cheers,
--
Luís

> Yet another reason I _strongly_ urge you to mark your kernels with some
> type of "name" to help reduce the confusion of others that your kernels
> might be somehow associated with kernel.org releases.
> 
> greg k-h
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-14  8:58         ` Luis Henriques
@ 2014-10-16  8:10           ` Jiri Slaby
  2014-10-16 10:50             ` Luis Henriques
  2014-10-16 14:22           ` Greg Kroah-Hartman
  1 sibling, 1 reply; 174+ messages in thread
From: Jiri Slaby @ 2014-10-16  8:10 UTC (permalink / raw)
  To: Luis Henriques, Greg Kroah-Hartman
  Cc: Kamal Mostafa, kernel-team, Willy Tarreau, stable, linux-kernel

On 10/14/2014, 10:58 AM, Luis Henriques wrote:
> Could you please provide us with examples of commits in one of our
> extended stable trees that is not on any other public release at
> kernel.org?

Hi, from 3.12.y, for example:
commit 48e8cad86bb1241c08bdaa80db022c25068ff8e0
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Mon Jul 14 15:20:17 2014 +0200

    Revert "aio: fix kernel memory disclosure in io_getevents()
introduced in v3.10"

    This reverts commit 0e2e24e5dc6eb6f0698e9dc97e652f132b885624, which
    was applied twice mistakenly. The first one is
    bee3f7b8188d4b2a5dfaeb2eb4a68d99f67daecf.


Or any other patch without the "commit upstream" line. This may also
happen where there is no way of backporting a fix to the stable tree due
to later changes. Instead, a simple fix is applied, but it has no
connection to the original commit but the reference.

thanks,
-- 
js
suse labs

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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-16  8:10           ` Jiri Slaby
@ 2014-10-16 10:50             ` Luis Henriques
  0 siblings, 0 replies; 174+ messages in thread
From: Luis Henriques @ 2014-10-16 10:50 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Greg Kroah-Hartman, Kamal Mostafa, kernel-team, Willy Tarreau,
	stable, linux-kernel

On Thu, Oct 16, 2014 at 10:10:30AM +0200, Jiri Slaby wrote:
> On 10/14/2014, 10:58 AM, Luis Henriques wrote:
> > Could you please provide us with examples of commits in one of our
> > extended stable trees that is not on any other public release at
> > kernel.org?
> 
> Hi, from 3.12.y, for example:
> commit 48e8cad86bb1241c08bdaa80db022c25068ff8e0
> Author: Jiri Slaby <jslaby@suse.cz>
> Date:   Mon Jul 14 15:20:17 2014 +0200
> 
>     Revert "aio: fix kernel memory disclosure in io_getevents()
> introduced in v3.10"
> 
>     This reverts commit 0e2e24e5dc6eb6f0698e9dc97e652f132b885624, which
>     was applied twice mistakenly. The first one is
>     bee3f7b8188d4b2a5dfaeb2eb4a68d99f67daecf.
> 
> 
> Or any other patch without the "commit upstream" line. This may also
> happen where there is no way of backporting a fix to the stable tree due
> to later changes. Instead, a simple fix is applied, but it has no
> connection to the original commit but the reference.
> 

Thank you for your reply Jiri, but I believe you're referring to
commits that are in stable kernels and that are not on Linus tree.  I
do understand that these are required occasionally for the reasons you
stated above, and they are usually provided by subsystem maintainers.

However, the initial discussion was about commits that are not in a
public release (e.g. a Linus rc kernel) at kernel.org.

Cheers,
--
Luís

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

* Re: [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding.
  2014-10-14  8:58         ` Luis Henriques
  2014-10-16  8:10           ` Jiri Slaby
@ 2014-10-16 14:22           ` Greg Kroah-Hartman
  1 sibling, 0 replies; 174+ messages in thread
From: Greg Kroah-Hartman @ 2014-10-16 14:22 UTC (permalink / raw)
  To: Luis Henriques
  Cc: Kamal Mostafa, kernel-team, Willy Tarreau, stable, linux-kernel

On Tue, Oct 14, 2014 at 10:58:41AM +0200, Luis Henriques wrote:
> On Tue, Oct 14, 2014 at 03:52:33AM +0200, Greg Kroah-Hartman wrote:
> > On Mon, Oct 13, 2014 at 10:31:03AM -0700, Kamal Mostafa wrote:
> > > On Fri, 2014-10-10 at 07:30 +0200, Willy Tarreau wrote:
> > > > Hi Kamal,
> > > > 
> > > > [ removed Don Bailey from the CC who's certainly not interested in this ]
> > > > 
> > > > On Thu, Oct 09, 2014 at 02:03:08PM -0700, Kamal Mostafa wrote:
> > > > > 3.13.11.9 -stable review patch.  If anyone has any objections, please let me know.
> > > > > 
> > > > > ------------------
> > > > > 
> > > > > From: Willy Tarreau <w@1wt.eu>
> > > > > 
> > > > > commit 72cf90124e87d975d0b2114d930808c58b4c05e4 upstream.
> > > > 
> > > > (...)
> > > 
> > > Hi Willy-
> > > 
> > > Thanks very much for reviewing this.
> > > 
> > > > This one (and the accompanying revert) are still not present in more
> > > > recent stable kernels, so I find it surprizing that you're proposing
> > > > to integrate them now.
> > > 
> > > I can hold out those lzo fixes until the next 3.13-stable if you prefer.
> > 
> > Please do so.
> > 
> > > But fwiw...
> > > 
> > > >  If someone upgrades from 3.13.11.9 to 3.14.21
> > > > or 3.16.5, they'd expect to keep all fixes but will lose this one, so
> > > > this is a bit confusing.
> > > 
> > > I think those sorts of scheduling mismatches and discrepancies between
> > > stable versions are pretty common.  Examples:  The top 11 commits in
> > > v3.12.30 have not yet been applied[0] to any of the newer stable
> > > branches;
> > 
> > Those -mm patches from Mel are "special", I'm taking it slow in merging
> > them, doing lots of local testing and code review, and not all of them
> > even are relevant for 3.14, so don't take the acceptance /
> > non-acceptance of them as any kind of "proof" of anything at all.
> > 
> > > Many of the commits in v3.10.57 have not yet been applied[1]
> > > to linux-3.12.y but have been released in other newer stables.
> > 
> > That's because I am ahead of Jiri, which will almost always happen due
> > to our different workflows and time available to spend on stable
> > kernels.
> > 
> > > >  Is there any reason you're not tracking fixes
> > > > from more recent versions like Jiri, Li, Ben and I are doing ?
> > > 
> > > We (the Canonical stable maintainers) have always tracked the "cc:
> > > stable" fixes directly from mainline, not from the more-recent-version
> > > branches.  Given the examples above, it seems that the kernel.org
> > > maintainers are doing that too, yes?
> > 
> > You have included patches in your release that are not in _any_ public
> > release on kernel.org yet.  Which is fine, you are allowed to do
> > whatever you want, but that goes against the existing rules of stable
> > patches that we have been following for well over the past year for when
> > it is acceptable to add a patch to a stable release.
> > 
> 
> Could you please provide us with examples of commits in one of our
> extended stable trees that is not on any other public release at
> kernel.org?  We really try hard to follow the process defined for the
> official stable kernels, so if this has happen in the past it was
> definitely a mistake from our side, and we would love to get your
> feedback during the review cycles.

I don't really know, and honestly, don't care to spend the time and
energy to dig through to find this out.  The lzo ones jumped out at me
as I know the history behind them, and if you note, _I_ even didn't put
them in a stable kernel yet, as they have not shown up in a release from
Linus.

As the maintainer involved didn't ask you to go against the well-known
stable tree rules, that's a warning to others that perhaps something is
wrong here...

best of luck,

greg k-h

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

end of thread, other threads:[~2014-10-16 14:23 UTC | newest]

Thread overview: 174+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-09 21:00 [3.13.y.z extended stable] Linux 3.13.11.9 stable review Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 001/163] regulatory: add NUL to alpha2 Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 002/163] percpu: fix pcpu_alloc_pages() failure path Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 003/163] percpu: perform tlb flush after pcpu_map_pages() failure Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 004/163] percpu: free percpu allocation info for uniprocessor system Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 005/163] cgroup: reject cgroup names with '\n' Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 006/163] vfs: add d_is_dir() Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 007/163] CIFS: Fix directory rename error Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 008/163] usb: phy: twl4030-usb: Fix lost interrupts after ID pin goes down Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 009/163] rtlwifi: rtl8192cu: Add new ID Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 010/163] CIFS: Fix wrong restart readdir for SMB1 Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 011/163] CIFS: Fix wrong filename length for SMB2 Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 012/163] Revert "mac80211: disable uAPSD if all ACs are under ACM" Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 013/163] ahci: Add Device IDs for Intel 9 Series PCH Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 014/163] ata_piix: " Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 015/163] Revert "iwlwifi: dvm: don't enable CTS to self" Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 016/163] USB: zte_ev: fix removed PIDs Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 017/163] USB: ftdi_sio: add support for NOVITUS Bono E thermal printer Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 018/163] USB: sierra: avoid CDC class functions on "68A3" devices Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 019/163] USB: sierra: add 1199:68AA device ID Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 020/163] iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1 Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 021/163] iommu/arm-smmu: remove pgtable_page_{c,d}tor() Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 022/163] xen/manage: Always freeze/thaw processes when suspend/resuming Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 023/163] usb: gadget: fusb300_udc.h: Fix typo in include guard Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 024/163] usb: phy: tegra: Avoid use of sizeof(void) Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 025/163] arm64: use irq_set_affinity with force=false when migrating irqs Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 026/163] block: Fix dev_t minor allocation lifetime Kamal Mostafa
2014-10-09 21:09   ` Jens Axboe
2014-10-09 21:15     ` Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 027/163] usb: dwc3: core: fix order of PM runtime calls Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 028/163] usb: dwc3: core: fix ordering for PHY suspend Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 029/163] usb: dwc3: omap: fix ordering for runtime pm calls Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 030/163] iommu/fsl: Fix warning resulting from adding PCI device twice Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 031/163] ahci: add pcid for Marvel 0x9182 controller Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 032/163] drm/i915: Fix EIO/wedged handling in gem fault handler Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 033/163] ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses Kamal Mostafa
2014-10-09 21:00 ` [PATCH 3.13 034/163] drm/i915: Evict CS TLBs between batches Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 035/163] drm/i915: Wait for vblank before enabling the TV encoder Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 036/163] lockd: fix rpcbind crash on lockd startup failure Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 037/163] drm/radeon: fix semaphore value init Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 038/163] drm/radeon: add connector quirk for fujitsu board Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 039/163] imx-drm: ipuv3-plane: fix ipu_plane_dpms() Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 040/163] usb: host: xhci: fix compliance mode workaround Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 041/163] Input: elantech - fix detection of touchpad on ASUS s301l Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 042/163] USB: ftdi_sio: Add support for GE Healthcare Nemo Tracker device Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 043/163] uwb: init beacon cache entry before registering uwb device Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 044/163] nfs: fix kernel warning when removing proc entry Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 045/163] drm/radeon/dpm: set the thermal type properly for special configs Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 046/163] dm cache: fix race causing dirty blocks to be marked as clean Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 047/163] libceph: gracefully handle large reply messages from the mon Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 048/163] Input: serport - add compat handling for SPIOCSTYPE ioctl Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 049/163] usb: hub: take hub->hdev reference when processing from eventlist Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 050/163] eventpoll: fix uninitialized variable in epoll_ctl Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 051/163] kcmp: fix standard comparison bug Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 052/163] fsnotify/fdinfo: use named constants instead of hardcoded values Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 053/163] fs/notify: don't show f_handle if exportfs_encode_inode_fh failed Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 054/163] arm64: flush TLS registers during exec Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 055/163] storage: Add single-LUN quirk for Jaz USB Adapter Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 056/163] xhci: Fix null pointer dereference if xhci initialization fails Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 057/163] usb: xhci: Fix OOPS in xhci error handling code Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 058/163] xhci: fix oops when xhci resumes from hibernate with hw lpm capable devices Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 059/163] drm/ast: open key before detect chips Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 060/163] drm/ast: AST2000 cannot be detected correctly Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 061/163] futex: Unlock hb->lock in futex_wait_requeue_pi() error path Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 062/163] jiffies: Fix timeval conversion to jiffies Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 063/163] alarmtimer: Return relative times in timer_gettime Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 064/163] alarmtimer: Do not signal SIGEV_NONE timers Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 065/163] alarmtimer: Lock k_itimer during timer callback Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 066/163] parisc: Implement new LWS CAS supporting 64 bit operations Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 067/163] don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu() Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 068/163] be careful with nd->inode in path_init() and follow_dotdot_rcu() Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 069/163] iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 070/163] iio:trigger: modify return value for iio_trigger_get Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 071/163] iio: accel: bma180: Fix indio_dev->trig assignment Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 072/163] iio: adc: ad_sigma_delta: " Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 073/163] iio: hid_sensor_hub: " Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 074/163] iio: st_sensors: " Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 075/163] iio: gyro: itg3200: " Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 076/163] iio: inv_mpu6050: " Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 077/163] iio: meter: ade7758: " Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 078/163] MIPS: ZBOOT: add missing <linux/string.h> include Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 079/163] spi: fsl: Don't use devm_kzalloc in master->setup callback Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 080/163] spi: dw: " Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 081/163] ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 082/163] [media] cx18: fix kernel oops with tda8290 tuner Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 083/163] ASoC: davinci-mcasp: Correct rx format unit configuration Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 084/163] spi: sirf: enable RX_IO_DMA_INT interrupt Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 085/163] perf: Fix a race condition in perf_remove_from_context() Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 086/163] ASoC: samsung-i2s: Maintain CDCLK settings across i2s_{shutdown/startup} Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 087/163] ASoC: samsung-i2s: Check secondary DAI exists before referencing Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 088/163] ALSA: hda - Fix invalid pin powermap without jack detection Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 089/163] Input: atkbd - do not try 'deactivate' keyboard on any LG laptops Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 090/163] Input: i8042 - add Fujitsu U574 to no_timeout dmi table Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 091/163] Input: i8042 - add nomux quirk for Avatar AVIU-145A6 Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 092/163] iio: adc: at91: don't use the last converted data register Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 093/163] iio:magnetometer: bugfix magnetometers gain values Kamal Mostafa
2014-10-09 21:01 ` [PATCH 3.13 094/163] drm/i915: Fix SRC_COPY width on 830/845g Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 095/163] Target/iser: Get isert_conn reference once got to connected_handler Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 096/163] Target/iser: Don't put isert_conn inside disconnected handler Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 097/163] ARM: 8148/1: flush TLS and thumbee register state during exec Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 098/163] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 099/163] vgaarb: Don't default exclusively to first video device with mem+io Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 100/163] iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 101/163] iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 102/163] NFSv4: nfs4_state_manager() vs. nfs_server_remove_lists() Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 103/163] NFSv4: Fix another bug in the close/open_downgrade code Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 104/163] drm/radeon: don't reset dma on NI/SI init Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 105/163] drm/radeon: don't reset sdma on CIK init Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 106/163] drm/radeon: don't reset dma on r6xx-evergreen init Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 107/163] vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 108/163] drm/radeon/px: fix module unload Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 109/163] drm/nouveau/runpm: " Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 110/163] [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 111/163] USB: EHCI: unlink QHs even after the controller has stopped Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 112/163] USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 113/163] USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 114/163] USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 115/163] drm/nouveau: ltc/gf100-: fix cbc issues on certain boards Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 116/163] bnx2x: Fix link for KR with swapped polarity lane Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 117/163] iwlwifi: increase DEFAULT_MAX_TX_POWER Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 118/163] iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 119/163] workqueue: apply __WQ_ORDERED to create_singlethread_workqueue() Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 120/163] can: flexcan: mark TX mailbox as TX_INACTIVE Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 121/163] can: flexcan: correctly initialize mailboxes Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 122/163] can: flexcan: implement workaround for errata ERR005829 Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 123/163] can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-complete Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 124/163] can: at91_can: add missing prepare and unprepare of the clock Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 125/163] IB/qib: Correct reference counting in debugfs qp_stats Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 126/163] [media] videobuf2-dma-sg: fix for wrong GFP mask to sg_alloc_table_from_pages Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 127/163] [media] vb2: fix plane index sanity check in vb2_plane_cookie() Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 128/163] [media] adv7604: fix inverted condition Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 129/163] md/raid1: intialise start_next_window for READ case to avoid hang Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 130/163] md/raid1: be more cautious where we read-balance during resync Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 131/163] md/raid1: clean up request counts properly in close_sync() Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 132/163] md/raid1: make sure resync waits for conflicting writes to complete Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 133/163] md/raid1: Don't use next_resync to determine how far resync has progressed Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 134/163] md/raid1: update next_resync under resync_lock Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 135/163] md/raid1: count resync requests in nr_pending Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 136/163] md/raid1: fix_read_error should act on all non-faulty devices Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 137/163] ALSA: pcm: fix fifo_size frame calculation Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 138/163] Fix nasty 32-bit overflow bug in buffer i/o code Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 139/163] drm/radeon/cik: use a separate counter for CP init timeout Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 140/163] parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 141/163] sched: Fix unreleased llc_shared_mask bit during CPU hotplug Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 142/163] MIPS: mcount: Adjust stack pointer for static trace in MIPS32 Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 143/163] nilfs2: fix data loss with mmap() Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 144/163] ocfs2/dlm: do not get resource spinlock if lockres is new Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 145/163] mm, slab: initialize object alignment on cache creation Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 146/163] mm: softdirty: keep bit when zapping file pte Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 147/163] shmem: fix nlink for rename overwrite directory Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 148/163] ARM: 8165/1: alignment: don't break misaligned NEON load/store Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 149/163] ASoC: core: fix possible ZERO_SIZE_PTR pointer dereferencing error Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 150/163] cpufreq: integrator: fix integrator_cpufreq_remove return type Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 151/163] drm/i915: Flush the PTEs after updating them before suspend Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 152/163] ARM: 8178/1: fix set_tls for !CONFIG_KUSER_HELPERS Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 153/163] md/raid5: disable 'DISCARD' by default due to safety concerns Kamal Mostafa
2014-10-09 21:02 ` [PATCH 3.13 154/163] mm: migrate: Close race between migration completion and mprotect Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 155/163] mm: numa: Do not mark PTEs pte_numa when splitting huge pages Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 156/163] Fix problem recognizing symlinks Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 157/163] mm: memcontrol: do not iterate uninitialized memcgs Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 158/163] perf: fix perf bug in fork() Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 159/163] mm: page_alloc: fix zone allocation fairness on UP Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 160/163] init/Kconfig: Hide printk log config if CONFIG_PRINTK=n Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 161/163] init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 162/163] Revert "lzo: properly check for overruns" Kamal Mostafa
2014-10-09 21:03 ` [PATCH 3.13 163/163] lzo: check for length overrun in variable length encoding Kamal Mostafa
2014-10-10  5:30   ` Willy Tarreau
2014-10-13 17:31     ` Kamal Mostafa
2014-10-13 18:48       ` Willy Tarreau
2014-10-14  1:52       ` Greg Kroah-Hartman
2014-10-14  8:58         ` Luis Henriques
2014-10-16  8:10           ` Jiri Slaby
2014-10-16 10:50             ` Luis Henriques
2014-10-16 14:22           ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).