Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp244918pxb; Mon, 13 Sep 2021 18:12:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx07e8E4DK9ZiwqkOTDS93UxQ4wpFmAqxctLeqcBM+Naaj1+8+WYLUyJOHXpo+J5Bdxa90V X-Received: by 2002:a05:6e02:20cd:: with SMTP id 13mr10373380ilq.156.1631581972190; Mon, 13 Sep 2021 18:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631581972; cv=none; d=google.com; s=arc-20160816; b=fozY3w7IYENHTfyjWRi8mEBh2gZc5U4l0R0q8zsxBjAxnHGGIOHJvzgx0D99MzJuKl CU/Z8NRa4M4i3JV29mmBKCoQi6/NNY3t3G/t5lmDsFm0d9PYJioengUxRNCzxEHSW1aB 29l2mQ0aVKqFI1/mJB2BajlUXMSzxIyujT8tZk9Znl3izAgO4Y9GHcAPIUDcrG/2LTMo 78XXjFA3PRgOsP35vyY3WbpxZKZEx7gC0wU7LfmGBKQLZhdZc8QpI5arJPWoy54kiL2f 3rttdqkzMGuDdVPbcySgM7XZwf/JKqMmlt3jDiKL8wZEiCbr34UacE0pgXk8nuTJf/W1 BjdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CEUoHglPpWrB5WZWHKcVVYGMHNXrEPp8oClZB0FJtUo=; b=PJz5ad7UoaDZCvEkvZ1zlgPxvMhnGrdbakTY1BcRqQIpy1bcU9k41p7LyAJ0HiImuV QPXT7G2/2NmwrmoQaRCxqwezKQRWDbfKK6BmfzwG23q4QYOoxXj0zLhZCSedh1GhTY9W MI3Yy+TXGGDWcmAqNKz45WqEYC41IVwRFqcyhof+VeXNHJMgmsY+H40zM0l3nMNoNziR lBnnqUmMJfp4sn/3bSmrw0dRnrs9PViOmrBNZKx3a8axvQA2wjbpZ6hCUETc/xy7CWbg LFyjk5lXuQKScEr2pZBocv9WhMzSN+G8zNMEqU8/ev0XLEvLpD9FeO1uSnXsVx/BRc/u 1q2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VG7wvsOW; 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 b9si8837234ion.34.2021.09.13.18.12.40; Mon, 13 Sep 2021 18:12:52 -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=VG7wvsOW; 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 S244109AbhIMVbp (ORCPT + 99 others); Mon, 13 Sep 2021 17:31:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:34756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbhIMVbi (ORCPT ); Mon, 13 Sep 2021 17:31:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 01E18610FB; Mon, 13 Sep 2021 21:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631568621; bh=kDnxC/ku/qO2YWO25lHgWh/UEfoJ7cygr+a1l7tUC3M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VG7wvsOWUJeXM+FMs0FH3+zOqmH2owxzqpPcu3YDANFOnCP0VbRPqEIP7hbPmgxR2 gXA88kVtMvEDQp2Wq3i53HT5FPfYY0sQxDMbbLweb/XOQOdW7pON2ZaSKLyoOWRwe3 2NcGOGQaiTH6ttTuSViiC0aRsCsprYdlNXjV4mF22b8xslz9/7njo0TnbHF3GrN5f3 Z5ftw0XCnBbCOEuQejvNVTreFcRoNgu7TY+xy+Cm550RFXxezpoUo4uwy8jOl+umX8 B3wLfVX/6tDhfGgNYy0i/9QrUg+GwvUpyu1cjXivP3o1TyWIt94PKB4YWJkDFm58C3 yaXWj4r5QVavQ== Received: by mail-ej1-f44.google.com with SMTP id t19so24005287ejr.8; Mon, 13 Sep 2021 14:30:20 -0700 (PDT) X-Gm-Message-State: AOAM533mzDRtI93FSs6flVEIws9fhBU3AP9bGrx7k2Pf0W47anuGHX88 HB3px84FUdTeqjs4q0lhjzi9FpbQDhGcaMtJAw== X-Received: by 2002:a17:907:33ce:: with SMTP id zk14mr1304192ejb.84.1631568619636; Mon, 13 Sep 2021 14:30:19 -0700 (PDT) MIME-Version: 1.0 References: <20210913182550.264165-1-maz@kernel.org> <20210913182550.264165-4-maz@kernel.org> In-Reply-To: <20210913182550.264165-4-maz@kernel.org> From: Rob Herring Date: Mon, 13 Sep 2021 16:30:07 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 03/10] PCI: of: Allow matching of an interrupt-map local to a pci device To: Marc Zyngier Cc: devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , PCI , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Alyssa Rosenzweig , Stan Skowronek , Mark Kettenis , Sven Peter , Hector Martin , Robin Murphy , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 1:26 PM 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 > --- > 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)) { No need to check 'dn' is not NULL. Otherwise, Reviewed-by: Rob Herring > + 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 >