From patchwork Thu Sep 18 02:08:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 37581 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C13052057E for ; Thu, 18 Sep 2014 02:09:07 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id c11sf98598lbj.5 for ; Wed, 17 Sep 2014 19:09:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=gtP/V7/wM5jwybkP1r/p6Tu//z9Mjnhm2Nw8q4gV/QQ=; b=FFzwCMHnDVjyc63oleDIklA6vT8n/WYJyiCdwx1dhr69YP/5Wa99z+DhKCOqZ0qjR3 UTDIjBYIKz9+0oEf6Lkv6yv9pYYWwZ+8T1XaFX1Vns3bkppLSrvBk3A14H3fqTXmt01a RClheIWUMRYePVwcdMs/dO1sCjQeGaZlJ4sV18mh854nE8Ayro/q6+fTdJoUX6I93jwF 1XFgSVU06SbydedAPxPeIE10kBUudD9ZnLmpsZl8RJnT7CiEzD3pcv0RTu56hr+DLur+ QJ4rZrThJd8Bh1XbCg5sO78vsyvr1BkYQoNgZWQCYQYKQF4A+uP+J/71LCzhca2jRy3m KXNA== X-Gm-Message-State: ALoCoQlloO6S6XkBLE6OTWLdHqyMIk+9T4NhdbMcmcKn/q5xgD9YwN+co2vyHDSzmW7Wj92Gr370 X-Received: by 10.112.188.136 with SMTP id ga8mr200889lbc.8.1411006146498; Wed, 17 Sep 2014 19:09:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.135 with SMTP id k7ls105396lah.78.gmail; Wed, 17 Sep 2014 19:09:06 -0700 (PDT) X-Received: by 10.152.204.231 with SMTP id lb7mr1464383lac.44.1411006146227; Wed, 17 Sep 2014 19:09:06 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by mx.google.com with ESMTPS id pc8si6708073lbc.69.2014.09.17.19.09.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 19:09:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id mc6so239568lab.34 for ; Wed, 17 Sep 2014 19:09:05 -0700 (PDT) X-Received: by 10.152.115.195 with SMTP id jq3mr71451lab.90.1411006145903; Wed, 17 Sep 2014 19:09:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp682586lbb; Wed, 17 Sep 2014 19:09:05 -0700 (PDT) X-Received: by 10.70.12.65 with SMTP id w1mr1420631pdb.3.1411006144157; Wed, 17 Sep 2014 19:09:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hk2si37541722pdb.19.2014.09.17.19.09.03 for ; Wed, 17 Sep 2014 19:09:04 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757369AbaIRCJC (ORCPT + 5 others); Wed, 17 Sep 2014 22:09:02 -0400 Received: from mail-bn1on0146.outbound.protection.outlook.com ([157.56.110.146]:46912 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755836AbaIRCI7 (ORCPT ); Wed, 17 Sep 2014 22:08:59 -0400 Received: from BLUPR02CA031.namprd02.prod.outlook.com (25.160.23.149) by BN1PR02MB197.namprd02.prod.outlook.com (10.242.214.146) with Microsoft SMTP Server (TLS) id 15.0.1029.13; Thu, 18 Sep 2014 02:08:56 +0000 Received: from BN1AFFO11FD022.protection.gbl (2a01:111:f400:7c10::176) by BLUPR02CA031.outlook.office365.com (2a01:111:e400:8ad::21) with Microsoft SMTP Server (TLS) id 15.0.1034.13 via Frontend Transport; Thu, 18 Sep 2014 02:08:56 +0000 Received: from atltwp01.amd.com (165.204.84.221) by BN1AFFO11FD022.mail.protection.outlook.com (10.58.52.82) with Microsoft SMTP Server id 15.0.1029.15 via Frontend Transport; Thu, 18 Sep 2014 02:08:55 +0000 X-WSS-ID: 0NC2RAT-07-FQ4-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2BAF7CAE65D; Wed, 17 Sep 2014 21:08:53 -0500 (CDT) Received: from SATLEXDAG02.amd.com (10.181.40.5) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 17 Sep 2014 21:09:05 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by SATLEXDAG02.amd.com (10.181.40.5) with Microsoft SMTP Server id 14.3.195.1; Wed, 17 Sep 2014 22:08:53 -0400 From: To: , , CC: , , , , , , , , , , , "Suravee Suthikulpanit" , Mark Rutland , Marc Zyngier Subject: [PATCH 1/2 V7] irqchip: gic: Add support for multiple MSI for ARM64 Date: Wed, 17 Sep 2014 19:08:25 -0700 Message-ID: <1411006106-17339-2-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1411006106-17339-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1411006106-17339-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(88136002)(50226001)(104166001)(48376002)(50466002)(19580395003)(77096002)(90102001)(62966002)(20776003)(229853001)(83072002)(89996001)(101416001)(92726001)(2201001)(33646002)(4396001)(95666004)(77156001)(87936001)(84676001)(76176999)(64706001)(106466001)(47776003)(74662003)(81342003)(85306004)(19580405001)(31966008)(87286001)(107046002)(21056001)(50986999)(36756003)(79102003)(83322001)(85852003)(92566001)(74502003)(105586002)(97736003)(44976005)(81542003)(77982003)(86152002)(93916002)(46102003)(53416004)(86362001)(80022003)(68736004)(99396002)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR02MB197; H:atltwp01.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 033857D0BD Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-OriginatorOrg: amd4.onmicrosoft.com Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: suravee.suthikulpanit@amd.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Suravee Suthikulpanit This patch implelments the ARM64 version of arch_setup_msi_irqs(), which does not return 1 for when PCI_CAP_ID_MSI and nvec > 1. Cc: Mark Rutland Cc: Marc Zyngier Cc: Jason Cooper Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Suravee Suthikulpanit --- arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/msi.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 arch/arm64/kernel/msi.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index df7ef87..a921c42 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -29,6 +29,7 @@ arm64-obj-$(CONFIG_ARM64_CPU_SUSPEND) += sleep.o suspend.o arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o arm64-obj-$(CONFIG_KGDB) += kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o +arm64-obj-$(CONFIG_PCI_MSI) += msi.o obj-y += $(arm64-obj-y) vdso/ obj-m += $(arm64-obj-m) diff --git a/arch/arm64/kernel/msi.c b/arch/arm64/kernel/msi.c new file mode 100644 index 0000000..a295862 --- /dev/null +++ b/arch/arm64/kernel/msi.c @@ -0,0 +1,41 @@ +/* + * ARM64 architectural MSI implemention + * + * Support for Message Signalelled Interrupts for systems that + * implement ARM Generic Interrupt Controller: GICv2m. + * + * Copyright (C) 2014 Advanced Micro Devices, Inc. + * Authors: Suravee Suthikulpanit + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include + +/* + * ARM64 function for seting up MSI irqs. + * Based on driver/pci/msi.c: arch_setup_msi_irqs(). + * + * Note: + * Current implementation assumes that all interrupt controller used in + * ARM64 architecture _MUST_ supports multi-MSI. + */ +int arm64_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) +{ + struct msi_desc *entry; + int ret; + + list_for_each_entry(entry, &dev->msi_list, list) { + ret = arch_setup_msi_irq(dev, entry); + if (ret < 0) + return ret; + if (ret > 0) + return -ENOSPC; + } + + return 0; +}