diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-12 14:44:25 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-12 14:44:25 -0500 |
| commit | 2bf3b685a35c80fe368dad9da0e77ba48b460939 (patch) | |
| tree | 3516a82ec33f96d5e9d3f36abef751aa0b788748 /arch/arc/kernel | |
| parent | bf006e149a5717a4614d44a62090ae98775af7a0 (diff) | |
| parent | d06e622d3d9206e6a2cc45a0f9a3256da8773ff4 (diff) | |
Merge schedutil governor updates for v4.10.
Diffstat (limited to 'arch/arc/kernel')
| -rw-r--r-- | arch/arc/kernel/devtree.c | 2 | ||||
| -rw-r--r-- | arch/arc/kernel/mcip.c | 63 | ||||
| -rw-r--r-- | arch/arc/kernel/module.c | 53 | ||||
| -rw-r--r-- | arch/arc/kernel/process.c | 35 | ||||
| -rw-r--r-- | arch/arc/kernel/setup.c | 113 | ||||
| -rw-r--r-- | arch/arc/kernel/smp.c | 23 | ||||
| -rw-r--r-- | arch/arc/kernel/time.c | 19 | ||||
| -rw-r--r-- | arch/arc/kernel/troubleshoot.c | 110 |
8 files changed, 186 insertions, 232 deletions
diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c index f1e07c2344f8..3b67f538f142 100644 --- a/arch/arc/kernel/devtree.c +++ b/arch/arc/kernel/devtree.c | |||
| @@ -31,6 +31,8 @@ static void __init arc_set_early_base_baud(unsigned long dt_root) | |||
| 31 | arc_base_baud = 166666666; /* Fixed 166.6MHz clk (TB10x) */ | 31 | arc_base_baud = 166666666; /* Fixed 166.6MHz clk (TB10x) */ |
| 32 | else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp")) | 32 | else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp")) |
| 33 | arc_base_baud = 33333333; /* Fixed 33MHz clk (AXS10x) */ | 33 | arc_base_baud = 33333333; /* Fixed 33MHz clk (AXS10x) */ |
| 34 | else if (of_flat_dt_is_compatible(dt_root, "ezchip,arc-nps")) | ||
| 35 | arc_base_baud = 800000000; /* Fixed 800MHz clk (NPS) */ | ||
| 34 | else | 36 | else |
| 35 | arc_base_baud = 50000000; /* Fixed default 50MHz */ | 37 | arc_base_baud = 50000000; /* Fixed default 50MHz */ |
| 36 | } | 38 | } |
diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c index 72f9179b1a24..f39142acc89e 100644 --- a/arch/arc/kernel/mcip.c +++ b/arch/arc/kernel/mcip.c | |||
| @@ -15,11 +15,12 @@ | |||
| 15 | #include <asm/mcip.h> | 15 | #include <asm/mcip.h> |
| 16 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
| 17 | 17 | ||
| 18 | static char smp_cpuinfo_buf[128]; | ||
| 19 | static int idu_detected; | ||
| 20 | |||
| 21 | static DEFINE_RAW_SPINLOCK(mcip_lock); | 18 | static DEFINE_RAW_SPINLOCK(mcip_lock); |
| 22 | 19 | ||
| 20 | #ifdef CONFIG_SMP | ||
| 21 | |||
| 22 | static char smp_cpuinfo_buf[128]; | ||
| 23 | |||
| 23 | static void mcip_setup_per_cpu(int cpu) | 24 | static void mcip_setup_per_cpu(int cpu) |
| 24 | { | 25 | { |
| 25 | smp_ipi_irq_setup(cpu, IPI_IRQ); | 26 | smp_ipi_irq_setup(cpu, IPI_IRQ); |
| @@ -86,21 +87,7 @@ static void mcip_ipi_clear(int irq) | |||
| 86 | 87 | ||
| 87 | static void mcip_probe_n_setup(void) | 88 | static void mcip_probe_n_setup(void) |
| 88 | { | 89 | { |
| 89 | struct mcip_bcr { | 90 | struct mcip_bcr mp; |
| 90 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
| 91 | unsigned int pad3:8, | ||
| 92 | idu:1, llm:1, num_cores:6, | ||
| 93 | iocoh:1, gfrc:1, dbg:1, pad2:1, | ||
| 94 | msg:1, sem:1, ipi:1, pad:1, | ||
| 95 | ver:8; | ||
| 96 | #else | ||
| 97 | unsigned int ver:8, | ||
| 98 | pad:1, ipi:1, sem:1, msg:1, | ||
| 99 | pad2:1, dbg:1, gfrc:1, iocoh:1, | ||
| 100 | num_cores:6, llm:1, idu:1, | ||
| 101 | pad3:8; | ||
| 102 | #endif | ||
| 103 | } mp; | ||
| 104 | 91 | ||
| 105 | READ_BCR(ARC_REG_MCIP_BCR, mp); | 92 | READ_BCR(ARC_REG_MCIP_BCR, mp); |
| 106 | 93 | ||
| @@ -114,7 +101,6 @@ static void mcip_probe_n_setup(void) | |||
| 114 | IS_AVAIL1(mp.gfrc, "GFRC")); | 101 | IS_AVAIL1(mp.gfrc, "GFRC")); |
| 115 | 102 | ||
| 116 | cpuinfo_arc700[0].extn.gfrc = mp.gfrc; | 103 | cpuinfo_arc700[0].extn.gfrc = mp.gfrc; |
| 117 | idu_detected = mp.idu; | ||
| 118 | 104 | ||
| 119 | if (mp.dbg) { | 105 | if (mp.dbg) { |
| 120 | __mcip_cmd_data(CMD_DEBUG_SET_SELECT, 0, 0xf); | 106 | __mcip_cmd_data(CMD_DEBUG_SET_SELECT, 0, 0xf); |
| @@ -130,6 +116,8 @@ struct plat_smp_ops plat_smp_ops = { | |||
| 130 | .ipi_clear = mcip_ipi_clear, | 116 | .ipi_clear = mcip_ipi_clear, |
| 131 | }; | 117 | }; |
| 132 | 118 | ||
| 119 | #endif | ||
| 120 | |||
| 133 | /*************************************************************************** | 121 | /*************************************************************************** |
| 134 | * ARCv2 Interrupt Distribution Unit (IDU) | 122 | * ARCv2 Interrupt Distribution Unit (IDU) |
| 135 | * | 123 | * |
| @@ -193,6 +181,8 @@ idu_irq_set_affinity(struct irq_data *data, const struct cpumask *cpumask, | |||
| 193 | { | 181 | { |
| 194 | unsigned long flags; | 182 | unsigned long flags; |
| 195 | cpumask_t online; | 183 | cpumask_t online; |
| 184 | unsigned int destination_bits; | ||
| 185 | unsigned int distribution_mode; | ||
| 196 | 186 | ||
| 197 | /* errout if no online cpu per @cpumask */ | 187 | /* errout if no online cpu per @cpumask */ |
| 198 | if (!cpumask_and(&online, cpumask, cpu_online_mask)) | 188 | if (!cpumask_and(&online, cpumask, cpu_online_mask)) |
| @@ -200,8 +190,15 @@ idu_irq_set_affinity(struct irq_data *data, const struct cpumask *cpumask, | |||
| 200 | 190 | ||
| 201 | raw_spin_lock_irqsave(&mcip_lock, flags); | 191 | raw_spin_lock_irqsave(&mcip_lock, flags); |
| 202 | 192 | ||
| 203 | idu_set_dest(data->hwirq, cpumask_bits(&online)[0]); | 193 | destination_bits = cpumask_bits(&online)[0]; |
| 204 | idu_set_mode(data->hwirq, IDU_M_TRIG_LEVEL, IDU_M_DISTRI_RR); | 194 | idu_set_dest(data->hwirq, destination_bits); |
| 195 | |||
| 196 | if (ffs(destination_bits) == fls(destination_bits)) | ||
| 197 | distribution_mode = IDU_M_DISTRI_DEST; | ||
| 198 | else | ||
| 199 | distribution_mode = IDU_M_DISTRI_RR; | ||
| 200 | |||
| 201 | idu_set_mode(data->hwirq, IDU_M_TRIG_LEVEL, distribution_mode); | ||
| 205 | 202 | ||
| 206 | raw_spin_unlock_irqrestore(&mcip_lock, flags); | 203 | raw_spin_unlock_irqrestore(&mcip_lock, flags); |
| 207 | 204 | ||
| @@ -219,16 +216,15 @@ static struct irq_chip idu_irq_chip = { | |||
| 219 | 216 | ||
| 220 | }; | 217 | }; |
| 221 | 218 | ||
| 222 | static int idu_first_irq; | 219 | static irq_hw_number_t idu_first_hwirq; |
| 223 | 220 | ||
| 224 | static void idu_cascade_isr(struct irq_desc *desc) | 221 | static void idu_cascade_isr(struct irq_desc *desc) |
| 225 | { | 222 | { |
| 226 | struct irq_domain *domain = irq_desc_get_handler_data(desc); | 223 | struct irq_domain *idu_domain = irq_desc_get_handler_data(desc); |
| 227 | unsigned int core_irq = irq_desc_get_irq(desc); | 224 | irq_hw_number_t core_hwirq = irqd_to_hwirq(irq_desc_get_irq_data(desc)); |
| 228 | unsigned int idu_irq; | 225 | irq_hw_number_t idu_hwirq = core_hwirq - idu_first_hwirq; |
| 229 | 226 | ||
| 230 | idu_irq = core_irq - idu_first_irq; | 227 | generic_handle_irq(irq_find_mapping(idu_domain, idu_hwirq)); |
| 231 | generic_handle_irq(irq_find_mapping(domain, idu_irq)); | ||
| 232 | } | 228 | } |
| 233 | 229 | ||
| 234 | static int idu_irq_map(struct irq_domain *d, unsigned int virq, irq_hw_number_t hwirq) | 230 | static int idu_irq_map(struct irq_domain *d, unsigned int virq, irq_hw_number_t hwirq) |
| @@ -294,9 +290,12 @@ idu_of_init(struct device_node *intc, struct device_node *parent) | |||
| 294 | struct irq_domain *domain; | 290 | struct irq_domain *domain; |
| 295 | /* Read IDU BCR to confirm nr_irqs */ | 291 | /* Read IDU BCR to confirm nr_irqs */ |
| 296 | int nr_irqs = of_irq_count(intc); | 292 | int nr_irqs = of_irq_count(intc); |
| 297 | int i, irq; | 293 | int i, virq; |
| 294 | struct mcip_bcr mp; | ||
| 295 | |||
| 296 | READ_BCR(ARC_REG_MCIP_BCR, mp); | ||
| 298 | 297 | ||
| 299 | if (!idu_detected) | 298 | if (!mp.idu) |
| 300 | panic("IDU not detected, but DeviceTree using it"); | 299 | panic("IDU not detected, but DeviceTree using it"); |
| 301 | 300 | ||
| 302 | pr_info("MCIP: IDU referenced from Devicetree %d irqs\n", nr_irqs); | 301 | pr_info("MCIP: IDU referenced from Devicetree %d irqs\n", nr_irqs); |
| @@ -312,11 +311,11 @@ idu_of_init(struct device_node *intc, struct device_node *parent) | |||
| 312 | * however we need it to get the parent virq and set IDU handler | 311 | * however we need it to get the parent virq and set IDU handler |
| 313 | * as first level isr | 312 | * as first level isr |
| 314 | */ | 313 | */ |
| 315 | irq = irq_of_parse_and_map(intc, i); | 314 | virq = irq_of_parse_and_map(intc, i); |
| 316 | if (!i) | 315 | if (!i) |
| 317 | idu_first_irq = irq; | 316 | idu_first_hwirq = irqd_to_hwirq(irq_get_irq_data(virq)); |
| 318 | 317 | ||
| 319 | irq_set_chained_handler_and_data(irq, idu_cascade_isr, domain); | 318 | irq_set_chained_handler_and_data(virq, idu_cascade_isr, domain); |
| 320 | } | 319 | } |
| 321 | 320 | ||
| 322 | __mcip_cmd(CMD_IDU_ENABLE, 0); | 321 | __mcip_cmd(CMD_IDU_ENABLE, 0); |
diff --git a/arch/arc/kernel/module.c b/arch/arc/kernel/module.c index 9a2849756022..42e964db2967 100644 --- a/arch/arc/kernel/module.c +++ b/arch/arc/kernel/module.c | |||
| @@ -30,17 +30,9 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, | |||
| 30 | char *secstr, struct module *mod) | 30 | char *secstr, struct module *mod) |
| 31 | { | 31 | { |
| 32 | #ifdef CONFIG_ARC_DW2_UNWIND | 32 | #ifdef CONFIG_ARC_DW2_UNWIND |
| 33 | int i; | ||
| 34 | |||
| 35 | mod->arch.unw_sec_idx = 0; | 33 | mod->arch.unw_sec_idx = 0; |
| 36 | mod->arch.unw_info = NULL; | 34 | mod->arch.unw_info = NULL; |
| 37 | 35 | mod->arch.secstr = secstr; | |
| 38 | for (i = 1; i < hdr->e_shnum; i++) { | ||
| 39 | if (strcmp(secstr+sechdrs[i].sh_name, ".eh_frame") == 0) { | ||
| 40 | mod->arch.unw_sec_idx = i; | ||
| 41 | break; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | #endif | 36 | #endif |
| 45 | |||
