Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp944054pxb; Tue, 14 Sep 2021 12:10:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1aU8Uql9aUMNHr5ilknrPew9Q2sapxj9wbnQBvOlu5f+e+D2aHfREHlKd9xb5FgklKE3Z X-Received: by 2002:a05:6638:1403:: with SMTP id k3mr7104831jad.102.1631646625197; Tue, 14 Sep 2021 12:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631646625; cv=none; d=google.com; s=arc-20160816; b=ZCHfqCuS8syhK+wXpfMKZ8siEol3eYS3fcQ1k+2iMZshoE+NlJ5phSae0HLucwT92a dhBH997XULM0vLi2zy9UE14v0uTyaGlFG6zPkCmjFz1k0cMVDDSQnJwZkkek/b7CwBuF xDBD+vKLcwUhJ27kPZTX3KzdMgwqpcK07W51L4mP0EPovM9zWD8cFAkB6UJxIl+khXHu 0JYxikI+YH9kthLM7h3EJEVIQ7Ip0BFZMChUL2DAFVyvDFstcHUf4HDOP9MxuB5GKo+l HuPMUnM5HntY0Uq+T18RA6rk3i8kr5dhZhIjhv4N5pimFqIUvbmu/azdL3/RGfQruXJ0 YpGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=ti295cst4+HWUGhT2mF1LaY/KwBb+kHeh2vrEm0ILL4=; b=r2xykGTJq2JTu8vVEfZMGB6kh94AuJhTW/wIeBq/d1KPBnb8eOvIfa6Uq6p6Y4VJiC QNeaDgggpY1CvECdeU+NM6eHNgctr859U9EYwfFZwM32+PYo9DA+6Yz3XhjIpE7oSo2Y BTqcxayqe98h5fZw4r06Ldfb7QA3btijUy9Pof/z3+ab2U2+Hb4VEHmWcQNwOgBbL4NM a+uRVcJDlV+LGANm0UkEKm1wDvaeryDWueWMroAxuHY/FhW55v2UIefk5S41dn9JJeEJ 4VwoKJstw81yCCOiZQiIHLrdqcdeVCCWhN3qIIBi8Jm6MmEbThRNqTVMC99pBbFJ1zw6 kdNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tr+fY58j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si36834ila.177.2021.09.14.12.10.10; Tue, 14 Sep 2021 12:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tr+fY58j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbhINTKl (ORCPT + 99 others); Tue, 14 Sep 2021 15:10:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:39708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbhINTKk (ORCPT ); Tue, 14 Sep 2021 15:10:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C268A60FED; Tue, 14 Sep 2021 19:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631646563; bh=cfhCymTR+NW29/iSC+hTY93GTILfL5f/hAJx/9UgVVw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=tr+fY58jSFJxzkQD3+ZeNTH6ot3AQjr9hI5N+KRk/pUe10bWgj9E2fWblopTfx8zu uJIocMIZvsIk+OM/+eDPkmlt2wgJc3vcky+ov0S1t77UOIhOkN+YUuXHs3qPv2DVpo 2qm+h9xVEff8lNQTlneJLjJmC0HIQ/OZd4yy7SwFe5zIklTeX1iOOX755GC3akda+9 odhXDgZgd/PesEkHSwIMLPXCbdgRPN4yoFLR200yMTObkB8Om7roHaF7z9jTYQyd+G SUc7CgSOtcb+YIT+U5cYP/1TwcVCJeIevhLQuGn5GtusuoNCPhsL9C03y0vFhgYnQQ kKCNi+Gr7wPrg== Date: Tue, 14 Sep 2021 14:09:21 -0500 From: Bjorn Helgaas To: Marc Zyngier Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Alyssa Rosenzweig , Stan Skowronek , Mark Kettenis , Sven Peter , Hector Martin , Robin Murphy , kernel-team@android.com Subject: Re: [PATCH v3 03/10] PCI: of: Allow matching of an interrupt-map local to a pci device Message-ID: <20210914190921.GA1445505@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210913182550.264165-4-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 07:25:43PM +0100, Marc Zyngier wrote: > Just as we now allow an interrupt map to be parsed when part > of an interrupt controller, there is no reason to ignore an > interrupt map that would be part of a pci device node such as > a root port since we already allow interrupt specifiers. > > This allows the device itself to use the interrupt map for > for its own purpose. > > Signed-off-by: Marc Zyngier Acked-by: Bjorn Helgaas I assume Lorenzo would merge this along with the rest of the series. If I were applying I would silently wrap to 75 characters, s/pci/PCI/ in subject and above, and maybe incorporate a version of the subject line in the commit log so it says what the patch does. > --- > drivers/pci/of.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index d84381ce82b5..443cebb0622e 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -423,7 +423,7 @@ static int devm_of_pci_get_host_bridge_resources(struct device *dev, > */ > static int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq) > { > - struct device_node *dn, *ppnode; > + struct device_node *dn, *ppnode = NULL; > struct pci_dev *ppdev; > __be32 laddr[3]; > u8 pin; > @@ -452,8 +452,14 @@ static int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args * > if (pin == 0) > return -ENODEV; > > + /* Local interrupt-map in the device node? Use it! */ > + if (dn && of_get_property(dn, "interrupt-map", NULL)) { > + pin = pci_swizzle_interrupt_pin(pdev, pin); > + ppnode = dn; > + } > + > /* Now we walk up the PCI tree */ > - for (;;) { > + while (!ppnode) { > /* Get the pci_dev of our parent */ > ppdev = pdev->bus->self; > > -- > 2.30.2 >