pandora-kernel.git
10 years agowatchdog: twl4030: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 20:11:18 +0000 (01:41 +0530)]
watchdog: twl4030: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Timo Kokkonen <timo.t.kokkonen@nokia.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: mpcore: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 20:11:15 +0000 (01:41 +0530)]
watchdog: mpcore: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: da9055: use platform_{get,set}_drvdata()
Jingoo Han [Thu, 23 May 2013 10:44:23 +0000 (19:44 +0900)]
watchdog: da9055: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: da9052: use platform_{get,set}_drvdata()
Jingoo Han [Thu, 23 May 2013 10:44:09 +0000 (19:44 +0900)]
watchdog: da9052: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: cpwd: use platform_{get,set}_drvdata()
Jingoo Han [Thu, 23 May 2013 10:43:43 +0000 (19:43 +0900)]
watchdog: cpwd: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: s3c2410_wdt: convert s3c2410wdt to dev_pm_ops
Jingoo Han [Thu, 14 Mar 2013 01:31:21 +0000 (10:31 +0900)]
watchdog: s3c2410_wdt: convert s3c2410wdt to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer
dev_pm_ops structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: s3c2410_wdt: use dev_err()/dev_info() instead of pr_err()/pr_info()
Jingoo Han [Thu, 14 Mar 2013 01:30:21 +0000 (10:30 +0900)]
watchdog: s3c2410_wdt: use dev_err()/dev_info() instead of pr_err()/pr_info()

dev_err()/dev_info() are more preferred than pr_err()/pr_info().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: wm831x: use platform_{get,set}_drvdata()
Jingoo Han [Thu, 23 May 2013 10:44:53 +0000 (19:44 +0900)]
watchdog: wm831x: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: wm831x_wdt: use devm_gpio_request_one()
Jingoo Han [Mon, 29 Apr 2013 09:31:20 +0000 (18:31 +0900)]
watchdog: wm831x_wdt: use devm_gpio_request_one()

Use devm_gpio_request_one() to make cleanup paths simpler.
Also, GPIOF_DIR_OUT | GPIOF_INIT_LOW is replaced with
GPIOF_OUT_INIT_LOW.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: mtx1-wdt: use devm_gpio_request_one()
Jingoo Han [Mon, 29 Apr 2013 09:30:43 +0000 (18:30 +0900)]
watchdog: mtx1-wdt: use devm_gpio_request_one()

Use devm_gpio_request_one() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: sp805_wdt: use devm_clk_get()
Jingoo Han [Mon, 29 Apr 2013 09:16:49 +0000 (18:16 +0900)]
watchdog: sp805_wdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: shwdt: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 20:11:16 +0000 (01:41 +0530)]
watchdog: shwdt: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agoinet: fix spacing in assignment
Camelia Groza [Thu, 11 Jul 2013 06:55:51 +0000 (09:55 +0300)]
inet: fix spacing in assignment

Found using checkpatch.pl

Signed-off-by: Camelia Groza <camelia.groza@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agowatchdog: shwdt: use devm_clk_get()
Jingoo Han [Mon, 29 Apr 2013 09:16:33 +0000 (18:16 +0900)]
watchdog: shwdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: pnx4008_wdt: use devm_clk_get()
Jingoo Han [Mon, 29 Apr 2013 09:16:14 +0000 (18:16 +0900)]
watchdog: pnx4008_wdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: imx2_wdt: use devm_clk_get()
Jingoo Han [Mon, 29 Apr 2013 09:15:53 +0000 (18:15 +0900)]
watchdog: imx2_wdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: dw_wdt: Staticize local symbol
Sachin Kamat [Tue, 14 May 2013 06:41:03 +0000 (12:11 +0530)]
watchdog: dw_wdt: Staticize local symbol

'dw_wdt_write' is used only in this file. Make it static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agoifb: fix oops when loading the ifb failed
dingtianhong [Thu, 11 Jul 2013 11:04:06 +0000 (19:04 +0800)]
ifb: fix oops when loading the ifb failed

If __rtnl_link_register() return faild when loading the ifb, it will
take the wrong path and get oops, so fix it just like dummy.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodummy: fix oops when loading the dummy failed
dingtianhong [Thu, 11 Jul 2013 11:04:02 +0000 (19:04 +0800)]
dummy: fix oops when loading the dummy failed

We rename the dummy in modprobe.conf like this:

install dummy0 /sbin/modprobe -o dummy0 --ignore-install dummy
install dummy1 /sbin/modprobe -o dummy1 --ignore-install dummy

We got oops when we run the command:

modprobe dummy0
modprobe dummy1

------------[ cut here ]------------

[ 3302.187584] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[ 3302.195411] IP: [<ffffffff813fe62a>] __rtnl_link_unregister+0x9a/0xd0
[ 3302.201844] PGD 85c94a067 PUD 8517bd067 PMD 0
[ 3302.206305] Oops: 0002 [#1] SMP
[ 3302.299737] task: ffff88105ccea300 ti: ffff880eba4a0000 task.ti: ffff880eba4a0000
[ 3302.307186] RIP: 0010:[<ffffffff813fe62a>]  [<ffffffff813fe62a>] __rtnl_link_unregister+0x9a/0xd0
[ 3302.316044] RSP: 0018:ffff880eba4a1dd8  EFLAGS: 00010246
[ 3302.321332] RAX: 0000000000000000 RBX: ffffffff81a9d738 RCX: 0000000000000002
[ 3302.328436] RDX: 0000000000000000 RSI: ffffffffa04d602c RDI: ffff880eba4a1dd8
[ 3302.335541] RBP: ffff880eba4a1e18 R08: dead000000200200 R09: dead000000100100
[ 3302.342644] R10: 0000000000000080 R11: 0000000000000003 R12: ffffffff81a9d788
[ 3302.349748] R13: ffffffffa04d7020 R14: ffffffff81a9d670 R15: ffff880eba4a1dd8
[ 3302.364910] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 3302.370630] CR2: 0000000000000008 CR3: 000000085e15e000 CR4: 00000000000427e0
[ 3302.377734] DR0: 0000000000000003 DR1: 00000000000000b0 DR2: 0000000000000001
[ 3302.384838] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 3302.391940] Stack:
[ 3302.393944]  ffff880eba4a1dd8 ffff880eba4a1dd8 ffff880eba4a1e18 ffffffffa04d70c0
[ 3302.401350]  00000000ffffffef ffffffffa01a8000 0000000000000000 ffffffff816111c8
[ 3302.408758]  ffff880eba4a1e48 ffffffffa01a80be ffff880eba4a1e48 ffffffffa04d70c0
[ 3302.416164] Call Trace:
[ 3302.418605]  [<ffffffffa01a8000>] ? 0xffffffffa01a7fff
[ 3302.423727]  [<ffffffffa01a80be>] dummy_init_module+0xbe/0x1000 [dummy0]
[ 3302.430405]  [<ffffffffa01a8000>] ? 0xffffffffa01a7fff
[ 3302.435535]  [<ffffffff81000322>] do_one_initcall+0x152/0x1b0
[ 3302.441263]  [<ffffffff810ab24b>] do_init_module+0x7b/0x200
[ 3302.446824]  [<ffffffff810ad3d2>] load_module+0x4e2/0x530
[ 3302.452215]  [<ffffffff8127ae40>] ? ddebug_dyndbg_boot_param_cb+0x60/0x60
[ 3302.458979]  [<ffffffff810ad5f1>] SyS_init_module+0xd1/0x130
[ 3302.464627]  [<ffffffff814b9652>] system_call_fastpath+0x16/0x1b
[ 3302.490090] RIP  [<ffffffff813fe62a>] __rtnl_link_unregister+0x9a/0xd0
[ 3302.496607]  RSP <ffff880eba4a1dd8>
[ 3302.500084] CR2: 0000000000000008
[ 3302.503466] ---[ end trace 8342d49cd49f78ed ]---

The reason is that when loading dummy, if __rtnl_link_register() return failed,
the init_module should return and avoid take the wrong path.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agowatchdog: dw_wdt: use devm_clk_get()
Jingoo Han [Mon, 29 Apr 2013 09:15:26 +0000 (18:15 +0900)]
watchdog: dw_wdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: ts72xx_wdt: use devm_*() functions
Jingoo Han [Thu, 2 May 2013 05:52:16 +0000 (14:52 +0900)]
watchdog: ts72xx_wdt: use devm_*() functions

Use devm_*() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: riowd: use platform_{get,set}_drvdata()
Jingoo Han [Thu, 23 May 2013 10:44:38 +0000 (19:44 +0900)]
watchdog: riowd: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: riowd: use devm_kzalloc()
Jingoo Han [Tue, 30 Apr 2013 05:01:59 +0000 (14:01 +0900)]
watchdog: riowd: use devm_kzalloc()

Use devm_kzalloc() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: rc32434_wdt: use devm_ioremap_nocache() functions
Jingoo Han [Tue, 30 Apr 2013 05:01:41 +0000 (14:01 +0900)]
watchdog: rc32434_wdt: use devm_ioremap_nocache() functions

Use devm_ioremap_nocache() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: nuc900_wdt: use devm_*() functions
Jingoo Han [Tue, 30 Apr 2013 05:01:25 +0000 (14:01 +0900)]
watchdog: nuc900_wdt: use devm_*() functions

Use devm_*() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: mv64x60_wdt: use devm_ioremap()
Jingoo Han [Tue, 30 Apr 2013 05:00:49 +0000 (14:00 +0900)]
watchdog: mv64x60_wdt: use devm_ioremap()

Use devm_ioremap() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agodrivers: net: phy: at803x: Add missing mdio device id
Helmut Schaa [Thu, 11 Jul 2013 11:57:34 +0000 (13:57 +0200)]
drivers: net: phy: at803x: Add missing mdio device id

at803x supports Atheros 8030, 8031 and 8035 PHYs. 8031 was missing from
the mdio device id table.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agowatchdog: bcm63xx_wdt: use devm_ioremap_nocache()
Jingoo Han [Tue, 30 Apr 2013 05:00:33 +0000 (14:00 +0900)]
watchdog: bcm63xx_wdt: use devm_ioremap_nocache()

Use devm_ioremap_nocache() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: at32ap700x: Remove redundant platform_set_drvdata()
Sachin Kamat [Fri, 3 May 2013 20:11:14 +0000 (01:41 +0530)]
watchdog: at32ap700x: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agowatchdog: at32ap700x_wdt: use devm_*() functions
Jingoo Han [Tue, 30 Apr 2013 04:59:48 +0000 (13:59 +0900)]
watchdog: at32ap700x_wdt: use devm_*() functions

Use devm_*() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
10 years agoipv6: fix route selection if kernel is not compiled with CONFIG_IPV6_ROUTER_PREF
Hannes Frederic Sowa [Thu, 11 Jul 2013 10:43:42 +0000 (12:43 +0200)]
ipv6: fix route selection if kernel is not compiled with CONFIG_IPV6_ROUTER_PREF

This is a follow-up patch to 3630d40067a21d4dfbadc6002bb469ce26ac5d52
("ipv6: rt6_check_neigh should successfully verify neigh if no NUD
information are available").

Since the removal of rt->n in rt6_info we can end up with a dst ==
NULL in rt6_check_neigh. In case the kernel is not compiled with
CONFIG_IPV6_ROUTER_PREF we should also select a route with unkown
NUD state but we must not avoid doing round robin selection on routes
with the same target. So introduce and pass down a boolean ``do_rr'' to
indicate when we should update rt->rr_ptr. As soon as no route is valid
we do backtracking and do a lookup on a higher level in the fib trie.

v2:
a) Improved rt6_check_neigh logic (no need to create neighbour there)
   and documented return values.

v3:
a) Introduce enum rt6_nud_state to get rid of the magic numbers
   (thanks to David Miller).
b) Update and shorten commit message a bit to actualy reflect
   the source.

Reported-by: Pierre Emeriaud <petrus.lt@gmail.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobnx2x: fix tunneling CSUM calculation
Dmitry Kravkov [Thu, 11 Jul 2013 12:48:21 +0000 (15:48 +0300)]
bnx2x: fix tunneling CSUM calculation

Since commit c957d09ffda417f6c8e3d1f10e2b05228607d6d7
"bnx2x: Remove sparse and coccinelle warnings"
driver provided wrong partial csum for HW in tunneing
scenarios.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Pravin Shelar <pshelar@nicira.com>
CC: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Tested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoalx: fix lockdep annotation
Maarten Lankhorst [Thu, 11 Jul 2013 13:53:21 +0000 (15:53 +0200)]
alx: fix lockdep annotation

Move spin_lock_init to be called before the spinlocks are used, preventing a lockdep splat.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agovxlan: Fix kernel crash on rmmod.
Pravin B Shelar [Thu, 11 Jul 2013 18:38:06 +0000 (11:38 -0700)]
vxlan: Fix kernel crash on rmmod.

vxlan exit module unregisters vxlan net and then it unregisters
rtnl ops which triggers vxlan_dellink() from __rtnl_kill_links().
vxlan_dellink() deletes vxlan-dev from vxlan_list which has
list-head in vxlan-net-struct but that is already gone due to
net-unregister. That is how we are getting following crash.

Following commit fixes the crash by fixing module exit path.

BUG: unable to handle kernel paging request at ffff8804102c8000
IP: [<ffffffff812cc5e9>] __list_del_entry+0x29/0xd0
PGD 2972067 PUD 83e019067 PMD 83df97067 PTE 80000004102c8060
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
Modules linked in: ---
CPU: 19 PID: 6712 Comm: rmmod Tainted: GF            3.10.0+ #95
Hardware name: Dell Inc. PowerEdge R620/0KCKR5, BIOS 1.4.8 10/25/2012
task: ffff88080c47c580 ti: ffff88080ac50000 task.ti: ffff88080ac50000
RIP: 0010:[<ffffffff812cc5e9>]  [<ffffffff812cc5e9>]
__list_del_entry+0x29/0xd0
RSP: 0018:ffff88080ac51e08  EFLAGS: 00010206
RAX: ffff8804102c8000 RBX: ffff88040f0d4b10 RCX: dead000000200200
RDX: ffff8804102c8000 RSI: ffff88080ac51e58 RDI: ffff88040f0d4b10
RBP: ffff88080ac51e08 R08: 0000000000000001 R09: 2222222222222222
R10: 2222222222222222 R11: 2222222222222222 R12: ffff88080ac51e58
R13: ffffffffa07b8840 R14: ffffffff81ae48c0 R15: ffff88080ac51e58
FS:  00007f9ef105c700(0000) GS:ffff88082a800000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff8804102c8000 CR3: 00000008227e5000 CR4: 00000000000407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Stack:
 ffff88080ac51e28 ffffffff812cc6a1 2222222222222222 ffff88040f0d4000
 ffff88080ac51e48 ffffffffa07b3311 ffff88040f0d4000 ffffffff81ae49c8
 ffff88080ac51e98 ffffffff81492fc2 ffff88080ac51e58 ffff88080ac51e58
Call Trace:
 [<ffffffff812cc6a1>] list_del+0x11/0x40
 [<ffffffffa07b3311>] vxlan_dellink+0x51/0x70 [vxlan]
 [<ffffffff81492fc2>] __rtnl_link_unregister+0xa2/0xb0
 [<ffffffff8149448e>] rtnl_link_unregister+0x1e/0x30
 [<ffffffffa07b7b7c>] vxlan_cleanup_module+0x1c/0x2f [vxlan]
 [<ffffffff810c9b31>] SyS_delete_module+0x1d1/0x2c0
 [<ffffffff812b8a0e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff81582f42>] system_call_fastpath+0x16/0x1b
Code: eb 9f 55 48 8b 17 48 b9 00 01 10 00 00 00 ad de 48 8b 47 08 48 89
e5 48 39 ca 74 29 48 b9 00 02 20 00 00 00 ad de 48 39 c8 74 7a <4c> 8b
00 4c 39 c7 75 53 4c 8b 42 08 4c 39 c7 75 2b 48 89 42 08
RIP  [<ffffffff812cc5e9>] __list_del_entry+0x29/0xd0
 RSP <ffff88080ac51e08>
CR2: ffff8804102c8000

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years ago9p: fix off by one causing access violations and memory corruption
Sasha Levin [Thu, 11 Jul 2013 17:16:54 +0000 (13:16 -0400)]
9p: fix off by one causing access violations and memory corruption

p9_release_pages() would attempt to dereference one value past the end of
pages[]. This would cause the following crashes:

[ 6293.171817] BUG: unable to handle kernel paging request at ffff8807c96f3000
[ 6293.174146] IP: [<ffffffff8412793b>] p9_release_pages+0x3b/0x60
[ 6293.176447] PGD 79c5067 PUD 82c1e3067 PMD 82c197067 PTE 80000007c96f3060
[ 6293.180060] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[ 6293.180060] Modules linked in:
[ 6293.180060] CPU: 62 PID: 174043 Comm: modprobe Tainted: G        W    3.10.0-next-20130710-sasha #3954
[ 6293.180060] task: ffff8807b803b000 ti: ffff880787dde000 task.ti: ffff880787dde000
[ 6293.180060] RIP: 0010:[<ffffffff8412793b>]  [<ffffffff8412793b>] p9_release_pages+0x3b/0x60
[ 6293.214316] RSP: 0000:ffff880787ddfc28  EFLAGS: 00010202
[ 6293.214316] RAX: 0000000000000001 RBX: ffff8807c96f2ff8 RCX: 0000000000000000
[ 6293.222017] RDX: ffff8807b803b000 RSI: 0000000000000001 RDI: ffffea001c7e3d40
[ 6293.222017] RBP: ffff880787ddfc48 R08: 0000000000000000 R09: 0000000000000000
[ 6293.222017] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001
[ 6293.222017] R13: 0000000000000001 R14: ffff8807cc50c070 R15: ffff8807cc50c070
[ 6293.222017] FS:  00007f572641d700(0000) GS:ffff8807f3600000(0000) knlGS:0000000000000000
[ 6293.256784] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 6293.256784] CR2: ffff8807c96f3000 CR3: 00000007c8e81000 CR4: 00000000000006e0
[ 6293.256784] Stack:
[ 6293.256784]  ffff880787ddfcc8 ffff880787ddfcc8 0000000000000000 ffff880787ddfcc8
[ 6293.256784]  ffff880787ddfd48 ffffffff84128be8 ffff880700000002 0000000000000001
[ 6293.256784]  ffff8807b803b000 ffff880787ddfce0 0000100000000000 0000000000000000
[ 6293.256784] Call Trace:
[ 6293.256784]  [<ffffffff84128be8>] p9_virtio_zc_request+0x598/0x630
[ 6293.256784]  [<ffffffff8115c610>] ? wake_up_bit+0x40/0x40
[ 6293.256784]  [<ffffffff841209b1>] p9_client_zc_rpc+0x111/0x3a0
[ 6293.256784]  [<ffffffff81174b78>] ? sched_clock_cpu+0x108/0x120
[ 6293.256784]  [<ffffffff84122a21>] p9_client_read+0xe1/0x2c0
[ 6293.256784]  [<ffffffff81708a90>] v9fs_file_read+0x90/0xc0
[ 6293.256784]  [<ffffffff812bd073>] vfs_read+0xc3/0x130
[ 6293.256784]  [<ffffffff811a78bd>] ? trace_hardirqs_on+0xd/0x10
[ 6293.256784]  [<ffffffff812bd5a2>] SyS_read+0x62/0xa0
[ 6293.256784]  [<ffffffff841a1a00>] tracesys+0xdd/0xe2
[ 6293.256784] Code: 66 90 48 89 fb 41 89 f5 48 8b 3f 48 85 ff 74 29 85 f6 74 25 45 31 e4 66 0f 1f 84 00 00 00 00 00 e8 eb 14 12 fd 41 ff c4 49 63 c4 <48> 8b 3c c3 48 85 ff 74 05 45 39 e5 75 e7 48 83 c4 08 5b 41 5c
[ 6293.256784] RIP  [<ffffffff8412793b>] p9_release_pages+0x3b/0x60
[ 6293.256784]  RSP <ffff880787ddfc28>
[ 6293.256784] CR2: ffff8807c96f3000
[ 6293.256784] ---[ end trace 50822ee72cd360fc ]---

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge tag 'for-linus-3.11-merge-window-part-2' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Thu, 11 Jul 2013 17:21:23 +0000 (10:21 -0700)]
Merge tag 'for-linus-3.11-merge-window-part-2' of git://git./linux/kernel/git/ericvh/v9fs

Pull second round of 9p patches from Eric Van Hensbergen:
 "Several of these patches were rebased in order to correct style
  issues.  Only stylistic changes were made versus the patches which
  were in linux-next for two weeks.  The rebases have been in linux-next
  for 3 days and have passed my regressions.

  The bulk of these are RDMA fixes and improvements.  There's also some
  additions on the extended attributes front to support some additional
  namespaces and a new option for TCP to force allocation of mount
  requests from a priviledged port"

* tag 'for-linus-3.11-merge-window-part-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  fs/9p: Remove the unused variable "err" in v9fs_vfs_getattr()
  9P: Add cancelled() to the transport functions.
  9P/RDMA: count posted buffers without a pending request
  9P/RDMA: Improve error handling in rdma_request
  9P/RDMA: Do not free req->rc in error handling in rdma_request()
  9P/RDMA: Use a semaphore to protect the RQ
  9P/RDMA: Protect against duplicate replies
  9P/RDMA: increase P9_RDMA_MAXSIZE to 1MB
  9pnet: refactor struct p9_fcall alloc code
  9P/RDMA: rdma_request() needs not allocate req->rc
  9P: Fix fcall allocation for rdma
  fs/9p: xattr: add trusted and security namespaces
  net/9p: add privport option to 9p tcp transport

10 years agoMerge tag 'ecryptfs-3.11-rc1-cleanup' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 11 Jul 2013 17:20:18 +0000 (10:20 -0700)]
Merge tag 'ecryptfs-3.11-rc1-cleanup' of git://git./linux/kernel/git/tyhicks/ecryptfs

Pull eCryptfs updates from Tyler Hicks:
 "Code cleanups and improved buffer handling during page crypto
  operations:
   - Remove redundant code by merging some encrypt and decrypt functions
   - Get rid of a helper page allocation during page decryption by using
     in-place decryption
   - Better use of entire pages during page crypto operations
   - Several code cleanups"

* tag 'ecryptfs-3.11-rc1-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
  Use ecryptfs_dentry_to_lower_path in a couple of places
  eCryptfs: Make extent and scatterlist crypt function parameters similar
  eCryptfs: Collapse crypt_page_offset() into crypt_extent()
  eCryptfs: Merge ecryptfs_encrypt_extent() and ecryptfs_decrypt_extent()
  eCryptfs: Combine page_offset crypto functions
  eCryptfs: Combine encrypt_scatterlist() and decrypt_scatterlist()
  eCryptfs: Decrypt pages in-place
  eCryptfs: Accept one offset parameter in page offset crypto functions
  eCryptfs: Simplify lower file offset calculation
  eCryptfs: Read/write entire page during page IO
  eCryptfs: Use entire helper page during page crypto operations
  eCryptfs: Cocci spatch "memdup.spatch"

10 years agoMerge tag 'jfs-3.11' of git://github.com/kleikamp/linux-shaggy
Linus Torvalds [Thu, 11 Jul 2013 17:19:34 +0000 (10:19 -0700)]
Merge tag 'jfs-3.11' of git://github.com/kleikamp/linux-shaggy

Pull jfs update from Dave Kleikamp:
 "A couple cleanups to JFS for 3.11"

* tag 'jfs-3.11' of git://github.com/kleikamp/linux-shaggy:
  jfs: Update jfs_error
  jfs: fix sparse warning in fs/jfs/xattr.c

10 years agoMerge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux
Linus Torvalds [Thu, 11 Jul 2013 17:17:13 +0000 (10:17 -0700)]
Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux

Pull nfsd changes from Bruce Fields:
 "Changes this time include:

   - 4.1 enabled on the server by default: the last 4.1-specific issues
     I know of are fixed, so we're not going to find the rest of the
     bugs without more exposure.
   - Experimental support for NFSv4.2 MAC Labeling (to allow running
     selinux over NFS), from Dave Quigley.
   - Fixes for some delicate cache/upcall races that could cause rare
     server hangs; thanks to Neil Brown and Bodo Stroesser for extreme
     debugging persistence.
   - Fixes for some bugs found at the recent NFS bakeathon, mostly v4
     and v4.1-specific, but also a generic bug handling fragmented rpc
     calls"

* 'for-3.11' of git://linux-nfs.org/~bfields/linux: (31 commits)
  nfsd4: support minorversion 1 by default
  nfsd4: allow destroy_session over destroyed session
  svcrpc: fix failures to handle -1 uid's
  sunrpc: Don't schedule an upcall on a replaced cache entry.
  net/sunrpc: xpt_auth_cache should be ignored when expired.
  sunrpc/cache: ensure items removed from cache do not have pending upcalls.
  sunrpc/cache: use cache_fresh_unlocked consistently and correctly.
  sunrpc/cache: remove races with queuing an upcall.
  nfsd4: return delegation immediately if lease fails
  nfsd4: do not throw away 4.1 lock state on last unlock
  nfsd4: delegation-based open reclaims should bypass permissions
  svcrpc: don't error out on small tcp fragment
  svcrpc: fix handling of too-short rpc's
  nfsd4: minor read_buf cleanup
  nfsd4: fix decoding of compounds across page boundaries
  nfsd4: clean up nfs4_open_delegation
  NFSD: Don't give out read delegations on creates
  nfsd4: allow client to send no cb_sec flavors
  nfsd4: fail attempts to request gss on the backchannel
  nfsd4: implement minimal SP4_MACH_CRED
  ...

10 years agoMerge tag 'trace-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
Linus Torvalds [Thu, 11 Jul 2013 16:02:09 +0000 (09:02 -0700)]
Merge tag 'trace-3.11' of git://git./linux/kernel/git/rostedt/linux-trace

Pull tracing changes from Steven Rostedt:
 "The majority of the changes here are cleanups for the large changes
  that were added to 3.10, which includes several bug fixes that have
  been marked for stable.

  As for new features, there were a few, but nothing to write to LWN
  about.  These include:

  New function trigger called "dump" and "cpudump" that will cause
  ftrace to dump its buffer to the console when the function is called.
  The difference between "dump" and "cpudump" is that "dump" will dump
  the entire contents of the ftrace buffer, where as "cpudump" will only
  dump the contents of the ftrace buffer for the CPU that called the
  function.

  Another small enhancement is a new sysctl switch called
  "traceoff_on_warning" which, when enabled, will disable tracing if any
  WARN_ON() is triggered.  This is useful if you want to debug what
  caused a warning and do not want to risk losing your trace data by the
  ring buffer overwriting the data before you can disable it.  There's
  also a kernel command line option that will make this enabled at boot
  up called the same thing"

* tag 'trace-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (34 commits)
  tracing: Make tracing_open_generic_{tr,tc}() static
  tracing: Remove ftrace() function
  tracing: Remove TRACE_EVENT_TYPE enum definition
  tracing: Make tracer_tracing_{off,on,is_on}() static
  tracing: Fix irqs-off tag display in syscall tracing
  uprobes: Fix return value in error handling path
  tracing: Fix race between deleting buffer and setting events
  tracing: Add trace_array_get/put() to event handling
  tracing: Get trace_array ref counts when accessing trace files
  tracing: Add trace_array_get/put() to handle instance refs better
  tracing: Protect ftrace_trace_arrays list in trace_events.c
  tracing: Make trace_marker use the correct per-instance buffer
  ftrace: Do not run selftest if command line parameter is set
  tracing/kprobes: Don't pass addr=ip to perf_trace_buf_submit()
  tracing: Use flag buffer_disabled for irqsoff tracer
  tracing/kprobes: Turn trace_probe->files into list_head
  tracing: Fix disabling of soft disable
  tracing: Add missing syscall_metadata comment
  tracing: Simplify code for showing of soft disabled flag
  tracing/kprobes: Kill probe_enable_lock
  ...

10 years agoxfs: Add pquota fields where gquota is used.
Chandra Seetharaman [Thu, 11 Jul 2013 05:00:40 +0000 (00:00 -0500)]
xfs: Add pquota fields where gquota is used.

Add project quota changes to all the places where group quota field
is used:
   * add separate project quota members into various structures
   * split project quota and group quotas so that instead of overriding
     the group quota members incore, the new project quota members are
     used instead
   * get rid of usage of the OQUOTA flag incore, in favor of separate
     group and project quota flags.
   * add a project dquot argument to various functions.

Not using the pquotino field from superblock yet.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
10 years agosh_eth: SH_ETH should depend on HAS_DMA
Geert Uytterhoeven [Wed, 10 Jul 2013 21:03:34 +0000 (23:03 +0200)]
sh_eth: SH_ETH should depend on HAS_DMA

If NO_DMA=y:

drivers/built-in.o: In function `sh_eth_free_dma_buffer':
drivers/net/ethernet/renesas/sh_eth.c:1103: undefined reference to `dma_free_coherent'
drivers/net/ethernet/renesas/sh_eth.c:1110: undefined reference to `dma_free_coherent'
drivers/built-in.o: In function `sh_eth_ring_init':
drivers/net/ethernet/renesas/sh_eth.c:1065: undefined reference to `dma_alloc_coherent'
drivers/net/ethernet/renesas/sh_eth.c:1086: undefined reference to `dma_free_coherent'
drivers/built-in.o: In function `sh_eth_ring_format':
drivers/net/ethernet/renesas/sh_eth.c:988: undefined reference to `dma_map_single'
drivers/built-in.o: In function `sh_eth_txfree':
drivers/net/ethernet/renesas/sh_eth.c:1220: undefined reference to `dma_unmap_single'
drivers/built-in.o: In function `sh_eth_rx':
drivers/net/ethernet/renesas/sh_eth.c:1323: undefined reference to `dma_map_single'
drivers/built-in.o: In function `sh_eth_start_xmit':
drivers/net/ethernet/renesas/sh_eth.c:1954: undefined reference to `dma_map_single'

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv6: in case of link failure remove route directly instead of letting it expire
Hannes Frederic Sowa [Wed, 10 Jul 2013 21:00:57 +0000 (23:00 +0200)]
ipv6: in case of link failure remove route directly instead of letting it expire

We could end up expiring a route which is part of an ecmp route set. Doing
so would invalidate the rt->rt6i_nsiblings calculations and could provoke
the following panic:

[   80.144667] ------------[ cut here ]------------
[   80.145172] kernel BUG at net/ipv6/ip6_fib.c:733!
[   80.145172] invalid opcode: 0000 [#1] SMP
[   80.145172] Modules linked in: 8021q nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ebtable_filter ebtables ip6table_filter ip6_tables
+snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm snd_page_alloc snd_timer virtio_balloon snd soundcore i2c_piix4 i2c_core virtio_net virtio_blk
[   80.145172] CPU: 1 PID: 786 Comm: ping6 Not tainted 3.10.0+ #118
[   80.145172] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[   80.145172] task: ffff880117fa0000 ti: ffff880118770000 task.ti: ffff880118770000
[   80.145172] RIP: 0010:[<ffffffff815f3b5d>]  [<ffffffff815f3b5d>] fib6_add+0x75d/0x830
[   80.145172] RSP: 0018:ffff880118771798  EFLAGS: 00010202
[   80.145172] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88011350e480
[   80.145172] RDX: ffff88011350e238 RSI: 0000000000000004 RDI: ffff88011350f738
[   80.145172] RBP: ffff880118771848 R08: ffff880117903280 R09: 0000000000000001
[   80.145172] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88011350f680
[   80.145172] R13: ffff880117903280 R14: ffff880118771890 R15: ffff88011350ef90
[   80.145172] FS:  00007f02b5127740(0000) GS:ffff88011fd00000(0000) knlGS:0000000000000000
[   80.145172] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   80.145172] CR2: 00007f981322a000 CR3: 00000001181b1000 CR4: 00000000000006e0
[   80.145172] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   80.145172] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   80.145172] Stack:
[   80.145172]  0000000000000001 ffff880100000000 ffff880100000000 ffff880117903280
[   80.145172]  0000000000000000 ffff880119a4cf00 0000000000000400 00000000000007fa
[   80.145172]  0000000000000000 0000000000000000 0000000000000000 ffff88011350f680
[   80.145172] Call Trace:
[   80.145172]  [<ffffffff815eeceb>] ? rt6_bind_peer+0x4b/0x90
[   80.145172]  [<ffffffff815ed985>] __ip6_ins_rt+0x45/0x70
[   80.145172]  [<ffffffff815eee35>] ip6_ins_rt+0x35/0x40
[   80.145172]  [<ffffffff815ef1e4>] ip6_pol_route.isra.44+0x3a4/0x4b0
[   80.145172]  [<ffffffff815ef34a>] ip6_pol_route_output+0x2a/0x30
[   80.145172]  [<ffffffff81616077>] fib6_rule_action+0xd7/0x210
[   80.145172]  [<ffffffff815ef320>] ? ip6_pol_route_input+0x30/0x30
[   80.145172]  [<ffffffff81553026>] fib_rules_lookup+0xc6/0x140
[   80.145172]  [<ffffffff81616374>] fib6_rule_lookup+0x44/0x80
[   80.145172]  [<ffffffff815ef320>] ? ip6_pol_route_input+0x30/0x30
[   80.145172]  [<ffffffff815edea3>] ip6_route_output+0x73/0xb0
[   80.145172]  [<ffffffff815dfdf3>] ip6_dst_lookup_tail+0x2c3/0x2e0
[   80.145172]  [<ffffffff813007b1>] ? list_del+0x11/0x40
[   80.145172]  [<ffffffff81082a4c>] ? remove_wait_queue+0x3c/0x50
[   80.145172]  [<ffffffff815dfe4d>] ip6_dst_lookup_flow+0x3d/0xa0
[   80.145172]  [<ffffffff815fda77>] rawv6_sendmsg+0x267/0xc20
[   80.145172]  [<ffffffff815a8a83>] inet_sendmsg+0x63/0xb0
[   80.145172]  [<ffffffff8128eb93>] ? selinux_socket_sendmsg+0x23/0x30
[   80.145172]  [<ffffffff815218d6>] sock_sendmsg+0xa6/0xd0
[   80.145172]  [<ffffffff81524a68>] SYSC_sendto+0x128/0x180
[   80.145172]  [<ffffffff8109825c>] ? update_curr+0xec/0x170
[   80.145172]  [<ffffffff81041d09>] ? kvm_clock_get_cycles+0x9/0x10
[   80.145172]  [<ffffffff810afd1e>] ? __getnstimeofday+0x3e/0xd0
[   80.145172]  [<ffffffff8152509e>] SyS_sendto+0xe/0x10
[   80.145172]  [<ffffffff8164efd9>] system_call_fastpath+0x16/0x1b
[   80.145172] Code: fe ff ff 41 f6 45 2a 06 0f 85 ca fe ff ff 49 8b 7e 08 4c 89 ee e8 94 ef ff ff e9 b9 fe ff ff 48 8b 82 28 05 00 00 e9 01 ff ff ff <0f> 0b 49 8b 54 24 30 0d 00 00 40 00 89 83 14 01 00 00 48 89 53
[   80.145172] RIP  [<ffffffff815f3b5d>] fib6_add+0x75d/0x830
[   80.145172]  RSP <ffff880118771798>
[   80.387413] ---[ end trace 02f20b7a8b81ed95 ]---
[   80.390154] Kernel panic - not syncing: Fatal exception in interrupt

Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoRevert "Makefile: Fix install error with make -j option"
Linus Torvalds [Thu, 11 Jul 2013 02:02:51 +0000 (19:02 -0700)]
Revert "Makefile: Fix install error with make -j option"

This reverts commit d2aae8477cd00325bb7c7c7e95be488088900c48.

It is completely and utterly broken.  Module install should not build
any files, and adding broken dependencies to "help" it build files is
complete and utter sh*t.

The kernel should not be built by root, and "make install" and "make
module_install" (that for obvious reasons need to be run as root)
absolutely must not build any files.  They should only ever copy the
already-built files over.

So having dependencies for the install targets is wrong, wrong, wrong.

If you try to install a kernel without building it first, you *should*
get errors. The build system shouldn't try to help root build the files.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agomacvtap: correctly linearize skb when zerocopy is used
Jason Wang [Wed, 10 Jul 2013 05:43:28 +0000 (13:43 +0800)]
macvtap: correctly linearize skb when zerocopy is used

Userspace may produce vectors greater than MAX_SKB_FRAGS. When we try to
linearize parts of the skb to let the rest of iov to be fit in
the frags, we need count copylen into linear when calling macvtap_alloc_skb()
instead of partly counting it into data_len. Since this breaks
zerocopy_sg_from_iovec() since its inner counter assumes nr_frags should
be zero at beginning. This cause nr_frags to be increased wrongly without
setting the correct frags.

This bug were introduced from b92946e2919134ebe2a4083e4302236295ea2a73
(macvtap: zerocopy: validate vectors before building skb).

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotuntap: correctly linearize skb when zerocopy is used
Jason Wang [Wed, 10 Jul 2013 05:43:27 +0000 (13:43 +0800)]
tuntap: correctly linearize skb when zerocopy is used

Userspace may produce vectors greater than MAX_SKB_FRAGS. When we try to
linearize parts of the skb to let the rest of iov to be fit in
the frags, we need count copylen into linear when calling tun_alloc_skb()
instead of partly counting it into data_len. Since this breaks
zerocopy_sg_from_iovec() since its inner counter assumes nr_frags should
be zero at beginning. This cause nr_frags to be increased wrongly without
setting the correct frags.

This bug were introduced from 0690899b4d4501b3505be069b9a687e68ccbe15b
(tun: experimental zero copy tx support)

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoifb: fix rcu_sched self-detected stalls
dingtianhong [Wed, 10 Jul 2013 04:04:02 +0000 (12:04 +0800)]
ifb: fix rcu_sched self-detected stalls

According to the commit 16b0dc29c1af9df341428f4c49ada4f626258082
(dummy: fix rcu_sched self-detected stalls)

Eric Dumazet fix the problem in dummy, but the ifb will occur the
same problem like the dummy modules.

Trying to "modprobe ifb numifbs=30000" triggers :

INFO: rcu_sched self-detected stall on CPU

After this splat, RTNL is locked and reboot is needed.

We must call cond_resched() to avoid this, even holding RTNL.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge tag 'kvm-3.11-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Thu, 11 Jul 2013 01:17:41 +0000 (18:17 -0700)]
Merge tag 'kvm-3.11-2' of git://git./virt/kvm/kvm

Pull more KVM changes from Gleb Natapov:
 "A fix for a bug that prevents some guests from working on old Intel
  CPUs and a patch that integrates ARM64 KVM, merged via ARM64 tree,
  into Kconfig."

* tag 'kvm-3.11-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: VMX: mark unusable segment as nonpresent
  arm64: KVM: Kconfig integration

10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Thu, 11 Jul 2013 01:16:34 +0000 (18:16 -0700)]
Merge git://git./linux/kernel/git/davem/sparc

Pull Sparc bugfixes from David Miller:
 "Four bug fixes:

   1) Enable snoop tags properly on Sparc32/LEON, from Andreas Larsson

   2) strcpy() length check fix from Chen Gang.

   3) Forgotten unregister_netdev() in sunvnet driver, from Dave
      Kleikamp.

   4) Fix broken assembler offsets used in vm_area_struct accesses on
      sparc32, from Olivier DANET."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  [PATCH] sparc32: vm_area_struct access for old Sun SPARCs.
  sunvnet: vnet_port_remove must call unregister_netdev
  sparc32, leon: Require separate snoop tags set to regard snooping to be enabled
  arch: sparc: kernel: check the memory length before use strcpy().

10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
Linus Torvalds [Thu, 11 Jul 2013 01:15:41 +0000 (18:15 -0700)]
Merge git://git./linux/kernel/git/davem/ide

Pull IDE updates from David Miller:
 "Just a few small things:

   1) module_platform_driver_probe() conversions from Jingoo Han.

   2) module_pci_driver() conversion from Libo Chen.

   3) PIO size calculation fix from Steven J Hill"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide:
  ide: Fix IDE PIO size calculation
  drivers/ide/delkin_cb: Convert to module_pci_driver
  ide: gayle: use module_platform_driver_probe()
  ide: tx4939ide: use module_platform_driver_probe()
  ide: tx4938ide: use module_platform_driver_probe()

10 years agoMerge branch 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 11 Jul 2013 01:14:24 +0000 (18:14 -0700)]
Merge branch 'core-printk-for-linus' of git://git./linux/kernel/git/tip/tip

Pull printk locking fix from Thomas Gleixner:
 "A single lock ordering fix in the printk code"

* 'core-printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  printk: Fix rq->lock vs logbuf_lock unlock lock inversion

10 years agoMerge branch 'akpm' (patches from Andrew Morton)
Linus Torvalds [Thu, 11 Jul 2013 01:11:43 +0000 (18:11 -0700)]
Merge branch 'akpm' (patches from Andrew Morton)

Merge more patches from Andrew Morton:
 "The rest of MM"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm: remove free_area_cache
  zswap: add documentation
  zswap: add to mm/
  zbud: add to mm/

10 years agomm: remove free_area_cache
Michel Lespinasse [Wed, 10 Jul 2013 23:05:12 +0000 (16:05 -0700)]
mm: remove free_area_cache

Since all architectures have been converted to use vm_unmapped_area(),
there is no remaining use for the free_area_cache.

Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agozswap: add documentation
Seth Jennings [Wed, 10 Jul 2013 23:05:05 +0000 (16:05 -0700)]
zswap: add documentation

Add the documentation file for the zswap functionality

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Jenifer Hopper <jhopper@us.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Joe Perches <joe@perches.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Hugh Dickens <hughd@google.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agozswap: add to mm/
Seth Jennings [Wed, 10 Jul 2013 23:05:03 +0000 (16:05 -0700)]
zswap: add to mm/

zswap is a thin backend for frontswap that takes pages that are in the
process of being swapped out and attempts to compress them and store
them in a RAM-based memory pool.  This can result in a significant I/O
reduction on the swap device and, in the case where decompressing from
RAM is faster than reading from the swap device, can also improve
workload performance.

It also has support for evicting swap pages that are currently
compressed in zswap to the swap device on an LRU(ish) basis.  This
functionality makes zswap a true cache in that, once the cache is full,
the oldest pages can be moved out of zswap to the swap device so newer
pages can be compressed and stored in zswap.

This patch adds the zswap driver to mm/

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Jenifer Hopper <jhopper@us.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Joe Perches <joe@perches.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Hugh Dickens <hughd@google.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agozbud: add to mm/
Seth Jennings [Wed, 10 Jul 2013 23:04:55 +0000 (16:04 -0700)]
zbud: add to mm/

zbud is an special purpose allocator for storing compressed pages.  It
is designed to store up to two compressed pages per physical page.
While this design limits storage density, it has simple and
deterministic reclaim properties that make it preferable to a higher
density approach when reclaim will be used.

zbud works by storing compressed pages, or "zpages", together in pairs
in a single memory page called a "zbud page".  The first buddy is "left
justifed" at the beginning of the zbud page, and the last buddy is
"right justified" at the end of the zbud page.  The benefit is that if
either buddy is freed, the freed buddy space, coalesced with whatever
slack space that existed between the buddies, results in the largest
possible free region within the zbud page.

zbud also provides an attractive lower bound on density.  The ratio of
zpages to zbud pages can not be less than 1.  This ensures that zbud can
never "do harm" by using more pages to store zpages than the
uncompressed zpages would have used on their own.

This implementation is a rewrite of the zbud allocator internally used
by zcache in the driver/staging tree.  The rewrite was necessary to
remove some of the zcache specific elements that were ingrained
throughout and provide a generic allocation interface that can later be
used by zsmalloc and others.

This patch adds zbud to mm/ for later use by zswap.

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Cc: Jenifer Hopper <jhopper@us.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <jweiner@redhat.com>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Joe Perches <joe@perches.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Hugh Dickens <hughd@google.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agor8169: add a new chip for RTL8411
hayeswang [Mon, 8 Jul 2013 09:09:01 +0000 (17:09 +0800)]
r8169: add a new chip for RTL8411

