Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1293762 > unrolled thread

[RFC PATCH V2 4/8] irqchip/gic: Don't initialise chip if mapping IO space fails

Started byJon Hunter <jonathanh@nvidia.com>
First post2015-12-17 12:00 +0100
Last post2015-12-17 14:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH V2 4/8] irqchip/gic: Don't initialise chip if mapping IO space fails Jon Hunter <jonathanh@nvidia.com> - 2015-12-17 12:00 +0100
    Re: [RFC PATCH V2 4/8] irqchip/gic: Don't initialise chip if mapping  IO space fails Linus Walleij <linus.walleij@linaro.org> - 2015-12-17 14:30 +0100

#1293762 — [RFC PATCH V2 4/8] irqchip/gic: Don't initialise chip if mapping IO space fails

FromJon Hunter <jonathanh@nvidia.com>
Date2015-12-17 12:00 +0100
Subject[RFC PATCH V2 4/8] irqchip/gic: Don't initialise chip if mapping IO space fails
Message-ID<qGErV-6H4-41@gated-at.bofh.it>
If we fail to map the address space for the GIC distributor or CPU
interface, then don't attempt to initialise the chip, just WARN and
return.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/irqchip/irq-gic.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index abf2ffaed392..561a5cb5b8bc 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1208,10 +1208,14 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 		return -ENODEV;
 
 	dist_base = of_iomap(node, 0);
-	WARN(!dist_base, "unable to map gic dist registers\n");
+	if (WARN(!dist_base, "unable to map gic dist registers\n"))
+		return -ENOMEM;
 
 	cpu_base = of_iomap(node, 1);
-	WARN(!cpu_base, "unable to map gic cpu registers\n");
+	if (WARN(!cpu_base, "unable to map gic cpu registers\n")) {
+		iounmap(dist_base);
+		return -ENOMEM;
+	}
 
 	/*
 	 * Disable split EOI/Deactivate if either HYP is not available
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1293886 — Re: [RFC PATCH V2 4/8] irqchip/gic: Don't initialise chip if mapping IO space fails

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-12-17 14:30 +0100
SubjectRe: [RFC PATCH V2 4/8] irqchip/gic: Don't initialise chip if mapping IO space fails
Message-ID<qGGN4-8nL-11@gated-at.bofh.it>
In reply to#1293762
On Thu, Dec 17, 2015 at 11:48 AM, Jon Hunter <jonathanh@nvidia.com> wrote:

> If we fail to map the address space for the GIC distributor or CPU
> interface, then don't attempt to initialise the chip, just WARN and
> return.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web