linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.17 00/47] 3.17.7-stable review
@ 2014-12-14 20:20 Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 01/47] mm: frontswap: invalidate expired data on a dup-store failure Greg Kroah-Hartman
                   ` (43 more replies)
  0 siblings, 44 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, torvalds, akpm, linux, satoru.takeuchi,
	shuah.kh, stable

This is the start of the stable review cycle for the 3.17.7 release.
There are 47 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Tue Dec 16 20:18:09 UTC 2014.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.17.7-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 3.17.7-rc1

Takashi Iwai <tiwai@suse.de>
    ALSA: usb-audio: Don't resubmit pending URBs at MIDI error recovery

Takashi Iwai <tiwai@suse.de>
    ALSA: hda - Fix built-in mic at resume on Lenovo Ideapad S210

Takashi Iwai <tiwai@suse.de>
    ALSA: hda - Add EAPD fixup for ASUS Z99He laptop

Christian König <christian.koenig@amd.com>
    drm/radeon: sync all BOs involved in a CS v2

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Revert: ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC

Daniel Borkmann <dborkman@redhat.com>
    netlink: use jhash as hashfn for rhashtable

David Vrabel <david.vrabel@citrix.com>
    xen-netfront: use correct linear area after linearizing an skb

Daniel Borkmann <dborkman@redhat.com>
    net: sctp: use MAX_HEADER for headroom reserve in output path

Eric Dumazet <edumazet@google.com>
    net: mvneta: fix race condition in mvneta_tx()

willy tarreau <w@1wt.eu>
    net: mvneta: fix Tx interrupt delay

Denis Kirjanov <kda@linux-powerpc.org>
    mips: bpf: Fix broken BPF_MOD

Tom Herbert <therbert@google.com>
    gre: Set inner mac header in gro complete

Nicolas Dichtel <nicolas.dichtel@6wind.com>
    rtnetlink: release net refcnt on error in do_setlink()

Thomas Graf <tgraf@suug.ch>
    bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes

Willem de Bruijn <willemb@google.com>
    net-timestamp: make tcp_recvmsg call ipv6_recv_error for AF_INET6 socks

Jack Morgenstein <jackm@dev.mellanox.co.il>
    net/mlx4_core: Limit count field to 24 bits in qp_alloc_res

Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
    tg3: fix ring init when there are more TX than RX channels

Marcelo Leitner <mleitner@redhat.com>
    Fix race condition between vxlan_sock_add and vxlan_sock_release

Alexander Duyck <alexander.h.duyck@redhat.com>
    vxlan: Fix boolean flip in VXLAN_F_UDP_ZERO_CSUM6_[TX|RX]

Yuri Chislov <yuri.chislov@gmail.com>
    ipv6: gre: fix wrong skb->protocol in WCCP

lucien <lucien.xin@gmail.com>
    ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic

Dmitry Torokhov <dtor@chromium.org>
    sata_fsl: fix error handling of irq_of_parse_and_map

Tejun Heo <tj@kernel.org>
    ahci: disable MSI on SAMSUNG 0xa800 SSD

Devin Ryles <devin.ryles@intel.com>
    AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller

Sakari Ailus <sakari.ailus@iki.fi>
    media: smiapp: Only some selection targets are settable

sensoray-dev <linux-dev@sensoray.com>
    media: s2255drv: fix payload size for JPG, MJPEG

David Härdeman <david@hardeman.nu>
    media: rc-core: fix toggle handling in the rc6 decoder

Chris Clayton <chris2553@googlemail.com>
    x86: Use $(OBJDUMP) instead of plain objdump

Daniel Vetter <daniel.vetter@ffwll.ch>
    drm/i915: Unlock panel even when LVDS is disabled

Daniel Vetter <daniel.vetter@ffwll.ch>
    drm/i915: More cautious with pch fifo underruns

Ian Campbell <ian.campbell@citrix.com>
    of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap

Petr Mladek <pmladek@suse.cz>
    drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6

Michel Dänzer <michel.daenzer@amd.com>
    drm/radeon: Ignore RADEON_GEM_GTT_WC on 32-bit x86

Vishnu Motghare <vishnum@xilinx.com>
    i2c: cadence: Set the hardware time-out register to maximum value

Grygorii Strashko <grygorii.strashko@ti.com>
    i2c: davinci: generate STP always when NACK is received

Alexander Kochetkov <al.kochet@gmail.com>
    i2c: omap: fix i207 errata handling

Alexander Kochetkov <al.kochet@gmail.com>
    i2c: omap: fix NACK and Arbitration Lost irq handling

Dave Airlie <airlied@redhat.com>
    nouveau: move the hotplug ignore to correct place.

Ilia Mirkin <imirkin@alum.mit.edu>
    drm/nouveau/gf116: remove copy1 engine

Seth Forshee <seth.forshee@canonical.com>
    xen-netfront: Remove BUGs on paged skb data which crosses a page boundary

Paul Mackerras <paulus@samba.org>
    slab: fix nodeid bounds check for non-contiguous node IDs

Daniel Forrest <dan.forrest@ssec.wisc.edu>
    mm: fix anon_vma_clone() error treatment

Hugh Dickins <hughd@google.com>
    mm: fix swapoff hang after page migration and fork

Al Viro <viro@zeniv.linux.org.uk>
    fat: fix oops on corrupted vfat fs

Andrew Morton <akpm@linux-foundation.org>
    drivers/input/evdev.c: don't kfree() a vmalloc address

Andrew Morton <akpm@linux-foundation.org>
    mm/vmpressure.c: fix race in vmpressure_work_fn()

Weijie Yang <weijie.yang@samsung.com>
    mm: frontswap: invalidate expired data on a dup-store failure


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

Diffstat:

 Makefile                                           |  4 ++--
 arch/mips/net/bpf_jit.c                            |  4 ++--
 arch/x86/boot/compressed/Makefile                  |  2 +-
 drivers/acpi/ec.c                                  |  4 ++--
 drivers/ata/ahci.c                                 |  4 ++++
 drivers/ata/sata_fsl.c                             |  2 +-
 drivers/gpu/drm/i915/intel_display.c               |  2 --
 drivers/gpu/drm/i915/intel_lvds.c                  | 22 +++++++++---------
 drivers/gpu/drm/nouveau/core/engine/device/nvc0.c  |  1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c              |  2 +-
 drivers/gpu/drm/radeon/radeon_cs.c                 |  9 +++-----
 drivers/gpu/drm/radeon/radeon_kms.c                |  2 ++
 drivers/gpu/drm/radeon/radeon_object.c             |  7 ++++++
 drivers/i2c/busses/i2c-cadence.c                   | 11 +++++++++
 drivers/i2c/busses/i2c-davinci.c                   |  8 +++----
 drivers/i2c/busses/i2c-omap.c                      | 10 ++++-----
 drivers/input/evdev.c                              |  2 +-
 drivers/media/i2c/smiapp/smiapp-core.c             |  2 +-
 drivers/media/rc/ir-rc6-decoder.c                  |  2 +-
 drivers/media/usb/s2255/s2255drv.c                 |  2 +-
 drivers/net/bonding/bond_netlink.c                 |  7 +++++-
 drivers/net/ethernet/broadcom/tg3.c                |  3 ++-
 drivers/net/ethernet/marvell/mvneta.c              |  5 +++--
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  |  2 +-
 drivers/net/vxlan.c                                | 14 +++++-------
 drivers/net/xen-netfront.c                         |  8 +++----
 drivers/of/fdt.c                                   |  2 --
 fs/fat/namei_vfat.c                                | 20 +++++++++--------
 include/net/inet_common.h                          |  2 ++
 mm/frontswap.c                                     |  4 +++-
 mm/memory.c                                        | 26 +++++++++++-----------
 mm/mmap.c                                          | 10 ++++++---
 mm/rmap.c                                          |  6 +++--
 mm/slab.c                                          |  2 +-
 mm/vmpressure.c                                    |  8 ++++---
 net/core/rtnetlink.c                               |  1 +
 net/ipv4/af_inet.c                                 | 11 +++++++++
 net/ipv4/gre_offload.c                             |  3 +++
 net/ipv4/ip_vti.c                                  |  1 +
 net/ipv4/ping.c                                    | 12 ++--------
 net/ipv4/tcp.c                                     |  2 +-
 net/ipv6/ip6_gre.c                                 |  4 ++--
 net/ipv6/ip6_vti.c                                 | 11 +++++++++
 net/netlink/af_netlink.c                           |  2 +-
 net/sctp/output.c                                  |  4 ++--
 sound/pci/hda/patch_analog.c                       |  1 +
 sound/pci/hda/patch_realtek.c                      |  1 +
 sound/usb/midi.c                                   |  2 ++
 48 files changed, 164 insertions(+), 112 deletions(-)



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

* [PATCH 3.17 01/47] mm: frontswap: invalidate expired data on a dup-store failure
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 02/47] mm/vmpressure.c: fix race in vmpressure_work_fn() Greg Kroah-Hartman
                   ` (42 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Weijie Yang, Konrad Rzeszutek Wilk,
	Seth Jennings, Dan Streetman, Minchan Kim, Bob Liu,
	Andrew Morton, Linus Torvalds

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

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

From: Weijie Yang <weijie.yang@samsung.com>

commit fb993fa1a2f669215fa03a09eed7848f2663e336 upstream.

If a frontswap dup-store failed, it should invalidate the expired page
in the backend, or it could trigger some data corruption issue.
Such as:
 1. use zswap as the frontswap backend with writeback feature
 2. store a swap page(version_1) to entry A, success
 3. dup-store a newer page(version_2) to the same entry A, fail
 4. use __swap_writepage() write version_2 page to swapfile, success
 5. zswap do shrink, writeback version_1 page to swapfile
 6. version_2 page is overwrited by version_1, data corrupt.

This patch fixes this issue by invalidating expired data immediately
when meet a dup-store failure.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Seth Jennings <sjennings@variantweb.net>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/frontswap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -244,8 +244,10 @@ int __frontswap_store(struct page *page)
 		  the (older) page from frontswap
 		 */
 		inc_frontswap_failed_stores();
-		if (dup)
+		if (dup) {
 			__frontswap_clear(sis, offset);
+			frontswap_ops->invalidate_page(type, offset);
+		}
 	}
 	if (frontswap_writethrough_enabled)
 		/* report failure so swap also writes to swap device */



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

* [PATCH 3.17 02/47] mm/vmpressure.c: fix race in vmpressure_work_fn()
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 01/47] mm: frontswap: invalidate expired data on a dup-store failure Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 03/47] drivers/input/evdev.c: dont kfree() a vmalloc address Greg Kroah-Hartman
                   ` (41 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, ji_ang, Anton Vorontsov,
	Andrew Morton, Linus Torvalds

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

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

From: Andrew Morton <akpm@linux-foundation.org>

commit 91b57191cfd152c02ded0745250167d0263084f8 upstream.

In some android devices, there will be a "divide by zero" exception.
vmpr->scanned could be zero before spin_lock(&vmpr->sr_lock).

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=88051

[akpm@linux-foundation.org: neaten]
Reported-by: ji_ang <ji_ang@163.com>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/vmpressure.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -165,6 +165,7 @@ static void vmpressure_work_fn(struct wo
 	unsigned long scanned;
 	unsigned long reclaimed;
 
+	spin_lock(&vmpr->sr_lock);
 	/*
 	 * Several contexts might be calling vmpressure(), so it is
 	 * possible that the work was rescheduled again before the old
@@ -173,11 +174,12 @@ static void vmpressure_work_fn(struct wo
 	 * here. No need for any locks here since we don't care if
 	 * vmpr->reclaimed is in sync.
 	 */
-	if (!vmpr->scanned)
+	scanned = vmpr->scanned;
+	if (!scanned) {
+		spin_unlock(&vmpr->sr_lock);
 		return;
+	}
 
-	spin_lock(&vmpr->sr_lock);
-	scanned = vmpr->scanned;
 	reclaimed = vmpr->reclaimed;
 	vmpr->scanned = 0;
 	vmpr->reclaimed = 0;



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

* [PATCH 3.17 03/47] drivers/input/evdev.c: dont kfree() a vmalloc address
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 01/47] mm: frontswap: invalidate expired data on a dup-store failure Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 02/47] mm/vmpressure.c: fix race in vmpressure_work_fn() Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 04/47] fat: fix oops on corrupted vfat fs Greg Kroah-Hartman
                   ` (40 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Christian Casteyde, Henrik Rydberg,
	Andrew Morton, Linus Torvalds

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

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

From: Andrew Morton <akpm@linux-foundation.org>

commit 92788ac1eb06e69a822de45e2a8a63fa45eb5be2 upstream.

If kzalloc() failed and then evdev_open_device() fails, evdev_open()
will pass a vmalloc'ed pointer to kfree.

This might fix https://bugzilla.kernel.org/show_bug.cgi?id=88401, where
there was a crash in kfree().

Reported-by: Christian Casteyde <casteyde.christian@free.fr>
Belatedly-Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/input/evdev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -421,7 +421,7 @@ static int evdev_open(struct inode *inod
 
  err_free_client:
 	evdev_detach_client(evdev, client);
-	kfree(client);
+	kvfree(client);
 	return error;
 }
 



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

* [PATCH 3.17 04/47] fat: fix oops on corrupted vfat fs
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 03/47] drivers/input/evdev.c: dont kfree() a vmalloc address Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 05/47] mm: fix swapoff hang after page migration and fork Greg Kroah-Hartman
                   ` (39 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Al Viro, OGAWA Hirofumi,
	Andrew Morton, Linus Torvalds

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

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

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

commit 1ead0e79bfedd4b563b8ea7c585ca3884b0c89a7 upstream.

a) don't bother with ->d_time for positives - we only check it for
   negatives anyway.

b) make sure to set it at unlink and rmdir time - at *that* point
   soon-to-be negative dentry matches then-current directory contents

c) don't go into renaming of old alias in vfat_lookup() unless it
   has the same parent (which it will, unless we are seeing corrupted
   image)

[hirofumi@mail.parknet.co.jp: make change minimum, don't call d_move() for dir]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/fat/namei_vfat.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -736,7 +736,12 @@ static struct dentry *vfat_lookup(struct
 	}
 
 	alias = d_find_alias(inode);
-	if (alias && !vfat_d_anon_disconn(alias)) {
+	/*
+	 * Checking "alias->d_parent == dentry->d_parent" to make sure
+	 * FS is not corrupted (especially double linked dir).
+	 */
+	if (alias && alias->d_parent == dentry->d_parent &&
+	    !vfat_d_anon_disconn(alias)) {
 		/*
 		 * This inode has non anonymous-DCACHE_DISCONNECTED
 		 * dentry. This means, the user did ->lookup() by an
@@ -755,12 +760,9 @@ static struct dentry *vfat_lookup(struct
 
 out:
 	mutex_unlock(&MSDOS_SB(sb)->s_lock);
-	dentry->d_time = dentry->d_parent->d_inode->i_version;
-	dentry = d_splice_alias(inode, dentry);
-	if (dentry)
-		dentry->d_time = dentry->d_parent->d_inode->i_version;
-	return dentry;
-
+	if (!inode)
+		dentry->d_time = dir->i_version;
+	return d_splice_alias(inode, dentry);
 error:
 	mutex_unlock(&MSDOS_SB(sb)->s_lock);
 	return ERR_PTR(err);
@@ -793,7 +795,6 @@ static int vfat_create(struct inode *dir
 	inode->i_mtime = inode->i_atime = inode->i_ctime = ts;
 	/* timestamp is already written, so mark_inode_dirty() is unneeded. */
 
-	dentry->d_time = dentry->d_parent->d_inode->i_version;
 	d_instantiate(dentry, inode);
 out:
 	mutex_unlock(&MSDOS_SB(sb)->s_lock);
@@ -824,6 +825,7 @@ static int vfat_rmdir(struct inode *dir,
 	clear_nlink(inode);
 	inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
 	fat_detach(inode);
+	dentry->d_time = dir->i_version;
 out:
 	mutex_unlock(&MSDOS_SB(sb)->s_lock);
 
@@ -849,6 +851,7 @@ static int vfat_unlink(struct inode *dir
 	clear_nlink(inode);
 	inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC;
 	fat_detach(inode);
+	dentry->d_time = dir->i_version;
 out:
 	mutex_unlock(&MSDOS_SB(sb)->s_lock);
 
@@ -889,7 +892,6 @@ static int vfat_mkdir(struct inode *dir,
 	inode->i_mtime = inode->i_atime = inode->i_ctime = ts;
 	/* timestamp is already written, so mark_inode_dirty() is unneeded. */
 
-	dentry->d_time = dentry->d_parent->d_inode->i_version;
 	d_instantiate(dentry, inode);
 
 	mutex_unlock(&MSDOS_SB(sb)->s_lock);



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

* [PATCH 3.17 05/47] mm: fix swapoff hang after page migration and fork
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 04/47] fat: fix oops on corrupted vfat fs Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 06/47] mm: fix anon_vma_clone() error treatment Greg Kroah-Hartman
                   ` (38 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Hugh Dickins, Kelley Nielsen,
	Andrew Morton, Linus Torvalds

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

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

From: Hugh Dickins <hughd@google.com>

commit 2022b4d18a491a578218ce7a4eca8666db895a73 upstream.

I've been seeing swapoff hangs in recent testing: it's cycling around
trying unsuccessfully to find an mm for some remaining pages of swap.

I have been exercising swap and page migration more heavily recently,
and now notice a long-standing error in copy_one_pte(): it's trying to
add dst_mm to swapoff's mmlist when it finds a swap entry, but is doing
so even when it's a migration entry or an hwpoison entry.

Which wouldn't matter much, except it adds dst_mm next to src_mm,
assuming src_mm is already on the mmlist: which may not be so.  Then if
pages are later swapped out from dst_mm, swapoff won't be able to find
where to replace them.

There's already a !non_swap_entry() test for stats: move that up before
the swap_duplicate() and the addition to mmlist.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/memory.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

--- a/mm/memory.c
+++ b/mm/memory.c
@@ -815,20 +815,20 @@ copy_one_pte(struct mm_struct *dst_mm, s
 		if (!pte_file(pte)) {
 			swp_entry_t entry = pte_to_swp_entry(pte);
 
-			if (swap_duplicate(entry) < 0)
-				return entry.val;
+			if (likely(!non_swap_entry(entry))) {
+				if (swap_duplicate(entry) < 0)
+					return entry.val;
 
-			/* make sure dst_mm is on swapoff's mmlist. */
-			if (unlikely(list_empty(&dst_mm->mmlist))) {
-				spin_lock(&mmlist_lock);
-				if (list_empty(&dst_mm->mmlist))
-					list_add(&dst_mm->mmlist,
-						 &src_mm->mmlist);
-				spin_unlock(&mmlist_lock);
-			}
-			if (likely(!non_swap_entry(entry)))
+				/* make sure dst_mm is on swapoff's mmlist. */
+				if (unlikely(list_empty(&dst_mm->mmlist))) {
+					spin_lock(&mmlist_lock);
+					if (list_empty(&dst_mm->mmlist))
+						list_add(&dst_mm->mmlist,
+							 &src_mm->mmlist);
+					spin_unlock(&mmlist_lock);
+				}
 				rss[MM_SWAPENTS]++;
-			else if (is_migration_entry(entry)) {
+			} else if (is_migration_entry(entry)) {
 				page = migration_entry_to_page(entry);
 
 				if (PageAnon(page))



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

* [PATCH 3.17 06/47] mm: fix anon_vma_clone() error treatment
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 05/47] mm: fix swapoff hang after page migration and fork Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 07/47] slab: fix nodeid bounds check for non-contiguous node IDs Greg Kroah-Hartman
                   ` (37 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Forrest, Michal Hocko,
	Konstantin Khlebnikov, Andrea Arcangeli, Rik van Riel,
	Tim Hartrick, Hugh Dickins, Michel Lespinasse, Vlastimil Babka,
	Andrew Morton, Linus Torvalds

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

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

From: Daniel Forrest <dan.forrest@ssec.wisc.edu>

commit c4ea95d7cd08d9ffd7fa75e6c5e0332d596dd11e upstream.

Andrew Morton noticed that the error return from anon_vma_clone() was
being dropped and replaced with -ENOMEM (which is not itself a bug
because the only error return value from anon_vma_clone() is -ENOMEM).

I did an audit of callers of anon_vma_clone() and discovered an actual
bug where the error return was being lost.  In __split_vma(), between
Linux 3.11 and 3.12 the code was changed so the err variable is used
before the call to anon_vma_clone() and the default initial value of
-ENOMEM is overwritten.  So a failure of anon_vma_clone() will return
success since err at this point is now zero.

Below is a patch which fixes this bug and also propagates the error
return value from anon_vma_clone() in all cases.

Fixes: ef0855d334e1 ("mm: mempolicy: turn vma_set_policy() into vma_dup_policy()")
Signed-off-by: Daniel Forrest <dan.forrest@ssec.wisc.edu>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Tim Hartrick <tim@edgecast.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/mmap.c |   10 +++++++---
 mm/rmap.c |    6 ++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -752,8 +752,11 @@ again:			remove_next = 1 + (end > next->
 		 * shrinking vma had, to cover any anon pages imported.
 		 */
 		if (exporter && exporter->anon_vma && !importer->anon_vma) {
-			if (anon_vma_clone(importer, exporter))
-				return -ENOMEM;
+			int error;
+
+			error = anon_vma_clone(importer, exporter);
+			if (error)
+				return error;
 			importer->anon_vma = exporter->anon_vma;
 		}
 	}
@@ -2453,7 +2456,8 @@ static int __split_vma(struct mm_struct
 	if (err)
 		goto out_free_vma;
 
-	if (anon_vma_clone(new, vma))
+	err = anon_vma_clone(new, vma);
+	if (err)
 		goto out_free_mpol;
 
 	if (new->vm_file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -274,6 +274,7 @@ int anon_vma_fork(struct vm_area_struct
 {
 	struct anon_vma_chain *avc;
 	struct anon_vma *anon_vma;
+	int error;
 
 	/* Don't bother if the parent process has no anon_vma here. */
 	if (!pvma->anon_vma)
@@ -283,8 +284,9 @@ int anon_vma_fork(struct vm_area_struct
 	 * First, attach the new VMA to the parent VMA's anon_vmas,
 	 * so rmap can find non-COWed pages in child processes.
 	 */
-	if (anon_vma_clone(vma, pvma))
-		return -ENOMEM;
+	error = anon_vma_clone(vma, pvma);
+	if (error)
+		return error;
 
 	/* Then add our own anon_vma. */
 	anon_vma = anon_vma_alloc();



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

* [PATCH 3.17 07/47] slab: fix nodeid bounds check for non-contiguous node IDs
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 06/47] mm: fix anon_vma_clone() error treatment Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 08/47] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary Greg Kroah-Hartman
                   ` (36 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Paul Mackerras, Yasuaki Ishimatsu,
	Pekka Enberg, David Rientjes, Christoph Lameter, Joonsoo Kim,
	Andrew Morton, Linus Torvalds

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

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

From: Paul Mackerras <paulus@samba.org>

commit 7c3fbbdd04a681a1992ad6a3d7a36a63ff668753 upstream.

The bounds check for nodeid in ____cache_alloc_node gives false
positives on machines where the node IDs are not contiguous, leading to
a panic at boot time.  For example, on a POWER8 machine the node IDs are
typically 0, 1, 16 and 17.  This means that num_online_nodes() returns
4, so when ____cache_alloc_node is called with nodeid = 16 the VM_BUG_ON
triggers, like this:

  kernel BUG at /home/paulus/kernel/kvm/mm/slab.c:3079!
  Call Trace:
    .____cache_alloc_node+0x5c/0x270 (unreliable)
    .kmem_cache_alloc_node_trace+0xdc/0x360
    .init_list+0x3c/0x128
    .kmem_cache_init+0x1dc/0x258
    .start_kernel+0x2a0/0x568
    start_here_common+0x20/0xa8

To fix this, we instead compare the nodeid with MAX_NUMNODES, and
additionally make sure it isn't negative (since nodeid is an int).  The
check is there mainly to protect the array dereference in the get_node()
call in the next line, and the array being dereferenced is of size
MAX_NUMNODES.  If the nodeid is in range but invalid (for example if the
node is off-line), the BUG_ON in the next line will catch that.

Fixes: 14e50c6a9bc2 ("mm: slab: Verify the nodeid passed to ____cache_alloc_node")
Signed-off-by: Paul Mackerras <paulus@samba.org>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/slab.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3108,7 +3108,7 @@ static void *____cache_alloc_node(struct
 	void *obj;
 	int x;
 
-	VM_BUG_ON(nodeid > num_online_nodes());
+	VM_BUG_ON(nodeid < 0 || nodeid >= MAX_NUMNODES);
 	n = get_node(cachep, nodeid);
 	BUG_ON(!n);
 



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

* [PATCH 3.17 08/47] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 07/47] slab: fix nodeid bounds check for non-contiguous node IDs Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 09/47] drm/nouveau/gf116: remove copy1 engine Greg Kroah-Hartman
                   ` (35 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Seth Forshee, David Vrabel, David S. Miller

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

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

From: Seth Forshee <seth.forshee@canonical.com>

commit 8d609725d4357f499e2103e46011308b32f53513 upstream.

These BUGs can be erroneously triggered by frags which refer to
tail pages within a compound page. The data in these pages may
overrun the hardware page while still being contained within the
compound page, but since compound_order() evaluates to 0 for tail
pages the assertion fails. The code already iterates through
subsequent pages correctly in this scenario, so the BUGs are
unnecessary and can be removed.

Fixes: f36c374782e4 ("xen/netfront: handle compound page fragments on transmit")
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/xen-netfront.c |    5 -----
 1 file changed, 5 deletions(-)

--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -496,9 +496,6 @@ static void xennet_make_frags(struct sk_
 		len = skb_frag_size(frag);
 		offset = frag->page_offset;
 
-		/* Data must not cross a page boundary. */
-		BUG_ON(len + offset > PAGE_SIZE<<compound_order(page));
-
 		/* Skip unused frames from start of page */
 		page += offset >> PAGE_SHIFT;
 		offset &= ~PAGE_MASK;
@@ -506,8 +503,6 @@ static void xennet_make_frags(struct sk_
 		while (len > 0) {
 			unsigned long bytes;
 
-			BUG_ON(offset >= PAGE_SIZE);
-
 			bytes = PAGE_SIZE - offset;
 			if (bytes > len)
 				bytes = len;



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

* [PATCH 3.17 09/47] drm/nouveau/gf116: remove copy1 engine
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 08/47] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 10/47] nouveau: move the hotplug ignore to correct place Greg Kroah-Hartman
                   ` (34 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Ilia Mirkin, Ben Skeggs

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

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

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

commit 226d63a1addea8cbe8fc671978e62dc84927b046 upstream.

Indications are that no GF116's actually have a copy engine there, but
actually have the decompression engine. This engine can be made to do
copies, but that should be done separately.

Unclear why this didn't turn up on all GF116's, but perhaps the
non-mobile ones came with enough VRAM to not trigger ttm migrations in
test scenarios.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85465
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59168
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/nouveau/core/engine/device/nvc0.c |    1 -
 1 file changed, 1 deletion(-)

--- a/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
@@ -212,7 +212,6 @@ nvc0_identify(struct nouveau_device *dev
 		device->oclass[NVDEV_ENGINE_BSP    ] = &nvc0_bsp_oclass;
 		device->oclass[NVDEV_ENGINE_PPP    ] = &nvc0_ppp_oclass;
 		device->oclass[NVDEV_ENGINE_COPY0  ] = &nvc0_copy0_oclass;
-		device->oclass[NVDEV_ENGINE_COPY1  ] = &nvc0_copy1_oclass;
 		device->oclass[NVDEV_ENGINE_DISP   ] =  nva3_disp_oclass;
 		device->oclass[NVDEV_ENGINE_PERFMON] = &nvc0_perfmon_oclass;
 		break;



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

* [PATCH 3.17 10/47] nouveau: move the hotplug ignore to correct place.
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 09/47] drm/nouveau/gf116: remove copy1 engine Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 11/47] i2c: omap: fix NACK and Arbitration Lost irq handling Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Bjorn Helgaas, Dave Airlie

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

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

From: Dave Airlie <airlied@redhat.com>

commit 8b62c8c6df08ca567c78afa51aa7bbc554cede06 upstream.

Introduced in b440bde74f, however it was added to
the wrong function in nouveau.

https://bugzilla.kernel.org/show_bug.cgi?id=86011
Cc: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/nouveau/nouveau_drm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -626,7 +626,6 @@ int nouveau_pmops_suspend(struct device
 
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
-	pci_ignore_hotplug(pdev);
 	pci_set_power_state(pdev, PCI_D3hot);
 	return 0;
 }
@@ -930,6 +929,7 @@ static int nouveau_pmops_runtime_suspend
 	ret = nouveau_do_suspend(drm_dev, true);
 	pci_save_state(pdev);
 	pci_disable_device(pdev);
+	pci_ignore_hotplug(pdev);
 	pci_set_power_state(pdev, PCI_D3cold);
 	drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
 	return ret;



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

* [PATCH 3.17 11/47] i2c: omap: fix NACK and Arbitration Lost irq handling
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 10/47] nouveau: move the hotplug ignore to correct place Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 12/47] i2c: omap: fix i207 errata handling Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alexander Kochetkov, Felipe Balbi,
	Aaro Koskinen, Wolfram Sang

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

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

From: Alexander Kochetkov <al.kochet@gmail.com>

commit 27caca9d2e01c92b26d0690f065aad093fea01c7 upstream.

commit 1d7afc95946487945cc7f5019b41255b72224b70 (i2c: omap: ack IRQ in parts)
changed the interrupt handler to complete transfers without clearing
XRDY (AL case) and ARDY (NACK case) flags. XRDY or ARDY interrupts will be
fired again. As a result, ISR keep processing transfer after it was already
complete (from the driver code point of view).

A didn't see real impacts of the 1d7afc9, but it is really bad idea to
have ISR running on user data after transfer was complete.

It looks, what 1d7afc9 violate TI specs in what how AL and NACK should be
handled (see Note 1, sprugn4r, Figure 17-31 and Figure 17-32).

According to specs (if I understood correctly), in case of NACK and AL driver
must reset NACK, AL, ARDY, RDR, and RRDY (Master Receive Mode), and
NACK, AL, ARDY, and XDR (Master Transmitter Mode).

All that is done down the code under the if condition:
if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | OMAP_I2C_STAT_AL)) ...

The patch restore pre 1d7afc9 logic of handling NACK and AL interrupts, so
no interrupts is fired after ISR informs the rest of driver what transfer
complete.

Note: instead of removing break under NACK case, we could just replace 'break'
with 'continue' and allow NACK transfer to finish using ARDY event. I found
that NACK and ARDY bits usually set together. That case confirm TI wiki:
http://processors.wiki.ti.com/index.php/I2C_Tips#Detecting_and_handling_NACK

In order if someone interested in the event traces for NACK and AL cases,
I sent them to mailing list.

Tested on Beagleboard XM C.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Fixes: 1d7afc9 i2c: omap: ack IRQ in parts
Acked-by: Felipe Balbi <balbi@ti.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/i2c/busses/i2c-omap.c |    2 --
 1 file changed, 2 deletions(-)

--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -926,14 +926,12 @@ omap_i2c_isr_thread(int this_irq, void *
 		if (stat & OMAP_I2C_STAT_NACK) {
 			err |= OMAP_I2C_STAT_NACK;
 			omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK);
-			break;
 		}
 
 		if (stat & OMAP_I2C_STAT_AL) {
 			dev_err(dev->dev, "Arbitration lost\n");
 			err |= OMAP_I2C_STAT_AL;
 			omap_i2c_ack_stat(dev, OMAP_I2C_STAT_AL);
-			break;
 		}
 
 		/*



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

* [PATCH 3.17 12/47] i2c: omap: fix i207 errata handling
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 11/47] i2c: omap: fix NACK and Arbitration Lost irq handling Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 14/47] i2c: cadence: Set the hardware time-out register to maximum value Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alexander Kochetkov, Felipe Balbi,
	Wolfram Sang

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

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

From: Alexander Kochetkov <al.kochet@gmail.com>

commit ccfc866356674cb3a61829d239c685af6e85f197 upstream.

commit 6d9939f651419a63e091105663821f9c7d3fec37 (i2c: omap: split out [XR]DR
and [XR]RDY) changed the way how errata i207 (I2C: RDR Flag May Be Incorrectly
Set) get handled. 6d9939f6514 code doesn't correspond to workaround provided by
errata.

According to errata ISR must filter out spurious RDR before data read not after.
ISR must read RXSTAT to get number of bytes available to read. Because RDR
could be set while there could no data in the receive FIFO.

Restored pre 6d9939f6514 way of handling errata.

Found by code review. Real impact haven't seen.
Tested on Beagleboard XM C.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Fixes: 6d9939f651419a63e09110 i2c: omap: split out [XR]DR and [XR]RDY
Tested-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/i2c/busses/i2c-omap.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -956,11 +956,13 @@ omap_i2c_isr_thread(int this_irq, void *
 			if (dev->fifo_size)
 				num_bytes = dev->buf_len;
 
-			omap_i2c_receive_data(dev, num_bytes, true);
-
-			if (dev->errata & I2C_OMAP_ERRATA_I207)
+			if (dev->errata & I2C_OMAP_ERRATA_I207) {
 				i2c_omap_errata_i207(dev, stat);
+				num_bytes = (omap_i2c_read_reg(dev,
+					OMAP_I2C_BUFSTAT_REG) >> 8) & 0x3F;
+			}
 
+			omap_i2c_receive_data(dev, num_bytes, true);
 			omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RDR);
 			continue;
 		}



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

* [PATCH 3.17 14/47] i2c: cadence: Set the hardware time-out register to maximum value
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 12/47] i2c: omap: fix i207 errata handling Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 16/47] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Vishnu Motghare, Harini Katakam,
	Wolfram Sang

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

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

From: Vishnu Motghare <vishnum@xilinx.com>

commit 681d15a0f527af7ab3a783e1037de86fbcb136ac upstream.

Cadence I2C controller has bug wherein it generates invalid read transactions
after timeout in master receiver mode. This driver does not use the HW
timeout and this interrupt is disabled but the feature itself cannot be
disabled. Hence, this patch writes the maximum value (0xFF) to this register.
This is one of the workarounds to this bug and it will not avoid the issue
completely but reduces the chances of error.

Signed-off-by: Vishnu Motghare <vishnum@xilinx.com>
Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/i2c/busses/i2c-cadence.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -111,6 +111,8 @@
 #define CDNS_I2C_DIVA_MAX	4
 #define CDNS_I2C_DIVB_MAX	64
 
+#define CDNS_I2C_TIMEOUT_MAX	0xFF
+
 #define cdns_i2c_readreg(offset)       readl_relaxed(id->membase + offset)
 #define cdns_i2c_writereg(val, offset) writel_relaxed(val, id->membase + offset)
 
@@ -852,6 +854,15 @@ static int cdns_i2c_probe(struct platfor
 		goto err_clk_dis;
 	}
 
+	/*
+	 * Cadence I2C controller has a bug wherein it generates
+	 * invalid read transaction after HW timeout in master receiver mode.
+	 * HW timeout is not used by this driver and the interrupt is disabled.
+	 * But the feature itself cannot be disabled. Hence maximum value
+	 * is written to this register to reduce the chances of error.
+	 */
+	cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET);
+
 	dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n",
 		 id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq);
 



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

* [PATCH 3.17 16/47] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 14/47] i2c: cadence: Set the hardware time-out register to maximum value Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 17/47] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Helge Deller, Petr Mladek, Alex Deucher

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

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

From: Petr Mladek <pmladek@suse.cz>

commit f5475cc43c899e33098d4db44b7c5e710f16589d upstream.

I was unable too boot 3.18.0-rc6 because of the following kernel
panic in drm_calc_vbltimestamp_from_scanoutpos():

    [drm] Initialized drm 1.1.0 20060810
    [drm] radeon kernel modesetting enabled.
    [drm] initializing kernel modesetting (RV100 0x1002:0x515E 0x15D9:0x8080).
    [drm] register mmio base: 0xC8400000
    [drm] register mmio size: 65536
    radeon 0000:0b:01.0: VRAM: 128M 0x00000000D0000000 - 0x00000000D7FFFFFF (16M used)
    radeon 0000:0b:01.0: GTT: 512M 0x00000000B0000000 - 0x00000000CFFFFFFF
    [drm] Detected VRAM RAM=128M, BAR=128M
    [drm] RAM width 16bits DDR
    [TTM] Zone  kernel: Available graphics memory: 3829346 kiB
    [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
    [TTM] Initializing pool allocator
    [TTM] Initializing DMA pool allocator
    [drm] radeon: 16M of VRAM memory ready
    [drm] radeon: 512M of GTT memory ready.
    [drm] GART: num cpu pages 131072, num gpu pages 131072
    [drm] PCI GART of 512M enabled (table at 0x0000000037880000).
    radeon 0000:0b:01.0: WB disabled
    radeon 0000:0b:01.0: fence driver on ring 0 use gpu addr 0x00000000b0000000 and cpu addr 0xffff8800bbbfa000
    [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [drm] Driver supports precise vblank timestamp query.
    [drm] radeon: irq initialized.
    [drm] Loading R100 Microcode
    radeon 0000:0b:01.0: Direct firmware load for radeon/R100_cp.bin failed with error -2
    radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
    [drm:r100_cp_init] *ERROR* Failed to load firmware!
    radeon 0000:0b:01.0: failed initializing CP (-2).
    radeon 0000:0b:01.0: Disabling GPU acceleration
    [drm] radeon: cp finalized
    BUG: unable to handle kernel NULL pointer dereference at 000000000000025c
    IP: [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
    PGD 0
    Oops: 0000 [#1] SMP
    Modules linked in:
    CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc6-4-default #2649
    Hardware name: Supermicro X7DB8/X7DB8, BIOS 6.00 07/26/2006
    task: ffff880234da2010 ti: ffff880234da4000 task.ti: ffff880234da4000
    RIP: 0010:[<ffffffff8150423b>]  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
    RSP: 0000:ffff880234da7918  EFLAGS: 00010086
    RAX: ffffffff81557890 RBX: 0000000000000000 RCX: ffff880234da7a48
    RDX: ffff880234da79f4 RSI: 0000000000000000 RDI: ffff880232e15000
    RBP: ffff880234da79b8 R08: 0000000000000000 R09: 0000000000000000
    R10: 000000000000000a R11: 0000000000000001 R12: ffff880232dda1c0
    R13: ffff880232e1518c R14: 0000000000000292 R15: ffff880232e15000
    FS:  0000000000000000(0000) GS:ffff88023fc40000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 000000000000025c CR3: 0000000002014000 CR4: 00000000000007e0
    Stack:
     ffff880234da79d8 0000000000000286 ffff880232dcbc00 0000000000002480
     ffff880234da7958 0000000000000296 ffff880234da7998 ffffffff8151b51d
     ffff880234da7a48 0000000032dcbeb0 ffff880232dcbc00 ffff880232dcbc58
    Call Trace:
     [<ffffffff8151b51d>] ? drm_vma_offset_remove+0x1d/0x110
     [<ffffffff8152dc98>] radeon_get_vblank_timestamp_kms+0x38/0x60
     [<ffffffff8152076a>] ? ttm_bo_release_list+0xba/0x180
     [<ffffffff81503751>] drm_get_last_vbltimestamp+0x41/0x70
     [<ffffffff81503933>] vblank_disable_and_save+0x73/0x1d0
     [<ffffffff81106b2f>] ? try_to_del_timer_sync+0x4f/0x70
     [<ffffffff81505245>] drm_vblank_cleanup+0x65/0xa0
     [<ffffffff815604fa>] radeon_irq_kms_fini+0x1a/0x70
     [<ffffffff8156c07e>] r100_init+0x26e/0x410
     [<ffffffff8152ae3e>] radeon_device_init+0x7ae/0xb50
     [<ffffffff8152d57f>] radeon_driver_load_kms+0x8f/0x210
     [<ffffffff81506965>] drm_dev_register+0xb5/0x110
     [<ffffffff8150998f>] drm_get_pci_dev+0x8f/0x200
     [<ffffffff815291cd>] radeon_pci_probe+0xad/0xe0
     [<ffffffff8141a365>] local_pci_probe+0x45/0xa0
     [<ffffffff8141b741>] pci_device_probe+0xd1/0x130
     [<ffffffff81633dad>] driver_probe_device+0x12d/0x3e0
     [<ffffffff8163413b>] __driver_attach+0x9b/0xa0
     [<ffffffff816340a0>] ? __device_attach+0x40/0x40
     [<ffffffff81631cd3>] bus_for_each_dev+0x63/0xa0
     [<ffffffff8163378e>] driver_attach+0x1e/0x20
     [<ffffffff81633390>] bus_add_driver+0x180/0x240
     [<ffffffff81634914>] driver_register+0x64/0xf0
     [<ffffffff81419cac>] __pci_register_driver+0x4c/0x50
     [<ffffffff81509bf5>] drm_pci_init+0xf5/0x120
     [<ffffffff821dc871>] ? ttm_init+0x6a/0x6a
     [<ffffffff821dc908>] radeon_init+0x97/0xb5
     [<ffffffff810002fc>] do_one_initcall+0xbc/0x1f0
     [<ffffffff810e3278>] ? __wake_up+0x48/0x60
     [<ffffffff8218e256>] kernel_init_freeable+0x18a/0x215
     [<ffffffff8218d983>] ? initcall_blacklist+0xc0/0xc0
     [<ffffffff818a78f0>] ? rest_init+0x80/0x80
     [<ffffffff818a78fe>] kernel_init+0xe/0xf0
     [<ffffffff818c0c3c>] ret_from_fork+0x7c/0xb0
     [<ffffffff818a78f0>] ? rest_init+0x80/0x80
    Code: 45 ac 0f 88 a8 01 00 00 3b b7 d0 01 00 00 49 89 ff 0f 83 99 01 00 00 48 8b 47 20 48 8b 80 88 00 00 00 48 85 c0 0f 84 cd 01 00 00 <41> 8b b1 5c 02 00 00 41 8b 89 58 02 00 00 89 75 98 41 8b b1 60
    RIP  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
     RSP <ffff880234da7918>
    CR2: 000000000000025c
    ---[ end trace ad2c0aadf48e2032 ]---
    Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009

It has helped me to add a NULL pointer check that was suggested at
http://lists.freedesktop.org/archives/dri-devel/2014-October/070663.html

I am not familiar with the code. But the change looks sane
and we need something fast at this stage of 3.18 development.

Suggested-by: Helge Deller <deller@gmx.de>
Signed-off-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/radeon/radeon_kms.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -795,6 +795,8 @@ int radeon_get_vblank_timestamp_kms(stru
 
 	/* Get associated drm_crtc: */
 	drmcrtc = &rdev->mode_info.crtcs[crtc]->base;
+	if (!drmcrtc)
+		return -EINVAL;
 
 	/* Helper routine in DRM core does all the work: */
 	return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error,



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

* [PATCH 3.17 17/47] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 16/47] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 18/47] drm/i915: More cautious with pch fifo underruns Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Ian Campbell, Grant Likely, Rob Herring

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

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

From: Ian Campbell <ian.campbell@citrix.com>

commit 094cb98179f19b75acf9ff471daabf3948ce98e6 upstream.

memblock_is_region_reserved() returns true in the case of a partial
overlap, meaning that the current code fails to reserve the
non-overlapping portion.

This call was introduced as part of d1552ce449eb "of/fdt: move
memreserve and dtb memory reservations into core" which went into
v3.16.

I observed this causing a Midway system with a buggy fdt (the header
declares itself to be larger than it really is) failing to boot
because the over-inflated size of the fdt was causing it to seem to
run into the swapper_pg_dir region, meaning the DT wasn't reserved.
The symptoms were failing to find an disks or network and failing to
boot.

However given the ambiguity of whether things like the initrd are
covered by /memreserve/ and similar I think it is best to also
register the region rather than just ignoring it.

Since memblock_reserve() handles overlaps just fine lets just warn and
carry on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/of/fdt.c |    2 --
 1 file changed, 2 deletions(-)

--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -964,8 +964,6 @@ void __init __weak early_init_dt_add_mem
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
 					phys_addr_t size, bool nomap)
 {
-	if (memblock_is_region_reserved(base, size))
-		return -EBUSY;
 	if (nomap)
 		return memblock_remove(base, size);
 	return memblock_reserve(base, size);



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

* [PATCH 3.17 18/47] drm/i915: More cautious with pch fifo underruns
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 17/47] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 19/47] drm/i915: Unlock panel even when LVDS is disabled Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Daniel Vetter, lu hua, Paulo Zanoni,
	Jani Nikula

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

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

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

commit b68362278af94e1171f5be9d4e44988601fb0439 upstream.

Apparently PCH fifo underruns are tricky, we have plenty reports that
we see the occasional underrun (especially at boot-up).

So for a change let's see what happens when we don't re-enable pch
fifo underrun reporting when the pipe is disabled. This means that the
kernel can't catch pch fifo underruns when they happen (except when
all pipes are on on the pch). But we'll still catch underruns when
disabling the pipe again. So not a terrible reduction in test
coverage.

Since the DRM_ERROR is new and hence a regression plan B would be to
revert it back to a debug output. Which would be a lot worse than this
hack for underrun test coverage in the wild. See the referenced
discussions for more.

