ravb: fix invalid context bug while calling auto-negotiation by ethtool
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Wed, 4 Jul 2018 08:14:50 +0000 (11:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:09:13 +0000 (13:09 +0200)
commit1465aba3428dc13c9f34607e80ec0b0b9f309c95
treebb04b3499125378fd5bc730c6a4391aad8afe2dd
parent7947dc71b9ded5d01fda11580fe540c7fee45278
ravb: fix invalid context bug while calling auto-negotiation by ethtool

[ Upstream commit 0973a4dd79fe56a3beecfcff675ba4c01df0b0c1 ]

Since commit 35b5f6b1a82b ("PHYLIB: Locking fixes for PHY I/O
potentially sleeping") phy_start_aneg() function utilizes a mutex
to serialize changes to phy state, however the helper function is
called in atomic context.

The bug can be reproduced by running "ethtool -r" command, the bug
is reported if CONFIG_DEBUG_ATOMIC_SLEEP build option is enabled.

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/renesas/ravb_main.c