From nobody Tue Feb 10 11:39:43 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 AD1F0349B05 for ; Tue, 16 Dec 2025 14:24:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765895090; cv=none; b=BL/uRhKJ4ZWUvPuaHKpKhg2fhEW225xqMgM36slsQhHNSnBlkomRNYM1MtiZaouA6S6izM25xcs+TAlLiTEoyxGXd5n/l5y3U4RRLLMULmbgNuBZV661DaJLArfL+km8ylHzbaWk+Jf/T9kn/26ihzMoKVrE8a5UWM74WLxu3zc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765895090; c=relaxed/simple; bh=oE14/6tvrxpF238gkwc5DNpO7ZvJm6bZElXe/oOYj4M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=RWHGjJFL4GKNYO3QpIcfCnl7wQFHrJls561sTJ/4HF3ad+bkm9qUsOE1coRBHKPSAgPbskUDDQpnsmWnlTvthv7MmULUdtU10aCA7WGmLYS2Zf1Y1uaP8qItMuRFAlYswODl6d5/GyRyTQM7nrG3kmjHdgm/ecM8GZy+IMSYl78= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Zl/81Ci1; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Zl/81Ci1" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id B88AD4E41C2F; Tue, 16 Dec 2025 14:24:38 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 839B46071C; Tue, 16 Dec 2025 14:24:38 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C5DD611943685; Tue, 16 Dec 2025 15:24:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1765895073; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=d8MYPohReUBGKYu7q446IwdTcfInpw+Aoljj4WUmMaI=; b=Zl/81Ci17plA02vrBV7Gzl/e1Gw/F3PB3Uq8TMfK1VP8zlv9UDaruRXPsa7q0fsHIzsui6 ksQ2GJaTaAWGJl506DW+vvl47AnDqqbuLr4A5IEwznPyvqcLq+eEtp/bkBUVdsBZNinG71 QxBXscKOnmLiPCqmbYDSdku8vQafTk5bSd6cf9YF6qIVYZJlpvbAUksSqvk7VTZSAbD8Vu eBIfquUvm2SvFDw/ERlaUuTTxKT0Re55APQ6DntF5uy+FTPN07xAxrB2vLEtISMNWWJZej 3/t+s39Za944a4b3AIOsl5JS/SRJAWsnJ+T1mUcI+KQwaStCBUgYkV4QoCvi4A== From: "Thomas Richard (TI.com)" Date: Tue, 16 Dec 2025 15:24:25 +0100 Subject: [PATCH v3] phy: cadence-torrent: restore parent clock for refclk during resume Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251216-phy-cadence-torrent-resume-restore-refclk-parent-v3-1-8a7ed84b47e3@bootlin.com> X-B4-Tracking: v=1; b=H4sIAJhrQWkC/6WOzQ7CIBCEX6XhLKZgaIsn38N44GexxBYaqMSm6 bsLPelVs4fJzGT32xVFCBYiOlcrCpBstN5lczpUSPXC3QFbnT2iNWWEkBpP/YKV0OAU4NmHAG7 GAeJzhCI5KWrU8MCT2EvDuJHMqIYbgfLZKdf2tSOvt+x7W7aW/YNESvoHLBGcR0LXCtNqwuEiv Z8H647Kj6jgEv1A0OYHBM0IpikIwVkn6+YbsW3bG10rUv9VAQAA X-Change-ID: 20251110-phy-cadence-torrent-resume-restore-refclk-parent-f59fb5fc69fa To: Vinod Koul , Kishon Vijay Abraham I Cc: Thomas Petazzoni , Gregory CLEMENT , Udit Kumar , Prasanth Mantena , Abhash Kumar , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Neil Armstrong , "Thomas Richard (TI.com)" X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 While suspend and resume, parent clock config for refclk was getting lost. So save and restore it in suspend and resume operations. Reviewed-by: Neil Armstrong Signed-off-by: Thomas Richard (TI.com) --- Changes in v3: - catch RB tag. - Link to v2: https://lore.kernel.org/r/20251126-phy-cadence-torrent-resume= -restore-refclk-parent-v2-1-5d2eaa958b06@bootlin.com Changes in v2: - store parent configuration in cdns_torrent_refclk_driver. - add cdns_torrent_refclk_driver_suspend/_resume() functions. - use get_parent() and set_parent() operations to save and restore the configuration. - Link to v1: https://lore.kernel.org/r/20251110-phy-cadence-torrent-resume= -restore-refclk-parent-v1-1-1be87af7d19e@bootlin.com --- drivers/phy/cadence/phy-cadence-torrent.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadenc= e/phy-cadence-torrent.c index 37fa4bad6bd7..877f22177c69 100644 --- a/drivers/phy/cadence/phy-cadence-torrent.c +++ b/drivers/phy/cadence/phy-cadence-torrent.c @@ -397,6 +397,7 @@ struct cdns_torrent_refclk_driver { struct clk_hw hw; struct regmap_field *cmn_fields[REFCLK_OUT_NUM_CMN_CONFIG]; struct clk_init_data clk_data; + u8 parent_index; }; =20 #define to_cdns_torrent_refclk_driver(_hw) \ @@ -3326,11 +3327,29 @@ static const struct cdns_torrent_vals sgmii_qsgmii_= xcvr_diag_ln_vals =3D { .num_regs =3D ARRAY_SIZE(sgmii_qsgmii_xcvr_diag_ln_regs), }; =20 +static void cdns_torrent_refclk_driver_suspend(struct cdns_torrent_phy *cd= ns_phy) +{ + struct clk_hw *hw =3D cdns_phy->clk_hw_data->hws[CDNS_TORRENT_REFCLK_DRIV= ER]; + struct cdns_torrent_refclk_driver *refclk_driver =3D to_cdns_torrent_refc= lk_driver(hw); + + refclk_driver->parent_index =3D cdns_torrent_refclk_driver_get_parent(hw); +} + +static int cdns_torrent_refclk_driver_resume(struct cdns_torrent_phy *cdns= _phy) +{ + struct clk_hw *hw =3D cdns_phy->clk_hw_data->hws[CDNS_TORRENT_REFCLK_DRIV= ER]; + struct cdns_torrent_refclk_driver *refclk_driver =3D to_cdns_torrent_refc= lk_driver(hw); + + return cdns_torrent_refclk_driver_set_parent(hw, refclk_driver->parent_in= dex); +} + static int cdns_torrent_phy_suspend_noirq(struct device *dev) { struct cdns_torrent_phy *cdns_phy =3D dev_get_drvdata(dev); int i; =20 + cdns_torrent_refclk_driver_suspend(cdns_phy); + reset_control_assert(cdns_phy->phy_rst); reset_control_assert(cdns_phy->apb_rst); for (i =3D 0; i < cdns_phy->nsubnodes; i++) @@ -3352,6 +3371,10 @@ static int cdns_torrent_phy_resume_noirq(struct devi= ce *dev) int node =3D cdns_phy->nsubnodes; int ret, i; =20 + ret =3D cdns_torrent_refclk_driver_resume(cdns_phy); + if (ret) + return ret; + ret =3D cdns_torrent_clk(cdns_phy); if (ret) return ret; --- base-commit: 390f8dfb2f9876eeb827976fa26def5537440249 change-id: 20251110-phy-cadence-torrent-resume-restore-refclk-parent-f59fb5= fc69fa Best regards, --=20 Thomas Richard (TI.com)