References: http://mid.gmane.org/CA+gsUGRfGe3t4NcjdeA=qXysrhLY3r4CEu7z4bjTwxi1uOfy+g@mail.gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85898
References: https://bugs.freedesktop.org/show_bug.cgi?id=85898
References: https://bugs.freedesktop.org/show_bug.cgi?id=86233
References: https://bugs.freedesktop.org/show_bug.cgi?id=86478
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Tested-by: lu hua <huax.lu@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/intel_display.c |    2 --
 1 file changed, 2 deletions(-)

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4209,7 +4209,6 @@ static void ironlake_crtc_disable(struct
 		ironlake_fdi_disable(crtc);
 
 		ironlake_disable_pch_transcoder(dev_priv, pipe);
-		intel_set_pch_fifo_underrun_reporting(dev, pipe, true);
 
 		if (HAS_PCH_CPT(dev)) {
 			/* disable TRANS_DP_CTL */
@@ -4274,7 +4273,6 @@ static void haswell_crtc_disable(struct
 
 	if (intel_crtc->config.has_pch_encoder) {
 		lpt_disable_pch_transcoder(dev_priv);
-		intel_set_pch_fifo_underrun_reporting(dev, TRANSCODER_A, true);
 		intel_ddi_fdi_disable(crtc);
 	}
 



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

* [PATCH 3.17 19/47] drm/i915: Unlock panel even when LVDS is disabled
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 18/47] drm/i915: More cautious with pch fifo underruns Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 20/47] x86: Use $(OBJDUMP) instead of plain objdump Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Alexey Orishko, Chris Wilson,
	Francois Tigeot, Daniel Vetter, Jani Nikula

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

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

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

commit b0616c5306b342ceca07044dbc4f917d95c4f825 upstream.

Otherwise we'll have backtraces in assert_panel_unlocked because the
BIOS locks the register. In the reporter's case this regression was
introduced in

commit c31407a3672aaebb4acddf90944a114fa5c8af7b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Oct 18 21:07:01 2012 +0100

    drm/i915: Add no-lvds quirk for Supermicro X7SPA-H

Reported-by: Alexey Orishko <alexey.orishko@gmail.com>
Cc: Alexey Orishko <alexey.orishko@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Francois Tigeot <ftigeot@wolfpond.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Tested-by: Alexey Orishko <alexey.orishko@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/i915/intel_lvds.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -900,6 +900,17 @@ void intel_lvds_init(struct drm_device *
 	int pipe;
 	u8 pin;
 
+	/*
+	 * Unlock registers and just leave them unlocked. Do this before
+	 * checking quirk lists to avoid bogus WARNINGs.
+	 */
+	if (HAS_PCH_SPLIT(dev)) {
+		I915_WRITE(PCH_PP_CONTROL,
+			   I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS);
+	} else {
+		I915_WRITE(PP_CONTROL,
+			   I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
+	}
 	if (!intel_lvds_supported(dev))
 		return;
 
@@ -1098,17 +1109,6 @@ out:
 	lvds_encoder->a3_power = I915_READ(lvds_encoder->reg) &
 				 LVDS_A3_POWER_MASK;
 
-	/*
-	 * Unlock registers and just
-	 * leave them unlocked
-	 */
-	if (HAS_PCH_SPLIT(dev)) {
-		I915_WRITE(PCH_PP_CONTROL,
-			   I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS);
-	} else {
-		I915_WRITE(PP_CONTROL,
-			   I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
-	}
 	lvds_connector->lid_notifier.notifier_call = intel_lid_notify;
 	if (acpi_lid_notifier_register(&lvds_connector->lid_notifier)) {
 		DRM_DEBUG_KMS("lid notifier registration failed\n");



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

* [PATCH 3.17 20/47] x86: Use $(OBJDUMP) instead of plain objdump
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 19/47] drm/i915: Unlock panel even when LVDS is disabled Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 22/47] media: s2255drv: fix payload size for JPG, MJPEG Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Chris Clayton, Kees Cook,
	Borislav Petkov, Junjie Mao, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner

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

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

From: Chris Clayton <chris2553@googlemail.com>

commit e2e68ae688b0a3766cd75aedf4ed4e39be402009 upstream.

commit e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
broke the cross compile of x86. It added a objdump invocation, which
invokes the host native objdump and ignores an active cross tool
chain.

Use $(OBJDUMP) instead which takes the CROSS_COMPILE prefix into
account.

[ tglx: Massage changelog and use $(OBJDUMP) ]

Fixes: e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
Signed-off-by: Chris Clayton <chris2553@googlemail.com>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Junjie Mao <eternal.n08@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/54705C8E.1080400@googlemail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/boot/compressed/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -75,7 +75,7 @@ suffix-$(CONFIG_KERNEL_XZ)	:= xz
 suffix-$(CONFIG_KERNEL_LZO) 	:= lzo
 suffix-$(CONFIG_KERNEL_LZ4) 	:= lz4
 
-RUN_SIZE = $(shell objdump -h vmlinux | \
+RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \
 	     perl $(srctree)/arch/x86/tools/calc_run_size.pl)
 quiet_cmd_mkpiggy = MKPIGGY $@
       cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )



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

* [PATCH 3.17 22/47] media: s2255drv: fix payload size for JPG, MJPEG
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 20/47] x86: Use $(OBJDUMP) instead of plain objdump Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 23/47] media: smiapp: Only some selection targets are settable Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dean Anderson, Hans Verkuil,
	Mauro Carvalho Chehab

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

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

From: sensoray-dev <linux-dev@sensoray.com>

commit 1f391217ad8d7cd7b1e48e6e2abf49970cd91d18 upstream.

length is the size of the buffer, not the payload. That's set using
vb2_set_plane_payload().

Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/usb/s2255/s2255drv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -632,7 +632,7 @@ static void s2255_fillbuff(struct s2255_
 			break;
 		case V4L2_PIX_FMT_JPEG:
 		case V4L2_PIX_FMT_MJPEG:
-			buf->vb.v4l2_buf.length = jpgsize;
+			vb2_set_plane_payload(&buf->vb, 0, jpgsize);
 			memcpy(vbuf, tmpbuf, jpgsize);
 			break;
 		case V4L2_PIX_FMT_YUV422P:



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

* [PATCH 3.17 23/47] media: smiapp: Only some selection targets are settable
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 22/47] media: s2255drv: fix payload size for JPG, MJPEG Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:20 ` [PATCH 3.17 24/47] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sakari Ailus, Mauro Carvalho Chehab

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

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

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

commit b31eb901c4e5eeef4c83c43dfbc7fe0d4348cb21 upstream.

Setting a non-settable selection target caused BUG() to be called. The check
for valid selections only takes the selection target into account, but does
not tell whether it may be set, or only get. Fix the issue by simply
returning an error to the user.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/i2c/smiapp/smiapp-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2133,7 +2133,7 @@ static int smiapp_set_selection(struct v
 		ret = smiapp_set_compose(subdev, fh, sel);
 		break;
 	default:
-		BUG();
+		ret = -EINVAL;
 	}
 
 	mutex_unlock(&sensor->mutex);



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

* [PATCH 3.17 24/47] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 23/47] media: smiapp: Only some selection targets are settable Greg Kroah-Hartman
@ 2014-12-14 20:20 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 25/47] ahci: disable MSI on SAMSUNG 0xa800 SSD Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Devin Ryles, Tejun Heo

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

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

From: Devin Ryles <devin.ryles@intel.com>

commit 249cd0a187ed4ef1d0af7f74362cc2791ec5581b upstream.

This patch adds DeviceIDs for Sunrise Point-LP.

Signed-off-by: Devin Ryles <devin.ryles@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/ahci.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -321,6 +321,9 @@ static const struct pci_device_id ahci_p
 	{ PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */
 	{ PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
 	{ PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */
+	{ PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise Point-LP AHCI */
+	{ PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */
+	{ PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */
 	{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */
 	{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */
 	{ PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */



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

* [PATCH 3.17 25/47] ahci: disable MSI on SAMSUNG 0xa800 SSD
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2014-12-14 20:20 ` [PATCH 3.17 24/47] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 26/47] sata_fsl: fix error handling of irq_of_parse_and_map Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Tejun Heo, Dominik Mierzejewski

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

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

From: Tejun Heo <tj@kernel.org>

commit 2b21ef0aae65f22f5ba86b13c4588f6f0c2dbefb upstream.

Just like 0x1600 which got blacklisted by 66a7cbc303f4 ("ahci: disable
MSI instead of NCQ on Samsung pci-e SSDs on macbooks"), 0xa800 chokes
on NCQ commands if MSI is enabled.  Disable MSI.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Dominik Mierzejewski <dominik@greysector.net>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=89171
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/ahci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -495,6 +495,7 @@ static const struct pci_device_id ahci_p
 	 * enabled.  https://bugzilla.kernel.org/show_bug.cgi?id=60731
 	 */
 	{ PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_nomsi },
+	{ PCI_VDEVICE(SAMSUNG, 0xa800), board_ahci_nomsi },
 
 	/* Enmotus */
 	{ PCI_DEVICE(0x1c44, 0x8000), board_ahci },



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

* [PATCH 3.17 26/47] sata_fsl: fix error handling of irq_of_parse_and_map
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 25/47] ahci: disable MSI on SAMSUNG 0xa800 SSD Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 27/47] ip_tunnel: the lack of vti_link_ops dellink() cause kernel panic Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Dmitry Torokhov, Tejun Heo

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

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

From: Dmitry Torokhov <dtor@chromium.org>

commit aad0b624129709c94c2e19e583b6053520353fa8 upstream.

irq_of_parse_and_map() returns 0 on error (the result is unsigned int),
so testing for negative result never works.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/sata_fsl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1488,7 +1488,7 @@ static int sata_fsl_probe(struct platfor
 	host_priv->csr_base = csr_base;
 
 	irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
-	if (irq < 0) {
+	if (!irq) {
 		dev_err(&ofdev->dev, "invalid irq from platform\n");
 		goto error_exit_with_cleanup;
 	}



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

* [PATCH 3.17 27/47] ip_tunnel: the lack of vti_link_ops dellink() cause kernel panic
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 26/47] sata_fsl: fix error handling of irq_of_parse_and_map Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 28/47] ipv6: gre: fix wrong skb->protocol in WCCP Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Xin Long, Cong Wang, David S. Miller

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

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

From: lucien <lucien.xin@gmail.com>

[ Upstream commit 20ea60ca9952bd19d4b0d74719daba305aef5178 ]

Now the vti_link_ops do not point the .dellink, for fb tunnel device
(ip_vti0), the net_device will be removed as the default .dellink is
unregister_netdevice_queue,but the tunnel still in the tunnel list,
then if we add a new vti tunnel, in ip_tunnel_find():

        hlist_for_each_entry_rcu(t, head, hash_node) {
                if (local == t->parms.iph.saddr &&
                    remote == t->parms.iph.daddr &&
                    link == t->parms.link &&
==>                 type == t->dev->type &&
                    ip_tunnel_key_match(&t->parms, flags, key))
                        break;
        }

the panic will happen, cause dev of ip_tunnel *t is null:
[ 3835.072977] IP: [<ffffffffa04103fd>] ip_tunnel_find+0x9d/0xc0 [ip_tunnel]
[ 3835.073008] PGD b2c21067 PUD b7277067 PMD 0
[ 3835.073008] Oops: 0000 [#1] SMP
.....
[ 3835.073008] Stack:
[ 3835.073008]  ffff8800b72d77f0 ffffffffa0411924 ffff8800bb956000 ffff8800b72d78e0
[ 3835.073008]  ffff8800b72d78a0 0000000000000000 ffffffffa040d100 ffff8800b72d7858
[ 3835.073008]  ffffffffa040b2e3 0000000000000000 0000000000000000 0000000000000000
[ 3835.073008] Call Trace:
[ 3835.073008]  [<ffffffffa0411924>] ip_tunnel_newlink+0x64/0x160 [ip_tunnel]
[ 3835.073008]  [<ffffffffa040b2e3>] vti_newlink+0x43/0x70 [ip_vti]
[ 3835.073008]  [<ffffffff8150d4da>] rtnl_newlink+0x4fa/0x5f0
[ 3835.073008]  [<ffffffff812f68bb>] ? nla_strlcpy+0x5b/0x70
[ 3835.073008]  [<ffffffff81508fb0>] ? rtnl_link_ops_get+0x40/0x60
[ 3835.073008]  [<ffffffff8150d11f>] ? rtnl_newlink+0x13f/0x5f0
[ 3835.073008]  [<ffffffff81509cf4>] rtnetlink_rcv_msg+0xa4/0x270
[ 3835.073008]  [<ffffffff8126adf5>] ? sock_has_perm+0x75/0x90
[ 3835.073008]  [<ffffffff81509c50>] ? rtnetlink_rcv+0x30/0x30
[ 3835.073008]  [<ffffffff81529e39>] netlink_rcv_skb+0xa9/0xc0
[ 3835.073008]  [<ffffffff81509c48>] rtnetlink_rcv+0x28/0x30
....

modprobe ip_vti
ip link del ip_vti0 type vti
ip link add ip_vti0 type vti
rmmod ip_vti

do that one or more times, kernel will panic.

fix it by assigning ip_tunnel_dellink to vti_link_ops' dellink, in
which we skip the unregister of fb tunnel device. do the same on ip6_vti.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/ip_vti.c  |    1 +
 net/ipv6/ip6_vti.c |   11 +++++++++++
 2 files changed, 12 insertions(+)

--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -528,6 +528,7 @@ static struct rtnl_link_ops vti_link_ops
 	.validate	= vti_tunnel_validate,
 	.newlink	= vti_newlink,
 	.changelink	= vti_changelink,
+	.dellink        = ip_tunnel_dellink,
 	.get_size	= vti_get_size,
 	.fill_info	= vti_fill_info,
 };
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -905,6 +905,15 @@ static int vti6_newlink(struct net *src_
 	return vti6_tnl_create2(dev);
 }
 
+static void vti6_dellink(struct net_device *dev, struct list_head *head)
+{
+	struct net *net = dev_net(dev);
+	struct vti6_net *ip6n = net_generic(net, vti6_net_id);
+
+	if (dev != ip6n->fb_tnl_dev)
+		unregister_netdevice_queue(dev, head);
+}
+
 static int vti6_changelink(struct net_device *dev, struct nlattr *tb[],
 			   struct nlattr *data[])
 {
@@ -980,6 +989,7 @@ static struct rtnl_link_ops vti6_link_op
 	.setup		= vti6_dev_setup,
 	.validate	= vti6_validate,
 	.newlink	= vti6_newlink,
+	.dellink	= vti6_dellink,
 	.changelink	= vti6_changelink,
 	.get_size	= vti6_get_size,
 	.fill_info	= vti6_fill_info,
@@ -1020,6 +1030,7 @@ static int __net_init vti6_init_net(stru
 	if (!ip6n->fb_tnl_dev)
 		goto err_alloc_dev;
 	dev_net_set(ip6n->fb_tnl_dev, net);
+	ip6n->fb_tnl_dev->rtnl_link_ops = &vti6_link_ops;
 
 	err = vti6_fb_tnl_dev_init(ip6n->fb_tnl_dev);
 	if (err < 0)



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

* [PATCH 3.17 28/47] ipv6: gre: fix wrong skb->protocol in WCCP
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 27/47] ip_tunnel: the lack of vti_link_ops dellink() cause kernel panic Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 29/47] vxlan: Fix boolean flip in VXLAN_F_UDP_ZERO_CSUM6_[TX|RX] Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Dmitry Kozlov, Yuri Chislov,
	Daniel Borkmann, David S. Miller

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

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

From: Yuri Chislov <yuri.chislov@gmail.com>

[ Upstream commit be6572fdb1bfbe23b2624d477de50af50b02f5d6 ]

When using GRE redirection in WCCP, it sets the wrong skb->protocol,
that is, ETH_P_IP instead of ETH_P_IPV6 for the encapuslated traffic.

Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Yuri Chislov <yuri.chislov@gmail.com>
Tested-by: Yuri Chislov <yuri.chislov@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv6/ip6_gre.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -502,11 +502,11 @@ static int ip6gre_rcv(struct sk_buff *sk
 
 		skb->protocol = gre_proto;
 		/* WCCP version 1 and 2 protocol decoding.
-		 * - Change protocol to IP
+		 * - Change protocol to IPv6
 		 * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header
 		 */
 		if (flags == 0 && gre_proto == htons(ETH_P_WCCP)) {
-			skb->protocol = htons(ETH_P_IP);
+			skb->protocol = htons(ETH_P_IPV6);
 			if ((*(h + offset) & 0xF0) != 0x40)
 				offset += 4;
 		}



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

* [PATCH 3.17 29/47] vxlan: Fix boolean flip in VXLAN_F_UDP_ZERO_CSUM6_[TX|RX]
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 28/47] ipv6: gre: fix wrong skb->protocol in WCCP Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 30/47] Fix race condition between vxlan_sock_add and vxlan_sock_release Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Tom Herbert, Alexander Duyck,
	David S. Miller

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

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

From: Alexander Duyck <alexander.h.duyck@redhat.com>

[ Upstream commit 3dc2b6a8d38cf6c7604ec25f3d50d6ec8da04435 ]

In "vxlan: Call udp_sock_create" there was a logic error that resulted in
the default for IPv6 VXLAN tunnels going from using checksums to not using
checksums.  Since there is currently no support in iproute2 for setting
these values it means that a kernel after the change cannot talk over a IPv6
VXLAN tunnel to a kernel prior the change.

Fixes: 3ee64f3 ("vxlan: Call udp_sock_create")

Cc: Tom Herbert <therbert@google.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Acked-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/vxlan.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2362,9 +2362,9 @@ static struct socket *vxlan_create_sock(
 	if (ipv6) {
 		udp_conf.family = AF_INET6;
 		udp_conf.use_udp6_tx_checksums =
-		    !!(flags & VXLAN_F_UDP_ZERO_CSUM6_TX);
+		    !(flags & VXLAN_F_UDP_ZERO_CSUM6_TX);
 		udp_conf.use_udp6_rx_checksums =
-		    !!(flags & VXLAN_F_UDP_ZERO_CSUM6_RX);
+		    !(flags & VXLAN_F_UDP_ZERO_CSUM6_RX);
 	} else {
 		udp_conf.family = AF_INET;
 		udp_conf.local_ip.s_addr = INADDR_ANY;



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

* [PATCH 3.17 30/47] Fix race condition between vxlan_sock_add and vxlan_sock_release
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 29/47] vxlan: Fix boolean flip in VXLAN_F_UDP_ZERO_CSUM6_[TX|RX] Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 31/47] tg3: fix ring init when there are more TX than RX channels Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Marcelo Ricardo Leitner, David S. Miller

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

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

From: Marcelo Leitner <mleitner@redhat.com>

[ Upstream commit 00c83b01d58068dfeb2e1351cca6fccf2a83fa8f ]

Currently, when trying to reuse a socket, vxlan_sock_add will grab
vn->sock_lock, locate a reusable socket, inc refcount and release
vn->sock_lock.

But vxlan_sock_release() will first decrement refcount, and then grab
that lock. refcnt operations are atomic but as currently we have
deferred works which hold vs->refcnt each, this might happen, leading to
a use after free (specially after vxlan_igmp_leave):

  CPU 1                            CPU 2

deferred work                    vxlan_sock_add
  ...                              ...
                                   spin_lock(&vn->sock_lock)
                                   vs = vxlan_find_sock();
  vxlan_sock_release
    dec vs->refcnt, reaches 0
    spin_lock(&vn->sock_lock)
                                   vxlan_sock_hold(vs), refcnt=1
                                   spin_unlock(&vn->sock_lock)
    hlist_del_rcu(&vs->hlist);
    vxlan_notify_del_rx_port(vs)
    spin_unlock(&vn->sock_lock)

So when we look for a reusable socket, we check if it wasn't freed
already before reusing it.

Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Fixes: 7c47cedf43a8b3 ("vxlan: move IGMP join/leave to work queue")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/vxlan.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2050,9 +2050,8 @@ static int vxlan_init(struct net_device
 	spin_lock(&vn->sock_lock);
 	vs = vxlan_find_sock(vxlan->net, ipv6 ? AF_INET6 : AF_INET,
 			     vxlan->dst_port);
-	if (vs) {
+	if (vs && atomic_add_unless(&vs->refcnt, 1, 0)) {
 		/* If we have a socket with same port already, reuse it */
-		atomic_inc(&vs->refcnt);
 		vxlan_vs_add_dev(vs, vxlan);
 	} else {
 		/* otherwise make new socket outside of RTNL */
@@ -2459,12 +2458,9 @@ struct vxlan_sock *vxlan_sock_add(struct
 
 	spin_lock(&vn->sock_lock);
 	vs = vxlan_find_sock(net, ipv6 ? AF_INET6 : AF_INET, port);
-	if (vs) {
-		if (vs->rcv == rcv)
-			atomic_inc(&vs->refcnt);
-		else
+	if (vs && ((vs->rcv != rcv) ||
+		   !atomic_add_unless(&vs->refcnt, 1, 0)))
 			vs = ERR_PTR(-EBUSY);
-	}
 	spin_unlock(&vn->sock_lock);
 
 	if (!vs)



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

* [PATCH 3.17 31/47] tg3: fix ring init when there are more TX than RX channels
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 30/47] Fix race condition between vxlan_sock_add and vxlan_sock_release Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 32/47] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Thadeu Lima de Souza Cascardo,
	David S. Miller

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

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

From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>

[ Upstream commit a620a6bc1c94c22d6c312892be1e0ae171523125 ]

If TX channels are set to 4 and RX channels are set to less than 4,
using ethtool -L, the driver will try to initialize more RX channels
than it has allocated, causing an oops.

This fix only initializes the RX ring if it has been allocated.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/broadcom/tg3.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8561,7 +8561,8 @@ static int tg3_init_rings(struct tg3 *tp
 		if (tnapi->rx_rcb)
 			memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
 
-		if (tg3_rx_prodring_alloc(tp, &tnapi->prodring)) {
+		if (tnapi->prodring.rx_std &&
+		    tg3_rx_prodring_alloc(tp, &tnapi->prodring)) {
 			tg3_free_rings(tp);
 			return -ENOMEM;
 		}



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

* [PATCH 3.17 32/47] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 31/47] tg3: fix ring init when there are more TX than RX channels Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 33/47] net-timestamp: make tcp_recvmsg call ipv6_recv_error for AF_INET6 socks Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jack Morgenstein, Or Gerlitz,
	David S. Miller

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

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

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

[ Upstream commit 2d5c57d7fbfaa642fb7f0673df24f32b83d9066c ]

Some VF drivers use the upper byte of "param1" (the qp count field)
in mlx4_qp_reserve_range() to pass flags which are used to optimize
the range allocation.

Under the current code, if any of these flags are set, the 32-bit
count field yields a count greater than 2^24, which is out of range,
and this VF fails.

As these flags represent a "best-effort" allocation hint anyway, they may
safely be ignored. Therefore, the PF driver may simply mask out the bits.

Fixes: c82e9aa0a8 "mlx4_core: resource tracking for HCA resources used by guests"
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -1546,7 +1546,7 @@ static int qp_alloc_res(struct mlx4_dev
 
 	switch (op) {
 	case RES_OP_RESERVE:
-		count = get_param_l(&in_param);
+		count = get_param_l(&in_param) & 0xffffff;
 		align = get_param_h(&in_param);
 		err = mlx4_grant_resource(dev, slave, RES_QP, count, 0);
 		if (err)



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

* [PATCH 3.17 33/47] net-timestamp: make tcp_recvmsg call ipv6_recv_error for AF_INET6 socks
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 32/47] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 34/47] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Willem de Bruijn, David S. Miller

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

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

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

[ Upstream commit f4713a3dfad045d46afcb9c2a7d0bba288920ed4 ]

TCP timestamping introduced MSG_ERRQUEUE handling for TCP sockets.
If the socket is of family AF_INET6, call ipv6_recv_error instead
of ip_recv_error.

This change is more complex than a single branch due to the loadable
ipv6 module. It reuses a pre-existing indirect function call from
ping. The ping code is safe to call, because it is part of the core
ipv6 module and always present when AF_INET6 sockets are active.

Fixes: 4ed2d765 (net-timestamp: TCP timestamping)
Signed-off-by: Willem de Bruijn <willemb@google.com>

----

It may also be worthwhile to add WARN_ON_ONCE(sk->family == AF_INET6)
to ip_recv_error.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/net/inet_common.h |    2 ++
 net/ipv4/af_inet.c        |   11 +++++++++++
 net/ipv4/ping.c           |   12 ++----------
 net/ipv4/tcp.c            |    2 +-
 4 files changed, 16 insertions(+), 11 deletions(-)

--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -37,6 +37,8 @@ int inet_ioctl(struct socket *sock, unsi
 int inet_ctl_sock_create(struct sock **sk, unsigned short family,
 			 unsigned short type, unsigned char protocol,
 			 struct net *net);
+int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,
+		    int *addr_len);
 
 static inline void inet_ctl_sock_destroy(struct sock *sk)
 {
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1421,6 +1421,17 @@ out:
 	return pp;
 }
 
+int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
+{
+	if (sk->sk_family == AF_INET)
+		return ip_recv_error(sk, msg, len, addr_len);
+#if IS_ENABLED(CONFIG_IPV6)
+	if (sk->sk_family == AF_INET6)
+		return pingv6_ops.ipv6_recv_error(sk, msg, len, addr_len);
+#endif
+	return -EINVAL;
+}
+
 static int inet_gro_complete(struct sk_buff *skb, int nhoff)
 {
 	__be16 newlen = htons(skb->len - nhoff);
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -855,16 +855,8 @@ int ping_recvmsg(struct kiocb *iocb, str
 	if (flags & MSG_OOB)
 		goto out;
 
-	if (flags & MSG_ERRQUEUE) {
-		if (family == AF_INET) {
-			return ip_recv_error(sk, msg, len, addr_len);
-#if IS_ENABLED(CONFIG_IPV6)
-		} else if (family == AF_INET6) {
-			return pingv6_ops.ipv6_recv_error(sk, msg, len,
-							  addr_len);
-#endif
-		}
-	}
+	if (flags & MSG_ERRQUEUE)
+		return inet_recv_error(sk, msg, len, addr_len);
 
 	skb = skb_recv_datagram(sk, flags, noblock, &err);
 	if (!skb)
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1633,7 +1633,7 @@ int tcp_recvmsg(struct kiocb *iocb, stru
 	u32 urg_hole = 0;
 
 	if (unlikely(flags & MSG_ERRQUEUE))
-		return ip_recv_error(sk, msg, len, addr_len);
+		return inet_recv_error(sk, msg, len, addr_len);
 
 	if (sk_can_busy_loop(sk) && skb_queue_empty(&sk->sk_receive_queue) &&
 	    (sk->sk_state == TCP_ESTABLISHED))



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

* [PATCH 3.17 34/47] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 33/47] net-timestamp: make tcp_recvmsg call ipv6_recv_error for AF_INET6 socks Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 35/47] rtnetlink: release net refcnt on error in do_setlink() Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, John Fastabend, Scott Feldman,
	Thomas Graf, John Fastabend, David S. Miller

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

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

From: Thomas Graf <tgraf@suug.ch>

[ Upstream commit f6c6fda4c9e17940b0a2ba206b0408babfdc930c ]

Fixes: 7f28fa10 ("bonding: add arp_ip_target netlink support")
Reported-by: John Fastabend <john.fastabend@gmail.com>
Cc: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/bonding/bond_netlink.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -194,7 +194,12 @@ static int bond_changelink(struct net_de
 
 		bond_option_arp_ip_targets_clear(bond);
 		nla_for_each_nested(attr, data[IFLA_BOND_ARP_IP_TARGET], rem) {
-			__be32 target = nla_get_be32(attr);
+			__be32 target;
+
+			if (nla_len(attr) < sizeof(target))
+				return -EINVAL;
+
+			target = nla_get_be32(attr);
 
 			bond_opt_initval(&newval, (__force u64)target);
 			err = __bond_opt_set(bond, BOND_OPT_ARP_TARGETS,



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

* [PATCH 3.17 35/47] rtnetlink: release net refcnt on error in do_setlink()
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 34/47] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 36/47] gre: Set inner mac header in gro complete Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Eric W. Biederman, Nicolas Dichtel,
	David S. Miller

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

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

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>

[ Upstream commit e0ebde0e131b529fd721b24f62872def5ec3718c ]

rtnl_link_get_net() holds a reference on the 'struct net', we need to release
it in case of error.

CC: Eric W. Biederman <ebiederm@xmission.com>
Fixes: b51642f6d77b ("net: Enable a userns root rtnl calls that are safe for unprivilged users")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/rtnetlink.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1495,6 +1495,7 @@ static int do_setlink(const struct sk_bu
 			goto errout;
 		}
 		if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) {
+			put_net(net);
 			err = -EPERM;
 			goto errout;
 		}



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

* [PATCH 3.17 36/47] gre: Set inner mac header in gro complete
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 35/47] rtnetlink: release net refcnt on error in do_setlink() Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 37/47] mips: bpf: Fix broken BPF_MOD Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Wolfgang Walter, Tom Herbert,
	David S. Miller

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

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

From: Tom Herbert <therbert@google.com>

[ Upstream commit 6fb2a756739aa507c1fd5b8126f0bfc2f070dc46 ]

Set the inner mac header to point to the GRE payload when
doing GRO. This is needed if we proceed to send the packet
through GRE GSO which now uses the inner mac header instead
of inner network header to determine the length of encapsulation
headers.

Fixes: 14051f0452a2 ("gre: Use inner mac length when computing tunnel length")
Reported-by: Wolfgang Walter <linux@stwm.de>
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/gre_offload.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -279,6 +279,9 @@ static int gre_gro_complete(struct sk_bu
 		err = ptype->callbacks.gro_complete(skb, nhoff + grehlen);
 
 	rcu_read_unlock();
+
+	skb_set_inner_mac_header(skb, nhoff + grehlen);
+
 	return err;
 }
 



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

* [PATCH 3.17 37/47] mips: bpf: Fix broken BPF_MOD
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (32 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 36/47] gre: Set inner mac header in gro complete Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 38/47] net: mvneta: fix Tx interrupt delay Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Denis Kirjanov, Markos Chandras,
	David S. Miller

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

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

