From: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
To: Alessandro Zini <alessandro.zini@siemens.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Ciprian Regus <ciprian.regus@analog.com>,
Qingfang Deng <qingfang.deng@linux.dev>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, <netdev@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v4 3/3] net: ethernet: oa_tc6: add reset-gpios support
Date: Tue, 22 Sep 2026 14:29:45 +0530 [thread overview]
Message-ID: <56ded0b9-4975-46fd-93dd-b5777a24b2c8@microchip.com> (raw)
In-Reply-To: <20260918231450.55966-4-alessandro.zini@siemens.com>
Hi Alessandro,
On 19/09/26 4:44 am, Alessandro Zini wrote:
>
> #include <linux/bitfield.h>
> +#include <linux/delay.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/iopoll.h>
> #include <linux/interrupt.h>
> #include <linux/mdio.h>
> @@ -88,6 +90,7 @@ struct oa_tc6 {
> bool disable_traffic;
> bool prot_ctrl;
> enum oa_tc6_quirk_flag quirk_flags;
> + struct gpio_desc *reset_gpio;
> };
>
> enum oa_tc6_header_type {
> @@ -1504,6 +1507,22 @@ struct oa_tc6 *oa_tc6_init(struct spi_device *spi, struct net_device *netdev,
> if (!tc6->spi_data_rx_buf)
> return ERR_PTR(-ENOMEM);
>
> + tc6->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
> + GPIOD_OUT_HIGH);
> + if (IS_ERR(tc6->reset_gpio))
> + return ERR_PTR(dev_err_probe(&spi->dev,
> + PTR_ERR(tc6->reset_gpio),
> + "failed to get reset gpio\n"));
> +
> + if (tc6->reset_gpio) {
> + /* Keep the reset asserted for 10 us and then allow 1 ms of
> + * settle time for the crystal oscillator startup.
> + */
> + fsleep(10);
> + gpiod_set_value_cansleep(tc6->reset_gpio, 0);
> + fsleep(1000);
> + }
> +
How do we ensure that the reset has completed before proceeding? Should
we check for a reset-complete status indication instead of relying only
on fixed delays?
Also, do we still need oa_tc6_sw_reset_macphy() when reset_gpio is
implemented? My understanding is that the software reset path is mainly
needed for MAC-PHYs that do not expose a reset GPIO. In that case, it
may be cleaner to prefer the GPIO reset when available and fall back to
the software reset otherwise, rather than always performing both resets.
Best regards,
Parthiban V> /* Check the PROTE bit status so that we can reset
the device */
> ret = oa_tc6_check_ctrl_protection(tc6);
> if (ret) {
> --
> 2.55.0
next prev parent reply other threads:[~2026-09-22 8:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 23:14 [PATCH net-next v4 0/3] " Alessandro Zini
2026-09-18 23:14 ` [PATCH net-next v4 1/3] dt-bindings: net: microchip,lan8650: add reset-gpios property Alessandro Zini
2026-09-18 23:14 ` [PATCH net-next v4 2/3] net: ethernet: oa_tc6: return ERR_PTR from oa_tc6_init() Alessandro Zini
2026-09-18 23:14 ` [PATCH net-next v4 3/3] net: ethernet: oa_tc6: add reset-gpios support Alessandro Zini
2026-09-22 8:59 ` Parthiban Veerasooran [this message]
2026-09-22 17:10 ` Selvamani Rajagopal
2026-09-24 16:40 ` [PATCH net-next v4 0/3] " patchwork-bot+netdevbpf
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=56ded0b9-4975-46fd-93dd-b5777a24b2c8@microchip.com \
--to=parthiban.veerasooran@microchip.com \
--cc=alessandro.zini@siemens.com \
--cc=andrew+netdev@lunn.ch \
--cc=ciprian.regus@analog.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=qingfang.deng@linux.dev \
--cc=robh@kernel.org \
/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®