All of lore.kernel.org
 help / color / mirror / Atom feed
* [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review
@ 2016-02-04 22:43 Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 01/64] [4.2-stable only] Revert "arm64: mm: use correct mapping granularity under DEBUG_RODATA" Kamal Mostafa
                   ` (65 more replies)
  0 siblings, 66 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa

This is the start of the review cycle for the Linux 4.2.8-ckt4 stable
kernel.

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

http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-review

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

The review period for version 4.2.8-ckt4 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 4.2.y-ckt extended stable kernel
series, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable .

 -Kamal

--
 Documentation/DMA-API.txt                  |  7 ++++
 arch/arm64/Makefile                        |  1 +
 arch/arm64/kernel/head.S                   |  5 +++
 arch/arm64/mm/mmu.c                        | 12 +++----
 arch/arm64/mm/pageattr.c                   |  3 ++
 arch/arm64/mm/proc-macros.S                | 12 +++++++
 arch/arm64/mm/proc.S                       |  4 +--
 arch/powerpc/kernel/eeh_pe.c               | 33 ++++++++----------
 arch/powerpc/kernel/misc_64.S              | 28 ---------------
 arch/powerpc/kernel/module_64.c            | 12 +++++--
 arch/powerpc/kvm/book3s_hv_rmhandlers.S    |  2 +-
 arch/powerpc/kvm/powerpc.c                 | 20 +++++------
 arch/powerpc/perf/power8-pmu.c             |  2 +-
 arch/x86/include/asm/pgtable_types.h       |  6 ++--
 arch/x86/kernel/apic/io_apic.c             |  6 +++-
 arch/x86/mm/pageattr.c                     |  4 +--
 drivers/acpi/video_detect.c                |  8 -----
 drivers/cpufreq/cpufreq_governor.c         | 11 ++++--
 drivers/cpufreq/pxa2xx-cpufreq.c           |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |  3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c     |  7 ++--
 drivers/gpu/drm/amd/amdgpu/tonga_dpm.c     | 17 ++-------
 drivers/gpu/drm/radeon/dce6_afmt.c         | 12 ++-----
 drivers/gpu/drm/radeon/evergreen_hdmi.c    | 10 ++++++
 drivers/gpu/drm/radeon/evergreend.h        |  5 +++
 drivers/gpu/drm/radeon/radeon.h            |  2 +-
 drivers/gpu/drm/radeon/radeon_atombios.c   | 49 +++++++++++++++++++-------
 drivers/gpu/drm/radeon/radeon_audio.c      | 20 +++++++----
 drivers/gpu/drm/radeon/radeon_audio.h      |  1 +
 drivers/gpu/drm/radeon/vce_v1_0.c          | 12 +++----
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c        |  7 ++++
 drivers/hwmon/dell-smm-hwmon.c             | 11 ++++++
 drivers/iio/imu/adis_buffer.c              |  2 +-
 drivers/irqchip/irq-atmel-aic-common.c     |  2 +-
 drivers/net/xen-netback/netback.c          |  7 ++--
 drivers/net/xen-netfront.c                 | 21 +++++++-----
 drivers/pci/hotplug/acpiphp_glue.c         |  4 ++-
 drivers/scsi/sd.c                          |  7 ++--
 drivers/scsi/sr.c                          |  4 +++
 drivers/staging/speakup/selection.c        |  5 ++-
 drivers/staging/speakup/serialio.c         | 13 ++++++-
 drivers/tty/n_tty.c                        |  7 ++--
 drivers/tty/serial/8250/8250_pci.c         | 29 ++++++++++++++++
 drivers/tty/tty_io.c                       | 24 ++++++++++++-
 drivers/usb/class/cdc-acm.c                | 14 +++++++-
 drivers/usb/class/cdc-acm.h                |  1 +
 drivers/usb/core/hub.c                     |  8 +++--
 drivers/usb/serial/cp210x.c                |  1 +
 drivers/usb/serial/ftdi_sio.c              |  1 +
 drivers/usb/serial/ftdi_sio_ids.h          |  1 +
 drivers/usb/serial/option.c                | 18 +++++++++-
 drivers/usb/serial/visor.c                 | 11 ++++--
 drivers/virtio/virtio_pci_common.c         |  2 ++
 fs/timerfd.c                               |  2 +-
 include/linux/dmapool.h                    |  6 ++++
 include/linux/hrtimer.h                    | 34 ++++++++++++++++--
 kernel/seccomp.c                           | 22 ++++++------
 kernel/time/hrtimer.c                      | 55 ++++++++++++++++++++----------
 kernel/time/itimer.c                       |  2 +-
 kernel/time/posix-timers.c                 |  2 +-
 kernel/time/tick-sched.c                   |  4 +--
 kernel/time/timer_list.c                   |  2 +-
 net/sctp/sm_sideeffect.c                   | 42 ++++++++++++-----------
 scripts/mod/modpost.c                      |  3 +-
 sound/core/compress_offload.c              | 11 ++++++
 sound/core/seq/oss/seq_oss_init.c          |  2 +-
 sound/core/seq/oss/seq_oss_synth.c         |  2 +-
 sound/drivers/dummy.c                      |  2 +-
 sound/firewire/bebob/bebob_stream.c        | 14 +++++---
 sound/usb/quirks.c                         | 14 +++++++-
 tools/perf/ui/browsers/annotate.c          |  4 +--
 tools/perf/util/hist.c                     |  2 ++
 tools/perf/util/session.c                  |  2 +-
 73 files changed, 497 insertions(+), 246 deletions(-)

Alan Modra (1):
      powerpc: Simplify module TOC handling

Alan Stern (1):
      SCSI: fix crashes in sd and sr runtime PM

Alex Deucher (2):
      drm/amdgpu: fix tonga smu resume
      drm/radeon: properly byte swap vce firmware setup

Arnd Bergmann (1):
      cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype

Christian König (1):
      drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2

Daniele Palmas (1):
      USB: serial: option: Adding support for Telit LE922

Du, Changbin (1):
      usb: hub: do not clear BOS field during reset device

Gavin Shan (1):
      powerpc/eeh: Fix PE location code

Greg Kroah-Hartman (1):
      USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable

Greg Kurz (1):
      KVM: PPC: Fix ONE_REG AltiVec support

Guillaume Fougnies (1):
      ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay

Hans de Goede (1):
      ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist"

Insu Yun (1):
      ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot()

Jan Beulich (1):
      x86/mm: Fix types used in pgprot cacheability flags translations

Jann Horn (1):
      seccomp: always propagate NO_NEW_PRIVS on tsync

Jiri Olsa (1):
      perf hists: Fix HISTC_MEM_DCACHELINE width setting

Joe Jin (1):
      xen-netfront: update num_queues to real created

Johan Hovold (1):
      USB: visor: fix null-deref at probe

John Ernberg (1):
      USB: option: fix Cinterion AHxx enumeration

Kamal Mostafa (1):
      [4.2-stable only] Revert "arm64: mm: use correct mapping granularity under DEBUG_RODATA"

Karl Heiss (1):
      sctp: Prevent soft lockup when sctp_accept() is called during a timeout event

Lars-Peter Clausen (1):
      iio: adis_buffer: Fix out-of-bounds memory access

Lorenzo Pieralisi (1):
      arm64: kernel: fix architected PMU registers unconditional access

Lu Baolu (2):
      usb: cdc-acm: handle unlinked urb in acm read callback
      usb: cdc-acm: send zero packet for intel 7260 modem

Lucas Tanure (1):
      ALSA: bebob: Use a signed return type for get_formation_index

Madhavan Srinivasan (1):
      powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8

Markus Trippelsdorf (1):
      perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed

Matt Fleming (1):
      x86/mm/pat: Avoid truncation when converting cpa->numpages to address

Michael S. Tsirkin (1):
      virtio_pci: fix use after free on release

Michel Dänzer (1):
      drm/amdgpu: Use drm_calloc_large for VM page_tables array

Mika Penttilä (1):
      arm64: mm: avoid calling apply_to_page_range on empty range

Mika Westerberg (1):
      serial: 8250_pci: Add Intel Broadwell ports

Milo Kim (1):
      irqchip/atmel-aic: Fix wrong bit operation for IRQ priority

Oliver Neukum (1):
      cdc-acm:exclude Samsung phone 04e8:685d

Peter Dedecker (1):
      USB: cp210x: add ID for IAI USB to RS485 adaptor

Peter Hurley (3):
      tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
      n_tty: Fix unsafe reference to "other" ldisc
      staging/speakup: Use tty_ldisc_ref() for paste kworker

Ravi Bangoria (1):
      perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data

Rob Clark (1):
      drm/vmwgfx: respect 'nomodeset'

Samuel Thibault (1):
      Staging: speakup: Fix getting port information

Sean O. Stalley (1):
      mm: add dma_pool_zalloc() call to DMA API

Slava Grigorev (3):
      drm/radeon: cleaned up VCO output settings for DP audio
      drm/radeon: Add a common function for DFS handling
      drm/radeon: fix DP audio support for APU with DCE4.1 display engine

Takashi Iwai (4):
      ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()
      ALSA: seq: Degrade the error message for too many opens
      ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures
      ALSA: dummy: Disable switching timer backend via sysfs

Thomas Gleixner (5):
      x86/irq: Call chip->irq_set_affinity in proper context
      hrtimer: Handle remaining time proper for TIME_LOW_RES
      timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper
      posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper
      itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper

Thomas Huth (1):
      KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8

Thorsten Leemhuis (1):
      hwmon: (dell-smm) Blacklist Dell Studio XPS 8000

Viresh Kumar (1):
      cpufreq: Fix NULL reference crash while accessing policy->governor_data

Vladis Dronov (1):
      USB: serial: visor: fix crash on detecting device without write_urbs

Wanpeng Li (1):
      tick/nohz: Set the correct expiry when switching to nohz/lowres mode

Wei Liu (2):
      xen-netback: respect user provided max_queues
      xen-netfront: respect user provided max_queues

dann frazier (1):
      arm64: errata: Add -mpc-relative-literal-loads to build flags

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

* [PATCH 4.2.y-ckt 01/64] [4.2-stable only] Revert "arm64: mm: use correct mapping granularity under DEBUG_RODATA"
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API Kamal Mostafa
                   ` (64 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Kamal Mostafa

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

---8<------------------------------------------------------------

From: Kamal Mostafa <kamal@canonical.com>

This reverts commit 22140f9ffcaf90af70738b818e60be7a0c189c45.

Not suitable for 4.2-stable (no SWAPPER_BLOCK_SIZE definition).

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm64/mm/mmu.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 3d016b9..9cc82a4 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -308,8 +308,8 @@ static void __init __map_memblock(phys_addr_t start, phys_addr_t end)
 	 * for now. This will get more fine grained later once all memory
 	 * is mapped
 	 */
-	unsigned long kernel_x_start = round_down(__pa(_stext), SWAPPER_BLOCK_SIZE);
-	unsigned long kernel_x_end = round_up(__pa(__init_end), SWAPPER_BLOCK_SIZE);
+	unsigned long kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
+	unsigned long kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);
 
 	if (end < kernel_x_start) {
 		create_mapping(start, __phys_to_virt(start),
@@ -397,18 +397,18 @@ void __init fixup_executable(void)
 {
 #ifdef CONFIG_DEBUG_RODATA
 	/* now that we are actually fully mapped, make the start/end more fine grained */
-	if (!IS_ALIGNED((unsigned long)_stext, SWAPPER_BLOCK_SIZE)) {
+	if (!IS_ALIGNED((unsigned long)_stext, SECTION_SIZE)) {
 		unsigned long aligned_start = round_down(__pa(_stext),
-							 SWAPPER_BLOCK_SIZE);
+							SECTION_SIZE);
 
 		create_mapping(aligned_start, __phys_to_virt(aligned_start),
 				__pa(_stext) - aligned_start,
 				PAGE_KERNEL);
 	}
 
-	if (!IS_ALIGNED((unsigned long)__init_end, SWAPPER_BLOCK_SIZE)) {
+	if (!IS_ALIGNED((unsigned long)__init_end, SECTION_SIZE)) {
 		unsigned long aligned_end = round_up(__pa(__init_end),
-							  SWAPPER_BLOCK_SIZE);
+							SECTION_SIZE);
 		create_mapping(__pa(__init_end), (unsigned long)__init_end,
 				aligned_end - __pa(__init_end),
 				PAGE_KERNEL);
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 01/64] [4.2-stable only] Revert "arm64: mm: use correct mapping granularity under DEBUG_RODATA" Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 03/64] sctp: Prevent soft lockup when sctp_accept() is called during a timeout event Kamal Mostafa
                   ` (63 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sean O. Stalley, Vinod Koul, Bjorn Helgaas, Gilles Muller,
	Nicolas Palix, Michal Marek, Sebastian Andrzej Siewior,
	Jonathan Corbet, Andrew Morton, Linus Torvalds, Kamal Mostafa

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

---8<------------------------------------------------------------

From: "Sean O. Stalley" <sean.stalley@intel.com>

commit ad82362b2defd4adad87d8538617b2f51a4bf9c3 upstream.

Add a wrapper function for dma_pool_alloc() to get zeroed memory.

Signed-off-by: Sean O. Stalley <sean.stalley@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>
Cc: Nicolas Palix <nicolas.palix@imag.fr>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ kamal: 4.2-stable prereq for
  27bc944 dmaengine: bcm2835-dma: Convert to use DMA pool ]
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 Documentation/DMA-API.txt | 7 +++++++
 include/linux/dmapool.h   | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 7eba542..edccacd 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -104,6 +104,13 @@ crossing restrictions, pass 0 for alloc; passing 4096 says memory allocated
 from this pool must not cross 4KByte boundaries.
 
 
+	void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags,
+			      dma_addr_t *handle)
+
+Wraps dma_pool_alloc() and also zeroes the returned memory if the
+allocation attempt succeeded.
+
+
 	void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags,
 			dma_addr_t *dma_handle);
 
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
index e1043f7..53ba737 100644
--- a/include/linux/dmapool.h
+++ b/include/linux/dmapool.h
@@ -24,6 +24,12 @@ void dma_pool_destroy(struct dma_pool *pool);
 void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
 		     dma_addr_t *handle);
 
+static inline void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags,
+				    dma_addr_t *handle)
+{
+	return dma_pool_alloc(pool, mem_flags | __GFP_ZERO, handle);
+}
+
 void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
 
 /*
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 03/64] sctp: Prevent soft lockup when sctp_accept() is called during a timeout event
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 01/64] [4.2-stable only] Revert "arm64: mm: use correct mapping granularity under DEBUG_RODATA" Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 04/64] xen-netback: respect user provided max_queues Kamal Mostafa
                   ` (62 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Karl Heiss, David S. Miller, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Karl Heiss <kheiss@gmail.com>

[ Upstream commit 635682a14427d241bab7bbdeebb48a7d7b91638e ]

A case can occur when sctp_accept() is called by the user during
a heartbeat timeout event after the 4-way handshake.  Since
sctp_assoc_migrate() changes both assoc->base.sk and assoc->ep, the
bh_sock_lock in sctp_generate_heartbeat_event() will be taken with
the listening socket but released with the new association socket.
The result is a deadlock on any future attempts to take the listening
socket lock.

Note that this race can occur with other SCTP timeouts that take
the bh_lock_sock() in the event sctp_accept() is called.

 BUG: soft lockup - CPU#9 stuck for 67s! [swapper:0]
 ...
 RIP: 0010:[<ffffffff8152d48e>]  [<ffffffff8152d48e>] _spin_lock+0x1e/0x30
 RSP: 0018:ffff880028323b20  EFLAGS: 00000206
 RAX: 0000000000000002 RBX: ffff880028323b20 RCX: 0000000000000000
 RDX: 0000000000000000 RSI: ffff880028323be0 RDI: ffff8804632c4b48
 RBP: ffffffff8100bb93 R08: 0000000000000000 R09: 0000000000000000
 R10: ffff880610662280 R11: 0000000000000100 R12: ffff880028323aa0
 R13: ffff8804383c3880 R14: ffff880028323a90 R15: ffffffff81534225
 FS:  0000000000000000(0000) GS:ffff880028320000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
 CR2: 00000000006df528 CR3: 0000000001a85000 CR4: 00000000000006e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process swapper (pid: 0, threadinfo ffff880616b70000, task ffff880616b6cab0)
 Stack:
 ffff880028323c40 ffffffffa01c2582 ffff880614cfb020 0000000000000000
 <d> 0100000000000000 00000014383a6c44 ffff8804383c3880 ffff880614e93c00
 <d> ffff880614e93c00 0000000000000000 ffff8804632c4b00 ffff8804383c38b8
 Call Trace:
 <IRQ>
 [<ffffffffa01c2582>] ? sctp_rcv+0x492/0xa10 [sctp]
 [<ffffffff8148c559>] ? nf_iterate+0x69/0xb0
 [<ffffffff814974a0>] ? ip_local_deliver_finish+0x0/0x2d0
 [<ffffffff8148c716>] ? nf_hook_slow+0x76/0x120
 [<ffffffff814974a0>] ? ip_local_deliver_finish+0x0/0x2d0
 [<ffffffff8149757d>] ? ip_local_deliver_finish+0xdd/0x2d0
 [<ffffffff81497808>] ? ip_local_deliver+0x98/0xa0
 [<ffffffff81496ccd>] ? ip_rcv_finish+0x12d/0x440
 [<ffffffff81497255>] ? ip_rcv+0x275/0x350
 [<ffffffff8145cfeb>] ? __netif_receive_skb+0x4ab/0x750
 ...

With lockdep debugging:

 =====================================
 [ BUG: bad unlock balance detected! ]
 -------------------------------------
 CslRx/12087 is trying to release lock (slock-AF_INET) at:
 [<ffffffffa01bcae0>] sctp_generate_timeout_event+0x40/0xe0 [sctp]
 but there are no more locks to release!

 other info that might help us debug this:
 2 locks held by CslRx/12087:
 #0:  (&asoc->timers[i]){+.-...}, at: [<ffffffff8108ce1f>] run_timer_softirq+0x16f/0x3e0
 #1:  (slock-AF_INET){+.-...}, at: [<ffffffffa01bcac3>] sctp_generate_timeout_event+0x23/0xe0 [sctp]

Ensure the socket taken is also the same one that is released by
saving a copy of the socket before entering the timeout event
critical section.

Signed-off-by: Karl Heiss <kheiss@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/sctp/sm_sideeffect.c | 42 +++++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 85e6f03..9366510 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -244,12 +244,13 @@ void sctp_generate_t3_rtx_event(unsigned long peer)
 	int error;
 	struct sctp_transport *transport = (struct sctp_transport *) peer;
 	struct sctp_association *asoc = transport->asoc;
-	struct net *net = sock_net(asoc->base.sk);
+	struct sock *sk = asoc->base.sk;
+	struct net *net = sock_net(sk);
 
 	/* Check whether a task is in the sock.  */
 
-	bh_lock_sock(asoc->base.sk);
-	if (sock_owned_by_user(asoc->base.sk)) {
+	bh_lock_sock(sk);
+	if (sock_owned_by_user(sk)) {
 		pr_debug("%s: sock is busy\n", __func__);
 
 		/* Try again later.  */
@@ -272,10 +273,10 @@ void sctp_generate_t3_rtx_event(unsigned long peer)
 			   transport, GFP_ATOMIC);
 
 	if (error)
-		asoc->base.sk->sk_err = -error;
+		sk->sk_err = -error;
 
 out_unlock:
-	bh_unlock_sock(asoc->base.sk);
+	bh_unlock_sock(sk);
 	sctp_transport_put(transport);
 }
 
@@ -285,11 +286,12 @@ out_unlock:
 static void sctp_generate_timeout_event(struct sctp_association *asoc,
 					sctp_event_timeout_t timeout_type)
 {
-	struct net *net = sock_net(asoc->base.sk);
+	struct sock *sk = asoc->base.sk;
+	struct net *net = sock_net(sk);
 	int error = 0;
 
-	bh_lock_sock(asoc->base.sk);
-	if (sock_owned_by_user(asoc->base.sk)) {
+	bh_lock_sock(sk);
+	if (sock_owned_by_user(sk)) {
 		pr_debug("%s: sock is busy: timer %d\n", __func__,
 			 timeout_type);
 
@@ -312,10 +314,10 @@ static void sctp_generate_timeout_event(struct sctp_association *asoc,
 			   (void *)timeout_type, GFP_ATOMIC);
 
 	if (error)
-		asoc->base.sk->sk_err = -error;
+		sk->sk_err = -error;
 
 out_unlock:
-	bh_unlock_sock(asoc->base.sk);
+	bh_unlock_sock(sk);
 	sctp_association_put(asoc);
 }
 
@@ -365,10 +367,11 @@ void sctp_generate_heartbeat_event(unsigned long data)
 	int error = 0;
 	struct sctp_transport *transport = (struct sctp_transport *) data;
 	struct sctp_association *asoc = transport->asoc;
-	struct net *net = sock_net(asoc->base.sk);
+	struct sock *sk = asoc->base.sk;
+	struct net *net = sock_net(sk);
 
-	bh_lock_sock(asoc->base.sk);
-	if (sock_owned_by_user(asoc->base.sk)) {
+	bh_lock_sock(sk);
+	if (sock_owned_by_user(sk)) {
 		pr_debug("%s: sock is busy\n", __func__);
 
 		/* Try again later.  */
@@ -389,10 +392,10 @@ void sctp_generate_heartbeat_event(unsigned long data)
 			   transport, GFP_ATOMIC);
 
 	 if (error)
-		 asoc->base.sk->sk_err = -error;
+		sk->sk_err = -error;
 
 out_unlock:
-	bh_unlock_sock(asoc->base.sk);
+	bh_unlock_sock(sk);
 	sctp_transport_put(transport);
 }
 
@@ -403,10 +406,11 @@ void sctp_generate_proto_unreach_event(unsigned long data)
 {
 	struct sctp_transport *transport = (struct sctp_transport *) data;
 	struct sctp_association *asoc = transport->asoc;
-	struct net *net = sock_net(asoc->base.sk);
+	struct sock *sk = asoc->base.sk;
+	struct net *net = sock_net(sk);
 
-	bh_lock_sock(asoc->base.sk);
-	if (sock_owned_by_user(asoc->base.sk)) {
+	bh_lock_sock(sk);
+	if (sock_owned_by_user(sk)) {
 		pr_debug("%s: sock is busy\n", __func__);
 
 		/* Try again later.  */
@@ -427,7 +431,7 @@ void sctp_generate_proto_unreach_event(unsigned long data)
 		   asoc->state, asoc->ep, asoc, transport, GFP_ATOMIC);
 
 out_unlock:
-	bh_unlock_sock(asoc->base.sk);
+	bh_unlock_sock(sk);
 	sctp_association_put(asoc);
 }
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 04/64] xen-netback: respect user provided max_queues
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (2 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 03/64] sctp: Prevent soft lockup when sctp_accept() is called during a timeout event Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 05/64] xen-netfront: " Kamal Mostafa
                   ` (61 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Wei Liu, David S. Miller, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Wei Liu <wei.liu2@citrix.com>

commit 4c82ac3c37363e8c4ded6a5fe1ec5fa756b34df3 upstream.

Originally that parameter was always reset to num_online_cpus during
module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not
provided a value.

Reported-by: Johnny Strom <johnny.strom@linuxsolutions.fi>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/xen-netback/netback.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 4fe3e13..b90b116 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -2002,8 +2002,11 @@ static int __init netback_init(void)
 	if (!xen_domain())
 		return -ENODEV;
 
-	/* Allow as many queues as there are CPUs, by default */
-	xenvif_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xenvif_max_queues == 0)
+		xenvif_max_queues = num_online_cpus();
 
 	if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) {
 		pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 05/64] xen-netfront: respect user provided max_queues
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (3 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 04/64] xen-netback: respect user provided max_queues Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 06/64] xen-netfront: update num_queues to real created Kamal Mostafa
                   ` (60 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Wei Liu, David Vrabel, David S. Miller, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Wei Liu <wei.liu2@citrix.com>

commit 32a844056fd43dda647e1c3c6b9983bdfa04d17d upstream.

Originally that parameter was always reset to num_online_cpus during
module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not
provided a value.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Tested-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/xen-netfront.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 5ff0cfd..9b6b933 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -2131,8 +2131,11 @@ static int __init netif_init(void)
 
 	pr_info("Initialising Xen virtual ethernet driver\n");
 
-	/* Allow as many queues as there are CPUs, by default */
-	xennet_max_queues = num_online_cpus();
+	/* Allow as many queues as there are CPUs if user has not
+	 * specified a value.
+	 */
+	if (xennet_max_queues == 0)
+		xennet_max_queues = num_online_cpus();
 
 	return xenbus_register_frontend(&netfront_driver);
 }
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 06/64] xen-netfront: update num_queues to real created
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (4 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 05/64] xen-netfront: " Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 07/64] iio: adis_buffer: Fix out-of-bounds memory access Kamal Mostafa
                   ` (59 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Joe Jin, Boris Ostrovsky, Konrad Rzeszutek Wilk, Wei Liu,
	Ian Campbell, David S. Miller, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Joe Jin <joe.jin@oracle.com>

commit ca88ea1247dfee094e2467a3578eaec9bdf0833a upstream.

Sometimes xennet_create_queues() may failed to created all requested
queues, we need to update num_queues to real created to avoid NULL
pointer dereference.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/net/xen-netfront.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 9b6b933..e9872d5 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1704,19 +1704,19 @@ static void xennet_destroy_queues(struct netfront_info *info)
 }
 
 static int xennet_create_queues(struct netfront_info *info,
-				unsigned int num_queues)
+				unsigned int *num_queues)
 {
 	unsigned int i;
 	int ret;
 
-	info->queues = kcalloc(num_queues, sizeof(struct netfront_queue),
+	info->queues = kcalloc(*num_queues, sizeof(struct netfront_queue),
 			       GFP_KERNEL);
 	if (!info->queues)
 		return -ENOMEM;
 
 	rtnl_lock();
 
-	for (i = 0; i < num_queues; i++) {
+	for (i = 0; i < *num_queues; i++) {
 		struct netfront_queue *queue = &info->queues[i];
 
 		queue->id = i;
@@ -1726,7 +1726,7 @@ static int xennet_create_queues(struct netfront_info *info,
 		if (ret < 0) {
 			dev_warn(&info->netdev->dev,
 				 "only created %d queues\n", i);
-			num_queues = i;
+			*num_queues = i;
 			break;
 		}
 
@@ -1736,11 +1736,11 @@ static int xennet_create_queues(struct netfront_info *info,
 			napi_enable(&queue->napi);
 	}
 
-	netif_set_real_num_tx_queues(info->netdev, num_queues);
+	netif_set_real_num_tx_queues(info->netdev, *num_queues);
 
 	rtnl_unlock();
 
-	if (num_queues == 0) {
+	if (*num_queues == 0) {
 		dev_err(&info->netdev->dev, "no queues\n");
 		return -EINVAL;
 	}
@@ -1786,7 +1786,7 @@ static int talk_to_netback(struct xenbus_device *dev,
 	if (info->queues)
 		xennet_destroy_queues(info);
 
-	err = xennet_create_queues(info, num_queues);
+	err = xennet_create_queues(info, &num_queues);
 	if (err < 0)
 		goto destroy_ring;
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 07/64] iio: adis_buffer: Fix out-of-bounds memory access
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (5 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 06/64] xen-netfront: update num_queues to real created Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 08/64] KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8 Kamal Mostafa
                   ` (58 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lars-Peter Clausen, Jonathan Cameron, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit d590faf9e8f8509a0a0aa79c38e87fcc6b913248 upstream.

The SPI tx and rx buffers are both supposed to be scan_bytes amount of
bytes large and a common allocation is used to allocate both buffers. This
puts the beginning of the tx buffer scan_bytes bytes after the rx buffer.
The initialization of the tx buffer pointer is done adding scan_bytes to
the beginning of the rx buffer, but since the rx buffer is of type __be16
this will actually add two times as much and the tx buffer ends up pointing
after the allocated buffer.

Fix this by using scan_count, which is scan_bytes / 2, instead of
scan_bytes when initializing the tx buffer pointer.

Fixes: aacff892cbd5 ("staging:iio:adis: Preallocate transfer message")
Signed-off-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/imu/adis_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/adis_buffer.c b/drivers/iio/imu/adis_buffer.c
index cb32b59..36607d5 100644
--- a/drivers/iio/imu/adis_buffer.c
+++ b/drivers/iio/imu/adis_buffer.c
@@ -43,7 +43,7 @@ int adis_update_scan_mode(struct iio_dev *indio_dev,
 		return -ENOMEM;
 
 	rx = adis->buffer;
-	tx = rx + indio_dev->scan_bytes;
+	tx = rx + scan_count;
 
 	spi_message_init(&adis->msg);
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 08/64] KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (6 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 07/64] iio: adis_buffer: Fix out-of-bounds memory access Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 09/64] KVM: PPC: Fix ONE_REG AltiVec support Kamal Mostafa
                   ` (57 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Huth, Paul Mackerras, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Huth <thuth@redhat.com>

commit 760a7364f27d974d100118d88190e574626e18a6 upstream.

In the old DABR register, the BT (Breakpoint Translation) bit
is bit number 61. In the new DAWRX register, the WT (Watchpoint
Translation) bit is bit number 59. So to move the DABR-BT bit
into the position of the DAWRX-WT bit, it has to be shifted by
two, not only by one. This fixes hardware watchpoints in gdb of
older guests that only use the H_SET_DABR/X interface instead
of the new H_SET_MODE interface.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 437f643..62f72ee 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -2047,7 +2047,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
 
 	/* Emulate H_SET_DABR/X on P8 for the sake of compat mode guests */
 2:	rlwimi	r5, r4, 5, DAWRX_DR | DAWRX_DW
-	rlwimi	r5, r4, 1, DAWRX_WT
+	rlwimi	r5, r4, 2, DAWRX_WT
 	clrrdi	r4, r4, 3
 	std	r4, VCPU_DAWR(r3)
 	std	r5, VCPU_DAWRX(r3)
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 09/64] KVM: PPC: Fix ONE_REG AltiVec support
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (7 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 08/64] KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8 Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 10/64] x86/irq: Call chip->irq_set_affinity in proper context Kamal Mostafa
                   ` (56 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Greg Kurz, Paul Mackerras, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Greg Kurz <gkurz@linux.vnet.ibm.com>

commit b4d7f161feb3015d6306e1d35b565c888ff70c9d upstream.

The get and set operations got exchanged by mistake when moving the
code from book3s.c to powerpc.c.

Fixes: 3840edc8033ad5b86deee309c1c321ca54257452
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/kvm/powerpc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index e5dde32..aea90c1 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -916,21 +916,17 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
 				r = -ENXIO;
 				break;
 			}
-			vcpu->arch.vr.vr[reg->id - KVM_REG_PPC_VR0] = val.vval;
+			val.vval = vcpu->arch.vr.vr[reg->id - KVM_REG_PPC_VR0];
 			break;
 		case KVM_REG_PPC_VSCR:
 			if (!cpu_has_feature(CPU_FTR_ALTIVEC)) {
 				r = -ENXIO;
 				break;
 			}
-			vcpu->arch.vr.vscr.u[3] = set_reg_val(reg->id, val);
+			val = get_reg_val(reg->id, vcpu->arch.vr.vscr.u[3]);
 			break;
 		case KVM_REG_PPC_VRSAVE:
-			if (!cpu_has_feature(CPU_FTR_ALTIVEC)) {
-				r = -ENXIO;
-				break;
-			}
-			vcpu->arch.vrsave = set_reg_val(reg->id, val);
+			val = get_reg_val(reg->id, vcpu->arch.vrsave);
 			break;
 #endif /* CONFIG_ALTIVEC */
 		default:
@@ -971,17 +967,21 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg)
 				r = -ENXIO;
 				break;
 			}
-			val.vval = vcpu->arch.vr.vr[reg->id - KVM_REG_PPC_VR0];
+			vcpu->arch.vr.vr[reg->id - KVM_REG_PPC_VR0] = val.vval;
 			break;
 		case KVM_REG_PPC_VSCR:
 			if (!cpu_has_feature(CPU_FTR_ALTIVEC)) {
 				r = -ENXIO;
 				break;
 			}
-			val = get_reg_val(reg->id, vcpu->arch.vr.vscr.u[3]);
+			vcpu->arch.vr.vscr.u[3] = set_reg_val(reg->id, val);
 			break;
 		case KVM_REG_PPC_VRSAVE:
-			val = get_reg_val(reg->id, vcpu->arch.vrsave);
+			if (!cpu_has_feature(CPU_FTR_ALTIVEC)) {
+				r = -ENXIO;
+				break;
+			}
+			vcpu->arch.vrsave = set_reg_val(reg->id, val);
 			break;
 #endif /* CONFIG_ALTIVEC */
 		default:
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 10/64] x86/irq: Call chip->irq_set_affinity in proper context
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (8 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 09/64] KVM: PPC: Fix ONE_REG AltiVec support Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 11/64] drm/amdgpu: fix tonga smu resume Kamal Mostafa
                   ` (55 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Jiang Liu, Jeremiah Mahler, andy.shevchenko,
	Guenter Roeck, Joe Lawrence, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit e23b257c293ce4bcc8cabb2aa3097b6ed8a8261a upstream.

setup_ioapic_dest() calls irqchip->irq_set_affinity() completely
unprotected. That's wrong in several aspects:

 - it opens a race window where irq_set_affinity() can be interrupted and the
   irq chip left in unconsistent state.

 - it triggers a lockdep splat when we fix the vector race for 4.3+ because
   vector lock is taken with interrupts enabled.

The proper calling convention is irq descriptor lock held and interrupts
disabled.

Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Jeremiah Mahler <jmmahler@gmail.com>
Cc: andy.shevchenko@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Joe Lawrence <joe.lawrence@stratus.com>
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1601140919420.3575@nanos
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/kernel/apic/io_apic.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 11b46d9..7050ef9 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2521,6 +2521,7 @@ void __init setup_ioapic_dest(void)
 {
 	int pin, ioapic, irq, irq_entry;
 	const struct cpumask *mask;
+	struct irq_desc *desc;
 	struct irq_data *idata;
 	struct irq_chip *chip;
 
@@ -2536,7 +2537,9 @@ void __init setup_ioapic_dest(void)
 		if (irq < 0 || !mp_init_irq_at_boot(ioapic, irq))
 			continue;
 
-		idata = irq_get_irq_data(irq);
+		desc = irq_to_desc(irq);
+		raw_spin_lock_irq(&desc->lock);
+		idata = irq_desc_get_irq_data(desc);
 
 		/*
 		 * Honour affinities which have been set in early boot
@@ -2550,6 +2553,7 @@ void __init setup_ioapic_dest(void)
 		/* Might be lapic_chip for irq 0 */
 		if (chip->irq_set_affinity)
 			chip->irq_set_affinity(idata, mask, false);
+		raw_spin_unlock_irq(&desc->lock);
 	}
 }
 #endif
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 11/64] drm/amdgpu: fix tonga smu resume
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (9 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 10/64] x86/irq: Call chip->irq_set_affinity in proper context Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 12/64] perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data Kamal Mostafa
                   ` (54 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit e160e4db833c7e8587ec3c88efaed0d84f1bcf42 upstream.

Need to make sure smu buffers are pinned on resume.  This
matches what Fiji does.

Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/tonga_dpm.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c b/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c
index 2049038..63d6cb3 100644
--- a/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c
@@ -122,25 +122,12 @@ static int tonga_dpm_hw_fini(void *handle)
 
 static int tonga_dpm_suspend(void *handle)
 {
-	return 0;
+	return tonga_dpm_hw_fini(handle);
 }
 
 static int tonga_dpm_resume(void *handle)
 {
-	int ret;
-	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
-	mutex_lock(&adev->pm.mutex);
-
-	ret = tonga_smu_start(adev);
-	if (ret) {
-		DRM_ERROR("SMU start failed\n");
-		goto fail;
-	}
-
-fail:
-	mutex_unlock(&adev->pm.mutex);
-	return ret;
+	return tonga_dpm_hw_init(handle);
 }
 
 static int tonga_dpm_set_clockgating_state(void *handle,
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 12/64] perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (10 preceding siblings ...)
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 11/64] drm/amdgpu: fix tonga smu resume Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43   ` Kamal Mostafa
                   ` (53 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ravi Bangoria, Naveen N. Rao, Arnaldo Carvalho de Melo, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

commit 3caeaa562733c4836e61086ec07666635006a787 upstream.

While recording guest samples in host using perf kvm record, it will
populate unprocessable sample error, though samples will be recorded
properly. While generating report using perf kvm report, no samples will
be processed and same error will populate. We have seen this behaviour
with upstream perf(4.4-rc3) on x86 and ppc64 hardware.

Reason behind this failure is, when it tries to fetch machine from
rb_tree of machines, it fails. As a part of tracing a bug, we figured
out that this code was incorrectly refactored in commit 54245fdc3576
("perf session: Remove wrappers to machines__find").

This patch will change the functionality such that if it can't fetch
machine in first trial, it will create one node of machine and add that to
rb_tree. So next time when it tries to fetch same machine from rb_tree,
it won't fail. Actually it was the case before refactoring of code in
aforementioned commit.

This patch is generated from acme perf/core branch.

Below I've mention an example that demonstrate the behaviour before and
after applying patch.

Before applying patch:
[Note: One needs to run guest before recording data in host]

  ravi@ravi-bangoria:~$ ./perf kvm record -a
  Warning:
  5903 unprocessable samples recorded.
  Do you have a KVM guest running and not using 'perf kvm'?
  [ perf record: Captured and wrote 1.409 MB perf.data.guest (285 samples) ]

  ravi@ravi-bangoria:~$ ./perf kvm report --stdio
  Warning:
  5903 unprocessable samples recorded.
  Do you have a KVM guest running and not using 'perf kvm'?
  # To display the perf.data header info, please use --header/--header-only options.
  #
  # Total Lost Samples: 0
  #
  # Samples: 285  of event 'cycles'
  # Event count (approx.): 88715406
  #
  # Overhead  Command  Shared Object  Symbol
  # ........  .......  .............  ......
  #

  # (For a higher level overview, try: perf report --sort comm,dso)
  #

After applying patch:

  ravi@ravi-bangoria:~$ ./perf kvm record -a
  [ perf record: Captured and wrote 1.188 MB perf.data.guest (17 samples) ]

  ravi@ravi-bangoria:~$ ./perf kvm report --stdio
  # To display the perf.data header info, please use --header/--header-only options.
  #
  # Total Lost Samples: 0
  #
  # Samples: 17  of event 'cycles'
  # Event count (approx.): 700746
  #
  # Overhead  Command  Shared Object     Symbol
  # ........  .......  ................  ......................
  #
      34.19%  :5758    [unknown]         [g] 0xffffffff818682ab
      22.79%  :5758    [unknown]         [g] 0xffffffff812dc7f8
      22.79%  :5758    [unknown]         [g] 0xffffffff818650d0
      14.83%  :5758    [unknown]         [g] 0xffffffff8161a1b6
       2.49%  :5758    [unknown]         [g] 0xffffffff818692bf
       0.48%  :5758    [unknown]         [g] 0xffffffff81869253
       0.05%  :5758    [unknown]         [g] 0xffffffff81869250

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Fixes: 54245fdc3576 ("perf session: Remove wrappers to machines__find")
Link: http://lkml.kernel.org/r/1449471302-11283-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 tools/perf/util/session.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ed9dc25..8f8742e 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -961,7 +961,7 @@ static struct machine *machines__find_for_cpumode(struct machines *machines,
 
 		machine = machines__find(machines, pid);
 		if (!machine)
-			machine = machines__find(machines, DEFAULT_GUEST_KERNEL_ID);
+			machine = machines__findnew(machines, DEFAULT_GUEST_KERNEL_ID);
 		return machine;
 	}
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 13/64] hrtimer: Handle remaining time proper for TIME_LOW_RES
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
@ 2016-02-04 22:43   ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API Kamal Mostafa
                     ` (64 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, John Stultz, linux-m68k,
	dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 203cbf77de59fc8f13502dcfd11350c6d4a5c95f upstream.

If CONFIG_TIME_LOW_RES is enabled we add a jiffie to the relative timeout to
prevent short sleeps, but we do not account for that in interfaces which
retrieve the remaining time.

Helge observed that timerfd can return a remaining time larger than the
relative timeout. That's not expected and breaks userland test programs.

Store the information that the timer was armed relative and provide functions
to adjust the remaining time. To avoid bloating the hrtimer struct make state
a u8, which as a bonus results in better code on x86 at least.

Reported-and-tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.273328486@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/linux/hrtimer.h  | 34 +++++++++++++++++++++++++++---
 kernel/time/hrtimer.c    | 55 ++++++++++++++++++++++++++++++++----------------
 kernel/time/timer_list.c |  2 +-
 3 files changed, 69 insertions(+), 22 deletions(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 76dd4f0..2ead22d 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -87,7 +87,8 @@ enum hrtimer_restart {
  * @function:	timer expiry callback function
  * @base:	pointer to the timer base (per cpu and per clock)
  * @state:	state information (See bit values above)
- * @start_pid: timer statistics field to store the pid of the task which
+ * @is_rel:	Set if the timer was armed relative
+ * @start_pid:  timer statistics field to store the pid of the task which
  *		started the timer
  * @start_site:	timer statistics field to store the site where the timer
  *		was started
@@ -101,7 +102,8 @@ struct hrtimer {
 	ktime_t				_softexpires;
 	enum hrtimer_restart		(*function)(struct hrtimer *);
 	struct hrtimer_clock_base	*base;
-	unsigned long			state;
+	u8				state;
+	u8				is_rel;
 #ifdef CONFIG_TIMER_STATS
 	int				start_pid;
 	void				*start_site;
@@ -321,6 +323,27 @@ static inline void clock_was_set_delayed(void) { }
 
 #endif
 
+static inline ktime_t
+__hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now)
+{
+	ktime_t rem = ktime_sub(timer->node.expires, now);
+
+	/*
+	 * Adjust relative timers for the extra we added in
+	 * hrtimer_start_range_ns() to prevent short timeouts.
+	 */
+	if (IS_ENABLED(CONFIG_TIME_LOW_RES) && timer->is_rel)
+		rem.tv64 -= hrtimer_resolution;
+	return rem;
+}
+
+static inline ktime_t
+hrtimer_expires_remaining_adjusted(const struct hrtimer *timer)
+{
+	return __hrtimer_expires_remaining_adjusted(timer,
+						    timer->base->get_time());
+}
+
 extern void clock_was_set(void);
 #ifdef CONFIG_TIMERFD
 extern void timerfd_clock_was_set(void);
@@ -390,7 +413,12 @@ static inline void hrtimer_restart(struct hrtimer *timer)
 }
 
 /* Query timers: */
-extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
+extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
+
+static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
+{
+	return __hrtimer_get_remaining(timer, false);
+}
 
 extern u64 hrtimer_get_next_event(void);
 
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 5c7ae4b..5f405b3 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -889,10 +889,10 @@ static int enqueue_hrtimer(struct hrtimer *timer,
  */
 static void __remove_hrtimer(struct hrtimer *timer,
 			     struct hrtimer_clock_base *base,
-			     unsigned long newstate, int reprogram)
+			     u8 newstate, int reprogram)
 {
 	struct hrtimer_cpu_base *cpu_base = base->cpu_base;
-	unsigned int state = timer->state;
+	u8 state = timer->state;
 
 	timer->state = newstate;
 	if (!(state & HRTIMER_STATE_ENQUEUED))
@@ -922,7 +922,7 @@ static inline int
 remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart)
 {
 	if (hrtimer_is_queued(timer)) {
-		unsigned long state = timer->state;
+		u8 state = timer->state;
 		int reprogram;
 
 		/*
@@ -946,6 +946,22 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool rest
 	return 0;
 }
 
+static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim,
+					    const enum hrtimer_mode mode)
+{
+#ifdef CONFIG_TIME_LOW_RES
+	/*
+	 * CONFIG_TIME_LOW_RES indicates that the system has no way to return
+	 * granular time values. For relative timers we add hrtimer_resolution
+	 * (i.e. one jiffie) to prevent short timeouts.
+	 */
+	timer->is_rel = mode & HRTIMER_MODE_REL;
+	if (timer->is_rel)
+		tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));
+#endif
+	return tim;
+}
+
 /**
  * hrtimer_start_range_ns - (re)start an hrtimer on the current CPU
  * @timer:	the timer to be added
@@ -966,19 +982,10 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 	/* Remove an active timer from the queue: */
 	remove_hrtimer(timer, base, true);
 
-	if (mode & HRTIMER_MODE_REL) {
+	if (mode & HRTIMER_MODE_REL)
 		tim = ktime_add_safe(tim, base->get_time());
-		/*
-		 * CONFIG_TIME_LOW_RES is a temporary way for architectures
-		 * to signal that they simply return xtime in
-		 * do_gettimeoffset(). In this case we want to round up by
-		 * resolution when starting a relative timer, to avoid short
-		 * timeouts. This will go away with the GTOD framework.
-		 */
-#ifdef CONFIG_TIME_LOW_RES
-		tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));
-#endif
-	}
+
+	tim = hrtimer_update_lowres(timer, tim, mode);
 
 	hrtimer_set_expires_range_ns(timer, tim, delta_ns);
 
@@ -1066,19 +1073,23 @@ EXPORT_SYMBOL_GPL(hrtimer_cancel);
 /**
  * hrtimer_get_remaining - get remaining time for the timer
  * @timer:	the timer to read
+ * @adjust:	adjust relative timers when CONFIG_TIME_LOW_RES=y
  */
-ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
+ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust)
 {
 	unsigned long flags;
 	ktime_t rem;
 
 	lock_hrtimer_base(timer, &flags);
-	rem = hrtimer_expires_remaining(timer);
+	if (IS_ENABLED(CONFIG_TIME_LOW_RES) && adjust)
+		rem = hrtimer_expires_remaining_adjusted(timer);
+	else
+		rem = hrtimer_expires_remaining(timer);
 	unlock_hrtimer_base(timer, &flags);
 
 	return rem;
 }
-EXPORT_SYMBOL_GPL(hrtimer_get_remaining);
+EXPORT_SYMBOL_GPL(__hrtimer_get_remaining);
 
 #ifdef CONFIG_NO_HZ_COMMON
 /**
@@ -1212,6 +1223,14 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
 	fn = timer->function;
 
 	/*
+	 * Clear the 'is relative' flag for the TIME_LOW_RES case. If the
+	 * timer is restarted with a period then it becomes an absolute
+	 * timer. If its not restarted it does not matter.
+	 */
+	if (IS_ENABLED(CONFIG_TIME_LOW_RES))
+		timer->is_rel = false;
+
+	/*
 	 * Because we run timers from hardirq context, there is no chance
 	 * they get migrated to another cpu, therefore its safe to unlock
 	 * the timer base.
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index a4536e1..62b146b 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -69,7 +69,7 @@ print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer,
 	print_name_offset(m, taddr);
 	SEQ_printf(m, ", ");
 	print_name_offset(m, timer->function);
-	SEQ_printf(m, ", S:%02lx", timer->state);
+	SEQ_printf(m, ", S:%02x", timer->state);
 #ifdef CONFIG_TIMER_STATS
 	SEQ_printf(m, ", ");
 	print_name_offset(m, timer->start_site);
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 13/64] hrtimer: Handle remaining time proper for TIME_LOW_RES
@ 2016-02-04 22:43   ` Kamal Mostafa
  0 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, John Stultz, linux-m68k,
	dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 203cbf77de59fc8f13502dcfd11350c6d4a5c95f upstream.

