[PATCH 3.16.y-ckt 064/168] Bluetooth: Add support for Acer [13D3:3432]

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Anantha Krishnan 

commit fa2f1394fe9c1a217213f02df77812701de6362f upstream.

Add support for the QCA6174 chip.

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

Signed-off-by: Anantha Krishnan 
Signed-off-by: Marcel Holtmann 
Signed-off-by: Luis Henriques 
---
 drivers/bluetooth/ath3k.c | 2 ++
 drivers/bluetooth/btusb.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 095c4381f697..6b8c09dc3e55 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -104,6 +104,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x13d3, 0x3375) },
{ USB_DEVICE(0x13d3, 0x3393) },
{ USB_DEVICE(0x13d3, 0x3402) },
+   { USB_DEVICE(0x13d3, 0x3432) },
 
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE02C) },
@@ -153,6 +154,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
+   { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
 
/* Atheros AR5BBU22 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 0663fe85be29..a917f38f03ec 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -183,6 +183,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
+   { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
 
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 066/168] Input: xpad - add VID/PID for Razer Sabertooth

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Frank Razenberg 

commit a7b447380c5c974c740437af82793e450f47304d upstream.

The xpad driver recognizes Razer Sabertooth controllers as generic xbox
controller, while it is really a 360 controller.  This patch adds pid/vid
mappings for the controller so that it is correctly recognized.

Signed-off-by: Frank Razenberg 
Signed-off-by: Dmitry Torokhov 
Signed-off-by: Luis Henriques 
---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 603fe0dd3682..a5a1b6f5796b 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -169,6 +169,7 @@ static const struct xpad_device {
{ 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, 
XTYPE_XBOX360 },
{ 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 },
{ 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 },
+   { 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 },
{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, 
XTYPE_XBOX360 },
{ 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 },
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 065/168] Add a new PID/VID 0227/0930 for AR3012.

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Vincent Zwanenburg 

commit 89d2975fa06e66ea0d3665d91f799fb1ce4b8bad upstream.

usb devices info:

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

Signed-off-by: Vincent Zwanenburg 
Signed-off-by: Marcel Holtmann 
Signed-off-by: Luis Henriques 
---
 drivers/bluetooth/ath3k.c | 2 ++
 drivers/bluetooth/btusb.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 6b8c09dc3e55..3a7356a72b53 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -88,6 +88,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x04CA, 0x300b) },
{ USB_DEVICE(0x0930, 0x0219) },
{ USB_DEVICE(0x0930, 0x0220) },
+   { USB_DEVICE(0x0930, 0x0227) },
{ USB_DEVICE(0x0b05, 0x17d0) },
{ USB_DEVICE(0x0CF3, 0x0036) },
{ USB_DEVICE(0x0CF3, 0x3004) },
@@ -138,6 +139,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
+   { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index a917f38f03ec..67fa7de5376a 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -167,6 +167,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
+   { USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 068/168] Input: xpad - add USB ID for Thrustmaster Ferrari 458 Racing Wheel

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Tommi Rantala 

commit 4b54625822eb7a4eae9c5b8c890b6c4dc001b895 upstream.

Add the USB ID for the Xbox 360 Thrustmaster Ferrari 458 Racing Wheel.

Signed-off-by: Tommi Rantala 
Signed-off-by: Dmitry Torokhov 
Signed-off-by: Luis Henriques 
---
 drivers/input/joystick/xpad.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 229495a936f0..e383eebbafdd 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -207,6 +207,7 @@ static const struct xpad_device {
{ 0x24c6, 0x5501, "Hori Real Arcade Pro VX-SA", 0, XTYPE_XBOX360 },
{ 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick", 0, XTYPE_XBOX360 },
{ 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 
},
+   { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, 
XTYPE_XBOX360 },
{ 0x, 0x, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
{ 0x, 0x, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
 };
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 3/4] Documentation: Add cutoff periods for patch acceptance

2014-12-15 Thread One Thousand Gnomes
> +
> +  kernel.org "mainline:"  |  Patch may appear
> +  field when posted   |  in released kernel
> +  +
> +  3.18-rc[1-4]|  3.19
> +  3.18-rc[5-9]|  3.20
> +  3.18|  Merge window open - don't post
> +  3.19-rc[1-4]|  3.20
> +  3.19-rc[5-9]|  3.21
> +  3.19|  Merge window open - don't post
> +
> +Bug fixes can typically be accepted at any time.

That's exactly what was needed I think

Acked-by: Alan Cox 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 070/168] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: David Jeffery 

commit 92a56555bd576c61b27a5cab9f38a33a1e9a1df5 upstream.

If a SIGKILL is sent to a task waiting in __nfs_iocounter_wait,
it will busy-wait or soft lockup in its while loop.
nfs_wait_bit_killable won't sleep, and the loop won't exit on
the error return.

Stop the busy-wait by breaking out of the loop when
nfs_wait_bit_killable returns an error.

Signed-off-by: David Jeffery 
Signed-off-by: Trond Myklebust 
[ kamal: backport to 3.13-stable: context ]
Cc: Moritz Mühlenhoff 
Signed-off-by: Kamal Mostafa 
Signed-off-by: Luis Henriques 
---
 fs/nfs/pagelist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 3a9c34a0f898..54d049f930f7 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -116,7 +116,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c)
if (atomic_read(&c->io_count) == 0)
break;
ret = nfs_wait_bit_killable(&c->flags);
-   } while (atomic_read(&c->io_count) != 0);
+   } while (atomic_read(&c->io_count) != 0 && !ret);
finish_wait(wq, &q.wait);
return ret;
 }
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 052/168] vfs: Don't exchange "short" filenames unconditionally.

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Mikhail Efremov 

commit d2fa4a8476b911782f7e5167db18770222ac40c3 upstream.

Only exchange source and destination filenames
if flags contain RENAME_EXCHANGE.
In case if executable file was running and replaced by
other file /proc/PID/exe should still show correct file name,
not the old name of the file by which it was replaced.

The scenario when this bug manifests itself was like this:
* ALT Linux uses rpm and start-stop-daemon;
* during a package upgrade rpm creates a temporary file
  for an executable to rename it upon successful unpacking;
* start-stop-daemon is run subsequently and it obtains
  the (nonexistant) temporary filename via /proc/PID/exe
  thus failing to identify the running process.

Note that "long" filenames (> DNAiME_INLINE_LEN) are still
exchanged without RENAME_EXCHANGE and this behaviour exists
long enough (should be fixed too apparently).
So this patch is just an interim workaround that restores
behavior for "short" names as it was before changes
introduced by commit da1ce0670c14 ("vfs: add cross-rename").

See https://lkml.org/lkml/2014/9/7/6 for details.

AV: the comments about being more careful with ->d_name.hash
than with ->d_name.name are from back in 2.3.40s; they
became obsolete by 2.3.60s, when we started to unhash the
target instead of swapping hash chain positions followed
by d_delete() as we used to do when dcache was first
introduced.

Acked-by: Miklos Szeredi 
Cc: Linus Torvalds 
Cc: Alexander Viro 
Cc: linux-fsde...@vger.kernel.org
Fixes: da1ce0670c14 "vfs: add cross-rename"
Signed-off-by: Mikhail Efremov 
Signed-off-by: Al Viro 
Signed-off-by: Stefan Bader 
[ luis: used Stefan's backport to 3.16 ]
Signed-off-by: Luis Henriques 
---
 fs/dcache.c | 28 +++-
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 8a7dcc895d99..1d8b6a310822 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2401,7 +2401,8 @@ void dentry_update_name_case(struct dentry *dentry, 
struct qstr *name)
 }
 EXPORT_SYMBOL(dentry_update_name_case);
 
-static void switch_names(struct dentry *dentry, struct dentry *target)
+static void switch_names(struct dentry *dentry, struct dentry *target,
+bool exchange)
 {
if (dname_external(target)) {
if (dname_external(dentry)) {
@@ -2435,6 +2436,12 @@ static void switch_names(struct dentry *dentry, struct 
dentry *target)
 */
unsigned int i;
BUILD_BUG_ON(!IS_ALIGNED(DNAME_INLINE_LEN, 
sizeof(long)));
+   if (!exchange) {
+   memcpy(dentry->d_iname, target->d_name.name,
+   target->d_name.len + 1);
+   dentry->d_name.hash_len = 
target->d_name.hash_len;
+   return;
+   }
for (i = 0; i < DNAME_INLINE_LEN / sizeof(long); i++) {
swap(((long *) &dentry->d_iname)[i],
 ((long *) &target->d_iname)[i]);
@@ -2484,12 +2491,15 @@ static void dentry_unlock_parents_for_move(struct 
dentry *dentry,
  * When switching names, the actual string doesn't strictly have to
  * be preserved in the target - because we're dropping the target
  * anyway. As such, we can just do a simple memcpy() to copy over
- * the new name before we switch.
- *
- * Note that we have to be a lot more careful about getting the hash
- * switched - we have to switch the hash value properly even if it
- * then no longer matches the actual (corrupted) string of the target.
- * The hash value has to match the hash queue that the dentry is on..
+ * the new name before we switch, unless we are going to rehash
+ * it.  Note that if we *do* unhash the target, we are not allowed
+ * to rehash it without giving it a new name/hash key - whether
+ * we swap or overwrite the names here, resulting name won't match
+ * the reality in filesystem; it's only there for d_path() purposes.
+ * Note that all of this is happening under rename_lock, so the
+ * any hash lookup seeing it in the middle of manipulations will
+ * be discarded anyway.  So we do not care what happens to the hash
+ * key in that case.
  */
 /*
  * __d_move - move a dentry
@@ -2539,7 +2549,7 @@ static void __d_move(struct dentry *dentry, struct dentry 
*target,
list_del(&target->d_u.d_child);
 
/* Switch the names.. */
-   switch_names(dentry, target);
+   switch_names(dentry, target, exchange);
 
/* ... and switch the parents */
if (IS_ROOT(dentry)) {
@@ -2677,7 +2687,7 @@ static void __d_materialise_dentry(struct dentry *dentry, 
struct dentry *anon)
 
dparent = dentry->d_parent;
 
-   switch_names(dentry, anon);
+   switch_names(dentry, anon, false)

[PATCH 3.16.y-ckt 074/168] ARM: mvebu: add missing of_node_put() call in coherency.c

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Thomas Petazzoni 

commit 2eb04ae010a8fb165ba7aa56e9aa8e7980887dee upstream.

There is a missing of_node_put() to decrement the device_node
reference counter after a of_find_matching_node() in coherency_init().

Fixes: 501f928e0097 ("ARM: mvebu: add a coherency_available() call")
Signed-off-by: Thomas Petazzoni 
Acked-by: Gregory CLEMENT 
Link: 
https://lkml.kernel.org/r/1414423955-5933-4-git-send-email-thomas.petazz...@free-electrons.com
Signed-off-by: Jason Cooper 
Signed-off-by: Luis Henriques 
---
 arch/arm/mach-mvebu/coherency.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 2bdc3233abe2..044b51185fcc 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -400,6 +400,8 @@ int __init coherency_init(void)
 type == COHERENCY_FABRIC_TYPE_ARMADA_380)
armada_375_380_coherency_init(np);
 
+   of_node_put(np);
+
return 0;
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Xen-devel] [PATCH v2 2/2] x86, arm, platform, xen, kconfig: add xen defconfig helper

2014-12-15 Thread Stefano Stabellini
On Tue, 9 Dec 2014, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" 
> 
> This lets you build a kernel which can support xen dom0
> or xen guests by just using:
> 
>make xenconfig
> 
> on both x86 and arm64 kernels. This also splits out the
> options which are available currently to be built with x86
> and 'make ARCH=arm64' under a shared config.
> 
> Technically xen supports a dom0 kernel and also a guest
> kernel configuration but upon review with the xen team
> since we don't have many dom0 options its best to just
> combine these two into one.
> 
> Cc: Josh Triplett 
> Cc: Borislav Petkov 
> Cc: Pekka Enberg 
> Cc: David Rientjes 
> Cc: Michal Marek 
> Cc: Randy Dunlap 
> Cc: penb...@kernel.org
> Cc: levinsasha...@gmail.com
> Cc: mtosa...@redhat.com
> Cc: fengguang...@intel.com
> Cc: David Vrabel 
> Cc: Ian Campbell 
> Cc: Konrad Rzeszutek Wilk 
> Cc: xen-de...@lists.xenproject.org
> Reviewed-by: Josh Triplett 
> Signed-off-by: Luis R. Rodriguez 
> ---
>  arch/x86/configs/xen.config |  7 +++
>  kernel/configs/xen.config   | 30 ++
>  scripts/kconfig/Makefile|  5 +
>  3 files changed, 42 insertions(+)
>  create mode 100644 arch/x86/configs/xen.config
>  create mode 100644 kernel/configs/xen.config
> 
> diff --git a/arch/x86/configs/xen.config b/arch/x86/configs/xen.config
> new file mode 100644
> index 000..92b8587f
> --- /dev/null
> +++ b/arch/x86/configs/xen.config
> @@ -0,0 +1,7 @@
> +# x86 xen specific config options
> +CONFIG_XEN_PVHVM=y
> +CONFIG_XEN_MAX_DOMAIN_MEMORY=500
> +CONFIG_XEN_SAVE_RESTORE=y
> +# CONFIG_XEN_DEBUG_FS is not set
> +CONFIG_XEN_PVH=y
> +CONFIG_XEN_MCE_LOG=y
> diff --git a/kernel/configs/xen.config b/kernel/configs/xen.config
> new file mode 100644
> index 000..d2ec010
> --- /dev/null
> +++ b/kernel/configs/xen.config
> @@ -0,0 +1,30 @@
> +# generic config
> +CONFIG_XEN=y
> +CONFIG_XEN_DOM0=y
> +CONFIG_PCI_XEN=y

This shouldn't be here


> +CONFIG_XEN_PCIDEV_FRONTEND=m
> +CONFIG_XEN_BLKDEV_FRONTEND=m
> +CONFIG_XEN_BLKDEV_BACKEND=m
> +CONFIG_XEN_NETDEV_FRONTEND=m
> +CONFIG_XEN_NETDEV_BACKEND=m
> +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
> +CONFIG_HVC_XEN=y
> +CONFIG_HVC_XEN_FRONTEND=y
> +CONFIG_TCG_XEN=m

neither should this


> +CONFIG_XEN_WDT=m
> +CONFIG_XEN_FBDEV_FRONTEND=y
> +CONFIG_XEN_BALLOON=y
> +CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
> +CONFIG_XEN_SCRUB_PAGES=y
> +CONFIG_XEN_DEV_EVTCHN=m
> +CONFIG_XEN_BACKEND=y
> +CONFIG_XENFS=m
> +CONFIG_XEN_COMPAT_XENFS=y
> +CONFIG_XEN_SYS_HYPERVISOR=y
> +CONFIG_XEN_XENBUS_FRONTEND=y
> +CONFIG_XEN_GNTDEV=m
> +CONFIG_XEN_GRANT_DEV_ALLOC=m
> +CONFIG_SWIOTLB_XEN=y
> +CONFIG_XEN_PCIDEV_BACKEND=m
> +CONFIG_XEN_PRIVCMD=m
> +CONFIG_XEN_ACPI_PROCESSOR=m

and this


> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index ff612b0..f4a8f89 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -117,6 +117,10 @@ PHONY += kvmconfig
>  kvmconfig:
>   $(call mergeconfig,kvm_guest)
>  
> +PHONY += xenconfig
> +xenconfig:
> + $(call mergeconfig,xen)
> +
>  PHONY += tinyconfig
>  tinyconfig: allnoconfig
>   $(call mergeconfig,tiny)
> @@ -142,6 +146,7 @@ help:
>   @echo  '  listnewconfig   - List new options'
>   @echo  '  olddefconfig- Same as silentoldconfig but sets new 
> symbols to their default value'
>   @echo  '  kvmconfig   - Enable additional options for kvm guest 
> kernel support'
> + @echo  '  xenconfig   - Enable additional options for xen dom0 and 
> guest kernel support'
>   @echo  '  tinyconfig  - Configure the tiniest possible kernel'
>  
>  # lxdialog stuff
> -- 
> 2.1.1
> 
> 
> ___
> Xen-devel mailing list
> xen-de...@lists.xen.org
> http://lists.xen.org/xen-devel
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 073/168] aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Gu Zheng 

commit 835f252c6debd204fcd607c79975089b1ecd3472 upstream.

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

Markus reported that when shutting down mysqld (with AIO support,
on a ext3 formatted Harddrive) leads to a negative number of dirty pages
(underrun to the counter). The negative number results in a drastic reduction
of the write performance because the page cache is not used, because the kernel
thinks it is still 2 ^ 32 dirty pages open.

Add a warn trace in __dec_zone_state will catch this easily:

static inline void __dec_zone_state(struct zone *zone, enum
zone_stat_item item)
{
 atomic_long_dec(&zone->vm_stat[item]);
+WARN_ON_ONCE(item == NR_FILE_DIRTY &&
atomic_long_read(&zone->vm_stat[item]) < 0);
 atomic_long_dec(&vm_stat[item]);
}

[   21.341632] [ cut here ]
[   21.346294] WARNING: CPU: 0 PID: 309 at include/linux/vmstat.h:242
cancel_dirty_page+0x164/0x224()
[   21.355296] Modules linked in: wutbox_cp sata_mv
[   21.359968] CPU: 0 PID: 309 Comm: kworker/0:1 Not tainted 3.14.21-WuT #80
[   21.366793] Workqueue: events free_ioctx
[   21.370760] [] (unwind_backtrace) from []
(show_stack+0x20/0x24)
[   21.378562] [] (show_stack) from []
(dump_stack+0x24/0x28)
[   21.385840] [] (dump_stack) from []
(warn_slowpath_common+0x84/0x9c)
[   21.393976] [] (warn_slowpath_common) from []
(warn_slowpath_null+0x2c/0x34)
[   21.402800] [] (warn_slowpath_null) from []
(cancel_dirty_page+0x164/0x224)
[   21.411524] [] (cancel_dirty_page) from []
(truncate_inode_page+0x8c/0x158)
[   21.420272] [] (truncate_inode_page) from []
(truncate_inode_pages_range+0x11c/0x53c)
[   21.429890] [] (truncate_inode_pages_range) from
[] (truncate_pagecache+0x88/0xac)
[   21.439252] [] (truncate_pagecache) from []
(truncate_setsize+0x5c/0x74)
[   21.447731] [] (truncate_setsize) from []
(put_aio_ring_file.isra.14+0x34/0x90)
[   21.456826] [] (put_aio_ring_file.isra.14) from
[] (aio_free_ring+0x20/0xcc)
[   21.465660] [] (aio_free_ring) from []
(free_ioctx+0x24/0x44)
[   21.473190] [] (free_ioctx) from []
(process_one_work+0x134/0x47c)
[   21.481132] [] (process_one_work) from []
(worker_thread+0x130/0x414)
[   21.489350] [] (worker_thread) from []
(kthread+0xd4/0xec)
[   21.496621] [] (kthread) from []
(ret_from_fork+0x14/0x20)
[   21.503884] ---[ end trace 79c4bf42c038c9a1 ]---

The cause is that we set the aio ring file pages as *DIRTY* via SetPageDirty
(bypasses the VFS dirty pages increment) when init, and aio fs uses
*default_backing_dev_info* as the backing dev, which does not disable
the dirty pages accounting capability.
So truncating aio ring file will contribute to accounting dirty pages (VFS
dirty pages decrement), then error occurs.

The original goal is keeping these pages in memory (can not be reclaimed
or swapped) in life-time via marking it dirty. But thinking more, we have
already pinned pages via elevating the page's refcount, which can already
achieve the goal, so the SetPageDirty seems unnecessary.

In order to fix the issue, using the __set_page_dirty_no_writeback instead
of the nop .set_page_dirty, and dropped the SetPageDirty (don't manually
set the dirty flags, don't disable set_page_dirty(), rely on default behaviour).

With the above change, the dirty pages accounting can work well. But as we
known, aio fs is an anonymous one, which should never cause any real write-back,
we can ignore the dirty pages (write back) accounting by disabling the dirty
pages (write back) accounting capability. So we introduce an aio private
backing dev info (disabled the ACCT_DIRTY/WRITEBACK/ACCT_WB capabilities) to
replace the default one.

Reported-by: Markus Königshaus 
Signed-off-by: Gu Zheng 
Acked-by: Andrew Morton 
Signed-off-by: Benjamin LaHaise 
Signed-off-by: Luis Henriques 
---
 fs/aio.c | 21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/fs/aio.c b/fs/aio.c
index d72588a4c935..b645387b6d57 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -165,6 +165,15 @@ static struct vfsmount *aio_mnt;
 static const struct file_operations aio_ring_fops;
 static const struct address_space_operations aio_ctx_aops;
 
+/* Backing dev info for aio fs.
+ * -no dirty page accounting or writeback happens
+ */
+static struct backing_dev_info aio_fs_backing_dev_info = {
+   .name   = "aiofs",
+   .state  = 0,
+   .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK | BDI_CAP_MAP_COPY,
+};
+
 static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
 {
struct qstr this = QSTR_INIT("[aio]", 5);
@@ -176,6 +185,7 @@ static struct file *aio_private_file(struct kioctx *ctx, 
loff_t nr_pages)
 
inode->i_mapping->a_ops = &aio_ctx_aops;
inode->i_mapping->private_data = ctx;
+   inode->i_mapping->backing_dev_info = &aio_fs_backing_dev_info;
inode->i_size = PAGE_SIZE * n

[PATCH 3.16.y-ckt 072/168] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Steven Capper 

commit ded9477984690d026e46dd75e8157392cea3f13f upstream.

For LPAE, we have the following means for encoding writable or dirty
ptes:
  L_PTE_DIRTY   L_PTE_RDONLY
!pte_dirty && !pte_write0   1
!pte_dirty && pte_write 0   1
pte_dirty && !pte_write 1   1
pte_dirty && pte_write  1   0

So we can't distinguish between writeable clean ptes and read only
ptes. This can cause problems with ptes being incorrectly flagged as
read only when they are writeable but not dirty.

This patch renumbers L_PTE_RDONLY from AP[2] to a software bit #58,
and adds additional logic to set AP[2] whenever the pte is read only
or not dirty. That way we can distinguish between clean writeable ptes
and read only ptes.

HugeTLB pages will use this new logic automatically.

We need to add some logic to Transparent HugePages to ensure that they
correctly interpret the revised pgprot permissions (L_PTE_RDONLY has
moved and no longer matches PMD_SECT_AP2). In the process of revising
THP, the names of the PMD software bits have been prefixed with L_ to
make them easier to distinguish from their hardware bit counterparts.

Signed-off-by: Steve Capper 
Reviewed-by: Will Deacon 
Signed-off-by: Russell King 
Cc: Hou Pengyang 
Signed-off-by: Luis Henriques 
---
 arch/arm/include/asm/pgtable-3level-hwdef.h |  3 ++-
 arch/arm/include/asm/pgtable-3level.h   | 41 +
 arch/arm/mm/dump.c  |  4 +--
 arch/arm/mm/proc-v7-3level.S|  9 +--
 4 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h 
b/arch/arm/include/asm/pgtable-3level-hwdef.h
index 626989fec4d3..9fd61c72a33a 100644
--- a/arch/arm/include/asm/pgtable-3level-hwdef.h
+++ b/arch/arm/include/asm/pgtable-3level-hwdef.h
@@ -43,7 +43,7 @@
 #define PMD_SECT_BUFFERABLE(_AT(pmdval_t, 1) << 2)
 #define PMD_SECT_CACHEABLE (_AT(pmdval_t, 1) << 3)
 #define PMD_SECT_USER  (_AT(pmdval_t, 1) << 6) /* AP[1] */
-#define PMD_SECT_RDONLY(_AT(pmdval_t, 1) << 7) /* 
AP[2] */
+#define PMD_SECT_AP2   (_AT(pmdval_t, 1) << 7) /* read only */
 #define PMD_SECT_S (_AT(pmdval_t, 3) << 8)
 #define PMD_SECT_AF(_AT(pmdval_t, 1) << 10)
 #define PMD_SECT_nG(_AT(pmdval_t, 1) << 11)
@@ -72,6 +72,7 @@
 #define PTE_TABLE_BIT  (_AT(pteval_t, 1) << 1)
 #define PTE_BUFFERABLE (_AT(pteval_t, 1) << 2) /* AttrIndx[0] 
*/
 #define PTE_CACHEABLE  (_AT(pteval_t, 1) << 3) /* AttrIndx[1] 
*/
+#define PTE_AP2(_AT(pteval_t, 1) << 7) /* 
AP[2] */
 #define PTE_EXT_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], 
inner shareable */
 #define PTE_EXT_AF (_AT(pteval_t, 1) << 10)/* Access Flag 
*/
 #define PTE_EXT_NG (_AT(pteval_t, 1) << 11)/* nG */
diff --git a/arch/arm/include/asm/pgtable-3level.h 
b/arch/arm/include/asm/pgtable-3level.h
index 34f371c4bbb2..06e0bc0f8b00 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -79,18 +79,19 @@
 #define L_PTE_PRESENT  (_AT(pteval_t, 3) << 0) /* Present */
 #define L_PTE_FILE (_AT(pteval_t, 1) << 2) /* only when 
!PRESENT */
 #define L_PTE_USER (_AT(pteval_t, 1) << 6) /* AP[1] */
-#define L_PTE_RDONLY   (_AT(pteval_t, 1) << 7) /* AP[2] */
 #define L_PTE_SHARED   (_AT(pteval_t, 3) << 8) /* SH[1:0], 
inner shareable */
 #define L_PTE_YOUNG(_AT(pteval_t, 1) << 10)/* AF */
 #define L_PTE_XN   (_AT(pteval_t, 1) << 54)/* XN */
-#define L_PTE_DIRTY(_AT(pteval_t, 1) << 55)/* unused */
-#define L_PTE_SPECIAL  (_AT(pteval_t, 1) << 56)/* unused */
+#define L_PTE_DIRTY(_AT(pteval_t, 1) << 55)
+#define L_PTE_SPECIAL  (_AT(pteval_t, 1) << 56)
 #define L_PTE_NONE (_AT(pteval_t, 1) << 57)/* PROT_NONE */
+#define L_PTE_RDONLY   (_AT(pteval_t, 1) << 58)/* READ ONLY */
 
-#define PMD_SECT_VALID (_AT(pmdval_t, 1) << 0)
-#define PMD_SECT_DIRTY (_AT(pmdval_t, 1) << 55)
-#define PMD_SECT_SPLITTING (_AT(pmdval_t, 1) << 56)
-#define PMD_SECT_NONE  (_AT(pmdval_t, 1) << 57)
+#define L_PMD_SECT_VALID   (_AT(pmdval_t, 1) << 0)
+#define L_PMD_SECT_DIRTY   (_AT(pmdval_t, 1) << 55)
+#define L_PMD_SECT_SPLITTING   (_AT(pmdval_t, 1) << 56)
+#define L_PMD_SECT_NONE(_AT(pmdval_t, 1) << 57)
+#define L_PMD_SECT_RDONLY  (_AT(pteval_t, 1) << 58)
 
 /*
  * To be used in assembly code with the upper page attributes.
@@ -214,24 +215,25 

[PATCH v2 2/3] devfreq: exynos: Add driver for Exynos3250

2014-12-15 Thread Krzysztof Kozlowski
Add new devfreq driver for Exynos3250. The driver utilizes devfreq event
class for bus utilization data is multiplatform safe. Currently it does
not support ASV (Adaptive Supply Voltage).

Driver creates two devices:
 - Dynamic Memory Controller (DMC) and memory bus,
 - peripheral (left/right) buses.

For memory it changes the DMC clock from 50 MHz to 400 MHz and MIF
voltage regulator from 800 mV to 875 mV.
As for peripheral it changes the frequencies of multiple bus clocks and
INT voltage regulator from 850 mV to 950 mV.

Impact on performance (Rinato/Gear 2 board) calculated with:
$ perf bench mem memcpy -l 256MB -i 10
$ perf bench mem memset -l 256MB -i 10
$ dd if=/dev/mmcblk0p15 of=/opt/file iflag=direct oflag=direct count=128 bs=1M

 type   | no devfreq [MB/s] | devfreq [MB/s] |   diff
=
memcpy  | 152.016   | 151.590|  -0.3%
memcpy prefault | 166.636   | 166.598|   0.0%
memset  | 126.832   | 112.814| -11.0%
memset prefault | 168.349   | 168.287|  -0.0%
MMC transfer|  19.0 |  18.5  |  -2.6%

Impact on energy consumption, system in idle (WFI), mA:
 no devfreq [mA] | devfreq [mA] |   diff

 29.0| 19.2 | -33.8%

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/devfreq/Kconfig  |  12 +
 drivers/devfreq/Makefile |   1 +
 drivers/devfreq/exynos/Makefile  |   1 +
 drivers/devfreq/exynos/exynos3_bus.c | 847 +++
 4 files changed, 861 insertions(+)
 create mode 100644 drivers/devfreq/exynos/exynos3_bus.c

diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index d4559f7866d6..ed4718bad8c9 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -65,6 +65,18 @@ config DEVFREQ_GOV_USERSPACE
 
 comment "DEVFREQ Drivers"
 
+config ARM_EXYNOS3_BUS_DEVFREQ
+   bool "ARM Exynos3250 Memory and peripheral bus DEVFREQ Driver"
+   depends on SOC_EXYNOS3250
+   select DEVFREQ_GOV_SIMPLE_ONDEMAND
+   select PM_OPP
+   help
+ This adds the DEVFREQ driver for Exynos3250 memory interface
+ and peripheral bus (vdd_mif + vdd_int).
+ It reads PPMU counters of memory controllers and adjusts
+ the operating frequencies and voltages with OPP support.
+ This does not yet operate with optimal voltages.
+
 config ARM_EXYNOS4_BUS_DEVFREQ
bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver"
depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && 
!ARCH_MULTIPLATFORM
diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
index a1ffabe90a14..780f1c4724ea 100644
--- a/drivers/devfreq/Makefile
+++ b/drivers/devfreq/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o
 obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)+= governor_userspace.o
 
 # DEVFREQ Drivers
+obj-$(CONFIG_ARM_EXYNOS3_BUS_DEVFREQ)  += exynos/
 obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ)  += exynos/
 obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ)  += exynos/
 
diff --git a/drivers/devfreq/exynos/Makefile b/drivers/devfreq/exynos/Makefile
index 49bc9175f923..a4aa1ed474c9 100644
--- a/drivers/devfreq/exynos/Makefile
+++ b/drivers/devfreq/exynos/Makefile
@@ -1,3 +1,4 @@
 # Exynos DEVFREQ Drivers
+obj-$(CONFIG_ARM_EXYNOS3_BUS_DEVFREQ)  += exynos_ppmu.o exynos3_bus.o
 obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ)  += exynos_ppmu.o exynos4_bus.o
 obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ)  += exynos_ppmu.o exynos5_bus.o
diff --git a/drivers/devfreq/exynos/exynos3_bus.c 
b/drivers/devfreq/exynos/exynos3_bus.c
new file mode 100644
index ..e01c3d90d2b8
--- /dev/null
+++ b/drivers/devfreq/exynos/exynos3_bus.c
@@ -0,0 +1,847 @@
+/*
+ * drivers/devfreq/exynos/exynos3_bus.c
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * based on drivers/devfreqw/exynos/exynos4_bus.c
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ *
+ * EXYNOS3250 - Memory/Bus clock frequency scaling support in DEVFREQ framework
+ * This version supports EXYNOS3250 only.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+/*#include "exynos_ppmu.h"*/
+
+/*
+ * Assume that the bus is saturated if the utilization is 30%.
+ *
+ * Saturation ratio is less than that in exynos4_bus.c (40%) to boost
+ * ondemand governor early.
+ * Memory tests (memcpy, memory alloc, dmatest) shown that ratio of 40%
+ * triggers frequency increase sporadically.
+ */
+#define EXYNOS3_BUS_SATURATION_RATIO   30
+#define EXYNOS3_BUS_INT_REGULATOR_NAME "vdd-int"
+#define EXYNOS3_BUS_MIF_REGULATOR_NAME "vdd-mif"
+
+#define EXYNOS3_BUS_PPMU_NUM  

[PATCH v2 0/3] devfreq: exynos: Add driver for Exynos3250

2014-12-15 Thread Krzysztof Kozlowski
Hi,


Changes since v1

1. Patch 1/3, bindings: fixes after review from Mark Rutland.
2. Patch 2/3, driver: update perf benchmarks.
3. Rebase on Chanwoo's devfreq-event class patches v3 [1].


Description
===
The aim of patchset is to gather feedback about adding new devfreq driver for
Exynos 3250, along with the bindings.

The patchset uses devfreq-event class posted recently [1].

Chanwoo,
You were the author of our initial exynos3_bus.c driver so do you
want me to add your Signed-off-by?

[1] [RFC PATCHv3 0/7] devfreq: Add devfreq-event class to provide
raw data for devfreq device
https://lkml.org/lkml/2014/12/12/219


Best regards,
Krzysztof


Krzysztof Kozlowski (3):
  devfreq: dt-bindings: Document bindings for Exynos3250 bus DVFS driver
  devfreq: exynos: Add driver for Exynos3250
  ARM: dts: Add devfreq to Exynos3250 and Rinato board

 .../bindings/arm/samsung/exynos3250-devfreq.txt|  62 ++
 arch/arm/boot/dts/exynos3250-rinato.dts|  12 +
 arch/arm/boot/dts/exynos3250.dtsi  |  26 +
 drivers/devfreq/Kconfig|  12 +
 drivers/devfreq/Makefile   |   1 +
 drivers/devfreq/exynos/Makefile|   1 +
 drivers/devfreq/exynos/exynos3_bus.c   | 847 +
 7 files changed, 961 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/arm/samsung/exynos3250-devfreq.txt
 create mode 100644 drivers/devfreq/exynos/exynos3_bus.c

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/3] devfreq: dt-bindings: Document bindings for Exynos3250 bus DVFS driver

2014-12-15 Thread Krzysztof Kozlowski
Add documentation for bindings used by Exynos3250 Dynamic Voltage
and Frequency Scaling (DVFS) driver.

Signed-off-by: Krzysztof Kozlowski 
---
 .../bindings/arm/samsung/exynos3250-devfreq.txt| 62 ++
 1 file changed, 62 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/arm/samsung/exynos3250-devfreq.txt

diff --git 
a/Documentation/devicetree/bindings/arm/samsung/exynos3250-devfreq.txt 
b/Documentation/devicetree/bindings/arm/samsung/exynos3250-devfreq.txt
new file mode 100644
index ..162498ec0da8
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/samsung/exynos3250-devfreq.txt
@@ -0,0 +1,62 @@
+Samsung Exynos3250 bus frequency scaling driver
+===
+
+The Exynos3250 SoC allows Dynamic Voltage and Frequency Scaling (DVFS)
+for certain system buses:
+ - memory controller and bus,
+ - peripheral buses (leftbus, rightbus).
+
+DVFS for memory controller and bus
+==
+Required properties:
+ - compatible : should be "samsung,exynos3250-busfreq-mif"
+ - clock-names : one clock of name "dmc" to manage frequency
+ - clocks : phandle and specifier for clock listed in clock-names property
+ - vdd-mif-supply : phandle to MIF voltage regulator
+ - devfreq-events : two phandles to devfreq event devices providing
+   raw data for bus utilization
+
+DVFS for peripheral buses
+=
+Required properties:
+ - compatible : should be "samsung,exynos3250-busfreq-int"
+ - clock-names : names for bus clocks to manage frequencies;
+   All following clock names (and corresponding phandles) must be
+   provided: "aclk_400", "aclk_266", "aclk_200", "aclk_160", "aclk_gdl",
+   "aclk_gdr", "mfc";
+ - clocks : phandles and specifiers for clocks listed in clock-names property
+ - vdd-int-supply : phandle to INT voltage regulator
+ - devfreq-events : two phandles to devfreq event devices providing
+   raw data for bus utilization
+
+Example
+===
+   busfreq_mif: busfreq@106A {
+   compatible = "samsung,exynos3250-busfreq-mif";
+   clocks = <&cmu_dmc CLK_DIV_DMC>;
+   clock-names = "dmc";
+   vdd-mif-supply = <&buck1_reg>;
+   devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
+   status = "okay";
+   };
+
+   busfreq_int: busfreq@116A {
+   compatible = "samsung,exynos3250-busfreq-int";
+   clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>,
+   <&cmu CLK_DIV_ACLK_266>,
+   <&cmu CLK_DIV_ACLK_200>,
+   <&cmu CLK_DIV_ACLK_160>,
+   <&cmu CLK_DIV_GDL>,
+   <&cmu CLK_DIV_GDR>,
+   <&cmu CLK_DIV_MFC>;
+   clock-names = "aclk_400",
+   "aclk_266",
+   "aclk_200",
+   "aclk_160",
+   "aclk_gdl",
+   "aclk_gdr",
+   "mfc";
+   vdd-int-supply = <&buck3_reg>;
+   devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
+   status = "okay";
+   };
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/3] ARM: dts: Add devfreq to Exynos3250 and Rinato board

2014-12-15 Thread Krzysztof Kozlowski
Add devfreq to Exynos3250 common file and enable it for Rinato board.

Signed-off-by: Krzysztof Kozlowski 
---
 arch/arm/boot/dts/exynos3250-rinato.dts | 12 
 arch/arm/boot/dts/exynos3250.dtsi   | 26 ++
 2 files changed, 38 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts 
b/arch/arm/boot/dts/exynos3250-rinato.dts
index 7970b8e91ab2..6def01c61742 100644
--- a/arch/arm/boot/dts/exynos3250-rinato.dts
+++ b/arch/arm/boot/dts/exynos3250-rinato.dts
@@ -567,6 +567,18 @@
clock-frequency = <2400>;
 };
 
+&busfreq_mif {
+   vdd-mif-supply = <&buck1_reg>;
+   devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>;
+   status = "okay";
+};
+
+&busfreq_int {
+   vdd-int-supply = <&buck3_reg>;
+   devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
+   status = "okay";
+};
+
 &pinctrl_0 {
pinctrl-names = "default";
pinctrl-0 = <&sleep0>;
diff --git a/arch/arm/boot/dts/exynos3250.dtsi 
b/arch/arm/boot/dts/exynos3250.dtsi
index 51e3e7111e59..cc0e30768ec2 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -175,6 +175,32 @@
#clock-cells = <1>;
};
 
+   busfreq_mif: busfreq@106A {
+   compatible = "samsung,exynos3250-busfreq-mif";
+   clocks = <&cmu_dmc CLK_DIV_DMC>;
+   clock-names = "dmc";
+   status = "disabled";
+   };
+
+   busfreq_int: busfreq@116A {
+   compatible = "samsung,exynos3250-busfreq-int";
+   clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>,
+   <&cmu CLK_DIV_ACLK_266>,
+   <&cmu CLK_DIV_ACLK_200>,
+   <&cmu CLK_DIV_ACLK_160>,
+   <&cmu CLK_DIV_GDL>,
+   <&cmu CLK_DIV_GDR>,
+   <&cmu CLK_DIV_MFC>;
+   clock-names = "aclk_400",
+   "aclk_266",
+   "aclk_200",
+   "aclk_160",
+   "aclk_gdl",
+   "aclk_gdr",
+   "mfc";
+   status = "disabled";
+   };
+
rtc: rtc@1007 {
compatible = "samsung,exynos3250-rtc";
reg = <0x1007 0x100>;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 077/168] iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Cristina Ciocan 

commit ccf54555da9a5e91e454b909ca6a5303c7d6b910 upstream.

The direction field is set on 7 bits, thus we need to AND it with 0111 111 mask
in order to retrieve it, that is 0x7F, not 0xCF as it is now.

Fixes: ade7ef7ba (staging:iio: Differential channel handling)
Signed-off-by: Cristina Ciocan 
Signed-off-by: Jonathan Cameron 
Signed-off-by: Luis Henriques 
---
 include/linux/iio/events.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h
index 8bbd7bc1043d..03fa332ad2a8 100644
--- a/include/linux/iio/events.h
+++ b/include/linux/iio/events.h
@@ -72,7 +72,7 @@ struct iio_event_data {
 
 #define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF)
 
-#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xCF)
+#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0x7F)
 
 #define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF)
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 078/168] iio: adc: men_z188_adc: Add terminating entry for men_z188_ids

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Axel Lin 

commit fbbba1f89eb68e7d07707e104193d56de8e37fe5 upstream.

The mcb_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin 
Signed-off-by: Jonathan Cameron 
Signed-off-by: Luis Henriques 
---
 drivers/iio/adc/men_z188_adc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/men_z188_adc.c b/drivers/iio/adc/men_z188_adc.c
index b58d6302521f..d095efe1ba14 100644
--- a/drivers/iio/adc/men_z188_adc.c
+++ b/drivers/iio/adc/men_z188_adc.c
@@ -152,6 +152,7 @@ static void men_z188_remove(struct mcb_device *dev)
 
 static const struct mcb_device_id men_z188_ids[] = {
{ .device = 0xbc },
+   { }
 };
 MODULE_DEVICE_TABLE(mcb, men_z188_ids);
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 071/168] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Steven Capper 

commit f2950706871c4b6e8c0f0d7c3f62d35930b8de63 upstream.

Long descriptors on ARM are 64 bits, and some pte functions such as
pte_dirty return a bitwise-and of a flag with the pte value. If the
flag to be tested resides in the upper 32 bits of the pte, then we run
into the danger of the result being dropped if downcast.

For example:
gather_stats(page, md, pte_dirty(*pte), 1);
where pte_dirty(*pte) is downcast to an int.

This patch introduces a new macro pte_isset which performs the bitwise
and, then performs a double logical invert (where needed) to ensure
predictable downcasting. The logical inverse pte_isclear is also
introduced.

Equivalent pmd functions for Transparent HugePages have also been
added.

Signed-off-by: Steve Capper 
Reviewed-by: Will Deacon 
Signed-off-by: Russell King 
Cc: Hou Pengyang 
Signed-off-by: Luis Henriques 
---
 arch/arm/include/asm/pgtable-3level.h | 12 
 arch/arm/include/asm/pgtable.h| 18 +++---
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/arch/arm/include/asm/pgtable-3level.h 
b/arch/arm/include/asm/pgtable-3level.h
index 85c60adc8b60..34f371c4bbb2 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -207,17 +207,21 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long 
addr)
 #define pte_huge(pte)  (pte_val(pte) && !(pte_val(pte) & 
PTE_TABLE_BIT))
 #define pte_mkhuge(pte)(__pte(pte_val(pte) & ~PTE_TABLE_BIT))
 
-#define pmd_young(pmd) (pmd_val(pmd) & PMD_SECT_AF)
+#define pmd_isset(pmd, val)((u32)(val) == (val) ? pmd_val(pmd) & (val) \
+   : !!(pmd_val(pmd) & (val)))
+#define pmd_isclear(pmd, val)  (!(pmd_val(pmd) & (val)))
+
+#define pmd_young(pmd) (pmd_isset((pmd), PMD_SECT_AF))
 
 #define __HAVE_ARCH_PMD_WRITE
-#define pmd_write(pmd) (!(pmd_val(pmd) & PMD_SECT_RDONLY))
+#define pmd_write(pmd) (pmd_isclear((pmd), PMD_SECT_RDONLY))
 
 #define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd))
 #define pmd_thp_or_huge(pmd)   (pmd_huge(pmd) || pmd_trans_huge(pmd))
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-#define pmd_trans_huge(pmd)(pmd_val(pmd) && !(pmd_val(pmd) & 
PMD_TABLE_BIT))
-#define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING)
+#define pmd_trans_huge(pmd)(pmd_val(pmd) && !pmd_table(pmd))
+#define pmd_trans_splitting(pmd) (pmd_isset((pmd), PMD_SECT_SPLITTING))
 #endif
 
 #define PMD_BIT_FUNC(fn,op) \
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 5478e5d6ad89..01baef07cd0c 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -214,18 +214,22 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
 
 #define pte_clear(mm,addr,ptep)set_pte_ext(ptep, __pte(0), 0)
 
+#define pte_isset(pte, val)((u32)(val) == (val) ? pte_val(pte) & (val) \
+   : !!(pte_val(pte) & (val)))
+#define pte_isclear(pte, val)  (!(pte_val(pte) & (val)))
+
 #define pte_none(pte)  (!pte_val(pte))
-#define pte_present(pte)   (pte_val(pte) & L_PTE_PRESENT)
-#define pte_valid(pte) (pte_val(pte) & L_PTE_VALID)
+#define pte_present(pte)   (pte_isset((pte), L_PTE_PRESENT))
+#define pte_valid(pte) (pte_isset((pte), L_PTE_VALID))
 #define pte_accessible(mm, pte)(mm_tlb_flush_pending(mm) ? 
pte_present(pte) : pte_valid(pte))
-#define pte_write(pte) (!(pte_val(pte) & L_PTE_RDONLY))
-#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY)
-#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
-#define pte_exec(pte)  (!(pte_val(pte) & L_PTE_XN))
+#define pte_write(pte) (pte_isclear((pte), L_PTE_RDONLY))
+#define pte_dirty(pte) (pte_isset((pte), L_PTE_DIRTY))
+#define pte_young(pte) (pte_isset((pte), L_PTE_YOUNG))
+#define pte_exec(pte)  (pte_isclear((pte), L_PTE_XN))
 #define pte_special(pte)   (0)
 
 #define pte_valid_user(pte)\
-   (pte_valid(pte) && (pte_val(pte) & L_PTE_USER) && pte_young(pte))
+   (pte_valid(pte) && pte_isset((pte), L_PTE_USER) && pte_young(pte))
 
 #if __LINUX_ARM_ARCH__ < 6
 static inline void __sync_icache_dcache(pte_t pteval)
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 079/168] Input: synaptics - adjust min/max on Thinkpad E540

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Ben Sagal 

commit bce4f9e764c36bc35dd5c9cf9e057c09f422397d upstream.

The LEN2006 Synaptics touchpad (as found in Thinkpad E540) returns wrong
min max values.

touchpad-edge-detector output:
>  Touchpad SynPS/2 Synaptics TouchPad on /dev/input/event6
>  Move one finger around the touchpad to detect the actual edges
>  Kernel says:x [1472..5674], y [1408..4684]
>  Touchpad sends: x [1264..5675], y [1171..4688]

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88211
Signed-off-by: Binyamin Sagal 
Signed-off-by: Dmitry Torokhov 
Signed-off-by: Luis Henriques 
---
 drivers/input/mouse/synaptics.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 3dcdeb785649..2d992a94f5dc 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -140,6 +140,10 @@ static const struct min_max_quirk min_max_pnpid_table[] = {
(const char * const []){"LEN2001", NULL},
1024, 5022, 2508, 4832
},
+   {
+   (const char * const []){"LEN2006", NULL},
+   1264, 5675, 1171, 4688
+   },
{ }
 };
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 080/168] spi: Fix mapping from vmalloc-ed buffer to scatter list

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Charles Keepax 

commit c1aefbdd050e1fb15e92bcaf34d95b17ea952097 upstream.

We can only use page_address on memory that has been mapped using kmap,
when the buffer passed to the SPI has been allocated by vmalloc the page
has not necessarily been mapped through kmap. This means sometimes
page_address will return NULL causing the pointer we pass to sg_set_buf
to be invalid.

As we only call page_address so that we can pass a virtual address to
sg_set_buf which will then immediately call virt_to_page on it, fix this
by calling sg_set_page directly rather then relying on the sg_set_buf
helper.

Signed-off-by: Charles Keepax 
Signed-off-by: Mark Brown 
Signed-off-by: Luis Henriques 
---
 drivers/spi/spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d4f9670b51bc..d9a59a0464cd 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -606,13 +606,13 @@ static int spi_map_buf(struct spi_master *master, struct 
device *dev,
sg_free_table(sgt);
return -ENOMEM;
}
-   sg_buf = page_address(vm_page) +
-   ((size_t)buf & ~PAGE_MASK);
+   sg_set_page(&sgt->sgl[i], vm_page,
+   min, offset_in_page(buf));
} else {
sg_buf = buf;
+   sg_set_buf(&sgt->sgl[i], sg_buf, min);
}
 
-   sg_set_buf(&sgt->sgl[i], sg_buf, min);
 
buf += min;
len -= min;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 076/168] USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Preston Fick 

commit ffcfe30ebd8dd703d0fc4324ffe56ea21f5479f4 upstream.

Signed-off-by: Preston Fick 
Signed-off-by: Johan Hovold 
Signed-off-by: Luis Henriques 
---
 drivers/usb/serial/cp210x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 3beae723ad3a..5741e9405069 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
+   { USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */
{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB 
Device */
{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 084/168] USB: keyspan: fix tty line-status reporting

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Johan Hovold 

commit 5d1678a33c731b56e245e888fdae5e88efce0997 upstream.

Fix handling of TTY error flags, which are not bitmasks and must
specifically not be ORed together as this prevents the line discipline
from recognising them.

Also insert null characters when reporting overrun errors as these are
not associated with the received character.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold 
Signed-off-by: Luis Henriques 
---
 drivers/usb/serial/keyspan.c | 76 
 1 file changed, 48 insertions(+), 28 deletions(-)

diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 93cb7cebda62..7799d8bc4a63 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -321,14 +321,19 @@ static void   usa26_indat_callback(struct urb *urb)
/* some bytes had errors, every byte has status */
dev_dbg(&port->dev, "%s - RX error\n", __func__);
for (i = 0; i + 1 < urb->actual_length; i += 2) {
-   int stat = data[i], flag = 0;
-   if (stat & RXERROR_OVERRUN)
-   flag |= TTY_OVERRUN;
-   if (stat & RXERROR_FRAMING)
-   flag |= TTY_FRAME;
-   if (stat & RXERROR_PARITY)
-   flag |= TTY_PARITY;
+   int stat = data[i];
+   int flag = TTY_NORMAL;
+
+   if (stat & RXERROR_OVERRUN) {
+   tty_insert_flip_char(&port->port, 0,
+   TTY_OVERRUN);
+   }
/* XXX should handle break (0x10) */
+   if (stat & RXERROR_PARITY)
+   flag = TTY_PARITY;
+   else if (stat & RXERROR_FRAMING)
+   flag = TTY_FRAME;
+
tty_insert_flip_char(&port->port, data[i+1],
flag);
}
@@ -649,14 +654,19 @@ static void   usa49_indat_callback(struct urb *urb)
} else {
/* some bytes had errors, every byte has status */
for (i = 0; i + 1 < urb->actual_length; i += 2) {
-   int stat = data[i], flag = 0;
-   if (stat & RXERROR_OVERRUN)
-   flag |= TTY_OVERRUN;
-   if (stat & RXERROR_FRAMING)
-   flag |= TTY_FRAME;
-   if (stat & RXERROR_PARITY)
-   flag |= TTY_PARITY;
+   int stat = data[i];
+   int flag = TTY_NORMAL;
+
+   if (stat & RXERROR_OVERRUN) {
+   tty_insert_flip_char(&port->port, 0,
+   TTY_OVERRUN);
+   }
/* XXX should handle break (0x10) */
+   if (stat & RXERROR_PARITY)
+   flag = TTY_PARITY;
+   else if (stat & RXERROR_FRAMING)
+   flag = TTY_FRAME;
+
tty_insert_flip_char(&port->port, data[i+1],
flag);
}
@@ -713,15 +723,19 @@ static void usa49wg_indat_callback(struct urb *urb)
 */
for (x = 0; x + 1 < len &&
i + 1 < urb->actual_length; x += 2) {
-   int stat = data[i], flag = 0;
+   int stat = data[i];
+   int flag = TTY_NORMAL;
 
-   if (stat & RXERROR_OVERRUN)
-   flag |= TTY_OVERRUN;
-   if (stat & RXERROR_FRAMING)
-   flag |= TTY_FRAME;
-   if (stat & RXERROR_PARITY)
-   flag |= TTY_PARITY;
+   if (stat & RXERROR_OVERRUN) {
+   tty_insert_flip_char(&port->port, 0,
+   TTY_OVERRUN);
+   }
/* XXX should han

[PATCH 3.16.y-ckt 082/168] spi: sirf: fix word width configuration

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Qipan Li 

commit 9c4b19a07a3ba35a2eb9b4134d485908e2f5 upstream.

commit 8c328a262f ("spi: sirf: Avoid duplicate code in various
bits_per_word cases") is wrong in setting data width register of
fifo is not right, it should use sspi->word_width >> 1 to set
related bits. According to hardware spec, the mapping between
register value and data width:
0 - byte
1 - WORD
2 - DWORD

Fixes: 8c328a262f ("spi: sirf: Avoid duplicate code in various bits_per_word 
cases") is wrong in setting data width register of
Signed-off-by: Qipan Li 
Signed-off-by: Barry Song 
Signed-off-by: Mark Brown 
Signed-off-by: Luis Henriques 
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index 1a5161336730..633a38337787 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -563,9 +563,9 @@ spi_sirfsoc_setup_transfer(struct spi_device *spi, struct 
spi_transfer *t)
 
sspi->word_width = DIV_ROUND_UP(bits_per_word, 8);
txfifo_ctrl = SIRFSOC_SPI_FIFO_THD(SIRFSOC_SPI_FIFO_SIZE / 2) |
-  sspi->word_width;
+  (sspi->word_width >> 1);
rxfifo_ctrl = SIRFSOC_SPI_FIFO_THD(SIRFSOC_SPI_FIFO_SIZE / 2) |
-  sspi->word_width;
+  (sspi->word_width >> 1);
 
if (!(spi->mode & SPI_CS_HIGH))
regval |= SIRFSOC_SPI_CS_IDLE_STAT;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 087/168] nfsd: correctly define v4.2 support attributes

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Christoph Hellwig 

commit 6d0ba0432a5e10bc714ba9c5adc460e726e5fbb4 upstream.

Even when security labels are disabled we support at least the same
attributes as v4.1.

Signed-off-by: Christoph Hellwig 
Signed-off-by: J. Bruce Fields 
Signed-off-by: Luis Henriques 
---
 fs/nfsd/nfsd.h | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 847daf37e566..1579b2171fcc 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -335,12 +335,15 @@ void  nfsd_lockd_shutdown(void);
(NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT)
 
 #ifdef CONFIG_NFSD_V4_SECURITY_LABEL
-#define NFSD4_2_SUPPORTED_ATTRS_WORD2 \
-   (NFSD4_1_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SECURITY_LABEL)
+#define NFSD4_2_SECURITY_ATTRS FATTR4_WORD2_SECURITY_LABEL
 #else
-#define NFSD4_2_SUPPORTED_ATTRS_WORD2 0
+#define NFSD4_2_SECURITY_ATTRS 0
 #endif
 
+#define NFSD4_2_SUPPORTED_ATTRS_WORD2 \
+   (NFSD4_1_SUPPORTED_ATTRS_WORD2 | \
+   NFSD4_2_SECURITY_ATTRS)
+
 static inline u32 nfsd_suppattrs0(u32 minorversion)
 {
return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 085/168] USB: keyspan: fix overrun-error reporting

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Johan Hovold 

commit 855515a6d3731242d85850a206f2ec084c917338 upstream.

Fix reporting of overrun errors, which are not associated with a
character. Instead insert a null character and report only once.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold 
Signed-off-by: Luis Henriques 
---
 drivers/usb/serial/keyspan.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 7799d8bc4a63..077c714f1285 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -311,12 +311,13 @@ static void   usa26_indat_callback(struct urb *urb)
if ((data[0] & 0x80) == 0) {
/* no errors on individual bytes, only
   possible overrun err */
-   if (data[0] & RXERROR_OVERRUN)
-   err = TTY_OVERRUN;
-   else
-   err = 0;
+   if (data[0] & RXERROR_OVERRUN) {
+   tty_insert_flip_char(&port->port, 0,
+   TTY_OVERRUN);
+   }
for (i = 1; i < urb->actual_length ; ++i)
-   tty_insert_flip_char(&port->port, data[i], err);
+   tty_insert_flip_char(&port->port, data[i],
+   TTY_NORMAL);
} else {
/* some bytes had errors, every byte has status */
dev_dbg(&port->dev, "%s - RX error\n", __func__);
@@ -787,13 +788,13 @@ static void usa90_indat_callback(struct urb *urb)
if ((data[0] & 0x80) == 0) {
/* no errors on individual bytes, only
   possible overrun err*/
-   if (data[0] & RXERROR_OVERRUN)
-   err = TTY_OVERRUN;
-   else
-   err = 0;
+   if (data[0] & RXERROR_OVERRUN) {
+   tty_insert_flip_char(&port->port, 0,
+   TTY_OVERRUN);
+   }
for (i = 1; i < urb->actual_length ; ++i)
tty_insert_flip_char(&port->port,
-   data[i], err);
+   data[i], TTY_NORMAL);
}  else {
/* some bytes had errors, every byte has status */
dev_dbg(&port->dev, "%s - RX error\n", 
__func__);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 088/168] SUNRPC: Fix locking around callback channel reply receive

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Trond Myklebust 

commit 093a1468b6edb0e568be7311b8d2228d205702db upstream.

Both xprt_lookup_rqst() and xprt_complete_rqst() require that you
take the transport lock in order to avoid races with xprt_transmit().

Signed-off-by: Trond Myklebust 
Reviewed-by: Jeff Layton 
Signed-off-by: J. Bruce Fields 
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques 
---
 net/sunrpc/svcsock.c | 27 ---
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index b2437ee93657..89a4db5be155 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1000,17 +1000,12 @@ static int receive_cb_reply(struct svc_sock *svsk, 
struct svc_rqst *rqstp)
xid = *p++;
calldir = *p;
 
-   if (bc_xprt)
-   req = xprt_lookup_rqst(bc_xprt, xid);
-
-   if (!req) {
-   printk(KERN_NOTICE
-   "%s: Got unrecognized reply: "
-   "calldir 0x%x xpt_bc_xprt %p xid %08x\n",
-   __func__, ntohl(calldir),
-   bc_xprt, xid);
+   if (!bc_xprt)
return -EAGAIN;
-   }
+   spin_lock_bh(&bc_xprt->transport_lock);
+   req = xprt_lookup_rqst(bc_xprt, xid);
+   if (!req)
+   goto unlock_notfound;
 
memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf));
/*
@@ -1021,11 +1016,21 @@ static int receive_cb_reply(struct svc_sock *svsk, 
struct svc_rqst *rqstp)
dst = &req->rq_private_buf.head[0];
src = &rqstp->rq_arg.head[0];
if (dst->iov_len < src->iov_len)
-   return -EAGAIN; /* whatever; just giving up. */
+   goto unlock_eagain; /* whatever; just giving up. */
memcpy(dst->iov_base, src->iov_base, src->iov_len);
xprt_complete_rqst(req->rq_task, rqstp->rq_arg.len);
rqstp->rq_arg.len = 0;
+   spin_unlock_bh(&bc_xprt->transport_lock);
return 0;
+unlock_notfound:
+   printk(KERN_NOTICE
+   "%s: Got unrecognized reply: "
+   "calldir 0x%x xpt_bc_xprt %p xid %08x\n",
+   __func__, ntohl(calldir),
+   bc_xprt, ntohl(xid));
+unlock_eagain:
+   spin_unlock_bh(&bc_xprt->transport_lock);
+   return -EAGAIN;
 }
 
 static int copy_pages_to_kvecs(struct kvec *vec, struct page **pages, int len)
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 081/168] clk-divider: Fix READ_ONLY when divider > 1

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: James Hogan 

commit e6d5e7d90be92cee626d7ec16ca9b06f1eed710b upstream.

Commit 79c6ab509558 (clk: divider: add CLK_DIVIDER_READ_ONLY flag) in
v3.16 introduced the CLK_DIVIDER_READ_ONLY flag which caused the
recalc_rate() and round_rate() clock callbacks to be omitted.

However using this flag has the unfortunate side effect of causing the
clock recalculation code when a clock rate change is attempted to always
treat it as a pass-through clock, i.e. with a fixed divide of 1, which
may not be the case. Child clock rates are then recalculated using the
wrong parent rate.

Therefore instead of dropping the recalc_rate() and round_rate()
callbacks, alter clk_divider_bestdiv() to always report the current
divider as the best divider so that it is never altered.

For me the read only clock was the system clock, which divided the PLL
rate by 2, from which both the UART and the SPI clocks were divided.
Initial setting of the UART rate set it correctly, but when the SPI
clock was set, the other child clocks were miscalculated. The UART clock
was recalculated using the PLL rate as the parent rate, resulting in a
UART new_rate of double what it should be, and a UART which spewed forth
garbage when the rate changes were propagated.

Signed-off-by: James Hogan 
Cc: Thomas Abraham 
Cc: Tomasz Figa 
Cc: Max Schwarz 
Acked-by: Haojian Zhuang 
Signed-off-by: Michael Turquette 
[ luis: backported to 3.16:
  - drop changes to drivers/clk/rockchip/clk.c ]
Signed-off-by: Luis Henriques 
---
 drivers/clk/clk-divider.c| 18 +-
 include/linux/clk-provider.h |  1 -
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 18a9de29df0e..c0a842b335c5 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -263,6 +263,14 @@ static int clk_divider_bestdiv(struct clk_hw *hw, unsigned 
long rate,
if (!rate)
rate = 1;
 
+   /* if read only, just return current value */
+   if (divider->flags & CLK_DIVIDER_READ_ONLY) {
+   bestdiv = readl(divider->reg) >> divider->shift;
+   bestdiv &= div_mask(divider);
+   bestdiv = _get_div(divider, bestdiv);
+   return bestdiv;
+   }
+
maxdiv = _get_maxdiv(divider);
 
if (!(__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT)) {
@@ -361,11 +369,6 @@ const struct clk_ops clk_divider_ops = {
 };
 EXPORT_SYMBOL_GPL(clk_divider_ops);
 
-const struct clk_ops clk_divider_ro_ops = {
-   .recalc_rate = clk_divider_recalc_rate,
-};
-EXPORT_SYMBOL_GPL(clk_divider_ro_ops);
-
 static struct clk *_register_divider(struct device *dev, const char *name,
const char *parent_name, unsigned long flags,
void __iomem *reg, u8 shift, u8 width,
@@ -391,10 +394,7 @@ static struct clk *_register_divider(struct device *dev, 
const char *name,
}
 
init.name = name;
-   if (clk_divider_flags & CLK_DIVIDER_READ_ONLY)
-   init.ops = &clk_divider_ro_ops;
-   else
-   init.ops = &clk_divider_ops;
+   init.ops = &clk_divider_ops;
init.flags = flags | CLK_IS_BASIC;
init.parent_names = (parent_name ? &parent_name: NULL);
init.num_parents = (parent_name ? 1 : 0);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 0c287dbbb144..a4ebe5b78e74 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -341,7 +341,6 @@ struct clk_divider {
 #define CLK_DIVIDER_READ_ONLY  BIT(5)
 
 extern const struct clk_ops clk_divider_ops;
-extern const struct clk_ops clk_divider_ro_ops;
 struct clk *clk_register_divider(struct device *dev, const char *name,
const char *parent_name, unsigned long flags,
void __iomem *reg, u8 shift, u8 width,
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCHv3 2/7] devfreq: event: Add the list of supported devfreq-event type

2014-12-15 Thread Krzysztof Kozlowski
On pią, 2014-12-12 at 17:27 +0900, Chanwoo Choi wrote:
> This patch adds the list of supported devfreq-event type as following.
> Each devfreq-event device driver would support the various devfreq-event type
> for devfreq governor at the same time.
> - DEVFREQ_EVENT_TYPE_RAW_DATA
> - DEVFREQ_EVENT_TYPE_UTILIZATION
> - DEVFREQ_EVENT_TYPE_BANDWIDTH
> - DEVFREQ_EVENT_TYPE_LATENCY
> 
> Cc: MyungJoo Ham 
> Cc: Kyungmin Park 
> Signed-off-by: Chanwoo Choi 
> ---
>  drivers/devfreq/devfreq-event.c | 44 
> +
>  include/linux/devfreq.h | 29 ++-
>  2 files changed, 64 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
> index eaf59c1..9444f93 100644
> --- a/drivers/devfreq/devfreq-event.c
> +++ b/drivers/devfreq/devfreq-event.c
> @@ -29,6 +29,9 @@
>  #include 
>  #include "governor.h"
>  
> +#define EVENT_TYPE_RAW_DATA_MAX  U64_MAX
> +#define EVENT_TYPE_UTILIZATION_MAX   100
> +
>  static struct class *devfreq_event_class;
>  
>  /* The list of all devfreq event list */
> @@ -144,7 +147,8 @@ EXPORT_SYMBOL_GPL(devfreq_event_is_enabled);
>   * Note that this function set the event to the devfreq-event device to start
>   * for getting the event data which could be various event type.
>   */
> -int devfreq_event_set_event(struct devfreq_event_dev *edev)
> +int devfreq_event_set_event(struct devfreq_event_dev *edev,
> + enum devfreq_event_type type)
>  {
>   int ret;
>  
> @@ -158,7 +162,15 @@ int devfreq_event_set_event(struct devfreq_event_dev 
> *edev)
>   return -EPERM;
>  
>   mutex_lock(&edev->lock);
> - ret = edev->desc->ops->set_event(edev);
> +
> + if ((edev->desc->type & type) == 0) {
> + dev_err(&edev->dev, "unsupported of devfreq-event type\n");
> + mutex_unlock(&edev->lock);
> + return -EINVAL;
> + }
> +
> + ret = edev->desc->ops->set_event(edev, type);
> +
>   mutex_unlock(&edev->lock);
>  
>   return ret;
> @@ -174,7 +186,9 @@ EXPORT_SYMBOL_GPL(devfreq_event_set_event);
>   * current event data and total_event should be stored in second parameter
>   * (total_event).
>   */
> -u64 devfreq_event_get_event(struct devfreq_event_dev *edev, u64 *total_event)
> +u64 devfreq_event_get_event(struct devfreq_event_dev *edev,
> + enum devfreq_event_type type,
> + u64 *total_event)
>  {
>   u64 event;
>  
> @@ -190,7 +204,27 @@ u64 devfreq_event_get_event(struct devfreq_event_dev 
> *edev, u64 *total_event)
>   return 0;
>  
>   mutex_lock(&edev->lock);
> - event = edev->desc->ops->get_event(edev, total_event);
> +
> + if ((edev->desc->type & type) == 0) {
> + dev_err(&edev->dev, "unsupported of devfreq-event type\n");
> + return -EINVAL;
> + }
> +
> + event = edev->desc->ops->get_event(edev, type, total_event);
> +
> + switch (type) {
> + case DEVFREQ_EVENT_TYPE_RAW_DATA:
> + case DEVFREQ_EVENT_TYPE_BANDWIDTH:
> + case DEVFREQ_EVENT_TYPE_LATENCY:
> + if ((event > *total_event)
> + || ((event > EVENT_TYPE_RAW_DATA_MAX) ||
> + *total_event > EVENT_TYPE_RAW_DATA_MAX))
> + event = 0;

missing break here.

Best regards,
Krzysztof

> + case DEVFREQ_EVENT_TYPE_UTILIZATION:
> + if (event > EVENT_TYPE_UTILIZATION_MAX)
> + event = 0;
> + }
> +
>   mutex_unlock(&edev->lock);
>  
>   return event;
> @@ -215,8 +249,10 @@ int devfreq_event_reset_event(struct devfreq_event_dev 
> *edev)
>   return -EPERM;
>  
>   mutex_lock(&edev->lock);
> +
>   if (edev->desc->ops && edev->desc->ops->reset)
>   ret = edev->desc->ops->reset(edev);
> +
>   mutex_unlock(&edev->lock);
>  
>   if (ret < 0)
> diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
> index a8d2277..82da235 100644
> --- a/include/linux/devfreq.h
> +++ b/include/linux/devfreq.h
> @@ -197,6 +197,14 @@ struct devfreq_event_dev {
>   const struct devfreq_event_desc *desc;
>  };
>  
> +/* The supported type by devfreq-event device */
> +enum devfreq_event_type {
> + DEVFREQ_EVENT_TYPE_RAW_DATA = BIT(0),
> + DEVFREQ_EVENT_TYPE_UTILIZATION  = BIT(1),
> + DEVFREQ_EVENT_TYPE_BANDWIDTH= BIT(2),
> + DEVFREQ_EVENT_TYPE_LATENCY  = BIT(3),
> +};
> +
>  /**
>   * struct devfreq_event_ops - the operations of devfreq-event device
>   *
> @@ -219,8 +227,10 @@ struct devfreq_event_ops {
>   int (*reset)(struct devfreq_event_dev *event_dev);
>  
>   /* Mandatory functions */
> - int (*set_event)(struct devfreq_event_dev *event_dev);
> - u64 (*get_event)(struct devfreq_event_dev *event_dev, u64 *total_event);
> + int (*set_event)(struct devfreq_event_dev *event_dev,
> +

[PATCH 3.16.y-ckt 089/168] nfsd: Fix slot wake up race in the nfsv4.1 callback code

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Trond Myklebust 

commit c6c15e1ed303ffc47e696ea1c9a9df1761c1f603 upstream.

The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no
locking in order to guarantee atomicity, and so allows for races of
the form.

Task 1  Task 2
==  ==
if (test_and_set_bit(0) != 0) {
clear_bit(0)
rpc_wake_up_next(queue)
rpc_sleep_on(queue)
return false;
}

This patch breaks the race condition by adding a retest of the bit
after the call to rpc_sleep_on().

Signed-off-by: Trond Myklebust 
Signed-off-by: J. Bruce Fields 
Signed-off-by: Luis Henriques 
---
 fs/nfsd/nfs4callback.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 0f23ad005826..510a99115bb7 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -801,8 +801,12 @@ static bool nfsd41_cb_get_slot(struct nfs4_client *clp, 
struct rpc_task *task)
 {
if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) {
rpc_sleep_on(&clp->cl_cb_waitq, task, NULL);
-   dprintk("%s slot is busy\n", __func__);
-   return false;
+   /* Race breaker */
+   if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) {
+   dprintk("%s slot is busy\n", __func__);
+   return false;
+   }
+   rpc_wake_up_queued_task(&clp->cl_cb_waitq, task);
}
return true;
 }
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 1/8] kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2

2014-12-15 Thread Naveen N. Rao
Currently, all non-dot symbols are being treated as function descriptors
in ABIv1. This is incorrect and is resulting in perf probe not working:

  # perf probe do_fork
  Added new event:
  Failed to write event: Invalid argument
Error: Failed to add events.
  # dmesg | tail -1
  [192268.073063] Could not insert probe at _text+768432: -22

perf probe bases all kernel probes on _text and writes,
for example, "p:probe/do_fork _text+768432" to
/sys/kernel/debug/tracing/kprobe_events. In-kernel, _text is being
considered to be a function descriptor and is resulting in the above
error.

Fix this by changing how we lookup symbol addresses on ppc64. We first
check for the dot variant of a symbol and look at the non-dot variant
only if that fails. In this manner, we avoid having to look at the
function descriptor.

While at it, also separate out how this works on ABIv2 where
we don't have dot symbols, but need to use the local entry point.

Signed-off-by: Naveen N. Rao 
---
Mike,
I have restricted all changes to just the kprobe_lookup_name() macro. It has
now been split into different implementations for ABIv1 and ABIv2, hopefully
addressing the concerns you raised previously.

- Naveen

 arch/powerpc/include/asm/kprobes.h | 63 ++
 1 file changed, 44 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/include/asm/kprobes.h 
b/arch/powerpc/include/asm/kprobes.h
index af15d4d..039b583 100644
--- a/arch/powerpc/include/asm/kprobes.h
+++ b/arch/powerpc/include/asm/kprobes.h
@@ -41,34 +41,59 @@ typedef ppc_opcode_t kprobe_opcode_t;
 #define MAX_INSN_SIZE 1
 
 #ifdef CONFIG_PPC64
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+/* PPC64 ABIv2 needs local entry point */
+#define kprobe_lookup_name(name, addr) \
+{  \
+   addr = (kprobe_opcode_t *)kallsyms_lookup_name(name);   \
+   if (addr)   \
+   addr = (kprobe_opcode_t *)ppc_function_entry(addr); \
+}
+#else
 /*
- * 64bit powerpc uses function descriptors.
- * Handle cases where:
- * - User passes a <.symbol> or 
- * - User passes a  or 
- * - User passes a non-existent symbol, kallsyms_lookup_name
- *   returns 0. Don't deref the NULL pointer in that case
+ * 64bit powerpc ABIv1 uses function descriptors:
+ * - Check for the dot variant of the symbol first.
+ * - If that fails, try looking up the symbol provided.
+ *
+ * This ensures we always get to the actual symbol and not the descriptor.
+ * Also handle  format.
  */
 #define kprobe_lookup_name(name, addr) \
 {  \
-   addr = (kprobe_opcode_t *)kallsyms_lookup_name(name);   \
-   if (addr) { \
-   char *colon;\
-   if ((colon = strchr(name, ':')) != NULL) {  \
-   colon++;\
-   if (*colon != '\0' && *colon != '.')\
-   addr = (kprobe_opcode_t 
*)ppc_function_entry(addr); \
-   } else if (name[0] != '.')  \
-   addr = (kprobe_opcode_t *)ppc_function_entry(addr); \
-   } else {\
-   char dot_name[KSYM_NAME_LEN];   \
+   char dot_name[MODULE_NAME_LEN + 1 + KSYM_NAME_LEN]; \
+   char *modsym;   \
+   bool dot_appended = false;  \
+   if ((modsym = strchr(name, ':')) != NULL) { \
+   modsym++;   \
+   if (*modsym != '\0' && *modsym != '.') {\
+   /* Convert to  */   \
+   strncpy(dot_name, name, modsym - name); \
+   dot_name[modsym - name] = '.';  \
+   dot_name[modsym - name + 1] = '\0'; \
+   strncat(dot_name, modsym,   \
+   sizeof(dot_name) - (modsym - name) - 2);\
+   dot_appended = true;\
+   } else {\
+   dot_name[0] = '\0'; \
+   strncat(dot_name, name, sizeof(dot_name) - 1);  \
+   }   \
+   } else if (name[0] != '.') {\
dot_name[0] 

Re: [RFC PATCHv3 1/7] devfreq: event: Add new devfreq_event class to provide basic data for devfreq governor

2014-12-15 Thread Krzysztof Kozlowski
On pią, 2014-12-12 at 17:27 +0900, Chanwoo Choi wrote:
> This patch add new devfreq_event class for devfreq_event device which provide
> raw data (e.g., memory bus utilization/GPU utilization). This raw data from
> devfreq_event data would be used for the governor of devfreq subsystem.
> - devfreq_event device : Provide raw data for governor of existing devfreq 
> device
> - devfreq device   : Monitor device state and change frequency/voltage of 
> device
>  using the raw data from devfreq_event device
> 
> The devfreq subsystem support generic DVFS(Dynamic Voltage/Frequency Scaling)
> for Non-CPU Devices. The devfreq device would dertermine current device state
> using various governor (e.g., ondemand, performance, powersave). After 
> completed
> determination of system state, devfreq device would change the 
> frequency/voltage
> of devfreq device according to the result of governor.
> 
> But, devfreq governor must need basic data which indicates current device 
> state.
> Existing devfreq subsystem only consider devfreq device which check current 
> system
> state and determine proper system state using basic data. There is no 
> subsystem
> for device providing basic data to devfreq device.
> 
> The devfreq subsystem must need devfreq_event device(data-provider device) for
> existing devfreq device. So, this patch add new devfreq_event class for
> devfreq_event device which read various basic data(e.g, memory bus 
> utilization,
> GPU utilization) and provide measured data to existing devfreq device through
> standard APIs of devfreq_event class.
> 
> The following description explains the feature of two kind of devfreq class:
> - devfreq class (existing)
>  : devfreq consumer device use raw data from devfreq_event device for
>determining proper current system state and change voltage/frequency
>dynamically using various governors.
> 
> - devfreq_event class (new)
>  : Provide measured raw data to devfreq device for governor
> 
> Cc: MyungJoo Ham 
> Cc: Kyungmin Park 
> Signed-off-by: Chanwoo Choi 

[...]

> +/**
> + * devfreq_event_get_event() - Get event and total_event from devfreq-event 
> dev.
> + * @edev : the devfreq-event device
> + *
> + * Note that this function get the calculated event data from devfreq-event 
> dev
> + * after stoping the progress of whole sequence of devfreq-event dev. Return
> + * current event data and total_event should be stored in second parameter
> + * (total_event).
> + */
> +u64 devfreq_event_get_event(struct devfreq_event_dev *edev, u64 *total_event)
> +{

I think this function should return int (0 for success, negative
otherwise) and store the "event" under pointer passed as argument.
Why? Because:
1. error conditions are indicated with 'return 0' but should be 'return
-EINVAL'
2. Exynos-ppmu driver returns -EINVAL.
Checking for error conditions is in such case more complex than it
should.


Best regards,
Krzysztof


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 2/8] perf probe: Improve detection of file/function name in the probe pattern

2014-12-15 Thread Naveen N. Rao
Currently, perf probe considers patterns including a '.' to be a file.
However, this causes problems on powerpc ABIv1 where all functions have
a leading '.':

  $ perf probe -F | grep schedule_timeout_interruptible
  .schedule_timeout_interruptible
  $ perf probe .schedule_timeout_interruptible
  Semantic error :File always requires line number or lazy pattern.
Error: Command Parse Error.

Fix this by checking the probe pattern in more detail.

Signed-off-by: Naveen N. Rao 
---
 tools/perf/util/probe-event.c | 23 ---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 28eb141..9943ff3 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -999,6 +999,24 @@ static int parse_perf_probe_point(char *arg, struct 
perf_probe_event *pev)
arg = tmp;
}
 
+   /*
+* Check arg is function or file name and copy it.
+*
+* We consider arg to be a file spec if and only if it satisfies
+* all of the below criteria::
+* - it does not include any of "+@%",
+* - it includes one of ":;", and
+* - it has a period '.' in the name.
+*
+* Otherwise, we consider arg to be a function specification.
+*/
+   c = 0;
+   if (!strpbrk(arg, "+@%") && (ptr = strpbrk(arg, ";:")) != NULL) {
+   /* This is a file spec if it includes a '.' before ; or : */
+   if (memchr(arg, '.', ptr-arg))
+   c = 1;
+   }
+
ptr = strpbrk(arg, ";:+@%");
if (ptr) {
nc = *ptr;
@@ -1009,10 +1027,9 @@ static int parse_perf_probe_point(char *arg, struct 
perf_probe_event *pev)
if (tmp == NULL)
return -ENOMEM;
 
-   /* Check arg is function or file and copy it */
-   if (strchr(tmp, '.'))   /* File */
+   if (c == 1)
pp->file = tmp;
-   else/* Function */
+   else
pp->function = tmp;
 
/* Parse other options */
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 6/8] perf tools powerpc: Fix PPC64 ELF ABIv2 symbol decoding

2014-12-15 Thread Naveen N. Rao
PPC64 ELF ABIv2 has a Global Entry Point (GEP) and a Local Entry Point
(LEP). For purposes of probing, we need the LEP. Offset to the LEP is
encoded in st_other.

Signed-off-by: Ananth N Mavinakayanahalli 
Signed-off-by: Naveen N. Rao 
---
Changes from previous patchset:
Simplified logic by adding dependancy on HAVE_ARCH_SYMBOL_HANDLING. Also
generalized arch_elf_sym_decode() to be suitable for other architectures in
future.

 tools/perf/arch/powerpc/util/sym-handling.c | 10 ++
 tools/perf/util/symbol-elf.c|  2 ++
 tools/perf/util/symbol.h|  6 ++
 3 files changed, 18 insertions(+)

diff --git a/tools/perf/arch/powerpc/util/sym-handling.c 
b/tools/perf/arch/powerpc/util/sym-handling.c
index 0a77825..a27bfaf 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -1,8 +1,10 @@
 /*
  * Special symbol handling for PowerPC:
  * - Handle dot symbols on ABIv1
+ * - Decode offset from Global entry point to Local entry point on ABIv2
  *
  * Copyright (C) 2014 Naveen N Rao, IBM Corporation.
+ * Copyright (C) 2014 Ananth N Mavinakayanahalli, IBM Corporation.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -26,3 +28,11 @@ int probe_function_filter(struct map *map __maybe_unused, 
struct symbol *sym)
}
return 1;
 }
+
+inline void arch_elf_sym_decode(GElf_Sym *sym __maybe_unused)
+{
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+   if (sym && sym->st_other)
+   sym->st_value += PPC64_LOCAL_ENTRY_OFFSET(sym->st_other);
+#endif
+}
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 7ac4e4c..557b63b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -902,6 +902,8 @@ int dso__load_sym(struct dso *dso, struct map *map,
(sym.st_value & 1))
--sym.st_value;
 
+   arch_elf_sym_decode(&sym);
+
if (dso->kernel || kmodule) {
char dso_name[PATH_MAX];
 
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 9d602e9..9e03cdf 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -294,4 +294,10 @@ int compare_proc_modules(const char *from, const char *to);
 int setup_list(struct strlist **list, const char *list_str,
   const char *list_name);
 
+#ifdef HAVE_ARCH_SYMBOL_HANDLING
+extern void arch_elf_sym_decode(GElf_Sym *sym __maybe_unused);
+#else
+static inline void arch_elf_sym_decode(GElf_Sym *sym __maybe_unused) { }
+#endif
+
 #endif /* __PERF_SYMBOL */
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 8/8] perf probe powerpc: Fixup function entry if using kallsyms lookup

2014-12-15 Thread Naveen N. Rao
On powerpc ABIv2, if no debug-info is found and we use kallsyms, we need
to fixup the function entry to point to the local entry point. Use
offset of 8 since current toolchains always generate 2 instructions (8
bytes).

Signed-off-by: Naveen N. Rao 
---
Changes:
Generalize and introduce helper to post-process trace point.

 tools/perf/arch/powerpc/util/sym-handling.c | 17 +
 tools/perf/util/probe-event.c   |  1 +
 tools/perf/util/probe-event.h   | 10 ++
 3 files changed, 28 insertions(+)

diff --git a/tools/perf/arch/powerpc/util/sym-handling.c 
b/tools/perf/arch/powerpc/util/sym-handling.c
index 22fc2e6..30c8797 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -45,3 +45,20 @@ inline bool prefer_symtab(void)
return false;
 #endif
 }
+
+void arch_fix_tev_from_maps(struct perf_probe_event *pev __maybe_unused,
+   struct probe_trace_event *tev __maybe_unused,
+   struct map *map __maybe_unused)
+{
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+   /*
+* If we used kallsyms, we should fixup the function entry address here.
+* ppc64 ABIv2 local entry point is currently always 2 instructions (8 
bytes)
+* after the global entry point. Fix this if it ever changes.
+*/
+   if (!pev->uprobes && map->dso->symtab_type == 
DSO_BINARY_TYPE__KALLSYMS) {
+   tev->point.address += 8;
+   tev->point.offset += 8;
+   }
+#endif
+}
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index dfc3151..85f37a4 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2340,6 +2340,7 @@ static int find_probe_trace_events_from_map(struct 
perf_probe_event *pev,
strdup_or_goto(pev->args[i].type,
nomem_out);
}
+   arch_fix_tev_from_maps(pev, tev, map);
}
 
 out:
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index 5f92906..335a6a4 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -147,6 +147,16 @@ extern bool prefer_symtab(void);
 static inline bool prefer_symtab(void) { return false; };
 #endif
 
+#ifdef HAVE_ARCH_SYMBOL_HANDLING
+extern void arch_fix_tev_from_maps(struct perf_probe_event *pev __maybe_unused,
+  struct probe_trace_event *tev __maybe_unused,
+  struct map *map __maybe_unused);
+#else
+static inline void arch_fix_tev_from_maps(struct perf_probe_event *pev 
__maybe_unused,
+ struct probe_trace_event *tev 
__maybe_unused,
+ struct map *map __maybe_unused) { }
+#endif
+
 /* Maximum index number of event-name postfix */
 #define MAX_EVENT_INDEX1024
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 5/8] perf probe powerpc: Allow matching against dot symbols

2014-12-15 Thread Naveen N. Rao
Allow perf probe to work on powerpc ABIv1 without the need to specify
the leading dot '.' for functions. 'perf probe do_fork' works with this
patch.

Introduce HAVE_ARCH_SYMBOL_HANDLING to indicate need for special
handling of symbols. In this patch, we override probe_function_filter()
on powerpc to account for dot symbols.

Signed-off-by: Naveen N. Rao 
---
Changes from the previous patchset:
Introduced arch helper to override the way probe function filter works.

 tools/perf/arch/powerpc/Makefile|  1 +
 tools/perf/arch/powerpc/util/sym-handling.c | 28 
 tools/perf/config/Makefile  |  1 +
 tools/perf/util/probe-event.c   | 10 +-
 tools/perf/util/probe-event.h   |  5 +
 5 files changed, 40 insertions(+), 5 deletions(-)
 create mode 100644 tools/perf/arch/powerpc/util/sym-handling.c

diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile
index 6f7782b..1c3d435 100644
--- a/tools/perf/arch/powerpc/Makefile
+++ b/tools/perf/arch/powerpc/Makefile
@@ -3,4 +3,5 @@ PERF_HAVE_DWARF_REGS := 1
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/skip-callchain-idx.o
 endif
+LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/sym-handling.o
 LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
diff --git a/tools/perf/arch/powerpc/util/sym-handling.c 
b/tools/perf/arch/powerpc/util/sym-handling.c
new file mode 100644
index 000..0a77825
--- /dev/null
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -0,0 +1,28 @@
+/*
+ * Special symbol handling for PowerPC:
+ * - Handle dot symbols on ABIv1
+ *
+ * Copyright (C) 2014 Naveen N Rao, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include "map.h"
+#include "symbol.h"
+#include "probe-event.h"
+
+int probe_function_filter(struct map *map __maybe_unused, struct symbol *sym)
+{
+   if (sym->binding == STB_GLOBAL || sym->binding == STB_LOCAL) {
+   if ((strcmp(looking_function_name, sym->name) == 0) ||
+   (sym->name[0] == '.' && looking_function_name[0] != '.' &&
+strcmp(looking_function_name, sym->name+1) == 0)) {
+   num_matched_functions++;
+   return 0;
+   }
+   }
+   return 1;
+}
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 5d4b039..35cf934 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -383,6 +383,7 @@ ifeq ($(ARCH),powerpc)
   ifndef NO_DWARF
 CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
   endif
+  CFLAGS += -DHAVE_ARCH_SYMBOL_HANDLING
 endif
 
 ifndef NO_LIBUNWIND
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 74b7fef..7eb9b27 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -50,6 +50,8 @@
 #define PERFPROBE_GROUP "probe"
 
 bool probe_event_dry_run;  /* Dry run flag */
+char *looking_function_name;
+int num_matched_functions;
 
 #define semantic_error(msg ...) pr_err("Semantic error :" msg)
 
@@ -2210,11 +2212,8 @@ static int __add_probe_trace_events(struct 
perf_probe_event *pev,
return ret;
 }
 
-static char *looking_function_name;
-static int num_matched_functions;
-
-static int probe_function_filter(struct map *map __maybe_unused,
- struct symbol *sym)
+#ifndef HAVE_ARCH_SYMBOL_HANDLING
+int probe_function_filter(struct map *map __maybe_unused, struct symbol *sym)
 {
if ((sym->binding == STB_GLOBAL || sym->binding == STB_LOCAL) &&
strcmp(looking_function_name, sym->name) == 0) {
@@ -2223,6 +,7 @@ static int probe_function_filter(struct map *map 
__maybe_unused,
}
return 1;
 }
+#endif /* HAVE_ARCH_SYMBOL_HANDLING */
 
 #define strdup_or_goto(str, label) \
({ char *__p = strdup(str); if (!__p) goto label; __p; })
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index e01e994..8564451 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -7,6 +7,8 @@
 #include "strfilter.h"
 
 extern bool probe_event_dry_run;
+extern char *looking_function_name;
+extern int num_matched_functions;
 
 /* kprobe-tracer and uprobe-tracer tracing point */
 struct probe_trace_point {
@@ -136,6 +138,9 @@ extern int show_available_vars(struct perf_probe_event 
*pevs, int npevs,
 extern int show_available_funcs(const char *module, struct strfilter *filter,
bool user);
 
+extern int probe_function_filter(struct map *map __maybe_unused,
+   struct symbol *sym);
+
 /* Maximum index number of event-name postfix */
 #define MAX_EVENT_INDEX1024
 
-- 
2.1.3

--
To

[PATCHv2 4/8] perf probe powerpc: Handle powerpc dot symbols

2014-12-15 Thread Naveen N. Rao
Fix up various perf aspects related to ppc64's usage of dot functions:
- ignore leading '.' when generating event names and when looking for
  existing events.
- use the proper prefix when ignoring SyS symbol lookups.

Signed-off-by: Naveen N. Rao 
---
 tools/perf/util/probe-event.c | 8 
 tools/perf/util/symbol.c  | 6 ++
 2 files changed, 14 insertions(+)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 9943ff3..74b7fef 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2080,6 +2080,10 @@ static int get_new_event_name(char *buf, size_t len, 
const char *base,
 {
int i, ret;
 
+   /* Skip the leading dot on powerpc */
+   if (*base == '.')
+   base++;
+
/* Try no suffix */
ret = e_snprintf(buf, len, "%s", base);
if (ret < 0) {
@@ -2538,6 +2542,10 @@ int del_perf_probe_events(struct strlist *dellist)
event = str;
}
 
+   /* Skip the leading dot on powerpc */
+   if (event && *event == '.')
+   event++;
+
ret = e_snprintf(buf, 128, "%s:%s", group, event);
if (ret < 0) {
pr_err("Failed to copy event.");
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index c24c5b8..e7b9bae 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -139,6 +139,12 @@ static int choose_best_symbol(struct symbol *syma, struct 
symbol *symb)
if (na >= 10 && !strncmp(syma->name, "compat_SyS", 10))
return SYMBOL_B;
 
+   /* On powerpc, ignore the dot variants */
+   if (na >= 4 && !strncmp(syma->name, ".SyS", 4))
+   return SYMBOL_B;
+   if (na >= 11 && !strncmp(syma->name, ".compat_SyS", 11))
+   return SYMBOL_B;
+
return SYMBOL_A;
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 7/8] perf probe powerpc: Use DWARF info only if necessary

2014-12-15 Thread Naveen N. Rao
Use symbol table lookups by default if DWARF is not necessary, since
powerpc ABIv2 encodes local entry points in the symbol table and the
function entry address in DWARF may not be appropriate for kprobes, as
described here:
https://sourceware.org/bugzilla/show_bug.cgi?id=17638

"The DWARF address ranges deliberately include the *whole* function,
both global and local entry points."
...
"If you want to set probes on a local entry point, you should look up
the symbol in the main symbol table (not DWARF), and check the st_other
bits; they will indicate whether the function has a local entry point,
and what its offset from the global entry point is.  Note that GDB does
the same when setting a breakpoint on a function entry."

Signed-off-by: Naveen N. Rao 
---
Changes from previous patchset:
Generalize and introduce helper to prefer symbol table over DWARF.

 tools/perf/arch/powerpc/util/sym-handling.c | 9 +
 tools/perf/config/Makefile  | 1 +
 tools/perf/util/probe-event.c   | 6 ++
 tools/perf/util/probe-event.h   | 6 ++
 4 files changed, 22 insertions(+)

diff --git a/tools/perf/arch/powerpc/util/sym-handling.c 
b/tools/perf/arch/powerpc/util/sym-handling.c
index a27bfaf..22fc2e6 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -36,3 +36,12 @@ inline void arch_elf_sym_decode(GElf_Sym *sym __maybe_unused)
sym->st_value += PPC64_LOCAL_ENTRY_OFFSET(sym->st_other);
 #endif
 }
+
+inline bool prefer_symtab(void)
+{
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+   return true;
+#else
+   return false;
+#endif
+}
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 35cf934..849f686 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -384,6 +384,7 @@ ifeq ($(ARCH),powerpc)
 CFLAGS += -DHAVE_SKIP_CALLCHAIN_IDX
   endif
   CFLAGS += -DHAVE_ARCH_SYMBOL_HANDLING
+  CFLAGS += -DARCH_PREFER_SYMTAB
 endif
 
 ifndef NO_LIBUNWIND
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 7eb9b27..dfc3151 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2373,6 +2373,12 @@ static int convert_to_probe_trace_events(struct 
perf_probe_event *pev,
}
}
 
+   if (prefer_symtab() && !perf_probe_event_need_dwarf(pev)) {
+   ret = find_probe_trace_events_from_map(pev, tevs, max_tevs, 
target);
+   if (ret > 0)
+   return ret; /* Found in symbol table */
+   }
+
/* Convert perf_probe_event with debuginfo */
ret = try_to_find_probe_trace_events(pev, tevs, max_tevs, target);
if (ret != 0)
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index 8564451..5f92906 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -141,6 +141,12 @@ extern int show_available_funcs(const char *module, struct 
strfilter *filter,
 extern int probe_function_filter(struct map *map __maybe_unused,
struct symbol *sym);
 
+#ifdef ARCH_PREFER_SYMTAB
+extern bool prefer_symtab(void);
+#else
+static inline bool prefer_symtab(void) { return false; };
+#endif
+
 /* Maximum index number of event-name postfix */
 #define MAX_EVENT_INDEX1024
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 3/8] perf probe powerpc: Fix symbol fixup issues due to ELF type

2014-12-15 Thread Naveen N. Rao
If using the symbol table, symbol addresses are not being fixed up
properly, resulting in probes being placed at wrong addresses:

  # perf probe do_fork
  Added new event:
probe:do_fork(on do_fork)

  You can now use it in all perf tools, such as:

  perf record -e probe:do_fork -aR sleep 1

  # cat /sys/kernel/debug/tracing/kprobe_events
  p:probe/do_fork _text+635952
  # printf "%x" 635952
  9b430
  # grep do_fork /boot/System.map
  c00ab430 T .do_fork

Fix by checking for ELF type ET_DYN used by ppc64 kernels.

Signed-off-by: Naveen N. Rao 
---
 tools/perf/util/symbol-elf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 06fcd1b..7ac4e4c 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -683,7 +683,8 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const 
char *name,
 NULL) != NULL);
} else {
ss->adjust_symbols = ehdr.e_type == ET_EXEC ||
-ehdr.e_type == ET_REL;
+ehdr.e_type == ET_REL ||
+ehdr.e_type == ET_DYN;
}
 
ss->name   = strdup(name);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 0/8] Fix perf probe issues on powerpc

2014-12-15 Thread Naveen N. Rao
This patchset fixes various issues with perf probe on powerpc across ABIv1 and
ABIv2:
- in the presence of DWARF debug-info,
- in the absence of DWARF, but with the symbol table, and
- in the absence of debug-info, but with kallsyms.

Applies cleanly on -tip. Tested on ppc64 BE and LE.

Changes from previous version:
Addressed various review comments from Mike Ellerman largely to generalize
changes. Some of the simpler patches have been retained in their previous form
to limit code churn, while others have been generalized by introducing arch
helpers. Individual patches have more details.


- Naveen

Naveen N. Rao (8):
  kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2
  perf probe: Improve detection of file/function name in the probe
pattern
  perf probe powerpc: Fix symbol fixup issues due to ELF type
  perf probe powerpc: Handle powerpc dot symbols
  perf probe powerpc: Allow matching against dot symbols
  perf tools powerpc: Fix PPC64 ELF ABIv2 symbol decoding
  perf probe powerpc: Use DWARF info only if necessary
  perf probe powerpc: Fixup function entry if using kallsyms lookup

 arch/powerpc/include/asm/kprobes.h  | 63 +++-
 tools/perf/arch/powerpc/Makefile|  1 +
 tools/perf/arch/powerpc/util/sym-handling.c | 64 +
 tools/perf/config/Makefile  |  2 +
 tools/perf/util/probe-event.c   | 48 ++
 tools/perf/util/probe-event.h   | 21 ++
 tools/perf/util/symbol-elf.c|  5 ++-
 tools/perf/util/symbol.c|  6 +++
 tools/perf/util/symbol.h|  6 +++
 9 files changed, 188 insertions(+), 28 deletions(-)
 create mode 100644 tools/perf/arch/powerpc/util/sym-handling.c

-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 090/168] bnx2fc: do not add shared skbs to the fcoe_rx_list

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Maurizio Lombardi 

commit 01a4cc4d0cd6a836c7b923760e8eb1cbb6a47258 upstream.

In some cases, the fcoe_rx_list may contains multiple instances
of the same skb (the so called "shared skbs").

the bnx2fc_l2_rcv thread is a loop that extracts a skb from the list,
modifies (and destroys) its content and then proceed to the next one.
The problem is that if the skb is shared, the remaining instances will
be corrupted.

The solution is to use skb_share_check() before adding the skb to the
fcoe_rx_list.

[ 6286.808725] [ cut here ]
[ 6286.808729] WARNING: at include/scsi/fc_frame.h:173 
bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]()
[ 6286.808748] Modules linked in: bnx2x(-) mdio dm_service_time bnx2fc cnic uio 
fcoe libfcoe 8021q garp stp mrp libfc llc scsi_transport_fc scsi_tgt sg 
iTCO_wdt iTCO_vendor_support coretemp kvm_intel kvm crct10dif_pclmul 
crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel aesni_intel lrw gf128mul 
glue_helper ablk_helper ptp cryptd hpilo serio_raw hpwdt lpc_ich pps_core 
ipmi_si pcspkr mfd_core ipmi_msghandler shpchp pcc_cpufreq mperf nfsd 
auth_rpcgss nfs_acl lockd sunrpc dm_multipath xfs libcrc32c ata_generic 
pata_acpi sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect 
sysimgblt i2c_algo_bit ata_piix drm_kms_helper ttm drm libata i2c_core hpsa 
dm_mirror dm_region_hash dm_log dm_mod [last unloaded: mdio]
[ 6286.808750] CPU: 3 PID: 1304 Comm: bnx2fc_l2_threa Not tainted 
3.10.0-121.el7.x86_64 #1
[ 6286.808750] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013
[ 6286.808752]   0b36e715 8800deba1e00 
815ec0ba
[ 6286.808753]  8800deba1e38 8105dee1 a05618c0 
8801e4c81888
[ 6286.808754]  e8663868 8801f402b180 8801f56bc000 
8800deba1e48
[ 6286.808754] Call Trace:
[ 6286.808759]  [] dump_stack+0x19/0x1b
[ 6286.808762]  [] warn_slowpath_common+0x61/0x80
[ 6286.808763]  [] warn_slowpath_null+0x1a/0x20
[ 6286.808765]  [] bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]
[ 6286.808767]  [] ? bnx2fc_disable+0x90/0x90 [bnx2fc]
[ 6286.808769]  [] kthread+0xcf/0xe0
[ 6286.808770]  [] ? kthread_create_on_node+0x140/0x140
[ 6286.808772]  [] ret_from_fork+0x7c/0xb0
[ 6286.808773]  [] ? kthread_create_on_node+0x140/0x140
[ 6286.808774] ---[ end trace c6cdb939184ccb4e ]---

Signed-off-by: Maurizio Lombardi 
Acked-by: Chad Dupuis 
Signed-off-by: Christoph Hellwig 
Signed-off-by: Luis Henriques 
---
 drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c 
b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 785d0d71781e..a190ab663133 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -411,6 +411,7 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct 
net_device *dev,
struct fc_frame_header *fh;
struct fcoe_rcv_info *fr;
struct fcoe_percpu_s *bg;
+   struct sk_buff *tmp_skb;
unsigned short oxid;
 
interface = container_of(ptype, struct bnx2fc_interface,
@@ -423,6 +424,12 @@ static int bnx2fc_rcv(struct sk_buff *skb, struct 
net_device *dev,
goto err;
}
 
+   tmp_skb = skb_share_check(skb, GFP_ATOMIC);
+   if (!tmp_skb)
+   goto err;
+
+   skb = tmp_skb;
+
if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) {
printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n");
goto err;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 091/168] scsi: add Intel Multi-Flex to scsi scan blacklist

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: =?UTF-8?q?Christian=20S=C3=BCnkenberg?=

commit 1899045510ff109980d9cc34e330fd8ca3631871 upstream.

Intel Multi-Flex LUNs choke on REPORT SUPPORTED OPERATION CODES
resulting in sd_mod hanging for several minutes on startup.
The issue was introduced with WRITE SAME discovery heuristics.

Fixes: 5db44863b6eb ("[SCSI] sd: Implement support for WRITE SAME")
Signed-off-by: Christian Sünkenberg 
Signed-off-by: Christoph Hellwig 
Signed-off-by: Luis Henriques 
---
 drivers/scsi/scsi_devinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index 49014a143c6a..c1d04d4d3c6c 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -202,6 +202,7 @@ static struct {
{"IOMEGA", "Io20S *F", NULL, BLIST_KEY},
{"INSITE", "Floptical   F*8I", NULL, BLIST_KEY},
{"INSITE", "I325VM", NULL, BLIST_KEY},
+   {"Intel", "Multi-Flex", NULL, BLIST_NO_RSOC},
{"iRiver", "iFP Mass Driver", NULL, BLIST_NOT_LOCKABLE | 
BLIST_INQUIRY_36},
{"LASOUND", "CDX7405", "3.10", BLIST_MAX5LUN | BLIST_SINGLELUN},
{"MATSHITA", "PD-1", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 094/168] USB: xhci: don't start a halted endpoint before its new dequeue is set

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Mathias Nyman 

commit c3492dbfa1050debf23a5b5cd2bc7514c5b37896 upstream.

A halted endpoint ring must first be reset, then move the ring
dequeue pointer past the problematic TRB. If we start the ring too
early after reset, but before moving the dequeue pointer we
will end up executing the same problematic TRB again.

As we always issue a set transfer dequeue command after a reset
endpoint command we can skip starting endpoint rings at reset endpoint
command completion.

Without this fix we end up trying to handle the same faulty TD for
contol endpoints. causing timeout, and failing testusb ctrl_out write
tests.

Fixes: e9df17e (USB: xhci: Correct assumptions about number of rings per 
endpoint.)
Tested-by: Felipe Balbi 
Signed-off-by: Mathias Nyman 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Luis Henriques 
---
 drivers/usb/host/xhci-ring.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 28a929d45cfe..5188a6bded0e 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1102,9 +1102,8 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd 
*xhci, int slot_id,
false);
xhci_ring_cmd_db(xhci);
} else {
-   /* Clear our internal halted state and restart the ring(s) */
+   /* Clear our internal halted state */
xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED;
-   ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
}
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 092/168] ARM: 8216/1: xscale: correct auxiliary register in suspend/resume

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Dmitry Eremin-Solenikov 

commit ef59a20ba375aeb97b3150a118318884743452a8 upstream.

According to the manuals I have, XScale auxiliary register should be
reached with opc_2 = 1 instead of crn = 1. cpu_xscale_proc_init
correctly uses c1, c0, 1 arguments, but cpu_xscale_do_suspend and
cpu_xscale_do_resume use c1, c1, 0. Correct suspend/resume functions to
also use c1, c0, 1.

The issue was primarily noticed thanks to qemu reporing "unsupported
instruction" on the pxa suspend path. Confirmed in PXA210/250 and PXA255
XScale Core manuals and in PXA270 and PXA320 Developers Guides.

Harware tested by me on tosa (pxa255). Robert confirmed on pxa270 board.

Tested-by: Robert Jarzmik 
Signed-off-by: Dmitry Eremin-Solenikov 
Acked-by: Robert Jarzmik 
Signed-off-by: Russell King 
Signed-off-by: Luis Henriques 
---
 arch/arm/mm/proc-xscale.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index d19b1cfcad91..b34b95f45cb3 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -535,7 +535,7 @@ ENTRY(cpu_xscale_do_suspend)
mrc p15, 0, r5, c15, c1, 0  @ CP access reg
mrc p15, 0, r6, c13, c0, 0  @ PID
mrc p15, 0, r7, c3, c0, 0   @ domain ID
-   mrc p15, 0, r8, c1, c1, 0   @ auxiliary control reg
+   mrc p15, 0, r8, c1, c0, 1   @ auxiliary control reg
mrc p15, 0, r9, c1, c0, 0   @ control reg
bic r4, r4, #2  @ clear frequency change bit
stmia   r0, {r4 - r9}   @ store cp regs
@@ -552,7 +552,7 @@ ENTRY(cpu_xscale_do_resume)
mcr p15, 0, r6, c13, c0, 0  @ PID
mcr p15, 0, r7, c3, c0, 0   @ domain ID
mcr p15, 0, r1, c2, c0, 0   @ translation table base addr
-   mcr p15, 0, r8, c1, c1, 0   @ auxiliary control reg
+   mcr p15, 0, r8, c1, c0, 1   @ auxiliary control reg
mov r0, r9  @ control register
b   cpu_resume_mmu
 ENDPROC(cpu_xscale_do_resume)
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 093/168] USB: uas: Add no-uas quirk for Hitachi usb-3 enclosures 4971:1012

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Hans de Goede 

commit 8daee1352d51a32676b84bddcc0e3252d1caa833 upstream.

These disks have a broken uas implementation, the tag field of the status
iu-s is not set properly, so we need to fall-back to usb-storage for these.

Signed-off-by: Hans de Goede 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Luis Henriques 
---
 drivers/usb/storage/unusual_uas.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/storage/unusual_uas.h 
