Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp650030pxy; Thu, 22 Apr 2021 10:10:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwulVL5PPd+nZzDiDVb68LX75xnkZRPLBsBTFyrPFrciN30Rh/DUMC6j6hxg8ihv7oCHY3/ X-Received: by 2002:a17:906:f1cb:: with SMTP id gx11mr4614297ejb.106.1619111402035; Thu, 22 Apr 2021 10:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619111402; cv=none; d=google.com; s=arc-20160816; b=uR/usvxtDFIXqsEo54QeJ8cim/qHxPCL1drviStusDL3OoropHmlFytvDFsywYYrd3 9D0ey6fZVBQKn5rOm6h9zvNU4/RXWq2hdNoboKvdqYh0TQr1RC/rKabAh6qZ1Yse5rxF vrPa0L3mzrIvuq/pyNayy/awppldelykYfJ1s2yhEi1qT7Q8foeOQl8pS144menEXXeW z1+Ws6P6a/m+VDjJCQWaCR+7EtB2SQeHLrdRbZmHS2JBttD3MkV3fBN1MDeZss0CjJ1s QZ1D4ll7uFxwKXKYCzqs/u3ItKZdMJUVv6961gUQSNVMZn0+bwlz/93Zjf6OTqMNMlsI XzYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=9JVNpXiKMF26LPud2KKkP0m1qdQYvVKUT1s0yiLykeI=; b=Nq4t9EWRFC/i2fu6UG+1iOS9HkIJRupxushmrJPRnmbjtLGI92l2yE62YkVP9ZwAbF Adh0iRRd7BWT9eeRx4O6S5JyUdgmI4P8JP+WSs0HVpjsuIzwn0Gpo/OzmnW9GItaL2xJ 2I6SHbFR31M8I5z0tZmyUqKeSYOuE1L2ScLYAd1eyLHrBghjDPs3E3QwIvNrzWASsGIF ALl0Yqkaid1mvGbYq9R6gNzZHvgoVTR+bldjNDWl3ABX9R2vSf+I2/TLit6JyS3FYGeZ 7SGTgq5h1tCEKqNF0xi0Z3TuXLfJcP4pZxUzNu+rQKuCDMRoIMKBfBGIqkYYmjZN0RdS EwVw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv16si2789261ejb.283.2021.04.22.10.09.37; Thu, 22 Apr 2021 10:10:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238140AbhDVRGf (ORCPT + 99 others); Thu, 22 Apr 2021 13:06:35 -0400 Received: from mx.socionext.com ([202.248.49.38]:12518 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236287AbhDVRFy (ORCPT ); Thu, 22 Apr 2021 13:05:54 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 * -- 2.7.4