From: Paul Barker <pbarker@konsulko.com>
To: Woojung Huh <woojung.huh@microchip.com>,
Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>
Cc: Paul Barker <pbarker@konsulko.com>, netdev@vger.kernel.org
Subject: [PATCH v2 4/4] net: dsa: microchip: Implement recommended reset timing
Date: Mon, 7 Sep 2020 11:12:08 +0100 [thread overview]
Message-ID: <20200907101208.1223-5-pbarker@konsulko.com> (raw)
In-Reply-To: <20200907101208.1223-1-pbarker@konsulko.com>
The datasheet for the ksz9893 and ksz9477 switches recommend waiting at
least 100us after the de-assertion of reset before trying to program the
device through any interface.
Also switch the existing msleep() call to usleep_range() as recommended
in Documentation/timers/timers-howto.rst. The 2ms range used here is
somewhat arbitrary, as long as the reset is asserted for at least 10ms
we should be ok.
Signed-off-by: Paul Barker <pbarker@konsulko.com>
---
drivers/net/dsa/microchip/ksz_common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 8d53b12d40a8..a31738662d95 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -400,8 +400,9 @@ int ksz_switch_register(struct ksz_device *dev,
if (dev->reset_gpio) {
gpiod_set_value_cansleep(dev->reset_gpio, 1);
- mdelay(10);
+ usleep_range(10000, 12000);
gpiod_set_value_cansleep(dev->reset_gpio, 0);
+ usleep_range(100, 1000);
}
mutex_init(&dev->dev_mutex);
--
2.28.0
next prev parent reply other threads:[~2020-09-07 10:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 10:12 [PATCH v2 0/4] ksz9477 dsa switch driver improvements Paul Barker
2020-09-07 10:12 ` [PATCH v2 1/4] net: dsa: microchip: Make switch detection more informative Paul Barker
2020-09-08 4:11 ` Florian Fainelli
2020-09-07 10:12 ` [PATCH v2 2/4] net: dsa: microchip: Improve phy mode message Paul Barker
2020-09-07 12:08 ` kernel test robot
2020-09-08 4:11 ` Florian Fainelli
2020-09-07 10:12 ` [PATCH v2 3/4] net: dsa: microchip: Disable RGMII in-band status on KSZ9893 Paul Barker
2020-09-08 4:09 ` Florian Fainelli
2020-09-07 10:12 ` Paul Barker [this message]
2020-09-08 4:09 ` [PATCH v2 4/4] net: dsa: microchip: Implement recommended reset timing Florian Fainelli
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=20200907101208.1223-5-pbarker@konsulko.com \
--to=pbarker@konsulko.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
--cc=woojung.huh@microchip.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).