b/drivers/usb/storage/unusual_uas.h
index 2fefaf923e4a..18a283d6de1c 100644
--- a/drivers/usb/storage/unusual_uas.h
+++ b/drivers/usb/storage/unusual_uas.h
@@ -103,3 +103,10 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x, 0x,
"VL711",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_NO_ATA_1X),
+
+/* Reported-by: Hans de Goede  */
+UNUSUAL_DEV(0x4971, 0x1012, 0x, 0x,
+   "Hitachi",
+   "External HDD",
+   USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+   US_FL_IGNORE_UAS),
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 083/168] usb: serial: ftdi_sio: add PIDs for Matrix Orbital products

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Troy Clark 

commit 204ec6e07ea7aff863df0f7c53301f9cbbfbb9d3 upstream.

Add PIDs for new Matrix Orbital GTT series products.

Signed-off-by: Troy Clark 
[johan: shorten commit message ]
Signed-off-by: Johan Hovold 
Signed-off-by: Luis Henriques 
---
 drivers/usb/serial/ftdi_sio.c | 33 +
 drivers/usb/serial/ftdi_sio_ids.h | 39 +++
 2 files changed, 68 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index a523adad6380..debcdef4cbf0 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -483,6 +483,39 @@ static const struct usb_device_id id_table_combined[] = {
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) },
+   { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
diff --git a/drivers/usb/serial/ftdi_sio_ids.h 
b/drivers/usb/serial/ftdi_sio_ids.h
index 6786b705ccf6..e52409c9be99 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -926,8 +926,8 @@
 #define BAYER_CONTOUR_CABLE_PID0x6001
 
 /*
- * The following are the values for the Matrix Orbital FTDI Range
- * Anything in this range will use an FT232RL.
+ * Matrix Orbital Intelligent USB displays.
+ * http://www.matrixorbital.com
  */
 #define MTXORB_VID 0x1B3D
 #define MTXORB_FTDI_RANGE_0100_PID 0x0100
@@ -1186,8 +1186,39 @@
 #define MTXORB_FTDI_RANGE_01FD_PID 0x01FD
 #define MTXORB_FTDI_RANGE_01FE_PID 0x01FE
 #define MTXORB_FTDI_RANGE_01FF_PID 0x01FF
-
-
+#define MTXORB_FTDI_RANGE_4701_PID 0x4701
+#define MTXORB_FTDI_RANGE_9300_PID 0x9300
+#define MTXORB_FTDI_RANGE_9301_PID 0x9301
+#define MTXORB_FTDI_RANGE_9302_PID 0x9302
+#define MTXORB_FTDI_RANGE_9303_PID 0x9303
+#define MTXORB_FTDI_RANGE_9304_PID 0x9304
+#define MTXORB_FTDI_RANGE_9305_PID 0x9305
+#define MTXORB_FTDI_RANGE_9306_PID 0x9306
+#define MTXORB_FTDI_RANGE_9307_PID 0x9307
+#define MTXORB_FTDI_RANGE_9308_PID 0x9308
+#define MTXORB_FTDI_RANGE_9309_PID 0x9309
+#define MTXORB_FTDI_RANGE_930A_PID 0x930A
+#define MTXORB_FTDI_RANGE_930B_PID 0x930B
+#define MTXORB_FTDI_RANGE_930C_PID 0x930C
+#define MTXORB_FTDI_RANGE_930D_PID 0x930D
+#define MTXORB_FTDI_RANGE_930E_PID 0x930E
+#define MTXORB_FTDI_RANGE_930F_PID 0x930F
+#define MTXORB_FTDI_RANGE_9310_PID 0x9310
+#define MTXORB_FTDI_RANGE_9311_PID 0x9311
+#define MTXORB_FTDI_RANGE_9312_PID 0x9312
+#define MTXORB_FTDI

[PATCH 3.16.y-ckt 095/168] Revert "xhci: clear root port wake on bits if controller isn't wake-up capable"

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Lu Baolu 

commit 9b41ebd3cf0f68d8cad779d3eeba336f78262e43 upstream.

commit ff8cbf250b44 ("xhci: clear root port wake on bits if controller isn't")
can cause device detection error if runtime PM is enabled, and S3 wake
is disabled. Revert it.
https://bugzilla.kernel.org/show_bug.cgi?id=85701

This commit got into stable and should be reverted from there as well.

Signed-off-by: Lu Baolu 
Reported-by: Dmitry Nezhevenko 
[Mathias Nyman: reword commit message]
Signed-off-by: Mathias Nyman 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Luis Henriques 
---
 drivers/usb/host/xhci-hub.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 69aece31143a..64f0ddac957f 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -22,7 +22,6 @@
 
 
 #include 
-#include 
 #include 
 
 #include "xhci.h"
@@ -1142,9 +1141,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
 * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME
 * is enabled, so also enable remote wake here.
 */
-   if (hcd->self.root_hub->do_remote_wakeup
-   && device_may_wakeup(hcd->self.controller)) {
-
+   if (hcd->self.root_hub->do_remote_wakeup) {
if (t1 & PORT_CONNECT) {
t2 |= PORT_WKOC_E | PORT_WKDISC_E;
t2 &= ~PORT_WKCONN_E;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 098/168] ixgbe: Correctly disable VLAN filter in promiscuous mode

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Vlad Yasevich 

commit 4556dc591691fca743518edb24f15fbc83b5c8ef upstream.

IXGBE adapter seems to require that VLAN filtering be enabled if
VMDQ or SRIOV are enabled.  When those functions are disabled,
VLAN filtering may be disabled in promiscuous mode.

Prior to commit a9b8943ee129 ("ixgbe: remove vlan_filter_disable
and enable functions")

The logic was correct.  However, after the commit the logic
got reversed and VLAN filtered in now turned on when VMDQ/SRIOV
is disabled.

This patch changes the condition to enable hw vlan filtered
when VMDQ or SRIOV is enabled.

Fixes: a9b8943ee129 ("ixgbe: remove vlan_filter_disable and enable functions")
CC: Jacob Keller 
Signed-off-by: Vladislav Yasevich 
Acked-by: Emil Tantilov 
Tested-by: Phil Schmitt 
Signed-off-by: Jeff Kirsher 
Signed-off-by: David S. Miller 
Signed-off-by: Luis Henriques 
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index f5aa3311ea28..889005922c33 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4065,8 +4065,8 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
 * if SR-IOV and VMDQ are disabled - otherwise ensure
 * that hardware VLAN filters remain enabled.
 */
-   if (!(adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |
-   IXGBE_FLAG_SRIOV_ENABLED)))
+   if (adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |
+ IXGBE_FLAG_SRIOV_ENABLED))
vlnctrl |= (IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);
} else {
if (netdev->flags & IFF_ALLMULTI) {
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 100/168] ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Daniel Borkmann 

commit b5b2ffc0574e1f271d79b6b992ee382dc9d5eaa8 upstream.

While working on a different issue, I noticed an annoying use
after free bug on my machine when unloading the ixgbe driver:

[ 8642.318797] ixgbe :02:00.1: removed PHC on p2p2
[ 8642.742716] ixgbe :02:00.1: complete
[ 8642.743784] BUG: unable to handle kernel paging request at 8807d3740a90
[ 8642.744828] IP: [] ixgbe_remove+0xfc/0x1b0 [ixgbe]
[ 8642.745886] PGD 20c6067 PUD 81c1f6067 PMD 81c15a067 PTE 8007d3740060
[ 8642.746956] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
[ 8642.748039] Modules linked in: [...]
[ 8642.752929] CPU: 1 PID: 1225 Comm: rmmod Not tainted 3.18.0-rc2+ #49
[ 8642.754203] Hardware name: Supermicro X10SLM-F/X10SLM-F, BIOS 1.1b 11/01/2013
[ 8642.755505] task: 8807e34d3fe0 ti: 8807b7204000 task.ti: 
8807b7204000
[ 8642.756831] RIP: 0010:[]  [] 
ixgbe_remove+0xfc/0x1b0 [ixgbe]
[...]
[ 8642.774335] Stack:
[ 8642.775805]  8807ee824098 8807ee824098 a01f3000 
8807ee824000
[ 8642.777326]  8807b7207e18 8137720f 8807ee824098 
8807ee824098
[ 8642.778848]  a01f3068 8807ee8240f8 8807b7207e38 
8144180f
[ 8642.780365] Call Trace:
[ 8642.781869]  [] pci_device_remove+0x3f/0xc0
[ 8642.783395]  [] __device_release_driver+0x7f/0xf0
[ 8642.784876]  [] driver_detach+0xb8/0xc0
[ 8642.786352]  [] bus_remove_driver+0x59/0xe0
[ 8642.787783]  [] driver_unregister+0x30/0x70
[ 8642.789202]  [] pci_unregister_driver+0x25/0xa0
[ 8642.790657]  [] ixgbe_exit_module+0x1c/0xc8e [ixgbe]
[ 8642.792064]  [] SyS_delete_module+0x132/0x1c0
[ 8642.793450]  [] ? do_notify_resume+0x61/0xa0
[ 8642.794837]  [] system_call_fastpath+0x12/0x17

The issue is that test_and_set_bit() done on adapter->state is being
performed *after* the netdevice has been freed via free_netdev().

When netdev is being allocated on initialization time, it allocates
a private area, here struct ixgbe_adapter, that resides after the
net_device structure. In ixgbe_probe(), the device init routine,
we set up the adapter after alloc_etherdev_mq() on the private area
and add a reference for the pci_dev as well via pci_set_drvdata().

Both in the error path of ixgbe_probe(), but also on module unload
when ixgbe_remove() is being called, commit 41c62843eb6a ("ixgbe:
Fix rcu warnings induced by LER") accesses adapter after free_netdev().
The patch stores the result in a bool and thus fixes above oops on my
side.

Fixes: 41c62843eb6a ("ixgbe: Fix rcu warnings induced by LER")
Cc: Mark Rustad 
Signed-off-by: Daniel Borkmann 
Signed-off-by: Jeff Kirsher 
Signed-off-by: David S. Miller 
Signed-off-by: Luis Henriques 
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index c4d560d7dabb..a125d3c35856 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8081,6 +8081,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
int i, err, pci_using_dac, expected_gts;
unsigned int indices = MAX_TX_QUEUES;
u8 part_str[IXGBE_PBANUM_LENGTH];
+   bool disable_dev = false;
 #ifdef IXGBE_FCOE
u16 device_caps;
 #endif
@@ -8471,13 +8472,14 @@ err_sw_init:
iounmap(adapter->io_addr);
kfree(adapter->mac_table);
 err_ioremap:
+   disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
free_netdev(netdev);
 err_alloc_etherdev:
pci_release_selected_regions(pdev,
 pci_select_bars(pdev, IORESOURCE_MEM));
 err_pci_reg:
 err_dma:
-   if (!adapter || !test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
+   if (!adapter || disable_dev)
pci_disable_device(pdev);
return err;
 }
@@ -8495,6 +8497,7 @@ static void ixgbe_remove(struct pci_dev *pdev)
 {
struct ixgbe_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdev;
+   bool disable_dev;
 
ixgbe_dbg_adapter_exit(adapter);
 
@@ -8544,11 +8547,12 @@ static void ixgbe_remove(struct pci_dev *pdev)
e_dev_info("complete\n");
 
kfree(adapter->mac_table);
+   disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
free_netdev(netdev);
 
pci_disable_pcie_error_reporting(pdev);
 
-   if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
+   if (disable_dev)
pci_disable_device(pdev);
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 103/168] gpu/radeon: Set flag to indicate broken 64-bit MSI

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Benjamin Herrenschmidt 

commit 91ed6fd2c383bb8f02d66e98b4a4d2f7207249dc upstream.

Some radeon ASICs don't support all 64 address bits of MSIs despite
advertising support for 64-bit MSIs in their configuration space.

This breaks on systems such as IBM POWER7/8, where 64-bit MSIs can
be assigned with some of the high address bits set.

This makes use of the newly introduced "no_64bit_msi" flag in structure
pci_dev to allow the MSI allocation code to fallback to 32-bit MSIs
on those adapters.

Signed-off-by: Benjamin Herrenschmidt 
Reviewed-by: Alex Deucher 
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/radeon/radeon_irq_kms.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 16807afab362..c74f12d125f7 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -202,6 +202,16 @@ static bool radeon_msi_ok(struct radeon_device *rdev)
if (rdev->flags & RADEON_IS_AGP)
return false;
 
+   /*
+* Older chips have a HW limitation, they can only generate 40 bits
+* of address for "64-bit" MSIs which breaks on some platforms, notably
+* IBM POWER servers, so we limit them
+*/
+   if (rdev->family < CHIP_BONAIRE) {
+   dev_info(rdev->dev, "radeon: MSI limited to 32-bit\n");
+   rdev->pdev->no_64bit_msi = 1;
+   }
+
/* force MSI on */
if (radeon_msi == 1)
return true;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 105/168] powerpc/pseries: Honor the generic "no_64bit_msi" flag

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Benjamin Herrenschmidt 

commit 415072a041bf50dbd6d56934ffc0cbbe14c97be8 upstream.

Instead of the arch specific quirk which we are deprecating

Signed-off-by: Benjamin Herrenschmidt 
Signed-off-by: Luis Henriques 
---
 arch/powerpc/platforms/pseries/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/msi.c 
b/arch/powerpc/platforms/pseries/msi.c
index 0c882e83c4ce..6849d85ea0d5 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -428,7 +428,7 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int 
nvec_in, int type)
 */
 again:
if (type == PCI_CAP_ID_MSI) {
-   if (pdn->force_32bit_msi) {
+   if (pdev->no_64bit_msi) {
rc = rtas_change_msi(pdn, RTAS_CHANGE_32MSI_FN, nvec);
if (rc < 0) {
/*
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 104/168] sound/radeon: Move 64-bit MSI quirk from arch to driver

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Benjamin Herrenschmidt 

commit db79afa1e57925ba96ab18514c0ebe42a28e393e upstream.

A number of radeon cards have a HW limitation causing them to be
unable to generate the full 64-bit of address bits for MSIs. This
breaks MSIs on some platforms such as POWER machines.

We used to have a powerpc specific quirk to address that on a
single card, but this doesn't scale very well, this is better
put under control of the drivers who know precisely what a given
HW revision can do.

We now have a generic quirk in the PCI code. We should set it
appropriately for all radeon's from the audio driver.

Signed-off-by: Benjamin Herrenschmidt 
Reviewed-by: Takashi Iwai 
Reviewed-by: Alex Deucher 
Signed-off-by: Luis Henriques 
---
 sound/pci/hda/hda_intel.c | 10 --
 sound/pci/hda/hda_priv.h  |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ba0266f7cf03..6383971dcd15 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -252,7 +252,8 @@ enum {
 
 /* quirks for ATI/AMD HDMI */
 #define AZX_DCAPS_PRESET_ATI_HDMI \
-   (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_SYNC_WRITE | AZX_DCAPS_POSFIX_LPIB)
+   (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_SYNC_WRITE | AZX_DCAPS_POSFIX_LPIB|\
+AZX_DCAPS_NO_MSI64)
 
 /* quirks for Nvidia */
 #define AZX_DCAPS_PRESET_NVIDIA \
@@ -1297,9 +1298,14 @@ static int azx_first_init(struct azx *chip)
return -ENXIO;
}
 
-   if (chip->msi)
+   if (chip->msi) {
+   if (chip->driver_caps & AZX_DCAPS_NO_MSI64) {
+   dev_dbg(card->dev, "Disabling 64bit MSI\n");
+   pci->no_64bit_msi = true;
+   }
if (pci_enable_msi(pci) < 0)
chip->msi = 0;
+   }
 
if (azx_acquire_irq(chip, 0) < 0)
return -EBUSY;
diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h
index e9d1a5762a55..526bc876f0a1 100644
--- a/sound/pci/hda/hda_priv.h
+++ b/sound/pci/hda/hda_priv.h
@@ -191,6 +191,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
 #define AZX_DCAPS_PM_RUNTIME   (1 << 26)   /* runtime PM support */
 #define AZX_DCAPS_I915_POWERWELL (1 << 27) /* HSW i915 powerwell support */
 #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28)  /* CORBRP clears itself after 
reset */
+#define AZX_DCAPS_NO_MSI64  (1 << 29)  /* Stick to 32-bit MSIs */
 
 /* position fix mode */
 enum {
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 107/168] MIPS: cpu-probe: Set the FTLB probability bit on supported cores

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Markos Chandras 

commit cf0a8aa0226da5de88011e7f30eff22a894b2f49 upstream.

Make use of the Config6/FLTBP bit to set the probability of a TLBWR
instruction to hit the FTLB or the VTLB. A value of 0 (which may be
the default value on certain cores, such as proAptiv or P5600)
means that a TLBWR instruction will never hit the VTLB which
leads to performance limitations since it effectively decreases
the number of available TLB slots.

Signed-off-by: Markos Chandras 
Reviewed-by: James Hogan 
Cc: linux-m...@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8368/
Signed-off-by: Ralf Baechle 
Signed-off-by: Luis Henriques 
---
 arch/mips/include/asm/mipsregs.h |  2 ++
 arch/mips/kernel/cpu-probe.c | 33 -
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 98e9754a4b6b..6ad0208b50fb 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -660,6 +660,8 @@
 #define MIPS_CONF6_SYND(_ULCAST_(1) << 13)
 /* proAptiv FTLB on/off bit */
 #define MIPS_CONF6_FTLBEN  (_ULCAST_(1) << 15)
+/* FTLB probability bits */
+#define MIPS_CONF6_FTLBP_SHIFT (16)
 
 #define MIPS_CONF7_WII (_ULCAST_(1) << 31)
 
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index d74f957c561e..d5006d23ca7b 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -179,6 +179,32 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int 
isa)
 static char unknown_isa[] = KERN_ERR \
"Unsupported ISA type, c0.config0: %d.";
 
+static unsigned int calculate_ftlb_probability(struct cpuinfo_mips *c)
+{
+
+   unsigned int probability = c->tlbsize / c->tlbsizevtlb;
+
+   /*
+* 0 = All TLBWR instructions go to FTLB
+* 1 = 15:1: For every 16 TBLWR instructions, 15 go to the
+* FTLB and 1 goes to the VTLB.
+* 2 = 7:1: As above with 7:1 ratio.
+* 3 = 3:1: As above with 3:1 ratio.
+*
+* Use the linear midpoint as the probability threshold.
+*/
+   if (probability >= 12)
+   return 1;
+   else if (probability >= 6)
+   return 2;
+   else
+   /*
+* So FTLB is less than 4 times bigger than VTLB.
+* A 3:1 ratio can still be useful though.
+*/
+   return 3;
+}
+
 static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)
 {
unsigned int config6;
@@ -189,9 +215,14 @@ static void set_ftlb_enable(struct cpuinfo_mips *c, int 
enable)
case CPU_P5600:
/* proAptiv & related cores use Config6 to enable the FTLB */
config6 = read_c0_config6();
+   /* Clear the old probability value */
+   config6 &= ~(3 << MIPS_CONF6_FTLBP_SHIFT);
if (enable)
/* Enable FTLB */
-   write_c0_config6(config6 | MIPS_CONF6_FTLBEN);
+   write_c0_config6(config6 |
+(calculate_ftlb_probability(c)
+ << MIPS_CONF6_FTLBP_SHIFT)
+| MIPS_CONF6_FTLBEN);
else
/* Disable FTLB */
write_c0_config6(config6 &  ~MIPS_CONF6_FTLBEN);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 106/168] MIPS: r4kcache: Add EVA case for protected_writeback_dcache_line

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Markos Chandras 

commit 83fd43449baaf88fe5c03dd0081a062041837c51 upstream.

Commit de8974e3f76c0 ("MIPS: asm: r4kcache: Add EVA cache flushing
functions") added cache function for EVA using the cachee instruction.
However, it didn't add a case for the protected_writeback_dcache_line.
mips_dsemul() calls r4k_flush_cache_sigtramp() which in turn uses
the protected_writeback_dcache_line() to flush the trampoline code
back to memory. This used the wrong "cache" instruction leading to
random userland crashes on non-FPU cores.

Signed-off-by: Markos Chandras 
Cc: linux-m...@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8331/
Signed-off-by: Ralf Baechle 
Signed-off-by: Luis Henriques 
---
 arch/mips/include/asm/r4kcache.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h
index 0b8bd28a0df1..ed038d7c3410 100644
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
@@ -254,7 +254,11 @@ static inline void protected_flush_icache_line(unsigned 
long addr)
  */
 static inline void protected_writeback_dcache_line(unsigned long addr)
 {
+#ifdef CONFIG_EVA
+   protected_cachee_op(Hit_Writeback_Inv_D, addr);
+#else
protected_cache_op(Hit_Writeback_Inv_D, addr);
+#endif
 }
 
 static inline void protected_writeback_scache_line(unsigned long addr)
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 110/168] drm/i915: Ignore SURFLIVE and flip counter when the GPU gets reset

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= 

commit bdfa7542d40e6251c232a802231b37116bd31b11 upstream.

During a GPU reset we need to get pending page flip cleared out
since the ring contents are gone and flip will never complete
on its own. This used to work until the mmio vs. CS flip race
detection came about. That piece of code is looking for a
specific surface address in the SURFLIVE register, but as
a flip to that address may never happen the check may never
pass. So we should just skip the SURFLIVE and flip counter
checks when the GPU gets reset.

intel_display_handle_reset() tries to effectively complete
the flip anyway by calling .update_primary_plane(). But that
may not satisfy the conditions of the mmio vs. CS race
detection since there's no guarantee that a modeset didn't
sneak in between the GPU reset and intel_display_handle_reset().
Such a modeset will not wait for pending flips due to the ongoing GPU
reset, and then the primary plane updates performed by
intel_display_handle_reset() will already use the new surface
address, and thus the surface address the flip is waiting for
might never appear in SURFLIVE. The result is that the flip
will never complete and attempts to perform further page flips
will fail with -EBUSY.

During the GPU reset intel_crtc_has_pending_flip() will return
false regardless, so the deadlock with a modeset vs. the error
work acquiring crtc->mutex was avoided. And the reset_counter
check in intel_crtc_has_pending_flip() actually made this bug
even less severe since it allowed normal modesets to go through
even though there's a pending flip.

This is a regression introduced by me here:
 commit 75f7f3ec600524c9544cc31695155f1a9ddbe1d9
 Author: Ville Syrjälä 
 Date:   Tue Apr 15 21:41:34 2014 +0300

drm/i915: Fix mmio vs. CS flip race on ILK+

Testcase: igt/kms_flip/flip-vs-panning-vs-hang
Signed-off-by: Ville Syrjälä 
Reviewed-by: Chris Wilson 
Reviewed-by: Daniel Vetter 
Signed-off-by: Jani Nikula 
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/i915/intel_display.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 373d652d01fa..6b835b86fbfd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8925,6 +8925,10 @@ static bool page_flip_finished(struct intel_crtc *crtc)
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
 
+   if (i915_reset_in_progress(&dev_priv->gpu_error) ||
+   crtc->reset_counter != 
atomic_read(&dev_priv->gpu_error.reset_counter))
+   return true;
+
/*
 * The relevant registers doen't exist on pre-ctg.
 * As the flip done interrupt doesn't trigger for mmio
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 097/168] usb: xhci: rework root port wake bits if controller isn't allowed to wakeup

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Lu Baolu 

commit a1377e5397ab321e21b793ec8cd2b6f12bd3c718 upstream.

When system is being suspended, if host device is not allowed to do wakeup,
xhci_suspend() needs to clear all root port wake on bits. Otherwise, some
platforms may generate spurious wakeup, even if PCI PME# is disabled.

The initial commit ff8cbf250b44 ("xhci: clear root port wake on bits"),
which also got into stable, turned out to not work correctly and had to
be reverted, and is now rewritten.

Signed-off-by: Lu Baolu 
Suggested-by: Alan Stern 
Acked-by: Alan Stern 
[Mathias Nyman: reword commit message]
Signed-off-by: Mathias Nyman 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Luis Henriques 
---
 drivers/usb/host/xhci-pci.c  |  2 +-
 drivers/usb/host/xhci-plat.c | 10 +-
 drivers/usb/host/xhci.c  | 42 +-
 drivers/usb/host/xhci.h  |  2 +-
 4 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index d71aa5a97f0d..e614d1831e79 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -279,7 +279,7 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool 
do_wakeup)
if (xhci_compliance_mode_recovery_timer_quirk_check())
pdev->no_d3cold = true;
 
-   return xhci_suspend(xhci);
+   return xhci_suspend(xhci, do_wakeup);
 }
 
 static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 29d8adb5c8d1..271690de8de1 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -245,7 +245,15 @@ static int xhci_plat_suspend(struct device *dev)
struct usb_hcd  *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
 
-   return xhci_suspend(xhci);
+   /*
+* xhci_suspend() needs `do_wakeup` to know whether host is allowed
+* to do wakeup during suspend. Since xhci_plat_suspend is currently
+* only designed for system suspend, device_may_wakeup() is enough
+* to dertermine whether host is allowed to do wakeup. Need to
+* reconsider this when xhci_plat_suspend enlarges its scope, e.g.,
+* also applies to runtime suspend.
+*/
+   return xhci_suspend(xhci, device_may_wakeup(dev));
 }
 
 static int xhci_plat_resume(struct device *dev)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 502580e172e9..5e5f0c1b6613 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -35,6 +35,8 @@
 #define DRIVER_AUTHOR "Sarah Sharp"
 #define DRIVER_DESC "'eXtensible' Host Controller (xHC) Driver"
 
+#definePORT_WAKE_BITS  (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E)
+
 /* Some 0.95 hardware can't handle the chain bit on a Link TRB being cleared */
 static int link_quirk;
 module_param(link_quirk, int, S_IRUGO | S_IWUSR);
@@ -850,13 +852,47 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci)
xhci_set_cmd_ring_deq(xhci);
 }
 
+static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci)
+{
+   int port_index;
+   __le32 __iomem **port_array;
+   unsigned long flags;
+   u32 t1, t2;
+
+   spin_lock_irqsave(&xhci->lock, flags);
+
+   /* disble usb3 ports Wake bits*/
+   port_index = xhci->num_usb3_ports;
+   port_array = xhci->usb3_ports;
+   while (port_index--) {
+   t1 = readl(port_array[port_index]);
+   t1 = xhci_port_state_to_neutral(t1);
+   t2 = t1 & ~PORT_WAKE_BITS;
+   if (t1 != t2)
+   writel(t2, port_array[port_index]);
+   }
+
+   /* disble usb2 ports Wake bits*/
+   port_index = xhci->num_usb2_ports;
+   port_array = xhci->usb2_ports;
+   while (port_index--) {
+   t1 = readl(port_array[port_index]);
+   t1 = xhci_port_state_to_neutral(t1);
+   t2 = t1 & ~PORT_WAKE_BITS;
+   if (t1 != t2)
+   writel(t2, port_array[port_index]);
+   }
+
+   spin_unlock_irqrestore(&xhci->lock, flags);
+}
+
 /*
  * Stop HC (not bus-specific)
  *
  * This is called when the machine transition into S3/S4 mode.
  *
  */
