From patchwork Wed Jul 15 16:54:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 6799731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4748BC05AE for ; Wed, 15 Jul 2015 16:57:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64E6F20698 for ; Wed, 15 Jul 2015 16:57:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C38420673 for ; Wed, 15 Jul 2015 16:57:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFPy9-0001sW-El; Wed, 15 Jul 2015 16:55:41 +0000 Received: from mail-ig0-x229.google.com ([2607:f8b0:4001:c05::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFPxm-0000OO-Ny for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2015 16:55:19 +0000 Received: by igcqs7 with SMTP id qs7so111736595igc.0 for ; Wed, 15 Jul 2015 09:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GF9qzS0AwIdDzZrwXbeExUyo7u8k/DYwDLUqpFwMNkw=; b=yhZoueAGks0kqWCbep+LbyFKAU7gBau38Z604BFXalJN5SjtvNLl/4xdOwjn7xh+RP FT9D2s2AQ9x+AzP/VNmFKxbWkMdBhFcqu7vl8DZk6zyNUSg/nG7b6W1KzLr+zOt2vMQ6 F9F+9u/x8k7JyET893n8izpHAGwLmVNwE1H+QGTqkLw4d3tnfaoz1YlAzGmGiL2dpfmS gIz8NIxTHEfqQdRgVRI+keLlClIT2hJry7rGIOX66bgCs3718VGdDMpm0jQcfeYzMqVY ZTdPsmusKQhZzTcYmaD/qJ/3f88wg5yiQkmWcYktJMcHPp4Sr7A5N3HxfBM9i+rh/+/d IVVw== X-Received: by 10.107.134.83 with SMTP id i80mr5551924iod.123.1436979297924; Wed, 15 Jul 2015 09:54:57 -0700 (PDT) Received: from dl.caveonetworks.com (64.2.3.194.ptr.us.xo.net. [64.2.3.194]) by smtp.gmail.com with ESMTPSA id 76sm3137195iom.12.2015.07.15.09.54.55 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 Jul 2015 09:54:56 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id t6FGssV4008223; Wed, 15 Jul 2015 09:54:54 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id t6FGss9S008222; Wed, 15 Jul 2015 09:54:54 -0700 From: David Daney To: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Bjorn Helgaas , linux-pci@vger.kernel.org, Thomas Gleixner , Jason Cooper Subject: [PATCH 2/5] gic-its: Allow pci_requester_id to be overridden. Date: Wed, 15 Jul 2015 09:54:42 -0700 Message-Id: <1436979285-8177-3-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1436979285-8177-1-git-send-email-ddaney.cavm@gmail.com> References: <1436979285-8177-1-git-send-email-ddaney.cavm@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150715_095518_844800_61594BA6 X-CRM114-Status: GOOD ( 11.83 ) X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Richter , linux-kernel@vger.kernel.org, David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: David Daney Signed-off-by: David Daney --- drivers/irqchip/irq-gic-v3-its.c | 14 +++++++++++++- include/linux/irqchip/arm-gic-v3.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 1b7e155..4580970 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1189,11 +1189,23 @@ static int its_pci_msi_vec_count(struct pci_dev *pdev) return max(msi, msix); } +static u32 its_dflt_pci_requester_id(struct pci_dev *pdev, u16 alias) +{ + return alias; +} + +static its_pci_requester_id_t its_pci_requester_id = its_dflt_pci_requester_id; +void set_its_pci_requester_id(its_pci_requester_id_t fn) +{ + its_pci_requester_id = fn; +} +EXPORT_SYMBOL(set_its_pci_requester_id); + static int its_get_pci_alias(struct pci_dev *pdev, u16 alias, void *data) { struct its_pci_alias *dev_alias = data; - dev_alias->dev_id = alias; + dev_alias->dev_id = its_pci_requester_id(pdev, alias); if (pdev != dev_alias->pdev) dev_alias->count += its_pci_msi_vec_count(dev_alias->pdev); diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index ffbc034..18e3757 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -389,6 +389,8 @@ int its_cpu_init(void); int its_init(struct device_node *node, struct rdists *rdists, struct irq_domain *domain); +typedef u32 (*its_pci_requester_id_t)(struct pci_dev *, u16); +void set_its_pci_requester_id(its_pci_requester_id_t fn); #endif #endif