From patchwork Thu Mar 4 04:41:11 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: 392725 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp348641jai; Thu, 4 Mar 2021 14:16:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDkMN60OSQzArT8vZG5XwUrUR98mRILh4T5fS+/AmZenlPU5k1EKQ44kkgcOqeM7muq9H5 X-Received: by 2002:a05:6402:220a:: with SMTP id cq10mr6692099edb.345.1614896188022; Thu, 04 Mar 2021 14:16:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614896188; cv=none; d=google.com; s=arc-20160816; b=ytVKKCHAoarS2Fxu9D69rHFG3g20g8rEV8icEqWtIfH9R3wMKhuiovyVoBAztrQZGa kOFgAIcmAWFdyCaXt84IlmhpyRu1jdlVWWsachd1YLsFLaF+i//iYaStCLv8jTC5HMWI eeRKnZI0kTwBNW3IMcg12sHTKORlmQ4GBAFeaPhO9tf+csvNU0xCPkxkLoNoHShEBKH2 PTLlNf5xmKTjNlf8BINU9uOlkYfaUJEqL0zudmODzllCjBjZqKvjnwdY5MIOaM+dRPVd EWCOuY73Ir5G/SLgCWpIRgpYDt/A3nKOjdHKF4OmTgBPtA9d/4G6Mlba2FmPIv7DgCqz VBDQ== 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=SOTaTj/Aw0wePJ/zwdm2TNVvrrX/1i3XgKod62Fy95AbYAXSUtnXbTiIDDS+YLghZZ IIjqmcSNWVk0lpfYMMsH/9avDQQN8jHuMzyESmZQ1eBY3sWcl76nMVVbLUfT+ozJIyPf tI2z+R9LpTmNbGi1nOCJWnCZhdnB4jLvM2n+xvuX97Uq2vyn/ZN5SJrj4tJPmalaURSO 2tSOBCqreWkQ1cYrSrzTX4gsnA8P/fNnaxKTjdHV3tdW1IEaxJCLgI08l3nyXDLUKL2f eVLzJYWptdWNd0KcjklYkS3jHEse9FI+xFR5rLtIUtXUDVxQCX6gUhCeTzNALY+rMsFD eClQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Tvntns1O; 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 k6si527757edj.545.2021.03.04.14.16.27; Thu, 04 Mar 2021 14:16:28 -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=Tvntns1O; 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 S233723AbhCDEn3 (ORCPT + 13 others); Wed, 3 Mar 2021 23:43:29 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:47112 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233699AbhCDEnS (ORCPT ); Wed, 3 Mar 2021 23:43:18 -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 1244fclP052737; Wed, 3 Mar 2021 22:41:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1614832898; bh=2gdcGvIiei2/gTTob5OagdVE47Jl6d4UbQfoaMc8G3o=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Tvntns1O9mFwr8M97BUwCpT6H8JQS6F8qX1mYCeFaoRcVBHqH4X415QeogWucA6Xz JT3Pva19t+sXEUYeXg5yvKr2c3rvl+GPP1D5fyXIUGgkycRacMfr6m1Hl+uwUKm0AU XyJZvnr44s38fq5RFW+ml8WA/oJDAif5cbYpirts= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 1244fcLC087978 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 3 Mar 2021 22:41:38 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 3 Mar 2021 22:41:38 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE101.ent.ti.com (10.64.6.22) 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; Wed, 3 Mar 2021 22:41:38 -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 1244fQfj042911; Wed, 3 Mar 2021 22:41:34 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , Lokesh Vutla , Subject: [PATCH v4 02/13] phy: ti: j721e-wiz: Invoke wiz_init() before of_platform_device_create() Date: Thu, 4 Mar 2021 10:11:11 +0530 Message-ID: <20210304044122.15166-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304044122.15166-1-kishon@ti.com> References: <20210304044122.15166-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: