linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ 00/37] 3.2.28-stable review
@ 2012-08-17  3:02 Ben Hutchings
  2012-08-17  3:02 ` [ 01/37] bnx2: Fix bug in bnx2_free_tx_skbs() Ben Hutchings
                   ` (36 more replies)
  0 siblings, 37 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan

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

Responses should be made by Sun Aug 19 10:00:00 UTC 2012.
Anything received after that time might be too late.

A combined patch relative to 3.2.27 will be posted as an additional
response to this, and the diffstat can be found below.

Ben.

-------------
 Makefile                                      |    4 +-
 arch/arm/configs/mxs_defconfig                |    1 -
 arch/arm/mach-pxa/raumfeld.c                  |    2 +-
 arch/s390/kernel/compat_linux.c               |    2 -
 arch/s390/kernel/compat_wrapper.S             |    4 +-
 arch/x86/kvm/vmx.c                            |    1 +
 drivers/gpu/drm/i915/i915_drv.h               |    7 +--
 drivers/gpu/drm/i915/i915_gem.c               |   23 ++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c       |   31 ++++-------
 drivers/gpu/drm/radeon/evergreen.c            |   71 ++++---------------------
 drivers/gpu/drm/radeon/ni.c                   |   14 +++--
 drivers/gpu/drm/radeon/radeon_asic.h          |    8 +--
 drivers/gpu/drm/radeon/rv515.c                |   13 -----
 drivers/input/touchscreen/eeti_ts.c           |   21 +++++---
 drivers/mfd/ezx-pcap.c                        |    2 +-
 drivers/net/caif/caif_serial.c                |    3 ++
 drivers/net/ethernet/broadcom/bnx2.c          |    6 +--
 drivers/net/ethernet/intel/e1000/e1000_main.c |   10 ++--
 drivers/net/ethernet/intel/e1000e/82571.c     |    4 +-
 drivers/net/tun.c                             |    7 +--
 drivers/net/usb/kaweth.c                      |    2 +-
 drivers/net/wireless/ath/ath9k/hw.c           |    1 +
 drivers/net/wireless/ath/ath9k/hw.h           |    1 +
 drivers/net/wireless/ath/ath9k/pci.c          |    1 +
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c     |   13 +++--
 drivers/net/wireless/rt2x00/rt61pci.c         |    3 +-
 drivers/net/wireless/rtlwifi/usb.c            |   14 +++--
 drivers/net/wireless/rtlwifi/wifi.h           |    1 +
 fs/hfsplus/wrapper.c                          |    2 +-
 include/linux/input/eeti_ts.h                 |    1 +
 include/linux/mfd/ezx-pcap.h                  |    1 +
 net/caif/caif_dev.c                           |    2 +-
 net/core/rtnetlink.c                          |    8 ++-
 net/ipv4/cipso_ipv4.c                         |    6 ++-
 net/ipv4/tcp.c                                |    5 +-
 net/ipv4/tcp_input.c                          |    4 +-
 net/mac80211/mesh.c                           |    1 +
 net/sched/sch_sfb.c                           |    2 +
 net/sctp/input.c                              |    7 +--
 net/sctp/socket.c                             |   12 ++++-
 net/wanrouter/wanmain.c                       |   51 ++++++++----------
 net/wireless/core.c                           |    5 ++
 net/wireless/core.h                           |    1 +
 net/wireless/util.c                           |    2 +-
 sound/pci/hda/patch_conexant.c                |    1 -
 sound/pci/hda/patch_realtek.c                 |    7 ++-
 46 files changed, 191 insertions(+), 197 deletions(-)

-- 
Ben Hutchings
I say we take off; nuke the site from orbit.  It's the only way to be sure.


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

* [ 01/37] bnx2: Fix bug in bnx2_free_tx_skbs().
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 02/37] sch_sfb: Fix missing NULL check Ben Hutchings
                   ` (35 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Michael Chan, Zongyun Lai, Jeffrey Huang,
	David S. Miller

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

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

From: Michael Chan <mchan@broadcom.com>

[ Upstream commit c1f5163de417dab01fa9daaf09a74bbb19303f3c ]

In rare cases, bnx2x_free_tx_skbs() can unmap the wrong DMA address
when it gets to the last entry of the tx ring.  We were not using
the proper macro to skip the last entry when advancing the tx index.

Reported-by: Zongyun Lai <zlai@vmware.com>
Reviewed-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/broadcom/bnx2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 965c723..721adfd 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -5378,7 +5378,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
 			int k, last;
 
 			if (skb == NULL) {
-				j++;
+				j = NEXT_TX_BD(j);
 				continue;
 			}
 
@@ -5390,8 +5390,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
 			tx_buf->skb = NULL;
 
 			last = tx_buf->nr_frags;
-			j++;
-			for (k = 0; k < last; k++, j++) {
+			j = NEXT_TX_BD(j);
+			for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) {
 				tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
 				dma_unmap_page(&bp->pdev->dev,
 					dma_unmap_addr(tx_buf, mapping),



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

* [ 02/37] sch_sfb: Fix missing NULL check
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
  2012-08-17  3:02 ` [ 01/37] bnx2: Fix bug in bnx2_free_tx_skbs() Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 03/37] sctp: Fix list corruption resulting from freeing an association on a list Ben Hutchings
                   ` (34 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alan Cox, Eric Dumazet, David S. Miller

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

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

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

[ Upstream commit 7ac2908e4b2edaec60e9090ddb4d9ceb76c05e7d ]

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44461

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/sched/sch_sfb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
index 17859ea..351a69b 100644
--- a/net/sched/sch_sfb.c
+++ b/net/sched/sch_sfb.c
@@ -559,6 +559,8 @@ static int sfb_dump(struct Qdisc *sch, struct sk_buff *skb)
 
 	sch->qstats.backlog = q->qdisc->qstats.backlog;
 	opts = nla_nest_start(skb, TCA_OPTIONS);
+	if (opts == NULL)
+		goto nla_put_failure;
 	NLA_PUT(skb, TCA_SFB_PARMS, sizeof(opt), &opt);
 	return nla_nest_end(skb, opts);
 



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

* [ 03/37] sctp: Fix list corruption resulting from freeing an  association on a list
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
  2012-08-17  3:02 ` [ 01/37] bnx2: Fix bug in bnx2_free_tx_skbs() Ben Hutchings
  2012-08-17  3:02 ` [ 02/37] sch_sfb: Fix missing NULL check Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 04/37] caif: Fix access to freed pernet memory Ben Hutchings
                   ` (33 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Neil Horman, David S. Miller,
	Vlad Yasevich, Sridhar Samudrala

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

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

From: Neil Horman <nhorman@tuxdriver.com>

[ Upstream commit 2eebc1e188e9e45886ee00662519849339884d6d ]

A few days ago Dave Jones reported this oops:

[22766.294255] general protection fault: 0000 [#1] PREEMPT SMP
[22766.295376] CPU 0
[22766.295384] Modules linked in:
[22766.387137]  ffffffffa169f292 6b6b6b6b6b6b6b6b ffff880147c03a90
ffff880147c03a74
[22766.387135] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 00000000000
[22766.387136] Process trinity-watchdo (pid: 10896, threadinfo ffff88013e7d2000,
[22766.387137] Stack:
[22766.387140]  ffff880147c03a10
[22766.387140]  ffffffffa169f2b6
[22766.387140]  ffff88013ed95728
[22766.387143]  0000000000000002
[22766.387143]  0000000000000000
[22766.387143]  ffff880003fad062
[22766.387144]  ffff88013c120000
[22766.387144]
[22766.387145] Call Trace:
[22766.387145]  <IRQ>
[22766.387150]  [<ffffffffa169f292>] ? __sctp_lookup_association+0x62/0xd0
[sctp]
[22766.387154]  [<ffffffffa169f2b6>] __sctp_lookup_association+0x86/0xd0 [sctp]
[22766.387157]  [<ffffffffa169f597>] sctp_rcv+0x207/0xbb0 [sctp]
[22766.387161]  [<ffffffff810d4da8>] ? trace_hardirqs_off_caller+0x28/0xd0
[22766.387163]  [<ffffffff815827e3>] ? nf_hook_slow+0x133/0x210
[22766.387166]  [<ffffffff815902fc>] ? ip_local_deliver_finish+0x4c/0x4c0
[22766.387168]  [<ffffffff8159043d>] ip_local_deliver_finish+0x18d/0x4c0
[22766.387169]  [<ffffffff815902fc>] ? ip_local_deliver_finish+0x4c/0x4c0
[22766.387171]  [<ffffffff81590a07>] ip_local_deliver+0x47/0x80
[22766.387172]  [<ffffffff8158fd80>] ip_rcv_finish+0x150/0x680
[22766.387174]  [<ffffffff81590c54>] ip_rcv+0x214/0x320
[22766.387176]  [<ffffffff81558c07>] __netif_receive_skb+0x7b7/0x910
[22766.387178]  [<ffffffff8155856c>] ? __netif_receive_skb+0x11c/0x910
[22766.387180]  [<ffffffff810d423e>] ? put_lock_stats.isra.25+0xe/0x40
[22766.387182]  [<ffffffff81558f83>] netif_receive_skb+0x23/0x1f0
[22766.387183]  [<ffffffff815596a9>] ? dev_gro_receive+0x139/0x440
[22766.387185]  [<ffffffff81559280>] napi_skb_finish+0x70/0xa0
[22766.387187]  [<ffffffff81559cb5>] napi_gro_receive+0xf5/0x130
[22766.387218]  [<ffffffffa01c4679>] e1000_receive_skb+0x59/0x70 [e1000e]
[22766.387242]  [<ffffffffa01c5aab>] e1000_clean_rx_irq+0x28b/0x460 [e1000e]
[22766.387266]  [<ffffffffa01c9c18>] e1000e_poll+0x78/0x430 [e1000e]
[22766.387268]  [<ffffffff81559fea>] net_rx_action+0x1aa/0x3d0
[22766.387270]  [<ffffffff810a495f>] ? account_system_vtime+0x10f/0x130
[22766.387273]  [<ffffffff810734d0>] __do_softirq+0xe0/0x420
[22766.387275]  [<ffffffff8169826c>] call_softirq+0x1c/0x30
[22766.387278]  [<ffffffff8101db15>] do_softirq+0xd5/0x110
[22766.387279]  [<ffffffff81073bc5>] irq_exit+0xd5/0xe0
[22766.387281]  [<ffffffff81698b03>] do_IRQ+0x63/0xd0
[22766.387283]  [<ffffffff8168ee2f>] common_interrupt+0x6f/0x6f
[22766.387283]  <EOI>
[22766.387284]
[22766.387285]  [<ffffffff8168eed9>] ? retint_swapgs+0x13/0x1b
[22766.387285] Code: c0 90 5d c3 66 0f 1f 44 00 00 4c 89 c8 5d c3 0f 1f 00 55 48
89 e5 48 83
ec 20 48 89 5d e8 4c 89 65 f0 4c 89 6d f8 66 66 66 66 90 <0f> b7 87 98 00 00 00
48 89 fb
49 89 f5 66 c1 c0 08 66 39 46 02
[22766.387307]
[22766.387307] RIP
[22766.387311]  [<ffffffffa168a2c9>] sctp_assoc_is_match+0x19/0x90 [sctp]
[22766.387311]  RSP <ffff880147c039b0>
[22766.387142]  ffffffffa16ab120
[22766.599537] ---[ end trace 3f6dae82e37b17f5 ]---
[22766.601221] Kernel panic - not syncing: Fatal exception in interrupt

It appears from his analysis and some staring at the code that this is likely
occuring because an association is getting freed while still on the
sctp_assoc_hashtable.  As a result, we get a gpf when traversing the hashtable
while a freed node corrupts part of the list.

Nominally I would think that an mibalanced refcount was responsible for this,
but I can't seem to find any obvious imbalance.  What I did note however was
that the two places where we create an association using
sctp_primitive_ASSOCIATE (__sctp_connect and sctp_sendmsg), have failure paths
which free a newly created association after calling sctp_primitive_ASSOCIATE.
sctp_primitive_ASSOCIATE brings us into the sctp_sf_do_prm_asoc path, which
issues a SCTP_CMD_NEW_ASOC side effect, which in turn adds a new association to
the aforementioned hash table.  the sctp command interpreter that process side
effects has not way to unwind previously processed commands, so freeing the
association from the __sctp_connect or sctp_sendmsg error path would lead to a
freed association remaining on this hash table.

I've fixed this but modifying sctp_[un]hash_established to use hlist_del_init,
which allows us to proerly use hlist_unhashed to check if the node is on a
hashlist safely during a delete.  That in turn alows us to safely call
sctp_unhash_established in the __sctp_connect and sctp_sendmsg error paths
before freeing them, regardles of what the associations state is on the hash
list.

I noted, while I was doing this, that the __sctp_unhash_endpoint was using
hlist_unhsashed in a simmilar fashion, but never nullified any removed nodes
pointers to make that function work properly, so I fixed that up in a simmilar
fashion.

I attempted to test this using a virtual guest running the SCTP_RR test from
netperf in a loop while running the trinity fuzzer, both in a loop.  I wasn't
able to recreate the problem prior to this fix, nor was I able to trigger the
failure after (neither of which I suppose is suprising).  Given the trace above
however, I think its likely that this is what we hit.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: davej@redhat.com
CC: davej@redhat.com
CC: "David S. Miller" <davem@davemloft.net>
CC: Vlad Yasevich <vyasevich@gmail.com>
CC: Sridhar Samudrala <sri@us.ibm.com>
CC: linux-sctp@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/sctp/input.c  |  7 ++-----
 net/sctp/socket.c | 12 ++++++++++--
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index b7692aa..0fc18c7 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -736,15 +736,12 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep)
 
 	epb = &ep->base;
 
-	if (hlist_unhashed(&epb->node))
-		return;
-
 	epb->hashent = sctp_ep_hashfn(epb->bind_addr.port);
 
 	head = &sctp_ep_hashtable[epb->hashent];
 
 	sctp_write_lock(&head->lock);
-	__hlist_del(&epb->node);
+	hlist_del_init(&epb->node);
 	sctp_write_unlock(&head->lock);
 }
 
@@ -825,7 +822,7 @@ static void __sctp_unhash_established(struct sctp_association *asoc)
 	head = &sctp_assoc_hashtable[epb->hashent];
 
 	sctp_write_lock(&head->lock);
-	__hlist_del(&epb->node);
+	hlist_del_init(&epb->node);
 	sctp_write_unlock(&head->lock);
 }
 
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 0075554..8e49d76 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1231,8 +1231,14 @@ out_free:
 	SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p"
 			  " kaddrs: %p err: %d\n",
 			  asoc, kaddrs, err);
