From nobody Thu Oct 2 15:35:40 2025 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 EFFB72E9EC7; Mon, 15 Sep 2025 08:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757923531; cv=none; b=ic5zhmMxWgqEMYD5E2TRTwGqbkFLLKeitTMHIQGYpgimFZs3IkAxo6/Vf+cWGqjPxcEOIpEqG34o1QhWhB2jbMRUbiq0BnHGNW882wYc/rcjeKqVofN3LDF4cKcUdr+L9tKVHXZSBlRgee7xerCXYRXftf5fCcIblf8kgrMA14I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757923531; c=relaxed/simple; bh=B74HX5e+TfRygmN6Og4POXNipS2VHQDoP8es2YE1kNc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=u38sQARDITpaQXxVpGktCbCbgwvuHylxgokXX6T/kNKpEaBOYzJ/sItnP5c00XnHmC4D+yWvK5wfmGKYO0aHBFPNoG0jVO93CDWr6lFFRTND6VfMYCfpYVDcs2ZGj82m6vMpzowmaX9x3bUycDSbU1uBsM+c7cElFdcYC2Z0sRA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=jjmz3yV5; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="jjmz3yV5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1757923529; x=1789459529; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=B74HX5e+TfRygmN6Og4POXNipS2VHQDoP8es2YE1kNc=; b=jjmz3yV5k4P8OXl/Km9t6DejuYxQoVdef6j4H/qGmewvXbkpjqiyPsoW UeZmlUdAquR2YzSxUafXOyZYYFMUe48kzvWNA4yO05TQL8t19BZ6f9BjB 9R8NkbY8qlk5ZU7P/0M76GkOYi8Ild+N4sV15Q3P8WeyLAyvNGa9EUNiT WNqBUV2ZKivq1OGP0hpfnYekZ2IoCZ71Y6/hBF0iMEl6rS7OJQRFtPfG8 6JZ5RdAjX6ND9bVxBslJIegU0kT2lsYSHTt+GsocuyfJ5apLMurCaZCyB Z3uqctM16f92FWlac8S9Bg+R5e5I8D5MQEEQDlLaeXrwEyuVTMAxKwMLy g==; X-CSE-ConnectionGUID: ewY7/e+gQ0WFS+nyOvSX4A== X-CSE-MsgGUID: 824WDI+DT/Wt1juxykZo1A== X-IronPort-AV: E=Sophos;i="6.18,265,1751266800"; d="scan'208";a="213889417" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 15 Sep 2025 01:05:22 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Mon, 15 Sep 2025 01:05:14 -0700 Received: from DEN-DL-M31836.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Mon, 15 Sep 2025 01:05:11 -0700 From: Horatiu Vultur To: , , , , , , , , , , , , , CC: , , Horatiu Vultur Subject: [PATCH net] phy: mscc: Fix PTP for vsc8574 and VSC8572 Date: Mon, 15 Sep 2025 10:01:12 +0200 Message-ID: <20250915080112.3531170-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When trying to enable PTP on vsc8574 and vsc8572 it is not working even if the function vsc8584_ptp_init it says that it has support for PHY timestamping. It is not working because there is no PTP device. So, to fix this make sure to create a PTP device also for this PHYs as they have the same PTP IP as the other vsc PHYs. Fixes: 774626fa440e ("net: phy: mscc: Add PTP support for 2 more VSC PHYs") Signed-off-by: Horatiu Vultur --- drivers/net/phy/mscc/mscc_main.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_m= ain.c index ef0ef1570d392..89b5cd96e8720 100644 --- a/drivers/net/phy/mscc/mscc_main.c +++ b/drivers/net/phy/mscc/mscc_main.c @@ -2259,6 +2259,7 @@ static int vsc8574_probe(struct phy_device *phydev) u32 default_mode[4] =3D {VSC8531_LINK_1000_ACTIVITY, VSC8531_LINK_100_ACTIVITY, VSC8531_LINK_ACTIVITY, VSC8531_DUPLEX_COLLISION}; + int ret; =20 vsc8531 =3D devm_kzalloc(&phydev->mdio.dev, sizeof(*vsc8531), GFP_KERNEL); if (!vsc8531) @@ -2267,8 +2268,11 @@ static int vsc8574_probe(struct phy_device *phydev) phydev->priv =3D vsc8531; =20 vsc8584_get_base_addr(phydev); - devm_phy_package_join(&phydev->mdio.dev, phydev, - vsc8531->base_addr, 0); + ret =3D devm_phy_package_join(&phydev->mdio.dev, phydev, + vsc8531->base_addr, + sizeof(struct vsc85xx_shared_private)); + if (ret) + return ret; =20 vsc8531->nleds =3D 4; vsc8531->supp_led_modes =3D VSC8584_SUPP_LED_MODES; @@ -2279,6 +2283,16 @@ static int vsc8574_probe(struct phy_device *phydev) if (!vsc8531->stats) return -ENOMEM; =20 + if (phy_package_probe_once(phydev)) { + ret =3D vsc8584_ptp_probe_once(phydev); + if (ret) + return ret; + } + + ret =3D vsc8584_ptp_probe(phydev); + if (ret) + return ret; + return vsc85xx_dt_led_modes_get(phydev, default_mode); } =20 @@ -2648,7 +2662,7 @@ static struct phy_driver vsc85xx_driver[] =3D { .config_aneg =3D &vsc85xx_config_aneg, .aneg_done =3D &genphy_aneg_done, .read_status =3D &vsc85xx_read_status, - .handle_interrupt =3D vsc85xx_handle_interrupt, + .handle_interrupt =3D vsc8584_handle_interrupt, .config_intr =3D &vsc85xx_config_intr, .suspend =3D &genphy_suspend, .resume =3D &genphy_resume, --=20 2.34.1