From patchwork Wed Oct 17 07:40:57 2018 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: 149029 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp327510lji; Wed, 17 Oct 2018 00:42:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Tddy9HRtg0kHw0jvTcurMJIiVGiwe/EJfxd2qzE8QnRLL+7Zoh3ENZSJ0/mk2p9JOoO5N X-Received: by 2002:a17:902:2e:: with SMTP id 43-v6mr24697896pla.290.1539762141944; Wed, 17 Oct 2018 00:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539762141; cv=none; d=google.com; s=arc-20160816; b=EvpyRtMjQF/PDLC78wroKsNbh3kBRMWSUg8sNILbMVEa0ajtbf/u1v7dlVWY4aOQ4g cgdI6+Uquy0ovsyfgeCa7LQWIlJgc1rNwa2XD/Ba42z8M75/jRvC/W0LJUyYcyoyfCuD +ufWdOdpTNTIwOukWD63SeRLli42MZzW3QVhDNviN29jnG07LyfpJjAd7F9ppw+VMX7G pa+SRVbHx/5JS5Tp2zddkwFkbzISX9yGhSJUvSiz/kBp/EmxukhcXdztSwxeAUUlkqcy BIp2utDoTl6SaZE/Fkg5ZdcX4yJ+9Z/rE3mbRUJkf90cOV/dX66VKNxW3VyIRi0lRUj6 XKiQ== 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=3AdF0VMpgtkV9yWrrnXvabWcf4Spt+07w4PmTvQYyH8=; b=nEHGRohPaFZiwbi69EH1f6TqZTkMPvfLnb+/LRcifvhGMx3Ocba5QEFRtgKW96YntS CBaIu1kPUCVm+Pxwt7vUfgAUmJMHuzmqCk7aRml3YnwMJoOdjMURgxpVissCGZk4i3cR Hzh1TxFXkNOVnLHwtzqw5VVONDyLNaYenBxw/z4lVY+n701BnS+Z+AQ1MRSobhtfPJUr AWIDS1Jttb2hzjP1BZJN4oqR4opRcXTneGoAdvS4h+lDTaOYYpc9j1Z7nps9diyDyTZr iUNI51tEp/YMM1kOnfLPg1sIbAO/APjK+AX4x3afJfMLuGk2mDuTbVlaxYw6XTXpVSNM EKaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=dTJ1aJIp; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id p74-v6si17315001pfa.44.2018.10.17.00.42.21; Wed, 17 Oct 2018 00:42:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=dTJ1aJIp; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 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 S1727257AbeJQPgo (ORCPT + 6 others); Wed, 17 Oct 2018 11:36:44 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56410 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbeJQPgn (ORCPT ); Wed, 17 Oct 2018 11:36:43 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9H7g0ad022831; Wed, 17 Oct 2018 02:42:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539762120; bh=3AdF0VMpgtkV9yWrrnXvabWcf4Spt+07w4PmTvQYyH8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=dTJ1aJIpyTli+QbK/3XU+bgaqeqvI7/5NdCJMUsUMcHJ7NhBI6/qLXfB18kBWg5Jr CjQP+kiX1LHP0u7deGcY+nVNF8wRdgX4HhmEz+Cpv/phBvKVVqp9XDmQkYTMK+M91z BmdABzLeG9sh5F3lHsZF2esYnRRL8b6B19ESguDQ= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9H7fx5O023348; Wed, 17 Oct 2018 02:41:59 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) 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.1466.3; Wed, 17 Oct 2018 02:41:59 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 17 Oct 2018 02:41:59 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9H7fgSP009413; Wed, 17 Oct 2018 02:41:56 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Lorenzo Pieralisi , Murali Karicheri , Jingoo Han , Gustavo Pimentel CC: Rob Herring , , , , , Kishon Vijay Abraham I Subject: [PATCH v2 04/21] PCI: keystone: Do not initiate link training multiple times Date: Wed, 17 Oct 2018 13:10:57 +0530 Message-ID: <20181017074114.28239-5-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181017074114.28239-1-kishon@ti.com> References: <20181017074114.28239-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org commit 886bc5ceb5cc3ad4b219502d72 ("PCI: designware: Add generic dw_pcie_wait_for_link()") while adding a generic dw_pcie_wait_for_link() performed a special handling (initiate link training multiple times) for keystone which is not required. This also resulted in unncessarily waiting for more time to establish the link even when no PCI device is connected. Remove it and make it look similar to other dwc based PCIe drivers. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pci-keystone.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index afb948372077..aa7e706fc37d 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -87,19 +87,17 @@ static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie) { struct dw_pcie *pci = ks_pcie->pci; struct device *dev = pci->dev; - unsigned int retries; if (dw_pcie_link_up(pci)) { dev_info(dev, "Link already up\n"); return 0; } + ks_dw_pcie_initiate_link_train(ks_pcie); + /* check if the link is up or not */ - for (retries = 0; retries < 5; retries++) { - ks_dw_pcie_initiate_link_train(ks_pcie); - if (!dw_pcie_wait_for_link(pci)) - return 0; - } + if (!dw_pcie_wait_for_link(pci)) + return 0; dev_err(dev, "phy link never came up\n"); return -ETIMEDOUT;