If CONFIG_TIME_LOW_RES is enabled we add a jiffie to the relative timeout to
prevent short sleeps, but we do not account for that in interfaces which
retrieve the remaining time.

Helge observed that timerfd can return a remaining time larger than the
relative timeout. That's not expected and breaks userland test programs.

Store the information that the timer was armed relative and provide functions
to adjust the remaining time. To avoid bloating the hrtimer struct make state
a u8, which as a bonus results in better code on x86 at least.

Reported-and-tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.273328486@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/linux/hrtimer.h  | 34 +++++++++++++++++++++++++++---
 kernel/time/hrtimer.c    | 55 ++++++++++++++++++++++++++++++++----------------
 kernel/time/timer_list.c |  2 +-
 3 files changed, 69 insertions(+), 22 deletions(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 76dd4f0..2ead22d 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -87,7 +87,8 @@ enum hrtimer_restart {
  * @function:	timer expiry callback function
  * @base:	pointer to the timer base (per cpu and per clock)
  * @state:	state information (See bit values above)
- * @start_pid: timer statistics field to store the pid of the task which
+ * @is_rel:	Set if the timer was armed relative
+ * @start_pid:  timer statistics field to store the pid of the task which
  *		started the timer
  * @start_site:	timer statistics field to store the site where the timer
  *		was started
@@ -101,7 +102,8 @@ struct hrtimer {
 	ktime_t				_softexpires;
 	enum hrtimer_restart		(*function)(struct hrtimer *);
 	struct hrtimer_clock_base	*base;
-	unsigned long			state;
+	u8				state;
+	u8				is_rel;
 #ifdef CONFIG_TIMER_STATS
 	int				start_pid;
 	void				*start_site;
@@ -321,6 +323,27 @@ static inline void clock_was_set_delayed(void) { }
 
 #endif
 
+static inline ktime_t
+__hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now)
+{
+	ktime_t rem = ktime_sub(timer->node.expires, now);
+
+	/*
+	 * Adjust relative timers for the extra we added in
+	 * hrtimer_start_range_ns() to prevent short timeouts.
+	 */
+	if (IS_ENABLED(CONFIG_TIME_LOW_RES) && timer->is_rel)
+		rem.tv64 -= hrtimer_resolution;
+	return rem;
+}
+
+static inline ktime_t
+hrtimer_expires_remaining_adjusted(const struct hrtimer *timer)
+{
+	return __hrtimer_expires_remaining_adjusted(timer,
+						    timer->base->get_time());
+}
+
 extern void clock_was_set(void);
 #ifdef CONFIG_TIMERFD
 extern void timerfd_clock_was_set(void);
@@ -390,7 +413,12 @@ static inline void hrtimer_restart(struct hrtimer *timer)
 }
 
 /* Query timers: */
-extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
+extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust);
+
+static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
+{
+	return __hrtimer_get_remaining(timer, false);
+}
 
 extern u64 hrtimer_get_next_event(void);
 
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 5c7ae4b..5f405b3 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -889,10 +889,10 @@ static int enqueue_hrtimer(struct hrtimer *timer,
  */
 static void __remove_hrtimer(struct hrtimer *timer,
 			     struct hrtimer_clock_base *base,
-			     unsigned long newstate, int reprogram)
+			     u8 newstate, int reprogram)
 {
 	struct hrtimer_cpu_base *cpu_base = base->cpu_base;
-	unsigned int state = timer->state;
+	u8 state = timer->state;
 
 	timer->state = newstate;
 	if (!(state & HRTIMER_STATE_ENQUEUED))
@@ -922,7 +922,7 @@ static inline int
 remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart)
 {
 	if (hrtimer_is_queued(timer)) {
-		unsigned long state = timer->state;
+		u8 state = timer->state;
 		int reprogram;
 
 		/*
@@ -946,6 +946,22 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool rest
 	return 0;
 }
 
+static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim,
+					    const enum hrtimer_mode mode)
+{
+#ifdef CONFIG_TIME_LOW_RES
+	/*
+	 * CONFIG_TIME_LOW_RES indicates that the system has no way to return
+	 * granular time values. For relative timers we add hrtimer_resolution
+	 * (i.e. one jiffie) to prevent short timeouts.
+	 */
+	timer->is_rel = mode & HRTIMER_MODE_REL;
+	if (timer->is_rel)
+		tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));
+#endif
+	return tim;
+}
+
 /**
  * hrtimer_start_range_ns - (re)start an hrtimer on the current CPU
  * @timer:	the timer to be added
@@ -966,19 +982,10 @@ void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
 	/* Remove an active timer from the queue: */
 	remove_hrtimer(timer, base, true);
 
-	if (mode & HRTIMER_MODE_REL) {
+	if (mode & HRTIMER_MODE_REL)
 		tim = ktime_add_safe(tim, base->get_time());
-		/*
-		 * CONFIG_TIME_LOW_RES is a temporary way for architectures
-		 * to signal that they simply return xtime in
-		 * do_gettimeoffset(). In this case we want to round up by
-		 * resolution when starting a relative timer, to avoid short
-		 * timeouts. This will go away with the GTOD framework.
-		 */
-#ifdef CONFIG_TIME_LOW_RES
-		tim = ktime_add_safe(tim, ktime_set(0, hrtimer_resolution));
-#endif
-	}
+
+	tim = hrtimer_update_lowres(timer, tim, mode);
 
 	hrtimer_set_expires_range_ns(timer, tim, delta_ns);
 
@@ -1066,19 +1073,23 @@ EXPORT_SYMBOL_GPL(hrtimer_cancel);
 /**
  * hrtimer_get_remaining - get remaining time for the timer
  * @timer:	the timer to read
+ * @adjust:	adjust relative timers when CONFIG_TIME_LOW_RES=y
  */
-ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
+ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust)
 {
 	unsigned long flags;
 	ktime_t rem;
 
 	lock_hrtimer_base(timer, &flags);
-	rem = hrtimer_expires_remaining(timer);
+	if (IS_ENABLED(CONFIG_TIME_LOW_RES) && adjust)
+		rem = hrtimer_expires_remaining_adjusted(timer);
+	else
+		rem = hrtimer_expires_remaining(timer);
 	unlock_hrtimer_base(timer, &flags);
 
 	return rem;
 }
-EXPORT_SYMBOL_GPL(hrtimer_get_remaining);
+EXPORT_SYMBOL_GPL(__hrtimer_get_remaining);
 
 #ifdef CONFIG_NO_HZ_COMMON
 /**
@@ -1212,6 +1223,14 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
 	fn = timer->function;
 
 	/*
+	 * Clear the 'is relative' flag for the TIME_LOW_RES case. If the
+	 * timer is restarted with a period then it becomes an absolute
+	 * timer. If its not restarted it does not matter.
+	 */
+	if (IS_ENABLED(CONFIG_TIME_LOW_RES))
+		timer->is_rel = false;
+
+	/*
 	 * Because we run timers from hardirq context, there is no chance
 	 * they get migrated to another cpu, therefore its safe to unlock
 	 * the timer base.
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index a4536e1..62b146b 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -69,7 +69,7 @@ print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer,
 	print_name_offset(m, taddr);
 	SEQ_printf(m, ", ");
 	print_name_offset(m, timer->function);
-	SEQ_printf(m, ", S:%02lx", timer->state);
+	SEQ_printf(m, ", S:%02x", timer->state);
 #ifdef CONFIG_TIMER_STATS
 	SEQ_printf(m, ", ");
 	print_name_offset(m, timer->start_site);
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 14/64] timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
@ 2016-02-04 22:43   ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API Kamal Mostafa
                     ` (64 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, John Stultz, linux-m68k,
	dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit b62526ed11a1fe3861ab98d40b7fdab8981d788a upstream.

Helge reported that a relative timer can return a remaining time larger than
the programmed relative time on parisc and other architectures which have
CONFIG_TIME_LOW_RES set. This happens because we add a jiffie to the resulting
expiry time to prevent short timeouts.

Use the new function hrtimer_expires_remaining_adjusted() to calculate the
remaining time. It takes that extra added time into account for relative
timers.

Reported-and-tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.354500742@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/timerfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/timerfd.c b/fs/timerfd.c
index b94fa6c..053818d 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -153,7 +153,7 @@ static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
 	if (isalarm(ctx))
 		remaining = alarm_expires_remaining(&ctx->t.alarm);
 	else
-		remaining = hrtimer_expires_remaining(&ctx->t.tmr);
+		remaining = hrtimer_expires_remaining_adjusted(&ctx->t.tmr);
 
 	return remaining.tv64 < 0 ? ktime_set(0, 0): remaining;
 }
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 14/64] timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper
@ 2016-02-04 22:43   ` Kamal Mostafa
  0 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, John Stultz, linux-m68k,
	dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit b62526ed11a1fe3861ab98d40b7fdab8981d788a upstream.

Helge reported that a relative timer can return a remaining time larger than
the programmed relative time on parisc and other architectures which have
CONFIG_TIME_LOW_RES set. This happens because we add a jiffie to the resulting
expiry time to prevent short timeouts.

Use the new function hrtimer_expires_remaining_adjusted() to calculate the
remaining time. It takes that extra added time into account for relative
timers.

Reported-and-tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.354500742@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/timerfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/timerfd.c b/fs/timerfd.c
index b94fa6c..053818d 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -153,7 +153,7 @@ static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
 	if (isalarm(ctx))
 		remaining = alarm_expires_remaining(&ctx->t.alarm);
 	else
-		remaining = hrtimer_expires_remaining(&ctx->t.tmr);
+		remaining = hrtimer_expires_remaining_adjusted(&ctx->t.tmr);
 
 	return remaining.tv64 < 0 ? ktime_set(0, 0): remaining;
 }
-- 
1.9.1


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

* [PATCH 4.2.y-ckt 14/64] timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (12 preceding siblings ...)
  2016-02-04 22:43   ` Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43   ` Kamal Mostafa
                   ` (51 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, John Stultz, linux-m68k,
	dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit b62526ed11a1fe3861ab98d40b7fdab8981d788a upstream.

Helge reported that a relative timer can return a remaining time larger than
the programmed relative time on parisc and other architectures which have
CONFIG_TIME_LOW_RES set. This happens because we add a jiffie to the resulting
expiry time to prevent short timeouts.

Use the new function hrtimer_expires_remaining_adjusted() to calculate the
remaining time. It takes that extra added time into account for relative
timers.

Reported-and-tested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.354500742@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/timerfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/timerfd.c b/fs/timerfd.c
index b94fa6c..053818d 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -153,7 +153,7 @@ static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
 	if (isalarm(ctx))
 		remaining = alarm_expires_remaining(&ctx->t.alarm);
 	else
-		remaining = hrtimer_expires_remaining(&ctx->t.tmr);
+		remaining = hrtimer_expires_remaining_adjusted(&ctx->t.tmr);
 
 	return remaining.tv64 < 0 ? ktime_set(0, 0): remaining;
 }
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 15/64] posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
@ 2016-02-04 22:43   ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API Kamal Mostafa
                     ` (64 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, Helge Deller, John Stultz,
	linux-m68k, dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 572c39172684c3711e4a03c9a7380067e2b0661c upstream.

As Helge reported for timerfd we have the same issue in posix timers. We
return remaining time larger than the programmed relative time to user space
in case of CONFIG_TIME_LOW_RES=y. Use the proper function to adjust the extra
time added in hrtimer_start_range_ns().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Helge Deller <deller@gmx.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.450510905@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/posix-timers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 31d11ac..f2826c3 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -760,7 +760,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
 	    (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
 		timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv);
 
-	remaining = ktime_sub(hrtimer_get_expires(timer), now);
+	remaining = __hrtimer_expires_remaining_adjusted(timer, now);
 	/* Return 0 only, when the timer is expired and not pending */
 	if (remaining.tv64 <= 0) {
 		/*
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 15/64] posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper
@ 2016-02-04 22:43   ` Kamal Mostafa
  0 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, Helge Deller, John Stultz,
	linux-m68k, dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 572c39172684c3711e4a03c9a7380067e2b0661c upstream.

As Helge reported for timerfd we have the same issue in posix timers. We
return remaining time larger than the programmed relative time to user space
in case of CONFIG_TIME_LOW_RES=y. Use the proper function to adjust the extra
time added in hrtimer_start_range_ns().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Helge Deller <deller@gmx.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.450510905@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/posix-timers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 31d11ac..f2826c3 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -760,7 +760,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
 	    (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
 		timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv);
 
-	remaining = ktime_sub(hrtimer_get_expires(timer), now);
+	remaining = __hrtimer_expires_remaining_adjusted(timer, now);
 	/* Return 0 only, when the timer is expired and not pending */
 	if (remaining.tv64 <= 0) {
 		/*
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 15/64] posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (14 preceding siblings ...)
  2016-02-04 22:43   ` Kamal Mostafa
@ 2016-02-04 22:43 ` Kamal Mostafa
  2016-02-04 22:43   ` Kamal Mostafa
                   ` (49 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, Helge Deller, John Stultz,
	linux-m68k, dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 572c39172684c3711e4a03c9a7380067e2b0661c upstream.

As Helge reported for timerfd we have the same issue in posix timers. We
return remaining time larger than the programmed relative time to user space
in case of CONFIG_TIME_LOW_RES=y. Use the proper function to adjust the extra
time added in hrtimer_start_range_ns().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Helge Deller <deller@gmx.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.450510905@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/posix-timers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 31d11ac..f2826c3 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -760,7 +760,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
 	    (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
 		timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv);
 
-	remaining = ktime_sub(hrtimer_get_expires(timer), now);
+	remaining = __hrtimer_expires_remaining_adjusted(timer, now);
 	/* Return 0 only, when the timer is expired and not pending */
 	if (remaining.tv64 <= 0) {
 		/*
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 16/64] itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
@ 2016-02-04 22:43   ` Kamal Mostafa
  2016-02-04 22:43 ` [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API Kamal Mostafa
                     ` (64 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, Helge Deller, John Stultz,
	linux-m68k, dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 51cbb5242a41700a3f250ecfb48dcfb7e4375ea4 upstream.

As Helge reported for timerfd we have the same issue in itimers. We return
remaining time larger than the programmed relative time to user space in case
of CONFIG_TIME_LOW_RES=y. Use the proper function to adjust the extra time
added in hrtimer_start_range_ns().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Helge Deller <deller@gmx.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.528222587@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/itimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c
index 8d262b4..1d5c720 100644
--- a/kernel/time/itimer.c
+++ b/kernel/time/itimer.c
@@ -26,7 +26,7 @@
  */
 static struct timeval itimer_get_remtime(struct hrtimer *timer)
 {
-	ktime_t rem = hrtimer_get_remaining(timer);
+	ktime_t rem = __hrtimer_get_remaining(timer, true);
 
 	/*
 	 * Racy but safe: if the itimer expires after the above
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 16/64] itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper
@ 2016-02-04 22:43   ` Kamal Mostafa
  0 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:43 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thomas Gleixner, Peter Zijlstra, Helge Deller, John Stultz,
	linux-m68k, dhowells, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 51cbb5242a41700a3f250ecfb48dcfb7e4375ea4 upstream.

As Helge reported for timerfd we have the same issue in itimers. We return
remaining time larger than the programmed relative time to user space in case
of CONFIG_TIME_LOW_RES=y. Use the proper function to adjust the extra time
added in hrtimer_start_range_ns().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Helge Deller <deller@gmx.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: linux-m68k@lists.linux-m68k.org
Cc: dhowells@redhat.com
Link: http://lkml.kernel.org/r/20160114164159.528222587@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/itimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c
index 8d262b4..1d5c720 100644
--- a/kernel/time/itimer.c
+++ b/kernel/time/itimer.c
@@ -26,7 +26,7 @@
  */
 static struct timeval itimer_get_remtime(struct hrtimer *timer)
 {
-	ktime_t rem = hrtimer_get_remaining(timer);
+	ktime_t rem = __hrtimer_get_remaining(timer, true);
 
 	/*
 	 * Racy but safe: if the itimer expires after the above
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 17/64] drm/amdgpu: Use drm_calloc_large for VM page_tables array
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (17 preceding siblings ...)
  2016-02-04 22:43   ` Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 18/64] powerpc: Simplify module TOC handling Kamal Mostafa
                   ` (46 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Michel Dänzer, Alex Deucher, Kamal Mostafa

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

---8<------------------------------------------------------------

From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>

commit 9571e1d84042f5670df9fabdcbe7dd5da3abe43e upstream.

It can be big, depending on the VM address space size, which is tunable
via the vm_size module parameter.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93721
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 453c00b..a935644 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1190,7 +1190,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 {
 	const unsigned align = min(AMDGPU_VM_PTB_ALIGN_SIZE,
 		AMDGPU_VM_PTE_COUNT * 8);
-	unsigned pd_size, pd_entries, pts_size;
+	unsigned pd_size, pd_entries;
 	int i, r;
 
 	for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
@@ -1208,8 +1208,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 	pd_entries = amdgpu_vm_num_pdes(adev);
 
 	/* allocate page table array */
-	pts_size = pd_entries * sizeof(struct amdgpu_vm_pt);
-	vm->page_tables = kzalloc(pts_size, GFP_KERNEL);
+	vm->page_tables = drm_calloc_large(pd_entries, sizeof(struct amdgpu_vm_pt));
 	if (vm->page_tables == NULL) {
 		DRM_ERROR("Cannot allocate memory for page table array\n");
 		return -ENOMEM;
@@ -1260,7 +1259,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 
 	for (i = 0; i < amdgpu_vm_num_pdes(adev); i++)
 		amdgpu_bo_unref(&vm->page_tables[i].bo);
-	kfree(vm->page_tables);
+	drm_free_large(vm->page_tables);
 
 	amdgpu_bo_unref(&vm->page_directory);
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 18/64] powerpc: Simplify module TOC handling
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (18 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 17/64] drm/amdgpu: Use drm_calloc_large for VM page_tables array Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 19/64] drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2 Kamal Mostafa
                   ` (45 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Modra, Michael Ellerman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Alan Modra <amodra@gmail.com>

commit c153693d7eb9eeb28478aa2deaaf0b4e7b5ff5e9 upstream.

PowerPC64 uses the symbol .TOC. much as other targets use
_GLOBAL_OFFSET_TABLE_. It identifies the value of the GOT pointer (or in
powerpc parlance, the TOC pointer). Global offset tables are generally
local to an executable or shared library, or in the kernel, module. Thus
it does not make sense for a module to resolve a relocation against
.TOC. to the kernel's .TOC. value. A module has its own .TOC., and
indeed the powerpc64 module relocation processing ignores the kernel
value of .TOC. and instead calculates a module-local value.

This patch removes code involved in exporting the kernel .TOC., tweaks
modpost to ignore an undefined .TOC., and the module loader to twiddle
the section symbol so that .TOC. isn't seen as undefined.

Note that if the kernel was compiled with -msingle-pic-base then ELFv2
would not have function global entry code setting up r2. In that case
the module call stubs would need to be modified to set up r2 using the
kernel .TOC. value, requiring some of this code to be reinstated.

mpe: Furthermore a change in binutils master (not yet released) causes
the current way we handle the TOC to no longer work when building with
MODVERSIONS=y and RELOCATABLE=n. The symptom is that modules can not be
loaded due to there being no version found for TOC.

Signed-off-by: Alan Modra <amodra@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/kernel/misc_64.S   | 28 ----------------------------
 arch/powerpc/kernel/module_64.c | 12 +++++++++---
 scripts/mod/modpost.c           |  3 ++-
 3 files changed, 11 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index 4e314b9..bda85a1 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -634,31 +634,3 @@ _GLOBAL(kexec_sequence)
 	li	r5,0
 	blr	/* image->start(physid, image->start, 0); */
 #endif /* CONFIG_KEXEC */
-
-#ifdef CONFIG_MODULES
-#if defined(_CALL_ELF) && _CALL_ELF == 2
-
-#ifdef CONFIG_MODVERSIONS
-.weak __crc_TOC.
-.section "___kcrctab+TOC.","a"
-.globl __kcrctab_TOC.
-__kcrctab_TOC.:
-	.llong	__crc_TOC.
-#endif
-
-/*
- * Export a fake .TOC. since both modpost and depmod will complain otherwise.
- * Both modpost and depmod strip the leading . so we do the same here.
- */
-.section "__ksymtab_strings","a"
-__kstrtab_TOC.:
-	.asciz "TOC."
-
-.section "___ksymtab+TOC.","a"
-/* This symbol name is important: it's used by modpost to find exported syms */
-.globl __ksymtab_TOC.
-__ksymtab_TOC.:
-	.llong 0 /* .value */
-	.llong __kstrtab_TOC.
-#endif /* ELFv2 */
-#endif /* MODULES */
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 59663af..ac64ffd 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -326,7 +326,10 @@ static void dedotify_versions(struct modversion_info *vers,
 		}
 }
 
-/* Undefined symbols which refer to .funcname, hack to funcname (or .TOC.) */
+/*
+ * Undefined symbols which refer to .funcname, hack to funcname. Make .TOC.
+ * seem to be defined (value set later).
+ */
 static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
 {
 	unsigned int i;
@@ -334,8 +337,11 @@ static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
 	for (i = 1; i < numsyms; i++) {
 		if (syms[i].st_shndx == SHN_UNDEF) {
 			char *name = strtab + syms[i].st_name;
-			if (name[0] == '.')
+			if (name[0] == '.') {
+				if (strcmp(name+1, "TOC.") == 0)
+					syms[i].st_shndx = SHN_ABS;
 				memmove(name, name+1, strlen(name));
+			}
 		}
 	}
 }
@@ -351,7 +357,7 @@ static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs,
 	numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym);
 
 	for (i = 1; i < numsyms; i++) {
-		if (syms[i].st_shndx == SHN_UNDEF
+		if (syms[i].st_shndx == SHN_ABS
 		    && strcmp(strtab + syms[i].st_name, "TOC.") == 0)
 			return &syms[i];
 	}
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 12d3db3..a23ee3b 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -593,7 +593,8 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname)
 		if (strncmp(symname, "_restgpr0_", sizeof("_restgpr0_") - 1) == 0 ||
 		    strncmp(symname, "_savegpr0_", sizeof("_savegpr0_") - 1) == 0 ||
 		    strncmp(symname, "_restvr_", sizeof("_restvr_") - 1) == 0 ||
-		    strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0)
+		    strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0 ||
+		    strcmp(symname, ".TOC.") == 0)
 			return 1;
 	/* Do not ignore this symbol */
 	return 0;
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 19/64] drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (19 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 18/64] powerpc: Simplify module TOC handling Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 20/64] drm/radeon: properly byte swap vce firmware setup Kamal Mostafa
                   ` (44 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Christian König, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit 78d0e182b6c1f5336f6e8cbb197f403276dabc7f upstream.

We could pin BOs into invisible VRAM otherwise.

v2: make logic more readable as suggested by Michel

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> (v1)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 8da6424..9ada34f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -407,7 +407,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
 		}
 		if (fpfn > bo->placements[i].fpfn)
 			bo->placements[i].fpfn = fpfn;
-		if (lpfn && lpfn < bo->placements[i].lpfn)
+		if (!bo->placements[i].lpfn ||
+		    (lpfn && lpfn < bo->placements[i].lpfn))
 			bo->placements[i].lpfn = lpfn;
 		bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
 	}
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 20/64] drm/radeon: properly byte swap vce firmware setup
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (20 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 19/64] drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2 Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 21/64] ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist" Kamal Mostafa
                   ` (43 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit cc78eb22885bba64445cde438ba098de0104920f upstream.

Firmware is LE.  Need to properly byteswap some of the fields
so they are interpreted correctly by the driver on BE systems.

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/vce_v1_0.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/vce_v1_0.c b/drivers/gpu/drm/radeon/vce_v1_0.c
index 07a0d37..a01efe3 100644
--- a/drivers/gpu/drm/radeon/vce_v1_0.c
+++ b/drivers/gpu/drm/radeon/vce_v1_0.c
@@ -178,12 +178,12 @@ int vce_v1_0_load_fw(struct radeon_device *rdev, uint32_t *data)
 		return -EINVAL;
 	}
 
-	for (i = 0; i < sign->num; ++i) {
-		if (sign->val[i].chip_id == chip_id)
+	for (i = 0; i < le32_to_cpu(sign->num); ++i) {
+		if (le32_to_cpu(sign->val[i].chip_id) == chip_id)
 			break;
 	}
 
-	if (i == sign->num)
+	if (i == le32_to_cpu(sign->num))
 		return -EINVAL;
 
 	data += (256 - 64) / 4;
@@ -191,18 +191,18 @@ int vce_v1_0_load_fw(struct radeon_device *rdev, uint32_t *data)
 	data[1] = sign->val[i].nonce[1];
 	data[2] = sign->val[i].nonce[2];
 	data[3] = sign->val[i].nonce[3];
-	data[4] = sign->len + 64;
+	data[4] = cpu_to_le32(le32_to_cpu(sign->len) + 64);
 
 	memset(&data[5], 0, 44);
 	memcpy(&data[16], &sign[1], rdev->vce_fw->size - sizeof(*sign));
 
-	data += data[4] / 4;
+	data += le32_to_cpu(data[4]) / 4;
 	data[0] = sign->val[i].sigval[0];
 	data[1] = sign->val[i].sigval[1];
 	data[2] = sign->val[i].sigval[2];
 	data[3] = sign->val[i].sigval[3];
 
-	rdev->vce.keyselect = sign->val[i].keyselect;
+	rdev->vce.keyselect = le32_to_cpu(sign->val[i].keyselect);
 
 	return 0;
 }
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 21/64] ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist"
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (21 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 20/64] drm/radeon: properly byte swap vce firmware setup Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 22/64] ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot() Kamal Mostafa
                   ` (42 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hans de Goede, Rafael J. Wysocki, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit b186b4dcb79b1914c3dadb27ac72dafaa4267998 upstream.

The quirk to get "acpi_backlight=vendor" behavior by default on the
Dell Inspiron 5737 was added before we started doing
"acpi_backlight=native" by default on Win8 ready machines.

Since we now avoid using acpi-video as backlight driver on these machines
by default (using the native driver instead) we no longer need this quirk.

Moreover the vendor driver does not work after a suspend/resume where
as the native driver does.

This reverts commit 08a56226d847 (ACPI / video: Add Dell Inspiron 5737
to the blacklist).

Link: https://bugzilla.kernel.org/show_bug.cgi?id=111061
Reported-and-tested-by: erusan@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/acpi/video_detect.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 2922f1f..bdd3bb5 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -135,14 +135,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
 		DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"),
 		},
 	},
-	{
-	.callback = video_detect_force_vendor,
-	.ident = "Dell Inspiron 5737",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-		DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 5737"),
-		},
-	},
 
 	/*
 	 * These models have a working acpi_video backlight control, and using
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 22/64] ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot()
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (22 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 21/64] ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist" Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 23/64] hwmon: (dell-smm) Blacklist Dell Studio XPS 8000 Kamal Mostafa
                   ` (41 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Insu Yun, Rafael J. Wysocki, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Insu Yun <wuninsu@gmail.com>

commit 2c3033a0664dfae91e1dee7fabac10f24354b958 upstream.

In acpiphp_enable_slot(), there is a missing unlock path
when error occurred.  It needs to be unlocked before returning
an error.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/pci/hotplug/acpiphp_glue.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index ff53856..0b3e0bf 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -953,8 +953,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
 {
 	pci_lock_rescan_remove();
 
-	if (slot->flags & SLOT_IS_GOING_AWAY)
+	if (slot->flags & SLOT_IS_GOING_AWAY) {
+		pci_unlock_rescan_remove();
 		return -ENODEV;
+	}
 
 	/* configure all functions */
 	if (!(slot->flags & SLOT_ENABLED))
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 23/64] hwmon: (dell-smm) Blacklist Dell Studio XPS 8000
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (23 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 22/64] ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot() Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 24/64] usb: cdc-acm: handle unlinked urb in acm read callback Kamal Mostafa
                   ` (40 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Thorsten Leemhuis, Guenter Roeck, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Thorsten Leemhuis <linux@leemhuis.info>

commit 6220f4ebd7b4db499238c2dc91268a9c473fd01c upstream.

Since Linux 4.0 the CPU fan speed is going up and down on Dell Studio
XPS 8000 and 8100 for unknown reasons. The 8100 was already
blacklisted in commit a4b45b25f18d ("hwmon: (dell-smm) Blacklist
Dell Studio XPS 8100"). This patch blacklists the XPS 8000.

Without further debugging on the affected machine, it is not possible
to find the problem. For more details see
https://bugzilla.kernel.org/show_bug.cgi?id=100121

Signed-off-by: Thorsten Leemhuis <linux@leemhuis.info>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/hwmon/dell-smm-hwmon.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index c848789..c43318d 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -932,6 +932,17 @@ MODULE_DEVICE_TABLE(dmi, i8k_dmi_table);
 static struct dmi_system_id i8k_blacklist_dmi_table[] __initdata = {
 	{
 		/*
+		 * CPU fan speed going up and down on Dell Studio XPS 8000
+		 * for unknown reasons.
+		 */
+		.ident = "Dell Studio XPS 8000",
+		.matches = {
+			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Studio XPS 8000"),
+		},
+	},
+	{
+		/*
 		 * CPU fan speed going up and down on Dell Studio XPS 8100
 		 * for unknown reasons.
 		 */
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 24/64] usb: cdc-acm: handle unlinked urb in acm read callback
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (24 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 23/64] hwmon: (dell-smm) Blacklist Dell Studio XPS 8000 Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 25/64] usb: cdc-acm: send zero packet for intel 7260 modem Kamal Mostafa
                   ` (39 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Tang Jian Qiang, Lu Baolu, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Lu Baolu <baolu.lu@linux.intel.com>

commit 19454462acb1bdef80542061bdc9b410e4ed1ff6 upstream.

In current acm driver, the bulk-in callback function ignores the
URBs unlinked in usb core.

This causes unexpected data loss in some cases. For example,
runtime suspend entry will unlinked all urbs and set urb->status
to -ENOENT even those urbs might have data not processed yet.
Hence, data loss occurs.

This patch lets bulk-in callback function handle unlinked urbs
to avoid data loss.

Signed-off-by: Tang Jian Qiang <jianqiang.tang@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/class/cdc-acm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 26ca4f9..8cd193b 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb)
 		set_bit(rb->index, &acm->read_urbs_free);
 		dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n",
 							__func__, status);
-		return;
+		if ((status != -ENOENT) || (urb->actual_length == 0))
+			return;
 	}
 
 	usb_mark_last_busy(acm->dev);
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 25/64] usb: cdc-acm: send zero packet for intel 7260 modem
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (25 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 24/64] usb: cdc-acm: handle unlinked urb in acm read callback Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 26/64] cdc-acm:exclude Samsung phone 04e8:685d Kamal Mostafa
                   ` (38 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Konrad Leszczynski, Lu Baolu, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Lu Baolu <baolu.lu@linux.intel.com>

commit ffdb1e369a73b380fce95b05f8498d92c43842b4 upstream.

For Intel 7260 modem, it is needed for host side to send zero
packet if the BULK OUT size is equal to USB endpoint max packet
length. Otherwise, modem side may still wait for more data and
cannot give response to host side.

Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/class/cdc-acm.c | 6 ++++++
 drivers/usb/class/cdc-acm.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 8cd193b..e4c70dc 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1405,6 +1405,8 @@ made_compressed_probe:
 				usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
 				NULL, acm->writesize, acm_write_bulk, snd);
 		snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+		if (quirks & SEND_ZERO_PACKET)
+			snd->urb->transfer_flags |= URB_ZERO_PACKET;
 		snd->instance = acm;
 	}
 
@@ -1862,6 +1864,10 @@ static const struct usb_device_id acm_ids[] = {
 	{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
 		USB_CDC_ACM_PROTO_AT_CDMA) },
 
+	{ USB_DEVICE(0x1519, 0x0452), /* Intel 7260 modem */
+	.driver_info = SEND_ZERO_PACKET,
+	},
+
 	{ }
 };
 
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index dd9af38..ccfaba9 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -134,3 +134,4 @@ struct acm {
 #define IGNORE_DEVICE			BIT(5)
 #define QUIRK_CONTROL_LINE_STATE	BIT(6)
 #define CLEAR_HALT_CONDITIONS		BIT(7)
+#define SEND_ZERO_PACKET		BIT(8)
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 26/64] cdc-acm:exclude Samsung phone 04e8:685d
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (26 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 25/64] usb: cdc-acm: send zero packet for intel 7260 modem Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 27/64] usb: hub: do not clear BOS field during reset device Kamal Mostafa
                   ` (37 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Oliver Neukum, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Oliver Neukum <oneukum@suse.com>

commit e912e685f372ab62a2405a1acd923597f524e94a upstream.

This phone needs to be handled by a specialised firmware tool
and is reported to crash irrevocably if cdc-acm takes it.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/class/cdc-acm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index e4c70dc..fa4e239 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1841,6 +1841,11 @@ static const struct usb_device_id acm_ids[] = {
 	},
 #endif
 
+	/*Samsung phone in firmware update mode */
+	{ USB_DEVICE(0x04e8, 0x685d),
+	.driver_info = IGNORE_DEVICE,
+	},
+
 	/* Exclude Infineon Flash Loader utility */
 	{ USB_DEVICE(0x058b, 0x0041),
 	.driver_info = IGNORE_DEVICE,
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 27/64] usb: hub: do not clear BOS field during reset device
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (27 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 26/64] cdc-acm:exclude Samsung phone 04e8:685d Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 28/64] USB: cp210x: add ID for IAI USB to RS485 adaptor Kamal Mostafa
                   ` (36 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Du, Changbin, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit d8f00cd685f5c8e0def8593e520a7fef12c22407 upstream.

In function usb_reset_and_verify_device, the old BOS descriptor may
still be used before allocating a new one. (usb_unlocked_disable_lpm
function uses it under the situation that it fails to disable lpm.)
So we cannot set the udev->bos to NULL before that, just keep what it
was. It will be overwrite when allocating a new one.

Crash log:
BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
IP: [<ffffffff8171f98d>] usb_enable_link_state+0x2d/0x2f0
Call Trace:
[<ffffffff8171ed5b>] ? usb_set_lpm_timeout+0x12b/0x140
[<ffffffff8171fcd1>] usb_enable_lpm+0x81/0xa0
[<ffffffff8171fdd8>] usb_disable_lpm+0xa8/0xc0
[<ffffffff8171fe1c>] usb_unlocked_disable_lpm+0x2c/0x50
[<ffffffff81723933>] usb_reset_and_verify_device+0xc3/0x710
[<ffffffff8172c4ed>] ? usb_sg_wait+0x13d/0x190
[<ffffffff81724743>] usb_reset_device+0x133/0x280
[<ffffffff8179ccd1>] usb_stor_port_reset+0x61/0x70
[<ffffffff8179cd68>] usb_stor_invoke_transport+0x88/0x520

Signed-off-by: Du, Changbin <changbin.du@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/core/hub.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 2f0fa89..252807d 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5352,7 +5352,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
 	}
 
 	bos = udev->bos;
-	udev->bos = NULL;
 
 	for (i = 0; i < SET_CONFIG_TRIES; ++i) {
 
@@ -5445,8 +5444,11 @@ done:
 	usb_set_usb2_hardware_lpm(udev, 1);
 	usb_unlocked_enable_lpm(udev);
 	usb_enable_ltm(udev);
-	usb_release_bos_descriptor(udev);
-	udev->bos = bos;
+	/* release the new BOS descriptor allocated  by hub_port_init() */
+	if (udev->bos != bos) {
+		usb_release_bos_descriptor(udev);
+		udev->bos = bos;
+	}
 	return 0;
 
 re_enumerate:
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 28/64] USB: cp210x: add ID for IAI USB to RS485 adaptor
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (28 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 27/64] usb: hub: do not clear BOS field during reset device Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 29/64] USB: visor: fix null-deref at probe Kamal Mostafa
                   ` (35 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Dedecker, Johan Hovold, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Peter Dedecker <peter.dedecker@hotmail.com>

commit f487c54ddd544e1c9172cd510954f697b77b76e3 upstream.

Added the USB serial console device ID for IAI Corp. RCB-CV-USB
USB to RS485 adaptor.

Signed-off-by: Peter Dedecker <peter.dedecker@hotmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/cp210x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 59b2126..1dd9919 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -98,6 +98,7 @@ static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
 	{ USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */
 	{ USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
+	{ USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */
 	{ USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
 	{ USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
 	{ USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 29/64] USB: visor: fix null-deref at probe
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (29 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 28/64] USB: cp210x: add ID for IAI USB to RS485 adaptor Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 30/64] USB: serial: visor: fix crash on detecting device without write_urbs Kamal Mostafa
                   ` (34 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Johan Hovold, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Johan Hovold <johan@kernel.org>

commit cac9b50b0d75a1d50d6c056ff65c005f3224c8e0 upstream.

Fix null-pointer dereference at probe should a (malicious) Treo device
lack the expected endpoints.

Specifically, the Treo port-setup hack was dereferencing the bulk-in and
interrupt-in urbs without first making sure they had been allocated by
core.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/visor.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 60afb39..c53fbb3 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -544,6 +544,11 @@ static int treo_attach(struct usb_serial *serial)
 		(serial->num_interrupt_in == 0))
 		return 0;
 
+	if (serial->num_bulk_in < 2 || serial->num_interrupt_in < 2) {
+		dev_err(&serial->interface->dev, "missing endpoints\n");
+		return -ENODEV;
+	}
+
 	/*
 	* It appears that Treos and Kyoceras want to use the
 	* 1st bulk in endpoint to communicate with the 2nd bulk out endpoint,
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 30/64] USB: serial: visor: fix crash on detecting device without write_urbs
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (30 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 29/64] USB: visor: fix null-deref at probe Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 31/64] USB: serial: option: Adding support for Telit LE922 Kamal Mostafa
                   ` (33 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Vladis Dronov, Johan Hovold, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Vladis Dronov <vdronov@redhat.com>

commit cb3232138e37129e88240a98a1d2aba2187ff57c upstream.

The visor driver crashes in clie_5_attach() when a specially crafted USB
device without bulk-out endpoint is detected. This fix adds a check that
the device has proper configuration expected by the driver.

Reported-by: Ralf Spenneberg <ralf@spenneberg.net>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Fixes: cfb8da8f69b8 ("USB: visor: fix initialisation of UX50/TH55 devices")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/visor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index c53fbb3..337a0be 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -602,8 +602,10 @@ static int clie_5_attach(struct usb_serial *serial)
 	 */
 
 	/* some sanity check */
-	if (serial->num_ports < 2)
-		return -1;
+	if (serial->num_bulk_out < 2) {
+		dev_err(&serial->interface->dev, "missing bulk out endpoints\n");
+		return -ENODEV;
+	}
 
 	/* port 0 now uses the modified endpoint Address */
 	port = serial->port[0];
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 31/64] USB: serial: option: Adding support for Telit LE922
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (31 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 30/64] USB: serial: visor: fix crash on detecting device without write_urbs Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 32/64] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() Kamal Mostafa
                   ` (32 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Daniele Palmas, Johan Hovold, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Daniele Palmas <dnlplm@gmail.com>

commit ff4e2494dc17b173468e1713fdf6237fd8578bc7 upstream.

This patch adds support for two PIDs of LE922.

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/option.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 4021846..4201640 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -271,6 +271,8 @@ static void option_instat_callback(struct urb *urb);
 #define TELIT_PRODUCT_CC864_SINGLE		0x1006
 #define TELIT_PRODUCT_DE910_DUAL		0x1010
 #define TELIT_PRODUCT_UE910_V2			0x1012
+#define TELIT_PRODUCT_LE922_USBCFG0		0x1042
+#define TELIT_PRODUCT_LE922_USBCFG3		0x1043
 #define TELIT_PRODUCT_LE920			0x1200
 #define TELIT_PRODUCT_LE910			0x1201
 
@@ -623,6 +625,16 @@ static const struct option_blacklist_info sierra_mc73xx_blacklist = {
 	.reserved = BIT(8) | BIT(10) | BIT(11),
 };
 
+static const struct option_blacklist_info telit_le922_blacklist_usbcfg0 = {
+	.sendsetup = BIT(2),
+	.reserved = BIT(0) | BIT(1) | BIT(3),
+};
+
+static const struct option_blacklist_info telit_le922_blacklist_usbcfg3 = {
+	.sendsetup = BIT(0),
+	.reserved = BIT(1) | BIT(2) | BIT(3),
+};
+
 static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -1172,6 +1184,10 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) },
+	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0),
+		.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
+	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3),
+		.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
 		.driver_info = (kernel_ulong_t)&telit_le910_blacklist },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 32/64] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (32 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 31/64] USB: serial: option: Adding support for Telit LE922 Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 33/64] ALSA: seq: Degrade the error message for too many opens Kamal Mostafa
                   ` (31 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit 599151336638d57b98d92338aa59c048e3a3e97d upstream.

ALSA sequencer OSS emulation code has a sanity check for currently
opened devices, but there is a thinko there, eventually it spews
warnings and skips the operation wrongly like:
  WARNING: CPU: 1 PID: 7573 at sound/core/seq/oss/seq_oss_synth.c:311

Fix this off-by-one error.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/core/seq/oss/seq_oss_synth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c
index 0f3b381..b16dbef 100644
--- a/sound/core/seq/oss/seq_oss_synth.c
+++ b/sound/core/seq/oss/seq_oss_synth.c
@@ -308,7 +308,7 @@ snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp)
 	struct seq_oss_synth *rec;
 	struct seq_oss_synthinfo *info;
 
-	if (snd_BUG_ON(dp->max_synthdev >= SNDRV_SEQ_OSS_MAX_SYNTH_DEVS))
+	if (snd_BUG_ON(dp->max_synthdev > SNDRV_SEQ_OSS_MAX_SYNTH_DEVS))
 		return;
 	for (i = 0; i < dp->max_synthdev; i++) {
 		info = &dp->synths[i];
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 33/64] ALSA: seq: Degrade the error message for too many opens
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (33 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 32/64] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 34/64] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable Kamal Mostafa
                   ` (30 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit da10816e3d923565b470fec78a674baba794ed33 upstream.

ALSA OSS sequencer spews a kernel error message ("ALSA: seq_oss: too
many applications") when user-space tries to open more than the
limit.  This means that it can easily fill the log buffer.

Since it's merely a normal error, it's safe to suppress it via
pr_debug() instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/core/seq/oss/seq_oss_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c
index b1221b2..6779e82b 100644
--- a/sound/core/seq/oss/seq_oss_init.c
+++ b/sound/core/seq/oss/seq_oss_init.c
@@ -202,7 +202,7 @@ snd_seq_oss_open(struct file *file, int level)
 
 	dp->index = i;
 	if (i >= SNDRV_SEQ_OSS_MAX_CLIENTS) {
-		pr_err("ALSA: seq_oss: too many applications\n");
+		pr_debug("ALSA: seq_oss: too many applications\n");
 		rc = -ENOMEM;
 		goto _error;
 	}
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 34/64] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (34 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 33/64] ALSA: seq: Degrade the error message for too many opens Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 35/64] arm64: kernel: fix architected PMU registers unconditional access Kamal Mostafa
                   ` (29 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Greg Kroah-Hartman, Johan Hovold, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e03cdf22a2727c60307be6a729233edab3bfda9c upstream.

Harald Linden reports that the ftdi_sio driver works properly for the
Yaesu SCU-18 cable if the device ids are added to the driver.  So let's
add them.

Reported-by: Harald Linden <harald.linden@7183.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index a5a0376..8c660ae 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -824,6 +824,7 @@ static const struct usb_device_id id_table_combined[] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
+	{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) },
 	{ USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
 
 	/* Papouch devices based on FTDI chip */
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 2943b97..7850071 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -615,6 +615,7 @@
  */
 #define RATOC_VENDOR_ID		0x0584
 #define RATOC_PRODUCT_ID_USB60F	0xb020
+#define RATOC_PRODUCT_ID_SCU18	0xb03a
 
 /*
  * Infineon Technologies
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 35/64] arm64: kernel: fix architected PMU registers unconditional access
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (35 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 34/64] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 36/64] USB: option: fix Cinterion AHxx enumeration Kamal Mostafa
                   ` (28 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Maydell, Mark Rutland, Lorenzo Pieralisi, Will Deacon,
	Kamal Mostafa

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

---8<------------------------------------------------------------

From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

commit f436b2ac90a095746beb6729b8ee8ed87c9eaede upstream.

The Performance Monitors extension is an optional feature of the
AArch64 architecture, therefore, in order to access Performance
Monitors registers safely, the kernel should detect the architected
PMU unit presence through the ID_AA64DFR0_EL1 register PMUVer field
before accessing them.

This patch implements a guard by reading the ID_AA64DFR0_EL1 register
PMUVer field to detect the architected PMU presence and prevent accessing
PMU system registers if the Performance Monitors extension is not
implemented in the core.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Fixes: 60792ad349f3 ("arm64: kernel: enforce pmuserenr_el0 initialization and restore")
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm64/kernel/head.S    |  5 +++++
 arch/arm64/mm/proc-macros.S | 12 ++++++++++++
 arch/arm64/mm/proc.S        |  4 ++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 3705411..963b073 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -529,9 +529,14 @@ CPU_LE(	movk	x0, #0x30d0, lsl #16	)	// Clear EE and E0E on LE systems
 #endif
 
 	/* EL2 debug */
+	mrs	x0, id_aa64dfr0_el1		// Check ID_AA64DFR0_EL1 PMUVer
+	sbfx	x0, x0, #8, #4
+	cmp	x0, #1
+	b.lt	4f				// Skip if no PMU present
 	mrs	x0, pmcr_el0			// Disable debug access traps
 	ubfx	x0, x0, #11, #5			// to EL2 and allow access to
 	msr	mdcr_el2, x0			// all PMU counters from EL1
+4:
 
 	/* Stage-2 translation */
 	msr	vttbr_el2, xzr
diff --git a/arch/arm64/mm/proc-macros.S b/arch/arm64/mm/proc-macros.S
index 4c4d93c..d69dfff 100644
--- a/arch/arm64/mm/proc-macros.S
+++ b/arch/arm64/mm/proc-macros.S
@@ -62,3 +62,15 @@
 	bfi	\valreg, \tmpreg, #TCR_T0SZ_OFFSET, #TCR_TxSZ_WIDTH
 #endif
 	.endm
+
+/*
+ * reset_pmuserenr_el0 - reset PMUSERENR_EL0 if PMUv3 present
+ */
+	.macro	reset_pmuserenr_el0, tmpreg
+	mrs	\tmpreg, id_aa64dfr0_el1	// Check ID_AA64DFR0_EL1 PMUVer
+	sbfx	\tmpreg, \tmpreg, #8, #4
+	cmp	\tmpreg, #1			// Skip if no PMU present
+	b.lt	9000f
+	msr	pmuserenr_el0, xzr		// Disable PMU access from EL0
+9000:
+	.endm
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index 4730e39..2099067 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -119,7 +119,7 @@ ENTRY(cpu_do_resume)
 	 */
 	ubfx	x11, x11, #1, #1
 	msr	oslar_el1, x11
-	msr	pmuserenr_el0, xzr		// Disable PMU access from EL0
+	reset_pmuserenr_el0 x0			// Disable PMU access from EL0
 	mov	x0, x12
 	dsb	nsh		// Make sure local tlb invalidation completed
 	isb
@@ -159,7 +159,7 @@ ENTRY(__cpu_setup)
 	msr	cpacr_el1, x0			// Enable FP/ASIMD
 	mov	x0, #1 << 12			// Reset mdscr_el1 and disable
 	msr	mdscr_el1, x0			// access to the DCC from EL0
-	msr	pmuserenr_el0, xzr		// Disable PMU access from EL0
+	reset_pmuserenr_el0 x0			// Disable PMU access from EL0
 	/*
 	 * Memory region attributes for LPAE:
 	 *
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 36/64] USB: option: fix Cinterion AHxx enumeration
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (36 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 35/64] arm64: kernel: fix architected PMU registers unconditional access Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 37/64] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Kamal Mostafa
                   ` (27 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: John Ernberg, Johan Hovold, Kamal Mostafa

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

---8<------------------------------------------------------------

From: John Ernberg <john.ernberg@actia.se>

commit 4152b387da81617c80cb2946b2d56e3958906b3e upstream.

In certain kernel configurations where the cdc_ether and option drivers
are compiled as modules there can occur a race condition in enumeration.
This causes the option driver to enumerate the ethernet(wwan) interface
as usb-serial interfaces.

usb-devices output for the modem:
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  5 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1e2d ProdID=0055 Rev=00.00
S:  Manufacturer=Cinterion
S:  Product=AHx
C:  #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=10mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
I:  If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether

Signed-off-by: John Ernberg <john.ernberg@actia.se>
Fixes: 1941138e1c02 ("USB: added support for Cinterion's products...")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/usb/serial/option.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 4201640..8854059 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1707,7 +1707,7 @@ static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) },
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8),
 		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
-	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) },
+	{ USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX, 0xff) },
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX),
 		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 37/64] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (37 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 36/64] USB: option: fix Cinterion AHxx enumeration Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 38/64] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay Kamal Mostafa
                   ` (26 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit 462b3f161beb62eeb290f4ec52f5ead29a2f8ac7 upstream.

Some architectures like PowerPC can handle the maximum struct size in
an ioctl only up to 13 bits, and struct snd_compr_codec_caps used by
SNDRV_COMPRESS_GET_CODEC_CAPS ioctl overflows this limit.  This
problem was revealed recently by a powerpc change, as it's now treated
as a fatal build error.

This patch is a stop-gap for that: for architectures with less than 14
bit ioctl struct size, get rid of the handling of the relevant ioctl.
We should provide an alternative equivalent ioctl code later, but for
now just paper over it.  Luckily, the compress API hasn't been used on
such architectures, so the impact must be effectively zero.

Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/core/compress_offload.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index b123c42..b554d7f 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -44,6 +44,13 @@
 #include <sound/compress_offload.h>
 #include <sound/compress_driver.h>
 
+/* struct snd_compr_codec_caps overflows the ioctl bit size for some
+ * architectures, so we need to disable the relevant ioctls.
+ */
+#if _IOC_SIZEBITS < 14
+#define COMPR_CODEC_CAPS_OVERFLOW
+#endif
+
 /* TODO:
  * - add substream support for multiple devices in case of
  *	SND_DYNAMIC_MINORS is not used
@@ -438,6 +445,7 @@ out:
 	return retval;
 }
 
+#ifndef COMPR_CODEC_CAPS_OVERFLOW
 static int
 snd_compr_get_codec_caps(struct snd_compr_stream *stream, unsigned long arg)
 {
@@ -461,6 +469,7 @@ out:
 	kfree(caps);
 	return retval;
 }
+#endif /* !COMPR_CODEC_CAPS_OVERFLOW */
 
 /* revisit this with snd_pcm_preallocate_xxx */
 static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
@@ -799,9 +808,11 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
 	case _IOC_NR(SNDRV_COMPRESS_GET_CAPS):
 		retval = snd_compr_get_caps(stream, arg);
 		break;
+#ifndef COMPR_CODEC_CAPS_OVERFLOW
 	case _IOC_NR(SNDRV_COMPRESS_GET_CODEC_CAPS):
 		retval = snd_compr_get_codec_caps(stream, arg);
 		break;
+#endif
 	case _IOC_NR(SNDRV_COMPRESS_SET_PARAMS):
 		retval = snd_compr_set_params(stream, arg);
 		break;
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 38/64] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (38 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 37/64] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 39/64] virtio_pci: fix use after free on release Kamal Mostafa
                   ` (25 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Guillaume Fougnies, Takashi Iwai, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Guillaume Fougnies <guillaume@eulerian.com>

commit 5a4ff9ec8d6edd2ab1cfe8ce6a080d6e57cbea9a upstream.

TEAC UD-501/UD-503/NT-503 fail to switch properly between different
rate/format. Similar to 'Playback Design', this patch corrects the
invalid clock source error for TEAC products and avoids complete
freeze of the usb interface of 503 series.

Signed-off-by: Guillaume Fougnies <guillaume@eulerian.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/usb/quirks.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index fb9a8a5..5585cfd 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1202,8 +1202,12 @@ void snd_usb_set_interface_quirk(struct usb_device *dev)
 	 * "Playback Design" products need a 50ms delay after setting the
 	 * USB interface.
 	 */
-	if (le16_to_cpu(dev->descriptor.idVendor) == 0x23ba)
+	switch (le16_to_cpu(dev->descriptor.idVendor)) {
+	case 0x23ba: /* Playback Design */
+	case 0x0644: /* TEAC Corp. */
 		mdelay(50);
+		break;
+	}
 }
 
 void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
@@ -1218,6 +1222,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
 	    (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
 		mdelay(20);
 
+	/*
+	 * "TEAC Corp." products need a 20ms delay after each
+	 * class compliant request
+	 */
+	if ((le16_to_cpu(dev->descriptor.idVendor) == 0x0644) &&
+	    (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
+		mdelay(20);
+
 	/* Marantz/Denon devices with USB DAC functionality need a delay
 	 * after each class compliant request
 	 */
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 39/64] virtio_pci: fix use after free on release
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (39 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 38/64] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 40/64] ALSA: bebob: Use a signed return type for get_formation_index Kamal Mostafa
                   ` (24 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sasha Levin, Michael S. Tsirkin, Kamal Mostafa

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

---8<------------------------------------------------------------

From: "Michael S. Tsirkin" <mst@redhat.com>

commit 2989be09a8a9d62a785137586ad941f916e08f83 upstream.

KASan detected a use-after-free error in virtio-pci remove code. In
virtio_pci_remove(), vp_dev is still used after being freed in
unregister_virtio_device() (in virtio_pci_release_dev() more
precisely).

To fix, keep a reference until cleanup is done.

Fixes: 63bd62a08ca4 ("virtio_pci: defer kfree until release callback")
Reported-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/virtio/virtio_pci_common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index 78f804a..2046a68 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -545,6 +545,7 @@ err_enable_device:
 static void virtio_pci_remove(struct pci_dev *pci_dev)
 {
 	struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
+	struct device *dev = get_device(&vp_dev->vdev.dev);
 
 	unregister_virtio_device(&vp_dev->vdev);
 
@@ -554,6 +555,7 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
 		virtio_pci_modern_remove(vp_dev);
 
 	pci_disable_device(pci_dev);
+	put_device(dev);
 }
 
 static struct pci_driver virtio_pci_driver = {
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 40/64] ALSA: bebob: Use a signed return type for get_formation_index
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (40 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 39/64] virtio_pci: fix use after free on release Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 41/64] arm64: errata: Add -mpc-relative-literal-loads to build flags Kamal Mostafa
                   ` (23 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lucas Tanure, Takashi Iwai, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Lucas Tanure <tanure@linux.com>

commit 07905298e4d5777eb58516cdc242f7ac1ca387a2 upstream.

The return type "unsigned int" was used by the get_formation_index function
despite of the aspect that it will eventually return a negative	error code.
So, change to signed int and get index by reference in the parameters.

Done with the help of Coccinelle.

[Fix the missing braces suggested by Julia Lawall -- tiwai]

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/firewire/bebob/bebob_stream.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index 5be5242..7fdf34e 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -47,14 +47,16 @@ static const unsigned int bridgeco_freq_table[] = {
 	[6] = 0x07,
 };
 
-static unsigned int
-get_formation_index(unsigned int rate)
+static int
+get_formation_index(unsigned int rate, unsigned int *index)
 {
 	unsigned int i;
 
 	for (i = 0; i < ARRAY_SIZE(snd_bebob_rate_table); i++) {
-		if (snd_bebob_rate_table[i] == rate)
-			return i;
+		if (snd_bebob_rate_table[i] == rate) {
+			*index = i;
+			return 0;
+		}
 	}
 	return -EINVAL;
 }
@@ -424,7 +426,9 @@ make_both_connections(struct snd_bebob *bebob, unsigned int rate)
 		goto end;
 
 	/* confirm params for both streams */
-	index = get_formation_index(rate);
+	err = get_formation_index(rate, &index);
+	if (err < 0)
+		goto end;
 	pcm_channels = bebob->tx_stream_formations[index].pcm;
 	midi_channels = bebob->tx_stream_formations[index].midi;
 	amdtp_stream_set_parameters(&bebob->tx_stream,
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 41/64] arm64: errata: Add -mpc-relative-literal-loads to build flags
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (41 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 40/64] ALSA: bebob: Use a signed return type for get_formation_index Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 42/64] arm64: mm: avoid calling apply_to_page_range on empty range Kamal Mostafa
                   ` (22 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Dann Frazier, Will Deacon, Kamal Mostafa

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

---8<------------------------------------------------------------

From: dann frazier <dann.frazier@canonical.com>

commit 67dfa1751ce71e629aad7c438e1678ad41054677 upstream.

GCC6 (and Linaro's 2015.12 snapshot of GCC5) has a new default that uses
adrp/ldr or adrp/add to address literal pools. When CONFIG_ARM64_ERRATUM_843419
is enabled, modules built with this toolchain fail to load:

  module libahci: unsupported RELA relocation: 275

This patch fixes the problem by passing '-mpc-relative-literal-loads'
to the compiler.

Fixes: df057cc7b4fa ("arm64: errata: add module build workaround for erratum #843419")
BugLink: http://bugs.launchpad.net/bugs/1533009
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Suggested-by: Christophe Lyon <christophe.lyon@linaro.org>
Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm64/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 3258174..d7e808f 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -18,6 +18,7 @@ GZFLAGS		:=-9
 KBUILD_DEFCONFIG := defconfig
 
 KBUILD_CFLAGS	+= -mgeneral-regs-only
+KBUILD_CFLAGS	+= $(call cc-option, -mpc-relative-literal-loads)
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS	+= -mbig-endian
 AS		+= -EB
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 42/64] arm64: mm: avoid calling apply_to_page_range on empty range
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (42 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 41/64] arm64: errata: Add -mpc-relative-literal-loads to build flags Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 43/64] x86/mm: Fix types used in pgprot cacheability flags translations Kamal Mostafa
                   ` (21 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Mika Penttilä, Will Deacon, Kamal Mostafa

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

---8<------------------------------------------------------------

From: =?UTF-8?q?Mika=20Penttil=C3=A4?= <mika.penttila@nextfour.com>

commit 57adec866c0440976c96a4b8f5b59fb411b1cacb upstream.

Calling apply_to_page_range with an empty range results in a BUG_ON
from the core code. This can be triggered by trying to load the st_drv
module with CONFIG_DEBUG_SET_MODULE_RONX enabled:

  kernel BUG at mm/memory.c:1874!
  Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
  Modules linked in:
  CPU: 3 PID: 1764 Comm: insmod Not tainted 4.5.0-rc1+ #2
  Hardware name: ARM Juno development board (r0) (DT)
  task: ffffffc9763b8000 ti: ffffffc975af8000 task.ti: ffffffc975af8000
  PC is at apply_to_page_range+0x2cc/0x2d0
  LR is at change_memory_common+0x80/0x108

This patch fixes the issue by making change_memory_common (called by the
set_memory_* functions) a NOP when numpages == 0, therefore avoiding the
erroneous call to apply_to_page_range and bringing us into line with x86
and s390.

Reviewed-by: Laura Abbott <labbott@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Mika Penttilä <mika.penttila@nextfour.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/arm64/mm/pageattr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c
index e47ed1c..545710f 100644
--- a/arch/arm64/mm/pageattr.c
+++ b/arch/arm64/mm/pageattr.c
@@ -57,6 +57,9 @@ static int change_memory_common(unsigned long addr, int numpages,
 	if (end < MODULES_VADDR || end >= MODULES_END)
 		return -EINVAL;
 
+	if (!numpages)
+		return 0;
+
 	data.set_mask = set_mask;
 	data.clear_mask = clear_mask;
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 43/64] x86/mm: Fix types used in pgprot cacheability flags translations
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (43 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 42/64] arm64: mm: avoid calling apply_to_page_range on empty range Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 44/64] powerpc/eeh: Fix PE location code Kamal Mostafa
                   ` (20 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jan Beulich, Thomas Gleixner, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Jan Beulich <JBeulich@suse.com>

commit 3625c2c234ef66acf21a72d47a5ffa94f6c5ebf2 upstream.

For PAE kernels "unsigned long" is not suitable to hold page protection
flags, since _PAGE_NX doesn't fit there. This is the reason for quite a
few W+X pages getting reported as insecure during boot (observed namely
for the entire initrd range).

Fixes: 281d4078be ("x86: Make page cache mode a real type")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <JGross@suse.com>
Link: http://lkml.kernel.org/r/56A7635602000078000CAFF1@prv-mh.provo.novell.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/include/asm/pgtable_types.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 13f310b..055bcb1 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -337,20 +337,18 @@ static inline enum page_cache_mode pgprot2cachemode(pgprot_t pgprot)
 }
 static inline pgprot_t pgprot_4k_2_large(pgprot_t pgprot)
 {
+	pgprotval_t val = pgprot_val(pgprot);
 	pgprot_t new;
-	unsigned long val;
 
-	val = pgprot_val(pgprot);
 	pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
 		((val & _PAGE_PAT) << (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
 	return new;
 }
 static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot)
 {
+	pgprotval_t val = pgprot_val(pgprot);
 	pgprot_t new;
-	unsigned long val;
 
-	val = pgprot_val(pgprot);
 	pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) |
 			  ((val & _PAGE_PAT_LARGE) >>
 			   (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT));
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 44/64] powerpc/eeh: Fix PE location code
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (44 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 43/64] x86/mm: Fix types used in pgprot cacheability flags translations Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 45/64] SCSI: fix crashes in sd and sr runtime PM Kamal Mostafa
                   ` (19 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Gavin Shan, Michael Ellerman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Gavin Shan <gwshan@linux.vnet.ibm.com>

commit 7e56f627768da4e6480986b5145dc3422bc448a5 upstream.

In eeh_pe_loc_get(), the PE location code is retrieved from the
"ibm,loc-code" property of the device node for the bridge of the
PE's primary bus. It's not correct because the property indicates
the parent PE's location code.

This reads the correct PE location code from "ibm,io-base-loc-code"
or "ibm,slot-location-code" property of PE parent bus's device node.

Fixes: 357b2f3dd9b7 ("powerpc/eeh: Dump PE location code")
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/kernel/eeh_pe.c | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index 35f0b62..22f6d95 100644
--- a/arch/powerpc/kernel/eeh_pe.c
+++ b/arch/powerpc/kernel/eeh_pe.c
@@ -861,32 +861,29 @@ void eeh_pe_restore_bars(struct eeh_pe *pe)
 const char *eeh_pe_loc_get(struct eeh_pe *pe)
 {
 	struct pci_bus *bus = eeh_pe_bus_get(pe);
-	struct device_node *dn = pci_bus_to_OF_node(bus);
+	struct device_node *dn;
 	const char *loc = NULL;
 
-	if (!dn)
-		goto out;
+	while (bus) {
+		dn = pci_bus_to_OF_node(bus);
+		if (!dn) {
+			bus = bus->parent;
+			continue;
+		}
 
-	/* PHB PE or root PE ? */
-	if (pci_is_root_bus(bus)) {
-		loc = of_get_property(dn, "ibm,loc-code", NULL);
-		if (!loc)
+		if (pci_is_root_bus(bus))
 			loc = of_get_property(dn, "ibm,io-base-loc-code", NULL);
+		else
+			loc = of_get_property(dn, "ibm,slot-location-code",
+					      NULL);
+
 		if (loc)
-			goto out;
+			return loc;
 
-		/* Check the root port */
-		dn = dn->child;
-		if (!dn)
-			goto out;
+		bus = bus->parent;
 	}
 
-	loc = of_get_property(dn, "ibm,loc-code", NULL);
-	if (!loc)
-		loc = of_get_property(dn, "ibm,slot-location-code", NULL);
-
-out:
-	return loc ? loc : "N/A";
+	return "N/A";
 }
 
 /**
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 45/64] SCSI: fix crashes in sd and sr runtime PM
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (45 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 44/64] powerpc/eeh: Fix PE location code Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 46/64] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) Kamal Mostafa
                   ` (18 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Stern, James Bottomley, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit 13b4389143413a1f18127c07f72c74cad5b563e8 upstream.

Runtime suspend during driver probe and removal can cause problems.
The driver's runtime_suspend or runtime_resume callbacks may invoked
before the driver has finished binding to the device or after the
driver has unbound from the device.

This problem shows up with the sd and sr drivers, and can cause disk
or CD/DVD drives to become unusable as a result.  The fix is simple.
The drivers store a pointer to the scsi_disk or scsi_cd structure as
their private device data when probing is finished, so we simply have
to be sure to clear the private data during removal and test it during
runtime suspend/resume.

This fixes <https://bugs.debian.org/801925>.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Paul Menzel <paul.menzel@giantmonkey.de>
Reported-by: Erich Schubert <erich@debian.org>
Reported-by: Alexandre Rossi <alexandre.rossi@gmail.com>
Tested-by: Paul Menzel <paul.menzel@giantmonkey.de>
Tested-by: Erich Schubert <erich@debian.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/scsi/sd.c | 7 +++++--
 drivers/scsi/sr.c | 4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index a20da8c..441ae2b 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3142,8 +3142,8 @@ static int sd_suspend_common(struct device *dev, bool ignore_stop_errors)
 	struct scsi_disk *sdkp = dev_get_drvdata(dev);
 	int ret = 0;
 
-	if (!sdkp)
-		return 0;	/* this can happen */
+	if (!sdkp)	/* E.g.: runtime suspend following sd_remove() */
+		return 0;
 
 	if (sdkp->WCE && sdkp->media_present) {
 		sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n");
@@ -3182,6 +3182,9 @@ static int sd_resume(struct device *dev)
 {
 	struct scsi_disk *sdkp = dev_get_drvdata(dev);
 
+	if (!sdkp)	/* E.g.: runtime resume at the start of sd_probe() */
+		return 0;
+
 	if (!sdkp->device->manage_start_stop)
 		return 0;
 
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 8bd54a6..64c8674 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -144,6 +144,9 @@ static int sr_runtime_suspend(struct device *dev)
 {
 	struct scsi_cd *cd = dev_get_drvdata(dev);
 
+	if (!cd)	/* E.g.: runtime suspend following sr_remove() */
+		return 0;
+
 	if (cd->media_present)
 		return -EBUSY;
 	else
@@ -985,6 +988,7 @@ static int sr_remove(struct device *dev)
 	scsi_autopm_get_device(cd->device);
 
 	del_gendisk(cd->disk);
+	dev_set_drvdata(dev, NULL);
 
 	mutex_lock(&sr_ref_mutex);
 	kref_put(&cd->kref, sr_kref_release);
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 46/64] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (46 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 45/64] SCSI: fix crashes in sd and sr runtime PM Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 47/64] n_tty: Fix unsafe reference to "other" ldisc Kamal Mostafa
                   ` (17 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Peter Hurley <peter@hurleysoftware.com>

commit 5c17c861a357e9458001f021a7afa7aab9937439 upstream.

ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios via ioctl(TCSETS*) without actually
changing the line discipline via ioctl(TIOCSETD).

However, directly accessing the current ldisc via tty->ldisc is
unsafe; the ldisc ptr dereferenced may be stale if the line discipline
is changing via ioctl(TIOCSETD) or hangup.

Wait for the line discipline reference (just like read() or write())
to retrieve the "current" line discipline id.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/tty/tty_io.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 1aa0286..d5f54a1 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2662,6 +2662,28 @@ static int tiocsetd(struct tty_struct *tty, int __user *p)
 }
 
 /**
+ *	tiocgetd	-	get line discipline
+ *	@tty: tty device
+ *	@p: pointer to user data
+ *
+ *	Retrieves the line discipline id directly from the ldisc.
+ *
+ *	Locking: waits for ldisc reference (in case the line discipline
+ *		is changing or the tty is being hungup)
+ */
+
+static int tiocgetd(struct tty_struct *tty, int __user *p)
+{
+	struct tty_ldisc *ld;
+	int ret;
+
+	ld = tty_ldisc_ref_wait(tty);
+	ret = put_user(ld->ops->num, p);
+	tty_ldisc_deref(ld);
+	return ret;
+}
+
+/**
  *	send_break	-	performed time break
  *	@tty: device to break on
  *	@duration: timeout in mS
@@ -2887,7 +2909,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case TIOCGSID:
 		return tiocgsid(tty, real_tty, p);
 	case TIOCGETD:
-		return put_user(tty->ldisc->ops->num, (int __user *)p);
+		return tiocgetd(tty, p);
 	case TIOCSETD:
 		return tiocsetd(tty, p);
 	case TIOCVHANGUP:
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 47/64] n_tty: Fix unsafe reference to "other" ldisc
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (47 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 46/64] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 48/64] staging/speakup: Use tty_ldisc_ref() for paste kworker Kamal Mostafa
                   ` (16 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Peter Hurley <peter@hurleysoftware.com>

commit 6d27a63caad3f13e96cf065d2d96828c2006be6b upstream.

Although n_tty_check_unthrottle() has a valid ldisc reference (since
the tty core gets the ldisc ref in tty_read() before calling the line
discipline read() method), it does not have a valid ldisc reference to
the "other" pty of a pty pair. Since getting an ldisc reference for
tty->link essentially open-codes tty_wakeup(), just replace with the
equivalent tty_wakeup().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/tty/n_tty.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index c82adde..a0398a8 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -258,16 +258,13 @@ static void n_tty_check_throttle(struct tty_struct *tty)
 
 static void n_tty_check_unthrottle(struct tty_struct *tty)
 {
-	if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
-	    tty->link->ldisc->ops->write_wakeup == n_tty_write_wakeup) {
+	if (tty->driver->type == TTY_DRIVER_TYPE_PTY) {
 		if (chars_in_buffer(tty) > TTY_THRESHOLD_UNTHROTTLE)
 			return;
 		if (!tty->count)
 			return;
 		n_tty_kick_worker(tty);
-		n_tty_write_wakeup(tty->link);
-		if (waitqueue_active(&tty->link->write_wait))
-			wake_up_interruptible_poll(&tty->link->write_wait, POLLOUT);
+		tty_wakeup(tty->link);
 		return;
 	}
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 48/64] staging/speakup: Use tty_ldisc_ref() for paste kworker
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (48 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 47/64] n_tty: Fix unsafe reference to "other" ldisc Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 49/64] tick/nohz: Set the correct expiry when switching to nohz/lowres mode Kamal Mostafa
                   ` (15 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Peter Hurley, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Peter Hurley <peter@hurleysoftware.com>

commit f4f9edcf9b5289ed96113e79fa65a7bf27ecb096 upstream.

As the function documentation for tty_ldisc_ref_wait() notes, it is
only callable from a tty file_operations routine; otherwise there
is no guarantee the ref won't be NULL.

The key difference with the VT's paste_selection() is that is an ioctl,
where __speakup_paste_selection() is completely async kworker, kicked
off from interrupt context.

Fixes: 28a821c30688 ("Staging: speakup: Update __speakup_paste_selection()
       tty (ab)usage to match vt")
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/staging/speakup/selection.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
index a031570..ed68b2c 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -141,7 +141,9 @@ static void __speakup_paste_selection(struct work_struct *work)
 	struct tty_ldisc *ld;
 	DECLARE_WAITQUEUE(wait, current);
 
-	ld = tty_ldisc_ref_wait(tty);
+	ld = tty_ldisc_ref(tty);
+	if (!ld)
+		goto tty_unref;
 	tty_buffer_lock_exclusive(&vc->port);
 
 	add_wait_queue(&vc->paste_wait, &wait);
@@ -161,6 +163,7 @@ static void __speakup_paste_selection(struct work_struct *work)
 
 	tty_buffer_unlock_exclusive(&vc->port);
 	tty_ldisc_deref(ld);
+tty_unref:
 	tty_kref_put(tty);
 }
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 49/64] tick/nohz: Set the correct expiry when switching to nohz/lowres mode
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (49 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 48/64] staging/speakup: Use tty_ldisc_ref() for paste kworker Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 50/64] irqchip/atmel-aic: Fix wrong bit operation for IRQ priority Kamal Mostafa
                   ` (14 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Wanpeng Li, Peter Zijlstra, Frederic Weisbecker, Thomas Gleixner,
	Kamal Mostafa

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

---8<------------------------------------------------------------

From: Wanpeng Li <kernellwp@gmail.com>

commit 1ca8ec532fc2d986f1f4a319857bb18e0c9739b4 upstream.

commit 0ff53d096422 sets the next tick interrupt to the last jiffies update,
i.e. in the past, because the forward operation is invoked before the set
operation. There is no resulting damage (yet), but we get an extra pointless
tick interrupt.

Revert the order so we get the next tick interrupt in the future.

Fixes: commit 0ff53d096422 "tick: sched: Force tick interrupt and get rid of softirq magic"
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1453893967-3458-1-git-send-email-wanpeng.li@hotmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/time/tick-sched.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index c792429..3d31be1 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -988,9 +988,9 @@ static void tick_nohz_switch_to_nohz(void)
 	/* Get the next period */
 	next = tick_init_jiffy_update();
 
-	hrtimer_forward_now(&ts->sched_timer, tick_period);
 	hrtimer_set_expires(&ts->sched_timer, next);
-	tick_program_event(next, 1);
+	hrtimer_forward_now(&ts->sched_timer, tick_period);
+	tick_program_event(hrtimer_get_expires(&ts->sched_timer), 1);
 	tick_nohz_activate(ts, NOHZ_MODE_LOWRES);
 }
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 50/64] irqchip/atmel-aic: Fix wrong bit operation for IRQ priority
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (50 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 49/64] tick/nohz: Set the correct expiry when switching to nohz/lowres mode Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 51/64] seccomp: always propagate NO_NEW_PRIVS on tsync Kamal Mostafa
                   ` (13 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Milo Kim, Jason Cooper, Marc Zyngier, Ludovic Desroches,
	Nicholas Ferre, Thomas Gleixner, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Milo Kim <milo.kim@ti.com>

commit 49f34134aea74f19ca016f055d25ee55ec359dee upstream.

Atmel AIC has common structure for SMR (Source Mode Register).

  bit[6:5] Interrupt source type
  bit[2:0] Priority level
  Other bits are unused.

To update new priority value, bit[2:0] should be cleared first and then
new priority level can be written. However, aic_common_set_priority()
helper clears source type bits instead of priority bits.
This patch fixes wrong mask bit operation.

Fixes: b1479ebb7720 "irqchip: atmel-aic: Add atmel AIC/AIC5 drivers"
Signed-off-by: Milo Kim <milo.kim@ti.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: Nicholas Ferre <nicolas.ferre@atmel.com>
Link: http://lkml.kernel.org/r/1452669592-3401-2-git-send-email-milo.kim@ti.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/irqchip/irq-atmel-aic-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
index 63cd031..869d01d 100644
--- a/drivers/irqchip/irq-atmel-aic-common.c
+++ b/drivers/irqchip/irq-atmel-aic-common.c
@@ -86,7 +86,7 @@ int aic_common_set_priority(int priority, unsigned *val)
 	    priority > AT91_AIC_IRQ_MAX_PRIORITY)
 		return -EINVAL;
 
-	*val &= AT91_AIC_PRIOR;
+	*val &= ~AT91_AIC_PRIOR;
 	*val |= priority;
 
 	return 0;
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 51/64] seccomp: always propagate NO_NEW_PRIVS on tsync
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (51 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 50/64] irqchip/atmel-aic: Fix wrong bit operation for IRQ priority Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 52/64] drm/radeon: cleaned up VCO output settings for DP audio Kamal Mostafa
                   ` (12 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Jann Horn, Kees Cook, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Jann Horn <jann@thejh.net>

commit 103502a35cfce0710909da874f092cb44823ca03 upstream.

Before this patch, a process with some permissive seccomp filter
that was applied by root without NO_NEW_PRIVS was able to add
more filters to itself without setting NO_NEW_PRIVS by setting
the new filter from a throwaway thread with NO_NEW_PRIVS.

Signed-off-by: Jann Horn <jann@thejh.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 kernel/seccomp.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 245df6b..8609611 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -317,24 +317,24 @@ static inline void seccomp_sync_threads(void)
 		put_seccomp_filter(thread);
 		smp_store_release(&thread->seccomp.filter,
 				  caller->seccomp.filter);
+
+		/*
+		 * Don't let an unprivileged task work around
+		 * the no_new_privs restriction by creating
+		 * a thread that sets it up, enters seccomp,
+		 * then dies.
+		 */
+		if (task_no_new_privs(caller))
+			task_set_no_new_privs(thread);
+
 		/*
 		 * Opt the other thread into seccomp if needed.
 		 * As threads are considered to be trust-realm
 		 * equivalent (see ptrace_may_access), it is safe to
 		 * allow one thread to transition the other.
 		 */
-		if (thread->seccomp.mode == SECCOMP_MODE_DISABLED) {
-			/*
-			 * Don't let an unprivileged task work around
-			 * the no_new_privs restriction by creating
-			 * a thread that sets it up, enters seccomp,
-			 * then dies.
-			 */
-			if (task_no_new_privs(caller))
-				task_set_no_new_privs(thread);
-
+		if (thread->seccomp.mode == SECCOMP_MODE_DISABLED)
 			seccomp_assign_mode(thread, SECCOMP_MODE_FILTER);
-		}
 	}
 }
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 52/64] drm/radeon: cleaned up VCO output settings for DP audio
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (52 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 51/64] seccomp: always propagate NO_NEW_PRIVS on tsync Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 53/64] drm/radeon: Add a common function for DFS handling Kamal Mostafa
                   ` (11 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Slava Grigorev, Alex Deucher, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Slava Grigorev <slava.grigorev@amd.com>

commit c9a392eac18409f51a071520cf508c0b4ad990e2 upstream.

This is preparation for the fixes in the following patches.

Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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/dce6_afmt.c       |  2 +-
 drivers/gpu/drm/radeon/radeon.h          |  2 +-
 drivers/gpu/drm/radeon/radeon_atombios.c | 12 +++++++-----
 drivers/gpu/drm/radeon/radeon_audio.c    |  8 +-------
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c
index 883dce6..abd72ee 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -296,7 +296,7 @@ void dce6_dp_audio_set_dto(struct radeon_device *rdev,
 			div = 0;
 
 		if (div)
-			clock = rdev->clock.gpupll_outputfreq * 10 / div;
+			clock /= div;
 
 		WREG32(DCE8_DCCG_AUDIO_DTO1_PHASE, 24000);
 		WREG32(DCE8_DCCG_AUDIO_DTO1_MODULE, clock);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index f0b0b6f..f1daf86 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -268,7 +268,7 @@ struct radeon_clock {
 	uint32_t current_dispclk;
 	uint32_t dp_extclk;
 	uint32_t max_pixel_clock;
-	uint32_t gpupll_outputfreq;
+	uint32_t vco_freq;
 };
 
 /*
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 08fc1b5..9a9363a 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1257,12 +1257,14 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
 		rdev->mode_info.firmware_flags =
 			le16_to_cpu(firmware_info->info.usFirmwareCapability.susAccess);
 
-		if (ASIC_IS_DCE8(rdev)) {
-			rdev->clock.gpupll_outputfreq =
+		if (ASIC_IS_DCE8(rdev))
+			rdev->clock.vco_freq =
 				le32_to_cpu(firmware_info->info_22.ulGPUPLL_OutputFreq);
-			if (rdev->clock.gpupll_outputfreq == 0)
-				rdev->clock.gpupll_outputfreq = 360000;	/* 3.6 GHz */
-		}
+		else
+			rdev->clock.vco_freq = rdev->clock.current_dispclk;
+
+		if (rdev->clock.vco_freq == 0)
+			rdev->clock.vco_freq = 360000;	/* 3.6 GHz */
 
 		return true;
 	}
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c
index 2c02e99..85e1c23 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -739,9 +739,6 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
 	struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
 	struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
 	struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
-	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
-	struct radeon_connector_atom_dig *dig_connector =
-		radeon_connector->con_priv;
 
 	if (!dig || !dig->afmt)
 		return;
@@ -753,10 +750,7 @@ static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
 		radeon_audio_write_speaker_allocation(encoder);
 		radeon_audio_write_sad_regs(encoder);
 		radeon_audio_write_latency_fields(encoder, mode);
-		if (rdev->clock.dp_extclk || ASIC_IS_DCE5(rdev))
-			radeon_audio_set_dto(encoder, rdev->clock.default_dispclk * 10);
-		else
-			radeon_audio_set_dto(encoder, dig_connector->dp_clock);
+		radeon_audio_set_dto(encoder, rdev->clock.vco_freq * 10);
 		radeon_audio_set_audio_packet(encoder);
 		radeon_audio_select_pin(encoder);
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 53/64] drm/radeon: Add a common function for DFS handling
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (53 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 52/64] drm/radeon: cleaned up VCO output settings for DP audio Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 54/64] drm/radeon: fix DP audio support for APU with DCE4.1 display engine Kamal Mostafa
                   ` (10 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Slava Grigorev, Alex Deucher, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Slava Grigorev <slava.grigorev@amd.com>

commit a64c9dab1c4d05c87ec8a1cb9b48915816462143 upstream.

Move encoding of DFS (digital frequency synthesizer) divider into a
separate function and improve calculation precision.

Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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/dce6_afmt.c    | 12 ++----------
 drivers/gpu/drm/radeon/radeon_audio.c | 12 ++++++++++++
 drivers/gpu/drm/radeon/radeon_audio.h |  1 +
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c
index abd72ee..848b1ff 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -285,18 +285,10 @@ void dce6_dp_audio_set_dto(struct radeon_device *rdev,
 		unsigned int div = (RREG32(DENTIST_DISPCLK_CNTL) &
 			DENTIST_DPREFCLK_WDIVIDER_MASK) >>
 			DENTIST_DPREFCLK_WDIVIDER_SHIFT;
-
-		if (div < 128 && div >= 96)
-			div -= 64;
-		else if (div >= 64)
-			div = div / 2 - 16;
-		else if (div >= 8)
-			div /= 4;
-		else
-			div = 0;
+		div = radeon_audio_decode_dfs_div(div);
 
 		if (div)
-			clock /= div;
+			clock = clock * 100 / div;
 
 		WREG32(DCE8_DCCG_AUDIO_DTO1_PHASE, 24000);
 		WREG32(DCE8_DCCG_AUDIO_DTO1_MODULE, clock);
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c
index 85e1c23..b214663 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -775,3 +775,15 @@ void radeon_audio_dpms(struct drm_encoder *encoder, int mode)
 	if (radeon_encoder->audio && radeon_encoder->audio->dpms)
 		radeon_encoder->audio->dpms(encoder, mode == DRM_MODE_DPMS_ON);
 }
+
+unsigned int radeon_audio_decode_dfs_div(unsigned int div)
+{
+	if (div >= 8 && div < 64)
+		return (div - 8) * 25 + 200;
+	else if (div >= 64 && div < 96)
+		return (div - 64) * 50 + 1600;
+	else if (div >= 96 && div < 128)
+		return (div - 96) * 100 + 3200;
+	else
+		return 0;
+}
diff --git a/drivers/gpu/drm/radeon/radeon_audio.h b/drivers/gpu/drm/radeon/radeon_audio.h
index 059cc30..5c70cce 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.h
+++ b/drivers/gpu/drm/radeon/radeon_audio.h
@@ -79,5 +79,6 @@ void radeon_audio_fini(struct radeon_device *rdev);
 void radeon_audio_mode_set(struct drm_encoder *encoder,
 	struct drm_display_mode *mode);
 void radeon_audio_dpms(struct drm_encoder *encoder, int mode);
+unsigned int radeon_audio_decode_dfs_div(unsigned int div);
 
 #endif
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 54/64] drm/radeon: fix DP audio support for APU with DCE4.1 display engine
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (54 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 53/64] drm/radeon: Add a common function for DFS handling Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 55/64] cpufreq: Fix NULL reference crash while accessing policy->governor_data Kamal Mostafa
                   ` (9 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Slava Grigorev, Alex Deucher, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Slava Grigorev <slava.grigorev@amd.com>

commit fe6fc1f132b4300c1f6defd43a5d673eb60a820d upstream.

Properly setup the DFS divider for DP audio for DCE4.1.

Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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/evergreen_hdmi.c  | 10 +++++++++
 drivers/gpu/drm/radeon/evergreend.h      |  5 +++++
 drivers/gpu/drm/radeon/radeon_atombios.c | 37 +++++++++++++++++++++++++-------
 3 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c
index 9953356..3cf04a2 100644
--- a/drivers/gpu/drm/radeon/evergreen_hdmi.c
+++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c
@@ -289,6 +289,16 @@ void dce4_dp_audio_set_dto(struct radeon_device *rdev,
 	 * number (coefficient of two integer numbers.  DCCG_AUDIO_DTOx_PHASE
 	 * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
 	 */
+	if (ASIC_IS_DCE41(rdev)) {
+		unsigned int div = (RREG32(DCE41_DENTIST_DISPCLK_CNTL) &
+			DENTIST_DPREFCLK_WDIVIDER_MASK) >>
+			DENTIST_DPREFCLK_WDIVIDER_SHIFT;
+		div = radeon_audio_decode_dfs_div(div);
+
+		if (div)
+			clock = 100 * clock / div;
+	}
+
 	WREG32(DCCG_AUDIO_DTO1_PHASE, 24000);
 	WREG32(DCCG_AUDIO_DTO1_MODULE, clock);
 }
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h
index 4aa5f75..13b6029 100644
--- a/drivers/gpu/drm/radeon/evergreend.h
+++ b/drivers/gpu/drm/radeon/evergreend.h
@@ -511,6 +511,11 @@
 #define DCCG_AUDIO_DTO1_CNTL              0x05cc
 #       define DCCG_AUDIO_DTO1_USE_512FBR_DTO (1 << 3)
 
+#define DCE41_DENTIST_DISPCLK_CNTL			0x049c
+#       define DENTIST_DPREFCLK_WDIVIDER(x)		(((x) & 0x7f) << 24)
+#       define DENTIST_DPREFCLK_WDIVIDER_MASK		(0x7f << 24)
+#       define DENTIST_DPREFCLK_WDIVIDER_SHIFT		24
+
 /* DCE 4.0 AFMT */
 #define HDMI_CONTROL                         0x7030
 #       define HDMI_KEEPOUT_MODE             (1 << 0)
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 9a9363a..de9a2ff 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -1106,6 +1106,31 @@ union firmware_info {
 	ATOM_FIRMWARE_INFO_V2_2 info_22;
 };
 
+union igp_info {
+	struct _ATOM_INTEGRATED_SYSTEM_INFO info;
+	struct _ATOM_INTEGRATED_SYSTEM_INFO_V2 info_2;
+	struct _ATOM_INTEGRATED_SYSTEM_INFO_V6 info_6;
+	struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_7 info_7;
+	struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_8 info_8;
+};
+
+static void radeon_atombios_get_dentist_vco_freq(struct radeon_device *rdev)
+{
+	struct radeon_mode_info *mode_info = &rdev->mode_info;
+	int index = GetIndexIntoMasterTable(DATA, IntegratedSystemInfo);
+	union igp_info *igp_info;
+	u8 frev, crev;
+	u16 data_offset;
+
+	if (atom_parse_data_header(mode_info->atom_context, index, NULL,
+			&frev, &crev, &data_offset)) {
+		igp_info = (union igp_info *)(mode_info->atom_context->bios +
+			data_offset);
+		rdev->clock.vco_freq =
+			le32_to_cpu(igp_info->info_6.ulDentistVCOFreq);
+	}
+}
+
 bool radeon_atom_get_clock_info(struct drm_device *dev)
 {
 	struct radeon_device *rdev = dev->dev_private;
@@ -1260,6 +1285,10 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
 		if (ASIC_IS_DCE8(rdev))
 			rdev->clock.vco_freq =
 				le32_to_cpu(firmware_info->info_22.ulGPUPLL_OutputFreq);
+		else if (ASIC_IS_DCE5(rdev))
+			rdev->clock.vco_freq = rdev->clock.current_dispclk;
+		else if (ASIC_IS_DCE41(rdev))
+			radeon_atombios_get_dentist_vco_freq(rdev);
 		else
 			rdev->clock.vco_freq = rdev->clock.current_dispclk;
 
@@ -1272,14 +1301,6 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
 	return false;
 }
 
-union igp_info {
-	struct _ATOM_INTEGRATED_SYSTEM_INFO info;
-	struct _ATOM_INTEGRATED_SYSTEM_INFO_V2 info_2;
-	struct _ATOM_INTEGRATED_SYSTEM_INFO_V6 info_6;
-	struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_7 info_7;
-	struct _ATOM_INTEGRATED_SYSTEM_INFO_V1_8 info_8;
-};
-
 bool radeon_atombios_sideport_present(struct radeon_device *rdev)
 {
 	struct radeon_mode_info *mode_info = &rdev->mode_info;
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 55/64] cpufreq: Fix NULL reference crash while accessing policy->governor_data
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (55 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 54/64] drm/radeon: fix DP audio support for APU with DCE4.1 display engine Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 56/64] cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype Kamal Mostafa
                   ` (8 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Viresh Kumar, Rafael J. Wysocki, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Viresh Kumar <viresh.kumar@linaro.org>

commit e4b133cc4b30b48d488e4e4fffb132f173ce4358 upstream.

There is a race discovered by Juri, where we are able to:
- create and read a sysfs file before policy->governor_data is being set
  to a non NULL value.
  OR
- set policy->governor_data to NULL, and reading a file before being
  destroyed.

And so such a crash is reported:

Unable to handle kernel NULL pointer dereference at virtual address 0000000c
pgd = edfc8000
[0000000c] *pgd=bfc8c835
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in:
CPU: 4 PID: 1730 Comm: cat Not tainted 4.5.0-rc1+ #463
Hardware name: ARM-Versatile Express
task: ee8e8480 ti: ee930000 task.ti: ee930000
PC is at show_ignore_nice_load_gov_pol+0x24/0x34
LR is at show+0x4c/0x60
pc : [<c058f1bc>]    lr : [<c058ae88>]    psr: a0070013
sp : ee931dd0  ip : ee931de0  fp : ee931ddc
r10: ee4bc290  r9 : 00001000  r8 : ef2cb000
r7 : ee4bc200  r6 : ef2cb000  r5 : c0af57b0  r4 : ee4bc2e0
r3 : 00000000  r2 : 00000000  r1 : c0928df4  r0 : ef2cb000
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c5387d  Table: adfc806a  DAC: 00000051
Process cat (pid: 1730, stack limit = 0xee930210)
Stack: (0xee931dd0 to 0xee932000)
1dc0:                                     ee931dfc ee931de0 c058ae88 c058f1a4
1de0: edce3bc0 c07bfca4 edce3ac0 00001000 ee931e24 ee931e00 c01fcb90 c058ae48
1e00: 00000001 edce3bc0 00000000 00000001 ee931e50 ee8ff480 ee931e34 ee931e28
1e20: c01fb33c c01fcb0c ee931e8c ee931e38 c01a5210 c01fb314 ee931e9c ee931e48
1e40: 00000000 edce3bf0 befe4a00 ee931f78 00000000 00000000 000001e4 00000000
1e60: c00545a8 edce3ac0 00001000 00001000 befe4a00 ee931f78 00000000 00001000
1e80: ee931ed4 ee931e90 c01fbed8 c01a5038 ed085a58 00020000 00000000 00000000
1ea0: c0ad72e4 ee931f78 ee8ff488 ee8ff480 c077f3fc 00001000 befe4a00 ee931f78
1ec0: 00000000 00001000 ee931f44 ee931ed8 c017c328 c01fbdc4 00001000 00000000
1ee0: ee8ff480 00001000 ee931f44 ee931ef8 c017c65c c03deb10 ee931fac ee931f08
1f00: c0009270 c001f290 c0a8d968 ef2cb000 ef2cb000 ee8ff480 00000020 ee8ff480
1f20: ee8ff480 befe4a00 00001000 ee931f78 00000000 00000000 ee931f74 ee931f48
1f40: c017d1ec c017c2f8 c019c724 c019c684 ee8ff480 ee8ff480 00001000 befe4a00
1f60: 00000000 00000000 ee931fa4 ee931f78 c017d2a8 c017d160 00000000 00000000
1f80: 000a9f20 00001000 befe4a00 00000003 c000ffe4 ee930000 00000000 ee931fa8
1fa0: c000fe40 c017d264 000a9f20 00001000 00000003 befe4a00 00001000 00000000
Unable to handle kernel NULL pointer dereference at virtual address 0000000c
1fc0: 000a9f20 00001000 befe4a00 00000003 00000000 00000000 00000003 00000001
pgd = edfc4000
[0000000c] *pgd=bfcac835
1fe0: 00000000 befe49dc 000197f8 b6e35dfc 60070010 00000003 3065b49d 134ac2c9

[<c058f1bc>] (show_ignore_nice_load_gov_pol) from [<c058ae88>] (show+0x4c/0x60)
[<c058ae88>] (show) from [<c01fcb90>] (sysfs_kf_seq_show+0x90/0xfc)
[<c01fcb90>] (sysfs_kf_seq_show) from [<c01fb33c>] (kernfs_seq_show+0x34/0x38)
[<c01fb33c>] (kernfs_seq_show) from [<c01a5210>] (seq_read+0x1e4/0x4e4)
[<c01a5210>] (seq_read) from [<c01fbed8>] (kernfs_fop_read+0x120/0x1a0)
[<c01fbed8>] (kernfs_fop_read) from [<c017c328>] (__vfs_read+0x3c/0xe0)
[<c017c328>] (__vfs_read) from [<c017d1ec>] (vfs_read+0x98/0x104)
[<c017d1ec>] (vfs_read) from [<c017d2a8>] (SyS_read+0x50/0x90)
[<c017d2a8>] (SyS_read) from [<c000fe40>] (ret_fast_syscall+0x0/0x1c)
Code: e5903044 e1a00001 e3081df4 e34c1092 (e593300c)
---[ end trace 5994b9a5111f35ee ]---

Fix that by making sure, policy->governor_data is updated at the right
places only.

Reported-and-tested-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/cpufreq/cpufreq_governor.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 57a39f8..f7f3b59b 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -284,16 +284,18 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy,
 		cdata->gdbs_data = dbs_data;
 	}
 
+	policy->governor_data = dbs_data;
+
 	ret = sysfs_create_group(get_governor_parent_kobj(policy),
 				 get_sysfs_attr(dbs_data));
 	if (ret)
 		goto put_kobj;
 
-	policy->governor_data = dbs_data;
-
 	return 0;
 
 put_kobj:
+	policy->governor_data = NULL;
+
 	if (!have_governor_per_policy()) {
 		cdata->gdbs_data = NULL;
 		cpufreq_put_global_kobject();
@@ -310,11 +312,12 @@ static void cpufreq_governor_exit(struct cpufreq_policy *policy,
 {
 	struct common_dbs_data *cdata = dbs_data->cdata;
 
-	policy->governor_data = NULL;
 	if (!--dbs_data->usage_count) {
 		sysfs_remove_group(get_governor_parent_kobj(policy),
 				   get_sysfs_attr(dbs_data));
 
+		policy->governor_data = NULL;
+
 		if (!have_governor_per_policy()) {
 			cdata->gdbs_data = NULL;
 			cpufreq_put_global_kobject();
@@ -322,6 +325,8 @@ static void cpufreq_governor_exit(struct cpufreq_policy *policy,
 
 		cdata->exit(dbs_data, policy->governor->initialized == 1);
 		kfree(dbs_data);
+	} else {
+		policy->governor_data = NULL;
 	}
 }
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 56/64] cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (56 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 55/64] cpufreq: Fix NULL reference crash while accessing policy->governor_data Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 57/64] ALSA: dummy: Disable switching timer backend via sysfs Kamal Mostafa
                   ` (7 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Arnd Bergmann, Rafael J. Wysocki, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Arnd Bergmann <arnd@arndb.de>

commit fb2a24a1c6457d21df9fae0dd66b20c63ba56077 upstream.

There are two definitions of pxa_cpufreq_change_voltage, with slightly
different prototypes after one of them had its argument marked 'const'.
Now the other one (for !CONFIG_REGULATOR) produces a harmless warning:

drivers/cpufreq/pxa2xx-cpufreq.c: In function 'pxa_set_target':
drivers/cpufreq/pxa2xx-cpufreq.c:291:36: warning: passing argument 1 of 'pxa_cpufreq_change_voltage' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   ret = pxa_cpufreq_change_voltage(&pxa_freq_settings[idx]);
                                    ^
drivers/cpufreq/pxa2xx-cpufreq.c:205:12: note: expected 'struct pxa_freqs *' but argument is of type 'const struct pxa_freqs *'
 static int pxa_cpufreq_change_voltage(struct pxa_freqs *pxa_freq)
            ^

This changes the prototype in the same way as the other, which
avoids the warning.

Fixes: 03c229906311 (cpufreq: pxa: make pxa_freqs arrays const)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/cpufreq/pxa2xx-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c
index 1d99c97..0963772 100644
--- a/drivers/cpufreq/pxa2xx-cpufreq.c
+++ b/drivers/cpufreq/pxa2xx-cpufreq.c
@@ -202,7 +202,7 @@ static void __init pxa_cpufreq_init_voltages(void)
 	}
 }
 #else
-static int pxa_cpufreq_change_voltage(struct pxa_freqs *pxa_freq)
+static int pxa_cpufreq_change_voltage(const struct pxa_freqs *pxa_freq)
 {
 	return 0;
 }
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 57/64] ALSA: dummy: Disable switching timer backend via sysfs
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (57 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 56/64] cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 58/64] drm/vmwgfx: respect 'nomodeset' Kamal Mostafa
                   ` (6 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Takashi Iwai <tiwai@suse.de>

commit 7ee96216c31aabe1eb42fb91ff50dae9fcd014b2 upstream.

ALSA dummy driver can switch the timer backend between system timer
and hrtimer via its hrtimer module option.  This can be also switched
dynamically via sysfs, but it may lead to a memory corruption when
switching is done while a PCM stream is running; the stream instance
for the newly switched timer method tries to access the memory that
was allocated by another timer method although the sizes differ.

As the simplest fix, this patch just disables the switch via sysfs by
dropping the writable bit.

BugLink: http://lkml.kernel.org/r/CACT4Y+ZGEeEBntHW5WHn2GoeE0G_kRrCmUh6=dWyy-wfzvuJLg@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 sound/drivers/dummy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 016e451..df8e757 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -87,7 +87,7 @@ MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-128) for dummy driver.");
 module_param(fake_buffer, bool, 0444);
 MODULE_PARM_DESC(fake_buffer, "Fake buffer allocations.");
 #ifdef CONFIG_HIGH_RES_TIMERS
-module_param(hrtimer, bool, 0644);
+module_param(hrtimer, bool, 0444);
 MODULE_PARM_DESC(hrtimer, "Use hrtimer as the timer source.");
 #endif
 
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 58/64] drm/vmwgfx: respect 'nomodeset'
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (58 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 57/64] ALSA: dummy: Disable switching timer backend via sysfs Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 59/64] Staging: speakup: Fix getting port information Kamal Mostafa
                   ` (5 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Rob Clark, Dave Airlie, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Rob Clark <robdclark@gmail.com>

commit 96c5d076f0a5e2023ecdb44d8261f87641ee71e0 upstream.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 15a8d77..2aa0e92 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -25,6 +25,7 @@
  *
  **************************************************************************/
 #include <linux/module.h>
+#include <linux/console.h>
 
 #include <drm/drmP.h>
 #include "vmwgfx_drv.h"
@@ -1447,6 +1448,12 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 static int __init vmwgfx_init(void)
 {
 	int ret;
+
+#ifdef CONFIG_VGA_CONSOLE
+	if (vgacon_text_force())
+		return -EINVAL;
+#endif
+
 	ret = drm_pci_init(&driver, &vmw_pci_driver);
 	if (ret)
 		DRM_ERROR("Failed initializing DRM.\n");
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 59/64] Staging: speakup: Fix getting port information
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (59 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 58/64] drm/vmwgfx: respect 'nomodeset' Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 60/64] x86/mm/pat: Avoid truncation when converting cpa->numpages to address Kamal Mostafa
                   ` (4 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Samuel Thibault, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Samuel Thibault <samuel.thibault@ens-lyon.org>

commit 327b882d3bcc1fba82dbd39b5cf5a838c81218e2 upstream.

Commit f79b0d9c223c ("staging: speakup: Fixed warning <linux/serial.h>
instead of <asm/serial.h>") broke the port information in the speakup
driver: SERIAL_PORT_DFNS only gets defined if asm/serial.h is included,
and no other header includes asm/serial.h.

We here make sure serialio.c does get the arch-specific definition of
SERIAL_PORT_DFNS from asm/serial.h, if any.

Along the way, this makes sure that we do have information for the
requested serial port number (index)

Fixes: f79b0d9c223c ("staging: speakup: Fixed warning <linux/serial.h> instead of <asm/serial.h>")
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/staging/speakup/serialio.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c
index 1d9d51b..f41a7da 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -6,6 +6,11 @@
 #include "spk_priv.h"
 #include "serialio.h"
 
+#include <linux/serial_core.h>
+/* WARNING:  Do not change this to <linux/serial.h> without testing that
+ * SERIAL_PORT_DFNS does get defined to the appropriate value. */
+#include <asm/serial.h>
+
 #ifndef SERIAL_PORT_DFNS
 #define SERIAL_PORT_DFNS
 #endif
@@ -23,9 +28,15 @@ const struct old_serial_port *spk_serial_init(int index)
 	int baud = 9600, quot = 0;
 	unsigned int cval = 0;
 	int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8;
-	const struct old_serial_port *ser = rs_table + index;
+	const struct old_serial_port *ser;
 	int err;
 
+	if (index >= ARRAY_SIZE(rs_table)) {
+		pr_info("no port info for ttyS%d\n", index);
+		return NULL;
+	}
+	ser = rs_table + index;
+
 	/*	Divisor, bytesize and parity */
 	quot = ser->baud_base / baud;
 	cval = cflag & (CSIZE | CSTOPB);
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 60/64] x86/mm/pat: Avoid truncation when converting cpa->numpages to address
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (60 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 59/64] Staging: speakup: Fix getting port information Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 61/64] serial: 8250_pci: Add Intel Broadwell ports Kamal Mostafa
                   ` (3 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sai Praneeth Prakhya, Matt Fleming, Thomas Gleixner, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Matt Fleming <matt@codeblueprint.co.uk>

commit 742563777e8da62197d6cb4b99f4027f59454735 upstream.

There are a couple of nasty truncation bugs lurking in the pageattr
code that can be triggered when mapping EFI regions, e.g. when we pass
a cpa->pgd pointer. Because cpa->numpages is a 32-bit value, shifting
left by PAGE_SHIFT will truncate the resultant address to 32-bits.

Viorel-Cătălin managed to trigger this bug on his Dell machine that
provides a ~5GB EFI region which requires 1236992 pages to be mapped.
When calling populate_pud() the end of the region gets calculated
incorrectly in the following buggy expression,

  end = start + (cpa->numpages << PAGE_SHIFT);

And only 188416 pages are mapped. Next, populate_pud() gets invoked
for a second time because of the loop in __change_page_attr_set_clr(),
only this time no pages get mapped because shifting the remaining
number of pages (1048576) by PAGE_SHIFT is zero. At which point the
loop in __change_page_attr_set_clr() spins forever because we fail to
map progress.

Hitting this bug depends very much on the virtual address we pick to
map the large region at and how many pages we map on the initial run
through the loop. This explains why this issue was only recently hit
with the introduction of commit

  a5caa209ba9c ("x86/efi: Fix boot crash by mapping EFI memmap
   entries bottom-up at runtime, instead of top-down")

It's interesting to note that safe uses of cpa->numpages do exist in
the pageattr code. If instead of shifting ->numpages we multiply by
PAGE_SIZE, no truncation occurs because PAGE_SIZE is a UL value, and
so the result is unsigned long.

To avoid surprises when users try to convert very large cpa->numpages
values to addresses, change the data type from 'int' to 'unsigned
long', thereby making it suitable for shifting by PAGE_SHIFT without
any type casting.

The alternative would be to make liberal use of casting, but that is
far more likely to cause problems in the future when someone adds more
code and fails to cast properly; this bug was difficult enough to
track down in the first place.

Reported-and-tested-by: Viorel-Cătălin Răpițeanu <rapiteanu.catalin@gmail.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=110131
Link: http://lkml.kernel.org/r/1454067370-10374-1-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/x86/mm/pageattr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 727158c..4ffbfdb 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -34,7 +34,7 @@ struct cpa_data {
 	pgd_t		*pgd;
 	pgprot_t	mask_set;
 	pgprot_t	mask_clr;
-	int		numpages;
+	unsigned long	numpages;
 	int		flags;
 	unsigned long	pfn;
 	unsigned	force_split : 1;
@@ -1322,7 +1322,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
 		 * CPA operation. Either a large page has been
 		 * preserved or a single page update happened.
 		 */
-		BUG_ON(cpa->numpages > numpages);
+		BUG_ON(cpa->numpages > numpages || !cpa->numpages);
 		numpages -= cpa->numpages;
 		if (cpa->flags & (CPA_PAGES_ARRAY | CPA_ARRAY))
 			cpa->curpage++;
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 61/64] serial: 8250_pci: Add Intel Broadwell ports
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (61 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 60/64] x86/mm/pat: Avoid truncation when converting cpa->numpages to address Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 62/64] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed Kamal Mostafa
                   ` (2 subsequent siblings)
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Leif Liddy, Mika Westerberg, Greg Kroah-Hartman, Kamal Mostafa

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

---8<------------------------------------------------------------

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

commit 6c55d9b98335f7f6bd5f061866ff1633401f3a44 upstream.

Some recent (early 2015) macbooks have Intel Broadwell where LPSS UARTs are
PCI enumerated instead of ACPI. The LPSS UART block is pretty much same as
used on Intel Baytrail so we can reuse the existing Baytrail setup code.

Add both Broadwell LPSS UART ports to the list of supported devices.

Signed-off-by: Leif Liddy <leif.liddy@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 drivers/tty/serial/8250/8250_pci.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 46ddce4..f85839e 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1380,6 +1380,9 @@ ce4100_serial_setup(struct serial_private *priv,
 #define PCI_DEVICE_ID_INTEL_BSW_UART1	0x228a
 #define PCI_DEVICE_ID_INTEL_BSW_UART2	0x228c
 
+#define PCI_DEVICE_ID_INTEL_BDW_UART1	0x9ce3
+#define PCI_DEVICE_ID_INTEL_BDW_UART2	0x9ce4
+
 #define BYT_PRV_CLK			0x800
 #define BYT_PRV_CLK_EN			(1 << 0)
 #define BYT_PRV_CLK_M_VAL_SHIFT		1
@@ -1458,11 +1461,13 @@ byt_serial_setup(struct serial_private *priv,
 	switch (pdev->device) {
 	case PCI_DEVICE_ID_INTEL_BYT_UART1:
 	case PCI_DEVICE_ID_INTEL_BSW_UART1:
+	case PCI_DEVICE_ID_INTEL_BDW_UART1:
 		rx_param->src_id = 3;
 		tx_param->dst_id = 2;
 		break;
 	case PCI_DEVICE_ID_INTEL_BYT_UART2:
 	case PCI_DEVICE_ID_INTEL_BSW_UART2:
+	case PCI_DEVICE_ID_INTEL_BDW_UART2:
 		rx_param->src_id = 5;
 		tx_param->dst_id = 4;
 		break;
@@ -2170,6 +2175,20 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
 		.subdevice	= PCI_ANY_ID,
 		.setup		= byt_serial_setup,
 	},
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BDW_UART1,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= byt_serial_setup,
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BDW_UART2,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.setup		= byt_serial_setup,
+	},
 	/*
 	 * ITE
 	 */
@@ -5619,6 +5638,16 @@ static struct pci_device_id serial_pci_tbl[] = {
 		PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
 		pbn_byt },
 
+	/* Intel Broadwell */
+	{	PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BDW_UART1,
+		PCI_ANY_ID,  PCI_ANY_ID,
+		PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
+		pbn_byt },
+	{	PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BDW_UART2,
+		PCI_ANY_ID,  PCI_ANY_ID,
+		PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
+		pbn_byt },
+
 	/*
 	 * Intel Penwell
 	 */
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 62/64] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (62 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 61/64] serial: 8250_pci: Add Intel Broadwell ports Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 63/64] perf hists: Fix HISTC_MEM_DCACHELINE width setting Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 64/64] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8 Kamal Mostafa
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Markus Trippelsdorf, Ben Hutchings, Matt Fleming, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Markus Trippelsdorf <markus@trippelsdorf.de>

