Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp213750imm; Fri, 21 Sep 2018 13:02:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZAK5tCc5qB5f2AnkDPk6z2zFCSO1wg/VNcglPVgqGqwFuj/rCl5Mwsm3lmWaTaup77B6VE X-Received: by 2002:a17:902:1:: with SMTP id 1-v6mr27493692pla.206.1537560123329; Fri, 21 Sep 2018 13:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537560123; cv=none; d=google.com; s=arc-20160816; b=faLsQjbpJ58XWqJ2afl7OxaJ+VP1hL2uG7Be5+3Hu0SCFc+D+3VDHZzCJwMuqv8pwc 67YFYC8g8PFOyGRevwEESNs/CN/3yqCq2lbUij1oPaM2KV/HeR+IbXKjUc8Z471b4wLG iqD1q7eJZ59X7/2W1j0jebzhdLVkaxQENzkFyS4ZOO75cSgJQC3Ozcyh925653FW7RdE +0ocaA9DmytbevvY1zXACDfYj18tJ5tMQw3lAt9ER1+iOz4hCt4lI26LVrgsGBL/YvWz VsV89X128hYCZvHHflc0pzY/Zf91odFR73GtnlNi3qouaYtwSrgzXtFqIAaN45M7Vv6t Ff5A== 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; bh=bv4DcSTUruIvvtQF51MwbV5YvRodnexRoetfHqv62w8=; b=g7LgF2F8r2bqMIuvTbt01rk6EdyAuBKnhcNuySxZXxJ8dOXvzrcjyr0dQmWn6Vy4ti Pj03ZL9OQ8pi5Q8mh1rcw9knf4GlrNXwcxgDKy1DocZ4IAd8n1qkEbs+a7UXw2RHeJQd nI3jm7yr4QOOs9ZOwyxv8AyVQVnjMBXuTgh/Bb7cONNYafWEOFx0YGVq1bnPoiZSj33w UriZ29NDDiEuwCZKiNfwBwYeR1mb+ULl+ill1CMqNV1pUzBuJCPl0AV4FKx4n8ItN1gq 6ghSHbrj3xYxunvEHxMdS20kXo6y0W/J/SqEXS2bd1JgbI3p6oaUfEWbTNYBOpLSMF9q mNUw== 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 i19-v6si27481094pgj.140.2018.09.21.13.01.48; Fri, 21 Sep 2018 13:02:03 -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 S2391415AbeIVBum (ORCPT + 99 others); Fri, 21 Sep 2018 21:50:42 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41268 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391371AbeIVBum (ORCPT ); Fri, 21 Sep 2018 21:50:42 -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 41C101596; Fri, 21 Sep 2018 13:00:18 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EACEA3F5BD; Fri, 21 Sep 2018 13:00:17 -0700 (PDT) From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Jeremy Linton , Jeffrey Hugo , Thomas Gleixner , Jason Cooper Subject: [PATCH 01/10] irqchip/gic-v3-its: Change initialization ordering for LPIs Date: Fri, 21 Sep 2018 20:59:45 +0100 Message-Id: <20180921195954.21574-2-marc.zyngier@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180921195954.21574-1-marc.zyngier@arm.com> References: <20180921195954.21574-1-marc.zyngier@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We currently initialize the LPIs (and the ITS) fairly early, even before the SMP support and the CPU interface. This is a bit odd (as LPIs are not exactly crutial for the early boot process), and is going to cause issues when reorganizing the probing code. Let's move this initialization later. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index d5912f1ec884..6232f98ef81b 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -653,7 +653,9 @@ early_param("irqchip.gicv3_nolpi", gicv3_nolpi_cfg); static int gic_dist_supports_lpis(void) { - return !!(readl_relaxed(gic_data.dist_base + GICD_TYPER) & GICD_TYPER_LPIS) && !gicv3_nolpi; + return (IS_ENABLED(CONFIG_ARM_GIC_V3_ITS) && + !!(readl_relaxed(gic_data.dist_base + GICD_TYPER) & GICD_TYPER_LPIS) && + !gicv3_nolpi); } static void gic_cpu_init(void) @@ -673,10 +675,6 @@ static void gic_cpu_init(void) gic_cpu_config(rbase, gic_redist_wait_for_rwp); - /* Give LPIs a spin */ - if (IS_ENABLED(CONFIG_ARM_GIC_V3_ITS) && gic_dist_supports_lpis()) - its_cpu_init(); - /* initialise system registers */ gic_cpu_sys_reg_init(); } @@ -689,6 +687,10 @@ static void gic_cpu_init(void) static int gic_starting_cpu(unsigned int cpu) { gic_cpu_init(); + + if (gic_dist_supports_lpis()) + its_cpu_init(); + return 0; } @@ -1127,14 +1129,16 @@ static int __init gic_init_bases(void __iomem *dist_base, gic_update_vlpi_properties(); - if (IS_ENABLED(CONFIG_ARM_GIC_V3_ITS) && gic_dist_supports_lpis()) - its_init(handle, &gic_data.rdists, gic_data.domain); - gic_smp_init(); gic_dist_init(); gic_cpu_init(); gic_cpu_pm_init(); + if (gic_dist_supports_lpis()) { + its_init(handle, &gic_data.rdists, gic_data.domain); + its_cpu_init(); + } + return 0; out_free: -- 2.18.0