Skip to contentSkip to conversation

net: macb: initialize bp->queues[0].bp for at91rm9200

PATCH In review Alexandre Belloni 3 participants 3 messages Jun 26, 2018 – Jun 28, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: macb: initialize bp->queues[0].bp for at91rm9200

The macb driver currently crashes on at91rm9200 with the following trace:

Unable to handle kernel NULL pointer dereference at virtual address 00000014

[...]
[<c031da44>] (macb_rx_desc) from [<c031f2bc>] (at91ether_open+0x2e8/0x3f8) [<c031f2bc>] (at91ether_open) from [<c041e8d8>] (__dev_open+0x120/0x13c) [<c041e8d8>] (__dev_open) from [<c041ec08>] (__dev_change_flags+0x17c/0x1a8) [<c041ec08>] (__dev_change_flags) from [<c041ec4c>] (dev_change_flags+0x18/0x4c) [<c041ec4c>] (dev_change_flags) from [<c07a5f4c>] (ip_auto_config+0x220/0x10b0) [<c07a5f4c>] (ip_auto_config) from [<c000a4fc>] (do_one_initcall+0x78/0x18c) [<c000a4fc>] (do_one_initcall) from [<c0783e50>] (kernel_init_freeable+0x184/0x1c4) [<c0783e50>] (kernel_init_freeable) from [<c0574d70>] (kernel_init+0x8/0xe8) [<c0574d70>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)

Solve that by initializing bp->queues[0].bp in at91ether_init (as is done in macb_init).

Fixes ae1f2a56d273 ("net: macb: Added support for many RX queues")
---
 drivers/net/ethernet/cadence/macb_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +2 -0
index 3e93df5d4e3b..96cc03a6d942 100644
@@ -3726,6 +3726,8 @@ static int at91ether_init(struct platform_device *pdev)
 	int err;
 	u32 reg;
 
+	bp->queues[0].bp = bp;
+
 	dev->netdev_ops = &at91ether_netdev_ops;
 	dev->ethtool_ops = &macb_ethtool_ops;
 
Signature · 1 line
2.18.0
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Alexandre Belloni

The macb driver currently crashes on at91rm9200 with the following trace:

Unable to handle kernel NULL pointer dereference at virtual address 00000014

[...]
[<c031da44>] (macb_rx_desc) from [<c031f2bc>] (at91ether_open+0x2e8/0x3f8) [<c031f2bc>] (at91ether_open) from [<c041e8d8>] (__dev_open+0x120/0x13c) [<c041e8d8>] (__dev_open) from [<c041ec08>] (__dev_change_flags+0x17c/0x1a8) [<c041ec08>] (__dev_change_flags) from [<c041ec4c>] (dev_change_flags+0x18/0x4c) [<c041ec4c>] (dev_change_flags) from [<c07a5f4c>] (ip_auto_config+0x220/0x10b0) [<c07a5f4c>] (ip_auto_config) from [<c000a4fc>] (do_one_initcall+0x78/0x18c) [<c000a4fc>] (do_one_initcall) from [<c0783e50>] (kernel_init_freeable+0x184/0x1c4) [<c0783e50>] (kernel_init_freeable) from [<c0574d70>] (kernel_init+0x8/0xe8) [<c0574d70>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)

Quoted 5 lines

Solve that by initializing bp->queues[0].bp in at91ether_init (as is done in macb_init).

Fixes ae1f2a56d273 ("net: macb: Added support for many RX queues")
Quoted 18 lines
---
  drivers/net/ethernet/cadence/macb_main.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +2 -0
index 3e93df5d4e3b..96cc03a6d942 100644
@@ -3726,6 +3726,8 @@ static int at91ether_init(struct platform_device *pdev)
  	int err;
  	u32 reg;
 
+	bp->queues[0].bp = bp;
+
  	dev->netdev_ops = &at91ether_netdev_ops;
  	dev->ethtool_ops = &macb_ethtool_ops;
 
Signature · 1 line
Nicolas Ferre
maintainer
#2 lore raw
In reply to Alexandre Belloni

From: Alexandre Belloni <[email protected]>
Date: Tue, 26 Jun 2018 10:44:01 +0200

Quoted 14 lines

The macb driver currently crashes on at91rm9200 with the following trace:

Unable to handle kernel NULL pointer dereference at virtual address 00000014

[...]
[<c031da44>] (macb_rx_desc) from [<c031f2bc>] (at91ether_open+0x2e8/0x3f8) [<c031f2bc>] (at91ether_open) from [<c041e8d8>] (__dev_open+0x120/0x13c) [<c041e8d8>] (__dev_open) from [<c041ec08>] (__dev_change_flags+0x17c/0x1a8) [<c041ec08>] (__dev_change_flags) from [<c041ec4c>] (dev_change_flags+0x18/0x4c) [<c041ec4c>] (dev_change_flags) from [<c07a5f4c>] (ip_auto_config+0x220/0x10b0) [<c07a5f4c>] (ip_auto_config) from [<c000a4fc>] (do_one_initcall+0x78/0x18c) [<c000a4fc>] (do_one_initcall) from [<c0783e50>] (kernel_init_freeable+0x184/0x1c4) [<c0783e50>] (kernel_init_freeable) from [<c0574d70>] (kernel_init+0x8/0xe8) [<c0574d70>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)

Quoted 5 lines

Solve that by initializing bp->queues[0].bp in at91ether_init (as is done in macb_init).

Fixes ae1f2a56d273 ("net: macb: Added support for many RX queues")

Applied and queued up for -stable.