From patchwork Wed Apr 15 09:49:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghuan Lian X-Patchwork-Id: 6219441 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 D7BACBF4A6 for ; Wed, 15 Apr 2015 09:47:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E9D620376 for ; Wed, 15 Apr 2015 09:47:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B8A9202E9 for ; Wed, 15 Apr 2015 09:47:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752630AbbDOJrh (ORCPT ); Wed, 15 Apr 2015 05:47:37 -0400 Received: from mail-bn1on0140.outbound.protection.outlook.com ([157.56.110.140]:23728 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752073AbbDOJrh (ORCPT ); Wed, 15 Apr 2015 05:47:37 -0400 Received: from BY2PR03CA010.namprd03.prod.outlook.com (10.255.93.27) by BL2PR03MB561.namprd03.prod.outlook.com (10.141.91.151) with Microsoft SMTP Server (TLS) id 15.1.136.25; Wed, 15 Apr 2015 09:47:35 +0000 Received: from BL2FFO11FD054.protection.gbl (10.255.93.4) by BY2PR03CA010.outlook.office365.com (10.255.93.27) with Microsoft SMTP Server (TLS) id 15.1.136.25 via Frontend Transport; Wed, 15 Apr 2015 09:47:34 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD054.mail.protection.outlook.com (10.173.161.182) with Microsoft SMTP Server (TLS) id 15.1.142.12 via Frontend Transport; Wed, 15 Apr 2015 09:47:34 +0000 Received: from lmh.ap.freescale.net (lmh.ap.freescale.net [10.193.20.53]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t3F9lRx8007250; Wed, 15 Apr 2015 02:47:31 -0700 From: Minghuan Lian To: CC: , Zang Roy-R61911 , Hu Mingkai-B21284 , Scott Wood , Yoder Stuart-B08248 , Arnd Bergmann , Bjorn Helgaas , "Minghuan Lian" Subject: [PATCH 1/2] irqchip/gicv3-its: Support share device ID Date: Wed, 15 Apr 2015 17:49:23 +0800 Message-ID: <1429091364-31939-2-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429091364-31939-1-git-send-email-Minghuan.Lian@freescale.com> References: <1429091364-31939-1-git-send-email-Minghuan.Lian@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(189002)(199003)(85426001)(19580395003)(19580405001)(6806004)(76176999)(50986999)(46102003)(105606002)(2950100001)(62966003)(77156002)(48376002)(77096005)(50466002)(47776003)(50226001)(36756003)(575784001)(86362001)(87936001)(92566002)(2351001)(229853001)(110136001)(104016003)(106466001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR03MB561; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB561; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BL2PR03MB561; BCL:0; PCL:0; RULEID:; SRVR:BL2PR03MB561; X-Forefront-PRVS: 0547116B72 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2015 09:47:34.5123 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB561 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 SMMU of some platforms can only isolate limited device ID. This may require that all PCI devices share the same ITS device with the fixed device ID. The patch adds function arch_msi_share_devid_update used for these platforms to update the fixed device ID and maximum MSI interrupts number. Signed-off-by: Minghuan Lian --- drivers/irqchip/irq-gic-v3-its.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index d0374a6..be78d0a 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1169,6 +1169,15 @@ static int its_get_pci_alias(struct pci_dev *pdev, u16 alias, void *data) return 0; } +void __weak +arch_msi_share_devid_update(struct pci_dev *pdev, u32 *dev_id, u32 *nvesc) +{ + /* + * use PCI_DEVID NOT share device ID as default + * so nothing need to do + */ +} + static int its_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec, msi_alloc_info_t *info) { @@ -1185,6 +1194,8 @@ static int its_msi_prepare(struct irq_domain *domain, struct device *dev, dev_alias.count = nvec; pci_for_each_dma_alias(pdev, its_get_pci_alias, &dev_alias); + arch_msi_share_devid_update(pdev, &dev_alias.dev_id, &dev_alias.count); + its = domain->parent->host_data; its_dev = its_find_device(its, dev_alias.dev_id);