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: <1414555138-6500-1-git-send-email-cernekee@gmail.com>
Date:	Tue, 28 Oct 2014 20:58:48 -0700
From:	Kevin Cernekee <cernekee@...il.com>
To:	f.fainelli@...il.com, tglx@...utronix.de, jason@...edaemon.net,
	ralf@...ux-mips.org
Cc:	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	mbizon@...ebox.fr, jogo@...nwrt.org, linux-mips@...ux-mips.org
Subject: [PATCH 01/11] irqchip: Allow irq_reg_{readl,writel} to use __raw_{readl_writel}

On big-endian systems readl/writel may perform an unwanted endian swap,
breaking generic-chip.c.  Let the platform code opt to use the __raw_
variants by selecting RAW_IRQ_ACCESSORS.

This is required in order for bcm3384 to use GENERIC_IRQ_CHIP.  Several
existing irqchip drivers also use the __raw_ accessors directly, so it
is a reasonably common requirement.

Signed-off-by: Kevin Cernekee <cernekee@...il.com>
---
 drivers/irqchip/Kconfig |  3 +++
 include/linux/irq.h     | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index b21f12f..6f0e80b 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -2,6 +2,9 @@ config IRQCHIP
 	def_bool y
 	depends on OF_IRQ
 
+config RAW_IRQ_ACCESSORS
+	bool
+
 config ARM_GIC
 	bool
 	select IRQ_DOMAIN
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 03f48d9..ed1ea8a 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -639,6 +639,17 @@ void arch_teardown_hwirq(unsigned int irq);
 void irq_init_desc(unsigned int irq);
 #endif
 
+#ifdef CONFIG_RAW_IRQ_ACCESSORS
+
+#ifndef irq_reg_writel
+# define irq_reg_writel(val, addr)	__raw_writel(val, addr)
+#endif
+#ifndef irq_reg_readl
+# define irq_reg_readl(addr)		__raw_readl(addr)
+#endif
+
+#else
+
 #ifndef irq_reg_writel
 # define irq_reg_writel(val, addr)	writel(val, addr)
 #endif
@@ -646,6 +657,8 @@ void irq_init_desc(unsigned int irq);
 # define irq_reg_readl(addr)		readl(addr)
 #endif
 
+#endif
+
 /**
  * struct irq_chip_regs - register offsets for struct irq_gci
  * @enable:	Enable register offset to reg_base
-- 
2.1.1

--
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