From patchwork Tue May 5 13:50:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 6338461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC23F9F32B for ; Tue, 5 May 2015 13:59:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C39B202A1 for ; Tue, 5 May 2015 13:59:42 +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 20D3520251 for ; Tue, 5 May 2015 13:59:41 +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 1YpdKL-0006lx-2M; Tue, 05 May 2015 13:56:01 +0000 Received: from mail-pa0-f44.google.com ([209.85.220.44]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YpdI4-0003mH-Iz for linux-arm-kernel@lists.infradead.org; Tue, 05 May 2015 13:53:41 +0000 Received: by pacwv17 with SMTP id wv17so193939292pac.0 for ; Tue, 05 May 2015 06:53:17 -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=mz8J8eGloqwqC/M4rFmDRSjxE8AqZK7MT4POWk8i5jpyWqmMNod/K0ITOdc1deljpm 4CcFEs0krnOdqCLXAIwgulzrmMm0uLOqQr/WoZyOmozknSMlBSiBeQDlpL6ZWbkgVG27 Z/yvv/UbKvYSt5yvX4PaX9WOLF74jMcV1L4YAEsVtjmb33Psl7N8aSbnkQnOO2djxK1i ITdfR0TsJtHyQV/mM3t5aP9lucVo8T1/xc3vs/Tt+JlnuFEWKPGc1YrFmNBM31EfL7pM +KUp7Fu+Uviuyul6u6Ivt3eNucCoe0n6xQXoSNLX0NrtflvLNdT7B0rUca7RLKj0kLaJ IgUw== X-Gm-Message-State: ALoCoQnJdwpJX9002zYLHua8DIYO3R8hTPG/pknS0FxWyX/srOq6FAF+c7/BvHX08BPAYSabjWLU X-Received: by 10.66.248.195 with SMTP id yo3mr17223194pac.123.1430833997271; Tue, 05 May 2015 06:53:17 -0700 (PDT) Received: from localhost ([180.150.157.4]) by mx.google.com with ESMTPSA id fu7sm16189211pac.26.2015.05.05.06.53.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 May 2015 06:53:15 -0700 (PDT) From: Hanjun Guo To: Marc Zyngier , Jason Cooper , Will Deacon , Catalin Marinas , "Rafael J. Wysocki" Subject: [RFC PATCH 9/9] irqchip / GICv3: Add stacked irqdomain support for ACPI based init Date: Tue, 5 May 2015 21:50:57 +0800 Message-Id: <1430833857-30736-10-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430833857-30736-1-git-send-email-hanjun.guo@linaro.org> References: <1430833857-30736-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150505_065340_713706_7F2BC3A7 X-CRM114-Status: GOOD ( 14.49 ) 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: