[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181126143941.GB12116@lunn.ch>
Date: Mon, 26 Nov 2018 15:39:41 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Harini Katakam <harini.katakam@...inx.com>
Cc: nicolas.ferre@...rochip.com, davem@...emloft.net,
claudiu.beznea@...rochip.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, michal.simek@...inx.com,
harinikatakamlinux@...il.com, Harini Katakam <harinik@...inx.com>,
Shubhrajyoti Datta <shubhrajyoti.datta@...inx.com>,
Sai Pavan Boddu <sai.pavan.boddu@...inx.com>
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@...inx.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@...inx.com>
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@...inx.com>
> Signed-off-by: Harini Katakam <harinik@...inx.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@...n.ch>
Andrew
Powered by blists - more mailing lists