lkml.org 
[lkml]   [2014]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 06/15] genirq: Generic chip: Optimize for fixed-endian systems
Date
Allow the compiler to inline an LE MMIO access if the configuration only
supports LE registers, or a BE MMIO access if the configuration only
supports BE registers. If the configuration supports both (possibly
a multiplatform kernel) then make the decision at runtime.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
kernel/irq/Kconfig | 5 +++++
kernel/irq/Makefile | 1 +
kernel/irq/generic-chip.c | 10 +++++++++-
3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig
index 225086b..6283c8c 100644
--- a/kernel/irq/Kconfig
+++ b/kernel/irq/Kconfig
@@ -51,6 +51,11 @@ config GENERIC_IRQ_CHIP
bool
select IRQ_DOMAIN

+# Same as above, but use big-endian MMIO accesses
+config GENERIC_IRQ_CHIP_BE
+ bool
+ select IRQ_DOMAIN
+
# Generic irq_domain hw <--> linux irq number translation
config IRQ_DOMAIN
bool
diff --git a/kernel/irq/Makefile b/kernel/irq/Makefile
index fff1738..34c2b0f 100644
--- a/kernel/irq/Makefile
+++ b/kernel/irq/Makefile
@@ -1,6 +1,7 @@

obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o
obj-$(CONFIG_GENERIC_IRQ_CHIP) += generic-chip.o
+obj-$(CONFIG_GENERIC_IRQ_CHIP_BE) += generic-chip.o
obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
obj-$(CONFIG_IRQ_DOMAIN) += irqdomain.o
obj-$(CONFIG_PROC_FS) += proc.o
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index c1890bb..457ea48 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -9,6 +9,7 @@
#include <linux/export.h>
#include <linux/irqdomain.h>
#include <linux/interrupt.h>
+#include <linux/kconfig.h>
#include <linux/kernel_stat.h>
#include <linux/syscore_ops.h>

@@ -19,7 +20,14 @@ static DEFINE_RAW_SPINLOCK(gc_lock);

static int is_big_endian(struct irq_chip_generic *gc)
{
- return !!(gc->domain->gc->gc_flags & IRQ_GC_BE_IO);
+ if (IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP) &&
+ !IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP_BE))
+ return 0;
+ else if (IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP_BE) &&
+ !IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP))
+ return 1;
+ else
+ return !!(gc->domain->gc->gc_flags & IRQ_GC_BE_IO);
}

static void irq_reg_writel(struct irq_chip_generic *gc,
--
2.1.1


\
 
 \ /
  Last update: 2014-10-30 04:01    [W:0.166 / U:1.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site