Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7258043imm; Tue, 28 Aug 2018 08:54:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZhrOeFkLwA/pdI2aRhV66+2Hqi04i/QXBpg2pITxNcgh3Tg6Gmrp6qmA5OtPFf+EhIt6eF X-Received: by 2002:a63:dc17:: with SMTP id s23-v6mr2174057pgg.40.1535471651903; Tue, 28 Aug 2018 08:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535471651; cv=none; d=google.com; s=arc-20160816; b=nyFnviRi0eSe7KWAcekQxHfDnbl8xo1Eh9v3ikFWsQ6RVTYA77HRDwNEOBSD2Y32Gp QyoxLs7TWiyknURfVEVpyiXhamYJS4XvIDZ3bR/6Pw30abEfkkyyOIuZpaRLt8HrGT12 AR9fAFBU6jW3wYLC8I2jFJqRIfe9ZoY97n+Q9kCQEMuCVeZIPSIu+vvst/X7FqK2r3DE IQeFdC7JlUJRR281IyJ0Ppw4CMydSz9aq4AhnkwvTT//YBseB3XzOdBDZedHNgGj9iVY bQKocfVq0Q/lRdonPJ/+g/Ub6E4VYuC11Se0796MHkIy6+n07kHfdUVEReJigVLMcxDT B0CA== 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=Ur88HYQ4WtzdshJqeBg9/GST4cTYTVUgaDlZe01dQ+M=; b=jHTCIBBpNfzOfYXwlKdtKK90npnI/dKU3PNjNbdUU/hApZ/3x2nfzGT5ojaQowewHx s+Gl+KNQY9ruIHselEH/wSqUIsihruPm14bn6jnn45O32wJIxOQcJiZOVnxH03d9zU8u CqWw/f3weP4A5fry4ZQAIuzEJfS6jKadttcnTjmeRS/V4Z2olT+3aICAyJyZGo4tx0gq MOOtAYWdzv93cAfoExo65pqxs9g8Z6MgzVpcnodgTJzjVa4I+0AeUGKSvkfCa3DbvHqG XcjPEuqtqpG8RPKBpJBtDpnTyqgOwQ/DoMOM1BGOCI0NbsDO/IP48Ye49CvEY9y3L1vE wEWQ== 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 q23-v6si1394217pgj.354.2018.08.28.08.53.56; Tue, 28 Aug 2018 08:54:11 -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 S1727800AbeH1Tor (ORCPT + 99 others); Tue, 28 Aug 2018 15:44:47 -0400 Received: from foss.arm.com ([217.140.101.70]:41108 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbeH1Tor (ORCPT ); Tue, 28 Aug 2018 15:44:47 -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 C0EA5ED1; Tue, 28 Aug 2018 08:52:30 -0700 (PDT) Received: from e112298-lin.Emea.Arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8C34E3F557; Tue, 28 Aug 2018 08:52:28 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, daniel.thompson@linaro.org, joel@joelfernandes.org, marc.zyngier@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, james.morse@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, Julien Thierry , Thomas Gleixner , Jason Cooper Subject: [PATCH v5 18/27] irqchip/gic-v3: Do not overwrite PMR value Date: Tue, 28 Aug 2018 16:51:28 +0100 Message-Id: <1535471497-38854-19-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535471497-38854-1-git-send-email-julien.thierry@arm.com> References: <1535471497-38854-1-git-send-email-julien.thierry@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the architecture is using ICC_PMR_EL1 to mask IRQs, do not overwrite that value. Tested-by: Daniel Thompson Signed-off-by: Julien Thierry Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier --- drivers/irqchip/irq-gic-v3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index fef6688..162c49c 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -407,6 +407,9 @@ static u32 gic_get_pribits(void) static bool gic_has_group0(void) { u32 val; + u32 old_pmr; + + old_pmr = gic_read_pmr(); /* * Let's find out if Group0 is under control of EL3 or not by @@ -422,6 +425,8 @@ static bool gic_has_group0(void) gic_write_pmr(BIT(8 - gic_get_pribits())); val = gic_read_pmr(); + gic_write_pmr(old_pmr); + return val != 0; } @@ -583,7 +588,8 @@ static void gic_cpu_sys_reg_init(void) group0 = gic_has_group0(); /* Set priority mask register */ - write_gicreg(DEFAULT_PMR_VALUE, ICC_PMR_EL1); + if (!gic_prio_masking_enabled()) + write_gicreg(DEFAULT_PMR_VALUE, ICC_PMR_EL1); /* * Some firmwares hand over to the kernel with the BPR changed from -- 1.9.1