Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp628476rdb; Mon, 15 Jan 2024 08:18:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyOY7tns8uogc7lL1nGQfNDQvRsYbj9TOYUHehjVxM4mYak92NLjpLWi/ElFiQ9X2kRybE X-Received: by 2002:a17:90b:2d8e:b0:28c:3758:f38a with SMTP id sj14-20020a17090b2d8e00b0028c3758f38amr2915752pjb.5.1705335530825; Mon, 15 Jan 2024 08:18:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705335530; cv=none; d=google.com; s=arc-20160816; b=BrE/lOOo2VAIU4oGpkCEE53Hhkjb1xC3zCN9t+F1DJYSj0JRc0Wkfx4uVIBkIz7nSJ 3DDIYM3yiNZvc14jdSWfgZbq5bPMGATvN0DzZMU6U3igaKojsjQD/97olh5bWwCMMa4s ZLPbvQ21u1CUON4bX1qwDD4iLo6LbOXBHqXz3un/WceLKXyHF3m4pULzlVvIOaksv5Uu 1wEAg1ldlMwltOiFl3hx2N5nIY/Vt54RwP5ljhKAQ4oeTqLCO6Pi8JaTOve5hSXqxetN iKJG67B3HhscdGeviCJOnD7G0ui+qOM89+uN6x/pBrxsF+6tgp9Go0Q4V5k4EeeBHWKS ppVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=+S1bV3o/pT6DGMVe8pPN9SikJtzfTvzV+l25VERgt3Y=; fh=ihwxVJW8DyodhmdJo1IfhLUDNDWeXh+49SpWXYbpL2Y=; b=N9vzCy1zd8DyOSt4g3+4KqkE+e34pVi4YMjQJQRDeVjMBkdQDAPR2KULjOwJj+bJRX 3vlPoxLUfOid6YcJatITq4KAQhFBK0YA1JGOfwZcaNa0lY1GIVtMYqzp3MVXt/4pCV3d 64DNNT/s5Yg3aRd/9ivjVmmKFGTO++6OfxFsefRPI1KJXNOLZRiccnV1b9nJwv/v6lE5 oB/+G5cvPl2HwB0xC5Fdop4/BciZYOf3vHCB5fUz87hW9v0Pr2zmM2CpE8c4cVk8cq5B krek96ZM7VmlmTP5W+c5i2eNINyBEARieGMYRgnO+bGB4EEN1DeCU4hU0Psdz5949/h4 SXZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=IMcgHzS0; spf=pass (google.com: domain of linux-kernel+bounces-26239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26239-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y6-20020a17090ad70600b0028cee78aecbsi11927199pju.115.2024.01.15.08.18.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 08:18:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=IMcgHzS0; spf=pass (google.com: domain of linux-kernel+bounces-26239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26239-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 93971B21253 for ; Mon, 15 Jan 2024 16:18:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A66D118E28; Mon, 15 Jan 2024 16:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="IMcgHzS0" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 47F2717C60; Mon, 15 Jan 2024 16:16:25 +0000 (UTC) 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 Received: by mail.gandi.net (Postfix) with ESMTPSA id 8EE79C0015; Mon, 15 Jan 2024 16:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705335384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+S1bV3o/pT6DGMVe8pPN9SikJtzfTvzV+l25VERgt3Y=; b=IMcgHzS0EzcVT6FgexD4TRcnwzkFI9f80CEcAppC2cx5Heh/9WSGS2Iohpk0AFTqZhRcBD wZUstknu0sx+gNVczlRidJaQHE+Kiq/SHozs0Z8KpR5Ft17IWCzj5NnJJC1NI+2LMjamtm qHvrKBS2GzKuvN2szmTuk38pjUCjSuaKn9hkQdTYYOlD5eSJcoAY7USqeQT0IqFygXammI gqb5fmKhxLER0ydyt/qmNdQhrGHhRCt6h/eRqx5wEnzyHWZxk8yegOE4Z0qUJ0SKoixgEe t2q/VNy/VXjLF4JKhhZV2O3K9jJy3okMzsI4uuJjO9NBYn2w55U8p1p9SL/8/A== From: Thomas Richard Date: Mon, 15 Jan 2024 17:14:49 +0100 Subject: [PATCH 08/14] phy: cadence-torrent: register resets even if the phy is already configured 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: 7bit Message-Id: <20240102-j7200-pcie-s2r-v1-8-84e55da52400@bootlin.com> References: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Tom Joseph , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com Resets are needed during suspend and resume stages. So they shall be registered during the probe even the phy is already initialized. The function cdns_torrent_reset is renamed cdns_torrent_of_get_reset to make it clear. Signed-off-by: Thomas Richard --- drivers/phy/cadence/phy-cadence-torrent.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadence/phy-cadence-torrent.c index 94298ad9f875..100b58965558 100644 --- a/drivers/phy/cadence/phy-cadence-torrent.c +++ b/drivers/phy/cadence/phy-cadence-torrent.c @@ -2660,7 +2660,7 @@ static int cdns_torrent_clk_register(struct cdns_torrent_phy *cdns_phy) return 0; } -static int cdns_torrent_reset(struct cdns_torrent_phy *cdns_phy) +static int cdns_torrent_of_get_reset(struct cdns_torrent_phy *cdns_phy) { struct device *dev = cdns_phy->dev; @@ -2780,6 +2780,10 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) if (ret) return ret; + ret = cdns_torrent_of_get_reset(cdns_phy); + if (ret) + goto clk_cleanup; + ret = cdns_torrent_of_get_clk(cdns_phy); if (ret) goto clk_cleanup; @@ -2787,10 +2791,6 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) regmap_field_read(cdns_phy->phy_pma_cmn_ctrl_1, &already_configured); if (!already_configured) { - ret = cdns_torrent_reset(cdns_phy); - if (ret) - goto clk_cleanup; - ret = cdns_torrent_clk(cdns_phy); if (ret) goto clk_cleanup; -- 2.39.2