From: Richard Leitner <richard.leitner@skidata.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Richard Leitner <dev@g0hl1n.net>
Cc: Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Fugang Duan <fugang.duan@nxp.com>, Andrew Lunn <andrew@lunn.ch>,
"Florian Fainelli" <f.fainelli@gmail.com>,
Frank Rowand <frowand.list@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
Baruch Siach <baruch@tkos.co.il>,
"David Wu" <david.wu@rock-chips.com>, <lukma@denx.de>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v4 1/4] phylib: Add device reset delay support
Date: Thu, 7 Dec 2017 16:01:11 +0100 [thread overview]
Message-ID: <5f174dfc-e373-1069-cf22-f25a569030d0@skidata.com> (raw)
In-Reply-To: <CAMuHMdVgWif=1K-S2j1Y39B9yDNvV12sUm7nrFLOP-=ndSYtVA@mail.gmail.com>
Hi Geert,
On 12/07/2017 03:52 PM, Geert Uytterhoeven wrote:
> Hi Richard,
>
> On Thu, Dec 7, 2017 at 3:43 PM, Richard Leitner <dev@g0hl1n.net> wrote:
>> --- a/drivers/net/phy/mdio_device.c
>> +++ b/drivers/net/phy/mdio_device.c
>> @@ -24,6 +24,7 @@
>> #include <linux/slab.h>
>> #include <linux/string.h>
>> #include <linux/unistd.h>
>> +#include <linux/delay.h>
>>
>> void mdio_device_free(struct mdio_device *mdiodev)
>> {
>> @@ -118,8 +119,16 @@ EXPORT_SYMBOL(mdio_device_remove);
>>
>> void mdio_device_reset(struct mdio_device *mdiodev, int value)
>> {
>> - if (mdiodev->reset)
>> - gpiod_set_value(mdiodev->reset, value);
>> + unsigned int d;
>> +
>> + if (!mdiodev->reset)
>> + return;
>> +
>> + gpiod_set_value(mdiodev->reset, value);
>> +
>> + d = value ? mdiodev->reset_delay : mdiodev->reset_post_delay;
>> + if (d)
>> + usleep_range(d, d + min_t(unsigned int, d / 10, 100));
>
> Oops, I meant "max_t", not "min_t", else the upper limit can be "d + 0",
> which is not what we want.
You're right...
> Sorry, my fault.
I just copied it over from you suggestion without thinking about it...
So it's definitely my fault too ;-)
I'll wait for some more comments and send a new version next week.
regards;Richard.L
next prev parent reply other threads:[~2017-12-07 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 14:43 [PATCH net-next v4 0/4] net: fec: fix refclk enable for SMSC LAN8710/20 Richard Leitner
2017-12-07 14:43 ` [PATCH net-next v4 1/4] phylib: Add device reset delay support Richard Leitner
2017-12-07 14:52 ` Geert Uytterhoeven
2017-12-07 15:01 ` Richard Leitner [this message]
2017-12-07 14:43 ` [PATCH net-next v4 2/4] phylib: add reset after clk enable support Richard Leitner
2017-12-07 14:43 ` [PATCH net-next v4 3/4] net: phy: smsc: LAN8710/20: add PHY_RST_AFTER_CLK_EN flag Richard Leitner
2017-12-07 14:43 ` [PATCH net-next v4 4/4] net: fec: add phy_reset_after_clk_enable() support Richard Leitner
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=5f174dfc-e373-1069-cf22-f25a569030d0@skidata.com \
--to=richard.leitner@skidata.com \
--cc=andrew@lunn.ch \
--cc=baruch@tkos.co.il \
--cc=davem@davemloft.net \
--cc=david.wu@rock-chips.com \
--cc=dev@g0hl1n.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=frowand.list@gmail.com \
--cc=fugang.duan@nxp.com \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukma@denx.de \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sergei.shtylyov@cogentembedded.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
all inboxes | Powered by JetHome®