commit d4913cbd05bab685e49c8174896e563b2487d054 upstream.

The issue was pointed out by gcc-6's -Wmisleading-indentation.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: c97cf42219b7 ("perf top: Live TUI Annotation")
Link: http://lkml.kernel.org/r/20151214154403.GB1409@x4
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 tools/perf/ui/browsers/annotate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index ebca255..197c484 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -730,11 +730,11 @@ static int annotate_browser__run(struct annotate_browser *browser,
 				nd = browser->curr_hot;
 			break;
 		case K_UNTAB:
-			if (nd != NULL)
+			if (nd != NULL) {
 				nd = rb_next(nd);
 				if (nd == NULL)
 					nd = rb_first(&browser->entries);
-			else
+			} else
 				nd = browser->curr_hot;
 			break;
 		case K_F1:
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 63/64] perf hists: Fix HISTC_MEM_DCACHELINE width setting
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (63 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 62/64] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 64/64] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8 Kamal Mostafa
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Jiri Olsa, David Ahern, Don Zickus, Namhyung Kim, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Jiri Olsa <jolsa@kernel.org>

commit 0805909f59e02036a4e2660159f27dbf8b6084ac upstream.

Set correct width for unresolved mem_dcacheline addr.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 9b32ba71ba90 ("perf tools: Add dcacheline sort")
Link: http://lkml.kernel.org/r/1453290995-18485-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 tools/perf/util/hist.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index f298c69..e05ca0d 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -129,6 +129,8 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
 			symlen = unresolved_col_width + 4 + 2;
 			hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL,
 					   symlen);
