All of lore.kernel.org
 help / color / mirror / Atom feed
* [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review
@ 2015-02-19 13:51 Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 01/58] powerpc: add little endian flag to syscall_get_arch() Luis Henriques
                   ` (57 more replies)
  0 siblings, 58 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Luis Henriques

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

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

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

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

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

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

 -Luis

--
 arch/arm/boot/dts/exynos4.dtsi                     |  4 +-
 arch/arm/mm/context.c                              | 26 +++---
 arch/arm64/include/asm/cputype.h                   |  2 +
 arch/arm64/kernel/setup.c                          | 99 ++++++++++++++++------
 arch/arm64/kernel/smp.c                            |  5 ++
 arch/mips/kernel/irq_cpu.c                         |  4 +
 arch/mips/kernel/smp.c                             |  2 +-
 arch/powerpc/kernel/ptrace.c                       | 10 ++-
 arch/x86/kvm/x86.c                                 | 19 +++--
 arch/x86/mm/fault.c                                |  8 +-
 arch/x86/pci/common.c                              | 16 ++++
 drivers/bluetooth/ath3k.c                          | 12 +++
 drivers/bluetooth/btusb.c                          |  2 +
 drivers/gpio/gpiolib.c                             |  2 +
 drivers/gpu/drm/radeon/radeon_display.c            |  3 +
 drivers/gpu/drm/radeon/radeon_gem.c                |  6 +-
 drivers/gpu/drm/radeon/radeon_kms.c                | 16 ++--
 drivers/gpu/drm/radeon/radeon_vm.c                 |  6 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c              | 21 +----
 drivers/md/raid5.c                                 |  5 ++
 drivers/media/rc/ir-lirc-codec.c                   | 12 ++-
 drivers/mmc/host/sdhci-acpi.c                      |  4 +
 drivers/mmc/host/sdhci-pci.c                       | 51 +++++++++++
 drivers/mmc/host/sdhci-pci.h                       |  6 ++
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c    |  2 +-
 .../net/ethernet/qlogic/netxen/netxen_nic_main.c   |  5 +-
 drivers/net/hyperv/netvsc.c                        | 11 ++-
 drivers/net/ppp/ppp_deflate.c                      |  2 +-
 drivers/pci/quirks.c                               | 40 ++++++++-
 drivers/spi/spi-fsl-dspi.c                         | 14 ++-
 drivers/virtio/virtio_pci.c                        | 13 +--
 fs/ceph/snap.c                                     | 26 +++++-
 fs/ceph/super.c                                    | 10 ++-
 fs/ceph/super.h                                    |  2 +
 fs/cifs/file.c                                     |  6 +-
 fs/nilfs2/nilfs.h                                  |  2 -
 fs/nilfs2/segment.c                                | 44 ++++++++--
 fs/nilfs2/segment.h                                |  5 ++
 include/net/ip.h                                   |  2 +-
 include/net/netns/ipv4.h                           |  1 +
 include/sound/ak4113.h                             |  2 +-
 include/sound/ak4114.h                             |  2 +-
 include/uapi/linux/audit.h                         |  2 +
 kernel/smpboot.c                                   |  2 +
 lib/checksum.c                                     | 12 ++-
 mm/pagewalk.c                                      |  5 +-
 net/core/dev.c                                     | 20 +++--
 net/core/rtnetlink.c                               |  6 +-
 net/ipv4/ip_output.c                               | 29 +------
 net/ipv4/ip_sockglue.c                             |  8 +-
 net/ipv4/ping.c                                    |  5 +-
 net/ipv4/tcp_ipv4.c                                | 37 ++++++--
 net/ipv4/udp_diag.c                                |  4 +-
 net/ipv6/datagram.c                                | 10 +--
 net/ipv6/ip6_fib.c                                 | 45 +++++-----
 net/ipv6/route.c                                   |  7 +-
 net/sctp/sm_make_chunk.c                           |  2 +-
 net/socket.c                                       |  6 +-
 sound/i2c/other/ak4113.c                           | 17 ++--
 sound/i2c/other/ak4114.c                           | 18 ++--
 sound/pci/hda/patch_realtek.c                      | 88 ++++++++++++++-----
 sound/soc/atmel/atmel_ssc_dai.c                    | 18 +---
 sound/soc/codecs/sgtl5000.c                        |  3 +
 63 files changed, 609 insertions(+), 265 deletions(-)

Adam Lee (1):
      Bluetooth: ath3k: workaround the compatibility issue with xHCI controller

Adrian Hunter (4):
      mmc: sdhci-pci: Fix Braswell eMMC timeout clock frequency
      mmc: sdhci-pci: Add support for Intel SPT
      mmc: sdhci-acpi: Add ACPI HID INT344D
      mmc: sdhci-acpi: Add a HID and UID for a SD Card host controller

Alan Cox (1):
      mmc: sdhci: Add PCI IDs for Intel Braswell

Alex Deucher (2):
      drm/radeon: don't init gpuvm if accel is disabled (v3)
      drm/radeon: properly set vm fragment size for TN/RL

Anantha Krishnan (1):
      Bluetooth: Add support for Acer [0489:e078]

Ani Sinha (1):
      net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland.

Austin Lund (1):
      [media] media/rc: Send sync space information on the lirc device

Bhuvanchandra DV (1):
      spi: spi-fsl-dspi: Remove usage of devm_kzalloc

Bo Shen (1):
      ASoC: atmel_ssc_dai: fix start event for I2S mode

Charlotte Richardson (1):
      PCI: Add NEC variants to Stratus ftServer PCIe DMI check

Christian König (1):
      drm/radeon: fix PLLs on RS880 and older v2

Christoph Hellwig (1):
      net: don't OOPS on socket aio

David Henningsson (1):
      ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart

Eric Dumazet (4):
      net: rps: fix cpu unplug
      netxen: fix netxen_nic_poll() logic
      tcp: ipv4: initialize unicast_sock sk_pacing_rate
      ipv4: tcp: get rid of ugly unicast_sock

Eric Nelson (1):
      ASoC: sgtl5000: add delay before first I2C access

Felix Fietkau (1):
      MIPS: IRQ: Fix disable_irq on CPU IRQs

Florian Westphal (1):
      ppp: deflate: never return len larger than output buffer

Govindarajulu Varadarajan (1):
      bnx2x: fix napi poll return value for repoll

Hagen Paul Pfeifer (1):
      ipv6: stop sending PTB packets for MTU < 1280

Haiyang Zhang (1):
      hyperv: Fix the error processing in netvsc_send()

Hannes Frederic Sowa (1):
      ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos too

Hemmo Nieminen (1):
      MIPS: Fix kernel lockup or crash after CPU offline/online

Herbert Xu (1):
      udp_diag: Fix socket skipping within chain

Hui Wang (1):
      ALSA: hda/realtek - move HP_MUTE_LED_MIC1 quirk for alc282

Janne Heikkinen (1):
      Bluetooth: Add USB device 04ca:3010 as Atheros AR3012

Johan Hovold (2):
      gpio: sysfs: fix memory leak in gpiod_export_link
      gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low

Lai Jiangshan (1):
      smpboot: Add missing get_online_cpus() in smpboot_register_percpu_thread()

Linus Torvalds (1):
      x86: mm: move mmap_sem unlock from mm_fault_error() to caller

Marcelo Tosatti (1):
      KVM: x86: update masterclock values on TSC writes

Mark Rutland (1):
      arm64: Fix up /proc/cpuinfo

Maurice Petallo (1):
      mmc: sdhci: Preset value not supported in Baytrail eMMC

Michael S. Tsirkin (1):
      virtio_pci: document why we defer kfree

Myron Stowe (1):
      PCI: Handle read-only BARs on AMD CS553x devices

NeilBrown (1):
      md/raid5: fix another livelock caused by non-aligned writes.

Richard Guy Briggs (1):
      powerpc: add little endian flag to syscall_get_arch()

Roopa Prabhu (1):
      bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify

Ryusuke Konishi (1):
      nilfs2: fix deadlock of segment constructor over I_SYNC flag

Sachin Prabhu (1):
      Complete oplock break jobs before closing file handle

Saran Maruti Ramanara (1):
      net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param

Sasha Levin (1):
      virtio_pci: defer kfree until release callback

Shiraz Hashim (1):
      mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range

Sylwester Nawrocki (1):
      ARM: dts: Fix I2S1, I2S2 compatible for exynos4 SoCs

Takashi Iwai (1):
      ALSA: ak411x: Fix stall in work callback

Thomas Hellstrom (1):
      drm/vmwgfx: Don't use memory accounting for kernel-side fence objects

Will Deacon (1):
      ARM: 8299/1: mm: ensure local active ASID is marked as allocated on rollover

Willem de Bruijn (1):
      ip: zero sockaddr returned on error queue

Yan, Zheng (1):
      ceph: introduce global empty snap context

karl beldan (2):
      lib/checksum.c: fix carry in csum_tcpudp_nofold
      lib/checksum.c: fix build for generic csum_tcpudp_nofold

subashab@codeaurora.org (1):
      ping: Fix race in free in receive path

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

* [PATCH 3.16.y-ckt 01/58] powerpc: add little endian flag to syscall_get_arch()
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 02/58] arm64: Fix up /proc/cpuinfo Luis Henriques
                   ` (56 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Richard Guy Briggs, Michael Ellerman, Ben Hutchings, Luis Henriques

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

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

From: Richard Guy Briggs <rgb@redhat.com>

commit 63f13448d81c910a284b096149411a719cbed501 upstream.

Since both ppc and ppc64 have LE variants which are now reported by uname, add
that flag (__AUDIT_ARCH_LE) to syscall_get_arch() and add AUDIT_ARCH_PPC64LE
variant.

Without this,  perf trace and auditctl fail.

Mainline kernel reports ppc64le (per a058801) but there is no matching
AUDIT_ARCH_PPC64LE.

Since 32-bit PPC LE is not supported by audit, don't advertise it in
AUDIT_ARCH_PPC* variants.

See:
	https://www.redhat.com/archives/linux-audit/2014-August/msg00082.html
	https://www.redhat.com/archives/linux-audit/2014-December/msg00004.html

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[bwh: Backported to 3.16: arch is passed in by do_syscall_trace_enter()
 rather than queried by calling syscall_get_arch()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/kernel/ptrace.c | 10 ++++++++--
 include/uapi/linux/audit.h   |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 2e3d2bf536c5..665ff668d8ae 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1769,6 +1769,7 @@ long arch_ptrace(struct task_struct *child, long request,
 long do_syscall_trace_enter(struct pt_regs *regs)
 {
 	long ret = 0;
+	int arch;
 
 	user_exit();
 
@@ -1786,15 +1787,20 @@ long do_syscall_trace_enter(struct pt_regs *regs)
 	if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
 		trace_sys_enter(regs, regs->gpr[0]);
 
+	arch = is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
+#ifdef __LITTLE_ENDIAN__
+	arch |= __AUDIT_ARCH_LE;
+#endif
+
 #ifdef CONFIG_PPC64
 	if (!is_32bit_task())
-		audit_syscall_entry(AUDIT_ARCH_PPC64,
+		audit_syscall_entry(arch,
 				    regs->gpr[0],
 				    regs->gpr[3], regs->gpr[4],
 				    regs->gpr[5], regs->gpr[6]);
 	else
 #endif
-		audit_syscall_entry(AUDIT_ARCH_PPC,
+		audit_syscall_entry(arch,
 				    regs->gpr[0],
 				    regs->gpr[3] & 0xffffffff,
 				    regs->gpr[4] & 0xffffffff,
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index cf6714752b69..6f94bf3f28a9 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -363,7 +363,9 @@ enum {
 #define AUDIT_ARCH_PARISC	(EM_PARISC)
 #define AUDIT_ARCH_PARISC64	(EM_PARISC|__AUDIT_ARCH_64BIT)
 #define AUDIT_ARCH_PPC		(EM_PPC)
+/* do not define AUDIT_ARCH_PPCLE since it is not supported by audit */
 #define AUDIT_ARCH_PPC64	(EM_PPC64|__AUDIT_ARCH_64BIT)
+#define AUDIT_ARCH_PPC64LE	(EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
 #define AUDIT_ARCH_S390		(EM_S390)
 #define AUDIT_ARCH_S390X	(EM_S390|__AUDIT_ARCH_64BIT)
 #define AUDIT_ARCH_SH		(EM_SH)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 02/58] arm64: Fix up /proc/cpuinfo
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 01/58] powerpc: add little endian flag to syscall_get_arch() Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 03/58] MIPS: IRQ: Fix disable_irq on CPU IRQs Luis Henriques
                   ` (55 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Catalin Marinas, Will Deacon, Ian Campbell, Mark Rutland, Luis Henriques

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

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

From: Mark Rutland <mark.rutland@arm.com>

commit 44b82b7700d05a52cd983799d3ecde1a976b3bed upstream.

[backport to 3.16.x: fold in missing MIDR_EL1 recording]

Commit d7a49086f263164a (arm64: cpuinfo: print info for all CPUs)
attempted to clean up /proc/cpuinfo, but due to concerns regarding
further changes was reverted in commit 5e39977edf6500fd (Revert "arm64:
cpuinfo: print info for all CPUs").

There are two major issues with the arm64 /proc/cpuinfo format
currently:

* The "Features" line describes (only) the 64-bit hwcaps, which is
  problematic for some 32-bit applications which attempt to parse it. As
  the same names are used for analogous ISA features (e.g. aes) despite
  these generally being architecturally unrelated, it is not possible to
  simply append the 64-bit and 32-bit hwcaps in a manner that might not
  be misleading to some applications.

  Various potential solutions have appeared in vendor kernels. Typically
  the format of the Features line varies depending on whether the task
  is 32-bit.

* Information is only printed regarding a single CPU. This does not
  match the ARM format, and does not provide sufficient information in
  big.LITTLE systems where CPUs are heterogeneous. The CPU information
  printed is queried from the current CPU's registers, which is racy
  w.r.t. cross-cpu migration.

This patch attempts to solve these issues. The following changes are
made:

* When a task with a LINUX32 personality attempts to read /proc/cpuinfo,
  the "Features" line contains the decoded 32-bit hwcaps, as with the
  arm port. Otherwise, the decoded 64-bit hwcaps are shown. This aligns
  with the behaviour of COMPAT_UTS_MACHINE and COMPAT_ELF_PLATFORM. In
  the absense of compat support, the Features line is empty.

  The set of hwcaps injected into a task's auxval are unaffected.

* Properties are printed per-cpu, as with the ARM port. The per-cpu
  information is queried from pre-recorded cpu information (as used by
  the sanity checks).

* As with the previous attempt at fixing up /proc/cpuinfo, the hardware
  field is removed. The only users so far are 32-bit applications tied
  to particular boards, so no portable applications should be affected,
  and this should prevent future tying to particular boards.

The following differences remain:

* No model_name is printed, as this cannot be queried from the hardware
  and cannot be provided in a stable fashion. Use of the CPU
  {implementor,variant,part,revision} fields is sufficient to identify a
  CPU and is portable across arm and arm64.

* The following system-wide properties are not provided, as they are not
  possible to provide generally. Programs relying on these are already
  tied to particular (32-bit only) boards:
  - Hardware
  - Revision
  - Serial

No software has yet been identified for which these remaining
differences are problematic.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
[Mark: backport to v3.16.x]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm64/include/asm/cputype.h |  2 +
 arch/arm64/kernel/setup.c        | 99 +++++++++++++++++++++++++++++-----------
 arch/arm64/kernel/smp.c          |  5 ++
 3 files changed, 80 insertions(+), 26 deletions(-)

diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index 27f54a7cc81b..ad08bc71fad8 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -78,6 +78,8 @@ static inline u32 __attribute_const__ read_cpuid_cachetype(void)
 	return read_cpuid(CTR_EL0);
 }
 
+void cpuinfo_store_cpu(void);
+
 #endif /* __ASSEMBLY__ */
 
 #endif
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 209070d08ee3..37655ae949b5 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -43,6 +43,7 @@
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 #include <linux/efi.h>
+#include <linux/personality.h>
 
 #include <asm/fixmap.h>
 #include <asm/cputype.h>
@@ -78,7 +79,6 @@ unsigned int compat_elf_hwcap2 __read_mostly;
 #endif
 
 static const char *cpu_name;
-static const char *machine_name;
 phys_addr_t __fdt_pointer __initdata;
 
 /*
@@ -198,6 +198,19 @@ static void __init smp_build_mpidr_hash(void)
 }
 #endif
 
+struct cpuinfo_arm64 {
+	struct cpu	cpu;
+	u32		reg_midr;
+};
+
+static DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data);
+
+void cpuinfo_store_cpu(void)
+{
+	struct cpuinfo_arm64 *info = this_cpu_ptr(&cpu_data);
+	info->reg_midr = read_cpuid_id();
+}
+
 static void __init setup_processor(void)
 {
 	struct cpu_info *cpu_info;
@@ -220,6 +233,8 @@ static void __init setup_processor(void)
 	sprintf(init_utsname()->machine, ELF_PLATFORM);
 	elf_hwcap = 0;
 
+	cpuinfo_store_cpu();
+
 	/*
 	 * Check for sane CTR_EL0.CWG value.
 	 */
@@ -308,8 +323,6 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
 		while (true)
 			cpu_relax();
 	}
-
-	machine_name = of_flat_dt_get_machine_name();
 }
 
 /*
@@ -419,14 +432,12 @@ static int __init arm64_device_init(void)
 }
 arch_initcall_sync(arm64_device_init);
 
-static DEFINE_PER_CPU(struct cpu, cpu_data);
-
 static int __init topology_init(void)
 {
 	int i;
 
 	for_each_possible_cpu(i) {
-		struct cpu *cpu = &per_cpu(cpu_data, i);
+		struct cpu *cpu = &per_cpu(cpu_data.cpu, i);
 		cpu->hotpluggable = 1;
 		register_cpu(cpu, i);
 	}
@@ -447,14 +458,41 @@ static const char *hwcap_str[] = {
 	NULL
 };
 
+#ifdef CONFIG_COMPAT
+static const char *compat_hwcap_str[] = {
+	"swp",
+	"half",
+	"thumb",
+	"26bit",
+	"fastmult",
+	"fpa",
+	"vfp",
+	"edsp",
+	"java",
+	"iwmmxt",
+	"crunch",
+	"thumbee",
+	"neon",
+	"vfpv3",
+	"vfpv3d16",
+	"tls",
+	"vfpv4",
+	"idiva",
+	"idivt",
+	"vfpd32",
+	"lpae",
+	"evtstrm"
+};
+#endif /* CONFIG_COMPAT */
+
 static int c_show(struct seq_file *m, void *v)
 {
-	int i;
-
-	seq_printf(m, "Processor\t: %s rev %d (%s)\n",
-		   cpu_name, read_cpuid_id() & 15, ELF_PLATFORM);
+	int i, j;
 
 	for_each_online_cpu(i) {
+		struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
+		u32 midr = cpuinfo->reg_midr;
+
 		/*
 		 * glibc reads /proc/cpuinfo to determine the number of
 		 * online processors, looking for lines beginning with
@@ -463,24 +501,33 @@ static int c_show(struct seq_file *m, void *v)
 #ifdef CONFIG_SMP
 		seq_printf(m, "processor\t: %d\n", i);
 #endif
-	}
-
-	/* dump out the processor features */
-	seq_puts(m, "Features\t: ");
-
-	for (i = 0; hwcap_str[i]; i++)
-		if (elf_hwcap & (1 << i))
-			seq_printf(m, "%s ", hwcap_str[i]);
 
-	seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
-	seq_printf(m, "CPU architecture: AArch64\n");
-	seq_printf(m, "CPU variant\t: 0x%x\n", (read_cpuid_id() >> 20) & 15);
-	seq_printf(m, "CPU part\t: 0x%03x\n", (read_cpuid_id() >> 4) & 0xfff);
-	seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
-
-	seq_puts(m, "\n");
+		/*
+		 * Dump out the common processor features in a single line.
+		 * Userspace should read the hwcaps with getauxval(AT_HWCAP)
+		 * rather than attempting to parse this, but there's a body of
+		 * software which does already (at least for 32-bit).
+		 */
+		seq_puts(m, "Features\t:");
+		if (personality(current->personality) == PER_LINUX32) {
+#ifdef CONFIG_COMPAT
+			for (j = 0; compat_hwcap_str[j]; j++)
+				if (compat_elf_hwcap & (1 << j))
+					seq_printf(m, " %s", compat_hwcap_str[j]);
+#endif /* CONFIG_COMPAT */
+		} else {
+			for (j = 0; hwcap_str[j]; j++)
+				if (elf_hwcap & (1 << j))
+					seq_printf(m, " %s", hwcap_str[j]);
+		}
+		seq_puts(m, "\n");
 
-	seq_printf(m, "Hardware\t: %s\n", machine_name);
+		seq_printf(m, "CPU implementer\t: 0x%02x\n", (midr >> 24));
+		seq_printf(m, "CPU architecture: 8\n");
+		seq_printf(m, "CPU variant\t: 0x%x\n", ((midr >> 20) & 0xf));
+		seq_printf(m, "CPU part\t: 0x%03x\n", ((midr >> 4) & 0xfff));
+		seq_printf(m, "CPU revision\t: %d\n\n", (midr & 0xf));
+	}
 
 	return 0;
 }
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index 40f38f46c8e0..9df272c0d240 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -155,6 +155,11 @@ asmlinkage void secondary_start_kernel(void)
 		cpu_ops[cpu]->cpu_postboot();
 
 	/*
+	 * Log the CPU info before it is marked online and might get read.
+	 */
+	cpuinfo_store_cpu();
+
+	/*
 	 * Enable GIC and timers.
 	 */
 	notify_cpu_starting(cpu);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 03/58] MIPS: IRQ: Fix disable_irq on CPU IRQs
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 01/58] powerpc: add little endian flag to syscall_get_arch() Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 02/58] arm64: Fix up /proc/cpuinfo Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 04/58] Complete oplock break jobs before closing file handle Luis Henriques
                   ` (54 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Felix Fietkau, linux-mips, Ralf Baechle, Luis Henriques

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

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

From: Felix Fietkau <nbd@openwrt.org>

commit a3e6c1eff54878506b2dddcc202df9cc8180facb upstream.

If the irq_chip does not define .irq_disable, any call to disable_irq
will defer disabling the IRQ until it fires while marked as disabled.
This assumes that the handler function checks for this condition, which
handle_percpu_irq does not. In this case, calling disable_irq leads to
an IRQ storm, if the interrupt fires while disabled.

This optimization is only useful when disabling the IRQ is slow, which
is not true for the MIPS CPU IRQ.

Disable this optimization by implementing .irq_disable and .irq_enable

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8949/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/kernel/irq_cpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index e498f2b3646a..f5598e25e906 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -56,6 +56,8 @@ static struct irq_chip mips_cpu_irq_controller = {
 	.irq_mask_ack	= mask_mips_irq,
 	.irq_unmask	= unmask_mips_irq,
 	.irq_eoi	= unmask_mips_irq,
+	.irq_disable	= mask_mips_irq,
+	.irq_enable	= unmask_mips_irq,
 };
 
 /*
@@ -92,6 +94,8 @@ static struct irq_chip mips_mt_cpu_irq_controller = {
 	.irq_mask_ack	= mips_mt_cpu_irq_ack,
 	.irq_unmask	= unmask_mips_irq,
 	.irq_eoi	= unmask_mips_irq,
+	.irq_disable	= mask_mips_irq,
+	.irq_enable	= unmask_mips_irq,
 };
 
 void __init mips_cpu_irq_init(void)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 04/58] Complete oplock break jobs before closing file handle
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (2 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 03/58] MIPS: IRQ: Fix disable_irq on CPU IRQs Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 05/58] smpboot: Add missing get_online_cpus() in smpboot_register_percpu_thread() Luis Henriques
                   ` (53 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sachin Prabhu, Jeff Layton, Steve French, Luis Henriques

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

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

From: Sachin Prabhu <sprabhu@redhat.com>

commit ca7df8e0bb2a5ec79691de8a1a4c0e611fe04e60 upstream.

Commit
c11f1df5003d534fd067f0168bfad7befffb3b5c
requires writers to wait for any pending oplock break handler to
complete before proceeding to write. This is done by waiting on bit
CIFS_INODE_PENDING_OPLOCK_BREAK in cifsFileInfo->flags. This bit is
cleared by the oplock break handler job queued on the workqueue once it
has completed handling the oplock break allowing writers to proceed with
writing to the file.

While testing, it was noticed that the filehandle could be closed while
there is a pending oplock break which results in the oplock break
handler on the cifsiod workqueue being cancelled before it has had a
chance to execute and clear the CIFS_INODE_PENDING_OPLOCK_BREAK bit.
Any subsequent attempt to write to this file hangs waiting for the
CIFS_INODE_PENDING_OPLOCK_BREAK bit to be cleared.

We fix this by ensuring that we also clear the bit
CIFS_INODE_PENDING_OPLOCK_BREAK when we remove the oplock break handler
from the workqueue.

The bug was found by Red Hat QA while testing using ltp's fsstress
command.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Steve French <steve.french@primarydata.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/cifs/file.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 9de08c9dd106..58dff97aafef 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -366,6 +366,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
 	struct cifsLockInfo *li, *tmp;
 	struct cifs_fid fid;
 	struct cifs_pending_open open;
+	bool oplock_break_cancelled;
 
 	spin_lock(&cifs_file_list_lock);
 	if (--cifs_file->count > 0) {
@@ -397,7 +398,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
 	}
 	spin_unlock(&cifs_file_list_lock);
 
-	cancel_work_sync(&cifs_file->oplock_break);
+	oplock_break_cancelled = cancel_work_sync(&cifs_file->oplock_break);
 
 	if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
 		struct TCP_Server_Info *server = tcon->ses->server;
@@ -409,6 +410,9 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
 		_free_xid(xid);
 	}
 
+	if (oplock_break_cancelled)
+		cifs_done_oplock_break(cifsi);
+
 	cifs_del_pending_open(&open);
 
 	/*
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 05/58] smpboot: Add missing get_online_cpus() in smpboot_register_percpu_thread()
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (3 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 04/58] Complete oplock break jobs before closing file handle Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 06/58] ASoC: atmel_ssc_dai: fix start event for I2S mode Luis Henriques
                   ` (52 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Lai Jiangshan, Thomas Gleixner, Rusty Russell, Peter Zijlstra,
	Srivatsa S. Bhat, David Rientjes, Luis Henriques

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

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

From: Lai Jiangshan <laijs@cn.fujitsu.com>

commit 4bee96860a65c3a62d332edac331b3cf936ba3ad upstream.

The following race exists in the smpboot percpu threads management:

CPU0	      	   	     CPU1
cpu_up(2)
  get_online_cpus();
  smpboot_create_threads(2);
			     smpboot_register_percpu_thread();
			     for_each_online_cpu();
			       __smpboot_create_thread();
  __cpu_up(2);

This results in a missing per cpu thread for the newly onlined cpu2 and
in a NULL pointer dereference on a consecutive offline of that cpu.

Proctect smpboot_register_percpu_thread() with get_online_cpus() to
prevent that.

[ tglx: Massaged changelog and removed the change in
        smpboot_unregister_percpu_thread() because that's an
        optimization and therefor not stable material. ]

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: David Rientjes <rientjes@google.com>
Link: http://lkml.kernel.org/r/1406777421-12830-1-git-send-email-laijs@cn.fujitsu.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 kernel/smpboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index eb89e1807408..60d35ac5d3f1 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -279,6 +279,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
 	unsigned int cpu;
 	int ret = 0;
 
+	get_online_cpus();
 	mutex_lock(&smpboot_threads_lock);
 	for_each_online_cpu(cpu) {
 		ret = __smpboot_create_thread(plug_thread, cpu);
@@ -291,6 +292,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)
 	list_add(&plug_thread->list, &hotplug_threads);
 out:
 	mutex_unlock(&smpboot_threads_lock);
+	put_online_cpus();
 	return ret;
 }
 EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 06/58] ASoC: atmel_ssc_dai: fix start event for I2S mode
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (4 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 05/58] smpboot: Add missing get_online_cpus() in smpboot_register_percpu_thread() Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 07/58] spi: spi-fsl-dspi: Remove usage of devm_kzalloc Luis Henriques
                   ` (51 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Bo Shen, Mark Brown, Luis Henriques

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

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

From: Bo Shen <voice.shen@atmel.com>

commit a43bd7e125143b875caae6d4f9938855b440faaf upstream.

According to the I2S specification information as following:
  - WS = 0, channel 1 (left)
  - WS = 1, channel 2 (right)
So, the start event should be TF/RF falling edge.

Reported-by: Songjun Wu <songjun.wu@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/atmel/atmel_ssc_dai.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index de433cfd044c..ee1e7ba5db41 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -345,7 +345,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 	struct atmel_pcm_dma_params *dma_params;
 	int dir, channels, bits;
 	u32 tfmr, rfmr, tcmr, rcmr;
-	int start_event;
 	int ret;
 
 	/*
@@ -452,19 +451,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 		 * The SSC transmit clock is obtained from the BCLK signal on
 		 * on the TK line, and the SSC receive clock is
 		 * generated from the transmit clock.
-		 *
-		 *  For single channel data, one sample is transferred
-		 * on the falling edge of the LRC clock.
-		 * For two channel data, one sample is
-		 * transferred on both edges of the LRC clock.
 		 */
-		start_event = ((channels == 1)
-				? SSC_START_FALLING_RF
-				: SSC_START_EDGE_RF);
-
 		rcmr =	  SSC_BF(RCMR_PERIOD, 0)
 			| SSC_BF(RCMR_STTDLY, START_DELAY)
-			| SSC_BF(RCMR_START, start_event)
+			| SSC_BF(RCMR_START, SSC_START_FALLING_RF)
 			| SSC_BF(RCMR_CKI, SSC_CKI_RISING)
 			| SSC_BF(RCMR_CKO, SSC_CKO_NONE)
 			| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
@@ -473,14 +463,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 		rfmr =	  SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
 			| SSC_BF(RFMR_FSOS, SSC_FSOS_NONE)
 			| SSC_BF(RFMR_FSLEN, 0)
-			| SSC_BF(RFMR_DATNB, 0)
+			| SSC_BF(RFMR_DATNB, (channels - 1))
 			| SSC_BIT(RFMR_MSBF)
 			| SSC_BF(RFMR_LOOP, 0)
 			| SSC_BF(RFMR_DATLEN, (bits - 1));
 
 		tcmr =	  SSC_BF(TCMR_PERIOD, 0)
 			| SSC_BF(TCMR_STTDLY, START_DELAY)
-			| SSC_BF(TCMR_START, start_event)
+			| SSC_BF(TCMR_START, SSC_START_FALLING_RF)
 			| SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
 			| SSC_BF(TCMR_CKO, SSC_CKO_NONE)
 			| SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
@@ -490,7 +480,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
 			| SSC_BF(TFMR_FSDEN, 0)
 			| SSC_BF(TFMR_FSOS, SSC_FSOS_NONE)
 			| SSC_BF(TFMR_FSLEN, 0)
-			| SSC_BF(TFMR_DATNB, 0)
+			| SSC_BF(TFMR_DATNB, (channels - 1))
 			| SSC_BIT(TFMR_MSBF)
 			| SSC_BF(TFMR_DATDEF, 0)
 			| SSC_BF(TFMR_DATLEN, (bits - 1));
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 07/58] spi: spi-fsl-dspi: Remove usage of devm_kzalloc
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (5 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 06/58] ASoC: atmel_ssc_dai: fix start event for I2S mode Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 08/58] ALSA: ak411x: Fix stall in work callback Luis Henriques
                   ` (50 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Bhuvanchandra DV, Mark Brown, Luis Henriques

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

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

From: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>

commit 973fbce69ed8e79b5fe3ad19cfecb581a7ef8048 upstream.

devm_* API was supposed to be used only in probe function call.
Memory is allocated at 'probe' and free automatically at 'remove'.
Usage of devm_* functions outside probe sometimes leads to memory leak.
Avoid using devm_kzalloc in dspi_setup_transfer and use kzalloc instead.
Also add the dspi_cleanup function to free the controller data upon
cleanup.

Acked-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/spi/spi-fsl-dspi.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index fde711380d1a..ec1651e85cf6 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -342,8 +342,7 @@ static int dspi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 	/* Only alloc on first setup */
 	chip = spi_get_ctldata(spi);
 	if (chip == NULL) {
-		chip = devm_kzalloc(&spi->dev, sizeof(struct chip_data),
-				    GFP_KERNEL);
+		chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
 		if (!chip)
 			return -ENOMEM;
 	}
@@ -382,6 +381,16 @@ static int dspi_setup(struct spi_device *spi)
 	return dspi_setup_transfer(spi, NULL);
 }
 
+static void dspi_cleanup(struct spi_device *spi)
+{
+	struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi);
+
+	dev_dbg(&spi->dev, "spi_device %u.%u cleanup\n",
+			spi->master->bus_num, spi->chip_select);
+
+	kfree(chip);
+}
+
 static irqreturn_t dspi_interrupt(int irq, void *dev_id)
 {
 	struct fsl_dspi *dspi = (struct fsl_dspi *)dev_id;
@@ -467,6 +476,7 @@ static int dspi_probe(struct platform_device *pdev)
 	dspi->bitbang.master->setup = dspi_setup;
 	dspi->bitbang.master->dev.of_node = pdev->dev.of_node;
 
+	master->cleanup = dspi_cleanup;
 	master->mode_bits = SPI_CPOL | SPI_CPHA;
 	master->bits_per_word_mask = SPI_BPW_MASK(4) | SPI_BPW_MASK(8) |
 					SPI_BPW_MASK(16);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 08/58] ALSA: ak411x: Fix stall in work callback
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (6 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 07/58] spi: spi-fsl-dspi: Remove usage of devm_kzalloc Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 09/58] lib/checksum.c: fix carry in csum_tcpudp_nofold Luis Henriques
                   ` (49 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Takashi Iwai, Luis Henriques

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 4161b4505f1690358ac0a9ee59845a7887336b21 upstream.

When ak4114 work calls its callback and the callback invokes
ak4114_reinit(), it stalls due to flush_delayed_work().  For avoiding
this, control the reentrance by introducing a refcount.  Also
flush_delayed_work() is replaced with cancel_delayed_work_sync().

The exactly same bug is present in ak4113.c and fixed as well.

Reported-by: Pavel Hofman <pavel.hofman@ivitera.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/sound/ak4113.h   |  2 +-
 include/sound/ak4114.h   |  2 +-
 sound/i2c/other/ak4113.c | 17 ++++++++---------
 sound/i2c/other/ak4114.c | 18 ++++++++----------
 4 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h
index 2609048c1d44..3a34f6edc2d1 100644
--- a/include/sound/ak4113.h
+++ b/include/sound/ak4113.h
@@ -286,7 +286,7 @@ struct ak4113 {
 	ak4113_write_t *write;
 	ak4113_read_t *read;
 	void *private_data;
-	unsigned int init:1;
+	atomic_t wq_processing;
 	spinlock_t lock;
 	unsigned char regmap[AK4113_WRITABLE_REGS];
 	struct snd_kcontrol *kctls[AK4113_CONTROLS];
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h
index 52f02a60dba7..069299a88915 100644
--- a/include/sound/ak4114.h
+++ b/include/sound/ak4114.h
@@ -168,7 +168,7 @@ struct ak4114 {
 	ak4114_write_t * write;
 	ak4114_read_t * read;
 	void * private_data;
-	unsigned int init: 1;
+	atomic_t wq_processing;
 	spinlock_t lock;
 	unsigned char regmap[6];
 	unsigned char txcsb[5];
diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c
index 1a3a6fa27158..c6bba99a90b2 100644
--- a/sound/i2c/other/ak4113.c
+++ b/sound/i2c/other/ak4113.c
@@ -56,8 +56,7 @@ static inline unsigned char reg_read(struct ak4113 *ak4113, unsigned char reg)
 
 static void snd_ak4113_free(struct ak4113 *chip)
 {
-	chip->init = 1;	/* don't schedule new work */
-	mb();
+	atomic_inc(&chip->wq_processing);	/* don't schedule new work */
 	cancel_delayed_work_sync(&chip->work);
 	kfree(chip);
 }
@@ -89,6 +88,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
 	chip->write = write;
 	chip->private_data = private_data;
 	INIT_DELAYED_WORK(&chip->work, ak4113_stats);
+	atomic_set(&chip->wq_processing, 0);
 
 	for (reg = 0; reg < AK4113_WRITABLE_REGS ; reg++)
 		chip->regmap[reg] = pgm[reg];
@@ -139,13 +139,11 @@ static void ak4113_init_regs(struct ak4113 *chip)
 
 void snd_ak4113_reinit(struct ak4113 *chip)
 {
-	chip->init = 1;
-	mb();
-	flush_delayed_work(&chip->work);
+	if (atomic_inc_return(&chip->wq_processing) == 1)
+		cancel_delayed_work_sync(&chip->work);
 	ak4113_init_regs(chip);
 	/* bring up statistics / event queing */
-	chip->init = 0;
-	if (chip->kctls[0])
+	if (atomic_dec_and_test(&chip->wq_processing))
 		schedule_delayed_work(&chip->work, HZ / 10);
 }
 EXPORT_SYMBOL_GPL(snd_ak4113_reinit);
@@ -632,8 +630,9 @@ static void ak4113_stats(struct work_struct *work)
 {
 	struct ak4113 *chip = container_of(work, struct ak4113, work.work);
 
-	if (!chip->init)
+	if (atomic_inc_return(&chip->wq_processing) == 1)
 		snd_ak4113_check_rate_and_errors(chip, chip->check_flags);
 
-	schedule_delayed_work(&chip->work, HZ / 10);
+	if (atomic_dec_and_test(&chip->wq_processing))
+		schedule_delayed_work(&chip->work, HZ / 10);
 }
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index c7f56339415d..b70e6eccbd03 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -66,8 +66,7 @@ static void reg_dump(struct ak4114 *ak4114)
 
 static void snd_ak4114_free(struct ak4114 *chip)
 {
-	chip->init = 1;	/* don't schedule new work */
-	mb();
+	atomic_inc(&chip->wq_processing);	/* don't schedule new work */
 	cancel_delayed_work_sync(&chip->work);
 	kfree(chip);
 }
@@ -100,6 +99,7 @@ int snd_ak4114_create(struct snd_card *card,
 	chip->write = write;
 	chip->private_data = private_data;
 	INIT_DELAYED_WORK(&chip->work, ak4114_stats);
+	atomic_set(&chip->wq_processing, 0);
 
 	for (reg = 0; reg < 6; reg++)
 		chip->regmap[reg] = pgm[reg];
@@ -152,13 +152,11 @@ static void ak4114_init_regs(struct ak4114 *chip)
 
 void snd_ak4114_reinit(struct ak4114 *chip)
 {
-	chip->init = 1;
-	mb();
-	flush_delayed_work(&chip->work);
+	if (atomic_inc_return(&chip->wq_processing) == 1)
+		cancel_delayed_work_sync(&chip->work);
 	ak4114_init_regs(chip);
 	/* bring up statistics / event queing */
-	chip->init = 0;
-	if (chip->kctls[0])
+	if (atomic_dec_and_test(&chip->wq_processing))
 		schedule_delayed_work(&chip->work, HZ / 10);
 }
 
@@ -612,10 +610,10 @@ static void ak4114_stats(struct work_struct *work)
 {
 	struct ak4114 *chip = container_of(work, struct ak4114, work.work);
 
-	if (!chip->init)
+	if (atomic_inc_return(&chip->wq_processing) == 1)
 		snd_ak4114_check_rate_and_errors(chip, chip->check_flags);
-
-	schedule_delayed_work(&chip->work, HZ / 10);
+	if (atomic_dec_and_test(&chip->wq_processing))
+		schedule_delayed_work(&chip->work, HZ / 10);
 }
 
 EXPORT_SYMBOL(snd_ak4114_create);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 09/58] lib/checksum.c: fix carry in csum_tcpudp_nofold
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (7 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 08/58] ALSA: ak411x: Fix stall in work callback Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 10/58] lib/checksum.c: fix build for generic csum_tcpudp_nofold Luis Henriques
                   ` (48 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Karl Beldan, Al Viro, Eric Dumazet, Arnd Bergmann,
	Mike Frysinger, netdev, Eric Dumazet, David S. Miller,
	Luis Henriques

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

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

From: karl beldan <karl.beldan@gmail.com>

commit 150ae0e94634714b23919f0c333fee28a5b199d5 upstream.

The carry from the 64->32bits folding was dropped, e.g with:
saddr=0xFFFFFFFF daddr=0xFF0000FF len=0xFFFF proto=0 sum=1,
csum_tcpudp_nofold returned 0 instead of 1.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 lib/checksum.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/checksum.c b/lib/checksum.c
index 129775eb6de6..fcf38943132c 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
@@ -47,6 +47,15 @@ static inline unsigned short from32to16(unsigned int x)
 	return x;
 }
 
+static inline u32 from64to32(u64 x)
+{
+	/* add up 32-bit and 32-bit for 32+c bit */
+	x = (x & 0xffffffff) + (x >> 32);
+	/* add up carry.. */
+	x = (x & 0xffffffff) + (x >> 32);
+	return (u32)x;
+}
+
 static unsigned int do_csum(const unsigned char *buff, int len)
 {
 	int odd;
@@ -195,8 +204,7 @@ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
 #else
 	s += (proto + len) << 8;
 #endif
-	s += (s >> 32);
-	return (__force __wsum)s;
+	return (__force __wsum)from64to32(s);
 }
 EXPORT_SYMBOL(csum_tcpudp_nofold);
 #endif
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 10/58] lib/checksum.c: fix build for generic csum_tcpudp_nofold
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (8 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 09/58] lib/checksum.c: fix carry in csum_tcpudp_nofold Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 11/58] MIPS: Fix kernel lockup or crash after CPU offline/online Luis Henriques
                   ` (47 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Karl Beldan, Eric Dumazet, David S. Miller, Luis Henriques

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

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

From: karl beldan <karl.beldan@gmail.com>

commit 9ce357795ef208faa0d59894d9d119a7434e37f3 upstream.

Fixed commit added from64to32 under _#ifndef do_csum_ but used it
under _#ifndef csum_tcpudp_nofold_, breaking some builds (Fengguang's
robot reported TILEGX's). Move from64to32 under the latter.

Fixes: 150ae0e94634 ("lib/checksum.c: fix carry in csum_tcpudp_nofold")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 lib/checksum.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/checksum.c b/lib/checksum.c
index fcf38943132c..8b39e86dbab5 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
@@ -47,15 +47,6 @@ static inline unsigned short from32to16(unsigned int x)
 	return x;
 }
 
-static inline u32 from64to32(u64 x)
-{
-	/* add up 32-bit and 32-bit for 32+c bit */
-	x = (x & 0xffffffff) + (x >> 32);
-	/* add up carry.. */
-	x = (x & 0xffffffff) + (x >> 32);
-	return (u32)x;
-}
-
 static unsigned int do_csum(const unsigned char *buff, int len)
 {
 	int odd;
@@ -190,6 +181,15 @@ csum_partial_copy(const void *src, void *dst, int len, __wsum sum)
 EXPORT_SYMBOL(csum_partial_copy);
 
 #ifndef csum_tcpudp_nofold
+static inline u32 from64to32(u64 x)
+{
+	/* add up 32-bit and 32-bit for 32+c bit */
+	x = (x & 0xffffffff) + (x >> 32);
+	/* add up carry.. */
+	x = (x & 0xffffffff) + (x >> 32);
+	return (u32)x;
+}
+
 __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
 			unsigned short len,
 			unsigned short proto,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 11/58] MIPS: Fix kernel lockup or crash after CPU offline/online
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (9 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 10/58] lib/checksum.c: fix build for generic csum_tcpudp_nofold Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 12/58] gpio: sysfs: fix memory leak in gpiod_export_link Luis Henriques
                   ` (46 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hemmo Nieminen, Aaro Koskinen, David Daney, linux-mips,
	Ralf Baechle, Luis Henriques

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

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

From: Hemmo Nieminen <hemmo.nieminen@iki.fi>

commit c7754e75100ed5e3068ac5085747f2bfc386c8d6 upstream.

As printk() invocation can cause e.g. a TLB miss, printk() cannot be
called before the exception handlers have been properly initialized.
This can happen e.g. when netconsole has been loaded as a kernel module
and the TLB table has been cleared when a CPU was offline.

Call cpu_report() in start_secondary() only after the exception handlers
have been initialized to fix this.

Without the patch the kernel will randomly either lockup or crash
after a CPU is onlined and the console driver is a module.

Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8953/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/mips/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 9bad52ede903..9bc3561b6901 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -101,10 +101,10 @@ asmlinkage void start_secondary(void)
 	unsigned int cpu;
 
 	cpu_probe();
-	cpu_report();
 	per_cpu_trap_init(false);
 	mips_clockevent_init();
 	mp_ops->init_secondary();
+	cpu_report();
 
 	/*
 	 * XXX parity protection should be folded in here when it's converted
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 12/58] gpio: sysfs: fix memory leak in gpiod_export_link
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (10 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 11/58] MIPS: Fix kernel lockup or crash after CPU offline/online Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 13/58] gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low Luis Henriques
                   ` (45 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johan Hovold, Linus Walleij, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit 0f303db08df0df9bd0966443ad6001e63960af16 upstream.

Fix memory leak in the gpio sysfs interface due to failure to drop
reference to device returned by class_find_device when creating a link.

Fixes: a4177ee7f1a8 ("gpiolib: allow exported GPIO nodes to be named
using sysfs links")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[ luis: backported to 3.16:
  - file rename: drivers/gpio/gpiolib-sysfs.c -> drivers/gpio/gpiolib.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpio/gpiolib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index b9b955530596..69fc2fcfc3e9 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -911,6 +911,7 @@ int gpiod_export_link(struct device *dev, const char *name,
 		if (tdev != NULL) {
 			status = sysfs_create_link(&dev->kobj, &tdev->kobj,
 						name);
+			put_device(tdev);
 		} else {
 			status = -ENODEV;
 		}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 13/58] gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (11 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 12/58] gpio: sysfs: fix memory leak in gpiod_export_link Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 14/58] md/raid5: fix another livelock caused by non-aligned writes Luis Henriques
                   ` (44 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Johan Hovold, Linus Walleij, Luis Henriques

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

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

From: Johan Hovold <johan@kernel.org>

commit 49d2ca84e433dab854c7a866bc6add09cfab682d upstream.

Fix memory leak in the gpio sysfs interface due to failure to drop
reference to device returned by class_find_device when setting the
gpio-line polarity.

Fixes: 0769746183ca ("gpiolib: add support for changing value polarity
in sysfs")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[ luis: backported to 3.16:
  - file rename: drivers/gpio/gpiolib-sysfs.c -> drivers/gpio/gpiolib.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpio/gpiolib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 69fc2fcfc3e9..afdca5a6b2a6 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -960,6 +960,7 @@ int gpiod_sysfs_set_active_low(struct gpio_desc *desc, int value)
 
 	status = sysfs_set_active_low(desc, dev, value);
 
+	put_device(dev);
 unlock:
 	mutex_unlock(&sysfs_lock);
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 14/58] md/raid5: fix another livelock caused by non-aligned writes.
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (12 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 13/58] gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 15/58] PCI: Add NEC variants to Stratus ftServer PCIe DMI check Luis Henriques
                   ` (43 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: NeilBrown, Luis Henriques

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

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

From: NeilBrown <neilb@suse.de>

commit b1b02fe97f75b12ab34b2303bfd4e3526d903a58 upstream.

If a non-page-aligned write is destined for a device which
is missing/faulty, we can deadlock.

As the target device is missing, a read-modify-write cycle
is not possible.
As the write is not for a full-page, a recontruct-write cycle
is not possible.

This should be handled by logic in fetch_block() which notices
there is a non-R5_OVERWRITE write to a missing device, and so
loads all blocks.

However since commit 67f455486d2ea2, that code requires
STRIPE_PREREAD_ACTIVE before it will active, and those circumstances
never set STRIPE_PREREAD_ACTIVE.

So: in handle_stripe_dirtying, if neither rmw or rcw was possible,
set STRIPE_DELAYED, which will cause STRIPE_PREREAD_ACTIVE be set
after a suitable delay.

Fixes: 67f455486d2ea20b2d94d6adf5b9b783d079e321
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/raid5.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 222aa7521877..68a03d7f25ee 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3204,6 +3204,11 @@ static void handle_stripe_dirtying(struct r5conf *conf,
 					  (unsigned long long)sh->sector,
 					  rcw, qread, test_bit(STRIPE_DELAYED, &sh->state));
 	}
+
+	if (rcw > disks && rmw > disks &&
+	    !test_bit(STRIPE_PREREAD_ACTIVE, &sh->state))
+		set_bit(STRIPE_DELAYED, &sh->state);
+
 	/* now if nothing is locked, and if we have enough data,
 	 * we can start a write request
 	 */
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 15/58] PCI: Add NEC variants to Stratus ftServer PCIe DMI check
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (13 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 14/58] md/raid5: fix another livelock caused by non-aligned writes Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 16/58] drm/radeon: fix PLLs on RS880 and older v2 Luis Henriques
                   ` (42 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Charlotte Richardson, Bjorn Helgaas, Myron Stowe, Luis Henriques

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

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

From: Charlotte Richardson <charlotte.richardson@stratus.com>

commit 51ac3d2f0c505ca36ffc9715ffd518d756589ef8 upstream.

NEC OEMs the same platforms as Stratus does, which have multiple devices on
some PCIe buses under downstream ports.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=51331
Fixes: 1278998f8ff6 ("PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check)")
Signed-off-by: Charlotte Richardson <charlotte.richardson@stratus.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/pci/common.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 059a76c29739..e3f365a9f319 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -448,6 +448,22 @@ static const struct dmi_system_id pciprobe_dmi_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "ftServer"),
 		},
 	},
+        {
+                .callback = set_scan_all,
+                .ident = "Stratus/NEC ftServer",
+                .matches = {
+                        DMI_MATCH(DMI_SYS_VENDOR, "NEC"),
+                        DMI_MATCH(DMI_PRODUCT_NAME, "Express5800/R32"),
+                },
+        },
+        {
+                .callback = set_scan_all,
+                .ident = "Stratus/NEC ftServer",
+                .matches = {
+                        DMI_MATCH(DMI_SYS_VENDOR, "NEC"),
+                        DMI_MATCH(DMI_PRODUCT_NAME, "Express5800/R31"),
+                },
+        },
 	{}
 };
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 16/58] drm/radeon: fix PLLs on RS880 and older v2
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (14 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 15/58] PCI: Add NEC variants to Stratus ftServer PCIe DMI check Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 17/58] drm/radeon: don't init gpuvm if accel is disabled (v3) Luis Henriques
                   ` (41 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christian König, Alex Deucher, Luis Henriques

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

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

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

commit 72edd83cc9e5819ed1ee771519143d7594e059f0 upstream.

This is a workaround for RS880 and older chips which seem to have
an additional limit on the minimum PLL input frequency.

v2: fix signed/unsigned warning

bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=91861
https://bugzilla.kernel.org/show_bug.cgi?id=83461

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index bf25061c8ac4..13ac29b1fa0c 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -1000,6 +1000,9 @@ void radeon_compute_pll_avivo(struct radeon_pll *pll,
 	if (pll->flags & RADEON_PLL_USE_FRAC_FB_DIV &&
 	    pll->flags & RADEON_PLL_USE_REF_DIV)
 		ref_div_max = pll->reference_div;
+	else if (pll->flags & RADEON_PLL_PREFER_MINM_OVER_MAXP)
+		/* fix for problems on RS880 */
+		ref_div_max = min(pll->max_ref_div, 7u);
 	else
 		ref_div_max = pll->max_ref_div;
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 17/58] drm/radeon: don't init gpuvm if accel is disabled (v3)
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (15 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 16/58] drm/radeon: fix PLLs on RS880 and older v2 Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 18/58] drm/radeon: properly set vm fragment size for TN/RL Luis Henriques
                   ` (40 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit 544143f9e01a60a93eb00ab4bfcb9bf4702a2a7d upstream.

If acceleration is disabled, it does not make sense
to init gpuvm since nothing will use it.  Moreover,
if radeon_vm_init() gets called it uses accel to try
and clear the pde tables, etc. which results in a bug.

v2: handle vm_fini as well
v3: handle bo_open/close as well

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_gem.c |  6 ++++--
 drivers/gpu/drm/radeon/radeon_kms.c | 16 ++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index d09650c1d720..d41505cb35f1 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -140,7 +140,8 @@ int radeon_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_pri
 	struct radeon_bo_va *bo_va;
 	int r;
 
-	if (rdev->family < CHIP_CAYMAN) {
+	if ((rdev->family < CHIP_CAYMAN) ||
+	    (!rdev->accel_working)) {
 		return 0;
 	}
 
@@ -170,7 +171,8 @@ void radeon_gem_object_close(struct drm_gem_object *obj,
 	struct radeon_bo_va *bo_va;
 	int r;
 
-	if (rdev->family < CHIP_CAYMAN) {
+	if ((rdev->family < CHIP_CAYMAN) ||
+	    (!rdev->accel_working)) {
 		return;
 	}
 
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index b3758de7009a..b63094746b50 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -594,14 +594,14 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 			return -ENOMEM;
 		}
 
-		vm = &fpriv->vm;
-		r = radeon_vm_init(rdev, vm);
-		if (r) {
-			kfree(fpriv);
-			return r;
-		}
-
 		if (rdev->accel_working) {
+			vm = &fpriv->vm;
+			r = radeon_vm_init(rdev, vm);
+			if (r) {
+				kfree(fpriv);
+				return r;
+			}
+
 			r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
 			if (r) {
 				radeon_vm_fini(rdev, vm);
@@ -659,9 +659,9 @@ void radeon_driver_postclose_kms(struct drm_device *dev,
 					radeon_vm_bo_rmv(rdev, vm->ib_bo_va);
 				radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
 			}
+			radeon_vm_fini(rdev, vm);
 		}
 
-		radeon_vm_fini(rdev, vm);
 		kfree(fpriv);
 		file_priv->driver_priv = NULL;
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 18/58] drm/radeon: properly set vm fragment size for TN/RL
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (16 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 17/58] drm/radeon: don't init gpuvm if accel is disabled (v3) Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 19/58] ARM: 8299/1: mm: ensure local active ASID is marked as allocated on rollover Luis Henriques
                   ` (39 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Alex Deucher, Luis Henriques

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

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

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

commit a124d068bf5be6be2ff4b9fab77b1b7509107e68 upstream.

Should be the same as cayman.  We don't use VM by default
on NI parts so this isn't critical.

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

diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index abf8e2c876ac..0f6f966a8e50 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -711,9 +711,11 @@ static void radeon_vm_frag_ptes(struct radeon_device *rdev,
 	 */
 
 	/* NI is optimized for 256KB fragments, SI and newer for 64KB */
-	uint64_t frag_flags = rdev->family == CHIP_CAYMAN ?
+	uint64_t frag_flags = ((rdev->family == CHIP_CAYMAN) ||
+			       (rdev->family == CHIP_ARUBA)) ?
 			R600_PTE_FRAG_256KB : R600_PTE_FRAG_64KB;
-	uint64_t frag_align = rdev->family == CHIP_CAYMAN ? 0x200 : 0x80;
+	uint64_t frag_align = ((rdev->family == CHIP_CAYMAN) ||
+			       (rdev->family == CHIP_ARUBA)) ? 0x200 : 0x80;
 
 	uint64_t frag_start = ALIGN(pe_start, frag_align);
 	uint64_t frag_end = pe_end & ~(frag_align - 1);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 19/58] ARM: 8299/1: mm: ensure local active ASID is marked as allocated on rollover
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (17 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 18/58] drm/radeon: properly set vm fragment size for TN/RL Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 20/58] ASoC: sgtl5000: add delay before first I2C access Luis Henriques
                   ` (38 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Will Deacon, Russell King, Luis Henriques

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

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

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

commit 8e64806672466392acf19e14427d1c29df3e58b9 upstream.

Commit e1a5848e3398 ("ARM: 7924/1: mm: don't bother with reserved ttbr0
when running with LPAE") removed the use of the reserved TTBR0 value
for LPAE systems, since the ASID is held in the TTBR and can be updated
atomicly with the pgd of the next mm.

Unfortunately, this patch forgot to update flush_context, which
deliberately avoids marking the local active ASID as allocated, since we
used to switch via ASID zero and didn't need to allocate the ASID of
the previous mm. The side-effect of this is that we can allocate the
same ASID to the next mm and, between flushing the local TLB and updating
TTBR0, we can perform speculative TLB fills for userspace nG mappings
using the page table of the previous mm.

The consequence of this is that the next mm can erroneously hit some
mappings of the previous mm. Note that this was made significantly
harder to hit by a391263cd84e ("ARM: 8203/1: mm: try to re-use old ASID
assignments following a rollover") but is still theoretically possible.

This patch fixes the problem by removing the code from flush_context
that forces the allocated ASID to zero for the local CPU. Many thanks
to the Broadcom guys for tracking this one down.

Fixes: e1a5848e3398 ("ARM: 7924/1: mm: don't bother with reserved ttbr0 when running with LPAE")

Reported-by: Raymond Ngun <rngun@broadcom.com>
Tested-by: Raymond Ngun <rngun@broadcom.com>
Reviewed-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/mm/context.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 6eb97b3a7481..4370933f16cd 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -144,21 +144,17 @@ static void flush_context(unsigned int cpu)
 	/* Update the list of reserved ASIDs and the ASID bitmap. */
 	bitmap_clear(asid_map, 0, NUM_USER_ASIDS);
 	for_each_possible_cpu(i) {
-		if (i == cpu) {
-			asid = 0;
-		} else {
-			asid = atomic64_xchg(&per_cpu(active_asids, i), 0);
-			/*
-			 * If this CPU has already been through a
-			 * rollover, but hasn't run another task in
-			 * the meantime, we must preserve its reserved
-			 * ASID, as this is the only trace we have of
-			 * the process it is still running.
-			 */
-			if (asid == 0)
-				asid = per_cpu(reserved_asids, i);
-			__set_bit(asid & ~ASID_MASK, asid_map);
-		}
+		asid = atomic64_xchg(&per_cpu(active_asids, i), 0);
+		/*
+		 * If this CPU has already been through a
+		 * rollover, but hasn't run another task in
+		 * the meantime, we must preserve its reserved
+		 * ASID, as this is the only trace we have of
+		 * the process it is still running.
+		 */
+		if (asid == 0)
+			asid = per_cpu(reserved_asids, i);
+		__set_bit(asid & ~ASID_MASK, asid_map);
 		per_cpu(reserved_asids, i) = asid;
 	}
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 20/58] ASoC: sgtl5000: add delay before first I2C access
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (18 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 19/58] ARM: 8299/1: mm: ensure local active ASID is marked as allocated on rollover Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 21/58] PCI: Handle read-only BARs on AMD CS553x devices Luis Henriques
                   ` (37 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Eric Nelson, Mark Brown, Luis Henriques

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

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

From: Eric Nelson <eric.nelson@boundarydevices.com>

commit 58cc9c9a175885bbf6bae3acf18233d0a8229a84 upstream.

To quote from section 1.3.1 of the data sheet:
	The SGTL5000 has an internal reset that is deasserted
	8 SYS_MCLK cycles after all power rails have been brought
	up. After this time, communication can start

	...
	1.0us represents 8 SYS_MCLK cycles at the minimum 8.0 MHz SYS_MCLK.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/soc/codecs/sgtl5000.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index f039d668266e..a62d340aa98a 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1463,6 +1463,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
 	if (ret)
 		return ret;
 
+	/* Need 8 clocks before I2C accesses */
+	udelay(1);
+
 	/* read chip information */
 	ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, &reg);
 	if (ret)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 21/58] PCI: Handle read-only BARs on AMD CS553x devices
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (19 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 20/58] ASoC: sgtl5000: add delay before first I2C access Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 22/58] ARM: dts: Fix I2S1, I2S2 compatible for exynos4 SoCs Luis Henriques
                   ` (36 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Myron Stowe, Bjorn Helgaas, Luis Henriques

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

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

From: Myron Stowe <myron.stowe@redhat.com>

commit 06cf35f903aa6da0cc8d9f81e9bcd1f7e1b534bb upstream.

Some AMD CS553x devices have read-only BARs because of a firmware or
hardware defect.  There's a workaround in quirk_cs5536_vsa(), but it no
longer works after 36e8164882ca ("PCI: Restore detection of read-only
BARs").  Prior to 36e8164882ca, we filled in res->start; afterwards we
leave it zeroed out.  The quirk only updated the size, so the driver tried
to use a region starting at zero, which didn't work.

Expand quirk_cs5536_vsa() to read the base addresses from the BARs and
hard-code the sizes.

On Nix's system BAR 2's read-only value is 0x6200.  Prior to 36e8164882ca,
we interpret that as a 512-byte BAR based on the lowest-order bit set.  Per
datasheet sec 5.6.1, that BAR (MFGPT) requires only 64 bytes; use that to
avoid clearing any address bits if a platform uses only 64-byte alignment.

[bhelgaas: changelog, reduce BAR 2 size to 64]
Fixes: 36e8164882ca ("PCI: Restore detection of read-only BARs")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=85991#c4
Link: http://support.amd.com/TechDocs/31506_cs5535_databook.pdf
Link: http://support.amd.com/TechDocs/33238G_cs5536_db.pdf
Reported-and-tested-by: Nix <nix@esperi.org.uk>
Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/pci/quirks.c | 40 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 37 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 293d2c2ccc55..6948f2379e16 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -324,18 +324,52 @@ static void quirk_s3_64M(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_868,		quirk_s3_64M);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3,	PCI_DEVICE_ID_S3_968,		quirk_s3_64M);
 
+static void quirk_io(struct pci_dev *dev, int pos, unsigned size,
+		     const char *name)
+{
+	u32 region;
+	struct pci_bus_region bus_region;
+	struct resource *res = dev->resource + pos;
+
+	pci_read_config_dword(dev, PCI_BASE_ADDRESS_0 + (pos << 2), &region);
+
+	if (!region)
+		return;
+
+	res->name = pci_name(dev);
+	res->flags = region & ~PCI_BASE_ADDRESS_IO_MASK;
+	res->flags |=
+		(IORESOURCE_IO | IORESOURCE_PCI_FIXED | IORESOURCE_SIZEALIGN);
+	region &= ~(size - 1);
+
+	/* Convert from PCI bus to resource space */
+	bus_region.start = region;
+	bus_region.end = region + size - 1;
+	pcibios_bus_to_resource(dev->bus, res, &bus_region);
+
+	dev_info(&dev->dev, FW_BUG "%s quirk: reg 0x%x: %pR\n",
+		 name, PCI_BASE_ADDRESS_0 + (pos << 2), res);
+}
+
 /*
  * Some CS5536 BIOSes (for example, the Soekris NET5501 board w/ comBIOS
  * ver. 1.33  20070103) don't set the correct ISA PCI region header info.
  * BAR0 should be 8 bytes; instead, it may be set to something like 8k
  * (which conflicts w/ BAR1's memory range).
+ *
+ * CS553x's ISA PCI BARs may also be read-only (ref:
+ * https://bugzilla.kernel.org/show_bug.cgi?id=85991 - Comment #4 forward).
  */
 static void quirk_cs5536_vsa(struct pci_dev *dev)
 {
+	static char *name = "CS5536 ISA bridge";
+
 	if (pci_resource_len(dev, 0) != 8) {
-		struct resource *res = &dev->resource[0];
-		res->end = res->start + 8 - 1;
-		dev_info(&dev->dev, "CS5536 ISA bridge bug detected (incorrect header); workaround applied\n");
+		quirk_io(dev, 0,   8, name);	/* SMB */
+		quirk_io(dev, 1, 256, name);	/* GPIO */
+		quirk_io(dev, 2,  64, name);	/* MFGPT */
+		dev_info(&dev->dev, "%s bug detected (incorrect header); workaround applied\n",
+			 name);
 	}
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_cs5536_vsa);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 22/58] ARM: dts: Fix I2S1, I2S2 compatible for exynos4 SoCs
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (20 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 21/58] PCI: Handle read-only BARs on AMD CS553x devices Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 23/58] mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range Luis Henriques
                   ` (35 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sylwester Nawrocki, Mark Brown, Luis Henriques

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

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

From: Sylwester Nawrocki <s.nawrocki@samsung.com>

commit fddcd300732dad5b822d27de7aa78998dca43162 upstream.

I2S1, I2S2 on Exynos4 SoC series have limited functionality compared
to I2S0, "samsung,s3c6410-i2s" compatible should be used for them.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/arm/boot/dts/exynos4.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 17b22e9cc2aa..e7c7b04abd99 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -334,7 +334,7 @@
 	};
 
 	i2s1: i2s@13960000 {
-		compatible = "samsung,s5pv210-i2s";
+		compatible = "samsung,s3c6410-i2s";
 		reg = <0x13960000 0x100>;
 		clocks = <&clock CLK_I2S1>;
 		clock-names = "iis";
@@ -344,7 +344,7 @@
 	};
 
 	i2s2: i2s@13970000 {
-		compatible = "samsung,s5pv210-i2s";
+		compatible = "samsung,s3c6410-i2s";
 		reg = <0x13970000 0x100>;
 		clocks = <&clock CLK_I2S2>;
 		clock-names = "iis";
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 23/58] mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (21 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 22/58] ARM: dts: Fix I2S1, I2S2 compatible for exynos4 SoCs Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 24/58] nilfs2: fix deadlock of segment constructor over I_SYNC flag Luis Henriques
                   ` (34 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Shiraz Hashim, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

From: Shiraz Hashim <shashim@codeaurora.org>

commit 23aaed6659df9adfabe9c583e67a36b54e21df46 upstream.

walk_page_range() silently skips vma having VM_PFNMAP set, which leads
to undesirable behaviour at client end (who called walk_page_range).
Userspace applications get the wrong data, so the effect is like just
confusing users (if the applications just display the data) or sometimes
killing the processes (if the applications do something with
misunderstanding virtual addresses due to the wrong data.)

For example for pagemap_read, when no callbacks are called against
VM_PFNMAP vma, pagemap_read may prepare pagemap data for next virtual
address range at wrong index.

Eventually userspace may get wrong pagemap data for a task.
Corresponding to a VM_PFNMAP marked vma region, kernel may report
mappings from subsequent vma regions.  User space in turn may account
more pages (than really are) to the task.

In my case I was using procmem, procrack (Android utility) which uses
pagemap interface to account RSS pages of a task.  Due to this bug it
was giving a wrong picture for vmas (with VM_PFNMAP set).

Fixes: a9ff785e4437 ("mm/pagewalk.c: walk_page_range should avoid VM_PFNMAP areas")
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/pagewalk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index 2beeabf502c5..9056d22d2880 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -199,7 +199,10 @@ int walk_page_range(unsigned long addr, unsigned long end,
 			 */
 			if ((vma->vm_start <= addr) &&
 			    (vma->vm_flags & VM_PFNMAP)) {
-				next = vma->vm_end;
+				if (walk->pte_hole)
+					err = walk->pte_hole(addr, next, walk);
+				if (err)
+					break;
 				pgd = pgd_offset(walk->mm, next);
 				continue;
 			}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 24/58] nilfs2: fix deadlock of segment constructor over I_SYNC flag
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (22 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 23/58] mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 25/58] ip: zero sockaddr returned on error queue Luis Henriques
                   ` (33 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ryusuke Konishi, Al Viro, Andrew Morton, Linus Torvalds, Luis Henriques

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

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

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

commit 7ef3ff2fea8bf5e4a21cef47ad87710a3d0fdb52 upstream.

Nilfs2 eventually hangs in a stress test with fsstress program.  This
issue was caused by the following deadlock over I_SYNC flag between
nilfs_segctor_thread() and writeback_sb_inodes():

  nilfs_segctor_thread()
    nilfs_segctor_thread_construct()
      nilfs_segctor_unlock()
        nilfs_dispose_list()
          iput()
            iput_final()
              evict()
                inode_wait_for_writeback()  * wait for I_SYNC flag

  writeback_sb_inodes()
     * set I_SYNC flag on inode->i_state
    __writeback_single_inode()
      do_writepages()
        nilfs_writepages()
          nilfs_construct_dsync_segment()
            nilfs_segctor_sync()
               * wait for completion of segment constructor
    inode_sync_complete()
       * clear I_SYNC flag after __writeback_single_inode() completed

writeback_sb_inodes() calls do_writepages() for dirty inodes after
setting I_SYNC flag on inode->i_state.  do_writepages() in turn calls
nilfs_writepages(), which can run segment constructor and wait for its
completion.  On the other hand, segment constructor calls iput(), which
can call evict() and wait for the I_SYNC flag on
inode_wait_for_writeback().

Since segment constructor doesn't know when I_SYNC will be set, it
cannot know whether iput() will block or not unless inode->i_nlink has a
non-zero count.  We can prevent evict() from being called in iput() by
implementing sop->drop_inode(), but it's not preferable to leave inodes
with i_nlink == 0 for long periods because it even defers file
truncation and inode deallocation.  So, this instead resolves the
deadlock by calling iput() asynchronously with a workqueue for inodes
with i_nlink == 0.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/nilfs2/nilfs.h   |  2 --
 fs/nilfs2/segment.c | 44 +++++++++++++++++++++++++++++++++++++++-----
 fs/nilfs2/segment.h |  5 +++++
 3 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h
index 9bc72dec3fa6..b02c202223a6 100644
--- a/fs/nilfs2/nilfs.h
+++ b/fs/nilfs2/nilfs.h
@@ -141,7 +141,6 @@ enum {
  * @ti_save: Backup of journal_info field of task_struct
  * @ti_flags: Flags
  * @ti_count: Nest level
- * @ti_garbage:	List of inode to be put when releasing semaphore
  */
 struct nilfs_transaction_info {
 	u32			ti_magic;
@@ -150,7 +149,6 @@ struct nilfs_transaction_info {
 				   one of other filesystems has a bug. */
 	unsigned short		ti_flags;
 	unsigned short		ti_count;
-	struct list_head	ti_garbage;
 };
 
 /* ti_magic */
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index a1a191634abc..5bee81674d53 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -305,7 +305,6 @@ static void nilfs_transaction_lock(struct super_block *sb,
 	ti->ti_count = 0;
 	ti->ti_save = cur_ti;
 	ti->ti_magic = NILFS_TI_MAGIC;
-	INIT_LIST_HEAD(&ti->ti_garbage);
 	current->journal_info = ti;
 
 	for (;;) {
@@ -332,8 +331,6 @@ static void nilfs_transaction_unlock(struct super_block *sb)
 
 	up_write(&nilfs->ns_segctor_sem);
 	current->journal_info = ti->ti_save;
-	if (!list_empty(&ti->ti_garbage))
-		nilfs_dispose_list(nilfs, &ti->ti_garbage, 0);
 }
 
 static void *nilfs_segctor_map_segsum_entry(struct nilfs_sc_info *sci,
@@ -746,6 +743,15 @@ static void nilfs_dispose_list(struct the_nilfs *nilfs,
 	}
 }
 
+static void nilfs_iput_work_func(struct work_struct *work)
+{
+	struct nilfs_sc_info *sci = container_of(work, struct nilfs_sc_info,
+						 sc_iput_work);
+	struct the_nilfs *nilfs = sci->sc_super->s_fs_info;
+
+	nilfs_dispose_list(nilfs, &sci->sc_iput_queue, 0);
+}
+
 static int nilfs_test_metadata_dirty(struct the_nilfs *nilfs,
 				     struct nilfs_root *root)
 {
@@ -1899,8 +1905,8 @@ static int nilfs_segctor_collect_dirty_files(struct nilfs_sc_info *sci,
 static void nilfs_segctor_drop_written_files(struct nilfs_sc_info *sci,
 					     struct the_nilfs *nilfs)
 {
-	struct nilfs_transaction_info *ti = current->journal_info;
 	struct nilfs_inode_info *ii, *n;
+	int defer_iput = false;
 
 	spin_lock(&nilfs->ns_inode_lock);
 	list_for_each_entry_safe(ii, n, &sci->sc_dirty_files, i_dirty) {
@@ -1911,9 +1917,24 @@ static void nilfs_segctor_drop_written_files(struct nilfs_sc_info *sci,
 		clear_bit(NILFS_I_BUSY, &ii->i_state);
 		brelse(ii->i_bh);
 		ii->i_bh = NULL;
-		list_move_tail(&ii->i_dirty, &ti->ti_garbage);
+		list_del_init(&ii->i_dirty);
+		if (!ii->vfs_inode.i_nlink) {
+			/*
+			 * Defer calling iput() to avoid a deadlock
+			 * over I_SYNC flag for inodes with i_nlink == 0
+			 */
+			list_add_tail(&ii->i_dirty, &sci->sc_iput_queue);
+			defer_iput = true;
+		} else {
+			spin_unlock(&nilfs->ns_inode_lock);
+			iput(&ii->vfs_inode);
+			spin_lock(&nilfs->ns_inode_lock);
+		}
 	}
 	spin_unlock(&nilfs->ns_inode_lock);
+
+	if (defer_iput)
+		schedule_work(&sci->sc_iput_work);
 }
 
 /*
@@ -2580,6 +2601,8 @@ static struct nilfs_sc_info *nilfs_segctor_new(struct super_block *sb,
 	INIT_LIST_HEAD(&sci->sc_segbufs);
 	INIT_LIST_HEAD(&sci->sc_write_logs);
 	INIT_LIST_HEAD(&sci->sc_gc_inodes);
+	INIT_LIST_HEAD(&sci->sc_iput_queue);
+	INIT_WORK(&sci->sc_iput_work, nilfs_iput_work_func);
 	init_timer(&sci->sc_timer);
 
 	sci->sc_interval = HZ * NILFS_SC_DEFAULT_TIMEOUT;
@@ -2606,6 +2629,8 @@ static void nilfs_segctor_write_out(struct nilfs_sc_info *sci)
 		ret = nilfs_segctor_construct(sci, SC_LSEG_SR);
 		nilfs_transaction_unlock(sci->sc_super);
 
+		flush_work(&sci->sc_iput_work);
+
 	} while (ret && retrycount-- > 0);
 }
 
@@ -2630,6 +2655,9 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
 		|| sci->sc_seq_request != sci->sc_seq_done);
 	spin_unlock(&sci->sc_state_lock);
 
+	if (flush_work(&sci->sc_iput_work))
+		flag = true;
+
 	if (flag || !nilfs_segctor_confirm(sci))
 		nilfs_segctor_write_out(sci);
 
@@ -2639,6 +2667,12 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
 		nilfs_dispose_list(nilfs, &sci->sc_dirty_files, 1);
 	}
 
+	if (!list_empty(&sci->sc_iput_queue)) {
+		nilfs_warning(sci->sc_super, __func__,
+			      "iput queue is not empty\n");
+		nilfs_dispose_list(nilfs, &sci->sc_iput_queue, 1);
+	}
+
 	WARN_ON(!list_empty(&sci->sc_segbufs));
 	WARN_ON(!list_empty(&sci->sc_write_logs));
 
diff --git a/fs/nilfs2/segment.h b/fs/nilfs2/segment.h
index 38a1d0013314..a48d6de1e02c 100644
--- a/fs/nilfs2/segment.h
+++ b/fs/nilfs2/segment.h
@@ -26,6 +26,7 @@
 #include <linux/types.h>
 #include <linux/fs.h>
 #include <linux/buffer_head.h>
+#include <linux/workqueue.h>
 #include <linux/nilfs2_fs.h>
 #include "nilfs.h"
 
@@ -92,6 +93,8 @@ struct nilfs_segsum_pointer {
  * @sc_nblk_inc: Block count of current generation
  * @sc_dirty_files: List of files to be written
  * @sc_gc_inodes: List of GC inodes having blocks to be written
+ * @sc_iput_queue: list of inodes for which iput should be done
+ * @sc_iput_work: work struct to defer iput call
  * @sc_freesegs: array of segment numbers to be freed
  * @sc_nfreesegs: number of segments on @sc_freesegs
  * @sc_dsync_inode: inode whose data pages are written for a sync operation
@@ -135,6 +138,8 @@ struct nilfs_sc_info {
 
 	struct list_head	sc_dirty_files;
 	struct list_head	sc_gc_inodes;
+	struct list_head	sc_iput_queue;
+	struct work_struct	sc_iput_work;
 
 	__u64		       *sc_freesegs;
 	size_t			sc_nfreesegs;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 25/58] ip: zero sockaddr returned on error queue
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (23 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 24/58] nilfs2: fix deadlock of segment constructor over I_SYNC flag Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 26/58] net: rps: fix cpu unplug Luis Henriques
                   ` (32 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Willem de Bruijn, David S. Miller, Luis Henriques

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

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

From: Willem de Bruijn <willemb@google.com>

commit f812116b174e59a350acc8e4856213a166a91222 upstream.

The sockaddr is returned in IP(V6)_RECVERR as part of errhdr. That
structure is defined and allocated on the stack as

    struct {
            struct sock_extended_err ee;
            struct sockaddr_in(6)    offender;
    } errhdr;

The second part is only initialized for certain SO_EE_ORIGIN values.
Always initialize it completely.

An MTU exceeded error on a SOCK_RAW/IPPROTO_RAW is one example that
would return uninitialized bytes.

Signed-off-by: Willem de Bruijn <willemb@google.com>

----

Also verified that there is no padding between errhdr.ee and
errhdr.offender that could leak additional kernel data.
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: based on davem's backport to 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ip_sockglue.c |  8 ++------
 net/ipv6/datagram.c    | 10 +++-------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 94f1f15cf834..7aa584c36c15 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -443,15 +443,11 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
 
 	memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err));
 	sin = &errhdr.offender;
-	sin->sin_family = AF_UNSPEC;
+	memset(sin, 0, sizeof(*sin));
 	if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP) {
-		struct inet_sock *inet = inet_sk(sk);
-
 		sin->sin_family = AF_INET;
 		sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
-		sin->sin_port = 0;
-		memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
-		if (inet->cmsg_flags)
+		if (inet_sk(sk)->cmsg_flags)
 			ip_cmsg_recv(msg, skb);
 	}
 
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index c3bf2d2e519e..841cfa2c4600 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -382,11 +382,10 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
 
 	memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err));
 	sin = &errhdr.offender;
-	sin->sin6_family = AF_UNSPEC;
+	memset(sin, 0, sizeof(*sin));
+
 	if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) {
 		sin->sin6_family = AF_INET6;
-		sin->sin6_flowinfo = 0;
-		sin->sin6_port = 0;
 		if (np->rxopt.all)
 			ip6_datagram_recv_common_ctl(sk, msg, skb);
 		if (skb->protocol == htons(ETH_P_IPV6)) {
@@ -397,12 +396,9 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
 				ipv6_iface_scope_id(&sin->sin6_addr,
 						    IP6CB(skb)->iif);
 		} else {
-			struct inet_sock *inet = inet_sk(sk);
-
 			ipv6_addr_set_v4mapped(ip_hdr(skb)->saddr,
 					       &sin->sin6_addr);
-			sin->sin6_scope_id = 0;
-			if (inet->cmsg_flags)
+			if (inet_sk(sk)->cmsg_flags)
 				ip_cmsg_recv(msg, skb);
 		}
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 26/58] net: rps: fix cpu unplug
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (24 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 25/58] ip: zero sockaddr returned on error queue Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 27/58] ipv6: stop sending PTB packets for MTU < 1280 Luis Henriques
                   ` (31 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, Tom Herbert, David S. Miller, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit ac64da0b83d82abe62f78b3d0e21cca31aea24fa upstream.

softnet_data.input_pkt_queue is protected by a spinlock that
we must hold when transferring packets from victim queue to an active
one. This is because other cpus could still be trying to enqueue packets
into victim queue.

A second problem is that when we transfert the NAPI poll_list from
victim to current cpu, we absolutely need to special case the percpu
backlog, because we do not want to add complex locking to protect
process_queue : Only owner cpu is allowed to manipulate it, unless cpu
is offline.

Based on initial patch from Prasad Sodagudi & Subash Abhinov
Kasiviswanathan.

This version is better because we do not slow down packet processing,
only make migration safer.

Reported-by: Prasad Sodagudi <psodagud@codeaurora.org>
Reported-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/dev.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 2d93b9de1d7b..efcc7f4b4fc7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6903,10 +6903,20 @@ static int dev_cpu_callback(struct notifier_block *nfb,
 		oldsd->output_queue = NULL;
 		oldsd->output_queue_tailp = &oldsd->output_queue;
 	}
-	/* Append NAPI poll list from offline CPU. */
-	if (!list_empty(&oldsd->poll_list)) {
-		list_splice_init(&oldsd->poll_list, &sd->poll_list);
-		raise_softirq_irqoff(NET_RX_SOFTIRQ);
+	/* Append NAPI poll list from offline CPU, with one exception :
+	 * process_backlog() must be called by cpu owning percpu backlog.
+	 * We properly handle process_queue & input_pkt_queue later.
+	 */
+	while (!list_empty(&oldsd->poll_list)) {
+		struct napi_struct *napi = list_first_entry(&oldsd->poll_list,
+							    struct napi_struct,
+							    poll_list);
+
+		list_del_init(&napi->poll_list);
+		if (napi->poll == process_backlog)
+			napi->state = 0;
+		else
+			____napi_schedule(sd, napi);
 	}
 
 	raise_softirq_irqoff(NET_TX_SOFTIRQ);
@@ -6917,7 +6927,7 @@ static int dev_cpu_callback(struct notifier_block *nfb,
 		netif_rx_internal(skb);
 		input_queue_head_incr(oldsd);
 	}
-	while ((skb = __skb_dequeue(&oldsd->input_pkt_queue))) {
+	while ((skb = skb_dequeue(&oldsd->input_pkt_queue))) {
 		netif_rx_internal(skb);
 		input_queue_head_incr(oldsd);
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 27/58] ipv6: stop sending PTB packets for MTU < 1280
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (25 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 26/58] net: rps: fix cpu unplug Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 28/58] netxen: fix netxen_nic_poll() logic Luis Henriques
                   ` (30 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Fernando Gont, Hagen Paul Pfeifer, David S. Miller, Luis Henriques

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

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

From: Hagen Paul Pfeifer <hagen@jauu.net>

commit 9d289715eb5c252ae15bd547cb252ca547a3c4f2 upstream.

Reduce the attack vector and stop generating IPv6 Fragment Header for
paths with an MTU smaller than the minimum required IPv6 MTU
size (1280 byte) - called atomic fragments.

See IETF I-D "Deprecating the Generation of IPv6 Atomic Fragments" [1]
for more information and how this "feature" can be misused.

[1] https://tools.ietf.org/html/draft-ietf-6man-deprecate-atomfrag-generation-00

Signed-off-by: Fernando Gont <fgont@si6networks.com>
Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv6/route.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index bafde82324c5..920616d05758 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1152,12 +1152,9 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
 		struct net *net = dev_net(dst->dev);
 
 		rt6->rt6i_flags |= RTF_MODIFIED;
-		if (mtu < IPV6_MIN_MTU) {
-			u32 features = dst_metric(dst, RTAX_FEATURES);
+		if (mtu < IPV6_MIN_MTU)
 			mtu = IPV6_MIN_MTU;
-			features |= RTAX_FEATURE_ALLFRAG;
-			dst_metric_set(dst, RTAX_FEATURES, features);
-		}
+
 		dst_metric_set(dst, RTAX_MTU, mtu);
 		rt6_update_expires(rt6, net->ipv6.sysctl.ip6_rt_mtu_expires);
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 28/58] netxen: fix netxen_nic_poll() logic
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (26 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 27/58] ipv6: stop sending PTB packets for MTU < 1280 Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 29/58] udp_diag: Fix socket skipping within chain Luis Henriques
                   ` (29 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, Manish Chopra, David S. Miller, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit 6088beef3f7517717bd21d90b379714dd0837079 upstream.

NAPI poll logic now enforces that a poller returns exactly the budget
when it wants to be called again.

If a driver limits TX completion, it has to return budget as well when
the limit is hit, not the number of received packets.

Reported-and-tested-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: d75b1ade567f ("net: less interrupt masking in NAPI")
Cc: Manish Chopra <manish.chopra@qlogic.com>
Acked-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 5bf05818a12c..87acca703658 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2391,7 +2391,10 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
 
 	work_done = netxen_process_rcv_ring(sds_ring, budget);
 
-	if ((work_done < budget) && tx_complete) {
+	if (!tx_complete)
+		work_done = budget;
+
+	if (work_done < budget) {
 		napi_complete(&sds_ring->napi);
 		if (test_bit(__NX_DEV_UP, &adapter->state))
 			netxen_nic_enable_int(sds_ring);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 29/58] udp_diag: Fix socket skipping within chain
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (27 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 28/58] netxen: fix netxen_nic_poll() logic Luis Henriques
@ 2015-02-19 13:51 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 30/58] ping: Fix race in free in receive path Luis Henriques
                   ` (28 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:51 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Herbert Xu, David S. Miller, Luis Henriques

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

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

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

commit 86f3cddbc3037882414c7308973530167906b7e9 upstream.

While working on rhashtable walking I noticed that the UDP diag
dumping code is buggy.  In particular, the socket skipping within
a chain never happens, even though we record the number of sockets
that should be skipped.

As this code was supposedly copied from TCP, this patch does what
TCP does and resets num before we walk a chain.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/udp_diag.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index 7927db0a9279..4a000f1dd757 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -99,11 +99,13 @@ static void udp_dump(struct udp_table *table, struct sk_buff *skb, struct netlin
 	s_slot = cb->args[0];
 	num = s_num = cb->args[1];
 
-	for (slot = s_slot; slot <= table->mask; num = s_num = 0, slot++) {
+	for (slot = s_slot; slot <= table->mask; s_num = 0, slot++) {
 		struct sock *sk;
 		struct hlist_nulls_node *node;
 		struct udp_hslot *hslot = &table->hash[slot];
 
+		num = 0;
+
 		if (hlist_nulls_empty(&hslot->head))
 			continue;
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 30/58] ping: Fix race in free in receive path
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (28 preceding siblings ...)
  2015-02-19 13:51 ` [PATCH 3.16.y-ckt 29/58] udp_diag: Fix socket skipping within chain Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 31/58] ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos too Luis Henriques
                   ` (27 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Subash Abhinov Kasiviswanathan, Eric Dumazet, David S. Miller,
	Luis Henriques

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

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

From: "subashab@codeaurora.org" <subashab@codeaurora.org>

commit fc752f1f43c1c038a2c6ae58cc739ebb5953ccb0 upstream.

An exception is seen in ICMP ping receive path where the skb
destructor sock_rfree() tries to access a freed socket. This happens
because ping_rcv() releases socket reference with sock_put() and this
internally frees up the socket. Later icmp_rcv() will try to free the
skb and as part of this, skb destructor is called and which leads
to a kernel panic as the socket is freed already in ping_rcv().

-->|exception
-007|sk_mem_uncharge
-007|sock_rfree
-008|skb_release_head_state
-009|skb_release_all
-009|__kfree_skb
-010|kfree_skb
-011|icmp_rcv
-012|ip_local_deliver_finish

Fix this incorrect free by cloning this skb and processing this cloned
skb instead.

This patch was suggested by Eric Dumazet

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ping.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 620e8ffa62e8..7dec0787b4a2 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -973,8 +973,11 @@ void ping_rcv(struct sk_buff *skb)
 
 	sk = ping_lookup(net, skb, ntohs(icmph->un.echo.id));
 	if (sk != NULL) {
+		struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
+
 		pr_debug("rcv on socket %p\n", sk);
-		ping_queue_rcv_skb(sk, skb_get(skb));
+		if (skb2)
+			ping_queue_rcv_skb(sk, skb2);
 		sock_put(sk);
 		return;
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 31/58] ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos too
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (29 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 30/58] ping: Fix race in free in receive path Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 32/58] bnx2x: fix napi poll return value for repoll Luis Henriques
                   ` (26 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Hannes Frederic Sowa, David S. Miller, Luis Henriques

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

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

From: Hannes Frederic Sowa <hannes@stressinduktion.org>

commit 6e9e16e6143b725662e47026a1d0f270721cdd24 upstream.

Lubomir Rintel reported that during replacing a route the interface
reference counter isn't correctly decremented.

To quote bug <https://bugzilla.kernel.org/show_bug.cgi?id=91941>:
| [root@rhel7-5 lkundrak]# sh -x lal
| + ip link add dev0 type dummy
| + ip link set dev0 up
| + ip link add dev1 type dummy
| + ip link set dev1 up
| + ip addr add 2001:db8:8086::2/64 dev dev0
| + ip route add 2001:db8:8086::/48 dev dev0 proto static metric 20
| + ip route add 2001:db8:8088::/48 dev dev1 proto static metric 10
| + ip route replace 2001:db8:8086::/48 dev dev1 proto static metric 20
| + ip link del dev0 type dummy
| Message from syslogd@rhel7-5 at Jan 23 10:54:41 ...
|  kernel:unregister_netdevice: waiting for dev0 to become free. Usage count = 2
|
| Message from syslogd@rhel7-5 at Jan 23 10:54:51 ...
|  kernel:unregister_netdevice: waiting for dev0 to become free. Usage count = 2

During replacement of a rt6_info we must walk all parent nodes and check
if the to be replaced rt6_info got propagated. If so, replace it with
an alive one.

Fixes: 4a287eba2de3957 ("IPv6 routing, NLM_F_* flag support: REPLACE and EXCL flags support, warn about missing CREATE flag")
Reported-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv6/ip6_fib.c | 45 ++++++++++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 19 deletions(-)

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 97b9fa8de377..4bffae914120 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -662,6 +662,29 @@ static int fib6_commit_metrics(struct dst_entry *dst,
 	return 0;
 }
 
+static void fib6_purge_rt(struct rt6_info *rt, struct fib6_node *fn,
+			  struct net *net)
+{
+	if (atomic_read(&rt->rt6i_ref) != 1) {
+		/* This route is used as dummy address holder in some split
+		 * nodes. It is not leaked, but it still holds other resources,
+		 * which must be released in time. So, scan ascendant nodes
+		 * and replace dummy references to this route with references
+		 * to still alive ones.
+		 */
+		while (fn) {
+			if (!(fn->fn_flags & RTN_RTINFO) && fn->leaf == rt) {
+				fn->leaf = fib6_find_prefix(net, fn);
+				atomic_inc(&fn->leaf->rt6i_ref);
+				rt6_release(rt);
+			}
+			fn = fn->parent;
+		}
+		/* No more references are possible at this point. */
+		BUG_ON(atomic_read(&rt->rt6i_ref) != 1);
+	}
+}
+
 /*
  *	Insert routing information in a node.
  */
@@ -810,11 +833,12 @@ add:
 		rt->dst.rt6_next = iter->dst.rt6_next;
 		atomic_inc(&rt->rt6i_ref);
 		inet6_rt_notify(RTM_NEWROUTE, rt, info);
-		rt6_release(iter);
 		if (!(fn->fn_flags & RTN_RTINFO)) {
 			info->nl_net->ipv6.rt6_stats->fib_route_nodes++;
 			fn->fn_flags |= RTN_RTINFO;
 		}
+		fib6_purge_rt(iter, fn, info->nl_net);
+		rt6_release(iter);
 	}
 
 	return 0;
@@ -1324,24 +1348,7 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
 		fn = fib6_repair_tree(net, fn);
 	}
 
-	if (atomic_read(&rt->rt6i_ref) != 1) {
-		/* This route is used as dummy address holder in some split
-		 * nodes. It is not leaked, but it still holds other resources,
-		 * which must be released in time. So, scan ascendant nodes
-		 * and replace dummy references to this route with references
-		 * to still alive ones.
-		 */
-		while (fn) {
-			if (!(fn->fn_flags & RTN_RTINFO) && fn->leaf == rt) {
-				fn->leaf = fib6_find_prefix(net, fn);
-				atomic_inc(&fn->leaf->rt6i_ref);
-				rt6_release(rt);
-			}
-			fn = fn->parent;
-		}
-		/* No more references are possible at this point. */
-		BUG_ON(atomic_read(&rt->rt6i_ref) != 1);
-	}
+	fib6_purge_rt(rt, fn, net);
 
 	inet6_rt_notify(RTM_DELROUTE, rt, info);
 	rt6_release(rt);
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 32/58] bnx2x: fix napi poll return value for repoll
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (30 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 31/58] ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos too Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 33/58] net: don't OOPS on socket aio Luis Henriques
                   ` (25 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Govindarajulu Varadarajan, David S. Miller, Luis Henriques

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

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

From: Govindarajulu Varadarajan <_govind@gmx.com>

commit 24e579c8898aa641ede3149234906982290934e5 upstream.

With the commit d75b1ade567ffab ("net: less interrupt masking in NAPI") napi
repoll is done only when work_done == budget. When in busy_poll is we return 0
in napi_poll. We should return budget.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index c43e7238de21..343511988683 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3152,7 +3152,7 @@ static int bnx2x_poll(struct napi_struct *napi, int budget)
 		}
 #endif
 		if (!bnx2x_fp_lock_napi(fp))
-			return work_done;
+			return budget;
 
 		for_each_cos_in_tx_queue(fp, cos)
 			if (bnx2x_tx_queue_has_work(fp->txdata_ptr[cos]))
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 33/58] net: don't OOPS on socket aio
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (31 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 32/58] bnx2x: fix napi poll return value for repoll Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 34/58] bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify Luis Henriques
                   ` (24 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Christoph Hellwig, David S. Miller, Luis Henriques

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

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

From: Christoph Hellwig <hch@lst.de>

commit 06539d3071067ff146a9bffd1c801fa56d290909 upstream.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/socket.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index abf56b2a14f9..7050240a951b 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -887,9 +887,6 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
 static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb,
 					 struct sock_iocb *siocb)
 {
-	if (!is_sync_kiocb(iocb))
-		BUG();
-
 	siocb->kiocb = iocb;
 	iocb->private = siocb;
 	return siocb;
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 34/58] bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (32 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 33/58] net: don't OOPS on socket aio Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 35/58] tcp: ipv4: initialize unicast_sock sk_pacing_rate Luis Henriques
                   ` (23 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Roopa Prabhu, David S. Miller, Luis Henriques

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

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

From: Roopa Prabhu <roopa@cumulusnetworks.com>

commit 59ccaaaa49b5b096cdc1f16706a9f931416b2332 upstream.

Reported in: https://bugzilla.kernel.org/show_bug.cgi?id=92081

This patch avoids calling rtnl_notify if the device ndo_bridge_getlink
handler does not return any bytes in the skb.

Alternately, the skb->len check can be moved inside rtnl_notify.

For the bridge vlan case described in 92081, there is also a fix needed
in bridge driver to generate a proper notification. Will fix that in
subsequent patch.

v2: rebase patch on net tree

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/core/rtnetlink.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 48c2be43f856..2128423f8a7c 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2690,12 +2690,16 @@ static int rtnl_bridge_notify(struct net_device *dev, u16 flags)
 			goto errout;
 	}
 
+	if (!skb->len)
+		goto errout;
+
 	rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
 	return 0;
 errout:
 	WARN_ON(err == -EMSGSIZE);
 	kfree_skb(skb);
-	rtnl_set_sk_err(net, RTNLGRP_LINK, err);
+	if (err)
+		rtnl_set_sk_err(net, RTNLGRP_LINK, err);
 	return err;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 35/58] tcp: ipv4: initialize unicast_sock sk_pacing_rate
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (33 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 34/58] bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 36/58] ipv4: tcp: get rid of ugly unicast_sock Luis Henriques
                   ` (22 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, David S. Miller, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit 811230cd853d62f09ed0addd0ce9a1b9b0e13fb5 upstream.

When I added sk_pacing_rate field, I forgot to initialize its value
in the per cpu unicast_sock used in ip_send_unicast_reply()

This means that for sch_fq users, RST packets, or ACK packets sent
on behalf of TIME_WAIT sockets might be sent to slowly or even dropped
once we reach the per flow limit.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: 95bd09eb2750 ("tcp: TSO packets automatic sizing")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/ipv4/ip_output.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index a0ded0ba16ae..34ee97c6aced 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1512,6 +1512,7 @@ static DEFINE_PER_CPU(struct inet_sock, unicast_sock) = {
 		.sk_wmem_alloc	= ATOMIC_INIT(1),
 		.sk_allocation	= GFP_ATOMIC,
 		.sk_flags	= (1UL << SOCK_USE_WRITE_QUEUE),
+		.sk_pacing_rate = ~0U,
 	},
 	.pmtudisc	= IP_PMTUDISC_WANT,
 	.uc_ttl		= -1,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 36/58] ipv4: tcp: get rid of ugly unicast_sock
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (34 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 35/58] tcp: ipv4: initialize unicast_sock sk_pacing_rate Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 37/58] ppp: deflate: never return len larger than output buffer Luis Henriques
                   ` (21 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Eric Dumazet, David S. Miller, Luis Henriques

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

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

From: Eric Dumazet <edumazet@google.com>

commit bdbbb8527b6f6a358dbcb70dac247034d665b8e4 upstream.

In commit be9f4a44e7d41 ("ipv4: tcp: remove per net tcp_sock")
I tried to address contention on a socket lock, but the solution
I chose was horrible :

commit 3a7c384ffd57e ("ipv4: tcp: unicast_sock should not land outside
of TCP stack") addressed a selinux regression.

commit 0980e56e506b ("ipv4: tcp: set unicast_sock uc_ttl to -1")
took care of another regression.

commit b5ec8eeac46 ("ipv4: fix ip_send_skb()") fixed another regression.

commit 811230cd85 ("tcp: ipv4: initialize unicast_sock sk_pacing_rate")
was another shot in the dark.

Really, just use a proper socket per cpu, and remove the skb_orphan()
call, to re-enable flow control.

This solves a serious problem with FQ packet scheduler when used in
hostile environments, as we do not want to allocate a flow structure
for every RST packet sent in response to a spoofed packet.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.16: based on davem's backport to 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 include/net/ip.h         |  2 +-
 include/net/netns/ipv4.h |  1 +
 net/ipv4/ip_output.c     | 30 +++---------------------------
 net/ipv4/tcp_ipv4.c      | 37 ++++++++++++++++++++++++++++++++-----
 4 files changed, 37 insertions(+), 33 deletions(-)

diff --git a/include/net/ip.h b/include/net/ip.h
index 3e8f0b32d31b..fdef22d88203 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -180,7 +180,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
 	return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0;
 }
 
-void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
+void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
 			   __be32 saddr, const struct ip_reply_arg *arg,
 			   unsigned int len);
 
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index aec5e12f9f19..80a1c572b9a0 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -52,6 +52,7 @@ struct netns_ipv4 {
 	struct inet_peer_base	*peers;
 	struct tcpm_hash_bucket	*tcp_metrics_hash;
 	unsigned int		tcp_metrics_hash_log;
+	struct sock  * __percpu	*tcp_sk;
 	struct netns_frags	frags;
 #ifdef CONFIG_NETFILTER
 	struct xt_table		*iptable_filter;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 34ee97c6aced..4aca72f52636 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1501,24 +1501,8 @@ static int ip_reply_glue_bits(void *dptr, char *to, int offset,
 /*
  *	Generic function to send a packet as reply to another packet.
  *	Used to send some TCP resets/acks so far.
- *
- *	Use a fake percpu inet socket to avoid false sharing and contention.
  */
-static DEFINE_PER_CPU(struct inet_sock, unicast_sock) = {
-	.sk = {
-		.__sk_common = {
-			.skc_refcnt = ATOMIC_INIT(1),
-		},
-		.sk_wmem_alloc	= ATOMIC_INIT(1),
-		.sk_allocation	= GFP_ATOMIC,
-		.sk_flags	= (1UL << SOCK_USE_WRITE_QUEUE),
-		.sk_pacing_rate = ~0U,
-	},
-	.pmtudisc	= IP_PMTUDISC_WANT,
-	.uc_ttl		= -1,
-};
-
-void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
+void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
 			   __be32 saddr, const struct ip_reply_arg *arg,
 			   unsigned int len)
 {
@@ -1526,9 +1510,8 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
 	struct ipcm_cookie ipc;
 	struct flowi4 fl4;
 	struct rtable *rt = skb_rtable(skb);
+	struct net *net = sock_net(sk);
 	struct sk_buff *nskb;
-	struct sock *sk;
-	struct inet_sock *inet;
 	int err;
 
 	if (ip_options_echo(&replyopts.opt.opt, skb))
@@ -1559,15 +1542,11 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
 	if (IS_ERR(rt))
 		return;
 
-	inet = &get_cpu_var(unicast_sock);
+	inet_sk(sk)->tos = arg->tos;
 
-	inet->tos = arg->tos;
-	sk = &inet->sk;
 	sk->sk_priority = skb->priority;
 	sk->sk_protocol = ip_hdr(skb)->protocol;
 	sk->sk_bound_dev_if = arg->bound_dev_if;
-	sock_net_set(sk, net);
-	__skb_queue_head_init(&sk->sk_write_queue);
 	sk->sk_sndbuf = sysctl_wmem_default;
 	err = ip_append_data(sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base,
 			     len, 0, &ipc, &rt, MSG_DONTWAIT);
@@ -1583,13 +1562,10 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
 			  arg->csumoffset) = csum_fold(csum_add(nskb->csum,
 								arg->csum));
 		nskb->ip_summed = CHECKSUM_NONE;
-		skb_orphan(nskb);
 		skb_set_queue_mapping(nskb, skb_get_queue_mapping(skb));
 		ip_push_pending_frames(sk, &fl4);
 	}
 out:
-	put_cpu_var(unicast_sock);
-
 	ip_rt_put(rt);
 }
 
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index f63c524de5d9..ac7752f4f777 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -684,7 +684,8 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
 
 	net = dev_net(skb_dst(skb)->dev);
 	arg.tos = ip_hdr(skb)->tos;
-	ip_send_unicast_reply(net, skb, ip_hdr(skb)->saddr,
+	ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk),
+			      skb, ip_hdr(skb)->saddr,
 			      ip_hdr(skb)->daddr, &arg, arg.iov[0].iov_len);
 
 	TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
@@ -767,7 +768,8 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
 	if (oif)
 		arg.bound_dev_if = oif;
 	arg.tos = tos;
-	ip_send_unicast_reply(net, skb, ip_hdr(skb)->saddr,
+	ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk),
+			      skb, ip_hdr(skb)->saddr,
 			      ip_hdr(skb)->daddr, &arg, arg.iov[0].iov_len);
 
 	TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
@@ -2532,14 +2534,39 @@ struct proto tcp_prot = {
 };
 EXPORT_SYMBOL(tcp_prot);
 
+static void __net_exit tcp_sk_exit(struct net *net)
+{
+	int cpu;
+
+	for_each_possible_cpu(cpu)
+		inet_ctl_sock_destroy(*per_cpu_ptr(net->ipv4.tcp_sk, cpu));
+	free_percpu(net->ipv4.tcp_sk);
+}
+
 static int __net_init tcp_sk_init(struct net *net)
 {
+	int res, cpu;
+
+	net->ipv4.tcp_sk = alloc_percpu(struct sock *);
+	if (!net->ipv4.tcp_sk)
+		return -ENOMEM;
+
+	for_each_possible_cpu(cpu) {
+		struct sock *sk;
+
+		res = inet_ctl_sock_create(&sk, PF_INET, SOCK_RAW,
+					   IPPROTO_TCP, net);
+		if (res)
+			goto fail;
+		*per_cpu_ptr(net->ipv4.tcp_sk, cpu) = sk;
+	}
 	net->ipv4.sysctl_tcp_ecn = 2;
 	return 0;
-}
 
-static void __net_exit tcp_sk_exit(struct net *net)
-{
+fail:
+	tcp_sk_exit(net);
+
+	return res;
 }
 
 static void __net_exit tcp_sk_exit_batch(struct list_head *net_exit_list)
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 37/58] ppp: deflate: never return len larger than output buffer
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (35 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 36/58] ipv4: tcp: get rid of ugly unicast_sock Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 38/58] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param Luis Henriques
                   ` (20 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Florian Westphal, David S. Miller, Luis Henriques

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

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

From: Florian Westphal <fw@strlen.de>

commit e2a4800e75780ccf4e6c2487f82b688ba736eb18 upstream.

When we've run out of space in the output buffer to store more data, we
will call zlib_deflate with a NULL output buffer until we've consumed
remaining input.

When this happens, olen contains the size the output buffer would have
consumed iff we'd have had enough room.

This can later cause skb_over_panic when ppp_generic skb_put()s
the returned length.

Reported-by: Iain Douglas <centos@1n6.org.uk>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/ppp/ppp_deflate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ppp/ppp_deflate.c b/drivers/net/ppp/ppp_deflate.c
index 602c625d95d5..b5edc7f96a39 100644
--- a/drivers/net/ppp/ppp_deflate.c
+++ b/drivers/net/ppp/ppp_deflate.c
@@ -246,7 +246,7 @@ static int z_compress(void *arg, unsigned char *rptr, unsigned char *obuf,
 	/*
 	 * See if we managed to reduce the size of the packet.
 	 */
-	if (olen < isize) {
+	if (olen < isize && olen <= osize) {
 		state->stats.comp_bytes += olen;
 		state->stats.comp_packets++;
 	} else {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 38/58] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (36 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 37/58] ppp: deflate: never return len larger than output buffer Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 39/58] hyperv: Fix the error processing in netvsc_send() Luis Henriques
                   ` (19 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Saran Maruti Ramanara, Daniel Borkmann, David S. Miller, Luis Henriques

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

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

From: Saran Maruti Ramanara <saran.neti@telus.com>

commit cfbf654efc6d78dc9812e030673b86f235bf677d upstream.

When making use of RFC5061, section 4.2.4. for setting the primary IP
address, we're passing a wrong parameter header to param_type2af(),
resulting always in NULL being returned.

At this point, param.p points to a sctp_addip_param struct, containing
a sctp_paramhdr (type = 0xc004, length = var), and crr_id as a correlation
id. Followed by that, as also presented in RFC5061 section 4.2.4., comes
the actual sctp_addr_param, which also contains a sctp_paramhdr, but
this time with the correct type SCTP_PARAM_IPV{4,6}_ADDRESS that
param_type2af() can make use of. Since we already hold a pointer to
addr_param from previous line, just reuse it for param_type2af().

Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT")
Signed-off-by: Saran Maruti Ramanara <saran.neti@telus.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/sctp/sm_make_chunk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 9f32741abb1c..371a152d9759 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2608,7 +2608,7 @@ do_addr_param:
 
 		addr_param = param.v + sizeof(sctp_addip_param_t);
 
-		af = sctp_get_af_specific(param_type2af(param.p->type));
+		af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 		if (af == NULL)
 			break;
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 39/58] hyperv: Fix the error processing in netvsc_send()
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (37 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 38/58] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 40/58] x86: mm: move mmap_sem unlock from mm_fault_error() to caller Luis Henriques
                   ` (18 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Haiyang Zhang, David S. Miller, Luis Henriques

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

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

From: Haiyang Zhang <haiyangz@microsoft.com>

commit d953ca4ddf71aa91a4596b2ff7ff1598f6ad4708 upstream.

The existing code frees the skb in EAGAIN case, in which the skb will be
retried from upper layer and used again.
Also, the existing code doesn't free send buffer slot in error case, because
there is no completion message for unsent packets.
This patch fixes these problems.

(Please also include this patch for stable trees. Thanks!)

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/net/hyperv/netvsc.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 7edf976ecfa0..349fb3d73f30 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -707,7 +707,7 @@ int netvsc_send(struct hv_device *device,
 	u64 req_id;
 	unsigned int section_index = NETVSC_INVALID_INDEX;
 	u32 msg_size = 0;
-	struct sk_buff *skb;
+	struct sk_buff *skb = NULL;
 	u16 q_idx = packet->q_idx;
 
 
@@ -734,8 +734,6 @@ int netvsc_send(struct hv_device *device,
 							   packet);
 			skb = (struct sk_buff *)
 			      (unsigned long)packet->send_completion_tid;
-			if (skb)
-				dev_kfree_skb_any(skb);
 			packet->page_buf_cnt = 0;
 		}
 	}
@@ -798,6 +796,13 @@ int netvsc_send(struct hv_device *device,
 			   packet, ret);
 	}
 
+	if (ret != 0) {
+		if (section_index != NETVSC_INVALID_INDEX)
+			netvsc_free_send_slot(net_device, section_index);
+	} else if (skb) {
+		dev_kfree_skb_any(skb);
+	}
+
 	return ret;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 40/58] x86: mm: move mmap_sem unlock from mm_fault_error() to caller
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (38 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 39/58] hyperv: Fix the error processing in netvsc_send() Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 41/58] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Luis Henriques
                   ` (17 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Linus Torvalds, Konstantin Khlebnikov, Luis Henriques

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

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

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

commit 7fb08eca45270d0ae86e1ad9d39c40b7a55d0190 upstream.

This replaces four copies in various stages of mm_fault_error() handling
with just a single one.  It will also allow for more natural placement
of the unlocking after some further cleanup.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/mm/fault.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 6d0e5472a5e5..dbd4abf66700 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -841,11 +841,8 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
 	  unsigned int fault)
 {
 	struct task_struct *tsk = current;
-	struct mm_struct *mm = tsk->mm;
 	int code = BUS_ADRERR;
 
-	up_read(&mm->mmap_sem);
-
 	/* Kernel mode? Handle exceptions or die: */
 	if (!(error_code & PF_USER)) {
 		no_context(regs, error_code, address, SIGBUS, BUS_ADRERR);
@@ -876,7 +873,6 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
 	       unsigned long address, unsigned int fault)
 {
 	if (fatal_signal_pending(current) && !(error_code & PF_USER)) {
-		up_read(&current->mm->mmap_sem);
 		no_context(regs, error_code, address, 0, 0);
 		return;
 	}
@@ -884,14 +880,11 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
 	if (fault & VM_FAULT_OOM) {
 		/* Kernel mode? Handle exceptions or die: */
 		if (!(error_code & PF_USER)) {
-			up_read(&current->mm->mmap_sem);
 			no_context(regs, error_code, address,
 				   SIGSEGV, SEGV_MAPERR);
 			return;
 		}
 
-		up_read(&current->mm->mmap_sem);
-
 		/*
 		 * We ran out of memory, call the OOM killer, and return the
 		 * userspace (which will retry the fault, or kill us if we got
@@ -1227,6 +1220,7 @@ good_area:
 		return;
 
 	if (unlikely(fault & VM_FAULT_ERROR)) {
+		up_read(&mm->mmap_sem);
 		mm_fault_error(regs, error_code, address, fault);
 		return;
 	}
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 41/58] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (39 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 40/58] x86: mm: move mmap_sem unlock from mm_fault_error() to caller Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 42/58] ALSA: hda/realtek - move HP_MUTE_LED_MIC1 quirk for alc282 Luis Henriques
                   ` (16 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Henningsson, Takashi Iwai, Luis Henriques

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

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

From: David Henningsson <david.henningsson@canonical.com>

commit 423044744aa4c250058e976474856a7a41972182 upstream.

This makes the mute LED work on a HP 15 touchsmart machine.

BugLink: https://bugs.launchpad.net/bugs/1334950
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 2cc27a08905b..72d76a936a54 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5064,6 +5064,17 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
 		{0x1d, 0x40700001},
 		{0x1e, 0x411111f0},
 		{0x21, 0x02211040}),
+	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
+		{0x12, 0x99a30130},
+		{0x14, 0x90170110},
+		{0x17, 0x40000000},
+		{0x18, 0x411111f0},
+		{0x19, 0x03a11020},
+		{0x1a, 0x411111f0},
+		{0x1b, 0x411111f0},
+		{0x1d, 0x40f41905},
+		{0x1e, 0x411111f0},
+		{0x21, 0x0321101f}),
 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
 		{0x12, 0x90a60130},
 		{0x14, 0x90170110},
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 42/58] ALSA: hda/realtek - move HP_MUTE_LED_MIC1 quirk for alc282
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (40 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 41/58] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 43/58] KVM: x86: update masterclock values on TSC writes Luis Henriques
                   ` (15 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: David Henningsson, Hui Wang, Takashi Iwai, Luis Henriques

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

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

From: Hui Wang <hui.wang@canonical.com>

commit 2c609999759c6964d99a614e8259fa700b5b337c upstream.

Cc: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 77 ++++++++++++++++++++++++++++++-------------
 1 file changed, 55 insertions(+), 22 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 72d76a936a54..ded8b2fa136f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4799,44 +4799,22 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
 	SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
-	SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
 	/* ALC282 */
 	SND_PCI_QUIRK(0x103c, 0x2191, "HP Touchsmart 14", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x2192, "HP Touchsmart 15", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x220d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x220e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x220f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x2211, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x2212, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x2213, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x2266, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x2267, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x2269, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x226c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x226d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x226f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x227a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x227b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x22a0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x22c0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x22c1, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x22c2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x22cd, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x22ce, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
-	SND_PCI_QUIRK(0x103c, 0x22d0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	/* ALC290 */
 	SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
 	SND_PCI_QUIRK(0x103c, 0x2261, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
@@ -5075,6 +5053,61 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
 		{0x1d, 0x40f41905},
 		{0x1e, 0x411111f0},
 		{0x21, 0x0321101f}),
+	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
+		{0x12, 0x99a30130},
+		{0x14, 0x90170110},
+		{0x17, 0x40020008},
+		{0x18, 0x411111f0},
+		{0x19, 0x03a11020},
+		{0x1a, 0x411111f0},
+		{0x1b, 0x411111f0},
+		{0x1d, 0x40e00001},
+		{0x1e, 0x411111f0},
+		{0x21, 0x03211040}),
+	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
+		{0x12, 0x99a30130},
+		{0x14, 0x90170110},
+		{0x17, 0x40000000},
+		{0x18, 0x411111f0},
+		{0x19, 0x03a11030},
+		{0x1a, 0x411111f0},
+		{0x1b, 0x411111f0},
+		{0x1d, 0x40e00001},
+		{0x1e, 0x411111f0},
+		{0x21, 0x03211020}),
+	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
+		{0x12, 0x99a30130},
+		{0x14, 0x90170110},
+		{0x17, 0x40000000},
+		{0x18, 0x411111f0},
+		{0x19, 0x03a11030},
+		{0x1a, 0x411111f0},
+		{0x1b, 0x411111f0},
+		{0x1d, 0x40f00001},
+		{0x1e, 0x411111f0},
+		{0x21, 0x03211020}),
+	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
+		{0x12, 0x99a30130},
+		{0x14, 0x90170110},
+		{0x17, 0x40000000},
+		{0x18, 0x411111f0},
+		{0x19, 0x04a11020},
+		{0x1a, 0x411111f0},
+		{0x1b, 0x411111f0},
+		{0x1d, 0x40f00001},
+		{0x1e, 0x411111f0},
+		{0x21, 0x0421101f}),
+	SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
+		{0x12, 0x99a30130},
+		{0x14, 0x90170110},
+		{0x17, 0x40000000},
+		{0x18, 0x411111f0},
+		{0x19, 0x03a11030},
+		{0x1a, 0x411111f0},
+		{0x1b, 0x411111f0},
+		{0x1d, 0x40f00001},
+		{0x1e, 0x411111f0},
+		{0x21, 0x04211020}),
 	SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
 		{0x12, 0x90a60130},
 		{0x14, 0x90170110},
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 43/58] KVM: x86: update masterclock values on TSC writes
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (41 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 42/58] ALSA: hda/realtek - move HP_MUTE_LED_MIC1 quirk for alc282 Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 44/58] [media] media/rc: Send sync space information on the lirc device Luis Henriques
                   ` (14 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Marcelo Tosatti, Paolo Bonzini, Luis Henriques

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

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

From: Marcelo Tosatti <mtosatti@redhat.com>

commit 7f187922ddf6b67f2999a76dcb71663097b75497 upstream.

When the guest writes to the TSC, the masterclock TSC copy must be
updated as well along with the TSC_OFFSET update, otherwise a negative
tsc_timestamp is calculated at kvm_guest_time_update.

Once "if (!vcpus_matched && ka->use_master_clock)" is simplified to
"if (ka->use_master_clock)", the corresponding "if (!ka->use_master_clock)"
becomes redundant, so remove the do_request boolean and collapse
everything into a single condition.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/x86/kvm/x86.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index eee371c996c2..a711a0d1ebc3 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1209,21 +1209,22 @@ void kvm_track_tsc_matching(struct kvm_vcpu *vcpu)
 {
 #ifdef CONFIG_X86_64
 	bool vcpus_matched;
-	bool do_request = false;
 	struct kvm_arch *ka = &vcpu->kvm->arch;
 	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
 
 	vcpus_matched = (ka->nr_vcpus_matched_tsc + 1 ==
 			 atomic_read(&vcpu->kvm->online_vcpus));
 
-	if (vcpus_matched && gtod->clock.vclock_mode == VCLOCK_TSC)
-		if (!ka->use_master_clock)
-			do_request = 1;
-
-	if (!vcpus_matched && ka->use_master_clock)
-			do_request = 1;
-
-	if (do_request)
+	/*
+	 * Once the masterclock is enabled, always perform request in
+	 * order to update it.
+	 *
+	 * In order to enable masterclock, the host clocksource must be TSC
+	 * and the vcpus need to have matched TSCs.  When that happens,
+	 * perform request to enable masterclock.
+	 */
+	if (ka->use_master_clock ||
+	    (gtod->clock.vclock_mode == VCLOCK_TSC && vcpus_matched))
 		kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
 
 	trace_kvm_track_tsc(vcpu->vcpu_id, ka->nr_vcpus_matched_tsc,
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 44/58] [media] media/rc: Send sync space information on the lirc device
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (42 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 43/58] KVM: x86: update masterclock values on TSC writes Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 45/58] Bluetooth: ath3k: workaround the compatibility issue with xHCI controller Luis Henriques
                   ` (13 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Austin Lund, Mauro Carvalho Chehab, Luis Henriques

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

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

From: Austin Lund <austin.lund@gmail.com>

commit a8f29e89f2b54fbf2c52be341f149bc195b63a8b upstream.

Userspace expects to see a long space before the first pulse is sent on
the lirc device.  Currently, if a long time has passed and a new packet
is started, the lirc codec just returns and doesn't send anything.  This
makes lircd ignore many perfectly valid signals unless they are sent in
quick sucession.  When a reset event is delivered, we cannot know
anything about the duration of the space.  But it should be safe to
assume it has been a long time and we just set the duration to maximum.

Signed-off-by: Austin Lund <austin.lund@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Austin Lund <austin.lund@gmail.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/media/rc/ir-lirc-codec.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index d731da6c414d..2af2326ab3d2 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -42,11 +42,17 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
 		return -EINVAL;
 
 	/* Packet start */
-	if (ev.reset)
-		return 0;
+	if (ev.reset) {
+		/* Userspace expects a long space event before the start of
+		 * the signal to use as a sync.  This may be done with repeat
+		 * packets and normal samples.  But if a reset has been sent
+		 * then we assume that a long time has passed, so we send a
+		 * space with the maximum time value. */
+		sample = LIRC_SPACE(LIRC_VALUE_MASK);
+		IR_dprintk(2, "delivering reset sync space to lirc_dev\n");
 
 	/* Carrier reports */
-	if (ev.carrier_report) {
+	} else if (ev.carrier_report) {
 		sample = LIRC_FREQUENCY(ev.carrier);
 		IR_dprintk(2, "carrier report (freq: %d)\n", sample);
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 45/58] Bluetooth: ath3k: workaround the compatibility issue with xHCI controller
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (43 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 44/58] [media] media/rc: Send sync space information on the lirc device Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 46/58] mmc: sdhci: Add PCI IDs for Intel Braswell Luis Henriques
                   ` (12 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Adam Lee, Marcel Holtmann, Luis Henriques

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

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

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

commit c561a5753dd631920c4459a067d22679b3d110d6 upstream.

BugLink: https://bugs.launchpad.net/bugs/1400215

ath3k devices fail to load firmwares on xHCI buses, but work well on
EHCI, this might be a compatibility issue between xHCI and ath3k chips.
As my testing result, those chips will work on xHCI buses again with
this patch.

This workaround is from Qualcomm, they also did some workarounds in
Windows driver.

Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/ath3k.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index a5075bb1c47f..ccb1adf930e6 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -170,6 +170,8 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
 #define USB_REQ_DFU_DNLOAD	1
 #define BULK_SIZE		4096
 #define FW_HDR_SIZE		20
+#define TIMEGAP_USEC_MIN	50
+#define TIMEGAP_USEC_MAX	100
 
 static int ath3k_load_firmware(struct usb_device *udev,
 				const struct firmware *firmware)
@@ -201,6 +203,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
 	pipe = usb_sndbulkpipe(udev, 0x02);
 
 	while (count) {
+		/* workaround the compatibility issue with xHCI controller*/
+		usleep_range(TIMEGAP_USEC_MIN, TIMEGAP_USEC_MAX);
+
 		size = min_t(uint, count, BULK_SIZE);
 		memcpy(send_buf, firmware->data + sent, size);
 
@@ -296,6 +301,9 @@ static int ath3k_load_fwfile(struct usb_device *udev,
 	count -= size;
 
 	while (count) {
+		/* workaround the compatibility issue with xHCI controller*/
+		usleep_range(TIMEGAP_USEC_MIN, TIMEGAP_USEC_MAX);
+
 		size = min_t(uint, count, BULK_SIZE);
 		pipe = usb_sndbulkpipe(udev, 0x02);
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 46/58] mmc: sdhci: Add PCI IDs for Intel Braswell
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (44 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 45/58] Bluetooth: ath3k: workaround the compatibility issue with xHCI controller Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 47/58] mmc: sdhci-pci: Fix Braswell eMMC timeout clock frequency Luis Henriques
                   ` (11 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Alan Cox, Mika Westerberg, Ulf Hansson, Luis Henriques

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

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

From: Alan Cox <alan@linux.intel.com>

commit 066173b6436dfc57a96b2d940f4e727fe8131261 upstream.

The hardware is the same as used in Baytrail. Add these new PCI IDs to the
driver's list of supported IDs.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-pci.c | 23 +++++++++++++++++++++++
 drivers/mmc/host/sdhci-pci.h |  3 +++
 2 files changed, 26 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 1aeeefc71512..e958926300a4 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -875,6 +875,29 @@ static const struct pci_device_id pci_ids[] = {
 		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_emmc,
 	},
 
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BSW_EMMC,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_emmc,
+	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BSW_SDIO,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_sdio,
+	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BSW_SD,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_sd,
+	},
 
 	{
 		.vendor		= PCI_VENDOR_ID_INTEL,
diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h
index c101477ef3be..9c1909b2a3ad 100644
--- a/drivers/mmc/host/sdhci-pci.h
+++ b/drivers/mmc/host/sdhci-pci.h
@@ -11,6 +11,9 @@
 #define PCI_DEVICE_ID_INTEL_BYT_SDIO	0x0f15
 #define PCI_DEVICE_ID_INTEL_BYT_SD	0x0f16
 #define PCI_DEVICE_ID_INTEL_BYT_EMMC2	0x0f50
+#define PCI_DEVICE_ID_INTEL_BSW_EMMC	0x2294
+#define PCI_DEVICE_ID_INTEL_BSW_SDIO	0x2295
+#define PCI_DEVICE_ID_INTEL_BSW_SD	0x2296
 #define PCI_DEVICE_ID_INTEL_MRFL_MMC	0x1190
 #define PCI_DEVICE_ID_INTEL_CLV_SDIO0	0x08f9
 #define PCI_DEVICE_ID_INTEL_CLV_SDIO1	0x08fa
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 47/58] mmc: sdhci-pci: Fix Braswell eMMC timeout clock frequency
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (45 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 46/58] mmc: sdhci: Add PCI IDs for Intel Braswell Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 48/58] mmc: sdhci-pci: Add support for Intel SPT Luis Henriques
                   ` (10 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Adrian Hunter, Ulf Hansson, Luis Henriques

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

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit a06586b62db5c63752e2e68daffec4baa275d594 upstream.

Braswell eMMC host controller specifies an incorrect
timeout clock frequncy in the capabilities registers.
The correct value is 1 MHz.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index e958926300a4..7a55466d81da 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -271,6 +271,8 @@ static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
 				 MMC_CAP_HW_RESET;
 	slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ;
 	slot->hw_reset = sdhci_pci_int_hw_reset;
+	if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BSW_EMMC)
+		slot->host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */
 	return 0;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 48/58] mmc: sdhci-pci: Add support for Intel SPT
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (46 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 47/58] mmc: sdhci-pci: Fix Braswell eMMC timeout clock frequency Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 49/58] mmc: sdhci-acpi: Add ACPI HID INT344D Luis Henriques
                   ` (9 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Adrian Hunter, Ulf Hansson, Luis Henriques

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

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit 1f7f26528fb159e71f081df1d1050c218ff1d74d upstream.

Add PCI IDs for SPT eMMC, SDIO and SD card.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-pci.c | 25 +++++++++++++++++++++++++
 drivers/mmc/host/sdhci-pci.h |  3 +++
 2 files changed, 28 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 7a55466d81da..1e5a7d0afe2c 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -948,6 +948,31 @@ static const struct pci_device_id pci_ids[] = {
 		.subdevice	= PCI_ANY_ID,
 		.driver_data	= (kernel_ulong_t)&sdhci_intel_mrfl_mmc,
 	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_SPT_EMMC,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_emmc,
+	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_SPT_SDIO,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_sdio,
+	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_SPT_SD,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_sd,
+	},
+
 	{
 		.vendor		= PCI_VENDOR_ID_O2,
 		.device		= PCI_DEVICE_ID_O2_8120,
diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h
index 9c1909b2a3ad..3fd813cca3cd 100644
--- a/drivers/mmc/host/sdhci-pci.h
+++ b/drivers/mmc/host/sdhci-pci.h
@@ -21,6 +21,9 @@
 #define PCI_DEVICE_ID_INTEL_CLV_EMMC0	0x08e5
 #define PCI_DEVICE_ID_INTEL_CLV_EMMC1	0x08e6
 #define PCI_DEVICE_ID_INTEL_QRK_SD	0x08A7
+#define PCI_DEVICE_ID_INTEL_SPT_EMMC	0x9d2b
+#define PCI_DEVICE_ID_INTEL_SPT_SDIO	0x9d2c
+#define PCI_DEVICE_ID_INTEL_SPT_SD	0x9d2d
 
 /*
  * PCI registers
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 49/58] mmc: sdhci-acpi: Add ACPI HID INT344D
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (47 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 48/58] mmc: sdhci-pci: Add support for Intel SPT Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 50/58] mmc: sdhci: Preset value not supported in Baytrail eMMC Luis Henriques
                   ` (8 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Adrian Hunter, Ulf Hansson, Luis Henriques

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

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit d0ed8e6b0ab149421cd1532e7c5ebb0992ad25d0 upstream.

Add ACPI HID INT344D for an Intel SDIO host controller.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-acpi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 8ce3c28cb76e..ecf09c85af4d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -156,6 +156,7 @@ static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = {
 	{ "INT33BB"  , "2" , &sdhci_acpi_slot_int_sdio },
 	{ "INT33C6"  , NULL, &sdhci_acpi_slot_int_sdio },
 	{ "INT3436"  , NULL, &sdhci_acpi_slot_int_sdio },
+	{ "INT344D"  , NULL, &sdhci_acpi_slot_int_sdio },
 	{ "PNP0D40"  },
 	{ },
 };
@@ -166,6 +167,7 @@ static const struct acpi_device_id sdhci_acpi_ids[] = {
 	{ "INT33BB"  },
 	{ "INT33C6"  },
 	{ "INT3436"  },
+	{ "INT344D"  },
 	{ "PNP0D40"  },
 	{ },
 };
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 50/58] mmc: sdhci: Preset value not supported in Baytrail eMMC
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (48 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 49/58] mmc: sdhci-acpi: Add ACPI HID INT344D Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 51/58] mmc: sdhci-acpi: Add a HID and UID for a SD Card host controller Luis Henriques
                   ` (7 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Maurice Petallo, Ulf Hansson, Luis Henriques

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

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

From: Maurice Petallo <mauricex.r.petallo@intel.com>

commit d61b59461b0cd0106f03e566d537b9072029e059 upstream.

"SDHCI_QUIRK2_PRESET_VALUE_BROKEN" quirk is added to prohibit
preset value enabling for Baytrail eMMC controller.

Signed-off-by: Maurice Petallo <mauricex.r.petallo@intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-acpi.c | 1 +
 drivers/mmc/host/sdhci-pci.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index ecf09c85af4d..c19ebe12b8c7 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -127,6 +127,7 @@ static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = {
 	.caps    = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE | MMC_CAP_HW_RESET,
 	.caps2   = MMC_CAP2_HC_ERASE_SZ,
 	.flags   = SDHCI_ACPI_RUNTIME_PM,
+	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
 };
 
 static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = {
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 1e5a7d0afe2c..56389ae09222 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -285,6 +285,7 @@ static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
 static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = {
 	.allow_runtime_pm = true,
 	.probe_slot	= byt_emmc_probe_slot,
+	.quirks2	= SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
 };
 
 static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = {
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 51/58] mmc: sdhci-acpi: Add a HID and UID for a SD Card host controller
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (49 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 50/58] mmc: sdhci: Preset value not supported in Baytrail eMMC Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 52/58] ceph: introduce global empty snap context Luis Henriques
                   ` (6 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Adrian Hunter, Ulf Hansson, Luis Henriques

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

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

From: Adrian Hunter <adrian.hunter@intel.com>

commit 7147eaf3a4fe7e7dbb6e1f89e328ea0507e0c32c upstream.

Add a HID (INT33BB) and UID (3) for a SD Card host controller.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/mmc/host/sdhci-acpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index c19ebe12b8c7..0ad3171e7dd0 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -155,6 +155,7 @@ static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = {
 	{ "80860F14" , "3" , &sdhci_acpi_slot_int_sd   },
 	{ "80860F16" , NULL, &sdhci_acpi_slot_int_sd   },
 	{ "INT33BB"  , "2" , &sdhci_acpi_slot_int_sdio },
+	{ "INT33BB"  , "3" , &sdhci_acpi_slot_int_sd },
 	{ "INT33C6"  , NULL, &sdhci_acpi_slot_int_sdio },
 	{ "INT3436"  , NULL, &sdhci_acpi_slot_int_sdio },
 	{ "INT344D"  , NULL, &sdhci_acpi_slot_int_sdio },
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 52/58] ceph: introduce global empty snap context
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (50 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 51/58] mmc: sdhci-acpi: Add a HID and UID for a SD Card host controller Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 53/58] drm/vmwgfx: Don't use memory accounting for kernel-side fence objects Luis Henriques
                   ` (5 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Yan, Zheng, Markus Blank-Burian, Luis Henriques

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

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

From: "Yan, Zheng" <zyan@redhat.com>

commit 97c85a828f36bbfffe9d77b977b65a5872b6cad4 upstream.

Current snaphost code does not properly handle moving inode from one
empty snap realm to another empty snap realm. After changing inode's
snap realm, some dirty pages' snap context can be not equal to inode's
i_head_snap. This can trigger BUG() in ceph_put_wrbuffer_cap_refs()

The fix is introduce a global empty snap context for all empty snap
realm. This avoids triggering the BUG() for filesystem with no snapshot.

Fixes: http://tracker.ceph.com/issues/9928

Signed-off-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
Cc: Markus Blank-Burian <burian@muenster.de>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/ceph/snap.c  | 26 +++++++++++++++++++++++++-
 fs/ceph/super.c | 10 ++++++++--
 fs/ceph/super.h |  2 ++
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
index f01645a27752..fad6f7dfab19 100644
--- a/fs/ceph/snap.c
+++ b/fs/ceph/snap.c
@@ -288,6 +288,9 @@ static int cmpu64_rev(const void *a, const void *b)
 	return 0;
 }
 
+
+static struct ceph_snap_context *empty_snapc;
+
 /*
  * build the snap context for a given realm.
  */
@@ -328,6 +331,12 @@ static int build_snap_context(struct ceph_snap_realm *realm)
 		return 0;
 	}
 
+	if (num == 0 && realm->seq == empty_snapc->seq) {
+		ceph_get_snap_context(empty_snapc);
+		snapc = empty_snapc;
+		goto done;
+	}
+
 	/* alloc new snap context */
 	err = -ENOMEM;
 	if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64))
@@ -365,6 +374,7 @@ static int build_snap_context(struct ceph_snap_realm *realm)
 	     realm->ino, realm, snapc, snapc->seq,
 	     (unsigned int) snapc->num_snaps);
 
+done:
 	if (realm->cached_context)
 		ceph_put_snap_context(realm->cached_context);
 	realm->cached_context = snapc;
@@ -466,6 +476,9 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci)
 		   cap_snap.  lucky us. */
 		dout("queue_cap_snap %p already pending\n", inode);
 		kfree(capsnap);
+	} else if (ci->i_snap_realm->cached_context == empty_snapc) {
+		dout("queue_cap_snap %p empty snapc\n", inode);
+		kfree(capsnap);
 	} else if (dirty & (CEPH_CAP_AUTH_EXCL|CEPH_CAP_XATTR_EXCL|
 			    CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR)) {
 		struct ceph_snap_context *snapc = ci->i_head_snapc;
@@ -928,5 +941,16 @@ out:
 	return;
 }
 
+int __init ceph_snap_init(void)
+{
+	empty_snapc = ceph_create_snap_context(0, GFP_NOFS);
+	if (!empty_snapc)
+		return -ENOMEM;
+	empty_snapc->seq = 1;
+	return 0;
+}
 
-
+void ceph_snap_exit(void)
+{
+	ceph_put_snap_context(empty_snapc);
+}
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 06150fd745ac..8503ec130c15 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -1028,15 +1028,20 @@ static int __init init_ceph(void)
 
 	ceph_flock_init();
 	ceph_xattr_init();
+	ret = ceph_snap_init();
+	if (ret)
+		goto out_xattr;
 	ret = register_filesystem(&ceph_fs_type);
 	if (ret)
-		goto out_icache;
+		goto out_snap;
 
 	pr_info("loaded (mds proto %d)\n", CEPH_MDSC_PROTOCOL);
 
 	return 0;
 
-out_icache:
+out_snap:
+	ceph_snap_exit();
+out_xattr:
 	ceph_xattr_exit();
 	destroy_caches();
 out:
@@ -1047,6 +1052,7 @@ static void __exit exit_ceph(void)
 {
 	dout("exit_ceph\n");
 	unregister_filesystem(&ceph_fs_type);
+	ceph_snap_exit();
 	ceph_xattr_exit();
 	destroy_caches();
 }
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 12b20744e386..b5b324a94cca 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -672,6 +672,8 @@ extern void ceph_queue_cap_snap(struct ceph_inode_info *ci);
 extern int __ceph_finish_cap_snap(struct ceph_inode_info *ci,
 				  struct ceph_cap_snap *capsnap);
 extern void ceph_cleanup_empty_realms(struct ceph_mds_client *mdsc);
+extern int ceph_snap_init(void);
+extern void ceph_snap_exit(void);
 
 /*
  * a cap_snap is "pending" if it is still awaiting an in-progress
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 53/58] drm/vmwgfx: Don't use memory accounting for kernel-side fence objects
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (51 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 52/58] ceph: introduce global empty snap context Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 54/58] Bluetooth: Add USB device 04ca:3010 as Atheros AR3012 Luis Henriques
                   ` (4 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Thomas Hellstrom, Luis Henriques

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

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

From: Thomas Hellstrom <thellstrom@vmware.com>

commit 1f563a6a46544602183e7493b6ef69769d3d76d9 upstream.

Kernel side fence objects are used when unbinding resources and may thus be
created as part of a memory reclaim operation. This might trigger recursive
memory reclaims and result in the kernel running out of stack space.

So a simple way out is to avoid accounting of these fence objects.
In principle this is OK since while user-space can trigger the creation of
such objects, it can't really hold on to them. However, their lifetime is
quite long, so some form of accounting should perhaps be implemented in the
future.

Fixes kernel crashes when running, for example viewperf11 ensight-04 test 3
with low system memory settings.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
index b65272d7ea56..64e4fe4dd1ec 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
@@ -485,14 +485,7 @@ void vmw_fence_obj_flush(struct vmw_fence_obj *fence)
 
 static void vmw_fence_destroy(struct vmw_fence_obj *fence)
 {
-	struct vmw_fence_manager *fman = fence->fman;
-
 	kfree(fence);
-	/*
-	 * Free kernel space accounting.
-	 */
-	ttm_mem_global_free(vmw_mem_glob(fman->dev_priv),
-			    fman->fence_size);
 }
 
 int vmw_fence_create(struct vmw_fence_manager *fman,
@@ -500,20 +493,12 @@ int vmw_fence_create(struct vmw_fence_manager *fman,
 		     uint32_t mask,
 		     struct vmw_fence_obj **p_fence)
 {
-	struct ttm_mem_global *mem_glob = vmw_mem_glob(fman->dev_priv);
 	struct vmw_fence_obj *fence;
 	int ret;
 
-	ret = ttm_mem_global_alloc(mem_glob, fman->fence_size,
-				   false, false);
-	if (unlikely(ret != 0))
-		return ret;
-
 	fence = kzalloc(sizeof(*fence), GFP_KERNEL);
-	if (unlikely(fence == NULL)) {
-		ret = -ENOMEM;
-		goto out_no_object;
-	}
+	if (unlikely(fence == NULL))
+		return -ENOMEM;
 
 	ret = vmw_fence_obj_init(fman, fence, seqno, mask,
 				 vmw_fence_destroy);
@@ -525,8 +510,6 @@ int vmw_fence_create(struct vmw_fence_manager *fman,
 
 out_err_init:
 	kfree(fence);
-out_no_object:
-	ttm_mem_global_free(mem_glob, fman->fence_size);
 	return ret;
 }
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 54/58] Bluetooth: Add USB device 04ca:3010 as Atheros AR3012
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (52 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 53/58] drm/vmwgfx: Don't use memory accounting for kernel-side fence objects Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 55/58] Bluetooth: Add support for Acer [0489:e078] Luis Henriques
                   ` (3 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Janne Heikkinen, Marcel Holtmann, Luis Henriques

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

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

From: Janne Heikkinen <janne.m.heikkinen@gmail.com>

commit 134d3b3550f050b9bec37111824452064d1ed928 upstream.

Asus X553MA has USB device 04ca:3010 that is Atheros AR3012
or compatible.

Device from /sys/kernel/debug/usb/devices:

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

Signed-off-by: Janne Heikkinen <janne.m.heikkinen@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/bluetooth/ath3k.c | 2 ++
 drivers/bluetooth/btusb.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index ccb1adf930e6..bbd11f84001e 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -86,6 +86,7 @@ static const struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x04CA, 0x3007) },
 	{ USB_DEVICE(0x04CA, 0x3008) },
 	{ USB_DEVICE(0x04CA, 0x300b) },
+	{ USB_DEVICE(0x04CA, 0x3010) },
 	{ USB_DEVICE(0x0930, 0x0219) },
 	{ USB_DEVICE(0x0930, 0x0220) },
 	{ USB_DEVICE(0x0930, 0x0227) },
@@ -138,6 +139,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 9ae597410c76..049d5ff66d15 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -165,6 +165,7 @@ static const struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x04ca, 0x3007), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 55/58] Bluetooth: Add support for Acer [0489:e078]
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (53 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 54/58] Bluetooth: Add USB device 04ca:3010 as Atheros AR3012 Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 56/58] net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland Luis Henriques
                   ` (2 subsequent siblings)
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Anantha Krishnan, Marcel Holtmann, Luis Henriques

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

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

From: Anantha Krishnan <ananthk@codeaurora.org>

commit 4b552bc9edfdc947862af225a0e2521edb5d37a0 upstream.

Add support for the QCA6174 chip.

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

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

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index bbd11f84001e..c8398678ead4 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -79,6 +79,7 @@ static const struct usb_device_id ath3k_table[] = {
 	{ USB_DEVICE(0x0489, 0xe057) },
 	{ USB_DEVICE(0x0489, 0xe056) },
 	{ USB_DEVICE(0x0489, 0xe05f) },
+	{ USB_DEVICE(0x0489, 0xe078) },
 	{ USB_DEVICE(0x04c5, 0x1330) },
 	{ USB_DEVICE(0x04CA, 0x3004) },
 	{ USB_DEVICE(0x04CA, 0x3005) },
@@ -132,6 +133,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
 	{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 049d5ff66d15..b7fa7ac76fdb 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -158,6 +158,7 @@ static const struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
+	{ USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
 	{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 56/58] net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland.
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (54 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 55/58] Bluetooth: Add support for Acer [0489:e078] Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 57/58] virtio_pci: defer kfree until release callback Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 58/58] virtio_pci: document why we defer kfree Luis Henriques
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Ani Sinha, David S. Miller, Michal Marek, Luis Henriques

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

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

From: Ani Sinha <ani@arista.com>

commit 6a2a2b3ae0759843b22c929881cc184b00cc63ff upstream.

Linux manpage for recvmsg and sendmsg calls does not explicitly mention setting msg_namelen to 0 when
msg_name passed set as NULL. When developers don't set msg_namelen member in msghdr, it might contain garbage
value which will fail the validation check and sendmsg and recvmsg calls from kernel will return EINVAL. This will
break old binaries and any code for which there is no access to source code.
To fix this, we set msg_namelen to 0 when msg_name is passed as NULL from userland.

Signed-off-by: Ani Sinha <ani@arista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 net/socket.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/socket.c b/net/socket.c
index 7050240a951b..4980af97d87c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1985,6 +1985,9 @@ static int copy_msghdr_from_user(struct msghdr *kmsg,
 	if (copy_from_user(kmsg, umsg, sizeof(struct msghdr)))
 		return -EFAULT;
 
+	if (kmsg->msg_name == NULL)
+		kmsg->msg_namelen = 0;
+
 	if (kmsg->msg_namelen < 0)
 		return -EINVAL;
 
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 57/58] virtio_pci: defer kfree until release callback
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (55 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 56/58] net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 58/58] virtio_pci: document why we defer kfree Luis Henriques
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team
  Cc: Sasha Levin, Michael S. Tsirkin, Luis Henriques

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

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

From: Sasha Levin <sasha.levin@oracle.com>

commit 63bd62a08ca45a0c804c3c89777edc7f76a2d6da upstream.

A struct device which has just been unregistered can live on past the
point at which a driver decides to drop it's initial reference to the
kobject gained on allocation.

This implies that when releasing a virtio device, we can't free a struct
virtio_device until the underlying struct device has been released,
which might not happen immediately on device_unregister().

Unfortunately, this is exactly what virtio pci does:
it has an empty release callback, and frees memory immediately
after unregistering the device.

This causes an easy to reproduce crash if CONFIG_DEBUG_KOBJECT_RELEASE
it enabled.

To fix, free the memory only once we know the device is gone in the release
callback.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
[ luis: backported to 3.16:
  - file rename: virtio_pci_legacy.c -> virtio_pci.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/virtio/virtio_pci.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 50c8ad598b49..a46570005a98 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -668,11 +668,10 @@ static const struct virtio_config_ops virtio_pci_config_ops = {
 
 static void virtio_pci_release_dev(struct device *_d)
 {
-	/*
-	 * No need for a release method as we allocate/free
-	 * all devices together with the pci devices.
-	 * Provide an empty one to avoid getting a warning from core.
-	 */
+	struct virtio_device *vdev = dev_to_virtio(_d);
+	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+
+	kfree(vp_dev);
 }
 
 /* the PCI probing function */
@@ -760,7 +759,6 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)
 	pci_iounmap(pci_dev, vp_dev->ioaddr);
 	pci_release_regions(pci_dev);
 	pci_disable_device(pci_dev);
-	kfree(vp_dev);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.1.4


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

* [PATCH 3.16.y-ckt 58/58] virtio_pci: document why we defer kfree
  2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
                   ` (56 preceding siblings ...)
  2015-02-19 13:52 ` [PATCH 3.16.y-ckt 57/58] virtio_pci: defer kfree until release callback Luis Henriques
@ 2015-02-19 13:52 ` Luis Henriques
  57 siblings, 0 replies; 59+ messages in thread
From: Luis Henriques @ 2015-02-19 13:52 UTC (permalink / raw)
  To: linux-kernel, stable, kernel-team; +Cc: Michael S. Tsirkin, Luis Henriques

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

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

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

commit a1eb03f546d651a8f39c7d0692b1f7f5b4e7e3cd upstream.

The reason we defer kfree until release function is because it's a
general rule for kobjects: kfree of the reference counter itself is only
legal in the release function.

Previous patch didn't make this clear, document this in code.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
[ luis: backported to 3.16:
  - file rename: virtio_pci_legacy.c -> virtio_pci.c ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/virtio/virtio_pci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index a46570005a98..52c4607fec9e 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -671,6 +671,9 @@ static void virtio_pci_release_dev(struct device *_d)
 	struct virtio_device *vdev = dev_to_virtio(_d);
 	struct virtio_pci_device *vp_dev = to_vp_device(vdev);
 
+	/* As struct device is a kobject, it's not safe to
+	 * free the memory (including the reference counter itself)
+	 * until it's release callback. */
 	kfree(vp_dev);
 }
 
-- 
2.1.4


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

end of thread, other threads:[~2015-02-19 14:09 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 13:51 [3.16.y-ckt stable] Linux 3.16.7-ckt7 stable review Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 01/58] powerpc: add little endian flag to syscall_get_arch() Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 02/58] arm64: Fix up /proc/cpuinfo Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 03/58] MIPS: IRQ: Fix disable_irq on CPU IRQs Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 04/58] Complete oplock break jobs before closing file handle Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 05/58] smpboot: Add missing get_online_cpus() in smpboot_register_percpu_thread() Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 06/58] ASoC: atmel_ssc_dai: fix start event for I2S mode Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 07/58] spi: spi-fsl-dspi: Remove usage of devm_kzalloc Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 08/58] ALSA: ak411x: Fix stall in work callback Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 09/58] lib/checksum.c: fix carry in csum_tcpudp_nofold Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 10/58] lib/checksum.c: fix build for generic csum_tcpudp_nofold Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 11/58] MIPS: Fix kernel lockup or crash after CPU offline/online Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 12/58] gpio: sysfs: fix memory leak in gpiod_export_link Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 13/58] gpio: sysfs: fix memory leak in gpiod_sysfs_set_active_low Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 14/58] md/raid5: fix another livelock caused by non-aligned writes Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 15/58] PCI: Add NEC variants to Stratus ftServer PCIe DMI check Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 16/58] drm/radeon: fix PLLs on RS880 and older v2 Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 17/58] drm/radeon: don't init gpuvm if accel is disabled (v3) Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 18/58] drm/radeon: properly set vm fragment size for TN/RL Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 19/58] ARM: 8299/1: mm: ensure local active ASID is marked as allocated on rollover Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 20/58] ASoC: sgtl5000: add delay before first I2C access Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 21/58] PCI: Handle read-only BARs on AMD CS553x devices Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 22/58] ARM: dts: Fix I2S1, I2S2 compatible for exynos4 SoCs Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 23/58] mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 24/58] nilfs2: fix deadlock of segment constructor over I_SYNC flag Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 25/58] ip: zero sockaddr returned on error queue Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 26/58] net: rps: fix cpu unplug Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 27/58] ipv6: stop sending PTB packets for MTU < 1280 Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 28/58] netxen: fix netxen_nic_poll() logic Luis Henriques
2015-02-19 13:51 ` [PATCH 3.16.y-ckt 29/58] udp_diag: Fix socket skipping within chain Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 30/58] ping: Fix race in free in receive path Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 31/58] ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos too Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 32/58] bnx2x: fix napi poll return value for repoll Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 33/58] net: don't OOPS on socket aio Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 34/58] bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 35/58] tcp: ipv4: initialize unicast_sock sk_pacing_rate Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 36/58] ipv4: tcp: get rid of ugly unicast_sock Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 37/58] ppp: deflate: never return len larger than output buffer Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 38/58] net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 39/58] hyperv: Fix the error processing in netvsc_send() Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 40/58] x86: mm: move mmap_sem unlock from mm_fault_error() to caller Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 41/58] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 42/58] ALSA: hda/realtek - move HP_MUTE_LED_MIC1 quirk for alc282 Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 43/58] KVM: x86: update masterclock values on TSC writes Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 44/58] [media] media/rc: Send sync space information on the lirc device Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 45/58] Bluetooth: ath3k: workaround the compatibility issue with xHCI controller Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 46/58] mmc: sdhci: Add PCI IDs for Intel Braswell Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 47/58] mmc: sdhci-pci: Fix Braswell eMMC timeout clock frequency Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 48/58] mmc: sdhci-pci: Add support for Intel SPT Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 49/58] mmc: sdhci-acpi: Add ACPI HID INT344D Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 50/58] mmc: sdhci: Preset value not supported in Baytrail eMMC Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 51/58] mmc: sdhci-acpi: Add a HID and UID for a SD Card host controller Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 52/58] ceph: introduce global empty snap context Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 53/58] drm/vmwgfx: Don't use memory accounting for kernel-side fence objects Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 54/58] Bluetooth: Add USB device 04ca:3010 as Atheros AR3012 Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 55/58] Bluetooth: Add support for Acer [0489:e078] Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 56/58] net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr struct from userland Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 57/58] virtio_pci: defer kfree until release callback Luis Henriques
2015-02-19 13:52 ` [PATCH 3.16.y-ckt 58/58] virtio_pci: document why we defer kfree Luis Henriques

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