From: Denis Kirjanov <kda@linux-powerpc.org>

[ Upstream commit 2e46477a12f6fd273e31a220b155d66e8352198c ]

Remove optimize_div() from BPF_MOD | BPF_K case
since we don't know the dividend and fix the
emit_mod() by reading the mod operation result from HI register

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/mips/net/bpf_jit.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -430,7 +430,7 @@ static inline void emit_mod(unsigned int
 		u32 *p = &ctx->target[ctx->idx];
 		uasm_i_divu(&p, dst, src);
 		p = &ctx->target[ctx->idx + 1];
-		uasm_i_mflo(&p, dst);
+		uasm_i_mfhi(&p, dst);
 	}
 	ctx->idx += 2; /* 2 insts */
 }
@@ -1006,7 +1006,7 @@ load_ind:
 			break;
 		case BPF_ALU | BPF_MOD | BPF_K:
 			/* A %= k */
-			if (k == 1 || optimize_div(&k)) {
+			if (k == 1) {
 				ctx->flags |= SEEN_A;
 				emit_jit_reg_move(r_A, r_zero, ctx);
 			} else {



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

* [PATCH 3.17 38/47] net: mvneta: fix Tx interrupt delay
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (33 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 37/47] mips: bpf: Fix broken BPF_MOD Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 39/47] net: mvneta: fix race condition in mvneta_tx() Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Maggie Mae Roxas, Willy Tarreau,
	David S. Miller

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

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

From: willy tarreau <w@1wt.eu>

[ Upstream commit aebea2ba0f7495e1a1c9ea5e753d146cb2f6b845 ]

The mvneta driver sets the amount of Tx coalesce packets to 16 by
default. Normally that does not cause any trouble since the driver
uses a much larger Tx ring size (532 packets). But some sockets
might run with very small buffers, much smaller than the equivalent
of 16 packets. This is what ping is doing for example, by setting
SNDBUF to 324 bytes rounded up to 2kB by the kernel.

The problem is that there is no documented method to force a specific
packet to emit an interrupt (eg: the last of the ring) nor is it
possible to make the NIC emit an interrupt after a given delay.

In this case, it causes trouble, because when ping sends packets over
its raw socket, the few first packets leave the system, and the first
15 packets will be emitted without an IRQ being generated, so without
the skbs being freed. And since the socket's buffer is small, there's
no way to reach that amount of packets, and the ping ends up with
"send: no buffer available" after sending 6 packets. Running with 3
instances of ping in parallel is enough to hide the problem, because
with 6 packets per instance, that's 18 packets total, which is enough
to grant a Tx interrupt before all are sent.

The original driver in the LSP kernel worked around this design flaw
by using a software timer to clean up the Tx descriptors. This timer
was slow and caused terrible network performance on some Tx-bound
workloads (such as routing) but was enough to make tools like ping
work correctly.

Instead here, we simply set the packet counts before interrupt to 1.
This ensures that each packet sent will produce an interrupt. NAPI
takes care of coalescing interrupts since the interrupt is disabled
once generated.

No measurable performance impact nor CPU usage were observed on small
nor large packets, including when saturating the link on Tx, and this
fixes tools like ping which rely on too small a send buffer. If one
wants to increase this value for certain workloads where it is safe
to do so, "ethtool -C $dev tx-frames" will override this default
setting.

This fix needs to be applied to stable kernels starting with 3.10.

Tested-By: Maggie Mae Roxas <maggie.mae.roxas@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/marvell/mvneta.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -216,7 +216,7 @@
 /* Various constants */
 
 /* Coalescing */
-#define MVNETA_TXDONE_COAL_PKTS		16
+#define MVNETA_TXDONE_COAL_PKTS		1
 #define MVNETA_RX_COAL_PKTS		32
 #define MVNETA_RX_COAL_USEC		100
 



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

* [PATCH 3.17 39/47] net: mvneta: fix race condition in mvneta_tx()
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (34 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 38/47] net: mvneta: fix Tx interrupt delay Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 41/47] xen-netfront: use correct linear area after linearizing an skb Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Eric Dumazet, David S. Miller

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

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

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 5f478b41033606d325e420df693162e2524c2b94 ]

mvneta_tx() dereferences skb to get skb->len too late,
as hardware might have completed the transmit and TX completion
could have freed the skb from another cpu.

Fixes: 71f6d1b31fb1 ("net: mvneta: replace Tx timer with a real interrupt")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/marvell/mvneta.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1721,6 +1721,7 @@ static int mvneta_tx(struct sk_buff *skb
 	u16 txq_id = skb_get_queue_mapping(skb);
 	struct mvneta_tx_queue *txq = &pp->txqs[txq_id];
 	struct mvneta_tx_desc *tx_desc;
+	int len = skb->len;
 	int frags = 0;
 	u32 tx_cmd;
 
@@ -1788,7 +1789,7 @@ out:
 
 		u64_stats_update_begin(&stats->syncp);
 		stats->tx_packets++;
-		stats->tx_bytes  += skb->len;
+		stats->tx_bytes  += len;
 		u64_stats_update_end(&stats->syncp);
 	} else {
 		dev->stats.tx_dropped++;



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

* [PATCH 3.17 41/47] xen-netfront: use correct linear area after linearizing an skb
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (35 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 39/47] net: mvneta: fix race condition in mvneta_tx() Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 42/47] netlink: use jhash as hashfn for rhashtable Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Anthony Wright, David Vrabel,
	David S. Miller

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

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

From: David Vrabel <david.vrabel@citrix.com>

[ Upstream commit 11d3d2a16cc1f05c6ece69a4392e99efb85666a6 ]

Commit 97a6d1bb2b658ac85ed88205ccd1ab809899884d (xen-netfront: Fix
handling packets on compound pages with skb_linearize) attempted to
fix a problem where an skb that would have required too many slots
would be dropped causing TCP connections to stall.

However, it filled in the first slot using the original buffer and not
the new one and would use the wrong offset and grant access to the
wrong page.

Netback would notice the malformed request and stop all traffic on the
VIF, reporting:

    vif vif-3-0 vif3.0: txreq.offset: 85e, size: 4002, end: 6144
    vif vif-3-0 vif3.0: fatal error; disabling device

Reported-by: Anthony Wright <anthony@overnetdata.com>
Tested-by: Anthony Wright <anthony@overnetdata.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/xen-netfront.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -627,6 +627,9 @@ static int xennet_start_xmit(struct sk_b
 				    slots, skb->len);
 		if (skb_linearize(skb))
 			goto drop;
+		data = skb->data;
+		offset = offset_in_page(data);
+		len = skb_headlen(skb);
 	}
 
 	spin_lock_irqsave(&queue->tx_lock, flags);



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

* [PATCH 3.17 42/47] netlink: use jhash as hashfn for rhashtable
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (36 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 41/47] xen-netfront: use correct linear area after linearizing an skb Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 43/47] Revert: ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Herbert Xu, Daniel Borkmann,
	Thomas Graf, Hannes Frederic Sowa, David S. Miller

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

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

From: Daniel Borkmann <dborkman@redhat.com>

[ Upstream commit 7f19fc5e0b617593dcda0d9956adc78b559ef1f5 ]

For netlink, we shouldn't be using arch_fast_hash() as a hashing
discipline, but rather jhash() instead.

Since netlink sockets can be opened by any user, a local attacker
would be able to easily create collisions with the DPDK-derived
arch_fast_hash(), which trades off performance for security by
using crc32 CPU instructions on x86_64.

While it might have a legimite use case in other places, it should
be avoided in netlink context, though. As rhashtable's API is very
flexible, we could later on still decide on other hashing disciplines,
if legitimate.

Reference: http://thread.gmane.org/gmane.linux.kernel/1844123
Fixes: e341694e3eb5 ("netlink: Convert netlink_lookup() to use RCU protected hash table")
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/netlink/af_netlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -3130,7 +3130,7 @@ static int __init netlink_proto_init(voi
 		.head_offset = offsetof(struct netlink_sock, node),
 		.key_offset = offsetof(struct netlink_sock, portid),
 		.key_len = sizeof(u32), /* portid */
-		.hashfn = arch_fast_hash,
+		.hashfn = jhash,
 		.max_shift = 16, /* 64K */
 		.grow_decision = rht_grow_above_75,
 		.shrink_decision = rht_shrink_below_30,



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

* [PATCH 3.17 43/47] Revert: ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (37 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 42/47] netlink: use jhash as hashfn for rhashtable Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 45/47] ALSA: hda - Add EAPD fixup for ASUS Z99He laptop Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Lv Zheng, Alexander Mezin, Rafael J. Wysocki

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

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

