Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1618739imj; Fri, 8 Feb 2019 04:39:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IYHlXC7QBvil6VtLiRAOraI6fz6bkDFKnicsK6QwdGrUni+7O0mK3mKceMNGjPtCmO1N2Oh X-Received: by 2002:a62:43c5:: with SMTP id l66mr22140748pfi.207.1549629557090; Fri, 08 Feb 2019 04:39:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549629557; cv=none; d=google.com; s=arc-20160816; b=uWoT0Vq5g9dn8fVDB9U5RVwFzcpvVNBoKCn+FBLO3ud4aEcN8fyELC3lz/m/gBOalm X9+1e/DCE0sQvqWpj0toGl7OoQvcKEzHbYbTQL5g5Ln5EIYwz28CTedAb8Ncijd0dm7H Og1wMUiJ9D7cgwPilEMVbQ2ywJfMxQZnNKA+ljUYNdRztDTFWMnnNDkJDMxfVzk658/4 AD3HVZ7ZNCa9iW5doz7A4E8qxdPsXdc6r0nZ+vl3JL+TwLVZ7N1J7erS2nzvsPdb4wXV AHdbt/807v5N2p9A5ELLxrImy6WA4LQNGbYPdr9Ec1nBER49iY3O7HLTHptU8VykmLgP 45bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=za3n79uTXhuAg89Odl5K7zA3/4teHlFt8f/2UCul1pI=; b=e35a22yunmAN0YZgzQeoefuDRhlkuxCLR9JsLF8SA5HyjTIwWOsuUTovHKEpuOPkA8 vRFXisPT6n2XOsavvOKm/ySOiZGdD4hbKmMVDuT9g82681e3eAmXzRxOZuezq1aalVX1 4XY7HKKYrWfy5kgchIhGtR5AFXJvRi1BO9nTg+UPNqRGE1KJOlzeGcZX82S/fAxXz+Yr dd8qXxxgF9QclIfV1OvZP5BwIUiMp3ZOubf1Zkkbe+qknRGlEOaGYsbIx+/ktQWQ9Kjq VTKD5EnuHXl8atCMWfuGUW6hbNI/mNuN+IKBjQmyQ/A3y9dhQ5x2gaPsAFjbT9DgzOY3 yOBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mobiveil.co.in header.s=google header.b=OVoNxJ6L; 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 q15si2036597pgc.475.2019.02.08.04.39.00; Fri, 08 Feb 2019 04:39:17 -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=@mobiveil.co.in header.s=google header.b=OVoNxJ6L; 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 S1727241AbfBHMii (ORCPT + 99 others); Fri, 8 Feb 2019 07:38:38 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35763 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbfBHMii (ORCPT ); Fri, 8 Feb 2019 07:38:38 -0500 Received: by mail-wr1-f65.google.com with SMTP id z18so3445505wrh.2 for ; Fri, 08 Feb 2019 04:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mobiveil.co.in; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=za3n79uTXhuAg89Odl5K7zA3/4teHlFt8f/2UCul1pI=; b=OVoNxJ6L+4h0zmcRL0/+4rPL4qAp+s8E3C9mBgNG/yVgl7yp+6sLCgN44Re9Gu9Wik f5q3MpCGafDHKYYqZ/Yl9KI4QDOZQ+NY+A1WSs8brIvZ5W/8k1hH5FE+Ltz5vD5IW5Y0 t+A80vouwIa00ZgMDXFMn6bwZrkAi9VYz/t4k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=za3n79uTXhuAg89Odl5K7zA3/4teHlFt8f/2UCul1pI=; b=nel/Tr5973l5cZYU9VO2LfIoXzvDCs5+d4yEIoymV9OefJ2aTsVpMxLW6jB5bIbpFd Sz/DdldQNAkTTCxzJvMdKTiXlTsA9/Ar6peaXHlx4UQ6nSsy3UxC+6jxfVjyYczAgjGc 95jwn7cQ0Fr3dBFvBAxsaae0gpgf/d614KunpmKORdDozbGrQ/p/UMGI9tH9rATw6juI G+iGZiw3jx4z15mTuX//h4gYN5BDrrH9c4EqVWbRyc3aQh08cTSDiFtdKIsL29Mz4ZGh f9S85Iyx1ukHgcebmct2BBak54BcP+XCHgRiW/DUp9dlM1zm8EHEKv/PLoDGGmukdsxg Lhgg== X-Gm-Message-State: AHQUAubA+GfJuL96hvm0Dq4fvCyIwl2Iblh3lSjKAghYYN82DuFtHz9y BUlUkTIK9aj7OKMUDW1R7EZ/DZGJwBWT9uRsvyUImQ== X-Received: by 2002:a5d:468e:: with SMTP id u14mr14295242wrq.253.1549629516223; Fri, 08 Feb 2019 04:38:36 -0800 (PST) MIME-Version: 1.0 References: <20190129080926.36773-1-Zhiqiang.Hou@nxp.com> <20190129080926.36773-18-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190129080926.36773-18-Zhiqiang.Hou@nxp.com> From: Subrahmanya Lingappa Date: Fri, 8 Feb 2019 18:11:15 +0530 Message-ID: Subject: Re: [PATCHv3 17/27] PCI: mobiveil: fix the checking of valid device To: "Z.q. Hou" Cc: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Mingkai Hu , "M.h. Lian" , Xiaowei Bao Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ZQ, On Tue, Jan 29, 2019 at 1:40 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Avoid to issue CFG transactions to link partner when the PCIe > link is not up. And allow CFG transactions to all functions of > Endpoint implemented multiple functions. > > Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host > Bridge IP driver") > Signed-off-by: Hou Zhiqiang > Reviewed-by: Minghuan Lian > --- > V3: > - No change > > drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > index dc5324d94466..1ae82e790562 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > @@ -29,6 +29,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->rp.root_bus_nr && !mobiveil_pcie_link_up(pcie)) > + return false; > + > /* Only one device down on each root port */ > if ((bus->number == pcie->rp.root_bus_nr) && (devfn > 0)) > return false; > @@ -37,7 +41,7 @@ static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn) > * Do not read more than one device on the bus directly > * attached to RC > */ > - if ((bus->primary == pcie->rp.root_bus_nr) && (devfn > 0)) > + if ((bus->primary == pcie->rp.root_bus_nr) && (PCI_SLOT(devfn) > 0)) here change "primary" to "number", as it's a bug in the original driver too. > return false; > > return true; > -- > 2.17.1 >