From: Esben Haabendal <esben.haabendal@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: andrew@lunn.ch, netdev@vger.kernel.org, richardcochran@gmail.com,
f.fainelli@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dp83640: Ensure against premature access to PHY registers after reset
Date: Fri, 06 Apr 2018 19:06:59 +0200 [thread overview]
Message-ID: <8760541cy4.fsf@gmail.com> (raw)
In-Reply-To: <20180406.111337.1908168293065420432.davem@davemloft.net> (David Miller's message of "Fri, 06 Apr 2018 11:13:37 -0400 (EDT)")
David Miller <davem@davemloft.net> writes:
> From: Andrew Lunn <andrew@lunn.ch>
> Date: Fri, 6 Apr 2018 16:14:10 +0200
>
>> On Fri, Apr 06, 2018 at 04:05:40PM +0200, Esben Haabendal wrote:
>>> From: Esben Haabendal <eha@deif.com>
>>>
>>> Signed-off-by: Esben Haabendal <eha@deif.com>
>>> ---
>>> drivers/net/phy/dp83640.c | 17 +++++++++++++++++
>>> 1 file changed, 17 insertions(+)
>>>
>>> diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
>>> index 654f42d00092..48403170096a 100644
>>> --- a/drivers/net/phy/dp83640.c
>>> +++ b/drivers/net/phy/dp83640.c
>>> @@ -1207,6 +1207,22 @@ static void dp83640_remove(struct phy_device *phydev)
>>> kfree(dp83640);
>>> }
>>>
>>> +static int dp83640_soft_reset(struct phy_device *phydev)
>>> +{
>>> + int ret;
>>> +
>>> + ret = genphy_soft_reset(phydev);
>>> + if (ret < 0)
>>> + return ret;
>>> +
>>> + /* From DP83640 datasheet: "Software driver code must wait 3 us
>>> + * following a software reset before allowing further serial MII
>>> + * operations with the DP83640." */
>>> + udelay(3);
>>
>> Hi Esben
>>
>> The accuracy of udelay() is not guaranteed. So you probably want to be
>> a bit pessimistic, and use 10.
Ok, will do.
/Esben
next prev parent reply other threads:[~2018-04-06 17:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 14:05 [PATCH] dp83640: Ensure against premature access to PHY registers after reset Esben Haabendal
2018-04-06 14:14 ` Andrew Lunn
2018-04-06 15:13 ` David Miller
2018-04-06 17:06 ` Esben Haabendal [this message]
2018-04-06 17:08 ` [PATCH v2] " Esben Haabendal
2018-04-06 17:23 ` Andrew Lunn
2018-04-08 20:17 ` [PATCH v3] " Esben Haabendal
2018-04-08 23:59 ` David Miller
2018-04-10 13:50 ` [PATCH v2] " Sasha Levin
2018-04-10 13:50 ` [PATCH] " Sasha Levin
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=8760541cy4.fsf@gmail.com \
--to=esben.haabendal@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.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).