Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755314AbbGPROV (ORCPT ); Thu, 16 Jul 2015 13:14:21 -0400 Received: from mail-bl2on0064.outbound.protection.outlook.com ([65.55.169.64]:40736 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754905AbbGPROS (ORCPT ); Thu, 16 Jul 2015 13:14:18 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none; Message-ID: <55A7E663.9030000@caviumnetworks.com> Date: Thu, 16 Jul 2015 10:14:11 -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> <55A7E0C2.8020704@caviumnetworks.com> <55A7E52D.9080201@arm.com> In-Reply-To: <55A7E52D.9080201@arm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: BY2PR07CA051.namprd07.prod.outlook.com (10.141.251.26) To CY1PR0701MB1728.namprd07.prod.outlook.com (25.163.21.142) X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1728;2:K3jUEieFTF+KK5f6zOnnwUoTqTDuDNOerZjl/vP9YBY/2e+8xf0yUKZAcsBDR5kR;3:/LrHYGZsv31qxz+DhW6zhGXv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RlGX5RvFfG4bIQgXoqY9nTAzYd0kc1rx9s1QlnKyqlLFgp8=;4:8VED4x8WjhorvE3AZFcC6gPu5SZksb9K/+vowHWq2Szh7BVGh9Hnnp1BPm7ZbDB9rF5hvGZzLsZHoUAhusZriqnaY1OZnfFH/mj27PbDCrmsO93+a0rFOFiOkWQkxqMH2W8w9ti65nX5OzssyV1urbHHmjAZIvqszVK2FedmKZkGmm9WfDhfLlS3mpYLrBva3zNzNZJVzpGlSyQo1fcsQf6YYZSKrf3wC1foz33m1iSqTUlf8MXgOnffprlOMjPYPmYP2c76lGYu45lZgJXpzxZ/XZd/Zi/X+Wf3j7LJRF0= CY1PR0701MB1728: 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:CY1PR0701MB1728;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1728; X-Forefront-PRVS: 0639027A9E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(24454002)(479174004)(76176999)(92566002)(87266999)(54356999)(65816999)(46102003)(36756003)(33656002)(50986999)(77096005)(65956001)(66066001)(23746002)(65806001)(93886004)(59896002)(4001350100001)(5001920100001)(64126003)(47776003)(87976001)(80316001)(110136002)(5001960100002)(53416004)(77156002)(62966003)(50466002)(42186005)(2950100001)(83506001)(122386002)(40100003)(189998001)(15583001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1728;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY1PR0701MB1728;23:yevmy5yPFilDLA9cek06Ao1z3D1NriPjm3V?= =?Windows-1252?Q?ItaR6IDVEx7OH6iSFFKqOvmrSTSyx5L2EpxFEXlD6orqCFlU16XrRgbr?= =?Windows-1252?Q?dofdLmKWzkr3lwy457H8NTVbzD/W8XwaqgM8t6NgZFbrdBtc9qpe0iTP?= =?Windows-1252?Q?oyKu3gMd8nHkCBDCxmYRA3M+LYnASKdQ7/ZOao8aeEwW1XwrCErb5O6f?= =?Windows-1252?Q?M5WtfytPkRjreEB32tdT+L7ijhXrtRz+stOPidtVD6xs20ClIvPP3OCj?= =?Windows-1252?Q?wfixxP1HqI01AHn1ljjVPFrTfjv2S2zA56o47h6bYfJBeA9OUpO1Zfv+?= =?Windows-1252?Q?mnQ3caZxJxikddQ5/iVsA59kikFv7LU9Jr4WkzD0h2V4DM2pqNdoFrie?= =?Windows-1252?Q?9sc7SUIXIeK1ZBtryuBcEhsY+5C9sON+hchrRz60njt2febdm4yHUYqZ?= =?Windows-1252?Q?9naB9YjZonByKooNka6E6wOOGdIQciYq6TW+r3hqPKQy2FhRn0JghEn9?= =?Windows-1252?Q?J6WgdVuI2uN27BkVODFO7wKSsrH3CZ7lAB+DsuJM3r9D7Uzj12zYNB4I?= =?Windows-1252?Q?TQRaWOoECoxPzQa+e3JFpl5KIFWcA3jp/NzuRClxGUco4orjNZQjRmPf?= =?Windows-1252?Q?111on6XbvQPYa4ERR7unCp8ft+x4saOxxSomYBW+/Ye/FVtFCht8Pl+l?= =?Windows-1252?Q?kUV907/aw2m2v7CMSVg8PprFkQxmohOlfoescQddnCXkQBiQSqit8FK6?= =?Windows-1252?Q?hmcwTIE4iSd/XzDGMap9lL24LS8oxnrqXVJIB8nYugw+WEup2PQplVXZ?= =?Windows-1252?Q?jAo3J5z+fSEDlbA4Wo8+P84qBZQI5+c2wHcMc2lvinex9aqNPKU5znNi?= =?Windows-1252?Q?BJHV7g2ziaMKIDCScsxZflFuFuSLjj+LfqUirc0OI8CyAh+gC+Karn3l?= =?Windows-1252?Q?OKWs8nzSPdJUtejP3VzXltLK8P1hD81C0r3XbiqguE+vR5NoYbUc0DvW?= =?Windows-1252?Q?6AEEaaX1bf257E4+3tWbgwtIBhYMScRDvPIwc0gfCAd/lAmAnMr957VQ?= =?Windows-1252?Q?ChCn/XosAPtTLx2ZdrqO3uUwZEAlPDYFaWlCGq90ABtjxDNHbacPtaQA?= =?Windows-1252?Q?a3g=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1728;5:7safPGPBV/CP1niRAfo3OYbmqeuNXVvYf7krPTuOEmI+JTstKak3zordlWf91l48nfQcO4ZG4rc/2S1Li3yXVd8mz7/Abbvndnx3GFrbpDumjgWuUwBbEYGz+HmDybsRoZnZKiFUJjSpxlRKNiWB4w==;24:KgZq6luQ3IwpGwRz5v0R31opvtBfbdCc0VnbaOd8lFBsnBkqKbTdlm0wmWcQgVQhOgSIPVOhT9F8JIkxf+l2nhfz1eD05gae8fzne8myCtw=;20:wJvaFu6+YrlvkEjHkUiH+74eNmU2EFpPeSiuF97rMYkziR+l+0Z4gJ0WUZbKflfOFL4N0xNC/b/+NMJNVSnMOA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2015 17:14:15.7952 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1728 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1487 Lines: 51 On 07/16/2015 10:09 AM, Marc Zyngier wrote: > On 16/07/15 17:50, David Daney wrote: [...] >>> 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); > > Neither. > > The way to do it is to make this a *separate* IRQ domain stacked onto > the SPI domain. No funky hook on the side. If it doesn't go through the > normal kernel API, it doesn't reach the GIC. Yes, the irqdomain does handle mapping SPI -> irq, and the message can be derived from the SPI. However, the irqdomain infrastructure cannot supply values for either assert_addr or deassert_addr. Those are needed in order to use SPI. How would you suggest that they be obtained? David Daney > > 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/