On Mon, Nov 26, 2018 at 12:37:49PM +0530, Harini Katakam wrote: > From: Harini Katakam <hari...@xilinx.com> > > 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.da...@xilinx.com> > Signed-off-by: Sai Pavan Boddu <sai.pavan.bo...@xilinx.com> > Signed-off-by: Harini Katakam <hari...@xilinx.com> > --- > v2 changes: > Use readx_poll_timeout > > Changes form RFC: > Cleaned up timeout implementation and moved it to a helper. > > drivers/net/ethernet/cadence/macb.h | 3 +++ > drivers/net/ethernet/cadence/macb_main.c | 33 > ++++++++++++++++++++++++++------ > 2 files changed, 30 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/ethernet/cadence/macb.h > b/drivers/net/ethernet/cadence/macb.h > index 3d45f4c..df7bee1 100644 > --- a/drivers/net/ethernet/cadence/macb.h > +++ b/drivers/net/ethernet/cadence/macb.h > @@ -714,6 +714,9 @@ > __v; \ > }) > > +#define MACB_IDLE_MASK (1 << MACB_IDLE_OFFSET)
I think you could use the MACB_BIT() macro here. But otherwise, Reviewed-by: Andrew Lunn <and...@lunn.ch> Andrew