Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp524650rdb; Thu, 15 Feb 2024 07:21:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV10H6fC3O18TqAsuQk/bJwKhrZTxW6oHyfpLt/f68/FnshQm2F2yYV9DVKC/8TVzC2dG+bL/X7VYcsy/5L0qBRgvcmZJ3FWAx/+bpZTg== X-Google-Smtp-Source: AGHT+IEyfyiZtOIZsCu6uEhpROOppAVg2pZM0jheHGYcdYyucJW4rxrqmVq5KkPcLwvjgA1A6AHA X-Received: by 2002:ad4:5743:0:b0:68f:280f:14cc with SMTP id q3-20020ad45743000000b0068f280f14ccmr1272391qvx.35.1708010498176; Thu, 15 Feb 2024 07:21:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708010498; cv=pass; d=google.com; s=arc-20160816; b=kjygWasey7GhwJggFhDqf3c9XTVstt5hWZ9J9qNCu3FGbZbgEp6wK9XJBk2BRYOwKY BUeDzudm2AB9wMrwgBfgc8uLOfeYuZH34UF4IB+PEoztOXpC3CZZ4D1SVQk1U9mpLjVR 5a5QTGPhDe9KfXt393zR/SkFk8a+qGYE9TSGOJmonaW/QSoIIg9lHEVnAxxcoD6J4rAM 1aN+lArpJ4zCSxORHTKbKzBR1lc9NNTCS9ZjKtc3F0CnNA6g9hBcxd+eSU2HU78Tue1r 14jQXvrvg+TtrsQ6pssRR7E0n7MVilLCtpImpbNALAaDBzMSdIkxnWL4e/yE0Exq0gNj IRQw== 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=ZY4zwQDv37yWJBGtlc4HVZQiyWGnejxAqR+BxRsb2To=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=YwWTLqfvUoDNVTm8G10FRFRSexkTbsf0bGLbBe+eWmUADh+Xx+iqzxDJIIduTkF2Px RQ6u8B1XtvMlwukMoPNyXdnvXbFdIsG3kHbflvS0V/fuLVqTZSj+CsXBODajN0FuAA8p GUq9dLmCxcKFsjJfVtJs9MuUFkyMG/mdzt10NspAhQX+wHMzOKRuiH/3vaMG55BpOHhp JXtz/fE3k0HdEtstL6N6QAFMZeweiifGrwV25Bz6eo1KPbzRBqK7pVe9640df91PCl3f fdW9BbUNgwgr9PYFbkh5uN3e1CjO2M3i54fUOnksL7nksqpPX/QHTqfxigh8yiCZ51iy 2tmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mMihYMdu; 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-67159-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67159-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fq4-20020a056214258400b0068ed2a8fee3si1745022qvb.7.2024.02.15.07.21.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:21:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67159-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mMihYMdu; 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-67159-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67159-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E480E1C21DA1 for ; Thu, 15 Feb 2024 15:21:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BE2F135A6D; Thu, 15 Feb 2024 15:18:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="mMihYMdu" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 41BBF134CF3; Thu, 15 Feb 2024 15:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010295; cv=none; b=cGDdBfeBVdga0ym+GJyeodu8DXsFB1qpW+zpORzl9sDVHluFiGepQvdxx+BF+b4/k0hT3QuyEh8o0kX2wLukViwTjzWYw3lUej7jUS8dDviUh3uRphEalYIzffPStnc/hmCCF+LyZPNzWT8KTs2UpeGYRL81rDkOZzQ79Zy+vn4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010295; c=relaxed/simple; bh=58Rx/Fpi5lkN1ZhQHKIMYHT21sc+k4stqHUV7CqcV3I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UWtiWP88M9Iw7rq2lcHI9KbqsNXajHLY9j+j1FAZ9wFtIYnMU0mf6QLsbfVYpxbEc4qZGUpy+agioYbMltKVanp0xBddUSWwJUSyee7C+Weve9XB4SKKIYbooXOW5uqhqCou5AvaoAK/MdrzgwNPt4YvecBgC/9kvUf0OE2Zr34= 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=mMihYMdu; arc=none smtp.client-ip=217.70.183.193 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 A27E9240002; Thu, 15 Feb 2024 15:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010291; 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=ZY4zwQDv37yWJBGtlc4HVZQiyWGnejxAqR+BxRsb2To=; b=mMihYMdu+xVGazYhvzrNJygS3F6vfTiAOpP4RpTyz32c1o8B3cQ5fZenBZXfPnzym+zTcN ZdXNIhWkJkFLRqQc0x4yi2dias50AwLN6FjMj31WkbL+ptbTqgf5utpG4QdpZn7yKvcd3U UnDx7pxNE58UaPoLK5k2LcTbuxgPoT26VDgXXVDMPYT3LSrukMxFpgEKshH0xQhk02BFRC rae/HNwQI/bodK+FwNUQ3jq8n6UCaTjqXypkupP/KDhWHQL2LqrhhBshxW1L+wTD2T2jSt LvwyG0kIL7rre5u0FFzE4j6/+x3Xu75Gwk1kMSOseS9MbGVPbHKnrdMxzihOuQ== From: Thomas Richard Date: Thu, 15 Feb 2024 16:17:56 +0100 Subject: [PATCH v3 11/18] 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-v3-11-5c2e4a3fac1f@bootlin.com> References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@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 , 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 803a76acf2fd..bba10ca0bfdd 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; @@ -2779,6 +2779,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; @@ -2786,10 +2790,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