netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: qca8k: Fix "Unexpected gfp" kernel exception
@ 2020-06-03 11:31 Michal Vokáč
  2020-06-03 13:41 ` Andrew Lunn
  2020-06-04 22:48 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Vokáč @ 2020-06-03 11:31 UTC (permalink / raw)
  To: Andrew Lunn, Vivien Didelot, David S. Miller
  Cc: Florian Fainelli, Jakub Kicinski, netdev, linux-kernel,
	Michal Vokáč,
	stable

Commit 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
replaced the dsa_switch_alloc helper by devm_kzalloc in all DSA
drivers. Unfortunately it introduced a typo in qca8k.c driver and
wrong argument is passed to the devm_kzalloc function.

This fix mitigates the following kernel exception:

  Unexpected gfp: 0x6 (__GFP_HIGHMEM|GFP_DMA32). Fixing up to gfp: 0x101 (GFP_DMA|__GFP_ZERO). Fix your code!
  CPU: 1 PID: 44 Comm: kworker/1:1 Not tainted 5.5.9-yocto-ua #1
  Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
  Workqueue: events deferred_probe_work_func
  [<c0014924>] (unwind_backtrace) from [<c00123bc>] (show_stack+0x10/0x14)
  [<c00123bc>] (show_stack) from [<c04c8fb4>] (dump_stack+0x90/0xa4)
  [<c04c8fb4>] (dump_stack) from [<c00e1b10>] (new_slab+0x20c/0x214)
  [<c00e1b10>] (new_slab) from [<c00e1cd0>] (___slab_alloc.constprop.0+0x1b8/0x540)
  [<c00e1cd0>] (___slab_alloc.constprop.0) from [<c00e2074>] (__slab_alloc.constprop.0+0x1c/0x24)
  [<c00e2074>] (__slab_alloc.constprop.0) from [<c00e4538>] (__kmalloc_track_caller+0x1b0/0x298)
  [<c00e4538>] (__kmalloc_track_caller) from [<c02cccac>] (devm_kmalloc+0x24/0x70)
  [<c02cccac>] (devm_kmalloc) from [<c030d888>] (qca8k_sw_probe+0x94/0x1ac)
  [<c030d888>] (qca8k_sw_probe) from [<c0304788>] (mdio_probe+0x30/0x54)
  [<c0304788>] (mdio_probe) from [<c02c93bc>] (really_probe+0x1e0/0x348)
  [<c02c93bc>] (really_probe) from [<c02c9884>] (driver_probe_device+0x60/0x16c)
  [<c02c9884>] (driver_probe_device) from [<c02c7fb0>] (bus_for_each_drv+0x70/0x94)
  [<c02c7fb0>] (bus_for_each_drv) from [<c02c9708>] (__device_attach+0xb4/0x11c)
  [<c02c9708>] (__device_attach) from [<c02c8148>] (bus_probe_device+0x84/0x8c)
  [<c02c8148>] (bus_probe_device) from [<c02c8cec>] (deferred_probe_work_func+0x64/0x90)
  [<c02c8cec>] (deferred_probe_work_func) from [<c0033c14>] (process_one_work+0x1d4/0x41c)
  [<c0033c14>] (process_one_work) from [<c00340a4>] (worker_thread+0x248/0x528)
  [<c00340a4>] (worker_thread) from [<c0039148>] (kthread+0x124/0x150)
  [<c0039148>] (kthread) from [<c00090d8>] (ret_from_fork+0x14/0x3c)
  Exception stack(0xee1b5fb0 to 0xee1b5ff8)
  5fa0:                                     00000000 00000000 00000000 00000000
  5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
  qca8k 2188000.ethernet-1:0a: Using legacy PHYLIB callbacks. Please migrate to PHYLINK!
  qca8k 2188000.ethernet-1:0a eth2 (uninitialized): PHY [2188000.ethernet-1:01] driver [Generic PHY]
  qca8k 2188000.ethernet-1:0a eth1 (uninitialized): PHY [2188000.ethernet-1:02] driver [Generic PHY]

Fixes: 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
Cc: <stable@vger.kernel.org>
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
---
 drivers/net/dsa/qca8k.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 9f4205b4439b..d2b5ab403e06 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -1079,8 +1079,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev)
 	if (id != QCA8K_ID_QCA8337)
 		return -ENODEV;
 
-	priv->ds = devm_kzalloc(&mdiodev->dev, sizeof(*priv->ds),
-				QCA8K_NUM_PORTS);
+	priv->ds = devm_kzalloc(&mdiodev->dev, sizeof(*priv->ds), GFP_KERNEL);
 	if (!priv->ds)
 		return -ENOMEM;
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: dsa: qca8k: Fix "Unexpected gfp" kernel exception
  2020-06-03 11:31 [PATCH net] net: dsa: qca8k: Fix "Unexpected gfp" kernel exception Michal Vokáč
@ 2020-06-03 13:41 ` Andrew Lunn
  2020-06-03 13:42   ` Andrew Lunn
  2020-06-04 22:48 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2020-06-03 13:41 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Vivien Didelot, David S. Miller, Florian Fainelli,
	Jakub Kicinski, netdev, linux-kernel, stable

On Wed, Jun 03, 2020 at 01:31:39PM +0200, Michal Vokáč wrote:
> Commit 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
> replaced the dsa_switch_alloc helper by devm_kzalloc in all DSA
> drivers. Unfortunately it introduced a typo in qca8k.c driver and
> wrong argument is passed to the devm_kzalloc function.
> 
> This fix mitigates the following kernel exception:
> 
>   Unexpected gfp: 0x6 (__GFP_HIGHMEM|GFP_DMA32). Fixing up to gfp: 0x101 (GFP_DMA|__GFP_ZERO). Fix your code!
>   CPU: 1 PID: 44 Comm: kworker/1:1 Not tainted 5.5.9-yocto-ua #1
>   Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
>   Workqueue: events deferred_probe_work_func
>   [<c0014924>] (unwind_backtrace) from [<c00123bc>] (show_stack+0x10/0x14)
>   [<c00123bc>] (show_stack) from [<c04c8fb4>] (dump_stack+0x90/0xa4)
>   [<c04c8fb4>] (dump_stack) from [<c00e1b10>] (new_slab+0x20c/0x214)
>   [<c00e1b10>] (new_slab) from [<c00e1cd0>] (___slab_alloc.constprop.0+0x1b8/0x540)
>   [<c00e1cd0>] (___slab_alloc.constprop.0) from [<c00e2074>] (__slab_alloc.constprop.0+0x1c/0x24)
>   [<c00e2074>] (__slab_alloc.constprop.0) from [<c00e4538>] (__kmalloc_track_caller+0x1b0/0x298)
>   [<c00e4538>] (__kmalloc_track_caller) from [<c02cccac>] (devm_kmalloc+0x24/0x70)
>   [<c02cccac>] (devm_kmalloc) from [<c030d888>] (qca8k_sw_probe+0x94/0x1ac)
>   [<c030d888>] (qca8k_sw_probe) from [<c0304788>] (mdio_probe+0x30/0x54)
>   [<c0304788>] (mdio_probe) from [<c02c93bc>] (really_probe+0x1e0/0x348)
>   [<c02c93bc>] (really_probe) from [<c02c9884>] (driver_probe_device+0x60/0x16c)
>   [<c02c9884>] (driver_probe_device) from [<c02c7fb0>] (bus_for_each_drv+0x70/0x94)
>   [<c02c7fb0>] (bus_for_each_drv) from [<c02c9708>] (__device_attach+0xb4/0x11c)
>   [<c02c9708>] (__device_attach) from [<c02c8148>] (bus_probe_device+0x84/0x8c)
>   [<c02c8148>] (bus_probe_device) from [<c02c8cec>] (deferred_probe_work_func+0x64/0x90)
>   [<c02c8cec>] (deferred_probe_work_func) from [<c0033c14>] (process_one_work+0x1d4/0x41c)
>   [<c0033c14>] (process_one_work) from [<c00340a4>] (worker_thread+0x248/0x528)
>   [<c00340a4>] (worker_thread) from [<c0039148>] (kthread+0x124/0x150)
>   [<c0039148>] (kthread) from [<c00090d8>] (ret_from_fork+0x14/0x3c)
>   Exception stack(0xee1b5fb0 to 0xee1b5ff8)
>   5fa0:                                     00000000 00000000 00000000 00000000
>   5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
>   5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
>   qca8k 2188000.ethernet-1:0a: Using legacy PHYLIB callbacks. Please migrate to PHYLINK!
>   qca8k 2188000.ethernet-1:0a eth2 (uninitialized): PHY [2188000.ethernet-1:01] driver [Generic PHY]
>   qca8k 2188000.ethernet-1:0a eth1 (uninitialized): PHY [2188000.ethernet-1:02] driver [Generic PHY]
> 
> Fixes: 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>

Signed-off-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: dsa: qca8k: Fix "Unexpected gfp" kernel exception
  2020-06-03 13:41 ` Andrew Lunn