+			hists__new_col_len(hists, HISTC_MEM_DCACHELINE,
+					   symlen);
 		}
 		if (h->mem_info->daddr.map) {
 			symlen = dso__name_len(h->mem_info->daddr.map->dso);
-- 
1.9.1

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

* [PATCH 4.2.y-ckt 64/64] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8
  2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
                   ` (64 preceding siblings ...)
  2016-02-04 22:44 ` [PATCH 4.2.y-ckt 63/64] perf hists: Fix HISTC_MEM_DCACHELINE width setting Kamal Mostafa
@ 2016-02-04 22:44 ` Kamal Mostafa
  65 siblings, 0 replies; 71+ messages in thread
From: Kamal Mostafa @ 2016-02-04 22:44 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Madhavan Srinivasan, Michael Ellerman, Kamal Mostafa

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

---8<------------------------------------------------------------

From: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>

commit 370f06c88528b3988fe24a372c10e1303bb94cf6 upstream.

Commit 7a7868326d77 ("powerpc/perf: Add an explict flag indicating
presence of SLOT field") introduced the PPMU_HAS_SSLOT flag to remove
the assumption that MMCRA[SLOT] was present when PPMU_ALT_SIPR was not
set.

That commit's changelog also mentions that Power8 does not support
MMCRA[SLOT]. However when the Power8 PMU support was merged, it
errnoeously included the PPMU_HAS_SSLOT flag.

So remove PPMU_HAS_SSLOT from the Power8 flags.

mpe: On systems where MMCRA[SLOT] exists, the field occupies bits 37:39
(IBM numbering). On Power8 bit 37 is reserved, and 38:39 overlap with
the high bits of the Threshold Event Counter Mantissa. I am not aware of
any published events which use the threshold counting mechanism, which
would cause the mantissa bits to be set. So in practice this bug is
unlikely to trigger.

Fixes: e05b9b9e5c10 ("powerpc/perf: Power8 PMU support")
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 arch/powerpc/perf/power8-pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index 396351d..f2aad60 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -813,7 +813,7 @@ static struct power_pmu power8_pmu = {
 	.get_constraint		= power8_get_constraint,
 	.get_alternatives	= power8_get_alternatives,
 	.disable_pmc		= power8_disable_pmc,
-	.flags			= PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_ARCH_207S,
+	.flags			= PPMU_HAS_SIER | PPMU_ARCH_207S,
 	.n_generic		= ARRAY_SIZE(power8_generic_events),
 	.generic_events		= power8_generic_events,
 	.cache_events		= &power8_cache_events,
-- 
1.9.1

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

end of thread, other threads:[~2016-02-04 23:12 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-04 22:43 [4.2.y-ckt stable] Linux 4.2.8-ckt4 stable review Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 01/64] [4.2-stable only] Revert "arm64: mm: use correct mapping granularity under DEBUG_RODATA" Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 02/64] mm: add dma_pool_zalloc() call to DMA API Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 03/64] sctp: Prevent soft lockup when sctp_accept() is called during a timeout event Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 04/64] xen-netback: respect user provided max_queues Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 05/64] xen-netfront: " Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 06/64] xen-netfront: update num_queues to real created Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 07/64] iio: adis_buffer: Fix out-of-bounds memory access Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 08/64] KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8 Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 09/64] KVM: PPC: Fix ONE_REG AltiVec support Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 10/64] x86/irq: Call chip->irq_set_affinity in proper context Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 11/64] drm/amdgpu: fix tonga smu resume Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 12/64] perf kvm record/report: 'unprocessable sample' error while recording/reporting guest data Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 13/64] hrtimer: Handle remaining time proper for TIME_LOW_RES Kamal Mostafa
2016-02-04 22:43   ` Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 14/64] timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper Kamal Mostafa
2016-02-04 22:43 ` Kamal Mostafa
2016-02-04 22:43   ` Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 15/64] posix-timers: " Kamal Mostafa
2016-02-04 22:43 ` Kamal Mostafa
2016-02-04 22:43   ` Kamal Mostafa
2016-02-04 22:43 ` [PATCH 4.2.y-ckt 16/64] itimers: " Kamal Mostafa
2016-02-04 22:43   ` Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 17/64] drm/amdgpu: Use drm_calloc_large for VM page_tables array Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 18/64] powerpc: Simplify module TOC handling Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 19/64] drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2 Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 20/64] drm/radeon: properly byte swap vce firmware setup Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 21/64] ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist" Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 22/64] ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot() Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 23/64] hwmon: (dell-smm) Blacklist Dell Studio XPS 8000 Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 24/64] usb: cdc-acm: handle unlinked urb in acm read callback Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 25/64] usb: cdc-acm: send zero packet for intel 7260 modem Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 26/64] cdc-acm:exclude Samsung phone 04e8:685d Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 27/64] usb: hub: do not clear BOS field during reset device Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 28/64] USB: cp210x: add ID for IAI USB to RS485 adaptor Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 29/64] USB: visor: fix null-deref at probe Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 30/64] USB: serial: visor: fix crash on detecting device without write_urbs Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 31/64] USB: serial: option: Adding support for Telit LE922 Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 32/64] ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup() Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 33/64] ALSA: seq: Degrade the error message for too many opens Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 34/64] USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 35/64] arm64: kernel: fix architected PMU registers unconditional access Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 36/64] USB: option: fix Cinterion AHxx enumeration Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 37/64] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 38/64] ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 39/64] virtio_pci: fix use after free on release Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 40/64] ALSA: bebob: Use a signed return type for get_formation_index Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 41/64] arm64: errata: Add -mpc-relative-literal-loads to build flags Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 42/64] arm64: mm: avoid calling apply_to_page_range on empty range Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 43/64] x86/mm: Fix types used in pgprot cacheability flags translations Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 44/64] powerpc/eeh: Fix PE location code Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 45/64] SCSI: fix crashes in sd and sr runtime PM Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 46/64] tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 47/64] n_tty: Fix unsafe reference to "other" ldisc Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 48/64] staging/speakup: Use tty_ldisc_ref() for paste kworker Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 49/64] tick/nohz: Set the correct expiry when switching to nohz/lowres mode Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 50/64] irqchip/atmel-aic: Fix wrong bit operation for IRQ priority Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 51/64] seccomp: always propagate NO_NEW_PRIVS on tsync Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 52/64] drm/radeon: cleaned up VCO output settings for DP audio Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 53/64] drm/radeon: Add a common function for DFS handling Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 54/64] drm/radeon: fix DP audio support for APU with DCE4.1 display engine Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 55/64] cpufreq: Fix NULL reference crash while accessing policy->governor_data Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 56/64] cpufreq: pxa2xx: fix pxa_cpufreq_change_voltage prototype Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 57/64] ALSA: dummy: Disable switching timer backend via sysfs Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 58/64] drm/vmwgfx: respect 'nomodeset' Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 59/64] Staging: speakup: Fix getting port information Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 60/64] x86/mm/pat: Avoid truncation when converting cpa->numpages to address Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 61/64] serial: 8250_pci: Add Intel Broadwell ports Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 62/64] perf annotate browser: Fix behaviour of Shift-Tab with nothing focussed Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 63/64] perf hists: Fix HISTC_MEM_DCACHELINE width setting Kamal Mostafa
2016-02-04 22:44 ` [PATCH 4.2.y-ckt 64/64] powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8 Kamal Mostafa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.