The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mikko Perttunen <mperttunen@nvidia.com>
To: <tglx@linutronix.de>, <jason@lakedaemon.net>, <marc.zyngier@arm.com>
Cc: <linux-kernel@vger.kernel.org>, <talho@nvidia.com>,
	<aniruddhab@nvidia.com>, Matt Craighead <mcraighead@nvidia.com>,
	Mikko Perttunen <mperttunen@nvidia.com>
Subject: [PATCH] irqchip/gic: Don't write to GICD_ICFGR0
Date: Thu, 6 Apr 2017 11:17:11 +0300	[thread overview]
Message-ID: <1491466631-11206-1-git-send-email-mperttunen@nvidia.com> (raw)

From: Matt Craighead <mcraighead@nvidia.com>

According to the GICv2 specification, the GICD_ICFGR0,
or GIC_DIST_CONFIG[0] register is read-only. Therefore
avoid writing to it.

Signed-off-by: Matt Craighead <mcraighead@nvidia.com>
[mperttunen@nvidia.com: commit message rewritten]
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/irqchip/irq-gic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 1b1df4f770bd..d9c0000050e0 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -609,7 +609,7 @@ void gic_dist_restore(struct gic_chip_data *gic)
 
 	writel_relaxed(GICD_DISABLE, dist_base + GIC_DIST_CTRL);
 
-	for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
+	for (i = 1; i < DIV_ROUND_UP(gic_irqs, 16); i++)
 		writel_relaxed(gic->saved_spi_conf[i],
 			dist_base + GIC_DIST_CONFIG + i * 4);
 
@@ -699,7 +699,7 @@ void gic_cpu_restore(struct gic_chip_data *gic)
 	}
 
 	ptr = raw_cpu_ptr(gic->saved_ppi_conf);
-	for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
+	for (i = 1; i < DIV_ROUND_UP(32, 16); i++)
 		writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);
 
 	for (i = 0; i < DIV_ROUND_UP(32, 4); i++)
-- 
2.1.4

             reply	other threads:[~2017-04-06  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06  8:17 Mikko Perttunen [this message]
2017-04-06  9:26 ` [PATCH] irqchip/gic: Don't write to GICD_ICFGR0 Marc Zyngier
2017-04-07  6:49   ` Mikko Perttunen
2017-04-07  7:32     ` Marc Zyngier
2017-04-10 10:32       ` Mikko Perttunen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491466631-11206-1-git-send-email-mperttunen@nvidia.com \
    --to=mperttunen@nvidia.com \
    --cc=aniruddhab@nvidia.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mcraighead@nvidia.com \
    --cc=talho@nvidia.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox