* [PATCH] ehea: Fix memory hotplug oops
@ 2011-05-11 2:17 Anton Blanchard
2011-05-11 12:46 ` Breno Leitao
0 siblings, 1 reply; 3+ messages in thread
From: Anton Blanchard @ 2011-05-11 2:17 UTC (permalink / raw)
To: leitao; +Cc: netdev
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
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-11 11:54:18.751672569 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-11 11:56:27.423964456 +1000
@@ -2688,9 +2688,6 @@ static int ehea_open(struct net_device *
netif_start_queue(dev);
}
- init_waitqueue_head(&port->swqe_avail_wq);
- init_waitqueue_head(&port->restart_wq);
-
mutex_unlock(&port->port_lock);
return ret;
@@ -3278,6 +3275,9 @@ struct ehea_port *ehea_setup_single_port
INIT_WORK(&port->reset_task, ehea_reset_port);
+ init_waitqueue_head(&port->swqe_avail_wq);
+ init_waitqueue_head(&port->restart_wq);
+
ret = register_netdev(dev);
if (ret) {
pr_err("register_netdev failed. ret=%d\n", ret);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ehea: Fix memory hotplug oops
2011-05-11 2:17 [PATCH] ehea: Fix memory hotplug oops Anton Blanchard
@ 2011-05-11 12:46 ` Breno Leitao
2011-05-12 4:38 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Breno Leitao @ 2011-05-11 12:46 UTC (permalink / raw)
To: David Miller; +Cc: Anton Blanchard, netdev
On 05/10/2011 11:17 PM, Anton Blanchard wrote:
>
> 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>
Acked-by: Breno Leitao <leitao@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ehea: Fix memory hotplug oops
2011-05-11 12:46 ` Breno Leitao
@ 2011-05-12 4:38 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-05-12 4:38 UTC (permalink / raw)
To: leitao; +Cc: anton, netdev
From: Breno Leitao <leitao@linux.vnet.ibm.com>
Date: Wed, 11 May 2011 09:46:51 -0300
> On 05/10/2011 11:17 PM, Anton Blanchard wrote:
>>
>> 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>
> Acked-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Applied to net-2.6, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-12 4:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-11 2:17 [PATCH] ehea: Fix memory hotplug oops Anton Blanchard
2011-05-11 12:46 ` Breno Leitao
2011-05-12 4:38 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).