From patchwork Thu Apr 22 17:04:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 12218953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A945C433ED for ; Thu, 22 Apr 2021 17:07:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6636613CC for ; Thu, 22 Apr 2021 17:07:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6636613CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0qrEmQMD9Vey+8VDO8lDvBEKoitRAKSQyXHcqzWJ76Q=; b=cQB9YrJP64Ofbv50yhEi98Ovpq XYe/UjmCQ0XsR6f8rHZZK7Kyvc4z6YgvxZ/O3mxDHqAo5UnuuGhI0yBX+lWTrJorBsaqIy3Ts9TjE eF4G+vjxbwjtTgxmSGTXim2Gw9a4vMX32x32h0NVAuhq8j+lKwdANoHKR2NC5ZxU+JRrE7jy9XSNm jfLC8Kq0Or0gYa3F7r17BUZYFHuvTS5C4lQRKlT4vEME3C5OjEMlXeIGJgh7MaRrTSe8oCWwBHDCq xWrtPNa8ZvXaC8wyaQLr7sob3IwF6BwJ8tPC4BhOYe6Z56EmHFMaTLTaFx60BE9PiQNpJiXhhBadB WQl91KFw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZclX-00H9Uh-Gn; Thu, 22 Apr 2021 17:05:23 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZclM-00H9TT-Ue for linux-arm-kernel@desiato.infradead.org; Thu, 22 Apr 2021 17:05:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9JVNpXiKMF26LPud2KKkP0m1qdQYvVKUT1s0yiLykeI=; b=LmeVaWBXfz/Mv4NRQWdCV3qUJR mlcKdmqzYeOucaySN9OmVHn3rq7KRt29bAzMPldcyLKDAAQnkpniC9gv0y3m3ar1YXQEub0czMBOZ RvcciLAfLUaBQcxP8uanPzUJazEKDrF2u5JSmoB9J4y8n/bj6GL/VH6rlEMS9o+3kyVAUzW8dvq+8 DkgXQaHYtgxFtjmXRcc4CpkyAUd/IOtnhQgy4b6ZWCSwgxeqEgrU2BBEf7mOC8zU0kLIiE1n+RiMX uhSwQvCH5ZsC67Fcd7rs4qXmyQ4XwZoYkpXUVfi6ut7HSM5G01KAcVbiAn4GEgI0d5iDNRB9jkueh bXWE/1yQ==; Received: from mx.socionext.com ([202.248.49.38]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZclK-00Ds2R-ED for linux-arm-kernel@lists.infradead.org; Thu, 22 Apr 2021 17:05:11 +0000 Received: from unknown (HELO kinkan2-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 23 Apr 2021 02:05:09 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan2-ex.css.socionext.com (Postfix) with ESMTP id 83F1C2059027; Fri, 23 Apr 2021 02:05:09 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Fri, 23 Apr 2021 02:05:09 +0900 Received: from plum.e01.socionext.com (unknown [10.213.132.32]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 26143B1D40; Fri, 23 Apr 2021 02:05:09 +0900 (JST) From: Kunihiko Hayashi To: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Jingoo Han , Gustavo Pimentel , Marc Zyngier Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jassi Brar , Masami Hiramatsu , Kunihiko Hayashi Subject: [PATCH v11 1/3] PCI: portdrv: Add pcie_port_service_get_irq() function Date: Fri, 23 Apr 2021 02:04:55 +0900 Message-Id: <1619111097-10232-2-git-send-email-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619111097-10232-1-git-send-email-hayashi.kunihiko@socionext.com> References: <1619111097-10232-1-git-send-email-hayashi.kunihiko@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210422_100510_599748_4702EE40 X-CRM114-Status: GOOD ( 14.11 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add pcie_port_service_get_irq() that returns the virtual IRQ number for specified portdrv service. Cc: Lorenzo Pieralisi Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Acked-by: Bjorn Helgaas --- drivers/pci/pcie/portdrv.h | 1 + drivers/pci/pcie/portdrv_core.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 2ff5724..628a3de 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h @@ -144,4 +144,5 @@ static inline void pcie_pme_interrupt_enable(struct pci_dev *dev, bool en) {} #endif /* !CONFIG_PCIE_PME */ struct device *pcie_port_find_device(struct pci_dev *dev, u32 service); +int pcie_port_service_get_irq(struct pci_dev *dev, u32 service); #endif /* _PORTDRV_H_ */ diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index e1fed664..93027d3 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -478,6 +478,22 @@ struct device *pcie_port_find_device(struct pci_dev *dev, EXPORT_SYMBOL_GPL(pcie_port_find_device); /** + * pcie_port_service_get_irq - get irq of the service + * @dev: PCI Express port the service is associated with + * @service: For the service to find + * + * Get irq number associated with given service on a pci_dev + */ +int pcie_port_service_get_irq(struct pci_dev *dev, u32 service) +{ + struct pcie_device *pciedev; + + pciedev = to_pcie_device(pcie_port_find_device(dev, service)); + + return pciedev->irq; +} + +/** * pcie_port_device_remove - unregister PCI Express port service devices * @dev: PCI Express port the service devices to unregister are associated with *