lkml.org 
[lkml]   [2018]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2018-11-26 15:40    [W:0.793 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site