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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  7 Sep 2012 12:14:55 +0100
From:	Lee Jones <lee.jones@...aro.org>
To:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:	STEricsson_nomadik_linux@...t.st.com, linus.walleij@...ricsson.com,
	arnd@...db.de, Lee Jones <lee.jones@...aro.org>,
	Samuel Ortiz <sameo@...ux.intel.com>
Subject: [PATCH 15/19] mfd: Don't convert just one IRQ using irqdomain if a range is provided

MFD core code attempts to convert specified hardware (local) IRQ
numbers to virtual-IRQs, which something Linux can understand. This
works great when only one IRQ is specified. However, converting
entire ranges is currently unsupported. If this occurs we issue a
kernel warning to inform the user of this, but we continue to
convert the first specified IRQ anyway and replace the range. This
is not the correct behaviour. This patch ensures that if a range
is specified, it is left untouched.

CC: Samuel Ortiz <sameo@...ux.intel.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
 drivers/mfd/mfd-core.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index f8b7771..f07cf69 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -126,10 +126,12 @@ static int mfd_add_device(struct device *parent, int id,
 		} else if (cell->resources[r].flags & IORESOURCE_IRQ) {
 			if (domain) {
 				/* Unable to create mappings for IRQ ranges. */
-				WARN_ON(cell->resources[r].start !=
-					cell->resources[r].end);
-				res[r].start = res[r].end = irq_create_mapping(
-					domain, cell->resources[r].start);
+				if (!WARN_ON(cell->resources[r].start !=
+						cell->resources[r].end))
+					res[r].start = res[r].end =
+						irq_create_mapping(
+							domain,
+							cell->resources[r].start);
 			} else {
 				res[r].start = irq_base +
 					cell->resources[r].start;
-- 
1.7.9.5

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