From patchwork Mon Mar 8 05:07:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 395330 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1421860jai; Sun, 7 Mar 2021 21:08:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLHOZQzMu10CfuOMRbx/bnUYv9Af1Ix3jryiWgvHampX36u+RrP1nWLHnQFHJIkUpLl20y X-Received: by 2002:a17:906:110d:: with SMTP id h13mr13495959eja.357.1615180131665; Sun, 07 Mar 2021 21:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615180131; cv=none; d=google.com; s=arc-20160816; b=jL39Bk+xlaGTO1WJuUOx2BbNm1ojrmmyJFniT88lfdijR4Tb8Y2ajlo2Md6CXNhbOz s+CEjXkW8LLRqFOiFZJ/vLHZR7gMS0FQqCzDmUubElak96VozVGWNq5yeYlzjm2pPf0O s6m4OJLuQlsrcC4mwOryAob4dON/cEugh8oVmmi7kxB0csPkNRDq/WMUBFf611zOVteB y7kT2lJsm3+r5jw9xnmrIT7o311ramVI3kxaSdllSYK9pd+mEhGLn9OBnWs6h14w4gGg HVkILflLStd6IPpzhyPUTdlu6yAJyCiyVVqvLeaIV0+JxMgInjm7Xy0T08it9Dq79H70 XcVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kDesQPQvYRjN7JUDLg1aWRBB+2K3tXaBtJ48Qzz8gLs=; b=Fo48LaBn30vjNsboaUeqzObOMcpGzRAU2u/5PhNxPE6zfjdUR9+tFh/43Ay+DMQ4lK v7aC0oZfRao+Pc8XSs0aQ1nOsW33VjPDJuk9Z7iHT4M0qKuc4le5TYMiBbheUZ/UB2Zd X2/a9ms6DSC7zPSR/S5RbJIq00lYkLo4+0snmJREJKQanMfDkj/cXeLHFMpXGNzZjbzp RrqSGEg34JXblrADZ2CM9O3kKaFOkskUfZXDuAfx8o1PPlTbxZjDX30oXzl6iwDFJFvW ob971QLblIMXi0TRK7Bjcuu75wGVd0OBv6YSBCR+I4SQc7/KIRWUt4mgPjD4iLlo7zDc iT2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LiSpDpkd; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si6504740ejn.699.2021.03.07.21.08.51; Sun, 07 Mar 2021 21:08:51 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LiSpDpkd; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229474AbhCHFIP (ORCPT + 13 others); Mon, 8 Mar 2021 00:08:15 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37996 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbhCHFHu (ORCPT ); Mon, 8 Mar 2021 00:07:50 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 12857j9S023557; Sun, 7 Mar 2021 23:07:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1615180065; bh=kDesQPQvYRjN7JUDLg1aWRBB+2K3tXaBtJ48Qzz8gLs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LiSpDpkdv04HcKRhxO7apZWBqtBQDdcOd3V2xTCnCRX9MXb3/O00Vk+NKDweNlxTM iTKdguhJti+wQ8B7sBJo8zY83mfGB1W7dC45S+HLXW2N315ZXzh376qEtB07SopUTb IuQ8iv7TWK7UoJwWqjMt1pI+FeUjfKtUrYJYkoD4= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 12857jmk068185 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 7 Mar 2021 23:07:45 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Sun, 7 Mar 2021 23:07:45 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Sun, 7 Mar 2021 23:07:45 -0600 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 12857aKx086547; Sun, 7 Mar 2021 23:07:41 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , Lokesh Vutla , Subject: [PATCH v5 01/13] phy: cadence: Sierra: Fix PHY power_on sequence Date: Mon, 8 Mar 2021 10:37:20 +0530 Message-ID: <20210308050732.7140-2-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210308050732.7140-1-kishon@ti.com> References: <20210308050732.7140-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 44d30d622821d ("phy: cadence: Add driver for Sierra PHY") de-asserts PHY_RESET even before the configurations are loaded in phy_init(). However PHY_RESET should be de-asserted only after all the configurations has been initialized, instead of de-asserting in probe. Fix it here. Fixes: 44d30d622821d ("phy: cadence: Add driver for Sierra PHY") Signed-off-by: Kishon Vijay Abraham I Cc: # v5.4+ Reviewed-by: Philipp Zabel --- drivers/phy/cadence/phy-cadence-sierra.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 26a0badabe38..19f32ae877b9 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -319,6 +319,12 @@ static int cdns_sierra_phy_on(struct phy *gphy) u32 val; int ret; + ret = reset_control_deassert(sp->phy_rst); + if (ret) { + dev_err(dev, "Failed to take the PHY out of reset\n"); + return ret; + } + /* Take the PHY lane group out of reset */ ret = reset_control_deassert(ins->lnk_rst); if (ret) { @@ -616,7 +622,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) pm_runtime_enable(dev); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); - reset_control_deassert(sp->phy_rst); return PTR_ERR_OR_ZERO(phy_provider); put_child: From patchwork Mon Mar 8 05:07:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 395329 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1421854jai; Sun, 7 Mar 2021 21:08:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZX4ryVpnx5aAccmK6X7SGbwRomJQtpP3ts1fwey7A0cJ9N6cYAmMoF5HlGDaHJ5IRUAl3 X-Received: by 2002:a17:906:2816:: with SMTP id r22mr13213446ejc.2.1615180131278; Sun, 07 Mar 2021 21:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615180131; cv=none; d=google.com; s=arc-20160816; b=JQrg/zkUI2wsRkEx+fFDqMtDeSnUDktIupTKUmrc6VJ1XjVM8MzpRQVyVpjDAb/aWc XMKuXhwJMWMR5aElGKC3c3QD0/y98sNO1XVtEQm1AWTsTv3SG+/wSqdKOtekdi0n3bj5 hzo3vV+NU4NZGFD+J0IxVjEcardQys7PV8aFFSFnnTmaeARZhAxx4HL2LTvXxvPibKeu YO3Q+okvJuHI/QgGfVOJVXqFGfsuqOTAplP30Wa2iTURKwbwehu+TO7XGDRS2ifOw6NV bg4U99Dactzz6Alp3RSsMm1GcRNNWuFqF4sejrG1bPdnJM8rkNQHTUw18bWYX+I5uwdR UuDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2gdcGvIiei2/gTTob5OagdVE47Jl6d4UbQfoaMc8G3o=; b=FZJkgjYGAVanYQivVW/vavJ2W5Y2r7qaUMxkJvs/05zyNk5Fztx8bFLZtb4iTpULKD iYjGW7QR4sSxw/JmSbR49P8O7cfaSiIk1SvvVyfWh+dpMwA4w002NE6pDNLaS47qryOf rAwikoGcX/s4D6tfPn2uTfiogExFdv1wXUlGkUzB8ToVeaoaNFDxMngRVBl7zgnTuDKr CpPofmGC3rOSuerz3RGtYyL44hetI2yX/StMYU6iDz92Qq2dP14LjhcExexh30AqQzdz gq+K7oDUEar02o6s5z0qXSc4Omq6ZStW73eRXbnNHIbhKpsOi3Bitw+AnA7Ikz0v2Fp/ BuvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HNefMIbS; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si6504740ejn.699.2021.03.07.21.08.50; Sun, 07 Mar 2021 21:08:51 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HNefMIbS; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234283AbhCHFIP (ORCPT + 13 others); Mon, 8 Mar 2021 00:08:15 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:36254 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231231AbhCHFHy (ORCPT ); Mon, 8 Mar 2021 00:07:54 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 12857nDv077155; Sun, 7 Mar 2021 23:07:49 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1615180069; bh=2gdcGvIiei2/gTTob5OagdVE47Jl6d4UbQfoaMc8G3o=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HNefMIbSZj4d7XSMezl3owZ8s1uwfLtuC4P/YROmgunGCfIy545yocU9oOIBytdAY Uzpbm2Y1LZuaRK1CHuPZBH7L4wOVPYZt4ENisDayDwBuhOm+iP73otTCVoCNud5qKk a2f7lqnlm+KeEUVJ8AIfGKDpkpDTMltYl7GA48zQ= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 12857nVV039450 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 7 Mar 2021 23:07:49 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Sun, 7 Mar 2021 23:07:49 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Sun, 7 Mar 2021 23:07:49 -0600 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 12857aL0086547; Sun, 7 Mar 2021 23:07:45 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , Lokesh Vutla , Subject: [PATCH v5 02/13] phy: ti: j721e-wiz: Invoke wiz_init() before of_platform_device_create() Date: Mon, 8 Mar 2021 10:37:21 +0530 Message-ID: <20210308050732.7140-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210308050732.7140-1-kishon@ti.com> References: <20210308050732.7140-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Invoke wiz_init() before configuring anything else in Sierra/Torrent (invoked as part of of_platform_device_create()). wiz_init() resets the SERDES device and any configuration done in the probe() of Sierra/Torrent will be lost. In order to prevent SERDES configuration from getting reset, invoke wiz_init() immediately before invoking of_platform_device_create(). Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC") Signed-off-by: Kishon Vijay Abraham I Cc: # v5.10 --- drivers/phy/ti/phy-j721e-wiz.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index 995c7dbec77b..1bb73822f44a 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -1262,27 +1262,24 @@ static int wiz_probe(struct platform_device *pdev) goto err_get_sync; } + ret = wiz_init(wiz); + if (ret) { + dev_err(dev, "WIZ initialization failed\n"); + goto err_wiz_init; + } + serdes_pdev = of_platform_device_create(child_node, NULL, dev); if (!serdes_pdev) { dev_WARN(dev, "Unable to create SERDES platform device\n"); ret = -ENOMEM; - goto err_pdev_create; - } - wiz->serdes_pdev = serdes_pdev; - - ret = wiz_init(wiz); - if (ret) { - dev_err(dev, "WIZ initialization failed\n"); goto err_wiz_init; } + wiz->serdes_pdev = serdes_pdev; of_node_put(child_node); return 0; err_wiz_init: - of_platform_device_destroy(&serdes_pdev->dev, NULL); - -err_pdev_create: wiz_clock_cleanup(wiz, node); err_get_sync: