From: Simon Horman <simon.horman@corigine.com>
To: Sean Anderson <seanga2@gmail.com>
Cc: "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
Subject: Re: [RFC PATCH net-next 1/7] net: sunhme: Just restart autonegotiation if we can't bring the link up
Date: Sat, 25 Feb 2023 17:56:22 +0100 [thread overview]
Message-ID: <Y/o9tr8bV/eW4xOI@corigine.com> (raw)
In-Reply-To: <20230222210355.2741485-2-seanga2@gmail.com>
On Wed, Feb 22, 2023 at 04:03:49PM -0500, Sean Anderson wrote:
> If we've tried regular autonegotiation and forcing the link mode, just
> restart autonegotiation instead of reinitializing the whole NIC.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
>
> drivers/net/ethernet/sun/sunhme.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index dd14114cbcfb..3eeda8f3fa80 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -589,7 +589,10 @@ static int set_happy_link_modes(struct happy_meal *hp, void __iomem *tregs)
> return 1;
> }
>
> -static int happy_meal_init(struct happy_meal *hp);
> +static void
> +happy_meal_begin_auto_negotiation(struct happy_meal *hp,
> + void __iomem *tregs,
> + const struct ethtool_link_ksettings *ep);
I think it is preferable, though far more verbose, to move
happy_meal_begin_auto_negotiation() before happy_meal_timer and avoid the
need for a forward declaration. I did try this locally, and it did
compile.
> static int is_lucent_phy(struct happy_meal *hp)
> {
> @@ -743,12 +746,7 @@ static void happy_meal_timer(struct timer_list *t)
> netdev_notice(hp->dev,
> "Link down, cable problem?\n");
>
> - ret = happy_meal_init(hp);
> - if (ret) {
> - /* ho hum... */
> - netdev_err(hp->dev,
> - "Error, cannot re-init the Happy Meal.\n");
> - }
> + happy_meal_begin_auto_negotiation(hp, tregs, NULL);
> goto out;
> }
> if (!is_lucent_phy(hp)) {
> --
> 2.37.1
>
next prev parent reply other threads:[~2023-02-25 16:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 21:03 [RFC PATCH net-next 0/7] net: sunhme: Probe/IRQ cleanups Sean Anderson
2023-02-22 21:03 ` [RFC PATCH net-next 1/7] net: sunhme: Just restart autonegotiation if we can't bring the link up Sean Anderson
2023-02-25 16:56 ` Simon Horman [this message]
2023-02-25 18:59 ` Sean Anderson
2023-02-22 21:03 ` [RFC PATCH net-next 2/7] net: sunhme: Remove residual polling code Sean Anderson
2023-02-22 21:03 ` [RFC PATCH net-next 3/7] net: sunhme: Unify IRQ requesting Sean Anderson
2023-02-22 21:03 ` [RFC PATCH net-next 4/7] net: sunhme: Alphabetize includes Sean Anderson
2023-02-25 21:07 ` Simon Horman
2023-02-22 21:03 ` [RFC PATCH net-next 5/7] net: sunhme: Switch SBUS to devres Sean Anderson
2023-02-22 21:03 ` [RFC PATCH net-next 6/7] net: sunhme: Consolidate mac address initialization Sean Anderson
2023-02-25 18:39 ` Simon Horman
2023-02-25 18:59 ` Sean Anderson
2023-02-25 20:27 ` Simon Horman
2023-02-22 21:03 ` [RFC PATCH net-next 7/7] net: sunhme: Consolidate common probe tasks Sean Anderson
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=Y/o9tr8bV/eW4xOI@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=seanga2@gmail.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