This reverts commit 2dbfff81a40b5b2be553042ad5c767e34fdd214c, which
really is commit 558e4736f2e1b0e6323adf7a5e4df77ed6cfc1a4 upstream.

Sorry for the confusion, this got applied twice, and reverted once, this
is the second revert and I hope to never touch it again...

Reported-by: Lv Zheng <lv.zheng@intel.com>
Cc: Alexander Mezin <mezin.alexander@gmail.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/ec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -299,11 +299,11 @@ static int acpi_ec_transaction_unlocked(
 	/* following two actions should be kept atomic */
 	ec->curr = t;
 	start_transaction(ec);
-	if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
-		clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
 	spin_unlock_irqrestore(&ec->lock, tmp);
 	ret = ec_poll(ec);
 	spin_lock_irqsave(&ec->lock, tmp);
+	if (ec->curr->command == ACPI_EC_COMMAND_QUERY)
+		clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
 	ec->curr = NULL;
 	spin_unlock_irqrestore(&ec->lock, tmp);
 	return ret;



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

* [PATCH 3.17 45/47] ALSA: hda - Add EAPD fixup for ASUS Z99He laptop
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (38 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 43/47] Revert: ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 46/47] ALSA: hda - Fix built-in mic at resume on Lenovo Ideapad S210 Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

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

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

From: Takashi Iwai <tiwai@suse.de>

commit f62f5eff3d40a56ad1cf0d81a6cac8dd8743e8a1 upstream.

The same fixup to enable EAPD is needed for ASUS Z99He with AD1986A
codec like another ASUS machine.

Reported-and-tested-by: Dmitry V. Zimin <pfzim@mail.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/pci/hda/patch_analog.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -332,6 +332,7 @@ static const struct hda_fixup ad1986a_fi
 
 static const struct snd_pci_quirk ad1986a_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_FIXUP_LAPTOP_IMIC),
+	SND_PCI_QUIRK(0x1043, 0x1443, "ASUS Z99He", AD1986A_FIXUP_EAPD),
 	SND_PCI_QUIRK(0x1043, 0x1447, "ASUS A8JN", AD1986A_FIXUP_EAPD),
 	SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8100, "ASUS P5", AD1986A_FIXUP_3STACK),
 	SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8200, "ASUS M2", AD1986A_FIXUP_3STACK),



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

* [PATCH 3.17 46/47] ALSA: hda - Fix built-in mic at resume on Lenovo Ideapad S210
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (39 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 45/47] ALSA: hda - Add EAPD fixup for ASUS Z99He laptop Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-14 20:21 ` [PATCH 3.17 47/47] ALSA: usb-audio: Dont resubmit pending URBs at MIDI error recovery Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Takashi Iwai

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

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

From: Takashi Iwai <tiwai@suse.de>

commit fedb2245cbb8d823e449ebdd48ba9bb35c071ce0 upstream.

The built-in mic boost volume gets almost muted after suspend/resume
on Lenovo Ideapad S210.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88121
Reported-and-tested-by: Roman Kagan <rkagan@mail.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5087,6 +5087,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+	SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
 	SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),



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

* [PATCH 3.17 47/47] ALSA: usb-audio: Dont resubmit pending URBs at MIDI error recovery
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (40 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 46/47] ALSA: hda - Fix built-in mic at resume on Lenovo Ideapad S210 Greg Kroah-Hartman
@ 2014-12-14 20:21 ` Greg Kroah-Hartman
  2014-12-15  3:31 ` [PATCH 3.17 00/47] 3.17.7-stable review Guenter Roeck
  2014-12-16  3:07 ` Shuah Khan
  43 siblings, 0 replies; 45+ messages in thread
From: Greg Kroah-Hartman @ 2014-12-14 20:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Clemens Ladisch, Takashi Iwai

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

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

From: Takashi Iwai <tiwai@suse.de>

commit 66139a48cee1530c91f37c145384b4ee7043f0b7 upstream.

In snd_usbmidi_error_timer(), the driver tries to resubmit MIDI input
URBs to reactivate the MIDI stream, but this causes the error when
some of URBs are still pending like:

 WARNING: CPU: 0 PID: 0 at ../drivers/usb/core/urb.c:339 usb_submit_urb+0x5f/0x70()
 URB ef705c40 submitted while active
 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.6-2-desktop #1
 Hardware name: FOXCONN TPS01/TPS01, BIOS 080015  03/23/2010
  c0984bfa f4009ed4 c078deaf f4009ee4 c024c884 c09a135c f4009f00 00000000
  c0984bfa 00000153 c061ac4f c061ac4f 00000009 00000001 ef705c40 e854d1c0
  f4009eec c024c8d3 00000009 f4009ee4 c09a135c f4009f00 f4009f04 c061ac4f
 Call Trace:
  [<c0205df6>] try_stack_unwind+0x156/0x170
  [<c020482a>] dump_trace+0x5a/0x1b0
  [<c0205e56>] show_trace_log_lvl+0x46/0x50
  [<c02049d1>] show_stack_log_lvl+0x51/0xe0
  [<c0205eb7>] show_stack+0x27/0x50
  [<c078deaf>] dump_stack+0x45/0x65
  [<c024c884>] warn_slowpath_common+0x84/0xa0
  [<c024c8d3>] warn_slowpath_fmt+0x33/0x40
  [<c061ac4f>] usb_submit_urb+0x5f/0x70
  [<f7974104>] snd_usbmidi_submit_urb+0x14/0x60 [snd_usbmidi_lib]
  [<f797483a>] snd_usbmidi_error_timer+0x6a/0xa0 [snd_usbmidi_lib]
  [<c02570c0>] call_timer_fn+0x30/0x130
  [<c0257442>] run_timer_softirq+0x1c2/0x260
  [<c0251493>] __do_softirq+0xc3/0x270
  [<c0204732>] do_softirq_own_stack+0x22/0x30
  [<c025186d>] irq_exit+0x8d/0xa0
  [<c0795228>] smp_apic_timer_interrupt+0x38/0x50
  [<c0794a3c>] apic_timer_interrupt+0x34/0x3c
  [<c0673d9e>] cpuidle_enter_state+0x3e/0xd0
  [<c028bb8d>] cpu_idle_loop+0x29d/0x3e0
  [<c028bd23>] cpu_startup_entry+0x53/0x60
  [<c0bfac1e>] start_kernel+0x415/0x41a

For avoiding these errors, check the pending URBs and skip
resubmitting such ones.

Reported-and-tested-by: Stefan Seyfried <stefan.seyfried@googlemail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/usb/midi.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -365,6 +365,8 @@ static void snd_usbmidi_error_timer(unsi
 		if (in && in->error_resubmit) {
 			in->error_resubmit = 0;
 			for (j = 0; j < INPUT_URBS; ++j) {
+				if (atomic_read(&in->urbs[j]->use_count))
+					continue;
 				in->urbs[j]->dev = umidi->dev;
 				snd_usbmidi_submit_urb(in->urbs[j], GFP_ATOMIC);
 			}



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

* Re: [PATCH 3.17 00/47] 3.17.7-stable review
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (41 preceding siblings ...)
  2014-12-14 20:21 ` [PATCH 3.17 47/47] ALSA: usb-audio: Dont resubmit pending URBs at MIDI error recovery Greg Kroah-Hartman
@ 2014-12-15  3:31 ` Guenter Roeck
  2014-12-16  3:07 ` Shuah Khan
  43 siblings, 0 replies; 45+ messages in thread
From: Guenter Roeck @ 2014-12-15  3:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, satoru.takeuchi, shuah.kh, stable

On 12/14/2014 12:20 PM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.17.7 release.
> There are 47 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Tue Dec 16 20:18:09 UTC 2014.
> Anything received after that time might be too late.
>

Build results:
	total: 133 pass: 132 fail: 1
Failed builds:
	avr32:atngw100mkii_evklcd101_defconfig

Qemu tests:
	total: 30 pass: 30 fail: 0

Details are available at http://server.roeck-us.net:8010/builders.

Guenter


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

* Re: [PATCH 3.17 00/47] 3.17.7-stable review
  2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
                   ` (42 preceding siblings ...)
  2014-12-15  3:31 ` [PATCH 3.17 00/47] 3.17.7-stable review Guenter Roeck
@ 2014-12-16  3:07 ` Shuah Khan
  43 siblings, 0 replies; 45+ messages in thread
From: Shuah Khan @ 2014-12-16  3:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: torvalds, akpm, linux, satoru.takeuchi, shuah.kh, stable

On 12/14/2014 01:20 PM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.17.7 release.
> There are 47 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Tue Dec 16 20:18:09 UTC 2014.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.17.7-rc1.gz
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

Compiled and booted on my test system. No dmesg regressions.

-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Open Source Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

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

end of thread, other threads:[~2014-12-16  3:07 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-14 20:20 [PATCH 3.17 00/47] 3.17.7-stable review Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 01/47] mm: frontswap: invalidate expired data on a dup-store failure Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 02/47] mm/vmpressure.c: fix race in vmpressure_work_fn() Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 03/47] drivers/input/evdev.c: dont kfree() a vmalloc address Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 04/47] fat: fix oops on corrupted vfat fs Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 05/47] mm: fix swapoff hang after page migration and fork Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 06/47] mm: fix anon_vma_clone() error treatment Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 07/47] slab: fix nodeid bounds check for non-contiguous node IDs Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 08/47] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 09/47] drm/nouveau/gf116: remove copy1 engine Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 10/47] nouveau: move the hotplug ignore to correct place Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 11/47] i2c: omap: fix NACK and Arbitration Lost irq handling Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 12/47] i2c: omap: fix i207 errata handling Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 14/47] i2c: cadence: Set the hardware time-out register to maximum value Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 16/47] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 17/47] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 18/47] drm/i915: More cautious with pch fifo underruns Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 19/47] drm/i915: Unlock panel even when LVDS is disabled Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 20/47] x86: Use $(OBJDUMP) instead of plain objdump Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 22/47] media: s2255drv: fix payload size for JPG, MJPEG Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 23/47] media: smiapp: Only some selection targets are settable Greg Kroah-Hartman
2014-12-14 20:20 ` [PATCH 3.17 24/47] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 25/47] ahci: disable MSI on SAMSUNG 0xa800 SSD Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 26/47] sata_fsl: fix error handling of irq_of_parse_and_map Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 27/47] ip_tunnel: the lack of vti_link_ops dellink() cause kernel panic Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 28/47] ipv6: gre: fix wrong skb->protocol in WCCP Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 29/47] vxlan: Fix boolean flip in VXLAN_F_UDP_ZERO_CSUM6_[TX|RX] Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 30/47] Fix race condition between vxlan_sock_add and vxlan_sock_release Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 31/47] tg3: fix ring init when there are more TX than RX channels Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 32/47] net/mlx4_core: Limit count field to 24 bits in qp_alloc_res Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 33/47] net-timestamp: make tcp_recvmsg call ipv6_recv_error for AF_INET6 socks Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 34/47] bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 35/47] rtnetlink: release net refcnt on error in do_setlink() Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 36/47] gre: Set inner mac header in gro complete Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 37/47] mips: bpf: Fix broken BPF_MOD Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 38/47] net: mvneta: fix Tx interrupt delay Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 39/47] net: mvneta: fix race condition in mvneta_tx() Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 41/47] xen-netfront: use correct linear area after linearizing an skb Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 42/47] netlink: use jhash as hashfn for rhashtable Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 43/47] Revert: ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 45/47] ALSA: hda - Add EAPD fixup for ASUS Z99He laptop Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 46/47] ALSA: hda - Fix built-in mic at resume on Lenovo Ideapad S210 Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.17 47/47] ALSA: usb-audio: Dont resubmit pending URBs at MIDI error recovery Greg Kroah-Hartman
2014-12-15  3:31 ` [PATCH 3.17 00/47] 3.17.7-stable review Guenter Roeck
2014-12-16  3:07 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).