diff --git a/patches.kernel.org/6.2.12-107-net-phy-nxp-c45-tja11xx-add-remove-callback.patch b/patches.kernel.org/6.2.12-107-net-phy-nxp-c45-tja11xx-add-remove-callback.patch new file mode 100644 index 0000000..66967a7 --- /dev/null +++ b/patches.kernel.org/6.2.12-107-net-phy-nxp-c45-tja11xx-add-remove-callback.patch @@ -0,0 +1,57 @@ +From: "Radu Pirea (OSS)" +Date: Thu, 6 Apr 2023 12:59:04 +0300 +Subject: [PATCH] net: phy: nxp-c45-tja11xx: add remove callback +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: a4506722dc39ca840593f14e3faa4c9ba9408211 + +commit a4506722dc39ca840593f14e3faa4c9ba9408211 upstream. + +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@vger.kernel.org # 5.15+ +Signed-off-by: Radu Pirea (OSS) +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/20230406095904.75456-1-radu-nicolae.pirea@oss.nxp.com +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + 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 5813b072..27738d1a 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); ++} ++ + static struct phy_driver nxp_c45_driver[] = { + { + PHY_ID_MATCH_MODEL(PHY_ID_TJA_1103), +@@ -1359,6 +1370,7 @@ static struct phy_driver nxp_c45_driver[] = { + .set_loopback = genphy_c45_loopback, + .get_sqi = nxp_c45_get_sqi, + .get_sqi_max = nxp_c45_get_sqi_max, ++ .remove = nxp_c45_remove, + }, + }; + +-- +2.35.3 + diff --git a/series.conf b/series.conf index 0758213..d3b315b 100644 --- a/series.conf +++ b/series.conf @@ -2334,6 +2334,7 @@ patches.kernel.org/6.2.12-104-riscv-add-icache-flush-for-nommu-sigreturn-tra.patch patches.kernel.org/6.2.12-105-HID-intel-ish-hid-Fix-kernel-panic-during-warm.patch patches.kernel.org/6.2.12-106-net-sfp-initialize-sfp-i2c_block_size-at-sfp-a.patch + patches.kernel.org/6.2.12-107-net-phy-nxp-c45-tja11xx-add-remove-callback.patch ######################################################## # Build fixes that apply to the vanilla kernel too.