sharkcz / rpms / kernel

Forked from rpms/kernel 6 years ago
Clone
c6ca7ce
From patchwork Wed Jun 21 18:20:04 2017
c6ca7ce
Content-Type: text/plain; charset="utf-8"
c6ca7ce
MIME-Version: 1.0
c6ca7ce
Content-Transfer-Encoding: 7bit
c6ca7ce
Subject: pinctrl: bcm2835: Avoid warning from __irq_do_set_handler
c6ca7ce
From: Stefan Wahren <stefan.wahren@i2se.com>
c6ca7ce
X-Patchwork-Id: 9802555
c6ca7ce
Message-Id: <1498069204-28154-1-git-send-email-stefan.wahren@i2se.com>
c6ca7ce
To: Linus Walleij <linus.walleij@linaro.org>, Eric Anholt <eric@anholt.net>
c6ca7ce
Cc: Stefan Wahren <stefan.wahren@i2se.com>, linux-gpio@vger.kernel.org,
c6ca7ce
 Phil Elwell <phil@raspberrypi.org>, linux-rpi-kernel@lists.infradead.org, 
c6ca7ce
 linux-arm-kernel@lists.infradead.org
c6ca7ce
Date: Wed, 21 Jun 2017 20:20:04 +0200
c6ca7ce
c6ca7ce
We get a warning during boot with enabled EARLY_PRINTK that
c6ca7ce
we try to set a irq_chip without data. This is caused by ignoring
c6ca7ce
the return value of irq_of_parse_and_map(). So avoid calling
c6ca7ce
gpiochip_set_chained_irqchip() in error case.
c6ca7ce
c6ca7ce
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
c6ca7ce
Fixes: 85ae9e512f43 ("pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP")
c6ca7ce
---
c6ca7ce
 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 4 ++++
c6ca7ce
 1 file changed, 4 insertions(+)
c6ca7ce
c6ca7ce
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
c6ca7ce
index 1eb7a1a..2308831 100644
c6ca7ce
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
c6ca7ce
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
c6ca7ce
@@ -1048,6 +1048,10 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
c6ca7ce
 	for (i = 0; i < BCM2835_NUM_IRQS; i++) {
c6ca7ce
 		pc->irq[i] = irq_of_parse_and_map(np, i);
c6ca7ce
 		pc->irq_group[i] = i;
c6ca7ce
+
c6ca7ce
+		if (pc->irq[i] == 0)
c6ca7ce
+			continue;
c6ca7ce
+
c6ca7ce
 		/*
c6ca7ce
 		 * Use the same handler for all groups: this is necessary
c6ca7ce
 		 * since we use one gpiochip to cover all lines - the
c6ca7ce
From 8aa99fe688734f249b07314cdd7c5e25651c9c6d Mon Sep 17 00:00:00 2001
c6ca7ce
From: Phil Elwell <phil@raspberrypi.org>
c6ca7ce
Date: Thu, 27 Oct 2016 16:21:19 +0100
c6ca7ce
Subject: irq-bcm2836: Prevent spurious interrupts, and trap them early
c6ca7ce
c6ca7ce
The old arch-specific IRQ macros included a dsb to ensure the
c6ca7ce
write to clear the mailbox interrupt completed before returning
c6ca7ce
from the interrupt. The BCM2836 irqchip driver needs the same
c6ca7ce
precaution to avoid spurious interrupts.
c6ca7ce
c6ca7ce
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
c6ca7ce
---
c6ca7ce
 drivers/irqchip/irq-bcm2836.c | 1 +
c6ca7ce
 1 file changed, 1 insertion(+)
c6ca7ce
c6ca7ce
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
c6ca7ce
index e7463e3..a8db33b 100644
c6ca7ce
--- a/drivers/irqchip/irq-bcm2836.c
c6ca7ce
+++ b/drivers/irqchip/irq-bcm2836.c
c6ca7ce
@@ -175,6 +175,7 @@ __exception_irq_entry bcm2836_arm_irqchip_handle_irq(struct pt_regs *regs)
c6ca7ce
 		u32 ipi = ffs(mbox_val) - 1;
c6ca7ce
 
c6ca7ce
 		writel(1 << ipi, mailbox0);
c6ca7ce
+		dsb(sy);
c6ca7ce
 		handle_IPI(ipi, regs);
c6ca7ce
 #endif
c6ca7ce
 	} else if (stat) {
c6ca7ce
-- 
c6ca7ce
cgit v0.12
c6ca7ce