summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence/macb.h
diff options
context:
space:
mode:
authorHarini Katakam <harini.katakam@xilinx.com>2019-03-01 11:50:32 +0100
committerDavid S. Miller <davem@davemloft.net>2019-03-03 22:51:37 +0100
commit8beb79b7ae937632db1d2721d33b46526d41f153 (patch)
treea940e3543aed8ead37ac363865e0764a361c6c5a /drivers/net/ethernet/cadence/macb.h
parentMerge branch 'net-dsa-microchip-add-KSZ9893-switch-support' (diff)
downloadlinux-8beb79b7ae937632db1d2721d33b46526d41f153.tar.xz
linux-8beb79b7ae937632db1d2721d33b46526d41f153.zip
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>
Diffstat (limited to 'drivers/net/ethernet/cadence/macb.h')
-rw-r--r--drivers/net/ethernet/cadence/macb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 9bbaad9f3d63..f51040fedcf5 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -715,6 +715,8 @@
__v; \
})
+#define MACB_READ_NSR(bp) macb_readl(bp, NSR)
+
/* struct macb_dma_desc - Hardware DMA descriptor
* @addr: DMA address of data buffer
* @ctrl: Control and status bits