From patchwork Mon Jan 14 13:24:15 2019 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: 155476 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3656942jaa; Mon, 14 Jan 2019 05:27:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN6XXqnZ2Mgyg7iKDXEWcd1BY870c9Gvs/jL8GVx6+0GV9HLX7mG7tMcEUFL2qoVcW+kJNFm X-Received: by 2002:a63:f34b:: with SMTP id t11mr22857751pgj.341.1547472423967; Mon, 14 Jan 2019 05:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472423; cv=none; d=google.com; s=arc-20160816; b=sHxplBVBaDH4RX021z5dPr2n3Bi/6EhFWbjXv98nsMC2V+q2Aq4YryL/PK1BUnMHKv lTI9zqBAbRnPEm7kk3R7ItGleivGYl//POxqkxMLPciMUHzBdSt2wyP8XKb/MQbDGVem bdxvAzTvao3Pj6ZX/Uk4ta/P26rGY+olFh2IfZ37HsCCxaZ9ejLsxCpfrifWFPPCjewO YY4qULzqpq+TQ7z8fhI7xH9Bx/FWWeSmq96S2NvzHllaB9Mqsr5MnMKiI/GxWuQh4CcF s+kxpLNtTIM5UEViY7UJFWTLEybxRZZ4ht5neI2TKFGWh2ZOr/5bvB27MY7H1BpQGRu7 jS4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4d1hv974DlQuBmZ/Ggs87YZnRdDcz6OLaZ5/NqWUvn4=; b=FkMJ8ie4Ksn360YzsfHrzAHMefVqKXf7/fCpdk3XWw0I07QCznF2XBrQB8Iylu6zkt emJkNEK4bX8IE1g46PRV0OKJU9opWFaZhjS0CH5V4fBmlRbQ/DOEYiFjS+mKtbz96D0S hSGLZyaKBtUL3dKMMC2JfWEM+imj/4btt0L2I2C4Inodzn6yxKIxu8xT7nLfOmYtKT0t KuNbqkl401jZD45F4B5cfIaZAQZh3crJbywKqOUbMqc0lDwTdfWvHCZFmxG306tWvybP TypcxjEQpmZx8m4gaY2sv/A/GhYd2kuQ5ee0WZ4V2kqJQiTiNKl+KPqkuLL7tJucL9+i cBtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fv7lvd0y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id b3si326645pgh.496.2019.01.14.05.27.03; Mon, 14 Jan 2019 05:27:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fv7lvd0y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726959AbfANN05 (ORCPT + 31 others); Mon, 14 Jan 2019 08:26:57 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37530 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726570AbfANN0z (ORCPT ); Mon, 14 Jan 2019 08:26:55 -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 x0EDQ9U3098224; Mon, 14 Jan 2019 07:26:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547472369; bh=4d1hv974DlQuBmZ/Ggs87YZnRdDcz6OLaZ5/NqWUvn4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fv7lvd0yI0YqvB+Bmfx/l6qx2gCvEwKD1lzBoE69GFO9XpgTJIq9AiBzzNLKoSSNT Fati1EOsDVxi8Fvo/fZelkO2lr+A+tk+oMtcA+dbVVdb6VVjynLwcONmY805lEDa/b sEqMNS2SsfoWpF0c4338QThzH9rKao+kHIxVSbSU= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0EDQ9kF012402 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 14 Jan 2019 07:26:09 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 14 Jan 2019 07:26:08 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 14 Jan 2019 07:26:08 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0EDOoWb028516; Mon, 14 Jan 2019 07:26:04 -0600 From: Kishon Vijay Abraham I To: Gustavo Pimentel , Rob Herring , Lorenzo Pieralisi CC: Kishon Vijay Abraham I , Jingoo Han , Bjorn Helgaas , Mark Rutland , Arnd Bergmann , Greg Kroah-Hartman , Murali Karicheri , Jesper Nilsson , , , , , , Subject: [PATCH 15/24] PCI: keystone: Invoke phy_reset API before enabling PHY Date: Mon, 14 Jan 2019 18:54:15 +0530 Message-ID: <20190114132424.6445-16-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190114132424.6445-1-kishon@ti.com> References: <20190114132424.6445-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SERDES connected to the PCIe controller in AM654 requires power on reset enable (POR_EN) to be set in the SERDES. The SERDES driver sets POR_EN in the reset ops and it has to be invoked before init or enable ops. In order for SERDES driver to set POR_EN, invoke phy_reset API in pci-keystone driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pci-keystone.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index c2873339809a..e2f4e7c01b5a 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -873,6 +873,10 @@ static int ks_pcie_enable_phy(struct keystone_pcie *ks_pcie) int num_lanes = ks_pcie->num_lanes; for (i = 0; i < num_lanes; i++) { + ret = phy_reset(ks_pcie->phy[i]); + if (ret < 0) + goto err_phy; + ret = phy_init(ks_pcie->phy[i]); if (ret < 0) goto err_phy;