Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 338222D23A6; Sat, 12 Sep 2026 13:22:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789219368; cv=none; b=M+BOco4x6zMVnsuc4WatoNq2iMIRhrtw6zztx0KbDm5t7Q2C9+wLxaoynt2G2J/PvvAneZLkRUoULio0E/iaQmu37L0vc+SVAL4Jyt5i/q0BgxB5+NxsYjWZ8ryrcjs327ZGXx+UbpSbzPh2OLgjvEf9qNlo+5D/CPxeJx8EoAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789219368; c=relaxed/simple; bh=zOI4I0jUh+Dtvgz498UiI/yjcXQclG+BVOHQ303ORb8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OWS0sgBdOnsEQequFS9B1B9a9f18pJHAr15OVzbTuB6bfPnRNdUlnNxxu7zL5SFZbYXMiNp0EASBWCD5reoGgAqByjxMFMAhQWDormvKaFacFkB0ICggVsuGOmqfAWhW7AaOjZCs5lcTVUlcci0UxIe+jAIq6ZM62P9BlQfS7I4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yqH4RJau; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yqH4RJau" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DC0C1F000FF; Sat, 12 Sep 2026 13:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789219366; bh=TSIPWhLZ3vGGFW5toLuXMV3j+6XHnSSIqDvioYrrtOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yqH4RJauJa1mx5Tlsh+p3Opy9rFo7gzZ5Q+g+vsiYpgX96rgUwAMWlSOuEjcXoNSH rZxDD/+GWGfFIlRn+T5tRYCBIoq7lcDvYhY8MNmKEcrSpkaH7XuGniCwBPrZcgM4lP H0jJ105qmZ+3a2IESCVKk2cOz+s4NKnLgdVe9LyI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wei Fang , Frank Li , bui duc phuc , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 1334/1376] net: fec: only stop PTP if it was initialized Date: Sat, 12 Sep 2026 09:02:40 +0200 Message-ID: <20260912065637.263536800@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: bui duc phuc [ Upstream commit dd890ae29299636fb037276fc1b5238698d08b03 ] fec_ptp_init() is only called when fep->bufdesc_ex is available. However, fec_probe() unconditionally calls fec_ptp_stop() on the failed_init path, and fec_drv_remove() unconditionally calls fec_ptp_stop() during device removal. Check fep->bufdesc_ex before calling fec_ptp_stop() in both paths to avoid stopping PTP when it was not initialized. Fixes: 32cba57ba74b ("net: fec: introduce fec_ptp_stop and use in probe fail path") Reviewed-by: Wei Fang Reviewed-by: Frank Li Signed-off-by: bui duc phuc Link: https://patch.msgid.link/20260826103428.32807-1-phucduc.bui@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/fec_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 22cd47d19ce24..1af74bbf385f2 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -4601,7 +4601,8 @@ fec_probe(struct platform_device *pdev) failed_irq: fec_enet_deinit(ndev); failed_init: - fec_ptp_stop(pdev); + if (fep->bufdesc_ex) + fec_ptp_stop(pdev); failed_reset: pm_runtime_put_noidle(&pdev->dev); pm_runtime_disable(&pdev->dev); @@ -4643,7 +4644,8 @@ fec_drv_remove(struct platform_device *pdev) ERR_PTR(ret)); cancel_work_sync(&fep->tx_timeout_work); - fec_ptp_stop(pdev); + if (fep->bufdesc_ex) + fec_ptp_stop(pdev); unregister_netdev(ndev); fec_enet_mii_remove(fep); if (fep->reg_phy) -- 2.53.0