From patchwork Wed Mar 10 15:45:47 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: 396731 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp483323jai; Wed, 10 Mar 2021 07:47:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoq6iyKRpIEgtuRvvnzWEXkg7zUBflNY68jzyvNI7IVCmiVTi62hu8IFeRx4GgOAbvQaQ4 X-Received: by 2002:a17:907:94cc:: with SMTP id dn12mr4313350ejc.177.1615391236805; Wed, 10 Mar 2021 07:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615391236; cv=none; d=google.com; s=arc-20160816; b=r78+qZC2oybB9AxyilTlEBCnzkNnzquhBYd22EZD1IPkg5ICVZZv0/FPYZ3YT2rrTP Js3pbNIbX94aEIkRRYvG0ZSBC4r8vZmTX1SM2zqz1hwaucgpmiMULpG0jFFHfKImc4eF lfZvudLotPuZC/GkL+Pb3xlUNL/eifl/u0JuS5C4pzUME37AFBZu3JLKfNVbT5bV8/jR 2oZ7BrBxC1VPAmVnK+Y0e/AvtNrEoK6dnAfRhdJ2hpKWqZDfsngk70Y4PtQ8fJkBximf Goi+Ai3aPJlbDaAOX3qYW9pHOldWP0sKpJY4SF/yjCqyPRaKDaXhytp98sEx+nlIawpG XjwQ== 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=R2vlX8auOjbLopoiS/2uk2TJKA3ADf2TUzeHZKwLWCs4gBmcEKAdZhUfIWAyOL1a7T y+US5ouJWSBJhXssB4hineNTaTAPqJYxetWB68oNbQe9/05y96619QqtjKb7ebclplL8 ibmMMW++cce2R4MmgkIWavsqWVNx51KNgf/KVR206oonaatrL2gRnEZ7zblNCR/yHFwb XeQXDOMn2Fh1zVV5EU4rVAQ/TX0cOgb9j/yXEnZNctffFtKnnn/HNnj1Z/9+XN0/yLxN LHfNI1CVv5nNpBEd+Eu2pofyG5wKKVWhM3kd4qr0ZiO32csbag+a9lXKPjvmfTMYkIOu aJSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hDaYAA+8; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 t3si4576077ejy.142.2021.03.10.07.47.16; Wed, 10 Mar 2021 07:47:16 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=hDaYAA+8; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S233201AbhCJPqm (ORCPT + 6 others); Wed, 10 Mar 2021 10:46:42 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:47664 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233205AbhCJPqR (ORCPT ); Wed, 10 Mar 2021 10:46:17 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 12AFkCt1067667; Wed, 10 Mar 2021 09:46:12 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1615391172; bh=2gdcGvIiei2/gTTob5OagdVE47Jl6d4UbQfoaMc8G3o=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hDaYAA+8ww9K8mcW6QMAVJIkcpN+ntIKmBN21FmEC4vKyyHvCH+zCbTBtyytAPHp8 EXx6HBe+ioTE92ikx/Y09kOOn1OXx0C1c8Jo7ZSnYz/tzxCGOKSS8bL+9/cBFJA/wJ 2GP91oXYflfWDgW5NwO+0tTz/HnkOPfby2RPRqcA= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 12AFkCpb046054 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Mar 2021 09:46:12 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 10 Mar 2021 09:46:12 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Wed, 10 Mar 2021 09:46:12 -0600 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 12AFk2KQ066370; Wed, 10 Mar 2021 09:46:09 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , Lokesh Vutla , Subject: [PATCH v6 02/13] phy: ti: j721e-wiz: Invoke wiz_init() before of_platform_device_create() Date: Wed, 10 Mar 2021 21:15:47 +0530 Message-ID: <20210310154558.32078-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210310154558.32078-1-kishon@ti.com> References: <20210310154558.32078-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 Reviewed-by: Swapnil Jakhade 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: