Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5902212imu; Mon, 26 Nov 2018 06:41:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZR0box2ke7skdCC+ztBfTTE5M5GUgQSA4ZWa+Hs4ssLI3I/6hQAZcxXDdRxp2FRDyPDIu X-Received: by 2002:a63:89c2:: with SMTP id v185mr23364001pgd.97.1543243319848; Mon, 26 Nov 2018 06:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543243319; cv=none; d=google.com; s=arc-20160816; b=nF/dINuC6+7SGgNCh6yhqjewlbtFG4OCYbWMORExmjcOJkzzC3XZdI+OU5lCSWwYQD uixKS7MKVyG2etiP5tH+cvymuW0dIzHhGDKrqneJA5wPVL7Kxej5HS+DAIubElWeyfZx /Q3pja+3256j8nNC6WPS6fKZHnctBOOZoQQc0z5Ku0EE27myATKfZQ5GRY448s/GDlmq 5oVPyQ6WprTi1ZonZRkb52fLTiNTs0NueeK4OlbFdqwTSYOzzasQpXAsMulmiylEvIIW RYDLc1SpWld5BUups5F24kwDO0AipP1SBrzv5MXchyTSWU+VE1Sf7hHzhA4kPcPqw0wX 2Xrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RY9LEOD7aRWwx7to15Fj0jf3FoySwRiHpK+tu5rF/O0=; b=wuAaWfDUspt01R+RgcGV8qUL1b7cYTmgcijRk+q8Lr5TZY15ww9AzvZv3E+YC8Nn9k eB/anTb7pQZ6FljxvxYSS8CTKxkp2HlCZ5O8aHeGUGYn2/vFZSym6RtbK1TueDQL3D3V d2hkvfU5ACohZps7oB6FthB/IWo6qmflaRQREFOKKy1CMeK0pORNZhjA3nSOxUfi66Oo hO4vdMTucNoIBWzcgyltU0IDeypHZ2xU8/3joULuIE9v2icfWYxDXi9M35qm+FbBe2aa ZiZcO0sr7n6VSm6mCrzd94CVfDl+Miiy/Q61YWiNWGva+N4SAUf5q7/zlEI/Jd2e/uH5 DvUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=vQOqud3f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si371601pgr.316.2018.11.26.06.41.32; Mon, 26 Nov 2018 06:41:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=vQOqud3f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726672AbeK0BeF (ORCPT + 99 others); Mon, 26 Nov 2018 20:34:05 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:49458 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbeK0BeF (ORCPT ); Mon, 26 Nov 2018 20:34:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=RY9LEOD7aRWwx7to15Fj0jf3FoySwRiHpK+tu5rF/O0=; b=vQOqud3fter1syj4YLXATti1W0q678wDR4Rf6hJgmcTmYJ6cx01NvRZxIY1Q8nhBfa3Y42Ezd5xRTm5Eq9CwPxIH+uL2MCSpAKBxJoq67upTE/6IbbmkAVVRzX/r0NS/DLav9IgpFeWIm5/je5Z3yvT10FJNq/AMw9jhu+GskFg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gRI33-0004SB-5u; Mon, 26 Nov 2018 15:39:41 +0100 Date: Mon, 26 Nov 2018 15:39:41 +0100 From: Andrew Lunn To: Harini Katakam Cc: nicolas.ferre@microchip.com, davem@davemloft.net, claudiu.beznea@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, michal.simek@xilinx.com, harinikatakamlinux@gmail.com, Harini Katakam , Shubhrajyoti Datta , Sai Pavan Boddu Subject: Re: [PATCH v2 1/4] net: macb: Check MDIO state before read/write and use timeouts Message-ID: <20181126143941.GB12116@lunn.ch> References: <1543216072-9623-1-git-send-email-harini.katakam@xilinx.com> <1543216072-9623-2-git-send-email-harini.katakam@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543216072-9623-2-git-send-email-harini.katakam@xilinx.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 12:37:49PM +0530, Harini Katakam wrote: > From: Harini Katakam > > 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 > Signed-off-by: Sai Pavan Boddu > Signed-off-by: Harini Katakam > --- > 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