linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Claudiu.Beznea@microchip.com>
To: <harinik@xilinx.com>, <andrew@lunn.ch>
Cc: <harini.katakam@xilinx.com>, <Nicolas.Ferre@microchip.com>,
	<davem@davemloft.net>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <michal.simek@xilinx.com>,
	<shubhrajyoti.datta@xilinx.com>, <sai.pavan.boddu@xilinx.com>
Subject: Re: [PATCH v2 1/4] net: macb: Check MDIO state before read/write and use timeouts
Date: Tue, 27 Nov 2018 10:25:11 +0000	[thread overview]
Message-ID: <74937246-dc7d-db1c-df00-5db856192eac@microchip.com> (raw)
In-Reply-To: <CAFcVECK=4e-+1u3X+OuLoAEicUtrkTX3C0wzAugMRcJSP0N-Vg@mail.gmail.com>

Hi Andrew, Harini,

On 27.11.2018 07:36, Harini Katakam wrote:
> Hi Claudiu,
> On Mon, Nov 26, 2018 at 8:22 PM Andrew Lunn <andrew@lunn.ch> wrote:
>>
>> On Mon, Nov 26, 2018 at 02:46:01PM +0000, Claudiu.Beznea@microchip.com wrote:
>>> Hi Harini,
>>>
>>> On 26.11.2018 09:07, 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.
>>>
>>> Is this MDIO bus busy check necessary? The caller of
>>> macb_mdio_read/macb_mdio_write locks the mdio bus mutex before calling it
>>> (e.g. mdiobus_read).
>>
>> Hi Claudiu
>>
>> It depends on the implementation. A write operation you could just
>> launch, but not wait for it to complete, allowing you to do other
>> stuff while the hardware is busy. For the next operation you then do
>> need to check the previous operation has completed.
>>
>> I've not checked it is actually implemented this way.
> 
> Yes, as Andrew mentioned, a previous MDIO bus operation cannot
> be assumed to be complete always - for ex., in case of a timeout.
> There is a chance that the MDIO bus bit is busy when mdio_read/write
> is called.

Thank you for your responses. I see it now.

Then, do you think it would be better to have a new API part of struct
mii_bus that drivers should register so that, the mii core to check if the
bus is idle before lunching a new request?

Thank you,
Claudiu Beznea

> 
> Regards,
> Harini
> 

  reply	other threads:[~2018-11-27 10:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  7:07 [PATCH v2 0/4] Macb power management support for ZynqMP Harini Katakam
2018-11-26  7:07 ` [PATCH v2 1/4] net: macb: Check MDIO state before read/write and use timeouts Harini Katakam
2018-11-26 14:39   ` Andrew Lunn
2018-11-27  5:38     ` Harini Katakam
2018-11-26 14:46   ` Claudiu.Beznea
2018-11-26 14:52     ` Andrew Lunn
2018-11-27  5:36       ` Harini Katakam
2018-11-27 10:25         ` Claudiu.Beznea [this message]
2018-11-27 10:49           ` Harini Katakam
2018-11-28  0:35           ` Andrew Lunn
2018-11-29 10:21             ` Claudiu.Beznea
2018-11-26  7:07 ` [PATCH v2 2/4] net: macb: Support clock management for tsu_clk Harini Katakam
2018-11-26  7:07 ` [PATCH v2 3/4] net: macb: Add pm runtime support Harini Katakam
2018-11-26 14:47   ` Andrew Lunn
2018-11-26 14:47   ` Claudiu.Beznea
2018-11-26  7:07 ` [PATCH v2 4/4] net: macb: Add support for suspend/resume with full power down Harini Katakam
2018-11-26 14:46   ` Claudiu.Beznea
2018-11-27  6:25     ` Harini Katakam
2018-11-27 10:31       ` Claudiu.Beznea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74937246-dc7d-db1c-df00-5db856192eac@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=harini.katakam@xilinx.com \
    --cc=harinik@xilinx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=sai.pavan.boddu@xilinx.com \
    --cc=shubhrajyoti.datta@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).