[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf1dd1a9-2e2d-473e-89f0-8e2c51226dfe@lunn.ch>
Date: Fri, 7 Apr 2023 16:20:37 +0200
From: Andrew Lunn <andrew@...n.ch>
To: "Radu Pirea (OSS)" <radu-nicolae.pirea@....nxp.com>
Cc: hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH net] net: phy: nxp-c45-tja11xx: add remove callback
On Thu, Apr 06, 2023 at 12:59:04PM +0300, Radu Pirea (OSS) wrote:
> Unregister PTP clock when the driver is removed.
> Purge the RX and TX skb queues.
>
> Fixes: 514def5dd339 ("phy: nxp-c45-tja11xx: add timestamping support")
> CC: stable@...r.kernel.org # 5.15+
> Signed-off-by: Radu Pirea (OSS) <radu-nicolae.pirea@....nxp.com>
> ---
> drivers/net/phy/nxp-c45-tja11xx.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c
> index 5813b07242ce..27738d1ae9ea 100644
> --- a/drivers/net/phy/nxp-c45-tja11xx.c
> +++ b/drivers/net/phy/nxp-c45-tja11xx.c
> @@ -1337,6 +1337,17 @@ static int nxp_c45_probe(struct phy_device *phydev)
> return ret;
> }
>
> +static void nxp_c45_remove(struct phy_device *phydev)
> +{
> + struct nxp_c45_phy *priv = phydev->priv;
> +
> + if (priv->ptp_clock)
> + ptp_clock_unregister(priv->ptp_clock);
> +
> + skb_queue_purge(&priv->tx_queue);
> + skb_queue_purge(&priv->rx_queue);
Do you need to disable interrupts? I suppose the real question is, is
it guaranteed phy_disconnect() is called before the driver is removed?
Andrew
Powered by blists - more mailing lists