Add a new chip for RTL8411 series.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge "net: finish renaming lls to busy poll"
David S. Miller [Thu, 11 Jul 2013 00:10:40 +0000 (17:10 -0700)]
Merge "net: finish renaming lls to busy poll"

Eliezer Tamir says:

====================
Here are three patches that complete the rename of lls to busy-poll

1. rename include/net/ll_poll.h to include/net/busy_poll.h
2. Rename ndo_ll_poll to ndo_busy_poll.
   Rename sk_mark_ll to sk_mark_napi_id.
   Rename skb_mark_ll to skb_mark_napi_id.
   Correct all useres of these functions.
   Update comments and defines  in include/net/busy_poll.h
3. Rename LL_SO to BUSY_POLL_SO
   Rename sysctl_net_ll_{read,poll} to sysctl_busy_{read,poll}
   Fix up users of these variables.
   Fix documentation for sysctl.

v2 fixed forgetting the ndo changes in v1
v3 is a resend with -M
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: rename busy poll socket op and globals
Eliezer Tamir [Wed, 10 Jul 2013 14:13:36 +0000 (17:13 +0300)]
net: rename busy poll socket op and globals

Rename LL_SO to BUSY_POLL_SO
Rename sysctl_net_ll_{read,poll} to sysctl_busy_{read,poll}
Fix up users of these variables.
Fix documentation for sysctl.

a patch for the socket.7  man page will follow separately,
because of limitations of my mail setup.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: rename ll methods to busy-poll
Eliezer Tamir [Wed, 10 Jul 2013 14:13:26 +0000 (17:13 +0300)]
net: rename ll methods to busy-poll

Rename ndo_ll_poll to ndo_busy_poll.
Rename sk_mark_ll to sk_mark_napi_id.
Rename skb_mark_ll to skb_mark_napi_id.
Correct all useres of these functions.
Update comments and defines  in include/net/busy_poll.h

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: rename include/net/ll_poll.h to include/net/busy_poll.h
Eliezer Tamir [Wed, 10 Jul 2013 14:13:17 +0000 (17:13 +0300)]
net: rename include/net/ll_poll.h to include/net/busy_poll.h

Rename the file and correct all the places where it is included.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Wed, 10 Jul 2013 23:08:06 +0000 (16:08 -0700)]
Merge branch 'misc' of git://git./linux/kernel/git/mmarek/kbuild

Pull coccinelle updates from Michal Marek:
 "The misc branch is reserved for Coccinelle this time:

   - 'report' is the default mode
   - MAINTAINERS update for Coccinelle
   - documentation udate
   - use new option format for spatch(1)
   - J=<n> variable to mimic make -j for coccicheck
   - check for missing pci_free_consistent() calls

  There are some patches for rpm-pkg and deb-pkg waiting for the
  3.12-rc1 merge window"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  Coccinelle: Update information about the minimal version required
  Coccinelle: Update the options used to the new option scheme
  scripts: Coccinelle script for pci_free_consistent()
  Coccinelle: Update the documentation
  Coccinelle: Update section of MAINTAINERS
  coccicheck: span checks across CPUs
  scripts/coccinelle: check for field address argument to kfree
  Coccinelle: Update the Coccinelle section of MAINTAINERS
  Coccinelle: Make 'report' the default mode

10 years agoMerge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Wed, 10 Jul 2013 23:06:46 +0000 (16:06 -0700)]
Merge branch 'kconfig' of git://git./linux/kernel/git/mmarek/kbuild

Pull kconfig updates from Michal Marek:
 - dependency solver fix for make defconfig
 - randconfig fixes, one of which had to be reverted again
 - more user-friendly sorting of search results
 - hex and range keywords support longs
 - fix for [mn]conf not to rely on particular behavior of the LINES and
   COLS variables
 - cleanup of magic constants in kconfig/lxdialog
 - [mn]conf formatting fixes
 - fix for scripts/config's help text in out-of-tree usage (under a
   different name)

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig: allow "hex" and "range" to support longs
  Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"
  kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG
  kconfig: loop as long as we changed some symbols in randconfig
  kconfig/[mn]conf: make it explicit in the search box that a regexp is possible
  kconfig: sort found symbols by relevance
  kconfig/conf: print the seed used to initialise the RNG for randconfig
  kconfig/conf: accept a base-16 seed for randconfig
  kconfig/conf: fix randconfig setting multiple symbols in a choice
  scripts/config: replace hard-coded script name by a dynamic value
  mconf/nconf: mark empty menus/menuconfigs different from non-empty ones
  nconf: use function calls instead of ncurses' variables LINES and COLS
  mconf: use function calls instead of ncurses' variables LINES and COLS
  kconfig/lxdialog: handle newline characters in print_autowrap()
  kconfig/lxdialog: Use new mininimum resize definitions in conf_choice()
  kconfig/lxdialog: Add definitions for mininimum (re)size values
  kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on

10 years agoMerge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Linus Torvalds [Wed, 10 Jul 2013 23:05:40 +0000 (16:05 -0700)]
Merge branch 'kbuild' of git://git./linux/kernel/git/mmarek/kbuild

Pull kbuild updates from Michal Marek:
 - fix for make headers_install argv explosion with too long path
 - scripts/setlocalversion does not call git update-index needlessly
 - fix for the src.rpm produced by make rpm-pkg.  The new make
   image_name can be useful also for other packaging tools.
 - scripts/mod/devicetable-offsets.o is not rebuilt during each make run
 - make modules_install dependency fix
 - scripts/sortextable portability fix
 - fix for kbuild to generate the output directory for all object files
   in subdirs.
 - a couple of minor fixes

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: create directory for dir/file.o
  tools/include: use stdint types for user-space byteshift headers
  Makefile: Fix install error with make -j option
  Fix a build warning in scripts/mod/file2alias.c
  improve modalias building
  scripts/mod: Spelling s/DEVICEVTABLE/DEVICETABLE/
  kbuild: fix error when building from src rpm
  scripts/setlocalversion on write-protected source tree
  Makefile.lib: align DTB quiet_cmd
  kbuild: fix make headers_install when path is too long