-	if (asoc)
+	if (asoc) {
+		/* sctp_primitive_ASSOCIATE may have added this association
+		 * To the hash table, try to unhash it, just in case, its a noop
+		 * if it wasn't hashed so we're safe
+		 */
+		sctp_unhash_established(asoc);
 		sctp_association_free(asoc);
+	}
 	return err;
 }
 
@@ -1942,8 +1948,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
 	goto out_unlock;
 
 out_free:
-	if (new_asoc)
+	if (new_asoc) {
+		sctp_unhash_established(asoc);
 		sctp_association_free(asoc);
+	}
 out_unlock:
 	sctp_release_sock(sk);
 



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

* [ 04/37] caif: Fix access to freed pernet memory
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (2 preceding siblings ...)
  2012-08-17  3:02 ` [ 03/37] sctp: Fix list corruption resulting from freeing an association on a list Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 05/37] cipso: dont follow a NULL pointer when setsockopt() is called Ben Hutchings
                   ` (32 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Sjur Brændeland, Eric W. Biederman,
	David S. Miller

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1630 bytes --]

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

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

From: Sjur Brændeland <sjur.brandeland@stericsson.com>

[ Upstream commit 96f80d123eff05c3cd4701463786b87952a6c3ac ]

unregister_netdevice_notifier() must be called before
unregister_pernet_subsys() to avoid accessing already freed
pernet memory. This fixes the following oops when doing rmmod:

Call Trace:
 [<ffffffffa0f802bd>] caif_device_notify+0x4d/0x5a0 [caif]
 [<ffffffff81552ba9>] unregister_netdevice_notifier+0xb9/0x100
 [<ffffffffa0f86dcc>] caif_device_exit+0x1c/0x250 [caif]
 [<ffffffff810e7734>] sys_delete_module+0x1a4/0x300
 [<ffffffff810da82d>] ? trace_hardirqs_on_caller+0x15d/0x1e0
 [<ffffffff813517de>] ? trace_hardirqs_on_thunk+0x3a/0x3
 [<ffffffff81696bad>] system_call_fastpath+0x1a/0x1f

RIP
 [<ffffffffa0f7f561>] caif_get+0x51/0xb0 [caif]

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/caif/caif_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index 68223e4..4e9115d 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -428,9 +428,9 @@ static int __init caif_device_init(void)
 
 static void __exit caif_device_exit(void)
 {
-	unregister_pernet_subsys(&caif_net_ops);
 	unregister_netdevice_notifier(&caif_device_notifier);
 	dev_remove_pack(&caif_packet_type);
+	unregister_pernet_subsys(&caif_net_ops);
 }
 
 module_init(caif_device_init);



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

