Skip to content

Commit 63f700a

Browse files
committed
Merge tag 'xtensa-20170612' of git://github.com/jcmvbkbc/linux-xtensa
Pull Xtensa fixes from Max Filippov: - don't use linux IRQ #0 in legacy irq domains: fixes timer interrupt assignment when it's hardware IRQ # is 0 and the kernel is built w/o device tree support - reduce reservation size for double exception vector literals from 48 to 20 bytes: fixes build on cores with small user exception vector - cleanups: use kmalloc_array instead of kmalloc in simdisk_init and seq_puts instead of seq_printf in c_show. * tag 'xtensa-20170612' of git://github.com/jcmvbkbc/linux-xtensa: xtensa: don't use linux IRQ #0 xtensa: reduce double exception literal reservation xtensa: ISS: Use kmalloc_array() in simdisk_init() xtensa: Use seq_puts() in c_show()
2 parents 2ab99b0 + e5c8667 commit 63f700a

File tree

9 files changed

+18
-22
lines changed

9 files changed

+18
-22
lines changed

arch/xtensa/include/asm/irq.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ static inline void variant_irq_disable(unsigned int irq) { }
2929
# define PLATFORM_NR_IRQS 0
3030
#endif
3131
#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
32-
#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS)
32+
#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS + 1)
33+
#define XTENSA_PIC_LINUX_IRQ(hwirq) ((hwirq) + 1)
3334

3435
#if VARIANT_NR_IRQS == 0
3536
static inline void variant_init_irq(void) { }

arch/xtensa/kernel/irq.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs)
3434
{
3535
int irq = irq_find_mapping(NULL, hwirq);
3636

37-
if (hwirq >= NR_IRQS) {
38-
printk(KERN_EMERG "%s: cannot handle IRQ %d\n",
39-
__func__, hwirq);
40-
}
41-
4237
#ifdef CONFIG_DEBUG_STACKOVERFLOW
4338
/* Debugging check for stack overflow: is there less than 1KB free? */
4439
{

arch/xtensa/kernel/setup.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,7 @@ c_show(struct seq_file *f, void *slot)
593593
(ccount_freq/10000) % 100,
594594
loops_per_jiffy/(500000/HZ),
595595
(loops_per_jiffy/(5000/HZ)) % 100);
596-
597-
seq_printf(f,"flags\t\t: "
596+
seq_puts(f, "flags\t\t: "
598597
#if XCHAL_HAVE_NMI
599598
"nmi "
600599
#endif

arch/xtensa/kernel/vmlinux.lds.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ SECTIONS
118118
SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR)
119119
SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4)
120120
SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR)
121-
SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 48)
121+
SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 20)
122122
SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)
123123
#endif
124124

@@ -306,13 +306,13 @@ SECTIONS
306306
.UserExceptionVector.literal)
307307
SECTION_VECTOR (_DoubleExceptionVector_literal,
308308
.DoubleExceptionVector.literal,
309-
DOUBLEEXC_VECTOR_VADDR - 48,
309+
DOUBLEEXC_VECTOR_VADDR - 20,
310310
SIZEOF(.UserExceptionVector.text),
311311
.UserExceptionVector.text)
312312
SECTION_VECTOR (_DoubleExceptionVector_text,
313313
.DoubleExceptionVector.text,
314314
DOUBLEEXC_VECTOR_VADDR,
315-
48,
315+
20,
316316
.DoubleExceptionVector.literal)
317317

318318
. = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;

arch/xtensa/platforms/iss/simdisk.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,7 @@ static int __init simdisk_init(void)
317317
if (simdisk_count > MAX_SIMDISK_COUNT)
318318
simdisk_count = MAX_SIMDISK_COUNT;
319319

320-
sddev = kmalloc(simdisk_count * sizeof(struct simdisk),
321-
GFP_KERNEL);
320+
sddev = kmalloc_array(simdisk_count, sizeof(*sddev), GFP_KERNEL);
322321
if (sddev == NULL)
323322
goto out_unregister;
324323

arch/xtensa/platforms/xtfpga/include/platform/hardware.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@
2424

2525
/* Interrupt configuration. */
2626

27-
#define PLATFORM_NR_IRQS 10
27+
#define PLATFORM_NR_IRQS 0
2828

2929
/* Default assignment of LX60 devices to external interrupts. */
3030

3131
#ifdef CONFIG_XTENSA_MX
3232
#define DUART16552_INTNUM XCHAL_EXTINT3_NUM
3333
#define OETH_IRQ XCHAL_EXTINT4_NUM
34+
#define C67X00_IRQ XCHAL_EXTINT8_NUM
3435
#else
3536
#define DUART16552_INTNUM XCHAL_EXTINT0_NUM
3637
#define OETH_IRQ XCHAL_EXTINT1_NUM
38+
#define C67X00_IRQ XCHAL_EXTINT5_NUM
3739
#endif
3840

3941
/*
@@ -63,5 +65,5 @@
6365

6466
#define C67X00_PADDR (XCHAL_KIO_PADDR + 0x0D0D0000)
6567
#define C67X00_SIZE 0x10
66-
#define C67X00_IRQ 5
68+
6769
#endif /* __XTENSA_XTAVNET_HARDWARE_H */

arch/xtensa/platforms/xtfpga/setup.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ static struct resource ethoc_res[] = {
175175
.flags = IORESOURCE_MEM,
176176
},
177177
[2] = { /* IRQ number */
178-
.start = OETH_IRQ,
179-
.end = OETH_IRQ,
178+
.start = XTENSA_PIC_LINUX_IRQ(OETH_IRQ),
179+
.end = XTENSA_PIC_LINUX_IRQ(OETH_IRQ),
180180
.flags = IORESOURCE_IRQ,
181181
},
182182
};
@@ -213,8 +213,8 @@ static struct resource c67x00_res[] = {
213213
.flags = IORESOURCE_MEM,
214214
},
215215
[1] = { /* IRQ number */
216-
.start = C67X00_IRQ,
217-
.end = C67X00_IRQ,
216+
.start = XTENSA_PIC_LINUX_IRQ(C67X00_IRQ),
217+
.end = XTENSA_PIC_LINUX_IRQ(C67X00_IRQ),
218218
.flags = IORESOURCE_IRQ,
219219
},
220220
};
@@ -247,7 +247,7 @@ static struct resource serial_resource = {
247247
static struct plat_serial8250_port serial_platform_data[] = {
248248
[0] = {
249249
.mapbase = DUART16552_PADDR,
250-
.irq = DUART16552_INTNUM,
250+
.irq = XTENSA_PIC_LINUX_IRQ(DUART16552_INTNUM),
251251
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
252252
UPF_IOREMAP,
253253
.iotype = XCHAL_HAVE_BE ? UPIO_MEM32BE : UPIO_MEM32,

drivers/irqchip/irq-xtensa-mx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static struct irq_chip xtensa_mx_irq_chip = {
142142
int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent)
143143
{
144144
struct irq_domain *root_domain =
145-
irq_domain_add_legacy(NULL, NR_IRQS, 0, 0,
145+
irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
146146
&xtensa_mx_irq_domain_ops,
147147
&xtensa_mx_irq_chip);
148148
irq_set_default_host(root_domain);

drivers/irqchip/irq-xtensa-pic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static struct irq_chip xtensa_irq_chip = {
8989
int __init xtensa_pic_init_legacy(struct device_node *interrupt_parent)
9090
{
9191
struct irq_domain *root_domain =
92-
irq_domain_add_legacy(NULL, NR_IRQS, 0, 0,
92+
irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
9393
&xtensa_irq_domain_ops, &xtensa_irq_chip);
9494
irq_set_default_host(root_domain);
9595
return 0;

0 commit comments

Comments
 (0)