From patchwork Mon Jul 13 09:14:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 6776551 Return-Path: X-Original-To: patchwork-linux-arm@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 6D074C05AC for ; Mon, 13 Jul 2015 09:17:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F8A32067A for ; Mon, 13 Jul 2015 09:17:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98F0D20678 for ; Mon, 13 Jul 2015 09:17:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZEZpW-0002yU-Cy; Mon, 13 Jul 2015 09:15:18 +0000 Received: from mail-bn1bon0111.outbound.protection.outlook.com ([157.56.111.111] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZEZpU-0001l4-DW for linux-arm-kernel@lists.infradead.org; Mon, 13 Jul 2015 09:15:17 +0000 Received: from BY2PR02CA0094.namprd02.prod.outlook.com (10.242.32.52) by BN3PR02MB1141.namprd02.prod.outlook.com (10.162.168.147) with Microsoft SMTP Server (TLS) id 15.1.213.14; Mon, 13 Jul 2015 09:14:54 +0000 Received: from BY2FFO11FD037.protection.gbl (2a01:111:f400:7c0c::171) by BY2PR02CA0094.outlook.office365.com (2a01:111:e400:2c2a::52) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Mon, 13 Jul 2015 09:14:47 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; arm.com; dkim=none (message not signed) header.d=none; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp02.amd.com (165.204.84.222) by BY2FFO11FD037.mail.protection.outlook.com (10.1.14.222) with Microsoft SMTP Server id 15.1.213.8 via Frontend Transport; Mon, 13 Jul 2015 09:14:46 +0000 X-WSS-ID: 0NRF5OI-08-RTZ-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (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 2643FD16036; Mon, 13 Jul 2015 05:14:42 -0400 (EDT) Received: from SATLEXDAG02.amd.com (10.181.40.5) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 13 Jul 2015 04:14:59 -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; Mon, 13 Jul 2015 05:14:43 -0400 From: Suravee Suthikulpanit To: , , , , Subject: [RFCv2 PATCH 1/8] irqdomain: Introduce irq_domain_ops.init_alloc_info Date: Mon, 13 Jul 2015 16:14:17 +0700 Message-ID: <1436778864-17645-2-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1436778864-17645-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1436778864-17645-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD037; 1:MPnb8TOShlnIHlUn1LUfnfqOQs9BcLSe6fIAe8Ed9rMdCR0n5qr5O0Oadnb0SXTWl0RL/JTtdaW6VtLhuznfeG2agnLjAWWaobJuJyLaGeu8anvNPaQIQVINGWtQcr1R7r3jSNZ7G16yuk2IR4rhGWRfT8JzHcW+7RdZJgOUElqozvtgoxJLHY5tCXZ78vTMe7yTRNgXv2PhCCwE1ie90+QlqWMivlO0SlqFCZsRFLEpfcE6XbyuY1PJtC1pu5wrh1EXtNDNgLtQQbAbabxWFxTiP1tdvt650JMxoLC1NF9vuFG6pAcfZN47yJShHYgPhhPvuUM0UfvAwL9kzlXOTeG5XZwodtfIW6w3d0n08zMVJ7EWrT5c8P5v08cH3WqPXAzzonUiKvMNjLauEv11Hc1YKyobC2Ecz9ccR3Nyymc= X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(428002)(164054003)(189002)(199003)(92566002)(19580405001)(19580395003)(77156002)(2201001)(87936001)(53416004)(229853001)(50226001)(76176999)(105586002)(86362001)(50986999)(48376002)(50466002)(5001770100001)(5001920100001)(47776003)(101416001)(62966003)(5003940100001)(189998001)(2950100001)(36756003)(77096005)(46102003)(5003600100002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR02MB1141; H:atltwp02.amd.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3PR02MB1141; 2:D5EAYDkE6HrCZk3s1ylcsMNvwHwxW620g7VOhlSsNt2jDNOGBchz4UxcCWvLdf/Q; 3:T6Leg6DA1L0jWRMY+vv93R3ZZBN+OjCmM6Vx8ITHR4rlOYVNfqH5J1TZ6bRembeTKUi1qXaPf1+IHK8hwhRBDi/3WRdP9EDxMKQwNFmXGgACOfDiyt0v5ZUcNFSbprEa/RFf3ogNNj8j2v+HS5GnVnNjxBoPEgtLTMrxVZahToTBrZWaX1/t4ZD/N9fJmxd5WLuV3gVw6E148Ull+VyuvQQHr+IFUnbUOjj9sXh0SNM4tENhUsu3VL3SednA8WaX; 25:fxpBz0snmect2bcJPJucXyHhTfnkoinlGC6xVlr0GQInxrObTxmg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2xfr0QwVJNAb8nxtZGlFdIOUegsGKH2Lr2YKQjf8igxJWhL4Wm+q6KgX4Xk58= BN3PR02MB1141: 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:BN3PR02MB1141; BCL:0; PCL:0; RULEID:; SRVR:BN3PR02MB1141; X-Forefront-PRVS: 0636271852 X-Microsoft-Exchange-Diagnostics: 1; BN3PR02MB1141; 23:HguLG82c8W+80CrOYQ3ckZETEcvvHtU7PhL91Z44F9XwvJSDE6BjWY9zmQvyRL53EUesXlJ0e8aDriGyEFXxRo/7/DzARiSUIhONWZpbn0qMbGGC9ahsbADzNFeUgcAZ3FNgD/G81NLeBO6Fph7O1gXkWs8eGODHodsEXC9qwXNOrbWvMSbYtym8rCUWFsLpzHz0eEYNKwcBKNe9cIY0b40bnIasAGi2x03pKNXZqkceMuZQXuyHfp6W//a9Ah6WCs9JtDg6RUCAzH7cKDJZetTcwlCKOoFzDurcxfVcAUTlobuYXFOBDkNvmWYugpcHmsuA+h5fBH0ry9PmVBN8gK3yYkiesg/PSENR9iJQpsAwSrfVZtsIJpxgtjgGOfsCcPylH65qm1TuGjX0FVI35cWfsrDMOpdcpBpsmW++YtcoAyfxAtAnX3waNmzuqb0gU/jNxstcJtk1kXZUC0XL9ougWrv1rqS+T+v17blbFZbleCxY2WglUVIPpMsW/sPYjEnmYM/BME4w+3r6U6NW6ZnloiCsbfSNxRK5i8XSB9kZ6Sbyjh/z5IHWk5Nns1K1cixR6Npug7JE/thZHicC1qA4woBSjvXlOd+QJVdH3RRAjqvkMOkE2BBR0yd8A4vmn+uf5aZFPxEtWTZNg7831IG1Se4El9xmqJtp/rHONSHy23BxBpm3SyCkBad9PAPAsy+Q983QQhrmlnGwBI9zxrfLKpRaOiG4uu3/JrClwTve3PNa1WjY7WN+UPfdUOzeBTxo5Hk7YgVxnFYb64ghR6Va0CcLAkhBny4eHLAD84f+VsO46ZCz/0RgZe7fUY5lH+PaZI9QVLxtuji5BPWoAj8T7fsyz5jZemwOx+H4YgoX3LGScSw2Q0oShSUSaVuSr+ZFE4IpWdVUNXO7Bb9UDw== X-Microsoft-Exchange-Diagnostics: 1; BN3PR02MB1141; 5:7rkxEaF/BT431CoQHEfqNuW/mQEHPhoFm3gv7Bp9z3l5LpTcBqKlymPWLOTKIAU4ZdOn5VGmxNTxBKTV36cWRFvJxGwvExOF7QQyp9+7AbQ+cCMLeWyIPLgBi7vAN0FRLo/taOUXVy33lBf1yGx+4g==; 24:b4JJBkpanrA0wgTvpkT0+JBps0oReaCuQiHXcJGxIBXGxSBg7pLe6ZL/MhlSMe2qybPR2YxDubgQ4tmdh/TTqAKSzz6QXxW7qm10Bt2dlwA=; 20:qwQvl2tuTJQ21czG719vIfLDSYOdz0ACe+XGsk0RL1bBornwOJvDooArQ/XivvjEhjZmSj7NJpsAV+Rq2qy3Nw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2015 09:14:46.4120 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96; Ip=[165.204.84.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR02MB1141 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150713_021516_674482_EC81B409 X-CRM114-Status: GOOD ( 12.81 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rjw@rjwysocki.net, al.stone@linaro.org, catalin.marinas@arm.com, sherry.hurwitz@amd.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, leo.duran@amd.com, Suravee Suthikulpanit , msalter@redhat.com, grant.likely@linaro.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Currently, when calling irq_domain_alloc_irqs() on ARM64, it uses struct of_phandle_args to pass irq information. However, this is not appropriate for ACPI since of_phandle_args is specific to DT. Therefore, this patch introduces a new function pointer, irq_domain_ops.init_alloc_info, which can be used by irqchips to provide a way to initialize irqchip-specific data-structure for allocating IRQ. Signed-off-by: Suravee Suthikulpanit --- NOTE: Similarly, x86 is currently using struct irq_alloc_info (see arch/x86/include/asm/hw_irq.h) and each irq_domain has different way of initializing this structure. Patch 2 also has an example of how I am planning to use this new op. Alternative would be to keep re-using of_phandle_args for ACPI as done currently. Any suggestions / feedbacks here are appreciated. Thanks, Suravee include/linux/irqdomain.h | 2 ++ kernel/irq/irqdomain.c | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index b4a74f7..1e51369 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -86,6 +86,8 @@ struct irq_domain_ops { /* extended V2 interfaces to support hierarchy irq_domains */ int (*alloc)(struct irq_domain *d, unsigned int virq, unsigned int nr_irqs, void *arg); + int (*init_alloc_info)(uint32_t *data, int nr, void *ref, + void **info); void (*free)(struct irq_domain *d, unsigned int virq, unsigned int nr_irqs); void (*activate)(struct irq_domain *d, struct irq_data *irq_data); diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 995d217..54434d2 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -478,6 +478,7 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) irq_hw_number_t hwirq; unsigned int type = IRQ_TYPE_NONE; int virq; + void *info; domain = irq_data->np ? irq_find_host(irq_data->np) : irq_default_domain; if (!domain) { @@ -504,7 +505,14 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) if (virq) return virq; - virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, irq_data); + if (domain->ops->init_alloc_info) + if (domain->ops->init_alloc_info(irq_data->args, + irq_data->args_count, + irq_data->np, + &info)) + return 0; + + virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, info); if (virq <= 0) return 0; } else {