Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp802241imm; Wed, 20 Jun 2018 06:54:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKtD3YQ4hTfbUBbMJuod+xX18H+N4Di9gU+KCks/cac6ty1WU4HBfzyRdvgoGsEkelTMHvN X-Received: by 2002:a62:9b57:: with SMTP id r84-v6mr23248349pfd.157.1529502898241; Wed, 20 Jun 2018 06:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529502898; cv=none; d=google.com; s=arc-20160816; b=K3w7Bn9Vye9C4jK49MjHNTmkTM7h8d3qYFYFAaP06qhzOA9Q4HhaCvm+FEGnbR1+6a ufQN+kTGUBfkPiu8Ry4Ws2SSLg+ymoE7hztXdPdeCQ0l0P3UY8xf7h79i4JN1bbY4t38 K7oJJrU5YFpSnbSJPqwesW3bx/QfWXrXEjGrV7sCyRivi47VLdDb8bmIzBoBpqQpHtrr efj7bTb6WRR6PDDGp1RQzO4UdIfJd89a0KFkXaTB8r97lNlcpjQYEsv4ufJ9JNs1HkCy 7Q+SUtOhYJN1w9+o3wQawnbMCh2imOwcEjSQlTVhRNSf83WkXAtZULWOrrqHgwQpCo3P 0wCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=HP6l3005Jk3leTGebHvmZNLKx/PasQuKhc23d4vgtGs=; b=wSr5ewzax1JbjiseQhYx0nnildgOU4sqQoKLZRAvfxSOIr5TvbVux1aazGLdb//jhI 5KZFgBEfSqJV7qDOVuh0I3zc6d/zSUYdjSgz/4HyvWK1QYLpgZsUfzOPLwSEdaZUuWd2 WtJ6wL9PbvTDLWINmygnK5hC5UjPs/bPJMPNCvVggMwA1YAl7N8n5BWerrfTCVNlxO+W OoC4+VKwgw0V6BlaT5zhJgh6zuRX90xQ//4dF4etlmzRGGo1nOED0SpDVQyaFsola8hR MzEixugB4enekzh/MyDFrUjUCOydevzLtmPYE7SHlx/zwUQVGHvmDSsVNl+ViOKraK+S 9Utw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si1990170pgq.564.2018.06.20.06.54.43; Wed, 20 Jun 2018 06:54:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754403AbeFTNxj (ORCPT + 99 others); Wed, 20 Jun 2018 09:53:39 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37528 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754345AbeFTNxh (ORCPT ); Wed, 20 Jun 2018 09:53:37 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AA38480D; Wed, 20 Jun 2018 06:53:36 -0700 (PDT) Received: from big-swifty.cambridge.arm.com (big-swifty.cambridge.arm.com [10.1.31.224]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 969333F578; Wed, 20 Jun 2018 06:53:30 -0700 (PDT) From: Marc Zyngier To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Ard Biesheuvel , Shanker Donthineni , Shameer Kolothum , MaJun , Laurentiu Tudor , Lei Zhang Subject: [PATCH 5/7] irqchip/gic-v3: Expose GICD_TYPER in the rdist structure Date: Wed, 20 Jun 2018 14:52:32 +0100 Message-Id: <20180620135234.32101-6-marc.zyngier@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620135234.32101-1-marc.zyngier@arm.com> References: <20180620135234.32101-1-marc.zyngier@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of exposing the GIC distributor IntID field in the rdist structure that is passed to the ITS, let's replace it with a copy of the whole GICD_TYPER register. We are going to need some of this information at a later time. No functionnal change. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 2 +- drivers/irqchip/irq-gic-v3.c | 4 ++-- include/linux/irqchip/arm-gic-v3.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 554c9d040c5a..8c7e8c235faf 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1600,7 +1600,7 @@ static int __init its_alloc_lpi_tables(void) { phys_addr_t paddr; - lpi_id_bits = gic_rdists->id_bits; + lpi_id_bits = GICD_TYPER_ID_BITS(gic_rdists->gicd_typer); gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT); if (!gic_rdists->prop_page) { pr_err("Failed to allocate PROPBASE\n"); diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 76ea56d779a1..e214181b77b7 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -877,7 +877,7 @@ static struct irq_chip gic_eoimode1_chip = { .flags = IRQCHIP_SET_TYPE_MASKED, }; -#define GIC_ID_NR (1U << gic_data.rdists.id_bits) +#define GIC_ID_NR (1U << GICD_TYPER_ID_BITS(gic_data.rdists.gicd_typer)) static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) @@ -1091,7 +1091,7 @@ static int __init gic_init_bases(void __iomem *dist_base, * The GIC only supports up to 1020 interrupt sources (SGI+PPI+SPI) */ typer = readl_relaxed(gic_data.dist_base + GICD_TYPER); - gic_data.rdists.id_bits = GICD_TYPER_ID_BITS(typer); + gic_data.rdists.gicd_typer = typer; gic_irqs = GICD_TYPER_IRQS(typer); if (gic_irqs > 1020) gic_irqs = 1020; diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index cbb872c1b607..396cd99af02f 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h @@ -576,8 +576,8 @@ struct rdists { phys_addr_t phys_base; } __percpu *rdist; struct page *prop_page; - int id_bits; u64 flags; + u32 gicd_typer; bool has_vlpis; bool has_direct_lpi; }; -- 2.17.1