Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2037015lqp; Tue, 16 Apr 2024 05:54:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3K8uCjQgtW6rUpGcCzzwYI2kvSoykuYfT8Bd2Xqdlcias8L1kaO/Jj8gjZAK0OM8iNCMV9tvAx0VZsG6+sYbIt39FPFYFHno2izWWzw== X-Google-Smtp-Source: AGHT+IFHtGwFaQt1K/WFGLzG7o5XwYenEJ8fSNKaLfX6j23sEUo/RBjMb9d4sOGfqewceXQEnOqp X-Received: by 2002:a05:6512:3f08:b0:518:bbb8:e7a5 with SMTP id y8-20020a0565123f0800b00518bbb8e7a5mr7123306lfa.42.1713272066976; Tue, 16 Apr 2024 05:54:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713272066; cv=pass; d=google.com; s=arc-20160816; b=ScXDpd0fSnoEtsAmNozl/hz9qweLqTt8Mx5WaZ73LlPPxJyX7M5eWSptgbix//TlLL QYLSXYfXQ7WHhbu/F9V/k/YEsd5/be8DqD4uhrrwzXaHgZt2vIr8yXdWWkWv9u6OFzfL hRwTdIdfAaa+xXGHO0yX/sN35OgobLBC7+rdtbMLQn4/hITqtQevz32KuQY8ilRWLRZ3 obhYelftqBXV6wGebHyOzaNv1S1nUyBX1iqSJbqbPCTI3rxdpRaxlVCwDvgjW0D4R3I4 xdNFenC2hoz81LJ+FI0sfuxscipJoONuNUx8XrE9li92vmLVup3fYg9glvz+tY/wQ3wG th7g== 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=VPItTV/Mp42ilTj6tN8/dzU8kHkSA8+8bFCV4f5utvE=; fh=GkNdvG04Lunqqv1Jt68/BI66vXiv28hSSvpkD3jAO7w=; b=c55dSzKk18cdgjGuzL8cQt/0JphpGNvcR6ycjisiOaIUyf9wW0UVnDv+IQ4cQnlMEk 6u96E4T/0YONf+QFlI8BtRfI3n67hdqLxQLuTSzF9JQgD2RALVm6x5DodgYHy1Vy7xVu ppJgqV5/gDBZg2CpbR+xfppJ9tYJ6NQgQiqjRxtpJCU0AhOFO4pryWc8DXdIHi8qwAU+ Lab/AFr4SYRh+FB0m9mDIA8mhPhafHQBWCgIRW/yRLzXH3pxDVhdxnK4yY9GoP/j7JKe OQt/cKMBOAM8p61YYxVXfHEzl/Vpj3wH6Y5RFXfOSMq/e1MfLL6cgQ8YplNKQoL6SWjh AauA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=po115KdO; 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-146829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146829-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q17-20020a50aa91000000b005701ea8ccbcsi2919122edc.310.2024.04.16.05.54.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 05:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=po115KdO; 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-146829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146829-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A8DB01F22791 for ; Tue, 16 Apr 2024 12:54:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C08AD12D771; Tue, 16 Apr 2024 12:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="po115KdO" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 2E8BB12CD9B for ; Tue, 16 Apr 2024 12:53:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713271995; cv=none; b=iomYqPywMiMGHme5rzvyJi0HYbbcsmVUmA5R9XLMe3XydO/LHH1TFtzRoloVe0kRbdz+Fotw/dFB1wywenfmvPog1hwYXzvHzk/JVfbK/xlJUMoqi7uVbTO1JBz6WCzkcZpm7kgcMeIgWiqDW5uFKTX0hpqtbH/IhBD1rSbX0II= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713271995; c=relaxed/simple; bh=Ea8yruTncvXm5sRFL3kWVhDS9eIu8eUYRpop2ZECQjI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H+UiD7VQu13y5H/mBtM0Udkd9FAt7MCtUm+m15Ch/TUlMm8+AiSHzzVLPPKGvTSVsymJ93lKx5Ro+6tycliLyx+M3xYAhLXKZJrLf9khXCjrF7SI+iU6vhvXo7qIfzGURD+SiJC47LOsys/HlTDyuVMnPwDI75OF4ydhqPVjmjQ= 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=po115KdO; arc=none smtp.client-ip=217.70.183.200 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 361F020010; Tue, 16 Apr 2024 12:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713271992; 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=VPItTV/Mp42ilTj6tN8/dzU8kHkSA8+8bFCV4f5utvE=; b=po115KdOsG3t/mmyxxa9RY7XLvDp2aOIX3CTMiymKr+XSQXWVQ2i1h8s76kSAveyvXVMvt z7BFVWLI//KU1SXeA/E+P32LMXKZIpd2fnorFRgLc5VLQTcEo8P/PxryAGcp+GgvSsn4YT csvwnDjZSekOw+PLiuThbADaGQd9ory3lGJNUvBGSTUzybBsfNsN5vr/70Dx3yNZRkV9an rqBHflsM1PNBXTWp7Lg3qG33dra+zG/ENGYr9bFhMrNJaqWpsEmv8oNT+Dii1BddBKqtyd dw/+H1fkxg6vFSBnxL49k4REYVO/r/lCq6b5Mfs0yvFStVsU8uRTt42Rc3HCSQ== From: Thomas Richard Date: Tue, 16 Apr 2024 14:52:36 +0200 Subject: [PATCH 7/8] phy: cadence-torrent: remove noop_ops phy operations 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: <20240412-j7200-phy-s2r-v1-7-f15815833974@bootlin.com> References: <20240412-j7200-phy-s2r-v1-0-f15815833974@bootlin.com> In-Reply-To: <20240412-j7200-phy-s2r-v1-0-f15815833974@bootlin.com> To: Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel Cc: linux-phy@lists.infradead.org, linux-kernel@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 Even if a PHY is already configured, the PHY operations are needed during resume stage, as the PHY is in reset state. The noop_ops PHY operations is removed to always have PHY operations. The already_configured flag is checked at the begening of init, configure and poweron operations to keep the already_configured behaviour. Signed-off-by: Thomas Richard --- drivers/phy/cadence/phy-cadence-torrent.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadence/phy-cadence-torrent.c index 0636d5d04817..0e3c755e6089 100644 --- a/drivers/phy/cadence/phy-cadence-torrent.c +++ b/drivers/phy/cadence/phy-cadence-torrent.c @@ -1595,6 +1595,9 @@ static int cdns_torrent_dp_configure(struct phy *phy, struct cdns_torrent_phy *cdns_phy = dev_get_drvdata(phy->dev.parent); int ret; + if (cdns_phy->already_configured) + return 0; + ret = cdns_torrent_dp_verify_config(inst, &opts->dp); if (ret) { dev_err(&phy->dev, "invalid params for phy configure\n"); @@ -1630,6 +1633,12 @@ static int cdns_torrent_phy_on(struct phy *phy) u32 read_val; int ret; + if (cdns_phy->already_configured) { + /* Give 5ms to 10ms delay for the PIPE clock to be stable */ + usleep_range(5000, 10000); + return 0; + } + if (cdns_phy->nsubnodes == 1) { /* Take the PHY lane group out of reset */ reset_control_deassert(inst->lnk_rst); @@ -2308,6 +2317,9 @@ static int cdns_torrent_phy_init(struct phy *phy) u32 num_regs; int i, j; + if (cdns_phy->already_configured) + return 0; + if (cdns_phy->nsubnodes > 1) { if (phy_type == TYPE_DP) return cdns_torrent_dp_multilink_init(cdns_phy, inst, phy); @@ -2445,19 +2457,6 @@ static const struct phy_ops cdns_torrent_phy_ops = { .owner = THIS_MODULE, }; -static int cdns_torrent_noop_phy_on(struct phy *phy) -{ - /* Give 5ms to 10ms delay for the PIPE clock to be stable */ - usleep_range(5000, 10000); - - return 0; -} - -static const struct phy_ops noop_ops = { - .power_on = cdns_torrent_noop_phy_on, - .owner = THIS_MODULE, -}; - static int cdns_torrent_phy_configure_multilink(struct cdns_torrent_phy *cdns_phy) { @@ -2937,10 +2936,7 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) of_property_read_u32(child, "cdns,ssc-mode", &cdns_phy->phys[node].ssc_mode); - if (!cdns_phy->already_configured) - gphy = devm_phy_create(dev, child, &cdns_torrent_phy_ops); - else - gphy = devm_phy_create(dev, child, &noop_ops); + gphy = devm_phy_create(dev, child, &cdns_torrent_phy_ops); if (IS_ERR(gphy)) { ret = PTR_ERR(gphy); goto put_child; -- 2.39.2