diff options
author | Anton Blanchard <anton@samba.org> | 2011-05-10 12:17:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-12 00:09:34 -0400 |
commit | 21ccc7936dac5ca9b3e2838bbc112a60f34e18b3 (patch) | |
tree | b711735fea08bb340517a75e81ef6e422a7ab791 /drivers/net/ehea | |
parent | 78d41b35a9570b7a9a45686789df5dfaeb2b7f4c (diff) |
ehea: Fix memory hotplug oops
The ehea driver oopses during memory hotplug if the ports are not
up. A simple testcase:
# ifconfig ethX down
# echo offline > /sys/devices/system/memory/memory32/state
Oops: Kernel access of bad area, sig: 11 [#1]
last sysfs file: /sys/devices/system/memory/memory32/state
REGS: c000000709393110 TRAP: 0300 Not tainted (2.6.39-rc2-01385-g7ef73bc-dirty)
DAR: 0000000000000000, DSISR: 40000000
...
NIP [c000000000067c98] .__wake_up_common+0x48/0xf0
LR [c00000000006d034] .__wake_up+0x54/0x90
Call Trace:
[c00000000006d034] .__wake_up+0x54/0x90
[d000000006bb6270] .ehea_rereg_mrs+0x140/0x730 [ehea]
[d000000006bb69c4] .ehea_mem_notifier+0x164/0x170 [ehea]
[c0000000006fc8a8] .notifier_call_chain+0x78/0xf0
[c0000000000b3d70] .__blocking_notifier_call_chain+0x70/0xb0
[c000000000458d78] .memory_notify+0x28/0x40
[c0000000001871d8] .remove_memory+0x208/0x6d0
[c000000000458264] .memory_section_action+0x94/0x140
[c0000000004583ec] .memory_block_change_state+0xdc/0x1d0
[c0000000004585cc] .store_mem_state+0xec/0x160
[c00000000044768c] .sysdev_store+0x3c/0x50
[c00000000020b48c] .sysfs_write_file+0xec/0x1f0
[c00000000018f86c] .vfs_write+0xec/0x1e0
[c00000000018fa88] .SyS_write+0x58/0xd0
To fix this, initialise the waitqueues during port probe instead
of port open.
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@kernel.org
Acked-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ehea')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 53c0f04b1b23..cf79cf759e13 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -2688,9 +2688,6 @@ static int ehea_open(struct net_device *dev) | |||
2688 | netif_start_queue(dev); | 2688 | netif_start_queue(dev); |
2689 | } | 2689 | } |
2690 | 2690 | ||
2691 | init_waitqueue_head(&port->swqe_avail_wq); | ||
2692 | init_waitqueue_head(&port->restart_wq); | ||
2693 | |||
2694 | mutex_unlock(&port->port_lock); | 2691 | mutex_unlock(&port->port_lock); |
2695 | 2692 | ||
2696 | return ret; | 2693 | return ret; |
@@ -3276,6 +3273,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3276 | 3273 | ||
3277 | INIT_WORK(&port->reset_task, ehea_reset_port); | 3274 | INIT_WORK(&port->reset_task, ehea_reset_port); |
3278 | 3275 | ||
3276 | init_waitqueue_head(&port->swqe_avail_wq); | ||
3277 | init_waitqueue_head(&port->restart_wq); | ||
3278 | |||
3279 | ret = register_netdev(dev); | 3279 | ret = register_netdev(dev); |
3280 | if (ret) { | 3280 | if (ret) { |
3281 | pr_err("register_netdev failed. ret=%d\n", ret); | 3281 | pr_err("register_netdev failed. ret=%d\n", ret); |