netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Arnd Bergmann <arnd@kernel.org>, Wei Fang <wei.fang@nxp.com>,
	Jakub Kicinski <kuba@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	ore@pengutronix.de, kernel@pengutronix.de
Subject: Re: [PATCH] [v2] fec: convert to gpio descriptor
Date: Tue, 31 Jan 2023 18:25:32 +0100	[thread overview]
Message-ID: <Y9lPDGUestsjdWVX@lunn.ch> (raw)
In-Reply-To: <20230131153851.ua57vy7vc2xdasup@pengutronix.de>

On Tue, Jan 31, 2023 at 04:38:51PM +0100, Marc Kleine-Budde wrote:
> On 26.01.2023 22:05:59, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > The driver can be trivially converted, as it only triggers the gpio
> > pin briefly to do a reset, and it already only supports DT.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> On current net-next/main 6a8ab436831d ("Merge branch
> 'add-support-for-the-the-vsc7512-internal-copper-phys'") this causes the
> riot board (arch/arm/boot/dts/imx6dl-riotboard.dts) to not probe the
> fec:
> 
> | Jan 31 16:32:12 riot kernel: fec 2188000.ethernet: error -ENOENT: failed to get phy-reset-gpios
> | Jan 31 16:32:12 riot kernel: fec: probe of 2188000.ethernet failed with error -2

Hi Marc

Could you try swapping the devm_gpiod_get() for
devm_gpiod_get_optional().

It is kind of hidden, but:

-       else if (!gpio_is_valid(phy_reset))
-               return 0;

made the GPIO optional, since -2 is not a valid GPIO number and so it
would silently return.

The real fix will need to be a bit more complex, since we don't want
to do the sleeps etc if the GPIO is not present.

	Andrew

      reply	other threads:[~2023-01-31 17:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 21:05 [PATCH] [v2] fec: convert to gpio descriptor Arnd Bergmann
2023-01-26 22:10 ` Andrew Lunn
2023-01-30  7:30 ` patchwork-bot+netdevbpf
2023-01-31 15:38 ` Marc Kleine-Budde
2023-01-31 17:25   ` Andrew Lunn [this message]

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=Y9lPDGUestsjdWVX@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=ore@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.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).