-int xhci_suspend(struct xhci_hcd *xhci)
+int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
 {
int rc = 0;
unsigned intdelay = XHCI_MAX_HALT_USEC;
@@ -867,6 +903,10 @@ int xhci_suspend(struct xhci_hcd *xhci)
xhci->shared_hcd->state != HC_STATE_SUSPENDED)
return -EINVAL;
 
+   /* Clear root port wake on bits if wakeup not allowed. */
+   if (!do_wakeup)
+   xhci_disable_port_wake_on_bits(xhci);
+
/* Don't poll the roothubs on bus suspend. */
xhci_dbg(xhci, "%s: stopping port polling.\n", __func_

[PATCH 3.16.y-ckt 113/168] Input: xpad - use proper endpoint type

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Greg Kroah-Hartman 

commit a1f9a4072655843fc03186acbad65990cc05dd2d upstream.

The xpad wireless endpoint is not a bulk endpoint on my devices, but
rather an interrupt one, so the USB core complains when it is submitted.
I'm guessing that the author really did mean that this should be an
interrupt urb, but as there are a zillion different xpad devices out
there, let's cover out bases and handle both bulk and interrupt
endpoints just as easily.

Signed-off-by: "Pierre-Loup A. Griffais" 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Dmitry Torokhov 
Signed-off-by: Luis Henriques 
---
 drivers/input/joystick/xpad.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index e383eebbafdd..18558f73b4a3 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -1038,9 +1038,19 @@ static int xpad_probe(struct usb_interface *intf, const 
struct usb_device_id *id
}
 
ep_irq_in = &intf->cur_altsetting->endpoint[1].desc;
-   usb_fill_bulk_urb(xpad->bulk_out, udev,
-   usb_sndbulkpipe(udev, 
ep_irq_in->bEndpointAddress),
-   xpad->bdata, XPAD_PKT_LEN, xpad_bulk_out, xpad);
+   if (usb_endpoint_is_bulk_out(ep_irq_in)) {
+   usb_fill_bulk_urb(xpad->bulk_out, udev,
+ usb_sndbulkpipe(udev,
+ 
ep_irq_in->bEndpointAddress),
+ xpad->bdata, XPAD_PKT_LEN,
+ xpad_bulk_out, xpad);
+   } else {
+   usb_fill_int_urb(xpad->bulk_out, udev,
+usb_sndintpipe(udev,
+   
ep_irq_in->bEndpointAddress),
+xpad->bdata, XPAD_PKT_LEN,
+xpad_bulk_out, xpad, 0);
+   }
 
/*
 * Submit the int URB immediately rather than waiting for open
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 109/168] MIPS: Loongson: Make platform serial setup always built-in.

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Aaro Koskinen 

commit 26927f76499849e095714452b8a4e09350f6a3b9 upstream.

If SERIAL_8250 is compiled as a module, the platform specific setup
for Loongson will be a module too, and it will not work very well.
At least on Loongson 3 it will trigger a build failure,
since loongson_sysconf is not exported to modules.

Fix by making the platform specific serial code always built-in.

Signed-off-by: Aaro Koskinen 
Reported-by: Ralf Baechle 
Cc: linux-m...@linux-mips.org
Cc: Huacai Chen 
Cc: Markos Chandras 
Patchwork: https://patchwork.linux-mips.org/patch/8533/
Signed-off-by: Ralf Baechle 
Signed-off-by: Luis Henriques 
---
 arch/mips/loongson/common/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/loongson/common/Makefile 
b/arch/mips/loongson/common/Makefile
index 0bb9cc9dc621..d87e03330b29 100644
--- a/arch/mips/loongson/common/Makefile
+++ b/arch/mips/loongson/common/Makefile
@@ -11,7 +11,8 @@ obj-$(CONFIG_PCI) += pci.o
 # Serial port support
 #
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
-obj-$(CONFIG_SERIAL_8250) += serial.o
+loongson-serial-$(CONFIG_SERIAL_8250) := serial.o
+obj-y += $(loongson-serial-m) $(loongson-serial-y)
 obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
 obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 114/168] powerpc/pseries: Fix endiannes issue in RTAS call from xmon

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Laurent Dufour 

commit 3b8a3c01096925a824ed3272601082289d9c23a5 upstream.

On pseries system (LPAR) xmon failed to enter when running in LE mode,
system is hunging. Inititating xmon will lead to such an output on the
console:

SysRq : Entering xmon
cpu 0x15: Vector: 0  at [c003f39ffb10]
pc: c007ed7c: sysrq_handle_xmon+0x5c/0x70
lr: c007ed7c: sysrq_handle_xmon+0x5c/0x70
sp: c003f39ffc70
   msr: 80009033
  current = 0xc003fafa7180
  paca= 0xc7d75e80   softe: 0irq_happened: 0x01
pid   = 14617, comm = bash
Bad kernel stack pointer fafb4b0 at eca7cc4
cpu 0x15: Vector: 300 (Data Access) at [c7f07d40]
pc: 0eca7cc4
lr: 0eca7c44
sp: fafb4b0
   msr: 80001000
   dar: 1000
 dsisr: 4200
  current = 0xc003fafa7180
  paca= 0xc7d75e80   softe: 0irq_happened: 0x01
pid   = 14617, comm = bash
cpu 0x15: Exception 300 (Data Access) in xmon, returning to main loop
xmon: WARNING: bad recursive fault on cpu 0x15

The root cause is that xmon is calling RTAS to turn off the surveillance
when entering xmon, and RTAS is requiring big endian parameters.

This patch is byte swapping the RTAS arguments when running in LE mode.

Signed-off-by: Laurent Dufour 
Signed-off-by: Michael Ellerman 
Signed-off-by: Luis Henriques 
---
 arch/powerpc/xmon/xmon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index d199bfa2f1fa..c6c497b40c45 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -292,10 +292,10 @@ static inline void disable_surveillance(void)
args.token = rtas_token("set-indicator");
if (args.token == RTAS_UNKNOWN_SERVICE)
return;
-   args.nargs = 3;
-   args.nret = 1;
+   args.nargs = cpu_to_be32(3);
+   args.nret = cpu_to_be32(1);
args.rets = &args.args[3];
-   args.args[0] = SURVEILLANCE_TOKEN;
+   args.args[0] = cpu_to_be32(SURVEILLANCE_TOKEN);
args.args[1] = 0;
args.args[2] = 0;
enter_rtas(__pa(&args));
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 112/168] usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Hans de Goede 

commit 263e80b43559a6103e178a9176938ce171b23872 upstream.

This wireless mouse receiver needs a reset-resume quirk to properly come
out of reset.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1165206
Signed-off-by: Hans de Goede 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Luis Henriques 
---
 drivers/usb/core/quirks.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index c85459338991..b195fdb1effc 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -44,6 +44,9 @@ static const struct usb_device_id usb_quirk_list[] = {
/* Creative SB Audigy 2 NX */
{ USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
 
+   /* Microsoft Wireless Laser Mouse 6000 Receiver */
+   { USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME },
+
/* Microsoft LifeCam-VX700 v2.0 */
{ USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 117/168] drm/radeon: report disconnected for LVDS/eDP with PX if ddc fails

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Alex Deucher 

commit 1348579433566355e570008929daa09a0db64fd8 upstream.

If ddc fails, presumably the i2c mux (and hopefully the signal
mux) are switched to the other GPU so don't fetch the edid from
the vbios so that the connector reports disconnected.

bug:
https://bugzilla.opensuse.org/show_bug.cgi?id=904417

Signed-off-by: Alex Deucher 
[ luis: backported to 3.16:
  - dropped changes to radeon_connector_get_edid() ]
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/radeon/radeon_connectors.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c 
b/drivers/gpu/drm/radeon/radeon_connectors.c
index 44831197e82e..eb76aa72466c 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -695,6 +695,8 @@ static int radeon_lvds_mode_valid(struct drm_connector 
*connector,
 static enum drm_connector_status
 radeon_lvds_detect(struct drm_connector *connector, bool force)
 {
+   struct drm_device *dev = connector->dev;
+   struct radeon_device *rdev = dev->dev_private;
struct radeon_connector *radeon_connector = 
to_radeon_connector(connector);
struct drm_encoder *encoder = radeon_best_single_encoder(connector);
enum drm_connector_status ret = connector_status_disconnected;
@@ -711,7 +713,11 @@ radeon_lvds_detect(struct drm_connector *connector, bool 
force)
/* check if panel is valid */
if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 
240)
ret = connector_status_connected;
-
+   /* don't fetch the edid from the vbios if ddc fails and runpm is
+* enabled so we report disconnected.
+*/
+   if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm != 0))
+   ret = connector_status_disconnected;
}
 
/* check for edid as well */
@@ -1492,6 +1498,11 @@ radeon_dp_detect(struct drm_connector *connector, bool 
force)
/* check if panel is valid */
if (native_mode->hdisplay >= 320 && 
native_mode->vdisplay >= 240)
ret = connector_status_connected;
+   /* don't fetch the edid from the vbios if ddc fails and 
runpm is
+* enabled so we report disconnected.
+*/
+   if ((rdev->flags & RADEON_IS_PX) && (radeon_runtime_pm 
!= 0))
+   ret = connector_status_disconnected;
}
/* eDP is always DP */
radeon_dig_connector->dp_sink_type = 
CONNECTOR_OBJECT_ID_DISPLAYPORT;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 115/168] powerpc/powernv: Replace OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Gavin Shan 

commit 360d88a9e3fba596a12520b242fbab1c45b983e1 upstream.

The flag passed to ioda_eeh_phb_reset() should be EEH_RESET_DEACTIVATE,
which is translated to OPAL_DEASSERT_RESET or something else by the
EEH backend accordingly.

The patch replaces OPAL_DEASSERT_RESET with EEH_RESET_DEACTIVATE for
ioda_eeh_phb_reset().

Signed-off-by: Gavin Shan 
Signed-off-by: Michael Ellerman 
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques 
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c 
b/arch/powerpc/platforms/powernv/pci-ioda.c
index dc30aa5a2ce8..c339a2fbdf0b 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1403,7 +1403,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
if (is_kdump_kernel()) {
pr_info("  Issue PHB reset ...\n");
ioda_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
-   ioda_eeh_phb_reset(hose, OPAL_DEASSERT_RESET);
+   ioda_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
}
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 101/168] ALSA: hda - Limit 40bit DMA for AMD HDMI controllers

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Takashi Iwai 

commit 413cbf469a19e7662ba5025695bf5a573927105a upstream.

AMD/ATI HDMI controller chip models, we already have a filter to lower
to 32bit DMA, but the rest are supposed to be working with 64bit
although the hardware doesn't really work with 63bit but only with 40
or 48bit DMA.  In this patch, we take 40bit DMA for safety for the
AMD/ATI controllers as the graphics drivers does.

Signed-off-by: Takashi Iwai 
Signed-off-by: Benjamin Herrenschmidt 
[ luis: backported to 3.16:
  - replaced AZX_GCAP_64OK by ICH6_GCAP_64OK ]
Signed-off-by: Luis Henriques 
---
 sound/pci/hda/hda_intel.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 007a1a8298fc..ba0266f7cf03 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1273,6 +1273,7 @@ static int azx_first_init(struct azx *chip)
struct snd_card *card = chip->card;
int err;
unsigned short gcap;
+   unsigned int dma_bits = 64;
 
 #if BITS_PER_LONG != 64
/* Fix up base address on ULI M5461 */
@@ -1309,9 +1310,14 @@ static int azx_first_init(struct azx *chip)
gcap = azx_readw(chip, GCAP);
dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
 
+   /* AMD devices support 40 or 48bit DMA, take the safe one */
+   if (chip->pci->vendor == PCI_VENDOR_ID_AMD)
+   dma_bits = 40;
+
/* disable SB600 64bit support for safety */
if (chip->pci->vendor == PCI_VENDOR_ID_ATI) {
struct pci_dev *p_smbus;
+   dma_bits = 40;
p_smbus = pci_get_device(PCI_VENDOR_ID_ATI,
 PCI_DEVICE_ID_ATI_SBX00_SMBUS,
 NULL);
@@ -1341,9 +1347,11 @@ static int azx_first_init(struct azx *chip)
}
 
/* allow 64bit DMA address if supported by H/W */
-   if ((gcap & ICH6_GCAP_64OK) && !pci_set_dma_mask(pci, DMA_BIT_MASK(64)))
-   pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(64));
-   else {
+   if (!(gcap & ICH6_GCAP_64OK))
+   dma_bits = 32;
+   if (!pci_set_dma_mask(pci, DMA_BIT_MASK(dma_bits))) {
+   pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(dma_bits));
+   } else {
pci_set_dma_mask(pci, DMA_BIT_MASK(32));
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32));
}
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 116/168] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Anton Blanchard 

commit 152d44a853e42952f6c8a504fb1f8eefd21fd5fd upstream.

I used some 64 bit instructions when adding the 32 bit getcpu VDSO
function. Fix it.

Fixes: 18ad51dd342a ("powerpc: Add VDSO version of getcpu")
Signed-off-by: Anton Blanchard 
Signed-off-by: Michael Ellerman 
Signed-off-by: Luis Henriques 
---
 arch/powerpc/kernel/vdso32/getcpu.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/vdso32/getcpu.S 
b/arch/powerpc/kernel/vdso32/getcpu.S
index 23eb9a9441bd..c62be60c7274 100644
--- a/arch/powerpc/kernel/vdso32/getcpu.S
+++ b/arch/powerpc/kernel/vdso32/getcpu.S
@@ -30,8 +30,8 @@
 V_FUNCTION_BEGIN(__kernel_getcpu)
   .cfi_startproc
mfspr   r5,SPRN_SPRG_VDSO_READ
-   cmpdi   cr0,r3,0
-   cmpdi   cr1,r4,0
+   cmpwi   cr0,r3,0
+   cmpwi   cr1,r4,0
clrlwi  r6,r5,16
rlwinm  r7,r5,16,31-15,31-0
beq cr0,1f
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 121/168] btrfs: zero out left over bytes after processing compression streams

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Chris Mason 

commit 2f19cad94cee3c9bd52d0c9ca584ef506302fb7c upstream.

Don Bailey noticed that our page zeroing for compression at end-io time
isn't complete.  This reworks a patch from Linus to push the zeroing
into the zlib and lzo specific functions instead of trying to handle the
corners inside btrfs_decompress_buf2page

Signed-off-by: Chris Mason 
Reviewed-by: Josef Bacik 
Reported-by: Don A. Bailey 
Signed-off-by: Linus Torvalds 
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques 
---
 fs/btrfs/compression.c | 33 +++--
 fs/btrfs/compression.h |  4 +++-
 fs/btrfs/lzo.c | 15 +++
 fs/btrfs/zlib.c| 20 ++--
 4 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 1daea0b47187..6db91cdbd92d 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -1010,8 +1010,6 @@ int btrfs_decompress_buf2page(char *buf, unsigned long 
buf_start,
bytes = min(bytes, working_bytes);
kaddr = kmap_atomic(page_out);
memcpy(kaddr + *pg_offset, buf + buf_offset, bytes);
-   if (*pg_index == (vcnt - 1) && *pg_offset == 0)
-   memset(kaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
kunmap_atomic(kaddr);
flush_dcache_page(page_out);
 
@@ -1053,3 +1051,34 @@ int btrfs_decompress_buf2page(char *buf, unsigned long 
buf_start,
 
return 1;
 }
+
+/*
+ * When uncompressing data, we need to make sure and zero any parts of
+ * the biovec that were not filled in by the decompression code.  pg_index
+ * and pg_offset indicate the last page and the last offset of that page
+ * that have been filled in.  This will zero everything remaining in the
+ * biovec.
+ */
+void btrfs_clear_biovec_end(struct bio_vec *bvec, int vcnt,
+  unsigned long pg_index,
+  unsigned long pg_offset)
+{
+   while (pg_index < vcnt) {
+   struct page *page = bvec[pg_index].bv_page;
+   unsigned long off = bvec[pg_index].bv_offset;
+   unsigned long len = bvec[pg_index].bv_len;
+
+   if (pg_offset < off)
+   pg_offset = off;
+   if (pg_offset < off + len) {
+   unsigned long bytes = off + len - pg_offset;
+   char *kaddr;
+
+   kaddr = kmap_atomic(page);
+   memset(kaddr + pg_offset, 0, bytes);
+   kunmap_atomic(kaddr);
+   }
+   pg_index++;
+   pg_offset = 0;
+   }
+}
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 0c803b4fbf93..d181f70caae0 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -45,7 +45,9 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 
start,
  unsigned long nr_pages);
 int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
 int mirror_num, unsigned long bio_flags);
-
+void btrfs_clear_biovec_end(struct bio_vec *bvec, int vcnt,
+  unsigned long pg_index,
+  unsigned long pg_offset);
 struct btrfs_compress_op {
struct list_head *(*alloc_workspace)(void);
 
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index dfad8514f0da..70e84945d2fd 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -374,6 +374,8 @@ cont:
}
 done:
kunmap(pages_in[page_in_index]);
+   if (!ret)
+   btrfs_clear_biovec_end(bvec, vcnt, page_out_index, pg_offset);
return ret;
 }
 
@@ -411,10 +413,23 @@ static int lzo_decompress(struct list_head *ws, unsigned 
char *data_in,
goto out;
}
 
+   /*
+* the caller is already checking against PAGE_SIZE, but lets
+* move this check closer to the memcpy/memset
+*/
+   destlen = min_t(unsigned long, destlen, PAGE_SIZE);
bytes = min_t(unsigned long, destlen, out_len - start_byte);
 
kaddr = kmap_atomic(dest_page);
memcpy(kaddr, workspace->buf + start_byte, bytes);
+
+   /*
+* btrfs_getblock is doing a zero on the tail of the page too,
+* but this will cover anything missing from the decompressed
+* data.
+*/
+   if (bytes < destlen)
+   memset(kaddr+bytes, 0, destlen-bytes);
kunmap_atomic(kaddr);
 out:
return ret;
diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
index b67d8fc81277..1c9137348f53 100644
--- a/fs/btrfs/zlib.c
+++ b/fs/btrfs/zlib.c
@@ -302,6 +302,8 @@ done:
zlib_inflateEnd(&workspace->inf_strm);
if (data_in)
kunmap(pages_in[page_in_index]);
+   if (

[PATCH 3.16.y-ckt 119/168] ARM: 8226/1: cacheflush: get rid of restarting block

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Vladimir Murzin 

commit 3f4aa45ceea5789a4aade536acc27f2e0d3da5e1 upstream.

We cannot restart cacheflush safely if a process provides user-defined
signal handler and signal is pending. In this case -EINTR is returned
and it is expected that process re-invokes syscall. However, there are
a few problems with that:
 * looks like nobody bothers checking return value from cacheflush
 * but if it did, we don't provide the restart address for that, so the
   process has to use the same range again
 * ...and again, what might lead to looping forever

So, remove cacheflush restarting code and terminate cache flushing
as early as fatal signal is pending.

Reported-by: Chanho Min 
Signed-off-by: Vladimir Murzin 
Acked-by: Will Deacon 
Signed-off-by: Russell King 
Signed-off-by: Luis Henriques 
---
 arch/arm/include/asm/thread_info.h | 11 ---
 arch/arm/kernel/traps.c| 31 ++-
 2 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/arch/arm/include/asm/thread_info.h 
b/arch/arm/include/asm/thread_info.h
index e4e4208a9130..76155ee5ac3b 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -43,16 +43,6 @@ struct cpu_context_save {
__u32   extra[2];   /* Xscale 'acc' register, etc */
 };
 
-struct arm_restart_block {
-   union {
-   /* For user cache flushing */
-   struct {
-   unsigned long start;
-   unsigned long end;
-   } cache;
-   };
-};
-
 /*
  * low level task data that entry.S needs immediate access to.
  * __switch_to() assumes cpu_context follows immediately after cpu_domain.
@@ -78,7 +68,6 @@ struct thread_info {
unsigned long   thumbee_state;  /* ThumbEE Handler Base 
register */
 #endif
struct restart_blockrestart_block;
-   struct arm_restart_blockarm_restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)  \
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index da11b28a72da..8dffc57a9f71 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -511,8 +511,6 @@ static int bad_syscall(int n, struct pt_regs *regs)
return regs->ARM_r0;
 }
 
-static long do_cache_op_restart(struct restart_block *);
-
 static inline int
 __do_cache_op(unsigned long start, unsigned long end)
 {
@@ -521,24 +519,8 @@ __do_cache_op(unsigned long start, unsigned long end)
do {
unsigned long chunk = min(PAGE_SIZE, end - start);
 
-   if (signal_pending(current)) {
-   struct thread_info *ti = current_thread_info();
-
-   ti->restart_block = (struct restart_block) {
-   .fn = do_cache_op_restart,
-   };
-
-   ti->arm_restart_block = (struct arm_restart_block) {
-   {
-   .cache = {
-   .start  = start,
-   .end= end,
-   },
-   },
-   };
-
-   return -ERESTART_RESTARTBLOCK;
-   }
+   if (fatal_signal_pending(current))
+   return 0;
 
ret = flush_cache_user_range(start, start + chunk);
if (ret)
@@ -551,15 +533,6 @@ __do_cache_op(unsigned long start, unsigned long end)
return 0;
 }
 
-static long do_cache_op_restart(struct restart_block *unused)
-{
-   struct arm_restart_block *restart_block;
-
-   restart_block = ¤t_thread_info()->arm_restart_block;
-   return __do_cache_op(restart_block->cache.start,
-restart_block->cache.end);
-}
-
 static inline int
 do_cache_op(unsigned long start, unsigned long end, int flags)
 {
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 111/168] net/ping: handle protocol mismatching scenario

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Jane Zhou 

commit 91a0b603469069cdcce4d572b7525ffc9fd352a6 upstream.

ping_lookup() may return a wrong sock if sk_buff's and sock's protocols
dont' match. For example, sk_buff's protocol is ETH_P_IPV6, but sock's
sk_family is AF_INET, in that case, if sk->sk_bound_dev_if is zero, a wrong
sock will be returned.
the fix is to "continue" the searching, if no matching, return NULL.

Cc: "David S. Miller" 
Cc: Alexey Kuznetsov 
Cc: James Morris 
Cc: Hideaki YOSHIFUJI 
Cc: Patrick McHardy 
Cc: net...@vger.kernel.org
Signed-off-by: Jane Zhou 
Signed-off-by: Yiwei Zhao 
Signed-off-by: David S. Miller 
Signed-off-by: Luis Henriques 
---
 net/ipv4/ping.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 044a0ddf6a79..620e8ffa62e8 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -217,6 +217,8 @@ static struct sock *ping_lookup(struct net *net, struct 
sk_buff *skb, u16 ident)
 &ipv6_hdr(skb)->daddr))
continue;
 #endif
+   } else {
+   continue;
}
 
if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 118/168] ARM: 8222/1: mvebu: enable strex backoff delay

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Thomas Petazzoni 

commit 995ab5189d1d7264e79e665dfa032a19b3ac646e upstream.

Under extremely rare conditions, in an MPCore node consisting of at
least 3 CPUs, two CPUs trying to perform a STREX to data on the same
shared cache line can enter a livelock situation.

This patch enables the HW mechanism that overcomes the bug. This fixes
the incorrect setup of the STREX backoff delay bit due to a wrong
description in the specification.

Note that enabling the STREX backoff delay mechanism is done by
leaving the bit *cleared*, while the bit was currently being set by
the proc-v7.S code.

[Thomas: adapt to latest mainline, slightly reword the commit log, add
stable markers.]

Fixes: de4901933f6d ("arm: mm: Add support for PJ4B cpu and init routines")

Signed-off-by: Nadav Haklai 
Signed-off-by: Thomas Petazzoni 
Acked-by: Gregory CLEMENT 
Acked-by: Jason Cooper 
Signed-off-by: Russell King 
Signed-off-by: Luis Henriques 
---
 arch/arm/mm/proc-v7.S | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 3db2c2f04a30..0eba0d1fd65a 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -235,7 +235,6 @@ __v7_pj4b_setup:
 /* Auxiliary Debug Modes Control 1 Register */
 #define PJ4B_STATIC_BP (1 << 2) /* Enable Static BP */
 #define PJ4B_INTER_PARITY (1 << 8) /* Disable Internal Parity Handling */
-#define PJ4B_BCK_OFF_STREX (1 << 5) /* Enable the back off of STREX instr */
 #define PJ4B_CLEAN_LINE (1 << 16) /* Disable data transfer for clean line */
 
 /* Auxiliary Debug Modes Control 2 Register */
@@ -258,7 +257,6 @@ __v7_pj4b_setup:
/* Auxiliary Debug Modes Control 1 Register */
mrc p15, 1, r0, c15, c1, 1
orr r0, r0, #PJ4B_CLEAN_LINE
-   orr r0, r0, #PJ4B_BCK_OFF_STREX
orr r0, r0, #PJ4B_INTER_PARITY
bic r0, r0, #PJ4B_STATIC_BP
mcr p15, 1, r0, c15, c1, 1
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 122/168] uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Andy Lutomirski 

commit 82975bc6a6df743b9a01810fb32cb65d0ec5d60b upstream.

x86 call do_notify_resume on paranoid returns if TIF_UPROBE is set but
not on non-paranoid returns.  I suspect that this is a mistake and that
the code only works because int3 is paranoid.

Setting _TIF_NOTIFY_RESUME in the uprobe code was probably a workaround
for the x86 bug.  With that bug fixed, we can remove _TIF_NOTIFY_RESUME
from the uprobes code.

Reported-by: Oleg Nesterov 
Acked-by: Srikar Dronamraju 
Acked-by: Borislav Petkov 
Signed-off-by: Andy Lutomirski 
Signed-off-by: Linus Torvalds 
Signed-off-by: Luis Henriques 
---
 arch/x86/include/asm/thread_info.h | 2 +-
 kernel/events/uprobes.c| 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h 
