From patchwork Sat Sep 20 16:31:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suthikulpanit, Suravee" X-Patchwork-Id: 37660 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4FF4B20293 for ; Sat, 20 Sep 2014 16:32:12 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id hi2sf477795wib.6 for ; Sat, 20 Sep 2014 09:32:11 -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=gKyIAud/xWlDm2t/ZQFrhibX5Vj+b4jyKEthZLjWmNc=; b=HHpWdPuq1+QLYlv9v5dEpO+S9KLC4DypD7zICTd21CEO5BUyh3nUoqJ1ruGl+XX+zQ vZCGdxgSnorE1q0azCxgqSuSmdKz5dJOUGi+i60KdHXC/bNSLhe8Gr4VtKF/Z+tq2XBd 2UolTwskSloXAdorTdDiMRFKkuiNYS5x44loLYo/VSr96y7lLJgYSscnWGSULCD8C6n9 Fh9yIGMy3sOHg4kMSbc0KOWVRaioe7yn/5wNG5NVxybk09Ch8ODikQXurE1bA4KzgCP4 qDGHN7QAE3ewWywYJIFDBOgoYRQ5ok39e6weVGAsgJYYgksgj/9xKkrHSbxfcpRTPFEO sUzA== X-Gm-Message-State: ALoCoQk8jN2CO5Rjwt0kWwKzkUSuZ43NqfvNXf4xMJnUFAk/qSnPZ1EP18R+2Vf2UYsAYT/zoZUm X-Received: by 10.112.76.229 with SMTP id n5mr455816lbw.8.1411230731496; Sat, 20 Sep 2014 09:32:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.137 with SMTP id y9ls406036laj.93.gmail; Sat, 20 Sep 2014 09:32:11 -0700 (PDT) X-Received: by 10.112.166.101 with SMTP id zf5mr13146522lbb.36.1411230731016; Sat, 20 Sep 2014 09:32:11 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id f8si7176635lbc.136.2014.09.20.09.32.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Sep 2014 09:32:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z12so4618000lbi.8 for ; Sat, 20 Sep 2014 09:32:09 -0700 (PDT) X-Received: by 10.152.179.226 with SMTP id dj2mr14303849lac.40.1411230729509; Sat, 20 Sep 2014 09:32:09 -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 of9csp19338lbb; Sat, 20 Sep 2014 09:32:08 -0700 (PDT) X-Received: by 10.66.66.202 with SMTP id h10mr10106336pat.22.1411230727933; Sat, 20 Sep 2014 09:32:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl10si8255527pab.23.2014.09.20.09.32.07 for ; Sat, 20 Sep 2014 09:32:07 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1756392AbaITQcD (ORCPT + 27 others); Sat, 20 Sep 2014 12:32:03 -0400 Received: from mail-bl2on0114.outbound.protection.outlook.com ([65.55.169.114]:40194 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756137AbaITQb7 (ORCPT ); Sat, 20 Sep 2014 12:31:59 -0400 Received: from BN1PR02CA0049.namprd02.prod.outlook.com (10.141.56.49) by BY1PR0201MB1078.namprd02.prod.outlook.com (25.161.205.140) with Microsoft SMTP Server (TLS) id 15.0.1034.13; Sat, 20 Sep 2014 16:31:55 +0000 Received: from BL2FFO11FD024.protection.gbl (2a01:111:f400:7c09::154) by BN1PR02CA0049.outlook.office365.com (2a01:111:e400:2a::49) with Microsoft SMTP Server (TLS) id 15.0.1034.13 via Frontend Transport; Sat, 20 Sep 2014 16:31:54 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BL2FFO11FD024.mail.protection.outlook.com (10.173.161.103) with Microsoft SMTP Server id 15.0.1029.15 via Frontend Transport; Sat, 20 Sep 2014 16:31:54 +0000 X-WSS-ID: 0NC7KL2-08-00N-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 atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2DED7D16007; Sat, 20 Sep 2014 11:31:49 -0500 (CDT) Received: from SATLEXDAG06.amd.com (10.181.40.13) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sat, 20 Sep 2014 11:32:07 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag06.amd.com (10.181.40.13) with Microsoft SMTP Server id 14.3.195.1; Sat, 20 Sep 2014 12:31:51 -0400 From: To: , , CC: , , , , , , , , , , , "Suravee Suthikulpanit" , Mark Rutland Subject: [V8 1/2] irqchip: gic: Add support for multiple MSI for ARM64 Date: Sat, 20 Sep 2014 09:31:37 -0700 Message-ID: <1411230698-8081-2-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1411230698-8081-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1411230698-8081-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(33646002)(36756003)(105586002)(77982003)(4396001)(229853001)(106466001)(90102001)(74502003)(80022003)(77156001)(81342003)(46102003)(47776003)(74662003)(77096002)(81542003)(76482002)(85306004)(95666004)(50466002)(48376002)(107046002)(50986999)(97736003)(92566001)(76176999)(21056001)(44976005)(2201001)(92726001)(53416004)(86362001)(85852003)(31966008)(86152002)(68736004)(83322001)(19580405001)(19580395003)(84676001)(62966002)(89996001)(50226001)(64706001)(104166001)(79102003)(20776003)(101416001)(87286001)(102836001)(99396002)(83072002)(87936001)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0201MB1078; H:atltwp02.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY1PR0201MB1078; X-Forefront-PRVS: 0340850FCD Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-OriginatorOrg: amd4.onmicrosoft.com Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.217.177 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. Signed-off-by: Suravee Suthikulpanit Acked-by: Marc Zyngier Cc: Mark Rutland Cc: Jason Cooper Cc: Catalin Marinas Cc: Will Deacon --- 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; +}