* [ 05/37] cipso: dont follow a NULL pointer when setsockopt()  is called
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (3 preceding siblings ...)
  2012-08-17  3:02 ` [ 04/37] caif: Fix access to freed pernet memory Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 06/37] caif: fix NULL pointer check Ben Hutchings
                   ` (31 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Paul Moore, Lin Ming, David S. Miller

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

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

From: Paul Moore <pmoore@redhat.com>

[ Upstream commit 89d7ae34cdda4195809a5a987f697a517a2a3177 ]

As reported by Alan Cox, and verified by Lin Ming, when a user
attempts to add a CIPSO option to a socket using the CIPSO_V4_TAG_LOCAL
tag the kernel dies a terrible death when it attempts to follow a NULL
pointer (the skb argument to cipso_v4_validate() is NULL when called via
the setsockopt() syscall).

This patch fixes this by first checking to ensure that the skb is
non-NULL before using it to find the incoming network interface.  In
the unlikely case where the skb is NULL and the user attempts to add
a CIPSO option with the _TAG_LOCAL tag we return an error as this is
not something we want to allow.

A simple reproducer, kindly supplied by Lin Ming, although you must
have the CIPSO DOI #3 configure on the system first or you will be
caught early in cipso_v4_validate():

	#include <sys/types.h>
	#include <sys/socket.h>
	#include <linux/ip.h>
	#include <linux/in.h>
	#include <string.h>

	struct local_tag {
		char type;
		char length;
		char info[4];
	};

	struct cipso {
		char type;
		char length;
		char doi[4];
		struct local_tag local;
	};

	int main(int argc, char **argv)
	{
		int sockfd;
		struct cipso cipso = {
			.type = IPOPT_CIPSO,
			.length = sizeof(struct cipso),
			.local = {
				.type = 128,
				.length = sizeof(struct local_tag),
			},
		};

		memset(cipso.doi, 0, 4);
		cipso.doi[3] = 3;

		sockfd = socket(AF_INET, SOCK_DGRAM, 0);
		#define SOL_IP 0
		setsockopt(sockfd, SOL_IP, IP_OPTIONS,
			&cipso, sizeof(struct cipso));

		return 0;
	}

CC: Lin Ming <mlin@ss.pku.edu.cn>
Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv4/cipso_ipv4.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 86f3b88..afaa735 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -1725,8 +1725,10 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)
 		case CIPSO_V4_TAG_LOCAL:
 			/* This is a non-standard tag that we only allow for
 			 * local connections, so if the incoming interface is
-			 * not the loopback device drop the packet. */
-			if (!(skb->dev->flags & IFF_LOOPBACK)) {
+			 * not the loopback device drop the packet. Further,
+			 * there is no legitimate reason for setting this from
+			 * userspace so reject it if skb is NULL. */
+			if (skb == NULL || !(skb->dev->flags & IFF_LOOPBACK)) {
 				err_offset = opt_iter;
 				goto validate_return_locked;
 			}



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

* [ 06/37] caif: fix NULL pointer check
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (4 preceding siblings ...)
  2012-08-17  3:02 ` [ 05/37] cipso: dont follow a NULL pointer when setsockopt() is called Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 07/37] wanmain: comparing array with NULL Ben Hutchings
                   ` (30 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Alan Cox, rucsoftsec, David S. Miller

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

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

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

[ Upstream commit c66b9b7d365444b433307ebb18734757cb668a02 ]

Reported-by: <rucsoftsec@gmail.com>
Resolves-bug: http://bugzilla.kernel.org/show_bug?44441
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/caif/caif_serial.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
index 23406e6..ae286a9 100644
--- a/drivers/net/caif/caif_serial.c
+++ b/drivers/net/caif/caif_serial.c
@@ -325,6 +325,9 @@ static int ldisc_open(struct tty_struct *tty)
 
 	sprintf(name, "cf%s", tty->name);
 	dev = alloc_netdev(sizeof(*ser), name, caifdev_setup);
+	if (!dev)
+		return -ENOMEM;
+
 	ser = netdev_priv(dev);
 	ser->tty = tty_kref_get(tty);
 	ser->dev = dev;



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

* [ 07/37] wanmain: comparing array with NULL
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (5 preceding siblings ...)
  2012-08-17  3:02 ` [ 06/37] caif: fix NULL pointer check Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 08/37] tcp: Add TCP_USER_TIMEOUT negative value check Ben Hutchings
                   ` (29 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alan Cox, David S. Miller

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

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

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

[ Upstream commit 8b72ff6484fe303e01498b58621810a114f3cf09 ]

gcc really should warn about these !

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/wanrouter/wanmain.c | 51 ++++++++++++++++++++++---------------------------
 1 file changed, 23 insertions(+), 28 deletions(-)

diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 788a12c..2ab7850 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -602,36 +602,31 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
 		 * successfully, add it to the interface list.
 		 */
 
-		if (dev->name == NULL) {
-			err = -EINVAL;
-		} else {
+#ifdef WANDEBUG
+		printk(KERN_INFO "%s: registering interface %s...\n",
+		       wanrouter_modname, dev->name);
+#endif
 
-			#ifdef WANDEBUG
-			printk(KERN_INFO "%s: registering interface %s...\n",
-				wanrouter_modname, dev->name);
-			#endif
-
-			err = register_netdev(dev);
-			if (!err) {
-				struct net_device *slave = NULL;
-				unsigned long smp_flags=0;
-
-				lock_adapter_irq(&wandev->lock, &smp_flags);
-
-				if (wandev->dev == NULL) {
-					wandev->dev = dev;
-				} else {
-					for (slave=wandev->dev;
-					     DEV_TO_SLAVE(slave);
-					     slave = DEV_TO_SLAVE(slave))
-						DEV_TO_SLAVE(slave) = dev;
-				}
-				++wandev->ndev;
-
-				unlock_adapter_irq(&wandev->lock, &smp_flags);
-				err = 0;	/* done !!! */
-				goto out;
+		err = register_netdev(dev);
+		if (!err) {
+			struct net_device *slave = NULL;
+			unsigned long smp_flags=0;
+
+			lock_adapter_irq(&wandev->lock, &smp_flags);
+
+			if (wandev->dev == NULL) {
+				wandev->dev = dev;
+			} else {
+				for (slave=wandev->dev;
+				     DEV_TO_SLAVE(slave);
+				     slave = DEV_TO_SLAVE(slave))
+					DEV_TO_SLAVE(slave) = dev;
 			}
+			++wandev->ndev;
+
+			unlock_adapter_irq(&wandev->lock, &smp_flags);
+			err = 0;	/* done !!! */
+			goto out;
 		}
 		if (wandev->del_if)
 			wandev->del_if(wandev, dev);



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

* [ 08/37] tcp: Add TCP_USER_TIMEOUT negative value check
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (6 preceding siblings ...)
  2012-08-17  3:02 ` [ 07/37] wanmain: comparing array with NULL Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 09/37] USB: kaweth.c: use GFP_ATOMIC under spin_lock Ben Hutchings
                   ` (28 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Hangbin Liu, David S. Miller

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

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

From: Hangbin Liu <liuhangbin@gmail.com>

[ Upstream commit 42493570100b91ef663c4c6f0c0fdab238f9d3c2 ]

TCP_USER_TIMEOUT is a TCP level socket option that takes an unsigned int. But
patch "tcp: Add TCP_USER_TIMEOUT socket option"(dca43c75) didn't check the negative
values. If a user assign -1 to it, the socket will set successfully and wait
for 4294967295 miliseconds. This patch add a negative value check to avoid
this issue.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv4/tcp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 11ba922..ad466a7 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2391,7 +2391,10 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 		/* Cap the max timeout in ms TCP will retry/retrans
 		 * before giving up and aborting (ETIMEDOUT) a connection.
 		 */
-		icsk->icsk_user_timeout = msecs_to_jiffies(val);
+		if (val < 0)
+			err = -EINVAL;
+		else
+			icsk->icsk_user_timeout = msecs_to_jiffies(val);
 		break;
 	default:
 		err = -ENOPROTOOPT;



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

* [ 09/37] USB: kaweth.c: use GFP_ATOMIC under spin_lock
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (7 preceding siblings ...)
  2012-08-17  3:02 ` [ 08/37] tcp: Add TCP_USER_TIMEOUT negative value check Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 10/37] net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling Ben Hutchings
                   ` (27 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Dan Carpenter, David S. Miller

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

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

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

[ Upstream commit e4c7f259c5be99dcfc3d98f913590663b0305bf8 ]

The problem is that we call this with a spin lock held.  The call tree
is:
	kaweth_start_xmit() holds kaweth->device_lock.
	-> kaweth_async_set_rx_mode()
	   -> kaweth_control()
	      -> kaweth_internal_control_msg()

The kaweth_internal_control_msg() function is only called from
kaweth_control() which used GFP_ATOMIC for its allocations.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/usb/kaweth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 582ca2d..c4c6a73 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1308,7 +1308,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
         int retv;
         int length = 0; /* shut up GCC */
 
-        urb = usb_alloc_urb(0, GFP_NOIO);
+	urb = usb_alloc_urb(0, GFP_ATOMIC);
         if (!urb)
                 return -ENOMEM;
 



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

* [ 10/37] net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI  handling
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (8 preceding siblings ...)
  2012-08-17  3:02 ` [ 09/37] USB: kaweth.c: use GFP_ATOMIC under spin_lock Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 11/37] tcp: perform DMA to userspace only if there is a task waiting for it Ben Hutchings
                   ` (26 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Jiri Benc, Max Matveev, David S. Miller

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

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

From: Jiri Benc <jbenc@redhat.com>

[ Upstream commit b1beb681cba5358f62e6187340660ade226a5fcc ]

When device flags are set using rtnetlink, IFF_PROMISC and IFF_ALLMULTI
flags are handled specially. Function dev_change_flags sets IFF_PROMISC and
IFF_ALLMULTI bits in dev->gflags according to the passed value but
do_setlink passes a result of rtnl_dev_combine_flags which takes those bits
from dev->flags.

This can be easily trigerred by doing:

tcpdump -i eth0 &
ip l s up eth0

ip sets IFF_UP flag in ifi_flags and ifi_change, which is combined with
IFF_PROMISC by rtnl_dev_combine_flags, causing __dev_change_flags to set
IFF_PROMISC in gflags.

Reported-by: Max Matveev <makc@redhat.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/core/rtnetlink.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 2ef859a..88bcf76 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -670,6 +670,12 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
 	}
 }
 
+static unsigned int rtnl_dev_get_flags(const struct net_device *dev)
+{
+	return (dev->flags & ~(IFF_PROMISC | IFF_ALLMULTI)) |
+	       (dev->gflags & (IFF_PROMISC | IFF_ALLMULTI));
+}
+
 static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
 					   const struct ifinfomsg *ifm)
 {
@@ -678,7 +684,7 @@ static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
 	/* bugwards compatibility: ifi_change == 0 is treated as ~0 */
 	if (ifm->ifi_change)
 		flags = (flags & ifm->ifi_change) |
-			(dev->flags & ~ifm->ifi_change);
+			(rtnl_dev_get_flags(dev) & ~ifm->ifi_change);
 
 	return flags;
 }



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

* [ 11/37] tcp: perform DMA to userspace only if there is a task  waiting for it
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (9 preceding siblings ...)
  2012-08-17  3:02 ` [ 10/37] net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 12/37] net/tun: fix ioctl() based info leaks Ben Hutchings
                   ` (25 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jiri Kosina, David S. Miller

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

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

From: Jiri Kosina <jkosina@suse.cz>

[ Upstream commit 59ea33a68a9083ac98515e4861c00e71efdc49a1 ]

Back in 2006, commit 1a2449a87b ("[I/OAT]: TCP recv offload to I/OAT")
added support for receive offloading to IOAT dma engine if available.

The code in tcp_rcv_established() tries to perform early DMA copy if
applicable. It however does so without checking whether the userspace
task is actually expecting the data in the buffer.

This is not a problem under normal circumstances, but there is a corner
case where this doesn't work -- and that's when MSG_TRUNC flag to
recvmsg() is used.

If the IOAT dma engine is not used, the code properly checks whether
there is a valid ucopy.task and the socket is owned by userspace, but
misses the check in the dmaengine case.

This problem can be observed in real trivially -- for example 'tbench' is a
good reproducer, as it makes a heavy use of MSG_TRUNC. On systems utilizing
IOAT, you will soon find tbench waiting indefinitely in sk_wait_data(), as they
have been already early-copied in tcp_rcv_established() using dma engine.

This patch introduces the same check we are performing in the simple
iovec copy case to the IOAT case as well. It fixes the indefinite
recvmsg(MSG_TRUNC) hangs.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv4/tcp_input.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 32e6ca2..a08a621 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5415,7 +5415,9 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 			if (tp->copied_seq == tp->rcv_nxt &&
 			    len - tcp_header_len <= tp->ucopy.len) {
 #ifdef CONFIG_NET_DMA
-				if (tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
+				if (tp->ucopy.task == current &&
+				    sock_owned_by_user(sk) &&
+				    tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
 					copied_early = 1;
 					eaten = 1;
 				}



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

* [ 12/37] net/tun: fix ioctl() based info leaks
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (10 preceding siblings ...)
  2012-08-17  3:02 ` [ 11/37] tcp: perform DMA to userspace only if there is a task waiting for it Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 13/37] e1000: add dropped DMA receive enable back in for WoL Ben Hutchings
                   ` (24 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Mathias Krause, David S. Miller

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

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

From: Mathias Krause <minipli@googlemail.com>

[ Upstream commits a117dacde0288f3ec60b6e5bcedae8fa37ee0dfc
  and 8bbb181308bc348e02bfdbebdedd4e4ec9d452ce ]

The tun module leaks up to 36 bytes of memory by not fully initializing
a structure located on the stack that gets copied to user memory by the
TUNGETIFF and SIOCGIFHWADDR ioctl()s.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/tun.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7bea9c6..a12c9bf 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1243,10 +1243,12 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
 	int vnet_hdr_sz;
 	int ret;
 
-	if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89)
+	if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) {
 		if (copy_from_user(&ifr, argp, ifreq_len))
 			return -EFAULT;
-
+	} else {
+		memset(&ifr, 0, sizeof(ifr));
+	}
 	if (cmd == TUNGETFEATURES) {
 		/* Currently this just means: "what IFF flags are valid?".
 		 * This is needed because we never checked for invalid flags on



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

* [ 13/37] e1000: add dropped DMA receive enable back in for WoL
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (11 preceding siblings ...)
  2012-08-17  3:02 ` [ 12/37] net/tun: fix ioctl() based info leaks Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 14/37] rtlwifi: rtl8192cu: Change buffer allocation for synchronous reads Ben Hutchings
                   ` (23 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Dean Nelson, Tobias Klausmann, Aaron Brown,
	Jeff Kirsher

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

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

From: Dean Nelson <dnelson@redhat.com>

commit b868179c47e9e8eadcd04c1f3105998e528988a3 upstream.

Commit d5bc77a223b0e9b9dfb002048d2b34a79e7d0b48 broke Wake-on-LAN by
inadvertently dropping the enabling of DMA receives.

Restore the enabling of DMA receives for WoL.

This is applicable to 3.1+ stable trees.

Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Tested-by: Tobias Klausmann <klausman@schwarzvogel.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 669ca38..d94d64b 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -4740,12 +4740,14 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
 		e1000_setup_rctl(adapter);
 		e1000_set_rx_mode(netdev);
 
+		rctl = er32(RCTL);
+
 		/* turn on all-multi mode if wake on multicast is enabled */
-		if (wufc & E1000_WUFC_MC) {
-			rctl = er32(RCTL);
+		if (wufc & E1000_WUFC_MC)
 			rctl |= E1000_RCTL_MPE;
-			ew32(RCTL, rctl);
-		}
+
+		/* enable receives in the hardware */
+		ew32(RCTL, rctl | E1000_RCTL_EN);
 
 		if (hw->mac_type >= e1000_82540) {
 			ctrl = er32(CTRL);



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

* [ 14/37] rtlwifi: rtl8192cu: Change buffer allocation for synchronous reads
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (12 preceding siblings ...)
  2012-08-17  3:02 ` [ 13/37] e1000: add dropped DMA receive enable back in for WoL Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 15/37] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio Ben Hutchings
                   ` (22 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Larry Finger, John W. Linville

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

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

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

commit 3ce4d85b76010525adedcc2555fa164bf706a2f3 upstream.

In commit a7959c1, the USB part of rtlwifi was switched to convert
_usb_read_sync() to using a preallocated buffer rather than one
that has been acquired using kmalloc. Although this routine is named
as though it were synchronous, there seem to be simultaneous users,
and the selection of the index to the data buffer is not multi-user
safe. This situation is addressed by adding a new spinlock. The routine
cannot sleep, thus a mutex is not allowed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/rtlwifi/usb.c  |   14 +++++++++++---
 drivers/net/wireless/rtlwifi/wifi.h |    1 +
 2 files changed, 12 insertions(+), 3 deletions(-)

--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -120,15 +120,19 @@ static u32 _usb_read_sync(struct rtl_pri
 	u8 request;
 	u16 wvalue;
 	u16 index;
-	__le32 *data = &rtlpriv->usb_data[rtlpriv->usb_data_index];
+	__le32 *data;
+	unsigned long flags;
 
+	spin_lock_irqsave(&rtlpriv->locks.usb_lock, flags);
+	if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT)
+		rtlpriv->usb_data_index = 0;
+	data = &rtlpriv->usb_data[rtlpriv->usb_data_index];
+	spin_unlock_irqrestore(&rtlpriv->locks.usb_lock, flags);
 	request = REALTEK_USB_VENQT_CMD_REQ;
 	index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */
 
 	wvalue = (u16)addr;
 	_usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len);
-	if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT)
-		rtlpriv->usb_data_index = 0;
 	return le32_to_cpu(*data);
 }
 
@@ -909,6 +913,10 @@ int __devinit rtl_usb_probe(struct usb_i
 				    GFP_KERNEL);
 	if (!rtlpriv->usb_data)
 		return -ENOMEM;
+
+	/* this spin lock must be initialized early */
+	spin_lock_init(&rtlpriv->locks.usb_lock);
+
 	rtlpriv->usb_data_index = 0;
 	SET_IEEE80211_DEV(hw, &intf->dev);
 	udev = interface_to_usbdev(intf);
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -1550,6 +1550,7 @@ struct rtl_locks {
 	spinlock_t rf_lock;
 	spinlock_t lps_lock;
 	spinlock_t waitq_lock;
+	spinlock_t usb_lock;
 
 	/*Dual mac*/
 	spinlock_t cck_and_rw_pagea_lock;



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

* [ 15/37] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (13 preceding siblings ...)
  2012-08-17  3:02 ` [ 14/37] rtlwifi: rtl8192cu: Change buffer allocation for synchronous reads Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:02 ` [ 16/37] drm/i915: fixup seqno allocation logic for lazy_request Ben Hutchings
                   ` (21 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Janne Kalliomäki, Christoph Hellwig

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

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

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

From: Janne Kalliomäki <janne@tuxera.com>

commit a6dc8c04218eb752ff79cdc24a995cf51866caed upstream.

The variable io_size was unsigned int, which caused the wrong sector number
to be calculated after aligning it. This then caused mount to fail with big
volumes, as backup volume header information was searched from a
wrong sector.

Signed-off-by: Janne Kalliomäki <janne@tuxera.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 fs/hfsplus/wrapper.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index 7daf4b8..90effcc 100644
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -56,7 +56,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
 	DECLARE_COMPLETION_ONSTACK(wait);
 	struct bio *bio;
 	int ret = 0;
-	unsigned int io_size;
+	u64 io_size;
 	loff_t start;
 	int offset;
 



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

* [ 16/37] drm/i915: fixup seqno allocation logic for lazy_request
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (14 preceding siblings ...)
  2012-08-17  3:02 ` [ 15/37] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio Ben Hutchings
@ 2012-08-17  3:02 ` Ben Hutchings
  2012-08-17  3:03 ` [ 17/37] KVM: VMX: Advertise CPU_BASED_RDPMC_EXITING for nested guests Ben Hutchings
                   ` (20 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:02 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Daniel Vetter, Chris Wilson

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

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

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

commit 53d227f282eb9fa4c7cdbfd691fa372b7ca8c4c3 upstream.

Currently we reserve seqnos only when we emit the request to the ring
(by bumping dev_priv->next_seqno), but start using it much earlier for
ring->oustanding_lazy_request. When 2 threads compete for the gpu and
run on two different rings (e.g. ddx on blitter vs. compositor)
hilarity ensued, especially when we get constantly interrupted while
reserving buffers.

Breakage seems to have been introduced in

commit 6f392d548658a17600da7faaf8a5df25ee5f01f6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Aug 7 11:01:22 2010 +0100

    drm/i915: Use a common seqno for all rings.

This patch fixes up the seqno reservation logic by moving it into
i915_gem_next_request_seqno. The ring->add_request functions now
superflously still return the new seqno through a pointer, that will
be refactored in the next patch.

Note that with this change we now unconditionally allocate a seqno,
even when ->add_request might fail because the rings are full and the
gpu died. But this does not open up a new can of worms because we can
already leave behind an outstanding_request_seqno if e.g. the caller
gets interrupted with a signal while stalling for the gpu in the
eviciton paths. And with the bugfix we only ever have one seqno
allocated per ring (and only that ring), so there are no ordering
issues with multiple outstanding seqnos on the same ring.

v2: Keep i915_gem_get_seqno (but move it to i915_gem.c) to make it
clear that we only have one seqno counter for all rings. Suggested by
Chris Wilson.

v3: As suggested by Chris Wilson use i915_gem_next_request_seqno
instead of ring->oustanding_lazy_request to make the follow-up
refactoring more clearly correct. Also improve the commit message
with issues discussed on irc.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45181
Tested-by: Nicolas Kalkhof nkalkhof()at()web.de
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/i915_drv.h         |    7 +------
 drivers/gpu/drm/i915/i915_gem.c         |   23 +++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_ringbuffer.c |   24 ++++--------------------
 3 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 000a9ad..563d24e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1177,12 +1177,7 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2)
 	return (int32_t)(seq1 - seq2) >= 0;
 }
 
-static inline u32
-i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
-{
-	drm_i915_private_t *dev_priv = ring->dev->dev_private;
-	return ring->outstanding_lazy_request = dev_priv->next_seqno;
-}
+u32 i915_gem_next_request_seqno(struct intel_ring_buffer *ring);
 
 int __must_check i915_gem_object_get_fence(struct drm_i915_gem_object *obj,
 					   struct intel_ring_buffer *pipelined);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 2b51e9c..2031cc7 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1576,6 +1576,28 @@ i915_gem_process_flushing_list(struct intel_ring_buffer *ring,
 	}
 }
 
+static u32
+i915_gem_get_seqno(struct drm_device *dev)
+{
+	drm_i915_private_t *dev_priv = dev->dev_private;
+	u32 seqno = dev_priv->next_seqno;
+
+	/* reserve 0 for non-seqno */
+	if (++dev_priv->next_seqno == 0)
+		dev_priv->next_seqno = 1;
+
+	return seqno;
+}
+
+u32
+i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
+{
+	if (ring->outstanding_lazy_request == 0)
+		ring->outstanding_lazy_request = i915_gem_get_seqno(ring->dev);
+
+	return ring->outstanding_lazy_request;
+}
+
 int
 i915_add_request(struct intel_ring_buffer *ring,
 		 struct drm_file *file,
@@ -1587,6 +1609,7 @@ i915_add_request(struct intel_ring_buffer *ring,
 	int ret;
 
 	BUG_ON(request == NULL);
+	seqno = i915_gem_next_request_seqno(ring);
 
 	ret = ring->add_request(ring, &seqno);
 	if (ret)
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 4956f1b..8a983b5 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -52,20 +52,6 @@ static inline int ring_space(struct intel_ring_buffer *ring)
 	return space;
 }
 
-static u32 i915_gem_get_seqno(struct drm_device *dev)
-{
-	drm_i915_private_t *dev_priv = dev->dev_private;
-	u32 seqno;
-
-	seqno = dev_priv->next_seqno;
-
-	/* reserve 0 for non-seqno */
-	if (++dev_priv->next_seqno == 0)
-		dev_priv->next_seqno = 1;
-
-	return seqno;
-}
-
 static int
 render_ring_flush(struct intel_ring_buffer *ring,
 		  u32	invalidate_domains,
@@ -465,7 +451,7 @@ gen6_add_request(struct intel_ring_buffer *ring,
 	mbox1_reg = ring->signal_mbox[0];
 	mbox2_reg = ring->signal_mbox[1];
 
-	*seqno = i915_gem_get_seqno(ring->dev);
+	*seqno = i915_gem_next_request_seqno(ring);
 
 	update_mboxes(ring, *seqno, mbox1_reg);
 	update_mboxes(ring, *seqno, mbox2_reg);
@@ -563,8 +549,7 @@ static int
 pc_render_add_request(struct intel_ring_buffer *ring,
 		      u32 *result)
 {
-	struct drm_device *dev = ring->dev;
-	u32 seqno = i915_gem_get_seqno(dev);
+	u32 seqno = i915_gem_next_request_seqno(ring);
 	struct pipe_control *pc = ring->private;
 	u32 scratch_addr = pc->gtt_offset + 128;
 	int ret;
@@ -615,8 +600,7 @@ static int
 render_ring_add_request(struct intel_ring_buffer *ring,
 			u32 *result)
 {
-	struct drm_device *dev = ring->dev;
-	u32 seqno = i915_gem_get_seqno(dev);
+	u32 seqno = i915_gem_next_request_seqno(ring);
 	int ret;
 
 	ret = intel_ring_begin(ring, 4);
@@ -790,7 +774,7 @@ ring_add_request(struct intel_ring_buffer *ring,
 	if (ret)
 		return ret;
 
-	seqno = i915_gem_get_seqno(ring->dev);
+	seqno = i915_gem_next_request_seqno(ring);
 
 	intel_ring_emit(ring, MI_STORE_DWORD_INDEX);
 	intel_ring_emit(ring, I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT);



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

* [ 17/37] KVM: VMX: Advertise CPU_BASED_RDPMC_EXITING for nested guests
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (15 preceding siblings ...)
  2012-08-17  3:02 ` [ 16/37] drm/i915: fixup seqno allocation logic for lazy_request Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 18/37] mac80211: cancel mesh path timer Ben Hutchings
                   ` (19 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Stefan Bader, Avi Kivity

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

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

From: Stefan Bader <stefan.bader@canonical.com>

Based on commit fee84b079d5ddee2247b5c1f53162c330c622902 upstream.

  Intercept RDPMC and forward it to the PMU emulation code.

Newer vmx support will only allow to load the kvm_intel module
if RDPMC_EXITING is supported. Even without the actual support
this part of the change is required on 3.2 hosts.

BugLink: http://bugs.launchpad.net/bugs/1031090
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/kvm/vmx.c | 1 +
 1 file changed, 1 insertion(+)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1956,6 +1956,7 @@ static __init void nested_vmx_setup_ctls
 #endif
 		CPU_BASED_MOV_DR_EXITING | CPU_BASED_UNCOND_IO_EXITING |
 		CPU_BASED_USE_IO_BITMAPS | CPU_BASED_MONITOR_EXITING |
+		CPU_BASED_RDPMC_EXITING |
 		CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
 	/*
 	 * We can allow some features even when not supported by the



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

* [ 18/37] mac80211: cancel mesh path timer
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (16 preceding siblings ...)
  2012-08-17  3:03 ` [ 17/37] KVM: VMX: Advertise CPU_BASED_RDPMC_EXITING for nested guests Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 19/37] ath9k: Add PID/VID support for AR1111 Ben Hutchings
                   ` (18 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Johannes Berg

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

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

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

commit dd4c9260e7f23f2e951cbfb2726e468c6d30306c upstream.

The mesh path timer needs to be canceled when
leaving the mesh as otherwise it could fire
after the interface has been removed already.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/mac80211/mesh.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index d60b3d3..8557235 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -622,6 +622,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
 
 	del_timer_sync(&sdata->u.mesh.housekeeping_timer);
 	del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
+	del_timer_sync(&sdata->u.mesh.mesh_path_timer);
 	/*
 	 * If the timer fired while we waited for it, it will have
 	 * requeued the work. Now the work will be running again



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

* [ 19/37] ath9k: Add PID/VID support for AR1111
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (17 preceding siblings ...)
  2012-08-17  3:03 ` [ 18/37] mac80211: cancel mesh path timer Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 20/37] ARM: mxs: Remove MMAP_MIN_ADDR setting from mxs_defconfig Ben Hutchings
                   ` (17 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Mohammed Shafi Shajakhan, Felix Bitterli,
	Tim Bentley, John W. Linville

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

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

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

commit d4e5979c0da95791aa717c18e162540c7a596360 upstream.

AR1111 is same as AR9485. The h/w
difference between them is quite insignificant,
Felix suggests only very few baseband features
may not be available in AR1111. The h/w code for
AR9485 is already present, so AR1111 should
work fine with the addition of its PID/VID.

Cc: Felix Bitterli <felixb@qca.qualcomm.com>
Reported-by: Tim Bentley <Tim.Bentley@Gmail.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Tested-by: Tim Bentley <Tim.Bentley@Gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/ath/ath9k/hw.c  |    1 +
 drivers/net/wireless/ath/ath9k/hw.h  |    1 +
 drivers/net/wireless/ath/ath9k/pci.c |    1 +
 3 files changed, 3 insertions(+)

--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -674,6 +674,7 @@ int ath9k_hw_init(struct ath_hw *ah)
 	case AR9300_DEVID_AR9340:
 	case AR9300_DEVID_AR9580:
 	case AR9300_DEVID_AR9462:
+	case AR9485_DEVID_AR1111:
 		break;
 	default:
 		if (common->bus_ops->ath_bus_type == ATH_USB)
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -48,6 +48,7 @@
 #define AR9300_DEVID_AR9580	0x0033
 #define AR9300_DEVID_AR9462	0x0034
 #define AR9300_DEVID_AR9330	0x0035
+#define AR9485_DEVID_AR1111	0x0037
 
 #define AR5416_AR9100_DEVID	0x000b
 
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -35,6 +35,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_i
 	{ PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E  AR9485 */
 	{ PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E  AR9580 */
 	{ PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E  AR9462 */
+	{ PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E  AR1111/AR9485 */
 	{ 0 }
 };
 



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

* [ 20/37] ARM: mxs: Remove MMAP_MIN_ADDR setting from mxs_defconfig
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (18 preceding siblings ...)
  2012-08-17  3:03 ` [ 19/37] ath9k: Add PID/VID support for AR1111 Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 21/37] ALSA: hda - add dock support for Thinkpad T430s Ben Hutchings
                   ` (16 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Marek Vasut, Russell King, Wolfgang Denk,
	Shawn Guo

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

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

From: Marek Vasut <marex@denx.de>

commit 3bed491c8d28329e34f8a31e3fe64d03f3a350f1 upstream.

The CONFIG_DEFAULT_MMAP_MIN_ADDR was set to 65536 in mxs_defconfig,
this caused severe breakage of userland applications since the upper
limit for ARM is 32768. By default CONFIG_DEFAULT_MMAP_MIN_ADDR is
set to 4096 and can also be changed via /proc/sys/vm/mmap_min_addr
if needed.

Quoting Russell King [1]:

"4096 is also fine for ARM too. There's not much point in having
defconfigs change it - that would just be pure noise in the config
files."

the CONFIG_DEFAULT_MMAP_MIN_ADDR can be removed from the defconfig
altogether.

This problem was introduced by commit cde7c41 (ARM: configs: add
defconfig for mach-mxs).

[1] http://marc.info/?l=linux-arm-kernel&m=134401593807820&w=2

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/configs/mxs_defconfig |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
index ccdb635..4edcfb4 100644
--- a/arch/arm/configs/mxs_defconfig
+++ b/arch/arm/configs/mxs_defconfig
@@ -34,7 +34,6 @@ CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_AEABI=y
-CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_FPE_NWFPE=y
 CONFIG_NET=y



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

* [ 21/37] ALSA: hda - add dock support for Thinkpad T430s
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (19 preceding siblings ...)
  2012-08-17  3:03 ` [ 20/37] ARM: mxs: Remove MMAP_MIN_ADDR setting from mxs_defconfig Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 22/37] cfg80211: process pending events when unregistering net device Ben Hutchings
                   ` (15 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Philipp A. Mohrenweiser, Takashi Iwai

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

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

From: "Philipp A. Mohrenweiser" <phiamo@googlemail.com>

commit 4407be6ba217514b1bc01488f8b56467d309e416 upstream.

Add a model/fixup string "lenovo-dock", for Thinkpad T430s, to allow
sound in docking station.

Tested on Lenovo T430s with ThinkPad Mini Dock Plus Series 3

Signed-off-by: Philipp A. Mohrenweiser <phiamo@googlemail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b9a5c45..bb93f92 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6207,6 +6207,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
+	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),



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

* [ 22/37] cfg80211: process pending events when unregistering net device
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (20 preceding siblings ...)
  2012-08-17  3:03 ` [ 21/37] ALSA: hda - add dock support for Thinkpad T430s Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 23/37] rt61pci: fix NULL pointer dereference in config_lna_gain Ben Hutchings
                   ` (14 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Daniel Drake, Johannes Berg, John W. Linville

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

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

From: Daniel Drake <dsd@laptop.org>

commit 1f6fc43e621167492ed4b7f3b4269c584c3d6ccc upstream.

libertas currently calls cfg80211_disconnected() when it is being
brought down. This causes an event to be allocated, but since the
wdev is already removed from the rdev by the time that the event
processing work executes, the event is never processed or freed.
http://article.gmane.org/gmane.linux.kernel.wireless.general/95666

Fix this leak, and other possible situations, by processing the event
queue when a device is being unregistered. Thanks to Johannes Berg for
the suggestion.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/wireless/core.c |    5 +++++
 net/wireless/core.h |    1 +
 net/wireless/util.c |    2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -971,6 +971,11 @@ static int cfg80211_netdev_notifier_call
 		 */
 		synchronize_rcu();
 		INIT_LIST_HEAD(&wdev->list);
+		/*
+		 * Ensure that all events have been processed and
+		 * freed.
+		 */
+		cfg80211_process_wdev_events(wdev);
 		break;
 	case NETDEV_PRE_UP:
 		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -426,6 +426,7 @@ int cfg80211_change_iface(struct cfg8021
 			  struct net_device *dev, enum nl80211_iftype ntype,
 			  u32 *flags, struct vif_params *params);
 void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev);
+void cfg80211_process_wdev_events(struct wireless_dev *wdev);
 
 int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
 				  struct wireless_dev *wdev,
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -725,7 +725,7 @@ void cfg80211_upload_connect_keys(struct
 	wdev->connect_keys = NULL;
 }
 
-static void cfg80211_process_wdev_events(struct wireless_dev *wdev)
+void cfg80211_process_wdev_events(struct wireless_dev *wdev)
 {
 	struct cfg80211_event *ev;
 	unsigned long flags;



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

* [ 23/37] rt61pci: fix NULL pointer dereference in config_lna_gain
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (21 preceding siblings ...)
  2012-08-17  3:03 ` [ 22/37] cfg80211: process pending events when unregistering net device Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 24/37] iwlwifi: disable greenfield transmissions as a workaround Ben Hutchings
                   ` (13 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Stanislaw Gruszka, John W. Linville

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

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

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit deee0214def5d8a32b8112f11d9c2b1696e9c0cb upstream.

We can not pass NULL libconf->conf->channel to rt61pci_config() as it
is dereferenced unconditionally in rt61pci_config_lna_gain() subroutine.

Resolves:
https://bugzilla.kernel.org/show_bug.cgi?id=44361

Reported-and-tested-by: <dolohow@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/rt2x00/rt61pci.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index f322596..3f7bc5c 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2243,8 +2243,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
 
 static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev)
 {
-	struct ieee80211_conf conf = { .flags = 0 };
-	struct rt2x00lib_conf libconf = { .conf = &conf };
+	struct rt2x00lib_conf libconf = { .conf = &rt2x00dev->hw->conf };
 
 	rt61pci_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS);
 }



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

* [ 24/37] iwlwifi: disable greenfield transmissions as a workaround
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (22 preceding siblings ...)
  2012-08-17  3:03 ` [ 23/37] rt61pci: fix NULL pointer dereference in config_lna_gain Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 25/37] ALSA: hda - add dock support for Thinkpad X230 Ben Hutchings
                   ` (12 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Johannes Berg, Emmanuel Grumbach,
	Cesar Eduardo Barros, John W. Linville

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

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

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

commit 50e2a30cf6fcaeb2d27360ba614dd169a10041c5 upstream.

There's a bug that causes the rate scaling to get stuck
when it has to use single-stream rates with a peer that
can do GF and SGI; the two are incompatible so we can't
use them together, but that causes the algorithm to not
work at all, it always rejects updates.

Disable greenfield for now to prevent that problem.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -708,11 +708,14 @@ static int rs_toggle_antenna(u32 valid_a
  */
 static bool rs_use_green(struct ieee80211_sta *sta)
 {
-	struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
-	struct iwl_rxon_context *ctx = sta_priv->ctx;
-
-	return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) &&
-		!(ctx->ht.non_gf_sta_present);
+	/*
+	 * There's a bug somewhere in this code that causes the
+	 * scaling to get stuck because GF+SGI can't be combined
+	 * in SISO rates. Until we find that bug, disable GF, it
+	 * has only limited benefit and we still interoperate with
+	 * GF APs since we can always receive GF transmissions.
+	 */
+	return false;
 }
 
 /**



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

* [ 25/37] ALSA: hda - add dock support for Thinkpad X230
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (23 preceding siblings ...)
  2012-08-17  3:03 ` [ 24/37] iwlwifi: disable greenfield transmissions as a workaround Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 26/37] e1000e: NIC goes up and immediately goes down Ben Hutchings
                   ` (11 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Felix Kaechele, Takashi Iwai

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

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

From: Felix Kaechele <felix@fetzig.org>

commit c8415a48fcb7a29889f4405d38c57db351e4b50a upstream.

As with the ThinkPad Models X230 Tablet and T530 the X230 needs a qurik to
correctly set up the pins for the dock port.

Signed-off-by: Felix Kaechele <felix@fetzig.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bb93f92..daa5103 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6207,6 +6207,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
 	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
+	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),



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

* [ 26/37] e1000e: NIC goes up and immediately goes down
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (24 preceding siblings ...)
  2012-08-17  3:03 ` [ 25/37] ALSA: hda - add dock support for Thinkpad X230 Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 27/37] ALSA: hda - remove quirk for Dell Vostro 1015 Ben Hutchings
                   ` (10 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Tushar Dave, Fabio Futigami,
	Marcelo Ricardo Leitner, Aaron Brown, Peter P Waskiewicz Jr

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

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

From: Tushar Dave <tushar.n.dave@intel.com>

commit b7ec70be01a87f2c85df3ae11046e74f9b67e323 upstream.

Found that commit d478eb44 was a bad commit.
If the link partner is transmitting codeword (even if NULL codeword),
then the RXCW.C bit will be set so check for RXCW.CW is unnecessary.
Ref: RH BZ 840642

Reported-by: Fabio Futigami <ffutigam@redhat.com>
Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
CC: Marcelo Ricardo Leitner <mleitner@redhat.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/ethernet/intel/e1000e/82571.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 0b3bade..2a4ded2 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1601,10 +1601,8 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
 			 * auto-negotiation in the TXCW register and disable
 			 * forced link in the Device Control register in an
 			 * attempt to auto-negotiate with our link partner.
-			 * If the partner code word is null, stop forcing
-			 * and restart auto negotiation.
 			 */
-			if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW))  {
+			if (rxcw & E1000_RXCW_C) {
 				/* Enable autoneg, and unforce link up */
 				ew32(TXCW, mac->txcw);
 				ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));



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

* [ 27/37] ALSA: hda - remove quirk for Dell Vostro 1015
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (25 preceding siblings ...)
  2012-08-17  3:03 ` [ 26/37] e1000e: NIC goes up and immediately goes down Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 28/37] ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad Ben Hutchings
                   ` (9 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Henningsson, Takashi Iwai

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

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

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

commit e9fc83cb2e5877801a255a37ddbc5be996ea8046 upstream.

This computer is confirmed working with model=auto on kernel 3.2.
Also, parsing fails with hda-emu with the current model.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/pci/hda/patch_conexant.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 1436118..6f538eb 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -2972,7 +2972,6 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
 	SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
 	SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
-	SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
 	SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD),
 	SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD),



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

* [ 28/37] ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (26 preceding siblings ...)
  2012-08-17  3:03 ` [ 27/37] ALSA: hda - remove quirk for Dell Vostro 1015 Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 29/37] ARM: pxa: remove irq_to_gpio from ezx-pcap driver Ben Hutchings
                   ` (8 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, David Henningsson, Takashi Iwai

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

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

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

commit 012e7eb1e501d0120e0383b81477f63091f5e365 upstream.

The same ID is twice in the quirk table, so the second one is not used.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 sound/pci/hda/patch_realtek.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4981,6 +4981,8 @@ static const struct alc_fixup alc269_fix
 	[ALC269_FIXUP_PCM_44K] = {
 		.type = ALC_FIXUP_FUNC,
 		.v.func = alc269_fixup_pcm_44k,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_QUANTA_MUTE
 	},
 	[ALC269_FIXUP_STEREO_DMIC] = {
 		.type = ALC_FIXUP_FUNC,
@@ -5080,8 +5082,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
-	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
-	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),
+	SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
 	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
 
 #if 1



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

* [ 29/37] ARM: pxa: remove irq_to_gpio from ezx-pcap driver
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (27 preceding siblings ...)
  2012-08-17  3:03 ` [ 28/37] ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 30/37] Input: eeti_ts: pass gpio value instead of IRQ Ben Hutchings
                   ` (7 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Arnd Bergmann, Haojian Zhuang,
	Samuel Ortiz, Daniel Ribeiro

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit 59ee93a528b94ef4e81a08db252b0326feff171f upstream.

The irq_to_gpio function was removed from the pxa platform
in linux-3.2, and this driver has been broken since.

There is actually no in-tree user of this driver that adds
this platform device, but the driver can and does get enabled
on some platforms.

Without this patch, building ezx_defconfig results in:

drivers/mfd/ezx-pcap.c: In function 'pcap_isr_work':
drivers/mfd/ezx-pcap.c:205:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/mfd/ezx-pcap.c       |    2 +-
 include/linux/mfd/ezx-pcap.h |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 43a76c4..db662e2 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -202,7 +202,7 @@ static void pcap_isr_work(struct work_struct *work)
 		}
 		local_irq_enable();
 		ezx_pcap_write(pcap, PCAP_REG_MSR, pcap->msr);
-	} while (gpio_get_value(irq_to_gpio(pcap->spi->irq)));
+	} while (gpio_get_value(pdata->gpio));
 }
 
 static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc)
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h
index 40c37216..32a1b5c 100644
--- a/include/linux/mfd/ezx-pcap.h
+++ b/include/linux/mfd/ezx-pcap.h
@@ -16,6 +16,7 @@ struct pcap_subdev {
 struct pcap_platform_data {
 	unsigned int irq_base;
 	unsigned int config;
+	int gpio;
 	void (*init) (void *);	/* board specific init */
 	int num_subdevs;
 	struct pcap_subdev *subdevs;



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

* [ 30/37] Input: eeti_ts: pass gpio value instead of IRQ
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (28 preceding siblings ...)
  2012-08-17  3:03 ` [ 29/37] ARM: pxa: remove irq_to_gpio from ezx-pcap driver Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 31/37] tun: dont zeroize sock->file on detach Ben Hutchings
                   ` (6 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Arnd Bergmann, Daniel Mack,
	Dmitry Torokhov, Sven Neumann, Haojian Zhuang

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

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

From: Arnd Bergmann <arnd@arndb.de>

commit 4eef6cbfcc03b294d9d334368a851b35b496ce53 upstream.

The EETI touchscreen asserts its IRQ line as soon as it has data in its
internal buffers. The line is automatically deasserted once all data has
been read via I2C. Hence, the driver has to monitor the GPIO line and
cannot simply rely on the interrupt handler reception.

In the current implementation of the driver, irq_to_gpio() is used to
determine the GPIO number from the i2c_client's IRQ value.

As irq_to_gpio() is not available on all platforms, this patch changes
this and makes the driver ignore the passed in IRQ. Instead, a GPIO is
added to the platform_data struct and gpio_to_irq is used to derive the
IRQ from that GPIO. If this fails, bail out. The driver is only able to
work in environments where the touchscreen GPIO can be mapped to an
IRQ.

Without this patch, building raumfeld_defconfig results in:

drivers/input/touchscreen/eeti_ts.c: In function 'eeti_ts_irq_active':
drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration]

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Sven Neumann <s.neumann@raumfeld.com>
Cc: linux-input@vger.kernel.org
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
[bwh: Backported to 3.2: raumfeld_controller_i2c_board_info.irq was
 initialised using gpio_to_irq(), but this doesn't seem to matter]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/arm/mach-pxa/raumfeld.c        |    2 +-
 drivers/input/touchscreen/eeti_ts.c |   21 +++++++++++++--------
 include/linux/input/eeti_ts.h       |    1 +
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 5905ed1..d89d87ae 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -953,12 +953,12 @@ static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
 
 static struct eeti_ts_platform_data eeti_ts_pdata = {
 	.irq_active_high = 1,
+	.irq_gpio = GPIO_TOUCH_IRQ,
 };
 
 static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
 	.type	= "eeti_ts",
 	.addr	= 0x0a,
-	.irq	= gpio_to_irq(GPIO_TOUCH_IRQ),
 	.platform_data = &eeti_ts_pdata,
 };
 
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 503c709..908407e 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -48,7 +48,7 @@ struct eeti_ts_priv {
 	struct input_dev *input;
 	struct work_struct work;
 	struct mutex mutex;
-	int irq, irq_active_high;
+	int irq_gpio, irq, irq_active_high;
 };
 
 #define EETI_TS_BITDEPTH	(11)
@@ -62,7 +62,7 @@ struct eeti_ts_priv {
 
 static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv)
 {
-	return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;
+	return gpio_get_value(priv->irq_gpio) == priv->irq_active_high;
 }
 
 static void eeti_ts_read(struct work_struct *work)
@@ -157,7 +157,7 @@ static void eeti_ts_close(struct input_dev *dev)
 static int __devinit eeti_ts_probe(struct i2c_client *client,
 				   const struct i2c_device_id *idp)
 {
-	struct eeti_ts_platform_data *pdata;
+	struct eeti_ts_platform_data *pdata = client->dev.platform_data;
 	struct eeti_ts_priv *priv;
 	struct input_dev *input;
 	unsigned int irq_flags;
@@ -199,9 +199,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
 
 	priv->client = client;
 	priv->input = input;
-	priv->irq = client->irq;
+	priv->irq_gpio = pdata->irq_gpio;
+	priv->irq = gpio_to_irq(pdata->irq_gpio);
 
-	pdata = client->dev.platform_data;
+	err = gpio_request_one(pdata->irq_gpio, GPIOF_IN, client->name);
+	if (err < 0)
+		goto err1;
 
 	if (pdata)
 		priv->irq_active_high = pdata->irq_active_high;
@@ -215,13 +218,13 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
 
 	err = input_register_device(input);
 	if (err)
-		goto err1;
+		goto err2;
 
 	err = request_irq(priv->irq, eeti_ts_isr, irq_flags,
 			  client->name, priv);
 	if (err) {
 		dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");
-		goto err2;
+		goto err3;
 	}
 
 	/*
@@ -233,9 +236,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
 	device_init_wakeup(&client->dev, 0);
 	return 0;
 
-err2:
+err3:
 	input_unregister_device(input);
 	input = NULL; /* so we dont try to free it below */
+err2:
+	gpio_free(pdata->irq_gpio);
 err1:
 	input_free_device(input);
 	kfree(priv);
diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h
index f875b31..16625d7 100644
--- a/include/linux/input/eeti_ts.h
+++ b/include/linux/input/eeti_ts.h
@@ -2,6 +2,7 @@
 #define LINUX_INPUT_EETI_TS_H
 
 struct eeti_ts_platform_data {
+	int irq_gpio;
 	unsigned int irq_active_high;
 };
 



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

* [ 31/37] tun: dont zeroize sock->file on detach
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (29 preceding siblings ...)
  2012-08-17  3:03 ` [ 30/37] Input: eeti_ts: pass gpio value instead of IRQ Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-19 17:13   ` Ben Hutchings
  2012-08-17  3:03 ` [ 32/37] drm/i915: correctly order the ring init sequence Ben Hutchings
                   ` (5 subsequent siblings)
  36 siblings, 1 reply; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Stanislav Kinsbursky, Ruan Zhijie, Al Viro,
	Eric Dumazet, Yuchung Cheng, David S. Miller

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

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

From: Stanislav Kinsbursky <skinsbursky@parallels.com>

commit 66d1b9263a371abd15806c53f486f0645ef31a8f upstream.

This is a fix for bug, introduced in 3.4 kernel by commit
1ab5ecb90cb6a3df1476e052f76a6e8f6511cb3d ("tun: don't hold network
namespace by tun sockets"), which, among other things, replaced simple
sock_put() by sk_release_kernel(). Below is sequence, which leads to
oops for non-persistent devices:

tun_chr_close()
tun_detach()				<== tun->socket.file = NULL
tun_free_netdev()
sk_release_sock()
sock_release(sock->file == NULL)
iput(SOCK_INODE(sock))			<== dereference on NULL pointer

This patch just removes zeroing of socket's file from __tun_detach().
sock_release() will do this.

Reported-by: Ruan Zhijie <ruanzhijie@hotmail.com>
Tested-by: Ruan Zhijie <ruanzhijie@hotmail.com>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/tun.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 926d4db..3a16d4f 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -187,7 +187,6 @@ static void __tun_detach(struct tun_struct *tun)
 	netif_tx_lock_bh(tun->dev);
 	netif_carrier_off(tun->dev);
 	tun->tfile = NULL;
-	tun->socket.file = NULL;
 	netif_tx_unlock_bh(tun->dev);
 
 	/* Drop read queue */



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

* [ 32/37] drm/i915: correctly order the ring init sequence
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (30 preceding siblings ...)
  2012-08-17  3:03 ` [ 31/37] tun: dont zeroize sock->file on detach Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17 23:29   ` Herton Ronaldo Krzesinski
  2012-08-17  3:03 ` [ 33/37] s390/compat: fix compat wrappers for process_vm system calls Ben Hutchings
                   ` (4 subsequent siblings)
  36 siblings, 1 reply; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Daniel Vetter, Jani Nikula, Yang Guang

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

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

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

commit 0d8957c8a90bbb5d34fab9a304459448a5131e06 upstream.

We may only start to set up the new register values after having
confirmed that the ring is truely off. Otherwise the hw might lose the
newly written register values. This is caught later on in the init
sequence, when we check whether the register writes have stuck.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50522
Tested-by: Yang Guang <guang.a.yang@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index bf0195a..414af1e 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -289,8 +289,6 @@ static int init_ring_common(struct intel_ring_buffer *ring)
 	I915_WRITE_HEAD(ring, 0);
 	ring->write_tail(ring, 0);
 
-	/* Initialize the ring. */
-	I915_WRITE_START(ring, obj->gtt_offset);
 	head = I915_READ_HEAD(ring) & HEAD_ADDR;
 
 	/* G45 ring initialization fails to reset head to zero */
@@ -316,6 +314,11 @@ static int init_ring_common(struct intel_ring_buffer *ring)
 		}
 	}
 
+	/* Initialize the ring. This must happen _after_ we've cleared the ring
+	 * registers with the above sequence (the readback of the HEAD registers
+	 * also enforces ordering), otherwise the hw might lose the new ring
+	 * register values. */
+	I915_WRITE_START(ring, obj->gtt_offset);
 	I915_WRITE_CTL(ring,
 			((ring->size - PAGE_SIZE) & RING_NR_PAGES)
 			| RING_VALID);



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

* [ 33/37] s390/compat: fix compat wrappers for process_vm system calls
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (31 preceding siblings ...)
  2012-08-17  3:03 ` [ 32/37] drm/i915: correctly order the ring init sequence Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 34/37] s390/compat: fix mmap compat " Ben Hutchings
                   ` (3 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Heiko Carstens, Martin Schwidefsky

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

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

From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit 82aabdb6f1eb61e0034ec23901480f5dd23db7c4 upstream.

The compat wrappers incorrectly called the non compat versions of
the system process_vm system calls.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/s390/kernel/compat_wrapper.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index e835d6d..2d82cfc 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1635,7 +1635,7 @@ ENTRY(compat_sys_process_vm_readv_wrapper)
 	llgfr	%r6,%r6			# unsigned long
 	llgf	%r0,164(%r15)		# unsigned long
 	stg	%r0,160(%r15)
-	jg	sys_process_vm_readv
+	jg	compat_sys_process_vm_readv
 
 ENTRY(compat_sys_process_vm_writev_wrapper)
 	lgfr	%r2,%r2			# compat_pid_t
@@ -1645,4 +1645,4 @@ ENTRY(compat_sys_process_vm_writev_wrapper)
 	llgfr	%r6,%r6			# unsigned long
 	llgf	%r0,164(%r15)		# unsigned long
 	stg	%r0,160(%r15)
-	jg	sys_process_vm_writev
+	jg	compat_sys_process_vm_writev



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

* [ 34/37] s390/compat: fix mmap compat system calls
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (32 preceding siblings ...)
  2012-08-17  3:03 ` [ 33/37] s390/compat: fix compat wrappers for process_vm system calls Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 35/37] drm/radeon: fix bank tiling parameters on evergreen Ben Hutchings
                   ` (2 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: torvalds, akpm, alan, Heiko Carstens, Martin Schwidefsky

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

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

From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit e85871218513c54f7dfdb6009043cb638f2fecbe upstream.

The native 31 bit and the compat behaviour for the mmap system calls differ:

In native 31 bit mode the passed in address for the mmap system call will be
unmodified passed to sys_mmap_pgoff().
In compat mode however the passed in address will be modified with
compat_ptr() which masks out the most significant bit.

The result is that in native 31 bit mode each mmap request (with MAP_FIXED)
will fail where the most significat bit is set, while in compat mode it
may succeed.

This odd behaviour was introduced with d3815898 "[S390] mmap: add missing
compat_ptr conversion to both mmap compat syscalls".

To restore a consistent behaviour accross native and compat mode this
patch functionally reverts the above mentioned commit.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/s390/kernel/compat_linux.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index d122508..f606d93 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -620,7 +620,6 @@ asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg)
 		return -EFAULT;
 	if (a.offset & ~PAGE_MASK)
 		return -EINVAL;
-	a.addr = (unsigned long) compat_ptr(a.addr);
 	return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
 			      a.offset >> PAGE_SHIFT);
 }
@@ -631,7 +630,6 @@ asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg)
 
 	if (copy_from_user(&a, arg, sizeof(a)))
 		return -EFAULT;
-	a.addr = (unsigned long) compat_ptr(a.addr);
 	return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
 }
 



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

* [ 35/37] drm/radeon: fix bank tiling parameters on evergreen
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (33 preceding siblings ...)
  2012-08-17  3:03 ` [ 34/37] s390/compat: fix mmap compat " Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 36/37] drm/radeon: fix bank tiling parameters on cayman Ben Hutchings
  2012-08-17  3:03 ` [ 37/37] drm/radeon: do not reenable crtc after moving vram start address Ben Hutchings
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alex Deucher

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

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

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

commit c8d15edc17d836686d1f071e564800e1a2724fa6 upstream.

Handle the 16 bank case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/radeon/evergreen.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2080,10 +2080,18 @@ static void evergreen_gpu_init(struct ra
 	if (rdev->flags & RADEON_IS_IGP)
 		rdev->config.evergreen.tile_config |= 1 << 4;
 	else {
-		if ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT)
-			rdev->config.evergreen.tile_config |= 1 << 4;
-		else
+		switch ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) {
+		case 0: /* four banks */
 			rdev->config.evergreen.tile_config |= 0 << 4;
+			break;
+		case 1: /* eight banks */
+			rdev->config.evergreen.tile_config |= 1 << 4;
+			break;
+		case 2: /* sixteen banks */
+		default:
+			rdev->config.evergreen.tile_config |= 2 << 4;
+			break;
+		}
 	}
 	rdev->config.evergreen.tile_config |=
 		((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT) << 8;



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

* [ 36/37] drm/radeon: fix bank tiling parameters on cayman
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (34 preceding siblings ...)
  2012-08-17  3:03 ` [ 35/37] drm/radeon: fix bank tiling parameters on evergreen Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  2012-08-17  3:03 ` [ 37/37] drm/radeon: do not reenable crtc after moving vram start address Ben Hutchings
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Alex Deucher

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

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

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

commit 5b23c9045a8b61352986270b2d109edf5085e113 upstream.

Handle the 16 bank case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[bwh: Backported to 3.2: adjust context, indentation]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/radeon/ni.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -804,10 +804,18 @@ static void cayman_gpu_init(struct radeo
 		rdev->config.cayman.tile_config |= (3 << 0);
 		break;
 	}
-	if ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT)
-		rdev->config.cayman.tile_config |= 1 << 4;
-	else
+	switch ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) {
+	case 0: /* four banks */
 		rdev->config.cayman.tile_config |= 0 << 4;
+		break;
+	case 1: /* eight banks */
+		rdev->config.cayman.tile_config |= 1 << 4;
+		break;
+	case 2: /* sixteen banks */
+	default:
+		rdev->config.cayman.tile_config |= 2 << 4;
+		break;
+	}
 	rdev->config.cayman.tile_config |=
 		((gb_addr_config & PIPE_INTERLEAVE_SIZE_MASK) >> PIPE_INTERLEAVE_SIZE_SHIFT) << 8;
 	rdev->config.cayman.tile_config |=



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

* [ 37/37] drm/radeon: do not reenable crtc after moving vram start address
  2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
                   ` (35 preceding siblings ...)
  2012-08-17  3:03 ` [ 36/37] drm/radeon: fix bank tiling parameters on cayman Ben Hutchings
@ 2012-08-17  3:03 ` Ben Hutchings
  36 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-17  3:03 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, akpm, alan, Jerome Glisse

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

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

From: Jerome Glisse <jglisse@redhat.com>

commit 81ee8fb6b52ec69eeed37fe7943446af1dccecc5 upstream.

It seems we can not update the crtc scanout address. After disabling
crtc, update to base address do not take effect after crtc being
reenable leading to at least frame being scanout from the old crtc
base address. Disabling crtc display request lead to same behavior.

So after changing the vram address if we don't keep crtc disabled
we will have the GPU trying to read some random system memory address
with some iommu this will broke the crtc engine and will lead to
broken display and iommu error message.

So to avoid this, disable crtc. For flicker less boot we will need
to avoid moving the vram start address.

This patch should also fix :

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

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/gpu/drm/radeon/evergreen.c   |   57 ----------------------------------
 drivers/gpu/drm/radeon/radeon_asic.h |    8 ++---
 drivers/gpu/drm/radeon/rv515.c       |   13 --------
 3 files changed, 2 insertions(+), 76 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index f4ef24f..e93b80a 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -1229,24 +1229,8 @@ void evergreen_agp_enable(struct radeon_device *rdev)
 
 void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save)
 {
-	save->vga_control[0] = RREG32(D1VGA_CONTROL);
-	save->vga_control[1] = RREG32(D2VGA_CONTROL);
 	save->vga_render_control = RREG32(VGA_RENDER_CONTROL);
 	save->vga_hdp_control = RREG32(VGA_HDP_CONTROL);
-	save->crtc_control[0] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET);
-	save->crtc_control[1] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET);
-	if (rdev->num_crtc >= 4) {
-		save->vga_control[2] = RREG32(EVERGREEN_D3VGA_CONTROL);
-		save->vga_control[3] = RREG32(EVERGREEN_D4VGA_CONTROL);
-		save->crtc_control[2] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET);
-		save->crtc_control[3] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET);
-	}
-	if (rdev->num_crtc >= 6) {
-		save->vga_control[4] = RREG32(EVERGREEN_D5VGA_CONTROL);
-		save->vga_control[5] = RREG32(EVERGREEN_D6VGA_CONTROL);
-		save->crtc_control[4] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET);
-		save->crtc_control[5] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
-	}
 
 	/* Stop all video */
 	WREG32(VGA_RENDER_CONTROL, 0);
