From patchwork Tue Jun 12 14:55:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 138359 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5458202lji; Tue, 12 Jun 2018 07:57:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLvY9WFOMGpRSqwdIQ7lrnsDOrageNyNGD9D9yOdWhRA9FaOLRCczf9j4xjD/jNF2w2Hfgi X-Received: by 2002:a62:221a:: with SMTP id i26-v6mr760744pfi.240.1528815443014; Tue, 12 Jun 2018 07:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528815443; cv=none; d=google.com; s=arc-20160816; b=qOu5hSlEX4XJ25IGg0R1cKp7xen1hWlX9bFAvLkLnzHYEE064OKbCgZHxmwRHTx2CQ U6/V88dZOIRlECXJf7sixNd22SVsaZR1AaO8aALjhkCZOD7xNTwqHlXdoR6/h4jLGFHn f8xEJuqJYe/sAZPtIIvg+mUWFNliVq/RMD8gfWCpjpCAyf3opteWtrEzztSo47BixT1r SypwWslPIJ62SLBqvWUwTwmcDj6VoctCGahgg01PYuuakWWS8RS9N0T6agty/7xn5Npn ghoWUdYlE0dZGxb+7HNaML9caC90UK/KnIpELDtJ2NetQixk8EivRMfceq/sFHQVTq7T B5qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=1F6Qi5E3tSKTs7kANCV70iTjqrG88IEy14vOXvGp220=; b=mmhCO2jnjj7ApPiIBLd13PN3LVIwkbN8YzxN9C2D28rjrPi5AnbNl3MIfaQj4JfaAB n8IWA4P+FlQBzbDIRNHjHWBtJjpnc3kHvnsuSYgMe8gBuN9dAYnomd6SgVRxrkluknjo OeHIIaIPbt9f2Jv7nRdD6lMIVzw6rUXdRGAGqaTghtdAYH2W2kCaqukVyr6s1qjP+uwt sWiatlTJfccFlCqPoYJSxpuLliM+1YHyJjUY6AytT2aDBj0pxVDwkI1L6lkIzvsuvyJt 0gUDeQ6co01jsH9qgEDP7kwy3CzLNQD3cneh6/xJxvNYXIgI8Qlg82cF4Iqsgt57nl63 m7fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TnpcXpCo; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7-v6si404279plj.122.2018.06.12.07.57.22; Tue, 12 Jun 2018 07:57:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TnpcXpCo; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933584AbeFLO5V (ORCPT + 13 others); Tue, 12 Jun 2018 10:57:21 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:33947 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932905AbeFLO5U (ORCPT ); Tue, 12 Jun 2018 10:57:20 -0400 Received: by mail-wr0-f196.google.com with SMTP id a12-v6so24448092wro.1 for ; Tue, 12 Jun 2018 07:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=lSxJbUdHNmVBPGUOkpXnq+1zAeru6Vo8+QUxKtlWkQ8=; b=TnpcXpCooscpUzEozegNOvd6xJahWMXweN9g3OOY8LL9ILst7gJJRdeXWd3WOHHNe3 lpTsSHiQxYabG6h0XmoJb8v1dwdEgNMmpyLP4Gq1xdhZRI77jTWPl6kh0mt03K5sawCs Qb90VfMArix+tZnWuyBEASyoc4k4PDfUp3Zko= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lSxJbUdHNmVBPGUOkpXnq+1zAeru6Vo8+QUxKtlWkQ8=; b=n9JNYFbbZxL9xId1lMd8fC5SFS0Xd+ArBhSXaY2jOLy9HEvSgK2EMOMF5/6PKONMWi CJj6wHKuYB3p1Xx8iIckfmDjDgqtMy6PMBkVFeWyXQVhI+F4Fw6sdm8yCBOT28sjhpD0 80PoqBgW9U7w0Jg6PxvJRf1X+wKMvweCIL84gib0dRVNEgcXh/vGlPMY9rb0YjAb12hL sEeNaBBzU/VYF1l+pq+NBw8t0z8GspBg/BaVtspfNlWyjZBEVtt4SSztwkhhN+kfDevR 7qBTEqPkTokwyxOf0fZBNj2j+kPRKMv5j2Mu0nTm8SyIIM3SY6PayIi22zlS3jbznt8G cFkg== X-Gm-Message-State: APt69E2KAw0flfMNG/3FuAsIgHASFy7RZNAg/WB7eoZkPe+M2T1+z+e5 m6TVPpxsWFTd17kyytVjXMhYVw== X-Received: by 2002:adf:f8c2:: with SMTP id f2-v6mr538977wrq.237.1528815439365; Tue, 12 Jun 2018 07:57:19 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id o16-v6sm474408wrp.8.2018.06.12.07.57.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jun 2018 07:57:18 -0700 (PDT) From: Srinivas Kandagatla To: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, sboyd@kernel.org, Srinivas Kandagatla Subject: [PATCH] irqchip/gic-v3: do not access GICR_WAKER if its secured register. Date: Tue, 12 Jun 2018 15:55:16 +0100 Message-Id: <20180612145516.30897-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org GICR_WAKER can be a secured register, check this before accessing it as its done in power management code. Without this patch Qualcomm DB820c board crashes. Signed-off-by: Srinivas Kandagatla --- drivers/irqchip/irq-gic-v3.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 5a67ec084588..38136d6e9ca5 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -656,6 +656,12 @@ static int gic_dist_supports_lpis(void) return !!(readl_relaxed(gic_data.dist_base + GICD_TYPER) & GICD_TYPER_LPIS) && !gicv3_nolpi; } +/* Check whether it's single security state view */ +static bool gic_dist_security_disabled(void) +{ + return readl_relaxed(gic_data.dist_base + GICD_CTLR) & GICD_CTLR_DS; +} + static void gic_cpu_init(void) { void __iomem *rbase; @@ -664,7 +670,8 @@ static void gic_cpu_init(void) if (gic_populate_rdist()) return; - gic_enable_redist(true); + if (gic_dist_security_disabled()) + gic_enable_redist(true); rbase = gic_data_rdist_sgi_base(); @@ -819,11 +826,6 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val, #endif #ifdef CONFIG_CPU_PM -/* Check whether it's single security state view */ -static bool gic_dist_security_disabled(void) -{ - return readl_relaxed(gic_data.dist_base + GICD_CTLR) & GICD_CTLR_DS; -} static int gic_cpu_pm_notifier(struct notifier_block *self, unsigned long cmd, void *v)