From patchwork Thu Dec 24 11:16:14 2020 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: 351881 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp6933083jai; Thu, 24 Dec 2020 03:18:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTEZCfXPj80pOv1fw2cXtybKlWMpMXFtfrAC3BYBXgygyz6D+NXFN9+z50Ga9iLDC6wIs1 X-Received: by 2002:aa7:d64d:: with SMTP id v13mr28604530edr.196.1608808733752; Thu, 24 Dec 2020 03:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608808733; cv=none; d=google.com; s=arc-20160816; b=GamKSJ/qvNzWobtTYQiSRU3L3m22+h45U+eMgl8O/WPrwBAq8aJwS31Yognh0+qaJU A1BV8jJcscruAU/xcC/HlpSul4SPpnWCpEiqg74weYlvIiPwdyMJlafxEn6RZinbccD3 ZT/6FyHlz07qCx0U2dsz0SmEMzqqQCb2Kd84waubCErHDiTVNalQiV8q+ZJUdb0f68Ea 8X00ZNgyRbzVxssbRrlP7wha10z+ZjSaFej/EwWBLktDWpVWATBXMkwH3r08/5sbJjf4 LhZkeanFfxXhHvvOmV7dsDOe/WH5DVpqLwWDMjLSsCE+vOQT6FOK1YefAQlrZHuWzINE Y50w== 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=NTvLEMflAztKktqpjh6r18tuK30GE4lQZASY4qEqAXs=; b=xLf9rrLU6x1EmxoZAAcYAKNbOn6eirz3B3x6CFXZwEXJ8Mskd50Z1N58cO8HAP1B/Y nDhN9cTQ1lrE9WmiGzv5SjVXnkeFc5Hb5LaT3kJTDgkOySOi5xGAvDGq1I0d+rP67fPX RHjF2n6BbHVqSG+5bQ2x8uGKUEqPHX7i/DslxOm8KzzFgF7ayhoyqmRfnHjQeLV2LqtX 8YlAxiM8C6Z4kgeNrOP7YZuwrX7xO+D3tZpbjUQsRpJjYKn+YdUn1GHVBAQmv3jdTHOv dUgWvaKzPb8KJSQfh8pix2Or90yeKDUktTxJ5A8Vy4IImkXtiU7UhKKWQCsgeIbIc81C T4dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ycvsksDH; 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 c4si11409789ejk.182.2020.12.24.03.18.53; Thu, 24 Dec 2020 03:18:53 -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=ycvsksDH; 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 S1727184AbgLXLRh (ORCPT + 14 others); Thu, 24 Dec 2020 06:17:37 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37718 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726746AbgLXLRg (ORCPT ); Thu, 24 Dec 2020 06:17:36 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0BOBGo6r041742; Thu, 24 Dec 2020 05:16:50 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1608808611; bh=NTvLEMflAztKktqpjh6r18tuK30GE4lQZASY4qEqAXs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ycvsksDH5RNTv27SdmCA4IEDfYOBdxr6oS2caC5181VaSa54RQguQNHUthnbnJFt2 CgYnU7cjadhW8ZujujSdC5DQrQUPoFX3h83LeNP2kxPi8EJ439k94NbTU8KLqx58lC MNtW7k6LHMY/2nW8JwIR27jZ2O+i3x/5vv7ErP68= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0BOBGoYl097615 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Dec 2020 05:16:50 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) 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; Thu, 24 Dec 2020 05:16:50 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE103.ent.ti.com (157.170.170.33) 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; Thu, 24 Dec 2020 05:16:50 -0600 Received: from a0393678-ssd.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0BOBGWG8116630; Thu, 24 Dec 2020 05:16:44 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Nishanth Menon , Philipp Zabel CC: , , , Subject: [PATCH v3 02/15] phy: ti: j721e-wiz: Invoke wiz_init() before of_platform_device_create() Date: Thu, 24 Dec 2020 16:46:14 +0530 Message-ID: <20201224111627.32590-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201224111627.32590-1-kishon@ti.com> References: <20201224111627.32590-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 c9cfafe89cbf..a75433b459dd 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -947,27 +947,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: