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 18EB4C433EF for ; Fri, 7 Jan 2022 23:03:30 +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=tym6xYtct1BmyxoToiN93jay7WxY7Jrr9qEXkm5599Q=; b=x2EYhH/55nR5xJ jeN0pZJzw3ZRomR773RlKReda7T77nmqY4d3eiQB6IQQlTlx4x0Fql3E+THqV1p00P8g41efgzczZ NqxF9bIhgGi/W6CiG3zUb3TAitRqtyrj70g8yt3qIOF7P8gOHda2/yDtBFgxABCekc4TetJRupwX2 bABdqiMXaHL6Qt62AKgARfZyd6NZ9EZNOqC9GfbQV23lLvE8XF/NWi5NyVddj0I/HjFsFCnYOgrfh sC2sWWozzdwFbmO2ngs68KW9SWFspXSdSiz2r+RENaXdgQkdPGYKvIH4HePMRTlIAHHLMaKxCn5fR DKQy7OKqUgSvPx+Z4u9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5yFH-005S0u-LD; Fri, 07 Jan 2022 23:02:03 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5yFE-005S01-7f for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 23:02:02 +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 ams.source.kernel.org (Postfix) with ESMTPS id 55570B8278A; Fri, 7 Jan 2022 23:01:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6867C36AE9; Fri, 7 Jan 2022 23:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641596517; bh=B0v7iGUci7GVYDzdLRx77A6fKfqdb4qSSCogIqDJ8Ec=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=PpsUtqiQCt8YbFCwFZYodxNP6vINYMVpPjhATJ7rYrs4f2Pb02CYJSS8h9BEdDv9+ 8Vx9ey3K0YfnP3JUpt962jGDFz66TfUix2SYLQGx9sP+tWbsd4RJLZfUCmLEzA/Avj HseUDM8G3JHkZxORXrpAzkWmyoizld66HY1+Sug0EnulHI7MN6ixQxG/uvsCxjVs+V f80Z4rWTylYcehWWN2hhomoR4+Xe5wg1BEGITEbn5wO89A/ZQk6ZxuxaoIZaJRX1vl TQH2Ej6/KuQQQRxlbxE64V7HYN04mhqaM/ehreiIPFSx4n4izb0IJWiIrORyYSmOHe zpQs6rLzoZP4Q== Date: Fri, 7 Jan 2022 17:01:55 -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 05/15] PCI: mvebu: Disallow mapping interrupts on emulated bridges Message-ID: <20220107230155.GA425110@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220107221348.5s4ehqhxunmoacbm@pali> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220107_150200_601410_711A76AF X-CRM114-Status: GOOD ( 32.12 ) 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 11:13:48PM +0100, Pali Roh=E1r wrote: > On Friday 07 January 2022 15:32:16 Bjorn Helgaas wrote: > > On Thu, Nov 25, 2021 at 01:45:55PM +0100, Pali Roh=E1r wrote: > > > Interrupt support on mvebu emulated bridges is not implemented yet. > > = > > Is this mvebu-specific, or is aardvar also affected? > = > This is pci-mvebu.c driver specific, it does not implement emulation of > neither INTx, nor MSI interrupts for emulated pci bridge (root port). As > we know this HW does not have compliant pci root port, it needs to be > emulated in driver, and emulation for interrupts is missing. (it means > that also AER interrupt is missing). > = > And pci-aardvark.c driver has same issue and similar patch is required > for pci-aardvark.c too. Marek should take care of it. But for > pci-aardvark we already have implementation which emulates INTx > interrupts and it is waiting for review on the list: > https://lore.kernel.org/linux-pci/20211208061851.31867-1-kabel@kernel.org/ > = > > > So properly indicate return value to callers that they cannot request > > > interrupts from emulated bridge. > > = > > Pet peeve: descriptions that say "do this *properly*". As though the > > previous authors were just ignorant or intentionally did something > > *improperly* :) > > = > > > Signed-off-by: Pali Roh=E1r > > > Cc: stable@vger.kernel.org > > > --- > > > drivers/pci/controller/pci-mvebu.c | 10 ++++++++++ > > > 1 file changed, 10 insertions(+) > > > = > > > diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/control= ler/pci-mvebu.c > > > index 19c6ee298442..a3df352d440e 100644 > > > --- a/drivers/pci/controller/pci-mvebu.c > > > +++ b/drivers/pci/controller/pci-mvebu.c > > > @@ -705,6 +705,15 @@ static struct pci_ops mvebu_pcie_ops =3D { > > > .write =3D mvebu_pcie_wr_conf, > > > }; > > > = > > > +static int mvebu_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8= pin) > > > +{ > > > + /* Interrupt support on mvebu emulated bridges is not implemented y= et */ > > > + if (dev->bus->number =3D=3D 0) > > > + return 0; /* Proper return code 0 =3D=3D NO_IRQ */ > > > + > > > + return of_irq_parse_and_map_pci(dev, slot, pin); > > = > > Is this something that could be done with a .read_base() op, e.g., > > make PCI_INTERRUPT_PIN contain zero (PCI_INTERRUPT_UNKNOWN)? > = > I'm not sure... maybe. I choose this style as after I implement > emulation of INTx interrupts it allows me just to replace "return 0;" by > "return my_mapping_function_for_root_port(...);". = OK, so even after you implement INTx for the emulated Root Ports, the default of_irq_parse_and_map_pci() is insufficient, and you will require an mvebu .map_irq() function. That's reasonable. "PCI_INTERRUPT_PIN =3D=3D 0" is the way software learns that a device doesn't use INTx, of course, and I suppose PCI_INTERRUPT_PIN already reads as zero, since mvebu_pci_bridge_emul_init() doesn't set bridge->conf.intpin, and I assume the default value would be zero? Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel