From patchwork Mon Oct 15 13:07:06 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: 148837 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3778554lji; Mon, 15 Oct 2018 06:10:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV61SH84jx66I9I280XbrWV2haeb2JQyTmMje5VfF42K3HXBIs7DH+6hxJudXsm7FJJoyj5q0 X-Received: by 2002:a65:66c9:: with SMTP id c9-v6mr16047883pgw.55.1539609043959; Mon, 15 Oct 2018 06:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539609043; cv=none; d=google.com; s=arc-20160816; b=udMQFq2NJag65Sam/IBOZrrpnUnHrMNpIJM7Q7byyQ0Gl9YfW7MaEXuCKoh+Qy3JRo 2/6Vz0QROBmk1ld+pvTE1FIXfMg+ecL4tlgdO91/ofNY3lvrqzkCuwitAJDAME0I4Grk 4x4C81NqRmyhUMw72kWsWF79U/5qODF2R+nTqzyFogvB5VleyHK1S1IoYelKFvJjqLOk tZ8k/RUUPdI4uNOquQPvxKtAGmjroqC2AaZ0AuYa1zYmqQRRze+90nX6hJHn69ye4faz tNV3eNRbCmo+IiWNUpcUbPD1EXHjwUgbEj8YSS6/wlNqS8yoq1WeQ7Zq4ROOBsGNnCq9 QFjQ== 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=zIHUw0IwTz54mYXhgOjwPNq/+QeIfE96N2Ao9dcGF2VKRTgIR319pqQjQYCS/37w41 p58JlHecv7QwQoXGe4cGqWRkU7qRMzxpy8tWiJtZtcDve+dsYZJRipyjcs/j6XtWCSkF P2v0AMVQ6Ako7ZpZZF8k3iFWmXoi7gTxuGeclT+Xbw74/T09cBjvhtqOeYHoQTIGaQzX F2Ifn551ADZZr8+FeN9PxULgGHlDJ0J+SRlYf2munMSOGNtMDZmZkuRfj2BL3e7FDDQ5 05Tzc5iw5hSrPYQgpvXB2ljRzUkmHb1NxFxKxbbUDl6yJtmjnlSbppCFMPsaRiaJOeRQ KKtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mSEePOxL; 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 r3-v6si8169164plb.197.2018.10.15.06.10.35; Mon, 15 Oct 2018 06:10:43 -0700 (PDT) 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=mSEePOxL; 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 S1726915AbeJOUy2 (ORCPT + 32 others); Mon, 15 Oct 2018 16:54:28 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:38748 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbeJOUxo (ORCPT ); Mon, 15 Oct 2018 16:53:44 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9FD8C1l119730; Mon, 15 Oct 2018 08:08:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539608892; bh=3AdF0VMpgtkV9yWrrnXvabWcf4Spt+07w4PmTvQYyH8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mSEePOxLDDPeC5VLFMwIzaewWuZBK7ZbIPNBbCQvFj1hWXTySTLxWaZJTHptRro3B DAKROCH86labCFOGWPTztonauFU9LsAWGrI6rg+A6TkanNsIOqgDEjsDpmCtZP16rQ pp3jSDa3TdXi/5Av/nkwUXAI7/2t4GP928ez1WbI= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9FD8C3N032668; Mon, 15 Oct 2018 08:08:12 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 15 Oct 2018 08:08:12 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) 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; Mon, 15 Oct 2018 08:08:12 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9FD7tL7009433; Mon, 15 Oct 2018 08:08:09 -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 04/19] PCI: keystone: Do not initiate link training multiple times Date: Mon, 15 Oct 2018 18:37:06 +0530 Message-ID: <20181015130721.5535-5-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181015130721.5535-1-kishon@ti.com> References: <20181015130721.5535-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 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;