From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Jon Hunter <jonathanh@nvidia.com>,
Bartosz Golaszewski <brgl@bgdev.pl>, Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Brad Griffis <bgriffis@nvidia.com>
Subject: Re: [RESEND PATCH net-next v3 2/4] net: phy: aquantia: wait for FW reset before checking the vendor ID
Date: Tue, 6 Aug 2024 14:36:22 +0300 [thread overview]
Message-ID: <20240806113622.g5ixwcwiw3vpidc3@skbuf> (raw)
In-Reply-To: <ZqjNQW5HhTUgCc5x@shell.armlinux.org.uk>
Hi Russell,
On Tue, Jul 30, 2024 at 12:23:45PM +0100, Russell King (Oracle) wrote:
> > If it times out, then it would appear that with the above code we don't
> > attempt to load the firmware by any other means?
>
> I'm also wondering about aqr_wait_reset_complete(). It uses
> phy_read_mmd_poll_timeout(), which prints an error message if it times
> out (which means no firmware has been loaded.) If we're then going on to
> attempt to load firmware, the error is not an error at all. So, I think
> while phy_read_poll_timeout() is nice and convenient, we need something
> like:
>
> #define phy_read_poll_timeout_quiet(phydev, regnum, val, cond, sleep_us, \
> timeout_us, sleep_before_read) \
> ({ \
> int __ret, __val; \
> __ret = read_poll_timeout(__val = phy_read, val, \
> __val < 0 || (cond), \
> sleep_us, timeout_us, sleep_before_read, phydev, regnum); \
> if (__val < 0) \
> __ret = __val; \
> __ret; \
> })
>
> #define phy_read_poll_timeout(phydev, regnum, val, cond, sleep_us, \
> timeout_us, sleep_before_read) \
> ({ \
> int __ret = phy_read_poll_timeout_quiet(phydev, regnum, val, cond, \
> sleep_us, timeout_us, \
> sleep_before_read); \
> if (__ret) \
> phydev_err(phydev, "%s failed: %d\n", __func__, __ret); \
> __ret; \
> })
>
> and aqr_wait_reset_complete() needs to use phy_read_poll_timeout_quiet().
I agree that aqr_wait_reset_complete() shouldn't have built-in prints in it,
as long as failures are also expected. Maybe an alternative option would
be for aqr_wait_reset_complete() to manually roll a call to read_poll_timeout(),
considering how it would be nice for _actual_ errors (not -ETIMEDOUT)
from phy_read_mmd() to still be logged.
But it seems strange that the driver has to time out on a 2 second poll,
and then it's still not sure why VEND1_GLOBAL_FW_ID still reads 0?
Is it because there's no firmware, or because there is, but it hasn't
waited for long enough?
I haven't followed the development of AQR firmware loading. Isn't there
a faster and more reliable way of determining whether there is firmware
in the first place? It could give the driver a 2 second boot-time speedup,
plus more confidence.
next prev parent reply other threads:[~2024-08-06 11:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 7:50 [RESEND PATCH net-next v3 0/4] net: phy: aquantia: enable support for aqr115c Bartosz Golaszewski
2024-07-08 7:50 ` [RESEND PATCH net-next v3 1/4] net: phy: aquantia: rename and export aqr107_wait_reset_complete() Bartosz Golaszewski
2024-07-08 7:50 ` [RESEND PATCH net-next v3 2/4] net: phy: aquantia: wait for FW reset before checking the vendor ID Bartosz Golaszewski
2024-07-30 9:59 ` Jon Hunter
2024-07-30 11:23 ` Russell King (Oracle)
2024-08-06 11:36 ` Vladimir Oltean [this message]
2024-08-06 11:27 ` Vladimir Oltean
2024-07-08 7:50 ` [RESEND PATCH net-next v3 3/4] net: phy: aquantia: wait for the GLOBAL_CFG to start returning real values Bartosz Golaszewski
2024-07-18 12:23 ` Jon Hunter
2024-07-18 13:04 ` Bartosz Golaszewski
2024-07-18 13:29 ` Bartosz Golaszewski
2024-07-18 14:08 ` Jon Hunter
2024-07-18 14:13 ` Bartosz Golaszewski
2024-07-18 14:49 ` Jon Hunter
2024-07-18 14:59 ` Bartosz Golaszewski
2024-07-18 17:42 ` Jon Hunter
2024-07-18 19:05 ` Bartosz Golaszewski
2024-07-19 8:39 ` Jon Hunter
2024-07-19 3:41 ` Andrew Lunn
2024-07-08 7:50 ` [RESEND PATCH net-next v3 4/4] net: phy: aquantia: add support for aqr115c Bartosz Golaszewski
2024-07-10 10:20 ` [RESEND PATCH net-next v3 0/4] net: phy: aquantia: enable " 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=20240806113622.g5ixwcwiw3vpidc3@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=andrew@lunn.ch \
--cc=bartosz.golaszewski@linaro.org \
--cc=bgriffis@nvidia.com \
--cc=brgl@bgdev.pl \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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