From patchwork Fri Jan 26 14:36:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Richard X-Patchwork-Id: 192639 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp711811dyb; Fri, 26 Jan 2024 06:59:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXxeWbsmXdC4Y18dNS1dKfAXz8nvbbNE+H+kVHGbLkAFbadRqleiDaQizfJwc3YBXSTJPa X-Received: by 2002:a17:903:41c7:b0:1d7:57d3:5983 with SMTP id u7-20020a17090341c700b001d757d35983mr1689491ple.15.1706281198947; Fri, 26 Jan 2024 06:59:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706281198; cv=pass; d=google.com; s=arc-20160816; b=kl7aTM5jUISFk5LE+mzpKCUBkCxYI9riE3ET2YmjpzOzZEIJ+k9/o0669LIA52dHD4 xKKpkNpsA2OGaXiIK29ZWyHxfQZr//e8t+DgqimkjXb0H7xR1X8dSiw1u+rhvWeYgUnc e5oZFQwdDaP2OoNqDNhu5DPChRmxqpxil4tA0yO6mdRyRTYNvnnZxn2OYa7oB0YUrHDS wBsGDH6TvNF6vgWxbjwdPK8g9bd8YTDISWc3IhkadzYpqdneeSZ8rkiENFNb3VefVOzF LsPPgt1WBhCUj+DOR2fOm5OfOkJL/Epmq5P2pRI5IBLQoAf2cUxjEI/SLZOU1f3GXamC 4JMg== ARC-Message-Signature: i=2; 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=N4pB3p7l4Wmx1B5ikJiVEe+u1C2q0FduhxiC+T5adXA=; fh=ihwxVJW8DyodhmdJo1IfhLUDNDWeXh+49SpWXYbpL2Y=; b=rVuAYSwTx1JaGel/IG7sC4EH4hKx6h/cUSKusrc8/dElTuIDX/veL1iU/6aifFFzvD pcOWT5e1TP+nHNHJ5WiWEhu6sBMg9AUYxhDv7zRyJI0gA+TkVWy5LcA6jP1+O51wvjCf dV+AoKf5SwnTqayk6upBrc9hR7h8cEkO/F9/pHxtvaTp+v87bCXHURAfTXUgAEF5Pjdb euY1qWG6wucbiVxZPlrGSgNcEk6NWfeTg9HNe67cFcKYzfkmuK6fQc3vAhF6laCY+t4j If415DkQZysqDL3O6PcPGBVmneg/WdDKnhpD+uXulX7M72B7TCyQAvsclchy875G9+xD j1pg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="TeN/aDnJ"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-40208-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40208-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e14-20020a170902ed8e00b001d72d235e2asi1210014plj.423.2024.01.26.06.59.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 06:59:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40208-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="TeN/aDnJ"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-40208-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40208-ouuuleilei=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 206F7B2AA0A for ; Fri, 26 Jan 2024 14:41:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7813720313; Fri, 26 Jan 2024 14:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="TeN/aDnJ" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 499A51F614; Fri, 26 Jan 2024 14:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279881; cv=none; b=DtbT8crtPsxNKmlmIXN2NaYuwcEdoNsNbiRXS0koP+QaAjhMCcpxLtN+4gt1SLdqzqhih7Gc/nBqb/vRdX/OT130cuE2e/VF5zlZd5MECmepzpDMWYMLv6sji3TthB3zPF4CVTu6nCDEUjUn3nK47kKV/7/8UPCMP2syJFdxtHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279881; c=relaxed/simple; bh=9Z2wuCIorg2817mV5JXqNVCfBWuO41XKwGO64R06XCo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=av8Q7TCXh+ji7lUBeCPoiYAjV5pmkIDGsp+3bADKg0URsQaJuVJRtAEToskaFRouXShZzfjAS6yjfWFrkvSpiadr6ig2/FsWIYUmCVTw1uBLj6L3PC81ox5hESFiOofIFbjvgGoi2SGUEjQcqfmgTiXOqVjWL7oDZ0Cuu62/s5w= 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=TeN/aDnJ; arc=none smtp.client-ip=217.70.183.194 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 53AE940010; Fri, 26 Jan 2024 14:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706279877; 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=N4pB3p7l4Wmx1B5ikJiVEe+u1C2q0FduhxiC+T5adXA=; b=TeN/aDnJfTUIuoo9ivm9jVMsuO/VzY5HtvEAR7CtPNYbwre0S2xufDx1v4ZsqQWH/2dZeM fCIPcmyZFEJJ7ToNTW/PEKXq8Kbga6jQtXGrJjQ+JsmcXeNhJZQxP7+keT6Y7wGBAl6WuV HwgBbvlQ/ZKjDFPb24/n2VNyfXoZJnKjDZ5YueNMeiKKj3mLNiE/tP0tgdYaVrS/1+mxE/ 60asLrVla4YCkFaPdXr71TSE7713QC64S8tLbramUvYfxMCvxhCvFCcaFfPQbdCKcIyaIO g34ogRTUB7BTdUrSrrgtxy0PXFTAW4Lin9X6fI3X/ZCeD6k5QfILOeIZBKVjRA== From: Thomas Richard Date: Fri, 26 Jan 2024 15:36:51 +0100 Subject: [PATCH v2 09/15] 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 Message-Id: <20240102-j7200-pcie-s2r-v2-9-8e4f7d228ec2@bootlin.com> References: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@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=84?= =?utf-8?q?ski?= , 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789165514115401800 X-GMAIL-MSGID: 1789165514115401800 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;