net: macb: Check MDIO state before read/write and use timeouts
authorHarini Katakam <harini.katakam@xilinx.com>
Fri, 1 Mar 2019 10:50:32 +0000 (16:20 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Mar 2019 21:51:37 +0000 (13:51 -0800)
commit8beb79b7ae937632db1d2721d33b46526d41f153
treea940e3543aed8ead37ac363865e0764a361c6c5a
parent41bc0ddb80e0380ab88b3902e638c89b3453b421
net: macb: Check MDIO state before read/write and use timeouts

Replace the while loop in MDIO read/write functions with a timeout.
In addition, add a check for MDIO bus busy before initiating a new
operation as well to make sure there is no ongoing MDIO operation.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/cadence/macb_main.c