linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] soc/tegra: pmc: Fail to allocate more than one wake IRQ
@ 2019-05-29 10:26 Thierry Reding
  2019-05-29 10:26 ` [PATCH 2/2] soc/tegra: pmc: Avoid crash for non-wake IRQs Thierry Reding
  2019-05-31  9:24 ` [PATCH 1/2] soc/tegra: pmc: Fail to allocate more than one wake IRQ Jon Hunter
  0 siblings, 2 replies; 6+ messages in thread
From: Thierry Reding @ 2019-05-29 10:26 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra, Bitan Biswas, linux-arm-kernel, Jon Hunter

From: Thierry Reding <treding@nvidia.com>

The code currently doesn't support allocating more than one wake IRQ at
a time. Detect this situation and error out. Also make sure to output a
warning when that happens to help track down callers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/soc/tegra/pmc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 5648e5c09ef5..653fe2c466f6 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1863,6 +1863,9 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq,
 	unsigned int i;
 	int err = 0;
 
+	if (WARN_ON(num_irqs > 1))
+		return -EINVAL;
+
 	for (i = 0; i < soc->num_wake_events; i++) {
 		const struct tegra_wake_event *event = &soc->wake_events[i];
 
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-03  7:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-29 10:26 [PATCH 1/2] soc/tegra: pmc: Fail to allocate more than one wake IRQ Thierry Reding
2019-05-29 10:26 ` [PATCH 2/2] soc/tegra: pmc: Avoid crash for non-wake IRQs Thierry Reding
2019-05-31  9:32   ` Jon Hunter
2019-05-31 10:28     ` Thierry Reding
2019-06-03  7:20       ` Peter De Schrijver
2019-05-31  9:24 ` [PATCH 1/2] soc/tegra: pmc: Fail to allocate more than one wake IRQ Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).