Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4667050ybi; Tue, 11 Jun 2019 10:22:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIfsfSXI5EOg4HxOqFMmXAOPcE5S3+I9yO0R+IABK6r796adA+s5YvCCRRijnozyZQthg0 X-Received: by 2002:a65:620d:: with SMTP id d13mr21623138pgv.109.1560273761991; Tue, 11 Jun 2019 10:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560273761; cv=none; d=google.com; s=arc-20160816; b=Kn399KitIgaKhrUaPxRDensULsirEjI5PZR7NXPaO6ngUNwp2G5AAHVmRNz6LJgIEx RToDLO4pguc6kHawneeN8cdWBGrs7XxE1GoifospkftTluqCYH9RFGoygxrcUnp1/Bar 3Wb/uk/13w30GSJgFHsNV+iwW+DMduzWqjEHYt85jDjbxGEjDbUwrdL5PDOMsFC5kyre HlGBs2VsvJXriT3vJNkhqLk5dmVjMq8ADqRBDyruz71ULDZUX35LzfyZKDlVzws7XuGh Kqvwuq6VGkbVPZQqtL3yUI1olHrR+G/Se2PfRuGEff8Nuepvn0J5WZbH6DzmjT50a7JC fXow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XbtSJCa/usuhOtJOyLi4UURfxo0tXf7BtN9Rvkq+/+I=; b=0+WnRdkHcE64vZBuXa1zW083s1cFC/HkpxtObNo+S/FH7mxb2qll927u0lflWzYv48 UNz4xDNEH9VW9AgdDdomMD/J2VZ+OSjP6S8Av60oZZy6b8b7sM2jKXwaUxp+DsVxlUl2 rWCbvyREtgw6H20s1CR2w+txhyNbupi1FHCRYcIJdtWS8Ku2yr15Vd4AXTDdGWhDLuOn VDTb2oDQa69N03C2herHS3mLu0pze6xzb60Bpf8F/qUwjgmUvzi2kfIUC3626rVgBTYb k1jbCHxcgXLYzs5zRNeSsCDESaU1jbzD65etXmTnvQc8DngZNG7bqzaJXf4rgz2tjhoN MErA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si12726841plk.167.2019.06.11.10.22.27; Tue, 11 Jun 2019 10:22:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405980AbfFKRRi (ORCPT + 99 others); Tue, 11 Jun 2019 13:17:38 -0400 Received: from foss.arm.com ([217.140.110.172]:38422 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405778AbfFKRRi (ORCPT ); Tue, 11 Jun 2019 13:17:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BD400346; Tue, 11 Jun 2019 10:17:37 -0700 (PDT) Received: from redmoon (unknown [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BAB1C3F73C; Tue, 11 Jun 2019 10:17:35 -0700 (PDT) Date: Tue, 11 Jun 2019 18:17:33 +0100 From: Lorenzo Pieralisi To: "Z.q. Hou" , bhelgaas@google.com Cc: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Mingkai Hu , "M.h. Lian" , Xiaowei Bao Subject: Re: [PATCHv5 16/20] PCI: mobiveil: Add link up condition check Message-ID: <20190611171733.GB22836@redmoon> References: <20190412083635.33626-1-Zhiqiang.Hou@nxp.com> <20190412083635.33626-17-Zhiqiang.Hou@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190412083635.33626-17-Zhiqiang.Hou@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NB: Please trim the CC list and keep it to concerned maintainers. On Fri, Apr 12, 2019 at 08:36:48AM +0000, Z.q. Hou wrote: > From: Hou Zhiqiang > > Avoid to issue CFG transactions to link partner when the PCIe > link is not up. > > Signed-off-by: Hou Zhiqiang > --- > V5: > - Corrected the subject. > > drivers/pci/controller/pcie-mobiveil.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c > index 621852078caf..1ee3ea2570c0 100644 > --- a/drivers/pci/controller/pcie-mobiveil.c > +++ b/drivers/pci/controller/pcie-mobiveil.c > @@ -283,6 +283,10 @@ static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn) > { > struct mobiveil_pcie *pcie = bus->sysdata; > > + /* If there is no link, then there is no device */ > + if (bus->number > pcie->root_bus_nr && !mobiveil_pcie_link_up(pcie)) I think Bjorn mentioned this a million times already, eg: https://lore.kernel.org/linux-pci/20190411201535.GS256045@google.com/ this is racy and gives a false sense of robustness. We have code in the kernel that checks the link but adding more seems silly to me, so I am inclined to drop this patch. Lorenzo > + return false; > + > /* Only one device down on each root port */ > if ((bus->number == pcie->root_bus_nr) && (devfn > 0)) > return false; > -- > 2.17.1 >