Commit 63f700aa authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 2ab99b00 e5c86679
...@@ -29,7 +29,8 @@ static inline void variant_irq_disable(unsigned int irq) { } ...@@ -29,7 +29,8 @@ static inline void variant_irq_disable(unsigned int irq) { }
# define PLATFORM_NR_IRQS 0 # define PLATFORM_NR_IRQS 0
#endif #endif
#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS #define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS) #define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS + 1)
#define XTENSA_PIC_LINUX_IRQ(hwirq) ((hwirq) + 1)
#if VARIANT_NR_IRQS == 0 #if VARIANT_NR_IRQS == 0
static inline void variant_init_irq(void) { } static inline void variant_init_irq(void) { }
......
...@@ -34,11 +34,6 @@ asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs) ...@@ -34,11 +34,6 @@ asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs)
{ {
int irq = irq_find_mapping(NULL, hwirq); int irq = irq_find_mapping(NULL, hwirq);
if (hwirq >= NR_IRQS) {
printk(KERN_EMERG "%s: cannot handle IRQ %d\n",
__func__, hwirq);
}
#ifdef CONFIG_DEBUG_STACKOVERFLOW #ifdef CONFIG_DEBUG_STACKOVERFLOW
/* Debugging check for stack overflow: is there less than 1KB free? */ /* Debugging check for stack overflow: is there less than 1KB free? */
{ {
......
...@@ -593,8 +593,7 @@ c_show(struct seq_file *f, void *slot) ...@@ -593,8 +593,7 @@ c_show(struct seq_file *f, void *slot)
(ccount_freq/10000) % 100, (ccount_freq/10000) % 100,
loops_per_jiffy/(500000/HZ), loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ)) % 100); (loops_per_jiffy/(5000/HZ)) % 100);
seq_puts(f, "flags\t\t: "
seq_printf(f,"flags\t\t: "
#if XCHAL_HAVE_NMI #if XCHAL_HAVE_NMI
"nmi " "nmi "
#endif #endif
......
...@@ -118,7 +118,7 @@ SECTIONS ...@@ -118,7 +118,7 @@ SECTIONS
SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR) SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR)
SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4) SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4)
SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR) SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR)
SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 48) SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 20)
SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR) SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)
#endif #endif
...@@ -306,13 +306,13 @@ SECTIONS ...@@ -306,13 +306,13 @@ SECTIONS
.UserExceptionVector.literal) .UserExceptionVector.literal)
SECTION_VECTOR (_DoubleExceptionVector_literal, SECTION_VECTOR (_DoubleExceptionVector_literal,
.DoubleExceptionVector.literal, .DoubleExceptionVector.literal,
DOUBLEEXC_VECTOR_VADDR - 48, DOUBLEEXC_VECTOR_VADDR - 20,
SIZEOF(.UserExceptionVector.text), SIZEOF(.UserExceptionVector.text),
.UserExceptionVector.text) .UserExceptionVector.text)
SECTION_VECTOR (_DoubleExceptionVector_text, SECTION_VECTOR (_DoubleExceptionVector_text,
.DoubleExceptionVector.text, .DoubleExceptionVector.text,
DOUBLEEXC_VECTOR_VADDR, DOUBLEEXC_VECTOR_VADDR,
48, 20,
.DoubleExceptionVector.literal) .DoubleExceptionVector.literal)
. = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3; . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;
......
...@@ -317,8 +317,7 @@ static int __init simdisk_init(void) ...@@ -317,8 +317,7 @@ static int __init simdisk_init(void)
if (simdisk_count > MAX_SIMDISK_COUNT) if (simdisk_count > MAX_SIMDISK_COUNT)
simdisk_count = MAX_SIMDISK_COUNT; simdisk_count = MAX_SIMDISK_COUNT;
sddev = kmalloc(simdisk_count * sizeof(struct simdisk), sddev = kmalloc_array(simdisk_count, sizeof(*sddev), GFP_KERNEL);
GFP_KERNEL);
if (sddev == NULL) if (sddev == NULL)
goto out_unregister; goto out_unregister;
......
...@@ -24,16 +24,18 @@ ...@@ -24,16 +24,18 @@
/* Interrupt configuration. */ /* Interrupt configuration. */
#define PLATFORM_NR_IRQS 10 #define PLATFORM_NR_IRQS 0
/* Default assignment of LX60 devices to external interrupts. */ /* Default assignment of LX60 devices to external interrupts. */
#ifdef CONFIG_XTENSA_MX #ifdef CONFIG_XTENSA_MX
#define DUART16552_INTNUM XCHAL_EXTINT3_NUM #define DUART16552_INTNUM XCHAL_EXTINT3_NUM
#define OETH_IRQ XCHAL_EXTINT4_NUM #define OETH_IRQ XCHAL_EXTINT4_NUM
#define C67X00_IRQ XCHAL_EXTINT8_NUM
#else #else
#define DUART16552_INTNUM XCHAL_EXTINT0_NUM #define DUART16552_INTNUM XCHAL_EXTINT0_NUM
#define OETH_IRQ XCHAL_EXTINT1_NUM #define OETH_IRQ XCHAL_EXTINT1_NUM
#define C67X00_IRQ XCHAL_EXTINT5_NUM
#endif #endif
/* /*
...@@ -63,5 +65,5 @@ ...@@ -63,5 +65,5 @@
#define C67X00_PADDR (XCHAL_KIO_PADDR + 0x0D0D0000) #define C67X00_PADDR (XCHAL_KIO_PADDR + 0x0D0D0000)
#define C67X00_SIZE 0x10 #define C67X00_SIZE 0x10
#define C67X00_IRQ 5
#endif /* __XTENSA_XTAVNET_HARDWARE_H */ #endif /* __XTENSA_XTAVNET_HARDWARE_H */
...@@ -175,8 +175,8 @@ static struct resource ethoc_res[] = { ...@@ -175,8 +175,8 @@ static struct resource ethoc_res[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[2] = { /* IRQ number */ [2] = { /* IRQ number */
.start = OETH_IRQ, .start = XTENSA_PIC_LINUX_IRQ(OETH_IRQ),
.end = OETH_IRQ, .end = XTENSA_PIC_LINUX_IRQ(OETH_IRQ),
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
...@@ -213,8 +213,8 @@ static struct resource c67x00_res[] = { ...@@ -213,8 +213,8 @@ static struct resource c67x00_res[] = {
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { /* IRQ number */ [1] = { /* IRQ number */
.start = C67X00_IRQ, .start = XTENSA_PIC_LINUX_IRQ(C67X00_IRQ),
.end = C67X00_IRQ, .end = XTENSA_PIC_LINUX_IRQ(C67X00_IRQ),
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
...@@ -247,7 +247,7 @@ static struct resource serial_resource = { ...@@ -247,7 +247,7 @@ static struct resource serial_resource = {
static struct plat_serial8250_port serial_platform_data[] = { static struct plat_serial8250_port serial_platform_data[] = {
[0] = { [0] = {
.mapbase = DUART16552_PADDR, .mapbase = DUART16552_PADDR,
.irq = DUART16552_INTNUM, .irq = XTENSA_PIC_LINUX_IRQ(DUART16552_INTNUM),
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
UPF_IOREMAP, UPF_IOREMAP,
.iotype = XCHAL_HAVE_BE ? UPIO_MEM32BE : UPIO_MEM32, .iotype = XCHAL_HAVE_BE ? UPIO_MEM32BE : UPIO_MEM32,
......
...@@ -142,7 +142,7 @@ static struct irq_chip xtensa_mx_irq_chip = { ...@@ -142,7 +142,7 @@ static struct irq_chip xtensa_mx_irq_chip = {
int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent) int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent)
{ {
struct irq_domain *root_domain = struct irq_domain *root_domain =
irq_domain_add_legacy(NULL, NR_IRQS, 0, 0, irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
&xtensa_mx_irq_domain_ops, &xtensa_mx_irq_domain_ops,
&xtensa_mx_irq_chip); &xtensa_mx_irq_chip);
irq_set_default_host(root_domain); irq_set_default_host(root_domain);
......
...@@ -89,7 +89,7 @@ static struct irq_chip xtensa_irq_chip = { ...@@ -89,7 +89,7 @@ static struct irq_chip xtensa_irq_chip = {
int __init xtensa_pic_init_legacy(struct device_node *interrupt_parent) int __init xtensa_pic_init_legacy(struct device_node *interrupt_parent)
{ {
struct irq_domain *root_domain = struct irq_domain *root_domain =
irq_domain_add_legacy(NULL, NR_IRQS, 0, 0, irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
&xtensa_irq_domain_ops, &xtensa_irq_chip); &xtensa_irq_domain_ops, &xtensa_irq_chip);
irq_set_default_host(root_domain); irq_set_default_host(root_domain);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment