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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 83B8DC433EF for ; Fri, 7 Jan 2022 21:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=5Rps1fp3YiLASvYnsBvrF8Ge1+7IiVMKK0G4M76OUY8=; b=R8YHlN7Z6TRPZO AWImrJ2IPp/Fxsq9f1exVBFoQFbUlBVChy2D358wkpJx1FAwYFHChS9XGZdykuFhmT691wUOYEohZ 3cZdeZueHn3952HGLkzScw08Jnrt9jMKH3qIT6YfMbHTHhm7DwnL3D1Su69W5S06gEO1SsYxOHmZH OIuAfRF51XK4f5BnYaj+bdG+KNfmv6bzBEF2nvsbWtwgofkTaiBI74rn7Ai3nY+9FWKqmvidhdu+x Gx8xLOXV4lVuEZ5aieHE12/XJReJhuMQQ3Yr2LiINOhUl/qG3QZuxIPIP9BNPCz9Y2dziSIzjXfS2 /UcHYGK7Tf1iP7obUaLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5wUB-005Frn-AV; Fri, 07 Jan 2022 21:09:19 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5wU8-005FqJ-0W for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 21:09:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D092D62000; Fri, 7 Jan 2022 21:09:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E05A8C36AE9; Fri, 7 Jan 2022 21:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641589744; bh=K/JhrwqQbSMuUehTwf3TsC5iGJ5JuvB2mFD5WJYCTBw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=C687/ms8TsF5D5FYUSJ8JkUCZI2qUNUy6Ru/vxOD+KCd8ojQDMInY4fdY7dZkUTm0 QoMgHmVZyTsFCEyBqKzOQBmNumfOxV1MJNrmVJEm5YluP+MHXYWUZXt5l3mkJ1bBKJ TXC8q4nctPDoyqUyAaCHBUMw+6dweoml6yoS4XhHDdFMqaoWpbMwTw1/Sb6CdE43M8 eI3NZ0R8inL/ni1eC+90YBJE9Jyl7GWB6/wHsj/xgbM3zgiBDqMNZgYaqmGIwMmtAZ bBb9I2qz8QVHl+HR6ylBDhgFlV0qucRbMCzySXuvSPU7XEIAtWkGzWKLOyxkrAWZ0P 5CSI43yYmlNeQ== Date: Fri, 7 Jan 2022 15:09:02 -0600 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Thomas Petazzoni , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Marek =?iso-8859-1?Q?Beh=FAn?= , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/15] PCI: mvebu: Check that PCI bridge specified in DT has function number zero Message-ID: <20220107210902.GA403155@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220107181819.yiya3mxhtfsnubg4@pali> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220107_130916_121568_0FCB9093 X-CRM114-Status: GOOD ( 25.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 07, 2022 at 07:18:19PM +0100, Pali Roh=E1r wrote: > On Friday 07 January 2022 12:15:12 Bjorn Helgaas wrote: > > On Thu, Nov 25, 2021 at 01:45:53PM +0100, Pali Roh=E1r wrote: > > > Driver cannot handle PCI bridges at non-zero function address. So add > > > appropriate check. Currently all in-tree kernel DTS files set PCI bri= dge > > > function to zero. > > = > > Why can the driver not handle bridges at non-zero function addresses? > > The PCI spec allows that, doesn't it? Is this a hardware limitation? > = > It is software / kernel limitation. > = > Because this bridge is virtual, emulated by pci-bridge-emul.c driver and > this driver can emulate only single function PCI-to-PCI bridge device. That's weird. Why does pci-bridge-emul.c care about the function number? Or maybe you're saying that pci-mvebu.c isn't smart enough to build an emulated bridge at a non-zero function? Or, since this is emulated, maybe there's just no *reason* to ever use a non-zero function? It would really be nice to have the commit log and maybe even a comment allude to what's going on here . Otherwise this check sort of dangles without having an obvious reason for existence. Does this issue also affect pci-aardvark.c (which looks like the only other user of pci_bridge_emul_init())? > > > Signed-off-by: Pali Roh=E1r > > > Cc: stable@vger.kernel.org > > > --- > > > drivers/pci/controller/pci-mvebu.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > = > > > diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/control= ler/pci-mvebu.c > > > index 6197f7e7c317..08274132cdfb 100644 > > > --- a/drivers/pci/controller/pci-mvebu.c > > > +++ b/drivers/pci/controller/pci-mvebu.c > > > @@ -864,6 +864,11 @@ static int mvebu_pcie_parse_port(struct mvebu_pc= ie *pcie, > > > port->devfn =3D of_pci_get_devfn(child); > > > if (port->devfn < 0) > > > goto skip; > > > + if (PCI_FUNC(port->devfn) !=3D 0) { > > > + dev_err(dev, "%s: invalid function number, must be zero\n", > > > + port->name); > > > + goto skip; > > > + } > > > = > > > ret =3D mvebu_get_tgt_attr(dev->of_node, port->devfn, IORESOURCE_ME= M, > > > &port->mem_target, &port->mem_attr); > > > -- = > > > 2.20.1 > > > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel