Messages in this thread | | | Date | Mon, 26 Nov 2018 15:39:41 +0100 | From | Andrew Lunn <> | Subject | Re: [PATCH v2 1/4] net: macb: Check MDIO state before read/write and use timeouts |
| |
On Mon, Nov 26, 2018 at 12:37:49PM +0530, Harini Katakam wrote: > From: Harini Katakam <harinik@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.datta@xilinx.com> > Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com> > Signed-off-by: Harini Katakam <harinik@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 <andrew@lunn.ch>
Andrew
| |