From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDCDBC4646D for ; Tue, 11 Jun 2019 17:17:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8AA62086D for ; Tue, 11 Jun 2019 17:17:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405985AbfFKRRj (ORCPT ); Tue, 11 Jun 2019 13:17:39 -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 > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Pieralisi Subject: Re: [PATCHv5 16/20] PCI: mobiveil: Add link up condition check Date: Tue, 11 Jun 2019 18:17:33 +0100 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 Return-path: Content-Disposition: inline In-Reply-To: <20190412083635.33626-17-Zhiqiang.Hou@nxp.com> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: devicetree@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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C421AC4321A for ; Tue, 11 Jun 2019 17:17:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A8502086D for ; Tue, 11 Jun 2019 17:17:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XJkInAUU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A8502086D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cgD4Cc3hy0UZz6FQ6Ypa7g+QXJgaIjWi3nN70J8IBig=; b=XJkInAUUGGH2re L9iEBjKgQM59a6VNDKF+YmJ3fI6+POVZu6OM3kebQ5F5o5oNe5BubsUSStxLl1Mx4uMHX3O51pkVj FLOzgGKppwotZIBiYFO3S7ofMSReel5e/850lg/CmglpJ22kAqHN5TV4ZJuDg1+VQn3UFKCc9DifO 7eA8a4HeOq/pbXZf7xzTnjROIvOBKuhTj6SkOO5Yy+uqU10E5t9g6Uz/JfIVse1zygXHJnMOTubzm kl5EBw42d7yqNkerE0cZP0SJxlp7w1fRstGOTfD6HkdNZwTQ1P5tWY9amoiCwQ97fMXUWNzbxcbZY x1KpTouJA8ueAr0VprKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hakOz-0001KP-4u; Tue, 11 Jun 2019 17:17:41 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hakOw-0001Jk-Hf for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2019 17:17:39 +0000 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 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-Disposition: inline In-Reply-To: <20190412083635.33626-17-Zhiqiang.Hou@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_101738_630728_B6C101C3 X-CRM114-Status: GOOD ( 17.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , Xiaowei Bao , "linux-pci@vger.kernel.org" , "l.subrahmanya@mobiveil.co.in" , "will.deacon@arm.com" , "linux-kernel@vger.kernel.org" , Leo Li , "M.h. Lian" , "robh+dt@kernel.org" , Mingkai Hu , "catalin.marinas@arm.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel