From patchwork Mon May 18 12:59:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 6429241 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 4EC85C0432 for ; Mon, 18 May 2015 13:14:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74AA1203C2 for ; Mon, 18 May 2015 13:14:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E9D5203B7 for ; Mon, 18 May 2015 13:14:52 +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 1YuKpR-00060h-6q; Mon, 18 May 2015 13:11:33 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YuKet-0004vi-VP for linux-arm-kernel@lists.infradead.org; Mon, 18 May 2015 13:00:41 +0000 Received: by pabts4 with SMTP id ts4so151405467pab.3 for ; Mon, 18 May 2015 06:00:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qGgi1WwgQRv0p5ypG3jaV1YO9pFxAqbH5/oXwCh7JUw=; b=Nb5Pmn2UfBrNcsM3zZADCw81pBLGCOk6BXZYDlsPqxrT724Ub6LPzRez0Q1DTS1/HR iNDXLZRFm1bkEDKlGaI/oHEtV8k9GHC0jXkfyA0EdFV8HggYYvlRbmProm8cYJLFkNXO qrzOuGykkpL+smePOd+UQLogkCiuQeVR+Y0kOJtvX6+GUegKJ9bsV0hXyRpGgK0ExqMA 8zVzvVV2VNl95/THqQhORtDo5pSYMzj+LFHqTd+CjUpl/eKjaC4BIjFBFZAH/QuObkQl AbMyHkXfzPsN0kl4jbIiRo/eG7Fz4a4Znds1xfdX9KgKjs1ESMOotSDF8hcKRYjY1mFf WaxQ== X-Gm-Message-State: ALoCoQlHPo5/84OtRTTGgoZiUFiJztv12XVCdj0cVEXg2yWCt8ABsIQ4whZm2x9juei/b8QSKM8b X-Received: by 10.68.192.98 with SMTP id hf2mr15537750pbc.142.1431954017954; Mon, 18 May 2015 06:00:17 -0700 (PDT) Received: from localhost ([180.150.148.224]) by mx.google.com with ESMTPSA id f1sm10070330pdp.24.2015.05.18.06.00.16 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 18 May 2015 06:00:17 -0700 (PDT) From: Hanjun Guo To: Marc Zyngier , Jason Cooper , Will Deacon , Catalin Marinas , "Rafael J. Wysocki" Subject: [PATCH 09/11] irqchip / GICv3: Add stacked irqdomain support for ACPI based init Date: Mon, 18 May 2015 20:59:19 +0800 Message-Id: <1431953961-22706-10-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431953961-22706-1-git-send-email-hanjun.guo@linaro.org> References: <1431953961-22706-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150518_060040_154884_CB4A3651 X-CRM114-Status: GOOD ( 14.99 ) X-Spam-Score: -0.7 (/) Cc: Lorenzo Pieralisi , Arnd Bergmann , linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, linux-kernel@vger.kernel.org, Tomasz Nowicki , Olof Johansson , Hanjun Guo , Grant Likely , Thomas Gleixner , Jiang Liu , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Similar as stacked domain support for ACPI based GICv2 init, let acpi_irq_domain point to the core domain of GICv3 and pass the gsi as the arg to support stacked irqdomain. Signed-off-by: Hanjun Guo --- drivers/irqchip/irq-gic-v3.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 11946a6..e7f134e 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -733,15 +733,21 @@ static int gic_irq_domain_xlate(struct irq_domain *d, static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, unsigned int nr_irqs, void *arg) { - int i, ret; + int i; irq_hw_number_t hwirq; - unsigned int type = IRQ_TYPE_NONE; - struct of_phandle_args *irq_data = arg; - ret = gic_irq_domain_xlate(domain, irq_data->np, irq_data->args, - irq_data->args_count, &hwirq, &type); - if (ret) - return ret; + if (domain->of_node) { /* DT case */ + int ret; + unsigned int type = IRQ_TYPE_NONE; + struct of_phandle_args *irq_data = arg; + + ret = gic_irq_domain_xlate(domain, irq_data->np, irq_data->args, + irq_data->args_count, &hwirq, &type); + if (ret) + return ret; + } else { /* ACPI case */ + hwirq = (irq_hw_number_t)*(u32 *)arg; + } for (i = 0; i < nr_irqs; i++) gic_irq_domain_map(domain, virq + i, hwirq + i); @@ -1012,7 +1018,7 @@ gic_v3_acpi_init(struct acpi_table_header *table) if (err) goto out_redist_unmap; - irq_set_default_host(gic_data.domain); + acpi_irq_domain = gic_data.domain; return 0; out_redist_unmap: