Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp358688pxf; Wed, 10 Mar 2021 07:48:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyybnJBVzW3a/hCi5CdnVKCmLY5eqJCHXEw2977j2OC6X4mDgKzY+rB7HNsjj0F3+mbDfFa X-Received: by 2002:aa7:c353:: with SMTP id j19mr3981986edr.263.1615391283411; Wed, 10 Mar 2021 07:48:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615391283; cv=none; d=google.com; s=arc-20160816; b=CiR6LU6GIMtObjwtm7OJ/SSuGG+jxUN6x+Tz+UbSB9cVXT8Is2FLvSAGOkgUN3cswx HQhEp1fGFuuCcnZvG4fZMWvYOpK2d8Wj8P7h8RI7NECthFoO5CHMuYzHR489xRTvH7/d vQPVnINtrng+Yh3pKDFunF7LMZn/+rmkaz9z+HAkFI/huggvtv107i0YxVEbn9si4/J8 HbX6omLuLy7PxElvFdtALrdxdYqJOAbqUq36NW+TxRArZ3GVf12mj7i/9wxWr2OaHw7L +ZGQqld3VLglHxqYiHLJU8gQb1CSM0GbzBl1KGVFoIxdRjf3fIXfqPG8yL48D9GixCjh kPKw== 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=HaFrAFT+OIaZDPDO3Az8yK/yXsDpY/EXmk5glbSl+zUKmY6oq91ZUQ6G2k16zfpM9B Q4Jut3RkH2QINGrefPbx/ik3vRcqEuq/oc0krGZybx+aAFa8Uf1R8FZEvRNgd0eTlTDi 0sMf56H5woC9ggvrzdLPywoT3hK6NeO08SdX+8LjphdJEu1bdh0inM+yg+DZ+phY1rGP 0LvIZg/XCOeNUDTI6mKq79vE6Lod5r8E6QgswrLuTMH3430JGX1je0O4fKdr26JEJy9G A3HJJig+b6pdQuuGdNudiJL9KB4B3vD5xEUBa7eIFMs/OftjPwtsGqmkRQLfrszRU1RW JwkA== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 n16si11749889edo.395.2021.03.10.07.47.40; Wed, 10 Mar 2021 07:48:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S233243AbhCJPqo (ORCPT + 99 others); Wed, 10 Mar 2021 10:46:44 -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 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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: -- 2.17.1