@@ -1357,47 +1341,6 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s
 	/* Unlock host access */
 	WREG32(VGA_HDP_CONTROL, save->vga_hdp_control);
 	mdelay(1);
-	/* Restore video state */
-	WREG32(D1VGA_CONTROL, save->vga_control[0]);
-	WREG32(D2VGA_CONTROL, save->vga_control[1]);
-	if (rdev->num_crtc >= 4) {
-		WREG32(EVERGREEN_D3VGA_CONTROL, save->vga_control[2]);
-		WREG32(EVERGREEN_D4VGA_CONTROL, save->vga_control[3]);
-	}
-	if (rdev->num_crtc >= 6) {
-		WREG32(EVERGREEN_D5VGA_CONTROL, save->vga_control[4]);
-		WREG32(EVERGREEN_D6VGA_CONTROL, save->vga_control[5]);
-	}
-	WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1);
-	WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1);
-	if (rdev->num_crtc >= 4) {
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1);
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1);
-	}
-	if (rdev->num_crtc >= 6) {
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1);
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1);
-	}
-	WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, save->crtc_control[0]);
-	WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, save->crtc_control[1]);
-	if (rdev->num_crtc >= 4) {
-		WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, save->crtc_control[2]);
-		WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, save->crtc_control[3]);
-	}
-	if (rdev->num_crtc >= 6) {
-		WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, save->crtc_control[4]);
-		WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, save->crtc_control[5]);
-	}
-	WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
-	WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
-	if (rdev->num_crtc >= 4) {
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
-	}
-	if (rdev->num_crtc >= 6) {
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
-		WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
-	}
 	WREG32(VGA_RENDER_CONTROL, save->vga_render_control);
 }
 
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index f4af243..0d445e7 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -255,13 +255,10 @@ extern int rs690_mc_wait_for_idle(struct radeon_device *rdev);
  * rv515
  */
 struct rv515_mc_save {
-	u32 d1vga_control;
-	u32 d2vga_control;
 	u32 vga_render_control;
 	u32 vga_hdp_control;
-	u32 d1crtc_control;
-	u32 d2crtc_control;
 };
