From: Linus Walleij Date: Wed, 13 Aug 2025 21:43:04 +0000 (+0200) Subject: net: dsa: ks8995: Add proper RESET delay X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccf29cb84972f97c98ac31f7d6fb1680dc5d3816;p=thirdparty%2Fkernel%2Fstable.git net: dsa: ks8995: Add proper RESET delay According to the datasheet we need to wait 100us before accessing any registers in the KS8995 after a reset de-assertion. Add this delay, if and only if we obtained a GPIO descriptor, otherwise it is just a pointless delay. Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20250813-ks8995-to-dsa-v1-2-75c359ede3a5@linaro.org Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/dsa/ks8995.c b/drivers/net/dsa/ks8995.c index d135b061d810b..bdee8c62315f3 100644 --- a/drivers/net/dsa/ks8995.c +++ b/drivers/net/dsa/ks8995.c @@ -438,9 +438,15 @@ static int ks8995_probe(struct spi_device *spi) if (err) return err; - /* de-assert switch reset */ - /* FIXME: this likely requires a delay */ - gpiod_set_value_cansleep(ks->reset_gpio, 0); + if (ks->reset_gpio) { + /* + * If a reset line was obtained, wait for 100us after + * de-asserting RESET before accessing any registers, see + * the KS8995MA datasheet, page 44. + */ + gpiod_set_value_cansleep(ks->reset_gpio, 0); + udelay(100); + } spi_set_drvdata(spi, ks);