lkml.org 
[lkml]   [2018]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/4] net: macb: Check MDIO state before read/write and use timeouts
Date
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
>
\
 
 \ /
  Last update: 2018-11-27 11:26    [W:0.073 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site