+
 int rv515_init(struct radeon_device *rdev);
 void rv515_fini(struct radeon_device *rdev);
 uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg);
@@ -389,11 +386,10 @@ void r700_cp_fini(struct radeon_device *rdev);
  * evergreen
  */
 struct evergreen_mc_save {
-	u32 vga_control[6];
 	u32 vga_render_control;
 	u32 vga_hdp_control;
-	u32 crtc_control[6];
 };
+
 void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev);
 int evergreen_init(struct radeon_device *rdev);
 void evergreen_fini(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index a12fbcc..aa8ef49 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -281,12 +281,8 @@ int rv515_debugfs_ga_info_init(struct radeon_device *rdev)
 
 void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save)
 {
-	save->d1vga_control = RREG32(R_000330_D1VGA_CONTROL);
-	save->d2vga_control = RREG32(R_000338_D2VGA_CONTROL);
 	save->vga_render_control = RREG32(R_000300_VGA_RENDER_CONTROL);
 	save->vga_hdp_control = RREG32(R_000328_VGA_HDP_CONTROL);
-	save->d1crtc_control = RREG32(R_006080_D1CRTC_CONTROL);
-	save->d2crtc_control = RREG32(R_006880_D2CRTC_CONTROL);
 
 	/* Stop all video */
 	WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0);
@@ -311,15 +307,6 @@ void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save)
 	/* Unlock host access */
 	WREG32(R_000328_VGA_HDP_CONTROL, save->vga_hdp_control);
 	mdelay(1);
-	/* Restore video state */
-	WREG32(R_000330_D1VGA_CONTROL, save->d1vga_control);
-	WREG32(R_000338_D2VGA_CONTROL, save->d2vga_control);
-	WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1);
-	WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 1);
-	WREG32(R_006080_D1CRTC_CONTROL, save->d1crtc_control);
-	WREG32(R_006880_D2CRTC_CONTROL, save->d2crtc_control);
-	WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0);
-	WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0);
 	WREG32(R_000300_VGA_RENDER_CONTROL, save->vga_render_control);
 }
 



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

* Re: [ 32/37] drm/i915: correctly order the ring init sequence
  2012-08-17  3:03 ` [ 32/37] drm/i915: correctly order the ring init sequence Ben Hutchings
@ 2012-08-17 23:29   ` Herton Ronaldo Krzesinski
  2012-08-18 10:04     ` Daniel Vetter
  0 siblings, 1 reply; 43+ messages in thread
From: Herton Ronaldo Krzesinski @ 2012-08-17 23:29 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: linux-kernel, stable, torvalds, akpm, alan, Daniel Vetter,
	Jani Nikula, Yang Guang

On Fri, Aug 17, 2012 at 04:03:15AM +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> commit 0d8957c8a90bbb5d34fab9a304459448a5131e06 upstream.
> 
> We may only start to set up the new register values after having
> confirmed that the ring is truely off. Otherwise the hw might lose the
> newly written register values. This is caught later on in the init
> sequence, when we check whether the register writes have stuck.
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50522
> Tested-by: Yang Guang <guang.a.yang@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[...]

With this commit on 3.2, i915 fails to initialize on a G41 based machine
I have here:

[   36.894261] i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[   36.894265] i915 0000:00:02.0: setting latency timer to 64
[   36.933118] mtrr: type mismatch for d0000000,10000000 old: write-back new: write-combining
[   36.933121] [drm] MTRR allocation failed.  Graphics performance may suffer.
[   36.933467] i915 0000:00:02.0: irq 42 for MSI/MSI-X
[   36.933471] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[   36.933472] [drm] Driver supports precise vblank timestamp query.
[   36.933498] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
[   36.969669] [drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 head 00001074 tail 00000000 start 00001000
[   36.969763] vga_switcheroo: disabled
[   36.969765] [drm:i915_driver_load] *ERROR* failed to init modeset
[   36.987444] i915 0000:00:02.0: PCI INT A disabled
[   36.987453] i915: probe of 0000:00:02.0 failed with error -5

Taking a look at it, I suspected of a timing issue, especially looking at
this commit, which isn't on 3.2:

commit f01db988ef6f6c70a6cc36ee71e4a98a68901229
Author: Sean Paul <seanpaul@chromium.org>
Date:   Fri Mar 16 12:43:22 2012 -0400

    drm/i915: Add wait_for in init_ring_common

And picking it made the issue go away, so the extra delay helped and is needed
with 0d8957c8a90bbb5d34fab9a304459448a5131e06 applied here.

-- 
[]'s
Herton

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

* Re: [ 32/37] drm/i915: correctly order the ring init sequence
  2012-08-17 23:29   ` Herton Ronaldo Krzesinski
@ 2012-08-18 10:04     ` Daniel Vetter
  2012-08-19 14:54       ` Ben Hutchings
  0 siblings, 1 reply; 43+ messages in thread
From: Daniel Vetter @ 2012-08-18 10:04 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski
  Cc: Ben Hutchings, linux-kernel, stable, torvalds, akpm, alan,
	Jani Nikula, Yang Guang

On Sat, Aug 18, 2012 at 1:29 AM, Herton Ronaldo Krzesinski
<herton.krzesinski@canonical.com> wrote:
> On Fri, Aug 17, 2012 at 04:03:15AM +0100, Ben Hutchings wrote:
>> 3.2-stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Daniel Vetter <daniel.vetter@ffwll.ch>
>>
>> commit 0d8957c8a90bbb5d34fab9a304459448a5131e06 upstream.
>>
>> We may only start to set up the new register values after having
>> confirmed that the ring is truely off. Otherwise the hw might lose the
>> newly written register values. This is caught later on in the init
>> sequence, when we check whether the register writes have stuck.
>>
>> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50522
>> Tested-by: Yang Guang <guang.a.yang@intel.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> [...]
>
> With this commit on 3.2, i915 fails to initialize on a G41 based machine
> I have here:
>
> [   36.894261] i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> [   36.894265] i915 0000:00:02.0: setting latency timer to 64
> [   36.933118] mtrr: type mismatch for d0000000,10000000 old: write-back new: write-combining
> [   36.933121] [drm] MTRR allocation failed.  Graphics performance may suffer.
> [   36.933467] i915 0000:00:02.0: irq 42 for MSI/MSI-X
> [   36.933471] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
> [   36.933472] [drm] Driver supports precise vblank timestamp query.
> [   36.933498] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
> [   36.969669] [drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 head 00001074 tail 00000000 start 00001000
> [   36.969763] vga_switcheroo: disabled
> [   36.969765] [drm:i915_driver_load] *ERROR* failed to init modeset
> [   36.987444] i915 0000:00:02.0: PCI INT A disabled
> [   36.987453] i915: probe of 0000:00:02.0 failed with error -5
>
> Taking a look at it, I suspected of a timing issue, especially looking at
> this commit, which isn't on 3.2:
>
> commit f01db988ef6f6c70a6cc36ee71e4a98a68901229
> Author: Sean Paul <seanpaul@chromium.org>
> Date:   Fri Mar 16 12:43:22 2012 -0400
>
>     drm/i915: Add wait_for in init_ring_common
>
> And picking it made the issue go away, so the extra delay helped and is needed
> with 0d8957c8a90bbb5d34fab9a304459448a5131e06 applied here.

Good catch, I've forgotten to check whether all the recent ring_init
patches have gone  through cc: stable. For the stable team, please
pick up both patches:

f01db988ef6f6c70a6cc36ee71e4a98a68901229 and
0d8957c8a90bbb5d34fab9a304459448a5131e06

Note that all kernels that need f01db backported also need
b7884eb45ec98c0d34c7f49005ae9d4b4b4e38f6 (to fix a regression
introduce by the former).

Yeah, the ring init sequence is a fickle beast :( but I'm pretty sure
with these three patches, stable kernels should be up to date and have
all the latest fixes.

Yours, Daniel
-- 
Daniel Vetter
daniel.vetter@ffwll.ch - +41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [ 32/37] drm/i915: correctly order the ring init sequence
  2012-08-18 10:04     ` Daniel Vetter
@ 2012-08-19 14:54       ` Ben Hutchings
  2012-08-19 19:00         ` Herton Ronaldo Krzesinski
  0 siblings, 1 reply; 43+ messages in thread
From: Ben Hutchings @ 2012-08-19 14:54 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Herton Ronaldo Krzesinski, linux-kernel, stable, torvalds, akpm,
	alan, Jani Nikula, Yang Guang

[-- Attachment #1: Type: text/plain, Size: 3711 bytes --]

On Sat, 2012-08-18 at 12:04 +0200, Daniel Vetter wrote:
> On Sat, Aug 18, 2012 at 1:29 AM, Herton Ronaldo Krzesinski
> <herton.krzesinski@canonical.com> wrote:
> > On Fri, Aug 17, 2012 at 04:03:15AM +0100, Ben Hutchings wrote:
> >> 3.2-stable review patch.  If anyone has any objections, please let me know.
> >>
> >> ------------------
> >>
> >> From: Daniel Vetter <daniel.vetter@ffwll.ch>
> >>
> >> commit 0d8957c8a90bbb5d34fab9a304459448a5131e06 upstream.
> >>
> >> We may only start to set up the new register values after having
> >> confirmed that the ring is truely off. Otherwise the hw might lose the
> >> newly written register values. This is caught later on in the init
> >> sequence, when we check whether the register writes have stuck.
> >>
> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50522
> >> Tested-by: Yang Guang <guang.a.yang@intel.com>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > [...]
> >
> > With this commit on 3.2, i915 fails to initialize on a G41 based machine
> > I have here:
> >
> > [   36.894261] i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> > [   36.894265] i915 0000:00:02.0: setting latency timer to 64
> > [   36.933118] mtrr: type mismatch for d0000000,10000000 old: write-back new: write-combining
> > [   36.933121] [drm] MTRR allocation failed.  Graphics performance may suffer.
> > [   36.933467] i915 0000:00:02.0: irq 42 for MSI/MSI-X
> > [   36.933471] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
> > [   36.933472] [drm] Driver supports precise vblank timestamp query.
> > [   36.933498] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
> > [   36.969669] [drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 head 00001074 tail 00000000 start 00001000
> > [   36.969763] vga_switcheroo: disabled
> > [   36.969765] [drm:i915_driver_load] *ERROR* failed to init modeset
> > [   36.987444] i915 0000:00:02.0: PCI INT A disabled
> > [   36.987453] i915: probe of 0000:00:02.0 failed with error -5
> >
> > Taking a look at it, I suspected of a timing issue, especially looking at
> > this commit, which isn't on 3.2:
> >
> > commit 18ef6f6c70a6cc36ee71e4a98a68901229
> > Author: Sean Paul <seanpaul@chromium.org>
> > Date:   Fri Mar 16 12:43:22 2012 -0400
> >
> >     drm/i915: Add wait_for in init_ring_common
> >
> > And picking it made the issue go away, so the extra delay helped and is needed
> > with 0d8957c8a90bbb5d34fab9a304459448a5131e06 applied here.
> 
> Good catch, I've forgotten to check whether all the recent ring_init
> patches have gone  through cc: stable. For the stable team, please
> pick up both patches:
> 
> f01db988ef6f6c70a6cc36ee71e4a98a68901229 and
> 0d8957c8a90bbb5d34fab9a304459448a5131e06
> 
> Note that all kernels that need f01db backported also need
> b7884eb45ec98c0d34c7f49005ae9d4b4b4e38f6 (to fix a regression
> introduce by the former).

3.2.y already had the second and third of these, but not f01db98
'drm/i915: Add wait_for in init_ring_common'.  So I've added that.

I don't have commit 18ef6f6c70a6cc36ee71e4a98a68901229 here, but I
assume it's a cherry-picked version as it has the same subject line.

Ben.

> Yeah, the ring init sequence is a fickle beast :( but I'm pretty sure
> with these three patches, stable kernels should be up to date and have
> all the latest fixes.
> 
> Yours, Daniel

-- 
Ben Hutchings
I say we take off; nuke the site from orbit.  It's the only way to be sure.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 31/37] tun: dont zeroize sock->file on detach
  2012-08-17  3:03 ` [ 31/37] tun: dont zeroize sock->file on detach Ben Hutchings
@ 2012-08-19 17:13   ` Ben Hutchings
  0 siblings, 0 replies; 43+ messages in thread
From: Ben Hutchings @ 2012-08-19 17:13 UTC (permalink / raw)
  To: Stanislav Kinsbursky
  Cc: stable, torvalds, akpm, alan, Ruan Zhijie, Al Viro, Eric Dumazet,
	Yuchung Cheng, David S. Miller, LKML

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

On Fri, 2012-08-17 at 04:03 +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Stanislav Kinsbursky <skinsbursky@parallels.com>
> 
> commit 66d1b9263a371abd15806c53f486f0645ef31a8f upstream.
> 
> This is a fix for bug, introduced in 3.4 kernel by commit
> 1ab5ecb90cb6a3df1476e052f76a6e8f6511cb3d ("tun: don't hold network
> namespace by tun sockets"), which, among other things, replaced simple
> sock_put() by sk_release_kernel(). Below is sequence, which leads to
> oops for non-persistent devices:

I didn't read this message properly when importing cc'd commits.  I'm
going to drop this patch, as it appears that it will result in an inode
leak or other badness if applied to 3.2.y.  Let David Miller know if any
tun fixes should go into 3.2.y.

Ben.

> tun_chr_close()
> tun_detach()				<== tun->socket.file = NULL
> tun_free_netdev()
> sk_release_sock()
> sock_release(sock->file == NULL)
> iput(SOCK_INODE(sock))			<== dereference on NULL pointer
> 
> This patch just removes zeroing of socket's file from __tun_detach().
> sock_release() will do this.
> 
> Reported-by: Ruan Zhijie <ruanzhijie@hotmail.com>
> Tested-by: Ruan Zhijie <ruanzhijie@hotmail.com>
> Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
> Acked-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/net/tun.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 926d4db..3a16d4f 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -187,7 +187,6 @@ static void __tun_detach(struct tun_struct *tun)
>  	netif_tx_lock_bh(tun->dev);
>  	netif_carrier_off(tun->dev);
>  	tun->tfile = NULL;
> -	tun->socket.file = NULL;
>  	netif_tx_unlock_bh(tun->dev);
>  
>  	/* Drop read queue */
> 

-- 
Ben Hutchings
I say we take off; nuke the site from orbit.  It's the only way to be sure.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [ 32/37] drm/i915: correctly order the ring init sequence
  2012-08-19 14:54       ` Ben Hutchings
@ 2012-08-19 19:00         ` Herton Ronaldo Krzesinski
  0 siblings, 0 replies; 43+ messages in thread
From: Herton Ronaldo Krzesinski @ 2012-08-19 19:00 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Daniel Vetter, linux-kernel, stable, torvalds, akpm, alan,
	Jani Nikula, Yang Guang

On Sun, Aug 19, 2012 at 03:54:44PM +0100, Ben Hutchings wrote:
> On Sat, 2012-08-18 at 12:04 +0200, Daniel Vetter wrote:
> > On Sat, Aug 18, 2012 at 1:29 AM, Herton Ronaldo Krzesinski
[...]
> > Good catch, I've forgotten to check whether all the recent ring_init
> > patches have gone  through cc: stable. For the stable team, please
> > pick up both patches:
> > 
> > f01db988ef6f6c70a6cc36ee71e4a98a68901229 and
> > 0d8957c8a90bbb5d34fab9a304459448a5131e06
> > 
> > Note that all kernels that need f01db backported also need
> > b7884eb45ec98c0d34c7f49005ae9d4b4b4e38f6 (to fix a regression
> > introduce by the former).
> 
> 3.2.y already had the second and third of these, but not f01db98
> 'drm/i915: Add wait_for in init_ring_common'.  So I've added that.
> 
> I don't have commit 18ef6f6c70a6cc36ee71e4a98a68901229 here, but I
> assume it's a cherry-picked version as it has the same subject line.

Ops sorry, yes, it's the same commit, just the hash was the version I
had picked in my local branch, I did git show in the wrong tree.

> 
> Ben.
> 
> > Yeah, the ring init sequence is a fickle beast :( but I'm pretty sure
> > with these three patches, stable kernels should be up to date and have
> > all the latest fixes.
> > 
> > Yours, Daniel
> 
> -- 
> Ben Hutchings
> I say we take off; nuke the site from orbit.  It's the only way to be sure.

-- 
[]'s
Herton

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

end of thread, other threads:[~2012-08-19 19:01 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17  3:02 [ 00/37] 3.2.28-stable review Ben Hutchings
2012-08-17  3:02 ` [ 01/37] bnx2: Fix bug in bnx2_free_tx_skbs() Ben Hutchings
2012-08-17  3:02 ` [ 02/37] sch_sfb: Fix missing NULL check Ben Hutchings
2012-08-17  3:02 ` [ 03/37] sctp: Fix list corruption resulting from freeing an association on a list Ben Hutchings
2012-08-17  3:02 ` [ 04/37] caif: Fix access to freed pernet memory Ben Hutchings
2012-08-17  3:02 ` [ 05/37] cipso: dont follow a NULL pointer when setsockopt() is called Ben Hutchings
2012-08-17  3:02 ` [ 06/37] caif: fix NULL pointer check Ben Hutchings
2012-08-17  3:02 ` [ 07/37] wanmain: comparing array with NULL Ben Hutchings
2012-08-17  3:02 ` [ 08/37] tcp: Add TCP_USER_TIMEOUT negative value check Ben Hutchings
2012-08-17  3:02 ` [ 09/37] USB: kaweth.c: use GFP_ATOMIC under spin_lock Ben Hutchings
2012-08-17  3:02 ` [ 10/37] net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling Ben Hutchings
2012-08-17  3:02 ` [ 11/37] tcp: perform DMA to userspace only if there is a task waiting for it Ben Hutchings
2012-08-17  3:02 ` [ 12/37] net/tun: fix ioctl() based info leaks Ben Hutchings
2012-08-17  3:02 ` [ 13/37] e1000: add dropped DMA receive enable back in for WoL Ben Hutchings
2012-08-17  3:02 ` [ 14/37] rtlwifi: rtl8192cu: Change buffer allocation for synchronous reads Ben Hutchings
2012-08-17  3:02 ` [ 15/37] hfsplus: fix overflow in sector calculations in hfsplus_submit_bio Ben Hutchings
2012-08-17  3:02 ` [ 16/37] drm/i915: fixup seqno allocation logic for lazy_request Ben Hutchings
2012-08-17  3:03 ` [ 17/37] KVM: VMX: Advertise CPU_BASED_RDPMC_EXITING for nested guests Ben Hutchings
2012-08-17  3:03 ` [ 18/37] mac80211: cancel mesh path timer Ben Hutchings
2012-08-17  3:03 ` [ 19/37] ath9k: Add PID/VID support for AR1111 Ben Hutchings
2012-08-17  3:03 ` [ 20/37] ARM: mxs: Remove MMAP_MIN_ADDR setting from mxs_defconfig Ben Hutchings
2012-08-17  3:03 ` [ 21/37] ALSA: hda - add dock support for Thinkpad T430s Ben Hutchings
2012-08-17  3:03 ` [ 22/37] cfg80211: process pending events when unregistering net device Ben Hutchings
2012-08-17  3:03 ` [ 23/37] rt61pci: fix NULL pointer dereference in config_lna_gain Ben Hutchings
2012-08-17  3:03 ` [ 24/37] iwlwifi: disable greenfield transmissions as a workaround Ben Hutchings
2012-08-17  3:03 ` [ 25/37] ALSA: hda - add dock support for Thinkpad X230 Ben Hutchings
2012-08-17  3:03 ` [ 26/37] e1000e: NIC goes up and immediately goes down Ben Hutchings
2012-08-17  3:03 ` [ 27/37] ALSA: hda - remove quirk for Dell Vostro 1015 Ben Hutchings
2012-08-17  3:03 ` [ 28/37] ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo Ideapad Ben Hutchings
2012-08-17  3:03 ` [ 29/37] ARM: pxa: remove irq_to_gpio from ezx-pcap driver Ben Hutchings
2012-08-17  3:03 ` [ 30/37] Input: eeti_ts: pass gpio value instead of IRQ Ben Hutchings
2012-08-17  3:03 ` [ 31/37] tun: dont zeroize sock->file on detach Ben Hutchings
2012-08-19 17:13   ` Ben Hutchings
2012-08-17  3:03 ` [ 32/37] drm/i915: correctly order the ring init sequence Ben Hutchings
2012-08-17 23:29   ` Herton Ronaldo Krzesinski
2012-08-18 10:04     ` Daniel Vetter
2012-08-19 14:54       ` Ben Hutchings
2012-08-19 19:00         ` Herton Ronaldo Krzesinski
2012-08-17  3:03 ` [ 33/37] s390/compat: fix compat wrappers for process_vm system calls Ben Hutchings
2012-08-17  3:03 ` [ 34/37] s390/compat: fix mmap compat " Ben Hutchings
2012-08-17  3:03 ` [ 35/37] drm/radeon: fix bank tiling parameters on evergreen Ben Hutchings
2012-08-17  3:03 ` [ 36/37] drm/radeon: fix bank tiling parameters on cayman Ben Hutchings
2012-08-17  3:03 ` [ 37/37] drm/radeon: do not reenable crtc after moving vram start address Ben Hutchings

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).