lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1470471483-1432-1-git-send-email-linus.walleij@linaro.org>
Date:	Sat,  6 Aug 2016 10:18:03 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Marc Zyngier <marc.zyngier@....com>,
	John Stultz <john.stultz@...aro.org>
Cc:	linux-kernel@...r.kernel.org,
	Linus Walleij <linus.walleij@...aro.org>,
	Jon Hunter <jonathanh@...dia.com>,
	Björn Andersson <bjorn.andersson@...aro.org>,
	Stephen Boyd <sboyd@...eaurora.org>,
	Abhijeet Dharmapurikar <adharmap@...eaurora.org>
Subject: [PATCH] Revert "irqdomain: Don't set type when mapping an IRQ"

This reverts commit 1e2a7d78499ec8859d2b469051b7b80bad3b08aa.

When using the APQ8060 Dragonboard I have lost all interrupts from
the PMIC after this commit: power button, keypad, RTC alarm and
all GPIOs. Reverting the commit solves the issue.

The affected irqchip driver is drivers/mfd/pm8921-core.c

I cannot immediately see what the problem is, so if you have a
better solution than just reverting the patch, please suggest.

Cc: Jon Hunter <jonathanh@...dia.com>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Björn Andersson <bjorn.andersson@...aro.org>
Cc: Stephen Boyd <sboyd@...eaurora.org>
Cc: Abhijeet Dharmapurikar <adharmap@...eaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
---
I am pretty sure that this is the same bug that John Stultz is
seeing on the Nexus 7, John: please confirm.
---
 include/linux/irqdomain.h |  3 ---
 kernel/irq/irqdomain.c    | 23 +++++------------------
 2 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index ffb84604c1de..1aee0fbe900e 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -455,9 +455,6 @@ static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
 	return -1;
 }
 
-static inline void irq_domain_free_irqs(unsigned int virq,
-					unsigned int nr_irqs) { }
-
 static inline bool irq_domain_is_hierarchy(struct irq_domain *domain)
 {
 	return false;
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 4752b43662e0..9ba6a6ec4408 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -567,7 +567,6 @@ static void of_phandle_args_to_fwspec(struct of_phandle_args *irq_data,
 unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
 {
 	struct irq_domain *domain;
-	struct irq_data *irq_data;
 	irq_hw_number_t hwirq;
 	unsigned int type = IRQ_TYPE_NONE;
 	int virq;
@@ -615,11 +614,7 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
 		 * it now and return the interrupt number.
 		 */
 		if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) {
-			irq_data = irq_get_irq_data(virq);
-			if (!irq_data)
-				return 0;
-
-			irqd_set_trigger_type(irq_data, type);
+			irq_set_irq_type(virq, type);
 			return virq;
 		}
 
@@ -639,18 +634,10 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
 			return virq;
 	}
 
-	irq_data = irq_get_irq_data(virq);
-	if (!irq_data) {
-		if (irq_domain_is_hierarchy(domain))
-			irq_domain_free_irqs(virq, 1);
-		else
-			irq_dispose_mapping(virq);
-		return 0;
-	}
-
-	/* Store trigger type */
-	irqd_set_trigger_type(irq_data, type);
-
+	/* Set type if specified and different than the current one */
+	if (type != IRQ_TYPE_NONE &&
+	    type != irq_get_trigger_type(virq))
+		irq_set_irq_type(virq, type);
 	return virq;
 }
 EXPORT_SYMBOL_GPL(irq_create_fwspec_mapping);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