10 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 10 Jul 2013 23:04:38 +0000 (16:04 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
 "Two small fixlets"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Fix interrupt handler timing harness
  perf/x86/amd: Do not print an error when the device is not present

10 years agodm: add switch target
Jim Ramsay [Wed, 10 Jul 2013 22:41:19 +0000 (23:41 +0100)]
dm: add switch target

dm-switch is a new target that maps IO to underlying block devices
efficiently when there is a large number of fixed-sized address regions
but there is no simple pattern to allow for a compact mapping
representation such as dm-stripe.

Though we have developed this target for a specific storage device, Dell
EqualLogic, we have made an effort to keep it as general purpose as
possible in the hope that others may benefit.

Originally developed by Jim Ramsay. Simplified by Mikulas Patocka.

Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm: update maintainers
Alasdair G Kergon [Wed, 10 Jul 2013 22:41:19 +0000 (23:41 +0100)]
dm: update maintainers

Add Mike Snitzer as an additional device-mapper maintainer.
Recognise uapi dm-*.h include files as device-mapper files.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: Yann Droneaud <ydroneaud@opteya.com>
Cc: Mike Snitzer <snitzer@redhat.com>
10 years agodm: optimize reorder structure
Mikulas Patocka [Wed, 10 Jul 2013 22:41:18 +0000 (23:41 +0100)]
dm: optimize reorder structure

This reorder actually improves performance by 20% (from 39.1s to 32.8s)
on x86-64 quad core Opteron.

I have no explanation for this, possibly it makes some other entries are
better cache-aligned.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm: optimize use SRCU and RCU
Mikulas Patocka [Wed, 10 Jul 2013 22:41:18 +0000 (23:41 +0100)]
dm: optimize use SRCU and RCU

This patch removes "io_lock" and "map_lock" in struct mapped_device and
"holders" in struct dm_table and replaces these mechanisms with
sleepable-rcu.

Previously, the code would call "dm_get_live_table" and "dm_table_put" to
get and release table. Now, the code is changed to call "dm_get_live_table"
and "dm_put_live_table". dm_get_live_table locks sleepable-rcu and
dm_put_live_table unlocks it.

dm_get_live_table_fast/dm_put_live_table_fast can be used instead of
dm_get_live_table/dm_put_live_table. These *_fast functions use
non-sleepable RCU, so the caller must not block between them.

If the code changes active or inactive dm table, it must call
dm_sync_table before destroying the old table.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm bufio: submit writes outside lock
Mikulas Patocka [Wed, 10 Jul 2013 22:41:18 +0000 (23:41 +0100)]
dm bufio: submit writes outside lock

This patch changes dm-bufio so that it submits write I/Os outside of the
lock. If the number of submitted buffers is greater than the number of
requests on the target queue, submit_bio blocks. We want to block outside
of the lock to improve latency of other threads that may need the lock.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm cache: fix arm link errors with inline
Mikulas Patocka [Wed, 10 Jul 2013 22:41:17 +0000 (23:41 +0100)]
dm cache: fix arm link errors with inline

Use __always_inline to avoid a link failure with gcc 4.6 on ARM.
gcc 4.7 is OK.

It creates a function block_div.part.8, it references __udivdi3 and
__umoddi3 and it is never called. The references to __udivdi3 and
__umoddi3 cause a link failure.

Reported-by: Rob Herring <robherring2@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm verity: use __ffs and __fls
Mikulas Patocka [Wed, 10 Jul 2013 22:41:17 +0000 (23:41 +0100)]
dm verity: use __ffs and __fls

This patch changes ffs() to __ffs() and fls() to __fls() which don't add
one to the result.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm flakey: correct ctr alloc failure mesg
Alasdair G Kergon [Wed, 10 Jul 2013 22:41:17 +0000 (23:41 +0100)]
dm flakey: correct ctr alloc failure mesg

Remove the reference to the "linear" target from the error message
issued when allocation fails in the flakey target.

Cc: Robin Dong <sanbai@taobao.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm verity: remove pointless comparison
Mikulas Patocka [Wed, 10 Jul 2013 22:41:17 +0000 (23:41 +0100)]
dm verity: remove pointless comparison

Remove num < 0 test in verity_ctr because num is unsigned.
(Found by Coverity.)

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm: use __GFP_HIGHMEM in __vmalloc
Mikulas Patocka [Wed, 10 Jul 2013 22:41:16 +0000 (23:41 +0100)]
dm: use __GFP_HIGHMEM in __vmalloc

Use __GFP_HIGHMEM in __vmalloc.

Pages allocated with __vmalloc can be allocated in high memory that is not
directly mapped to kernel space, so use __GFP_HIGHMEM just like vmalloc
does. This patch reduces memory pressure slightly because pages can be
allocated in the high zone.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm verity: fix inability to use a few specific devices sizes
Mikulas Patocka [Wed, 10 Jul 2013 22:41:16 +0000 (23:41 +0100)]
dm verity: fix inability to use a few specific devices sizes

Fix a boundary condition that caused failure for certain device sizes.

The problem is reported at
  http://code.google.com/p/cryptsetup/issues/detail?id=160

For certain device sizes the number of hashes at a specific level was
calculated incorrectly.

It happens for example for a device with data and metadata block size 4096
that has 16385 blocks and algorithm sha256.

The user can test if he is affected by this bug by running the
"veritysetup verify" command and also by activating the dm-verity kernel
driver and reading the whole block device. If it passes without an error,
then the user is not affected.

The condition for the bug is:

Split the total number of data blocks (data_block_bits) into bit strings,
each string has hash_per_block_bits bits. hash_per_block_bits is
rounddown(log2(metadata_block_size/hash_digest_size)). Equivalently, you
can say that you convert data_blocks_bits to 2^hash_per_block_bits base.

If there some zero bit string below the most significant bit string and at
least one bit below this zero bit string is set, then the bug happens.

The same bug exists in the userspace veritysetup tool, so you must use
fixed veritysetup too if you want to use devices that are affected by
this boundary condition.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org # 3.4+
Cc: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm ioctl: set noio flag to avoid __vmalloc deadlock
Mikulas Patocka [Wed, 10 Jul 2013 22:41:15 +0000 (23:41 +0100)]
dm ioctl: set noio flag to avoid __vmalloc deadlock

Set noio flag while calling __vmalloc() because it doesn't fully respect
gfp flags to avoid a possible deadlock (see commit
502624bdad3dba45dfaacaf36b7d83e39e74b2d2).

This should be backported to stable kernels 3.8 and newer. The kernel 3.8
doesn't have memalloc_noio_save(), so we should set and restore process
flag PF_MEMALLOC instead.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agodm mpath: fix ioctl deadlock when no paths
Hannes Reinecke [Wed, 10 Jul 2013 22:41:15 +0000 (23:41 +0100)]
dm mpath: fix ioctl deadlock when no paths

When multipath needs to retry an ioctl the reference to the
current live table needs to be dropped. Otherwise a deadlock
occurs when all paths are down:
- dm_blk_ioctl takes a reference to the current table
  and spins in multipath_ioctl().
- A new table is being loaded, but upon resume the process
  hangs in dm_table_destroy() waiting for references to
  drop to zero.

With this patch the reference to the old table is dropped
prior to retry, thereby avoiding the deadlock.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
10 years agoMerge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 10 Jul 2013 21:51:41 +0000 (14:51 -0700)]
Merge tag 'modules-next-for-linus' of git://git./linux/kernel/git/rusty/linux

Pull module updates from Rusty Russell:
 "Nothing interesting.  Except the most embarrassing bugfix ever.  But
  let's ignore that"

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  module: cleanup call chain.
  module: do percpu allocation after uniqueness check.  No, really!
  modules: don't fail to load on unknown parameters.
  ABI: Clarify when /sys/module/MODULENAME is created
  There is no /sys/parameters
  module: don't modify argument of module_kallsyms_lookup_name()

10 years agoMerge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 10 Jul 2013 21:50:58 +0000 (14:50 -0700)]
Merge tag 'virtio-next-for-linus' of git://git./linux/kernel/git/rusty/linux

Pull virtio updates from Rusty Russell:
 "No real surprises"

* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  MAINTAINERS: add tools/virtio/ under virtio
  tools/virtio: move module license stub to module.h
  virtio: include asm/barrier explicitly
  virtio: VIRTIO_F_ANY_LAYOUT feature
  lguest: fix example launcher compilation for broken glibc headers.
  virtio-net: fix the race between channels setting and refill
  tools/lguest: real barriers.
  tools/lguest: fix missing rmb().
  virtio_balloon: leak_balloon(): only tell host if we got pages deflated
  virtio-pci: fix leaks of msix_affinity_masks
  Fix comment typo "CONFIG_PAE"

10 years agoMerge tag 'vfio-v3.11' of git://github.com/awilliam/linux-vfio
Linus Torvalds [Wed, 10 Jul 2013 21:50:08 +0000 (14:50 -0700)]
Merge tag 'vfio-v3.11' of git://github.com/awilliam/linux-vfio

Pull vfio updates from Alex Williamson:
 "Largely hugepage support for vfio/type1 iommu and surrounding cleanups
  and fixes"

* tag 'vfio-v3.11' of git://github.com/awilliam/linux-vfio:
  vfio/type1: Fix leak on error path
  vfio: Limit group opens
  vfio/type1: Fix missed frees and zero sized removes
  vfio: fix documentation
  vfio: Provide module option to disable vfio_iommu_type1 hugepage support
  vfio: hugepage support for vfio_iommu_type1
  vfio: Convert type1 iommu to use rbtree

10 years agoMerge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Linus Torvalds [Wed, 10 Jul 2013 21:48:50 +0000 (14:48 -0700)]
Merge tag 'for_linus' of git://git./linux/kernel/git/mst/vhost

Pull vhost fixes and cleanups from Michael S Tsirkin:
 "This includes some fixes and cleanups for vhost net and scsi drivers"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  vhost/test: update test after vhost cleanups
  vhost: Make local function static
  vhost: Make vhost a separate module
  vhost-scsi: Rename struct tcm_vhost_cmd *tv_cmd to *cmd
  vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg
  vhost-scsi: Make func indention more consistent
  vhost-scsi: Rename struct vhost_scsi *s to *vs
  vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration
  vhost: Simplify dev->vqs[i] access
  vhost-net: fix use-after-free in vhost_net_flush

10 years agoMerge tag 'iommu-updates-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 10 Jul 2013 21:46:40 +0000 (14:46 -0700)]
Merge tag 'iommu-updates-v3.11' of git://git./linux/kernel/git/joro/iommu

Pull IOMMU updates from Joerg Roedel:
 "A few updates this time, most important and exiciting (to me) is:

   - The new ARM SMMU driver.  This is a common IOMMU driver that will
     hopefully be used in a lot of upcoming ARM chips.  So the mess in
     the past where every SOC had its own IOMMU will be over.

  Besides that:

   - Some important fixes in the IOMMU unmap path.  There are fixes in
     the common code and also in the AMD IOMMU driver.
   - Other random fixes"

* tag 'iommu-updates-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  MAINTAINERS: add entry for ARM system MMU driver
  iommu/arm: Add support for ARM Ltd. System MMU architecture
  documentation/iommu: Add description of ARM System MMU binding
  iommu: Use %pa and %zx instead of casting
  iommu/amd: Only unmap large pages from the first pte
  iommu: Fix compiler warning on pr_debug
  iommu/amd: Fix memory leak in free_pagetable
  iommu: Split iommu_unmaps
  iommu/{vt-d,amd}: Remove multifunction assumption around grouping
  iommu/omap: fix checkpatch warnings in omap iommu code
  iommu/omap: fix printk formats for dma_addr_t
  iommu/vt-d: DMAR reporting table needs at least one DRHD
  iommu/vt-d: Downgrade the warning if enabling irq remapping fails

10 years agodrm: avoid warning in drm_load_edid_firmware()
Linus Torvalds [Wed, 10 Jul 2013 21:21:46 +0000 (14:21 -0700)]
drm: avoid warning in drm_load_edid_firmware()

Use "const char *" instead of "char *" in order to avoid this warning:

  drivers/gpu/drm/drm_edid_load.c: In function ‘drm_load_edid_firmware’:
  drivers/gpu/drm/drm_edid_load.c:245:25: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years ago[PATCH] sparc32: vm_area_struct access for old Sun SPARCs.
Olivier DANET [Wed, 10 Jul 2013 20:56:10 +0000 (13:56 -0700)]
[PATCH] sparc32: vm_area_struct access for old Sun SPARCs.

Commit e4c6bfd2d79d063017ab19a18915f0bc759f32d9 ("mm: rearrange
vm_area_struct for fewer cache misses") changed the layout of the
vm_area_struct structure, it broke several SPARC32 assembly routines
which used numerical constants for accessing the vm_mm field.

This patch defines the VMA_VM_MM constant to replace the immediate values.

Signed-off-by: Olivier DANET <odanet@caramail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosunvnet: vnet_port_remove must call unregister_netdev
Dave Kleikamp [Mon, 1 Jul 2013 21:49:22 +0000 (16:49 -0500)]
sunvnet: vnet_port_remove must call unregister_netdev

The missing call to unregister_netdev() leaves the interface active
after the driver is unloaded by rmmod.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosparc32, leon: Require separate snoop tags set to regard snooping to be enabled
Andreas Larsson [Mon, 1 Jul 2013 14:16:07 +0000 (16:16 +0200)]
sparc32, leon: Require separate snoop tags set to regard snooping to be enabled

Even if data snooping is enabled, without separate snoop tags snooping will not
work when the MMU is enabled.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoarch: sparc: kernel: check the memory length before use strcpy().
Chen Gang [Sat, 22 Jun 2013 05:26:09 +0000 (13:26 +0800)]
arch: sparc: kernel: check the memory length before use strcpy().

For the related next strcpy(), the destination length is less than 512,
but the source maximize length may be 'OPROMMAXPARAM' (4096) which is
more than 512.

One work flow may:
  openprom_sunos_ioctl() ->  if (cmd == OPROMSETOPT)
    getstrings() ->  will alloc buffer with size 'OPROMMAXPARAM'.
    opromsetopt() ->  devide the buffer into 'var' and 'value'
      of_set_property() -> pass
        prom_setprop() -> pass
          ldom_set_var()

And do not mind the additional 4 alignment buffer increasing, since
'sizeof(pkt) - sizeof(pkt.header)' is 4 alignment at least.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoSUNRPC: Fix a deadlock in rpc_client_register()
Trond Myklebust [Wed, 10 Jul 2013 19:33:01 +0000 (15:33 -0400)]
SUNRPC: Fix a deadlock in rpc_client_register()

Commit 384816051ca9125cd54750e59c780c2a2655fa4f (SUNRPC: fix races on
PipeFS MOUNT notifications) introduces a regression when we call
rpc_setup_pipedir() with RPCSEC_GSS as the auth flavour.

By calling rpcauth_create() while holding the sn->pipefs_sb_lock, we
end up deadlocking in gss_pipes_dentries_create_net().
Fix is to register the client and release the mutex before calling
rpcauth_create().

Reported-by: Weston Andros Adamson <dros@netapp.com>
Tested-by: Weston Andros Adamson <dros@netapp.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Cc: <stable@vger.kernel.org> # : 3848160: SUNRPC: fix races on PipeFS MOUNT
Cc: <stable@vger.kernel.org> # : e73f4cc: SUNRPC: split client creation
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
10 years agox86 platform drivers: fix gpio leak
Libo Chen [Tue, 9 Jul 2013 12:34:28 +0000 (20:34 +0800)]
x86 platform drivers: fix gpio leak

when request_irq fails, we should release gpiochip

v2:
  fix warning: ignoring return value of 'gpiochip_remove

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agotoshiba_acpi: Add dependency on SERIO_I8042
Seth Forshee [Wed, 3 Jul 2013 13:14:16 +0000 (08:14 -0500)]
toshiba_acpi: Add dependency on SERIO_I8042

Configuring this option as a module with ACPI_TOSHIBA built-in
results in the following errors:

   drivers/built-in.o: In function `toshiba_acpi_remove':
>> toshiba_acpi.c:(.text+0x314bb0): undefined reference to `i8042_remove_filter'
   drivers/built-in.o: In function `toshiba_acpi_add':
>> toshiba_acpi.c:(.devinit.text+0xb822): undefined reference to `i8042_install_filter'
>> toshiba_acpi.c:(.devinit.text+0xb98b): undefined reference to `i8042_remove_filter'

Add a dependency to prevent ACPI_TOSHIBA from being built-in when
SERIO_I8042=m.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agoasus-nb-wmi: set wapf=4 for ASUSTeK COMPUTER INC. 1015E/U
AceLan Kao [Wed, 3 Jul 2013 06:35:15 +0000 (14:35 +0800)]
asus-nb-wmi: set wapf=4 for ASUSTeK COMPUTER INC. 1015E/U

Need to set wapf to 4 for ASUSTeK COMPUTER INC. 1015E/U, so that
user can toggle wifi function through function key correctly.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agoAdd trivial driver to disable Intel Smart Connect
Matthew Garrett [Wed, 3 Jul 2013 04:50:13 +0000 (00:50 -0400)]
Add trivial driver to disable Intel Smart Connect

Intel Smart Connect is an Intel-specific ACPI interface for configuring
devices to wake up at regular intervals so they can pull down mail or other
internet updates, and then go to sleep again. If a user enables this in
Windows and then reboots into Linux, the device may wake up if it's put to
sleep. Since there's no Linux userland support for any of this, the machine
will then remain awake until something else puts it back to sleep.

I haven't figured out all that much about how this works (there's a bunch
of different ACPI calls available on the device), but this seems to be
enough to turn it off. We can add more features to this driver if anyone
ever cares about figuring out what the rest of the calls do or writing some
Linux userspace to implement the rest of it.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agoAdd support driver for Intel Rapid Start Technology
Matthew Garrett [Tue, 2 Jul 2013 22:41:03 +0000 (18:41 -0400)]
Add support driver for Intel Rapid Start Technology

Intel Rapid Start Technology is a firmware-based suspend-to-disk
implementation. Once placed in S3, the device will wake once either a
timeout elapses or the battery reaches a critical level. It will then resume
to the firmware and copy the contents of RAM to a specialised partition, and
then power off the machine. If the user turns the machine back on the
firmware will copy the contents of the partition back to RAM and then resume
from S3 as normal.

This driver provides an interface for configuring the wakeup events and
timeout. It still requires firmware support and an appropriate suspend
partition.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agohp-wmi: add supports for POST code error
Alex Hung [Thu, 13 Jun 2013 08:46:25 +0000 (16:46 +0800)]
hp-wmi: add supports for POST code error

HP laptops include a POST code error query 0x2A that reports
which point BIOS fails to boot at. The error code is kept in CMOS
until it is cleared.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agoasus-wmi: control wlan-led only if wapf == 4
AceLan Kao [Thu, 30 May 2013 02:31:50 +0000 (10:31 +0800)]
asus-wmi: control wlan-led only if wapf == 4

Controlling the wlan led seems to have some side effects to the machines
with wapf value is not equal to 4. It will make the keyboard backlight
out of order.
So, the patch will enable the wlan led function only if the wapf == 4.

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

Reported-by: Mirto Silvio Busico <m.busico@ieee.org>
Tested-by: Karol Herbst <karolherbst@me.com>
Tested-by: drunkenbatman <drunkenbatman@gmail.com>
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agodrivers/platform/x86/intel_ips: Convert to module_pci_driver
Libo Chen [Mon, 27 May 2013 02:31:33 +0000 (10:31 +0800)]
drivers/platform/x86/intel_ips: Convert to module_pci_driver

use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agoasus-nb-wmi: ignore ALS notification key code
Viktar Vauchkevich [Thu, 23 May 2013 04:17:11 +0000 (07:17 +0300)]
asus-nb-wmi: ignore ALS notification key code

Ignore Ambient Light Sensor notification key code 0xC6 found in ASUS UX31a.
When the illuminance changes dmesg shows:
[10814.939979] asus_wmi: Unknown key c6 pressed

Signed-off-by: Viktar Vauchkevich <victorenator@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agoasus-wmi: append newline to messages
vic [Wed, 22 May 2013 18:32:10 +0000 (21:32 +0300)]
asus-wmi: append newline to messages

Append newline to messages.

Signed-off-by: Viktar Vauchkevich <victorenator@gmail.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
10 years agox86: asus-laptop: fix invalid point access
Libo Chen [Mon, 20 May 2013 02:30:24 +0000 (10:30 +0800)]
x86: asus-laptop: fix invalid point access

asus->name is null or point to const string,so it is not suitable to kfree it.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>