b/arch/x86/include/asm/thread_info.h
index 854053889d4d..547e344a6dc6 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -141,7 +141,7 @@ struct thread_info {
 /* Only used for 64 bit */
 #define _TIF_DO_NOTIFY_MASK\
(_TIF_SIGPENDING | _TIF_MCE_NOTIFY | _TIF_NOTIFY_RESUME |   \
-_TIF_USER_RETURN_NOTIFY)
+_TIF_USER_RETURN_NOTIFY | _TIF_UPROBE)
 
 /* flags to check in __switch_to() */
 #define _TIF_WORK_CTXSW
\
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 6f3254e8c137..9a4d44f93015 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1639,7 +1639,6 @@ bool uprobe_deny_signal(void)
if (__fatal_signal_pending(t) || 
arch_uprobe_xol_was_trapped(t)) {
utask->state = UTASK_SSTEP_TRAPPED;
set_tsk_thread_flag(t, TIF_UPROBE);
-   set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
}
}
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 0/8] irqchip: New driver for ST's SysCfg controlled IRQs

2014-12-15 Thread Lee Jones
On Mon, 15 Dec 2014, Jason Cooper wrote:

> On Mon, Dec 15, 2014 at 12:28:26PM +, Lee Jones wrote:
> > Jason, would you like me to send this set again?
> 
> Please wait for -rc1 to land, then rebase on that.

Can do.  Thanks Jason.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 096/168] USB: xhci: Reset a halted endpoint immediately when we encounter a stall.

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Mathias Nyman 

commit 8e71a322fdb127814bcba423a512914ca5bc6cf5 upstream.

If a device is halted and reuturns a STALL, then the halted endpoint
needs to be cleared both on the host and device side. The host
side halt is cleared by issueing a xhci reset endpoint command. The device side
is cleared with a ClearFeature(ENDPOINT_HALT) request, which should
be issued by the device driver if a URB reruen -EPIPE.

Previously we cleared the host side halt after the device side was cleared.
To make sure the host side halt is cleared in time we want to issue the
reset endpoint command immedialtely when a STALL status is encountered.

Otherwise we end up not following the specs and not returning -EPIPE
several times in a row when trying to transfer data to a halted endpoint.

Fixes: bcef3fd (USB: xhci: Handle errors that cause endpoint halts.)
Tested-by: Felipe Balbi 
Signed-off-by: Mathias Nyman 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Luis Henriques 
---
 drivers/usb/host/xhci-ring.c | 40 +++
 drivers/usb/host/xhci.c  | 65 ++--
 2 files changed, 25 insertions(+), 80 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 5188a6bded0e..17df04a2d18b 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1846,22 +1846,13 @@ static int finish_td(struct xhci_hcd *xhci, struct 
xhci_td *td,
ep->stopped_td = td;
return 0;
} else {
-   if (trb_comp_code == COMP_STALL) {
-   /* The transfer is completed from the driver's
-* perspective, but we need to issue a set dequeue
-* command for this stalled endpoint to move the dequeue
-* pointer past the TD.  We can't do that here because
-* the halt condition must be cleared first.  Let the
-* USB class driver clear the stall later.
-*/
-   ep->stopped_td = td;
-   ep->stopped_stream = ep_ring->stream_id;
-   } else if (xhci_requires_manual_halt_cleanup(xhci,
-   ep_ctx, trb_comp_code)) {
-   /* Other types of errors halt the endpoint, but the
-* class driver doesn't call usb_reset_endpoint() unless
-* the error is -EPIPE.  Clear the halted status in the
-* xHCI hardware manually.
+   if (trb_comp_code == COMP_STALL ||
+   xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
+ trb_comp_code)) {
+   /* Issue a reset endpoint command to clear the host side
+* halt, followed by a set dequeue command to move the
+* dequeue pointer past the TD.
+* The class driver clears the device side halt later.
 */
xhci_cleanup_halted_endpoint(xhci,
slot_id, ep_index, ep_ring->stream_id,
@@ -1981,9 +1972,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct 
xhci_td *td,
else
td->urb->actual_length = 0;
 
-   xhci_cleanup_halted_endpoint(xhci,
-   slot_id, ep_index, 0, td, event_trb);
-   return finish_td(xhci, td, event_trb, event, ep, status, true);
+   return finish_td(xhci, td, event_trb, event, ep, status, false);
}
/*
 * Did we transfer any data, despite the errors that might have
@@ -2537,17 +2526,8 @@ cleanup:
if (ret) {
urb = td->urb;
urb_priv = urb->hcpriv;
-   /* Leave the TD around for the reset endpoint function
-* to use(but only if it's not a control endpoint,
-* since we already queued the Set TR dequeue pointer
-* command for stalled control endpoints).
-*/
-   if (usb_endpoint_xfer_control(&urb->ep->desc) ||
-   (trb_comp_code != COMP_STALL &&
-   trb_comp_code != COMP_BABBLE))
-   xhci_urb_free_priv(xhci, urb_priv);
-   else
-   kfree(urb_priv);
+
+   xhci_urb_free_priv(xhci, urb_priv);
 
usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), 
urb);
if ((urb->actual_length != urb->transfer_buffer_length 
&&
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.

[PATCH 3.16.y-ckt 129/168] i2c: omap: fix NACK and Arbitration Lost irq handling

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Alexander Kochetkov 

commit 27caca9d2e01c92b26d0690f065aad093fea01c7 upstream.

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

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

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

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

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

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

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

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

Tested on Beagleboard XM C.

Signed-off-by: Alexander Kochetkov 
Fixes: 1d7afc9 i2c: omap: ack IRQ in parts
Acked-by: Felipe Balbi 
Tested-by: Aaro Koskinen 
Signed-off-by: Wolfram Sang 
Signed-off-by: Luis Henriques 
---
 drivers/i2c/busses/i2c-omap.c | 2 --
 1 file changed, 2 deletions(-)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 102/168] PCI/MSI: Add device flag indicating that 64-bit MSIs don't work

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Benjamin Herrenschmidt 

commit f144d1496b47e7450f41b767d0d91c724c2198bc upstream.

This can be set by quirks/drivers to be used by the architecture code
that assigns the MSI addresses.

We additionally add verification in the core MSI code that the values
assigned by the architecture do satisfy the limitation in order to fail
gracefully if they don't (ie. the arch hasn't been updated to deal with
that quirk yet).

Signed-off-by: Benjamin Herrenschmidt 
Acked-by: Bjorn Helgaas 
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques 
---
 drivers/pci/msi.c   | 26 ++
 include/linux/pci.h |  1 +
 2 files changed, 27 insertions(+)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 13f3d3037272..1d6c61ad7da7 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -594,6 +594,20 @@ error_attrs:
return ret;
 }
 
+static int msi_verify_entries(struct pci_dev *dev)
+{
+   struct msi_desc *entry;
+
+   list_for_each_entry(entry, &dev->msi_list, list) {
+   if (!dev->no_64bit_msi || !entry->msg.address_hi)
+   continue;
+   dev_err(&dev->dev, "Device has broken 64-bit MSI but arch"
+   " tried to assign one above 4G\n");
+   return -EIO;
+   }
+   return 0;
+}
+
 /**
  * msi_capability_init - configure device's MSI capability structure
  * @dev: pointer to the pci_dev data structure of MSI device function
@@ -647,6 +661,13 @@ static int msi_capability_init(struct pci_dev *dev, int 
nvec)
return ret;
}
 
+   ret = msi_verify_entries(dev);
+   if (ret) {
+   msi_mask_irq(entry, mask, ~mask);
+   free_msi_irqs(dev);
+   return ret;
+   }
+
ret = populate_msi_sysfs(dev);
if (ret) {
msi_mask_irq(entry, mask, ~mask);
@@ -762,6 +783,11 @@ static int msix_capability_init(struct pci_dev *dev,
if (ret)
goto out_avail;
 
+   /* Check if all MSI entries honor device restrictions */
+   ret = msi_verify_entries(dev);
+   if (ret)
+   goto out_free;
+
/*
 * Some devices require MSI-X to be enabled before we can touch the
 * MSI-X registers.  We need to mask all the vectors to prevent
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 97fe7ebf2e25..04fdc409eec6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -331,6 +331,7 @@ struct pci_dev {
unsigned intis_added:1;
unsigned intis_busmaster:1; /* device is busmaster */
unsigned intno_msi:1;   /* device may not use msi */
+   unsigned intno_64bit_msi:1; /* device may only use 32-bit MSIs */
unsigned intblock_cfg_access:1; /* config space access is 
blocked */
unsigned intbroken_parity_status:1; /* Device generates false 
positive parity */
unsigned intirq_reroute_variant:2;  /* device needs IRQ rerouting 
variant */
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 125/168] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Andy Lutomirski 

commit af726f21ed8af2cdaa4e93098dc211521218ae65 upstream.

There's nothing special enough about the espfix64 double fault fixup to
justify writing it in assembly.  Move it to C.

This also fixes a bug: if the double fault came from an IST stack, the
old asm code would return to a partially uninitialized stack frame.

Fixes: 3891a04aafd668686239349ea58f3314ea2af86b
Signed-off-by: Andy Lutomirski 
Reviewed-by: Thomas Gleixner 
Signed-off-by: Linus Torvalds 
Signed-off-by: Luis Henriques 
---
 arch/x86/kernel/entry_64.S | 34 ++
 arch/x86/kernel/traps.c| 24 
 2 files changed, 26 insertions(+), 32 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 1b1d9ab375a5..41712e1d129a 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -842,6 +842,7 @@ ENTRY(native_iret)
jnz native_irq_return_ldt
 #endif
 
+.global native_irq_return_iret
 native_irq_return_iret:
iretq
_ASM_EXTABLE(native_irq_return_iret, bad_iret)
@@ -936,37 +937,6 @@ ENTRY(retint_kernel)
CFI_ENDPROC
 END(common_interrupt)
 
-   /*
-* If IRET takes a fault on the espfix stack, then we
-* end up promoting it to a doublefault.  In that case,
-* modify the stack to make it look like we just entered
-* the #GP handler from user space, similar to bad_iret.
-*/
-#ifdef CONFIG_X86_ESPFIX64
-   ALIGN
-__do_double_fault:
-   XCPT_FRAME 1 RDI+8
-   movq RSP(%rdi),%rax /* Trap on the espfix stack? */
-   sarq $PGDIR_SHIFT,%rax
-   cmpl $ESPFIX_PGD_ENTRY,%eax
-   jne do_double_fault /* No, just deliver the fault */
-   cmpl $__KERNEL_CS,CS(%rdi)
-   jne do_double_fault
-   movq RIP(%rdi),%rax
-   cmpq $native_irq_return_iret,%rax
-   jne do_double_fault /* This shouldn't happen... */
-   movq PER_CPU_VAR(kernel_stack),%rax
-   subq $(6*8-KERNEL_STACK_OFFSET),%rax/* Reset to original stack */
-   movq %rax,RSP(%rdi)
-   movq $0,(%rax)  /* Missing (lost) #GP error code */
-   movq $general_protection,RIP(%rdi)
-   retq
-   CFI_ENDPROC
-END(__do_double_fault)
-#else
-# define __do_double_fault do_double_fault
-#endif
-
 /*
  * APIC interrupts.
  */
@@ -1138,7 +1108,7 @@ idtentry overflow do_overflow has_error_code=0
 idtentry bounds do_bounds has_error_code=0
 idtentry invalid_op do_invalid_op has_error_code=0
 idtentry device_not_available do_device_not_available has_error_code=0
-idtentry double_fault __do_double_fault has_error_code=1 paranoid=1
+idtentry double_fault do_double_fault has_error_code=1 paranoid=1
 idtentry coprocessor_segment_overrun do_coprocessor_segment_overrun 
has_error_code=0
 idtentry invalid_TSS do_invalid_TSS has_error_code=1
 idtentry segment_not_present do_segment_not_present has_error_code=1
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 0eafe9ea2494..48035e9cdde9 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -243,6 +243,30 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, 
long error_code)
static const char str[] = "double fault";
struct task_struct *tsk = current;
 
+#ifdef CONFIG_X86_ESPFIX64
+   extern unsigned char native_irq_return_iret[];
+
+   /*
+* If IRET takes a non-IST fault on the espfix64 stack, then we
+* end up promoting it to a doublefault.  In that case, modify
+* the stack to make it look like we just entered the #GP
+* handler from user space, similar to bad_iret.
+*/
+   if (((long)regs->sp >> PGDIR_SHIFT) == ESPFIX_PGD_ENTRY &&
+   regs->cs == __KERNEL_CS &&
+   regs->ip == (unsigned long)native_irq_return_iret)
+   {
+   struct pt_regs *normal_regs = task_pt_regs(current);
+
+   /* Fake a #GP(0) from userspace. */
+   memmove(&normal_regs->ip, (void *)regs->sp, 5*8);
+   normal_regs->orig_ax = 0;  /* Missing (lost) #GP error code */
+   regs->ip = (unsigned long)general_protection;
+   regs->sp = (unsigned long)&normal_regs->orig_ax;
+   return;
+   }
+#endif
+
exception_enter();
/* Return not checked because double check cannot be ignored */
notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 124/168] net: sun4i-emac: fix memory leak on bad packet

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Marc Zyngier 

commit 2670cc699a66c4cf268cb3e3f6dfc325ec14f224 upstream.

Upon reception of a new frame, the emac driver checks for a number
of error conditions, and flag the packet as "bad" if any of these
are present. It then allocates a skb unconditionally, but only uses
it if the packet is "good". On the error path, the skb is just forgotten,
and the system leaks memory.

The piece of junk I have on my desk seems to encounter such error
frequently enough so that the box goes OOM after a couple of days,
which makes me grumpy.

Fix this by moving the allocation on the "good_packet" path (and
convert it to netdev_alloc_skb while we're at it).

Tested on a random Allwinner A20 board.

Cc: Stefan Roese 
Cc: Maxime Ripard 
Signed-off-by: Marc Zyngier 
Acked-by: Maxime Ripard 
Signed-off-by: David S. Miller 
Signed-off-by: Luis Henriques 
---
 drivers/net/ethernet/allwinner/sun4i-emac.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c 
b/drivers/net/ethernet/allwinner/sun4i-emac.c
index d81e7167a8b5..29b9f082475d 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -633,8 +633,10 @@ static void emac_rx(struct net_device *dev)
}
 
/* Move data from EMAC */
-   skb = dev_alloc_skb(rxlen + 4);
-   if (good_packet && skb) {
+   if (good_packet) {
+   skb = netdev_alloc_skb(dev, rxlen + 4);
+   if (!skb)
+   continue;
skb_reserve(skb, 2);
rdptr = (u8 *) skb_put(skb, rxlen - 4);
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 127/168] drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Ben Hutchings 

commit 5188cd44c55db3e92cd9e77a40b5baa7ed4340f7 upstream.

UFO is now disabled on all drivers that work with virtio net headers,
but userland may try to send UFO/IPv6 packets anyway.  Instead of
sending with ID=0, we should select identifiers on their behalf (as we
used to).

Signed-off-by: Ben Hutchings 
Fixes: 916e4cf46d02 ("ipv6: reuse ip6_frag_id from ip6_ufo_append_data")
Signed-off-by: David S. Miller 
Signed-off-by: Luis Henriques 
---
 drivers/net/macvtap.c  |  3 +++
 drivers/net/tun.c  |  6 +-
 include/net/ipv6.h |  2 ++
 net/ipv6/output_core.c | 34 ++
 4 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index ff1acf99c10b..07c942b6ae01 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -570,6 +571,8 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb,
break;
case VIRTIO_NET_HDR_GSO_UDP:
gso_type = SKB_GSO_UDP;
+   if (skb->protocol == htons(ETH_P_IPV6))
+   ipv6_proxy_select_ident(skb);
break;
default:
return -EINVAL;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 6c48ae7b1faa..ee7538dc9c21 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -65,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1139,6 +1140,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, 
struct tun_file *tfile,
break;
}
 
+   skb_reset_network_header(skb);
+
if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) {
pr_debug("GSO!\n");
switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
@@ -1150,6 +1153,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, 
struct tun_file *tfile,
break;
case VIRTIO_NET_HDR_GSO_UDP:
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
+   if (skb->protocol == htons(ETH_P_IPV6))
+   ipv6_proxy_select_ident(skb);
break;
default:
tun->dev->stats.rx_frame_errors++;
@@ -1179,7 +1184,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, 
struct tun_file *tfile,
skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG;
}
 
-   skb_reset_network_header(skb);
skb_probe_transport_header(skb, 0);
 
rxhash = skb_get_hash(skb);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 574337fe72dd..9b442a8d68ba 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -668,6 +668,8 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, 
const struct in6_add
return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
 }
 
+void ipv6_proxy_select_ident(struct sk_buff *skb);
+
 int ip6_dst_hoplimit(struct dst_entry *dst);
 
 static inline int ip6_sk_dst_hoplimit(struct ipv6_pinfo *np, struct flowi6 
*fl6,
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 5ec867e4a8b7..1d4156ddf355 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -3,11 +3,45 @@
  * not configured or static.  These functions are needed by GSO/GRO 
implementation.
  */
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+/* This function exists only for tap drivers that must support broken
+ * clients requesting UFO without specifying an IPv6 fragment ID.
+ *
+ * This is similar to ipv6_select_ident() but we use an independent hash
+ * seed to limit information leakage.
+ *
+ * The network header must be set before calling this.
+ */
+void ipv6_proxy_select_ident(struct sk_buff *skb)
+{
+   static u32 ip6_proxy_idents_hashrnd __read_mostly;
+   struct in6_addr buf[2];
+   struct in6_addr *addrs;
+   u32 hash, id;
+
+   addrs = skb_header_pointer(skb,
+  skb_network_offset(skb) +
+  offsetof(struct ipv6hdr, saddr),
+  sizeof(buf), buf);
+   if (!addrs)
+   return;
+
+   net_get_random_once(&ip6_proxy_idents_hashrnd,
+   sizeof(ip6_proxy_idents_hashrnd));
+
+   hash = __ipv6_addr_jhash(&addrs[1], ip6_proxy_idents_hashrnd);
+   hash = __ipv6_addr_jhash(&addrs[0], hash);
+
+   id = ip_idents_reserve(hash, 1);
+   skb_shinfo(skb)->ip6_frag_id = htonl(id);
+}
+EXPORT_SYMBOL_GPL(ipv6_proxy_select_ident);
+
 int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
 {
u16 offset = sizeof(struct ipv6hdr);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-k

[PATCH 3.16.y-ckt 128/168] [media] smiapp: Only some selection targets are settable

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Sakari Ailus 

commit b31eb901c4e5eeef4c83c43dfbc7fe0d4348cb21 upstream.

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

Signed-off-by: Sakari Ailus 
Signed-off-by: Mauro Carvalho Chehab 
Signed-off-by: Luis Henriques 
---
 drivers/media/i2c/smiapp/smiapp-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 06fb03291d59..698219a9e538 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2138,7 +2138,7 @@ static int smiapp_set_selection(struct v4l2_subdev 
*subdev,
ret = smiapp_set_compose(subdev, fh, sel);
break;
default:
-   BUG();
+   ret = -EINVAL;
}
 
mutex_unlock(&sensor->mutex);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 131/168] x86: Use $(OBJDUMP) instead of plain objdump

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Chris Clayton 

commit e2e68ae688b0a3766cd75aedf4ed4e39be402009 upstream.

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

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

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

Fixes: e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
Signed-off-by: Chris Clayton 
Acked-by: Kees Cook 
Acked-by: Borislav Petkov 
Cc: Junjie Mao 
Cc: Ingo Molnar 
Cc: H. Peter Anvin 
Link: http://lkml.kernel.org/r/54705c8e.1080...@googlemail.com
Signed-off-by: Thomas Gleixner 
Signed-off-by: Luis Henriques 
---
 arch/x86/boot/compressed/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 132/168] of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Ian Campbell 

commit 094cb98179f19b75acf9ff471daabf3948ce98e6 upstream.

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

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

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

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

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

Signed-off-by: Ian Campbell 
Signed-off-by: Grant Likely 
Cc: Rob Herring 
Signed-off-by: Luis Henriques 
---
 drivers/of/fdt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index f2da1750a597..5c437ca532b3 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -960,8 +960,6 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, 
u64 size)
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
phys_addr_t size, bool nomap)
 {
-   if (memblock_is_region_reserved(base, size))
-   return -EBUSY;
if (nomap)
return memblock_remove(base, size);
return memblock_reserve(base, size);
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 120/168] staging: r8188eu: Add new device ID for DLink GO-USB-N150

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Larry Finger 

commit 6d4556fc0309608f760f1d329df56d77fdd0c31a upstream.

The DLink GO-USB-N150 with revision B1 uses this driver.

Signed-off-by: Larry Finger 
Signed-off-by: Greg Kroah-Hartman 
Signed-off-by: Luis Henriques 
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index c4273cd5f7ed..db785c05f01c 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -58,6 +58,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */
{USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
+   {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
{}  /* Terminating entry */
 };
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 126/168] x86_64, traps: Rework bad_iret

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Andy Lutomirski 

commit b645af2d5905c4e32399005b867987919cbfc3ae upstream.

It's possible for iretq to userspace to fail.  This can happen because
of a bad CS, SS, or RIP.

Historically, we've handled it by fixing up an exception from iretq to
land at bad_iret, which pretends that the failed iret frame was really
the hardware part of #GP(0) from userspace.  To make this work, there's
an extra fixup to fudge the gs base into a usable state.

This is suboptimal because it loses the original exception.  It's also
buggy because there's no guarantee that we were on the kernel stack to
begin with.  For example, if the failing iret happened on return from an
NMI, then we'll end up executing general_protection on the NMI stack.
This is bad for several reasons, the most immediate of which is that
general_protection, as a non-paranoid idtentry, will try to deliver
signals and/or schedule from the wrong stack.

This patch throws out bad_iret entirely.  As a replacement, it augments
the existing swapgs fudge into a full-blown iret fixup, mostly written
in C.  It's should be clearer and more correct.

Signed-off-by: Andy Lutomirski 
Reviewed-by: Thomas Gleixner 
Signed-off-by: Linus Torvalds 
Signed-off-by: Luis Henriques 
---
 arch/x86/kernel/entry_64.S | 45 +++--
 arch/x86/kernel/traps.c| 29 +
 2 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 41712e1d129a..902a14d02882 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -844,8 +844,13 @@ ENTRY(native_iret)
 
 .global native_irq_return_iret
 native_irq_return_iret:
+   /*
+* This may fault.  Non-paranoid faults on return to userspace are
+* handled by fixup_bad_iret.  These include #SS, #GP, and #NP.
+* Double-faults due to espfix64 are handled in do_double_fault.
+* Other faults here are fatal.
+*/
iretq
-   _ASM_EXTABLE(native_irq_return_iret, bad_iret)
 
 #ifdef CONFIG_X86_ESPFIX64
 native_irq_return_ldt:
@@ -873,25 +878,6 @@ native_irq_return_ldt:
jmp native_irq_return_iret
 #endif
 
-   .section .fixup,"ax"
-bad_iret:
-   /*
-* The iret traps when the %cs or %ss being restored is bogus.
-* We've lost the original trap vector and error code.
-* #GPF is the most likely one to get for an invalid selector.
-* So pretend we completed the iret and took the #GPF in user mode.
-*
-* We are now running with the kernel GS after exception recovery.
-* But error_entry expects us to have user GS to match the user %cs,
-* so swap back.
-*/
-   pushq $0
-
-   SWAPGS
-   jmp general_protection
-
-   .previous
-
/* edi: workmask, edx: work */
 retint_careful:
CFI_RESTORE_STATE
@@ -1383,16 +1369,15 @@ error_sti:
 
 /*
  * There are two places in the kernel that can potentially fault with
- * usergs. Handle them here. The exception handlers after iret run with
- * kernel gs again, so don't set the user space flag. B stepping K8s
- * sometimes report an truncated RIP for IRET exceptions returning to
- * compat mode. Check for these here too.
+ * usergs. Handle them here.  B stepping K8s sometimes report a
+ * truncated RIP for IRET exceptions returning to compat mode. Check
+ * for these here too.
  */
 error_kernelspace:
incl %ebx
leaq native_irq_return_iret(%rip),%rcx
cmpq %rcx,RIP+8(%rsp)
-   je error_swapgs
+   je error_bad_iret
movl %ecx,%eax  /* zero extend */
cmpq %rax,RIP+8(%rsp)
je bstep_iret
@@ -1403,7 +1388,15 @@ error_kernelspace:
 bstep_iret:
/* Fix truncated RIP */
movq %rcx,RIP+8(%rsp)
-   jmp error_swapgs
+   /* fall through */
+
+error_bad_iret:
+   SWAPGS
+   mov %rsp,%rdi
+   call fixup_bad_iret
+   mov %rax,%rsp
+   decl %ebx   /* Return to usergs */
+   jmp error_sti
CFI_ENDPROC
 END(error_entry)
 
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 48035e9cdde9..de801f22128a 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -407,6 +407,35 @@ asmlinkage __visible struct pt_regs *sync_regs(struct 
pt_regs *eregs)
return regs;
 }
 NOKPROBE_SYMBOL(sync_regs);
+
+struct bad_iret_stack {
+   void *error_entry_ret;
+   struct pt_regs regs;
+};
+
+asmlinkage __visible
+struct bad_iret_stack *fixup_bad_iret(struct bad_iret_stack *s)
+{
+   /*
+* This is called from entry_64.S early in handling a fault
+* caused by a bad iret to user mode.  To handle the fault
+* correctly, we want move our stack frame to task_pt_regs
+* and we want to pretend that the exception came from the
+* iret target.
+*/
+  

Re: [RFC PATCH net-next 1/1] net: Support for switch port configuration

2014-12-15 Thread Thomas Graf
On 12/15/14 at 02:29pm, Varlese, Marco wrote:
> > All of these are highly generic and should *not* be passed through from user
> > space to the driver directly but rather be properly abstracted as Roopa
> > proposed. The value of this API is abstraction.
> How would you let the user enable/disable features then? For instance, how 
> would the user enable/disable flooding for broadcast packets (BFLOODING) on a 
> given port? What I was proposing is to have a list of attributes (to be added 
> in if_link.h) which can be tuned by the user using a tool like iproute2. What 
> do you propose? 

Excellent, I agree with what you are saying. What set me off is that
the patch does not reflect that yet. Instead, the patch introduces
a pure Netlink pass-through API to the driver.

I would expect the patch to:
 1. Parse the Netlink messages and be aware of individual attributes
 2. Validate them
 3. Pass the configuration to the driver using an API that can also
be consumed from in-kernel users.

> I think I have seen Roopa posting his updated ndo patch and getting some 
> feedback by few people already and as long as I will be able to accomplish 
> the use case described here I am happy with his way.

I think Roopa's patches are supplementary. Not all switchdev users
will be backed with a Linux Bridge. I therefore welcome your patches
very much.

The overlap is in the ndo. I think both the API you propose and
Roopa's bridge code should use the same NDO.

> I do not have an example right now of a vendor specific attribute but I was 
> just saying that might happen (i.e. someone will have a feature not 
> implemented by others?).

That's fine. Once we have them we can consider adding vendor specific
extensions.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 140/168] drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Petr Mladek 

commit f5475cc43c899e33098d4db44b7c5e710f16589d upstream.

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

[drm] Initialized drm 1.1.0 20060810
[drm] radeon kernel modesetting enabled.
[drm] initializing kernel modesetting (RV100 0x1002:0x515E 0x15D9:0x8080).
[drm] register mmio base: 0xC840
[drm] register mmio size: 65536
radeon :0b:01.0: VRAM: 128M 0xD000 - 0xD7FF 
(16M used)
radeon :0b:01.0: GTT: 512M 0xB000 - 0xCFFF
[drm] Detected VRAM RAM=128M, BAR=128M
[drm] RAM width 16bits DDR
[TTM] Zone  kernel: Available graphics memory: 3829346 kiB
[TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[TTM] Initializing pool allocator
[TTM] Initializing DMA pool allocator
[drm] radeon: 16M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
[drm] GART: num cpu pages 131072, num gpu pages 131072
[drm] PCI GART of 512M enabled (table at 0x3788).
radeon :0b:01.0: WB disabled
radeon :0b:01.0: fence driver on ring 0 use gpu addr 0xb000 
and cpu addr 0x8800bbbfa000
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] radeon: irq initialized.
[drm] Loading R100 Microcode
radeon :0b:01.0: Direct firmware load for radeon/R100_cp.bin failed 
with error -2
radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
[drm:r100_cp_init] *ERROR* Failed to load firmware!
radeon :0b:01.0: failed initializing CP (-2).
radeon :0b:01.0: Disabling GPU acceleration
[drm] radeon: cp finalized
BUG: unable to handle kernel NULL pointer dereference at 025c
IP: [] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
PGD 0
Oops:  [#1] SMP
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc6-4-default #2649
Hardware name: Supermicro X7DB8/X7DB8, BIOS 6.00 07/26/2006
task: 880234da2010 ti: 880234da4000 task.ti: 880234da4000
RIP: 0010:[]  [] 
drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
RSP: :880234da7918  EFLAGS: 00010086
RAX: 81557890 RBX:  RCX: 880234da7a48
RDX: 880234da79f4 RSI:  RDI: 880232e15000
RBP: 880234da79b8 R08:  R09: 
R10: 000a R11: 0001 R12: 880232dda1c0
R13: 880232e1518c R14: 0292 R15: 880232e15000
FS:  () GS:88023fc4() knlGS:
CS:  0010 DS:  ES:  CR0: 8005003b
CR2: 025c CR3: 02014000 CR4: 07e0
Stack:
 880234da79d8 0286 880232dcbc00 2480
 880234da7958 0296 880234da7998 8151b51d
 880234da7a48 32dcbeb0 880232dcbc00 880232dcbc58
Call Trace:
 [] ? drm_vma_offset_remove+0x1d/0x110
 [] radeon_get_vblank_timestamp_kms+0x38/0x60
 [] ? ttm_bo_release_list+0xba/0x180
 [] drm_get_last_vbltimestamp+0x41/0x70
 [] vblank_disable_and_save+0x73/0x1d0
 [] ? try_to_del_timer_sync+0x4f/0x70
 [] drm_vblank_cleanup+0x65/0xa0
 [] radeon_irq_kms_fini+0x1a/0x70
 [] r100_init+0x26e/0x410
 [] radeon_device_init+0x7ae/0xb50
 [] radeon_driver_load_kms+0x8f/0x210
 [] drm_dev_register+0xb5/0x110
 [] drm_get_pci_dev+0x8f/0x200
 [] radeon_pci_probe+0xad/0xe0
 [] local_pci_probe+0x45/0xa0
 [] pci_device_probe+0xd1/0x130
 [] driver_probe_device+0x12d/0x3e0
 [] __driver_attach+0x9b/0xa0
 [] ? __device_attach+0x40/0x40
 [] bus_for_each_dev+0x63/0xa0
 [] driver_attach+0x1e/0x20
 [] bus_add_driver+0x180/0x240
 [] driver_register+0x64/0xf0
 [] __pci_register_driver+0x4c/0x50
 [] drm_pci_init+0xf5/0x120
 [] ? ttm_init+0x6a/0x6a
 [] radeon_init+0x97/0xb5
 [] do_one_initcall+0xbc/0x1f0
 [] ? __wake_up+0x48/0x60
 [] kernel_init_freeable+0x18a/0x215
 [] ? initcall_blacklist+0xc0/0xc0
 [] ? rest_init+0x80/0x80
 [] kernel_init+0xe/0xf0
 [] ret_from_fork+0x7c/0xb0
 [] ? rest_init+0x80/0x80
Code: 45 ac 0f 88 a8 01 00 00 3b b7 d0 01 00 00 49 89 ff 0f 83 99 01 00 00 
48 8b 47 20 48 8b 80 88 00 00 00 48 85 c0 0f 84 cd 01 00 00 <41> 8b b1 5c 02 00 
00 41 8b 89 58 02 00 00 89 75 98 41 8b b1 60
RIP  [] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
 RSP 
CR2: 025c
---[ end trace ad2c0aadf48e2032 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0009

It has helped me to add a NULL pointer check that was suggested at
http://lists.freedesktop.org/arch

Re: [PATCH 5/8] mfd: Add ST's Low Power Controller driver

2014-12-15 Thread Lee Jones
On Mon, 15 Dec 2014, Arnd Bergmann wrote:

> On Monday 15 December 2014 13:50:52 Lee Jones wrote:
> > > > 
> > > 
> > > I don't think it's necessary to have the MFD node if only one of the
> > > two modes can be used based on a DT property. It should be enough
> > > to have both the rtc and the wdt driver list the same compatible
> > > string and check the property in the probe function to decide if
> > > they want to drive the device or not:
> > 
> > I tried that and it didn't work.  Only one driver probed.
> > 
> > 
> 
> Strange, the code in really_probe() and the comment in device_attach()
> suggest that this is not the intentional behavior. What error
> code did you return? If it's -ENODEV or -ENXIO, it should keep
> trying the other drivers, otherwise it will give up.

Oh I see.  So if I return -ENODEV it will keep trying to bind with
other drivers.  I'll try that and report back.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 138/168] AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Devin Ryles 

commit 249cd0a187ed4ef1d0af7f74362cc2791ec5581b upstream.

This patch adds DeviceIDs for Sunrise Point-LP.

Signed-off-by: Devin Ryles 
Signed-off-by: Tejun Heo 
Signed-off-by: Luis Henriques 
---
 drivers/ata/ahci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 99c9a2b5f377..5fc11a616a7a 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -321,6 +321,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */
{ PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */
{ PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */
+   { PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise Point-LP AHCI */
+   { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */
+   { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */
{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */
{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */
{ PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 135/168] ALSA: hda/realtek - Add headset Mic support for new Dell machine

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Kailang Yang 

commit b734304f15ebe2a1e89fb9422541fbecf50b7cd9 upstream.

Dell has new machines. It supports headset Mic and Headphone Mic.

Signed-off-by: Kailang Yang 
Signed-off-by: Takashi Iwai 
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques 
---
 sound/pci/hda/patch_realtek.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 60f010959327..e517902cbd66 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4792,6 +4792,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1028, 0x0684, "Dell", 
ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", 
ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", 
ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
+   SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", 
ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
+   SND_PCI_QUIRK(0x1028, 0x06da, "Dell", 
ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x164a, "Dell", 
ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1028, 0x164b, "Dell", 
ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 136/168] drm/i915: More cautious with pch fifo underruns

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Daniel Vetter 

commit b68362278af94e1171f5be9d4e44988601fb0439 upstream.

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

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

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

References: 
http://mid.gmane.org/CA+gsUGRfGe3t4NcjdeA=qxysrhly3r4ceu7z4bjtwxi1uof...@mail.gmail.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85898
References: https://bugs.freedesktop.org/show_bug.cgi?id=85898
References: https://bugs.freedesktop.org/show_bug.cgi?id=86233
References: https://bugs.freedesktop.org/show_bug.cgi?id=86478
Signed-off-by: Daniel Vetter 
Tested-by: lu hua 
Reviewed-by: Paulo Zanoni 
Signed-off-by: Jani Nikula 
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/i915/intel_display.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c 
b/drivers/gpu/drm/i915/intel_display.c
index 6b835b86fbfd..abed8ee8e2d7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4183,7 +4183,6 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
ironlake_fdi_disable(crtc);
 
ironlake_disable_pch_transcoder(dev_priv, pipe);
-   intel_set_pch_fifo_underrun_reporting(dev, pipe, true);
 
if (HAS_PCH_CPT(dev)) {
/* disable TRANS_DP_CTL */
@@ -4250,7 +4249,6 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
 
if (intel_crtc->config.has_pch_encoder) {
lpt_disable_pch_transcoder(dev_priv);
-   intel_set_pch_fifo_underrun_reporting(dev, TRANSCODER_A, true);
intel_ddi_fdi_disable(crtc);
}
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 134/168] nouveau: move the hotplug ignore to correct place.

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Dave Airlie 

commit 8b62c8c6df08ca567c78afa51aa7bbc554cede06 upstream.

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

https://bugzilla.kernel.org/show_bug.cgi?id=86011
Cc: Bjorn Helgaas 
Signed-off-by: Dave Airlie 
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c 
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 0f7addae60d7..84a8b9fb20c8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -595,7 +595,6 @@ int nouveau_pmops_suspend(struct device *dev)
 
pci_save_state(pdev);
pci_disable_device(pdev);
-   pci_ignore_hotplug(pdev);
pci_set_power_state(pdev, PCI_D3hot);
return 0;
 }
@@ -887,6 +886,7 @@ static int nouveau_pmops_runtime_suspend(struct device *dev)
ret = nouveau_do_suspend(drm_dev, true);
pci_save_state(pdev);
pci_disable_device(pdev);
+   pci_ignore_hotplug(pdev);
pci_set_power_state(pdev, PCI_D3cold);
drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
return ret;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 152/168] ip_tunnel: the lack of vti_link_ops' dellink() cause kernel panic

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: lucien 

commit 20ea60ca9952bd19d4b0d74719daba305aef5178 upstream.

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

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

the panic will happen, cause dev of ip_tunnel *t is null:
[ 3835.072977] IP: [] ip_tunnel_find+0x9d/0xc0 [ip_tunnel]
[ 3835.073008] PGD b2c21067 PUD b7277067 PMD 0
[ 3835.073008] Oops:  [#1] SMP
.
[ 3835.073008] Stack:
[ 3835.073008]  8800b72d77f0 a0411924 8800bb956000 
8800b72d78e0
[ 3835.073008]  8800b72d78a0  a040d100 
8800b72d7858
[ 3835.073008]  a040b2e3   

[ 3835.073008] Call Trace:
[ 3835.073008]  [] ip_tunnel_newlink+0x64/0x160 [ip_tunnel]
[ 3835.073008]  [] vti_newlink+0x43/0x70 [ip_vti]
[ 3835.073008]  [] rtnl_newlink+0x4fa/0x5f0
[ 3835.073008]  [] ? nla_strlcpy+0x5b/0x70
[ 3835.073008]  [] ? rtnl_link_ops_get+0x40/0x60
[ 3835.073008]  [] ? rtnl_newlink+0x13f/0x5f0
[ 3835.073008]  [] rtnetlink_rcv_msg+0xa4/0x270
[ 3835.073008]  [] ? sock_has_perm+0x75/0x90
[ 3835.073008]  [] ? rtnetlink_rcv+0x30/0x30
[ 3835.073008]  [] netlink_rcv_skb+0xa9/0xc0
[ 3835.073008]  [] rtnetlink_rcv+0x28/0x30


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

do that one or more times, kernel will panic.

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

Signed-off-by: Xin Long 
Signed-off-by: Cong Wang 
Signed-off-by: David S. Miller 
Signed-off-by: Luis Henriques 
---
 net/ipv4/ip_vti.c  |  1 +
 net/ipv6/ip6_vti.c | 11 +++
 2 files changed, 12 insertions(+)

diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index b8960f3527f3..ea7525b1f996 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -528,6 +528,7 @@ static struct rtnl_link_ops vti_link_ops __read_mostly = {
.validate   = vti_tunnel_validate,
.newlink= vti_newlink,
.changelink = vti_changelink,
+   .dellink= ip_tunnel_dellink,
.get_size   = vti_get_size,
.fill_info  = vti_fill_info,
 };
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index f3ce1cbc0bc5..7c6e6bfb1b0f 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -901,6 +901,15 @@ static int vti6_newlink(struct net *src_net, struct 
net_device *dev,
return vti6_tnl_create2(dev);
 }
 
+static void vti6_dellink(struct net_device *dev, struct list_head *head)
+{
+   struct net *net = dev_net(dev);
+   struct vti6_net *ip6n = net_generic(net, vti6_net_id);
+
+   if (dev != ip6n->fb_tnl_dev)
+   unregister_netdevice_queue(dev, head);
+}
+
 static int vti6_changelink(struct net_device *dev, struct nlattr *tb[],
   struct nlattr *data[])
 {
@@ -976,6 +985,7 @@ static struct rtnl_link_ops vti6_link_ops __read_mostly = {
.setup  = vti6_dev_setup,
.validate   = vti6_validate,
.newlink= vti6_newlink,
+   .dellink= vti6_dellink,
.changelink = vti6_changelink,
.get_size   = vti6_get_size,
.fill_info  = vti6_fill_info,
@@ -1016,6 +1026,7 @@ static int __net_init vti6_init_net(struct net *net)
if (!ip6n->fb_tnl_dev)
goto err_alloc_dev;
dev_net_set(ip6n->fb_tnl_dev, net);
+   ip6n->fb_tnl_dev->rtnl_link_ops = &vti6_link_ops;
 
err = vti6_fb_tnl_dev_init(ip6n->fb_tnl_dev);
if (err < 0)
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 130/168] [media] s2255drv: fix payload size for JPG, MJPEG

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: sensoray-dev 

commit 1f391217ad8d7cd7b1e48e6e2abf49970cd91d18 upstream.

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

Signed-off-by: Dean Anderson 
Signed-off-by: Hans Verkuil 
Signed-off-by: Mauro Carvalho Chehab 
Signed-off-by: Luis Henriques 
---
 drivers/media/usb/s2255/s2255drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/s2255/s2255drv.c 
b/drivers/media/usb/s2255/s2255drv.c
index a44466bc7b86..ea56159e9bb2 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -632,7 +632,7 @@ static void s2255_fillbuff(struct s2255_vc *vc,
break;
case V4L2_PIX_FMT_JPEG:
case V4L2_PIX_FMT_MJPEG:
-   buf->vb.v4l2_buf.length = jpgsize;
+   vb2_set_plane_payload(&buf->vb, 0, jpgsize);
memcpy(vbuf, tmpbuf, jpgsize);
break;
case V4L2_PIX_FMT_YUV422P:
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 151/168] drm/radeon: sync all BOs involved in a CS v2

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: =?UTF-8?q?Christian=20K=C3=B6nig?= 

commit 86b276385c6a986872e4cd144f5940b156053c3f upstream.

Not just the userspace relocs, otherwise we won't wait
for a swapped out page tables to be swapped in again.

v2: rebased on Alex current drm-fixes-3.18

Signed-off-by: Christian König 
Signed-off-by: Alex Deucher 
[ luis: backported to 3.16: used Christian's backport to 3.17 ]
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/radeon/radeon_cs.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c 
b/drivers/gpu/drm/radeon/radeon_cs.c
index c50a1da6c12a..4aa1ede7b7b5 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -226,14 +226,11 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, 
u32 ring, s32 priority
 
 static void radeon_cs_sync_rings(struct radeon_cs_parser *p)
 {
-   int i;
-
-   for (i = 0; i < p->nrelocs; i++) {
-   if (!p->relocs[i].robj)
-   continue;
+   struct radeon_cs_reloc *reloc;
 
+   list_for_each_entry(reloc, &p->validated, tv.head) {
radeon_semaphore_sync_to(p->ib.semaphore,
-p->relocs[i].robj->tbo.sync_obj);
+reloc->robj->tbo.sync_obj);
}
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 137/168] drm/i915: Unlock panel even when LVDS is disabled

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Daniel Vetter 

commit b0616c5306b342ceca07044dbc4f917d95c4f825 upstream.

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

commit c31407a3672aaebb4acddf90944a114fa5c8af7b
Author: Chris Wilson 
Date:   Thu Oct 18 21:07:01 2012 +0100

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

Reported-by: Alexey Orishko 
Cc: Alexey Orishko 
Cc: Chris Wilson 
Cc: Francois Tigeot 
Signed-off-by: Daniel Vetter 
Tested-by: Alexey Orishko 
Signed-off-by: Jani Nikula 
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/i915/intel_lvds.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c 
b/drivers/gpu/drm/i915/intel_lvds.c
index 0fb230949f81..eef36d0076ee 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -893,6 +893,17 @@ void intel_lvds_init(struct drm_device *dev)
int pipe;
u8 pin;
 
+   /*
+* Unlock registers and just leave them unlocked. Do this before
+* checking quirk lists to avoid bogus WARNINGs.
+*/
+   if (HAS_PCH_SPLIT(dev)) {
+   I915_WRITE(PCH_PP_CONTROL,
+  I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS);
+   } else {
+   I915_WRITE(PP_CONTROL,
+  I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
+   }
if (!intel_lvds_supported(dev))
return;
 
@@ -1088,17 +1099,6 @@ out:
DRM_DEBUG_KMS("detected %s-link lvds configuration\n",
  lvds_encoder->is_dual_link ? "dual" : "single");
 
-   /*
-* Unlock registers and just
-* leave them unlocked
-*/
-   if (HAS_PCH_SPLIT(dev)) {
-   I915_WRITE(PCH_PP_CONTROL,
-  I915_READ(PCH_PP_CONTROL) | PANEL_UNLOCK_REGS);
-   } else {
-   I915_WRITE(PP_CONTROL,
-  I915_READ(PP_CONTROL) | PANEL_UNLOCK_REGS);
-   }
lvds_connector->lid_notifier.notifier_call = intel_lid_notify;
if (acpi_lid_notifier_register(&lvds_connector->lid_notifier)) {
DRM_DEBUG_KMS("lid notifier registration failed\n");
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 133/168] drm/nouveau/gf116: remove copy1 engine

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Ilia Mirkin 

commit 226d63a1addea8cbe8fc671978e62dc84927b046 upstream.

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

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

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85465
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59168
Signed-off-by: Ilia Mirkin 
Signed-off-by: Ben Skeggs 
Signed-off-by: Luis Henriques 
---
 drivers/gpu/drm/nouveau/core/engine/device/nvc0.c | 1 -
 1 file changed, 1 deletion(-)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 147/168] slab: fix nodeid bounds check for non-contiguous node IDs

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Paul Mackerras 

commit 7c3fbbdd04a681a1992ad6a3d7a36a63ff668753 upstream.

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

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

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

Fixes: 14e50c6a9bc2 ("mm: slab: Verify the nodeid passed to 
cache_alloc_node")
Signed-off-by: Paul Mackerras 
Reviewed-by: Yasuaki Ishimatsu 
Reviewed-by: Pekka Enberg 
Acked-by: David Rientjes 
Cc: Christoph Lameter 
Cc: Joonsoo Kim 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques 
---
 mm/slab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slab.c b/mm/slab.c
index c9103e4cf2c2..92dbea7e7132 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3225,7 +3225,7 @@ static void *cache_alloc_node(struct kmem_cache 
*cachep, gfp_t flags,
void *obj;
int x;
 
-   VM_BUG_ON(nodeid > num_online_nodes());
+   VM_BUG_ON(nodeid < 0 || nodeid >= MAX_NUMNODES);
n = cachep->node[nodeid];
BUG_ON(!n);
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 145/168] mm: fix swapoff hang after page migration and fork

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Hugh Dickins 

commit 2022b4d18a491a578218ce7a4eca8666db895a73 upstream.

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

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

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

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

Signed-off-by: Hugh Dickins 
Cc: Kelley Nielsen 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 
Signed-off-by: Luis Henriques 
---
 mm/memory.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 141/168] mm: frontswap: invalidate expired data on a dup-store failure

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Weijie Yang 

commit fb993fa1a2f669215fa03a09eed7848f2663e336 upstream.

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

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

Signed-off-by: Weijie Yang 
Cc: Konrad Rzeszutek Wilk 
Cc: Seth Jennings 
Cc: Dan Streetman 
Cc: Minchan Kim 
Cc: Bob Liu 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 
Signed-off-by: Luis Henriques 
---
 mm/frontswap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 142/168] mm/vmpressure.c: fix race in vmpressure_work_fn()

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Andrew Morton 

commit 91b57191cfd152c02ded0745250167d0263084f8 upstream.

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

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

[a...@linux-foundation.org: neaten]
Reported-by: ji_ang 
Cc: Anton Vorontsov 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 
Signed-off-by: Luis Henriques 
---
 mm/vmpressure.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 144/168] drivers/input/evdev.c: don't kfree() a vmalloc address

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Andrew Morton 

commit 92788ac1eb06e69a822de45e2a8a63fa45eb5be2 upstream.

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

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

Reported-by: Christian Casteyde 
Belatedly-Acked-by: Dmitry Torokhov 
Cc: Henrik Rydberg 
Signed-off-by: Andrew Morton 
Signed-off-by: Linus Torvalds 
Signed-off-by: Luis Henriques 
---
 drivers/input/evdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index fd325ec9f064..b51970d1e9ee 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -422,7 +422,7 @@ static int evdev_open(struct inode *inode, struct file 
*file)
 
  err_free_client:
evdev_detach_client(evdev, client);
-   kfree(client);
+   kvfree(client);
return error;
 }
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 149/168] i2c: davinci: generate STP always when NACK is received

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Grygorii Strashko 

commit 9ea359f7314132cbcb5a502d2d8ef095be1f45e4 upstream.

According to I2C specification the NACK should be handled as follows:
"When SDA remains HIGH during this ninth clock pulse, this is defined as the Not
Acknowledge signal. The master can then generate either a STOP condition to
abort the transfer, or a repeated START condition to start a new transfer."
[I2C spec Rev. 6, 3.1.6: http://www.nxp.com/documents/user_manual/UM10204.pdf]

Currently the Davinci i2c driver interrupts the transfer on receipt of a
NACK but fails to send a STOP in some situations and so makes the bus
stuck until next I2C IP reset (idle/enable).

For example, the issue will happen during SMBus read transfer which
consists from two i2c messages write command/address and read data:

S Slave Address Wr A Command Code A Sr Slave Address Rd A D1..Dn A P
<--- write ---> <--- read ->

The I2C client device will send NACK if it can't recognize "Command Code"
and it's expected from I2C master to generate STP in this case.
But now, Davinci i2C driver will just exit with -EREMOTEIO and STP will
not be generated.

Hence, fix it by generating Stop condition (STP) always when NACK is received.

This patch fixes Davinci I2C in the same way it was done for OMAP I2C
commit cda2109a26eb ("i2c: omap: query STP always when NACK is received").

Reviewed-by: Uwe Kleine-König 
Reported-by: Hein Tibosch 
Signed-off-by: Grygorii Strashko 
Signed-off-by: Wolfram Sang 
Signed-off-by: Luis Henriques 
---
 drivers/i2c/busses/i2c-davinci.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 389bc68c55ad..831b7df52fd5 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -411,11 +411,9 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct 
i2c_msg *msg, int stop)
if (dev->cmd_err & DAVINCI_I2C_STR_NACK) {
if (msg->flags & I2C_M_IGNORE_NAK)
return msg->len;
-   if (stop) {
-   w = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG);
-   w |= DAVINCI_I2C_MDR_STP;
-   davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
-   }
+   w = davinci_i2c_read_reg(dev, DAVINCI_I2C_MDR_REG);
+   w |= DAVINCI_I2C_MDR_STP;
+   davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w);
return -EREMOTEIO;
}
return -EIO;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 148/168] ahci: disable MSI on SAMSUNG 0xa800 SSD

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Tejun Heo 

commit 2b21ef0aae65f22f5ba86b13c4588f6f0c2dbefb upstream.

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

Signed-off-by: Tejun Heo 
Reported-by: Dominik Mierzejewski 
Link: https://bugzilla.kernel.org/show_bug.cgi?id=89171
Signed-off-by: Luis Henriques 
---
 drivers/ata/ahci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 5fc11a616a7a..3b18399290b3 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -495,6 +495,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 * enabled.  https://bugzilla.kernel.org/show_bug.cgi?id=60731
 */
{ PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_nomsi },
+   { PCI_VDEVICE(SAMSUNG, 0xa800), board_ahci_nomsi },
 
/* Enmotus */
{ PCI_DEVICE(0x1c44, 0x8000), board_ahci },
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.16.y-ckt 143/168] xen-netfront: Remove BUGs on paged skb data which crosses a page boundary

2014-12-15 Thread Luis Henriques
3.16.7-ckt3 -stable review patch.  If anyone has any objections, please let me 
know.

--

From: Seth Forshee 

commit 8d609725d4357f499e2103e46011308b32f53513 upstream.

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

Fixes: f36c374782e4 ("xen/netfront: handle compound page fragments on transmit")
Signed-off-by: Seth Forshee 
Reviewed-by: David Vrabel 
Signed-off-by: David S. Miller 
Signed-off-by: Luis Henriques 
---
 drivers/net/xen-netfront.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 055222bae6e4..7a4cd11e6a07 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -496,9 +496,6 @@ static void xennet_make_frags(struct sk_buff *skb, struct 
netfront_queue *queue,
len = skb_frag_size(frag);
offset = frag->page_offset;
 
-   /* Data must not cross a page boundary. */
-   BUG_ON(len + offset > PAGE_SIZE<> PAGE_SHIFT;
offset &= ~PAGE_MASK;
@@ -506,8 +503,6 @@ static void xennet_make_frags(struct sk_buff *skb, struct 
netfront_queue *queue,
while (len > 0) {
unsigned long bytes;
 
-   BUG_ON(offset >= PAGE_SIZE);
-
bytes = PAGE_SIZE - offset;
if (bytes > len)
bytes = len;
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


<    2   3   4   5   6   7   8   9   10   >