From: Alessandro B Maurici <abmaurici@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH] phy: fix possible double lock calling link changed handler
Date: Tue, 23 Nov 2021 19:31:14 -0300 [thread overview]
Message-ID: <20211123193114.346852d6@work> (raw)
In-Reply-To: <06d158a7-4b1f-d635-2de8-7b34b9c2b0c2@gmail.com>
On Tue, 23 Nov 2021 21:32:56 +0100
Heiner Kallweit <hkallweit1@gmail.com> wrote:
> Great that you have test hw, could you please test the following patch?
> The duplex argument of lan743x_phy_update_flowcontrol() seems to be some
> leftover, it isn't used and can be removed.
>
>
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index 4fc97823b..7d7647481 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -914,8 +914,7 @@ static int lan743x_phy_reset(struct lan743x_adapter *adapter)
> }
>
> static void lan743x_phy_update_flowcontrol(struct lan743x_adapter *adapter,
> - u8 duplex, u16 local_adv,
> - u16 remote_adv)
> + u16 local_adv, u16 remote_adv)
> {
> struct lan743x_phy *phy = &adapter->phy;
> u8 cap;
> @@ -943,7 +942,6 @@ static void lan743x_phy_link_status_change(struct net_device *netdev)
>
> phy_print_status(phydev);
> if (phydev->state == PHY_RUNNING) {
> - struct ethtool_link_ksettings ksettings;
> int remote_advertisement = 0;
> int local_advertisement = 0;
>
> @@ -980,18 +978,14 @@ static void lan743x_phy_link_status_change(struct net_device *netdev)
> }
> lan743x_csr_write(adapter, MAC_CR, data);
>
> - memset(&ksettings, 0, sizeof(ksettings));
> - phy_ethtool_get_link_ksettings(netdev, &ksettings);
> local_advertisement =
> linkmode_adv_to_mii_adv_t(phydev->advertising);
> remote_advertisement =
> linkmode_adv_to_mii_adv_t(phydev->lp_advertising);
>
> - lan743x_phy_update_flowcontrol(adapter,
> - ksettings.base.duplex,
> - local_advertisement,
> + lan743x_phy_update_flowcontrol(adapter, local_advertisement,
> remote_advertisement);
> - lan743x_ptp_update_latency(adapter, ksettings.base.speed);
> + lan743x_ptp_update_latency(adapter, phydev->speed);
> }
> }
>
Patch tested and working as expected.
Alessandro
next prev parent reply other threads:[~2021-11-23 22:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 2:55 [PATCH] phy: fix possible double lock calling link changed handler Alessandro B Maurici
2021-11-23 4:18 ` Andrew Lunn
2021-11-23 4:49 ` Alessandro B Maurici
2021-11-23 8:21 ` Heiner Kallweit
2021-11-23 14:11 ` Andrew Lunn
2021-11-23 16:06 ` Alessandro B Maurici
2021-11-23 20:32 ` Heiner Kallweit
2021-11-23 22:31 ` Alessandro B Maurici [this message]
2021-11-23 14:09 ` Andrew Lunn
2021-11-23 14:14 ` Russell King (Oracle)
2021-11-23 15:58 ` Alessandro B Maurici
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=20211123193114.346852d6@work \
--to=abmaurici@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).