Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755930AbbGPQuV (ORCPT ); Thu, 16 Jul 2015 12:50:21 -0400 Received: from mail-bl2on0098.outbound.protection.outlook.com ([65.55.169.98]:54263 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751033AbbGPQuR (ORCPT ); Thu, 16 Jul 2015 12:50:17 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; Message-ID: <55A7E0C2.8020704@caviumnetworks.com> Date: Thu, 16 Jul 2015 09:50:10 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Marc Zyngier CC: David Daney , "linux-arm-kernel@lists.infradead.org" , Catalin Marinas , Will Deacon , Bjorn Helgaas , "linux-pci@vger.kernel.org" , Thomas Gleixner , Jason Cooper , Robert Richter , "linux-kernel@vger.kernel.org" , David Daney Subject: Re: [PATCH 4/5] irqchip: gic-v3: Add gic_get_irq_domain() to get the irqdomain of the GIC. References: <1436979285-8177-1-git-send-email-ddaney.cavm@gmail.com> <1436979285-8177-5-git-send-email-ddaney.cavm@gmail.com> <55A6947F.8070903@arm.com> <55A6AD1F.902@caviumnetworks.com> <55A75F8B.3080009@arm.com> In-Reply-To: <55A75F8B.3080009@arm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: DM2PR07CA0027.namprd07.prod.outlook.com (10.141.52.155) To BLUPR0701MB1713.namprd07.prod.outlook.com (25.163.85.14) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1713;2:F45SgUCTBVmV7r4ux8Sh9oEjFRJ2PffJ63yzIH0tu0etnYX8iSkzz4GmMzOye+jL;3:yKf7ScAC8xAx5ptcxZ9nIos50BlJnBO0cWWDiumqwMCIssy/oS5ng/NNNwid3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TO3oC9lOtNbGhwKdFSo=;4:sTyhPBgBrXW4UhIOkVIu+TsVqdHI+45ZLECFRNNLVL4ycnx22EwVzYiFYmpyqoFhSNd/RRORoFpDCKXoKxfvei95E6IgM3Nh9wjeuY0k95QjcRvJYr2FtrDmkY5rnTMqR/q5FVN3lM7hzdCv35dvgEskeGqbSOxPycXGPkdNucyBNhK0wB3VnZLgvUtANkt0DBoMyN2xPY6e76kQjAEXFhOTqUWYIc8snse5Gm5kmUnB56r00C2lTBZb73LWY4kp95ETTiRiG475QZutGpPKMS+Qh/U4WsXIpK4h82cK7yg= BLUPR0701MB1713: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BLUPR0701MB1713;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1713; X-Forefront-PRVS: 0639027A9E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(24454002)(164054003)(479174004)(377454003)(5001960100002)(4001350100001)(189998001)(2950100001)(93886004)(19580405001)(33656002)(83506001)(110136002)(122386002)(62966003)(53416004)(77156002)(40100003)(42186005)(36756003)(87266999)(65816999)(76176999)(54356999)(92566002)(80316001)(87976001)(23746002)(19580395003)(46102003)(65956001)(77096005)(50986999)(50466002)(64126003)(66066001)(47776003)(65806001)(59896002)(15583001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1713;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BLUPR0701MB1713;23:0GVDR4/ZzOjp9y2A/BR2dvk3aifrgJf6H4H?= =?Windows-1252?Q?VALIkY8EQkm/QMEt6itCLGD8DT3JK491lBQiH1Pgz05Rn7kyOsCucQWx?= =?Windows-1252?Q?r6RWBavFdSnfszyddhxvFg3sUMxcNPqDKfmVBOH2Ve+qoMfaYGqI9sOw?= =?Windows-1252?Q?qcoAV4f6SLk2EMxP4cBVew+59swdpSPDhDelC57ly4D0nkUqHflS9si3?= =?Windows-1252?Q?qOsKzz6tHTIyfX/kYQLho0MOBYASbzspe49GGyhIS/OAY7UEG4ZuOklg?= =?Windows-1252?Q?Nz6vjfdcOeivns6pwKarC9bCfCaZ/+utmHOVN5b1VreY0DuT9lbileST?= =?Windows-1252?Q?fZAtsS33zvwCKRX0Q5z+YZGuzBd9LVfoNj1pLhA+QHMCyuM1718qtsSJ?= =?Windows-1252?Q?w6HPZTa37nFnigsHBkI9kDSJGPlrgryI0YrGtBsUBuWuTgFplB5JX5FV?= =?Windows-1252?Q?YOi5K7lAhj4nOGyiQwiqICirkl/GDZEscXY8np3650I82PLY3Y4h9MI+?= =?Windows-1252?Q?87gM96s8nA9+VCZq1Siv8R8KNHG36wW3+mAget9GmjVUu/C1xoXYl7ft?= =?Windows-1252?Q?xvUqE+7bCSRCJaViKWJnaIO8K/FrbcrBkImVyFlfuESDJGDLcbenpwis?= =?Windows-1252?Q?rAwqcqwcc9uX4eCusXw5Gz5+SkcC03fKl7cC3NX1aI/rL7UPGVhDAfd1?= =?Windows-1252?Q?VYvDk8a0TD9LYHx3q9zCOHqBmMKeoBY+Jdt2JPXP115ORWmiCGq/OnsS?= =?Windows-1252?Q?HZPRgAlpc1Yt/pEoIST0stvwLQ3+PSTQ3jT84Xc1hx+gLQ6Qb2NM8fbj?= =?Windows-1252?Q?wGF72qFKHsAdxW6R3IX3YrdVWiAlpameUDqDcyigu7aFzSwut5H3PrJ3?= =?Windows-1252?Q?c+0qZK6lZOuSHYPr/W89Nf1pXT36Ss33d/Lx+MRP2Cxf0NltiaXXgdCj?= =?Windows-1252?Q?if1ToY9mE3rCsnHYbtpEWVPxPpzFLhk07pwH4oTXSLaYQy8oGrFAEKnd?= =?Windows-1252?Q?/bzPr/VWmn3wt9kDuoNou4EVqZbncqMw16kax3tRseH/k3njezf9J2To?= =?Windows-1252?Q?fqlXOt2PsOjilBMmRXw9UMNE6LZeiyt/ajZxIU2lrAMiXvhRhvOmucRr?= =?Windows-1252?Q?z0ds55znGtJtszAsIzy3DyBPLKRRrPgqMk0YLp2l5YQtV?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1713;5:Vhe7jOSRLWxzvwbd3YU2c2d/zICdVTxPfET+HZSnyI1vkd9DqG3qAKRpBBbhOMrDJmufGSSZd2rSvJIuHNkc/E6uvVr3dVnAw4W6ECBNt0SUrtgHXkYYV+rIZ04M4+AmGHsxzJK+VhXe+K9utrV85A==;24:J+Bk3lpjzveRuIfqolkK2JeRP4mW5RXEgVahpzqUU2ocJzS/ngBZLPKIyAHWbUVfUtT5OF2hdJ5mPQkZ25LPDXnAc/SwebNGNubD7xEh8c4=;20:OmSLUV46iMztlUZwZyacOjHlG2upa3WFEc/LVPY9DDLM/touSVhzAradQTiTH6VhTZf3lqT8kTnW61E2U1HcbA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2015 16:50:13.6670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2884 Lines: 89 On 07/16/2015 12:38 AM, Marc Zyngier wrote: > On 15/07/15 19:57, David Daney wrote: >> On 07/15/2015 10:12 AM, Marc Zyngier wrote: >>> On 15/07/15 17:54, David Daney wrote: >>>> From: David Daney >>>> >>>> Needed to map SPI interrupt sources. >>>> >>>> Signed-off-by: David Daney >>>> --- >>>> drivers/irqchip/irq-gic-v3.c | 5 +++++ >>>> include/linux/irqchip/arm-gic-v3.h | 1 + >>>> 2 files changed, 6 insertions(+) >>>> >>>> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c >>>> index c52f7ba..0019fed 100644 >>>> --- a/drivers/irqchip/irq-gic-v3.c >>>> +++ b/drivers/irqchip/irq-gic-v3.c >>>> @@ -58,6 +58,11 @@ static struct gic_chip_data gic_data __read_mostly; >>>> /* Our default, arbitrary priority value. Linux only uses one anyway. */ >>>> #define DEFAULT_PMR_VALUE 0xf0 >>>> >>>> +struct irq_domain *gic_get_irq_domain(void) >>>> +{ >>>> + return gic_data.domain; >>>> +} >>>> + >>>> static inline unsigned int gic_irq(struct irq_data *d) >>>> { >>>> return d->hwirq; >>>> diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h >>>> index 18e3757..5992224 100644 >>>> --- a/include/linux/irqchip/arm-gic-v3.h >>>> +++ b/include/linux/irqchip/arm-gic-v3.h >>>> @@ -391,6 +391,7 @@ int its_init(struct device_node *node, struct rdists *rdists, >>>> >>>> typedef u32 (*its_pci_requester_id_t)(struct pci_dev *, u16); >>>> void set_its_pci_requester_id(its_pci_requester_id_t fn); >>>> +struct irq_domain *gic_get_irq_domain(void); >>>> #endif [...] > >> We need a way to be able to map these. > > However you're going to map them, it will not be by just blindly > exporting random irqdomains from an unsuspecting interrupt controller. There is nothing random about it. The ARM architects specified that there is exactly One True GIC in a system. If we need to do something with the GIC, it is not a "random ... unsuspecting interrupt controller", it is *The* GIC. > > Patch 5 has established that you're using "virtual wire" SPIs, so we > need to work on exposing that with the normal kernel abstraction, and > not by messing with the internals of the GIC. > Agreed. The MSI system has pci_enable_msix()/pci_disable_msix(). I would propose something like: struct gic_spi_entry { int spi /* SPI number */ int irq; /* kernel irq number mapped to the spi*/ u32 msg; /* message to be written */ u64 assert_addr; u64 deassert_addr; }; /* Fill in the SPI processing information */ int gic_map_spi(int spi, struct gic_spi_entry *data); David Daney > Thanks, > > M. > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/