@ 2020-06-03 13:42   ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-06-03 13:42 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Vivien Didelot, David S. Miller, Florian Fainelli,
	Jakub Kicinski, netdev, linux-kernel, stable

On Wed, Jun 03, 2020 at 03:41:21PM +0200, Andrew Lunn wrote:
> On Wed, Jun 03, 2020 at 01:31:39PM +0200, Michal Vokáč wrote:
> > Commit 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
> > replaced the dsa_switch_alloc helper by devm_kzalloc in all DSA
> > drivers. Unfortunately it introduced a typo in qca8k.c driver and
> > wrong argument is passed to the devm_kzalloc function.
> > 
> > This fix mitigates the following kernel exception:
> > 
> >   Unexpected gfp: 0x6 (__GFP_HIGHMEM|GFP_DMA32). Fixing up to gfp: 0x101 (GFP_DMA|__GFP_ZERO). Fix your code!
> >   CPU: 1 PID: 44 Comm: kworker/1:1 Not tainted 5.5.9-yocto-ua #1
> >   Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> >   Workqueue: events deferred_probe_work_func
> >   [<c0014924>] (unwind_backtrace) from [<c00123bc>] (show_stack+0x10/0x14)
> >   [<c00123bc>] (show_stack) from [<c04c8fb4>] (dump_stack+0x90/0xa4)
> >   [<c04c8fb4>] (dump_stack) from [<c00e1b10>] (new_slab+0x20c/0x214)
> >   [<c00e1b10>] (new_slab) from [<c00e1cd0>] (___slab_alloc.constprop.0+0x1b8/0x540)
> >   [<c00e1cd0>] (___slab_alloc.constprop.0) from [<c00e2074>] (__slab_alloc.constprop.0+0x1c/0x24)
> >   [<c00e2074>] (__slab_alloc.constprop.0) from [<c00e4538>] (__kmalloc_track_caller+0x1b0/0x298)
> >   [<c00e4538>] (__kmalloc_track_caller) from [<c02cccac>] (devm_kmalloc+0x24/0x70)
> >   [<c02cccac>] (devm_kmalloc) from [<c030d888>] (qca8k_sw_probe+0x94/0x1ac)
> >   [<c030d888>] (qca8k_sw_probe) from [<c0304788>] (mdio_probe+0x30/0x54)
> >   [<c0304788>] (mdio_probe) from [<c02c93bc>] (really_probe+0x1e0/0x348)
> >   [<c02c93bc>] (really_probe) from [<c02c9884>] (driver_probe_device+0x60/0x16c)
> >   [<c02c9884>] (driver_probe_device) from [<c02c7fb0>] (bus_for_each_drv+0x70/0x94)
> >   [<c02c7fb0>] (bus_for_each_drv) from [<c02c9708>] (__device_attach+0xb4/0x11c)
> >   [<c02c9708>] (__device_attach) from [<c02c8148>] (bus_probe_device+0x84/0x8c)
> >   [<c02c8148>] (bus_probe_device) from [<c02c8cec>] (deferred_probe_work_func+0x64/0x90)
> >   [<c02c8cec>] (deferred_probe_work_func) from [<c0033c14>] (process_one_work+0x1d4/0x41c)
> >   [<c0033c14>] (process_one_work) from [<c00340a4>] (worker_thread+0x248/0x528)
> >   [<c00340a4>] (worker_thread) from [<c0039148>] (kthread+0x124/0x150)
> >   [<c0039148>] (kthread) from [<c00090d8>] (ret_from_fork+0x14/0x3c)
> >   Exception stack(0xee1b5fb0 to 0xee1b5ff8)
> >   5fa0:                                     00000000 00000000 00000000 00000000
> >   5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> >   5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
> >   qca8k 2188000.ethernet-1:0a: Using legacy PHYLIB callbacks. Please migrate to PHYLINK!
> >   qca8k 2188000.ethernet-1:0a eth2 (uninitialized): PHY [2188000.ethernet-1:01] driver [Generic PHY]
> >   qca8k 2188000.ethernet-1:0a eth1 (uninitialized): PHY [2188000.ethernet-1:02] driver [Generic PHY]
> > 
> > Fixes: 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Arg! Sorry, wrong tag.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: dsa: qca8k: Fix "Unexpected gfp" kernel exception
  2020-06-03 11:31 [PATCH net] net: dsa: qca8k: Fix "Unexpected gfp" kernel exception Michal Vokáč
  2020-06-03 13:41 ` Andrew Lunn
@ 2020-06-04 22:48 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2020-06-04 22:48 UTC (permalink / raw)
  To: michal.vokac
  Cc: andrew, vivien.didelot, f.fainelli, kuba, netdev, linux-kernel, stable

From: Michal Vokáč <michal.vokac@ysoft.com>
Date: Wed,  3 Jun 2020 13:31:39 +0200

> Commit 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
> replaced the dsa_switch_alloc helper by devm_kzalloc in all DSA
> drivers. Unfortunately it introduced a typo in qca8k.c driver and
> wrong argument is passed to the devm_kzalloc function.
> 
> This fix mitigates the following kernel exception:
 ...
> Fixes: 7e99e3470172 ("net: dsa: remove dsa_switch_alloc helper")
> Cc: <stable@vger.kernel.org>

Please do not CC: stable for networking changes.

> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>

Applied and queued up for -stable, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-04 22:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 11:31 [PATCH net] net: dsa: qca8k: Fix "Unexpected gfp" kernel exception Michal Vokáč
2020-06-03 13:41 ` Andrew Lunn
2020-06-03 13:42   ` Andrew Lunn
2020-06-04 22:48 ` 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).