MIPS, IRQCHIP: Move i8259 irqchip driver to drivers/irqchip.
Subsystems (2)
PATCH 1/1 MIPS, IRQCHIP: Move i8259 irqchip driver to drivers/irqchip.
arch/mips/Kconfig | 4 - arch/mips/kernel/Makefile | 1 - arch/mips/kernel/i8259.c | 384 -------------------------------------------- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-i8259.c | 383 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 388 insertions(+), 389 deletions(-)
arch/mips/Kconfig +0 -4
@@ -1071,10 +1071,6 @@ config HOTPLUG_CPU config SYS_SUPPORTS_HOTPLUG_CPU bool -config I8259 - bool - select IRQ_DOMAIN - config MIPS_BONITO64 bool
arch/mips/kernel/Makefile +0 -1
@@ -61,7 +61,6 @@ obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o obj-$(CONFIG_MIPS_VPE_APSP_API_CMP) += rtlx-cmp.o obj-$(CONFIG_MIPS_VPE_APSP_API_MT) += rtlx-mt.o -obj-$(CONFIG_I8259) += i8259.o obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o obj-$(CONFIG_MIPS_MSC) += irq-msc01.o obj-$(CONFIG_IRQ_TXX9) += irq_txx9.o
arch/mips/kernel/i8259.c deleted +0 -384
384 lines not on this page · raw message
drivers/irqchip/Kconfig +4 -0
@@ -61,6 +61,10 @@ config ATMEL_AIC5_IRQ select MULTI_IRQ_HANDLER select SPARSE_IRQ +config I8259 + bool + select IRQ_DOMAIN + config BCM7038_L1_IRQ bool select GENERIC_IRQ_CHIP
drivers/irqchip/Makefile +1 -0
@@ -27,6 +27,7 @@ obj-$(CONFIG_ARM_NVIC) += irq-nvic.o obj-$(CONFIG_ARM_VIC) += irq-vic.o obj-$(CONFIG_ATMEL_AIC_IRQ) += irq-atmel-aic-common.o irq-atmel-aic.o obj-$(CONFIG_ATMEL_AIC5_IRQ) += irq-atmel-aic-common.o irq-atmel-aic5.o +obj-$(CONFIG_I8259) += irq-i8259.o obj-$(CONFIG_IMGPDC_IRQ) += irq-imgpdc.o obj-$(CONFIG_IRQ_MIPS_CPU) += irq-mips-cpu.o obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o
drivers/irqchip/irq-i8259.c new file +383 -0
383 lines not on this page · raw message
Quoted 7 lines · Ralf Baechle
arch/mips/Kconfig | 4 - arch/mips/kernel/Makefile | 1 - arch/mips/kernel/i8259.c | 384 -------------------------------------------- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-i8259.c | 383 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 388 insertions(+), 389 deletions(-)
Should I carry it, or want you merge it via the mips tree?
In the latter case: Acked-by-me.
Quoted 11 lines · Thomas Gleixner
Quoted 7 lines
arch/mips/Kconfig | 4 - arch/mips/kernel/Makefile | 1 - arch/mips/kernel/i8259.c | 384 -------------------------------------------- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-i8259.c | 383 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 388 insertions(+), 389 deletions(-)Should I carry it, or want you merge it via the mips tree?
In the latter case: Acked-by-me.
I guess the conflict potencial will be lower if you carry it - and if somebody wants to merge it with one of the other i8259.c littered through the tree it probably also is better if you carry it.
Thanks!
Ralf
Quoted 10 lines · Ralf Baechle
Quoted 8 lines · Thomas Gleixner
Quoted 7 lines
arch/mips/Kconfig | 4 - arch/mips/kernel/Makefile | 1 - arch/mips/kernel/i8259.c | 384 -------------------------------------------- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-i8259.c | 383 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 388 insertions(+), 389 deletions(-)
Quoted 7 lines
Quoted 3 lines
Should I carry it, or want you merge it via the mips tree?
In the latter case: Acked-by-me.
I guess the conflict potencial will be lower if you carry it - and if somebody wants to merge it with one of the other
i8259.clittered through the tree it probably also is better if you carry it.
Good point. That move might be just the trigger for me to sit down and do it :)
Thanks,
tglx
Hello.
Quoted 7 lines · Ralf Baechle
arch/mips/Kconfig | 4 - arch/mips/kernel/Makefile | 1 - arch/mips/kernel/i8259.c | 384 -------------------------------------------- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-i8259.c | 383 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 388 insertions(+), 389 deletions(-)
[...]
Quoted 28 lines
drivers/irqchip/irq-i8259.c new file +22
-0@@ -0,0 +1,383 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Code to handle x86 style IRQs plus some generic interrupt stuff. +* +* Copyright (C) 1992 Linus Torvalds +* Copyright (C) 1994 - 2000 Ralf Baechle +*/ +#include <linux/delay.h> +#include <linux/init.h> +#include <linux/ioport.h> +#include <linux/interrupt.h> +#include <linux/irqchip.h> +#include <linux/irqdomain.h> +#include <linux/kernel.h> +#include <linux/of_irq.h> +#include <linux/spinlock.h> +#include <linux/syscore_ops.h> +#include <linux/irq.h> +
drivers/irqchip/irq-i8259.c line 32
Quoted 10 lines
drivers/irqchip/irq-i8259.c new file +10
-0+#include <asm/i8259.h> +#include <asm/io.h> + +/* +* This is the 'legacy' 8259A Programmable Interrupt Controller, +* present in the majority of PC/AT boxes. +* plus some generic x86 specific things if generic specifics makes +* any sense at all. +* this file should become arch/i386/kernel/irq.c when the old irq.c +* moves to arch independent land
This comment doesn't make sense anymore, does it?
drivers/irqchip/irq-i8259.c line 43
Quoted 2 lines
drivers/irqchip/irq-i8259.c new file +2
-0+static struct irq_chip i8259A_chip = { + .name ="XT-PIC" ,
This name is wrong, wrong, wrong. XT only had single 8259 (and is not
supported by Linux anyway) while jhere we drive the AT specific two cascaded 8259s (which is just wrong in my opinion as well).
drivers/irqchip/irq-i8259.c line 47
Quoted 4 lines
drivers/irqchip/irq-i8259.c new file +4
-0+ .irq_mask = disable_8259A_irq, + .irq_disable = disable_8259A_irq, + .irq_unmask = enable_8259A_irq, + .irq_mask_ack = mask_and_ack_8259A,
I have always thought 8259 was the "fast-EOI" class interrupt chip, I've
never quite understood all this mask-and-ACK type handling for 8259...
[...]
Quoted 8 lines
drivers/irqchip/irq-i8259.c new file +8
-0+/* +* Careful! The 8259A is a fragile beast, it pretty +* much _has_ to be done exactly like this (mask it +* first, _then_ send the EOI, and the order of EOI +* to the two 8259s is important! +*/ +static void mask_and_ack_8259A (struct irq_data *d) +{
[...]
drivers/irqchip/irq-i8259.c line 174
Quoted 3 lines
drivers/irqchip/irq-i8259.c new file +3
-0+handle_real_irq: +if (irq &8 ) { +inb (PIC_SLAVE_IMR );/* DUMMY - (do we need this?) */
Hardly.
drivers/irqchip/irq-i8259.c line 176
Quoted 2 lines
drivers/irqchip/irq-i8259.c new file +2
-0+outb (cached_slave_mask,PIC_SLAVE_IMR ); +outb (0x60 +(irq&7 ),PIC_SLAVE_CMD );/* 'Specific EOI' to slave */
Need spaces around ops.
drivers/irqchip/irq-i8259.c line 181
Quoted 5 lines
drivers/irqchip/irq-i8259.c new file +5
-0+outb (0x60 +PIC_CASCADE_IR ,PIC_MASTER_CMD );/* 'Specific EOI' to master-IRQ2 */ + }else { +inb (PIC_MASTER_IMR );/* DUMMY - (do we need this?) */ +outb (cached_master_mask,PIC_MASTER_IMR ); +outb (0x60 +irq,PIC_MASTER_CMD );/* 'Specific EOI to master */
Same here...
drivers/irqchip/irq-i8259.c line 201
Quoted 9 lines
drivers/irqchip/irq-i8259.c new file +8
-0+ } +raw_spin_unlock_irqrestore (&i8259A_lock, flags); +return ; + { +static int spurious_irq_mask; +/* +* At this point we can be sure the IRQ is spurious, +* lets ACK and report it. [once per IRQ]
There's no point in ACKing spurious interrupt, if my memory serves. The
in-srvice register doesn't have the bit set, so no need to clear it.
drivers/irqchip/irq-i8259.c line 213
Quoted 12 lines
drivers/irqchip/irq-i8259.c new file +12
-0+*/ +if (!(spurious_irq_mask & irqmask)) { +printk (KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n" , irq); + spurious_irq_mask |= irqmask; + } +atomic_inc (&irq_err_count); +/* +* Theoretically we do not have to handle this IRQ, +* but in Linux this does not cause problems and is +* simpler for us. +*/ + goto handle_real_irq;
Hum... only because it doesn't cause issues?
WBR, Sergei
On 07/08/2015 03:46 PM, Ralf Baechle wrote:
I don't see any signoffs.
Quoted 6 lines
arch/mips/Kconfig | 4 - arch/mips/kernel/Makefile | 1 - arch/mips/kernel/i8259.c | 384 -------------------------------------------- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-i8259.c | 383 +++++++++++++++++++++++++++++++++++++++++++
Please use the -M switch with 'git format-patch'.
Quoted 1 line
6 files changed, 388 insertions(+), 389 deletions(-)
WBR, Sergei