Skip to content

Commit 89becf5

Browse files
Yoichi Yuasaralfbaechle
authored andcommitted
[MIPS] Lasat: Fix overlap of interrupt number ranges.
The range of MIPS_CPU IRQ and the range of LASAT IRQ overlap. Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent fcee3fa commit 89becf5

4 files changed

Lines changed: 44 additions & 28 deletions

File tree

‎arch/mips/lasat/interrupt.c‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@
1919
* Lasat boards.
2020
*/
2121
#include <linux/init.h>
22-
#include <linux/irq.h>
23-
#include <linux/sched.h>
24-
#include <linux/slab.h>
2522
#include <linux/interrupt.h>
26-
#include <linux/kernel_stat.h>
23+
#include <linux/irq.h>
2724

2825
#include <asm/bootinfo.h>
2926
#include <asm/irq_cpu.h>
3027
#include <asm/lasat/lasatint.h>
31-
#include <asm/time.h>
32-
#include <asm/gdb-stub.h>
28+
29+
#include <irq.h>
3330

3431
static volatile int *lasat_int_status;
3532
static volatile int *lasat_int_mask;
@@ -97,12 +94,18 @@ asmlinkage void plat_irq_dispatch(void)
9794

9895
/* if int_status == 0, then the interrupt has already been cleared */
9996
if (int_status) {
100-
irq = LASATINT_BASE + ls1bit32(int_status);
97+
irq = LASAT_IRQ_BASE + ls1bit32(int_status);
10198

10299
do_IRQ(irq);
103100
}
104101
}
105102

103+
static struct irqaction cascade = {
104+
.handler = no_action,
105+
.mask = CPU_MASK_NONE,
106+
.name = "cascade",
107+
};
108+
106109
void __init arch_init_irq(void)
107110
{
108111
int i;
@@ -127,6 +130,9 @@ void __init arch_init_irq(void)
127130
}
128131

129132
mips_cpu_irq_init();
130-
for (i = LASATINT_BASE; i <= LASATINT_END; i++)
133+
134+
for (i = LASAT_IRQ_BASE; i <= LASAT_IRQ_END; i++)
131135
set_irq_chip_and_handler(i, &lasat_irq_type, handle_level_irq);
136+
137+
setup_irq(LASAT_CASCADE_IRQ, &cascade);
132138
}

‎arch/mips/pci/pci-lasat.c‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
*
66
* Copyright (C) 2000, 2001, 04 Keith M Wesolowski
77
*/
8-
#include <linux/kernel.h>
98
#include <linux/init.h>
9+
#include <linux/kernel.h>
1010
#include <linux/pci.h>
1111
#include <linux/types.h>
12+
1213
#include <asm/bootinfo.h>
13-
#include <asm/lasat/lasatint.h>
14+
15+
#include <irq.h>
1416

1517
extern struct pci_ops nile4_pci_ops;
1618
extern struct pci_ops gt64xxx_pci0_ops;
@@ -55,29 +57,29 @@ static int __init lasat_pci_setup(void)
5557

5658
arch_initcall(lasat_pci_setup);
5759

58-
#define LASATINT_ETH1 (LASATINT_BASE + 0)
59-
#define LASATINT_ETH0 (LASATINT_BASE + 1)
60-
#define LASATINT_HDC (LASATINT_BASE + 2)
61-
#define LASATINT_COMP (LASATINT_BASE + 3)
62-
#define LASATINT_HDLC (LASATINT_BASE + 4)
63-
#define LASATINT_PCIA (LASATINT_BASE + 5)
64-
#define LASATINT_PCIB (LASATINT_BASE + 6)
65-
#define LASATINT_PCIC (LASATINT_BASE + 7)
66-
#define LASATINT_PCID (LASATINT_BASE + 8)
60+
#define LASAT_IRQ_ETH1 (LASAT_IRQ_BASE + 0)
61+
#define LASAT_IRQ_ETH0 (LASAT_IRQ_BASE + 1)
62+
#define LASAT_IRQ_HDC (LASAT_IRQ_BASE + 2)
63+
#define LASAT_IRQ_COMP (LASAT_IRQ_BASE + 3)
64+
#define LASAT_IRQ_HDLC (LASAT_IRQ_BASE + 4)
65+
#define LASAT_IRQ_PCIA (LASAT_IRQ_BASE + 5)
66+
#define LASAT_IRQ_PCIB (LASAT_IRQ_BASE + 6)
67+
#define LASAT_IRQ_PCIC (LASAT_IRQ_BASE + 7)
68+
#define LASAT_IRQ_PCID (LASAT_IRQ_BASE + 8)
6769

6870
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
6971
{
7072
switch (slot) {
7173
case 1:
7274
case 2:
7375
case 3:
74-
return LASATINT_PCIA + (((slot-1) + (pin-1)) % 4);
76+
return LASAT_IRQ_PCIA + (((slot-1) + (pin-1)) % 4);
7577
case 4:
76-
return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */
78+
return LASAT_IRQ_ETH1; /* Ethernet 1 (LAN 2) */
7779
case 5:
78-
return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */
80+
return LASAT_IRQ_ETH0; /* Ethernet 0 (LAN 1) */
7981
case 6:
80-
return LASATINT_HDC; /* IDE controller */
82+
return LASAT_IRQ_HDC; /* IDE controller */
8183
default:
8284
return 0xff; /* Illegal */
8385
}

‎include/asm-mips/lasat/lasatint.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#ifndef __ASM_LASAT_LASATINT_H
22
#define __ASM_LASAT_LASATINT_H
33

4-
#include <linux/irq.h>
5-
6-
#define LASATINT_BASE MIPS_CPU_IRQ_BASE
7-
#define LASATINT_END (LASATINT_BASE + 16)
8-
94
/* lasat 100 */
105
#define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000))
116
#define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000))

‎include/asm-mips/mach-lasat/irq.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ifndef _ASM_MACH_LASAT_IRQ_H
2+
#define _ASM_MACH_LASAT_IRQ_H
3+
4+
#define LASAT_CASCADE_IRQ (MIPS_CPU_IRQ_BASE + 0)
5+
6+
#define LASAT_IRQ_BASE 8
7+
#define LASAT_IRQ_END 23
8+
9+
#define NR_IRQS 24
10+
11+
#include_next <irq.h>
12+
13+
#endif /* _ASM_MACH_LASAT_IRQ_H */

0 commit comments

Comments
 (0)