Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Kill off machvec IRQ hinting.

Everything is using sparseirq these days, so we have no need to
arbitrarily size nr_irqs ahead of time. The legacy IRQ pre-allocation
likewise has no meaning for us, so that's killed off too. We now depend
on nr_irqs expansion by the generic hardirq layer instead.

It's also worth noting that the majority of boards had completely bogus
values for their nr_irqs relative to their CPU and configurations, so
this ends up correcting behaviour for quite a few platforms.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+12 -40
-1
arch/sh/boards/board-edosk7705.c
··· 74 74 */ 75 75 static struct sh_machine_vector mv_edosk7705 __initmv = { 76 76 .mv_name = "EDOSK7705", 77 - .mv_nr_irqs = 80, 78 77 .mv_init_irq = sh_edosk7705_init_irq, 79 78 };
-1
arch/sh/boards/board-edosk7760.c
··· 188 188 */ 189 189 struct sh_machine_vector mv_edosk7760 __initmv = { 190 190 .mv_name = "EDOSK7760", 191 - .mv_nr_irqs = 128, 192 191 };
-1
arch/sh/boards/board-polaris.c
··· 141 141 142 142 static struct sh_machine_vector mv_polaris __initmv = { 143 143 .mv_name = "Polaris", 144 - .mv_nr_irqs = 61, 145 144 .mv_init_irq = init_polaris_irq, 146 145 };
-1
arch/sh/boards/board-secureedge5410.c
··· 71 71 */ 72 72 static struct sh_machine_vector mv_snapgear __initmv = { 73 73 .mv_name = "SnapGear SecureEdge5410", 74 - .mv_nr_irqs = 72, 75 74 .mv_init_irq = init_snapgear_IRQ, 76 75 };
-1
arch/sh/boards/mach-cayman/setup.c
··· 181 181 182 182 static struct sh_machine_vector mv_cayman __initmv = { 183 183 .mv_name = "Hitachi Cayman", 184 - .mv_nr_irqs = 64, 185 184 .mv_ioport_map = cayman_ioport_map, 186 185 .mv_init_irq = init_cayman_irq, 187 186 };
-2
arch/sh/boards/mach-hp6xx/setup.c
··· 169 169 static struct sh_machine_vector mv_hp6xx __initmv = { 170 170 .mv_name = "hp6xx", 171 171 .mv_setup = hp6xx_setup, 172 - /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */ 173 - .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6, 174 172 /* Enable IRQ0 -> IRQ3 in IRQ_MODE */ 175 173 .mv_init_irq = hp6xx_init_irq, 176 174 };
-1
arch/sh/boards/mach-lboxre2/setup.c
··· 79 79 */ 80 80 static struct sh_machine_vector mv_lboxre2 __initmv = { 81 81 .mv_name = "L-BOX RE2", 82 - .mv_nr_irqs = 72, 83 82 .mv_init_irq = init_lboxre2_IRQ, 84 83 };
-1
arch/sh/boards/mach-microdev/setup.c
··· 194 194 */ 195 195 static struct sh_machine_vector mv_sh4202_microdev __initmv = { 196 196 .mv_name = "SH4-202 MicroDev", 197 - .mv_nr_irqs = 72, 198 197 .mv_ioport_map = microdev_ioport_map, 199 198 .mv_init_irq = init_microdev_irq, 200 199 };
-1
arch/sh/boards/mach-sdk7780/setup.c
··· 94 94 static struct sh_machine_vector mv_se7780 __initmv = { 95 95 .mv_name = "Renesas SDK7780-R3" , 96 96 .mv_setup = sdk7780_setup, 97 - .mv_nr_irqs = 111, 98 97 .mv_init_irq = init_sdk7780_IRQ, 99 98 }; 100 99
-1
arch/sh/boards/mach-se/7206/setup.c
··· 90 90 91 91 static struct sh_machine_vector mv_se __initmv = { 92 92 .mv_name = "SolutionEngine", 93 - .mv_nr_irqs = 256, 94 93 .mv_init_irq = init_se7206_IRQ, 95 94 .mv_mode_pins = se7206_mode_pins, 96 95 };
-11
arch/sh/boards/mach-se/770x/setup.c
··· 184 184 static struct sh_machine_vector mv_se __initmv = { 185 185 .mv_name = "SolutionEngine", 186 186 .mv_setup = smsc_setup, 187 - #if defined(CONFIG_CPU_SH4) 188 - .mv_nr_irqs = 48, 189 - #elif defined(CONFIG_CPU_SUBTYPE_SH7708) 190 - .mv_nr_irqs = 32, 191 - #elif defined(CONFIG_CPU_SUBTYPE_SH7709) 192 - .mv_nr_irqs = 61, 193 - #elif defined(CONFIG_CPU_SUBTYPE_SH7705) 194 - .mv_nr_irqs = 86, 195 - #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 196 - .mv_nr_irqs = 104, 197 - #endif 198 187 .mv_init_irq = init_se_IRQ, 199 188 };
-1
arch/sh/boards/mach-se/7721/setup.c
··· 92 92 struct sh_machine_vector mv_se7721 __initmv = { 93 93 .mv_name = "Solution Engine 7721", 94 94 .mv_setup = se7721_setup, 95 - .mv_nr_irqs = 109, 96 95 .mv_init_irq = init_se7721_IRQ, 97 96 };
-1
arch/sh/boards/mach-se/7724/setup.c
··· 929 929 static struct sh_machine_vector mv_ms7724se __initmv = { 930 930 .mv_name = "ms7724se", 931 931 .mv_init_irq = init_se7724_IRQ, 932 - .mv_nr_irqs = SE7724_FPGA_IRQ_BASE + SE7724_FPGA_IRQ_NR, 933 932 };
-1
arch/sh/boards/mach-se/7751/setup.c
··· 55 55 */ 56 56 static struct sh_machine_vector mv_7751se __initmv = { 57 57 .mv_name = "7751 SolutionEngine", 58 - .mv_nr_irqs = 72, 59 58 .mv_init_irq = init_7751se_IRQ, 60 59 };
-1
arch/sh/boards/mach-se/7780/setup.c
··· 110 110 static struct sh_machine_vector mv_se7780 __initmv = { 111 111 .mv_name = "Solution Engine 7780" , 112 112 .mv_setup = se7780_setup , 113 - .mv_nr_irqs = 111 , 114 113 .mv_init_irq = init_se7780_IRQ, 115 114 };
-1
arch/sh/boards/mach-se/board-se7619.c
··· 22 22 23 23 static struct sh_machine_vector mv_se __initmv = { 24 24 .mv_name = "SolutionEngine", 25 - .mv_nr_irqs = 108, 26 25 .mv_mode_pins = se7619_mode_pins, 27 26 };
-1
arch/sh/boards/mach-sh03/setup.c
··· 101 101 static struct sh_machine_vector mv_sh03 __initmv = { 102 102 .mv_name = "Interface (CTP/PCI-SH03)", 103 103 .mv_setup = sh03_setup, 104 - .mv_nr_irqs = 48, 105 104 .mv_init_irq = init_sh03_IRQ, 106 105 };
-1
arch/sh/boards/mach-sh7763rdp/setup.c
··· 214 214 static struct sh_machine_vector mv_sh7763rdp __initmv = { 215 215 .mv_name = "sh7763drp", 216 216 .mv_setup = sh7763rdp_setup, 217 - .mv_nr_irqs = 112, 218 217 .mv_init_irq = init_sh7763rdp_IRQ, 219 218 };
+8 -5
arch/sh/include/asm/irq.h
··· 5 5 #include <asm/machvec.h> 6 6 7 7 /* 8 - * A sane default based on a reasonable vector table size, platforms are 9 - * advised to cap this at the hard limit that they're interested in 10 - * through the machvec. 8 + * Only legacy non-sparseirq platforms have to set a reasonably sane 9 + * value here. sparseirq platforms allocate their irq_descs on the fly, 10 + * so will expand automatically based on the number of registered IRQs. 11 11 */ 12 - #define NR_IRQS 512 13 - #define NR_IRQS_LEGACY 8 /* Legacy external IRQ0-7 */ 12 + #ifdef CONFIG_SPARSE_IRQ 13 + # define NR_IRQS 8 14 + #else 15 + # define NR_IRQS 512 16 + #endif 14 17 15 18 /* 16 19 * This is a special IRQ number for indicating that no IRQ has been
-1
arch/sh/include/asm/machvec.h
··· 17 17 struct sh_machine_vector { 18 18 void (*mv_setup)(char **cmdline_p); 19 19 const char *mv_name; 20 - int mv_nr_irqs; 21 20 22 21 int (*mv_irq_demux)(int irq); 23 22 void (*mv_init_irq)(void);
+4 -2
arch/sh/kernel/irq.c
··· 234 234 #ifdef CONFIG_SPARSE_IRQ 235 235 int __init arch_probe_nr_irqs(void) 236 236 { 237 - nr_irqs = sh_mv.mv_nr_irqs; 238 - return NR_IRQS_LEGACY; 237 + /* 238 + * No pre-allocated IRQs. 239 + */ 240 + return 0; 239 241 } 240 242 #endif 241 243
-3
arch/sh/kernel/machvec.c
··· 121 121 mv_set(irq_demux); 122 122 mv_set(mode_pins); 123 123 mv_set(mem_init); 124 - 125 - if (!sh_mv.mv_nr_irqs) 126 - sh_mv.mv_nr_irqs = NR_IRQS; 127 124 }