Pull irqchip updates for 5.1 from Marc Zyngier: - irqsteer error handling fix - GICv3 range coalescing fix - stm32 coprocessor coexistence fixes - mbigen MSI teardown fix - non-DT secondary GIC infrastructure removed - various cleanups (brcmstb-l2, mmp) - new DT bindings (r8a774c0)
Unified · Split
| @@ -16,6 +16,7 @@ Required properties: · 15 unmodified lines | |||
| 16 | - "renesas,irqc-r8a7793" (R-Car M2-N) | 16 | - "renesas,irqc-r8a7793" (R-Car M2-N) |
| 17 | - "renesas,irqc-r8a7794" (R-Car E2) | 17 | - "renesas,irqc-r8a7794" (R-Car E2) |
| 18 | - "renesas,intc-ex-r8a774a1" (RZ/G2M) | 18 | - "renesas,intc-ex-r8a774a1" (RZ/G2M) |
| 19 | - "renesas,intc-ex-r8a774c0" (RZ/G2E) | ||
| 19 | - "renesas,intc-ex-r8a7795" (R-Car H3) | 20 | - "renesas,intc-ex-r8a7795" (R-Car H3) |
| 20 | - "renesas,intc-ex-r8a7796" (R-Car M3-W) | 21 | - "renesas,intc-ex-r8a7796" (R-Car M3-W) |
| 21 | - "renesas,intc-ex-r8a77965" (R-Car M3-N) | 22 | - "renesas,intc-ex-r8a77965" (R-Car M3-N) |
| @@ -90,7 +90,7 @@ void __init cns3xxx_map_io(void) · 89 unmodified lines | |||
| 90 | /* used by entry-macro.S */ | 90 | /* used by entry-macro.S */ |
| 91 | void __init cns3xxx_init_irq(void) | 91 | void __init cns3xxx_init_irq(void) |
| 92 | { | 92 | { |
| 93 | gic_init(0, 29, IOMEM(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT), | 93 | gic_init(IOMEM(CNS3XXX_TC11MP_GIC_DIST_BASE_VIRT), |
| 94 | IOMEM(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT)); | 94 | IOMEM(CNS3XXX_TC11MP_GIC_CPU_BASE_VIRT)); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| @@ -275,14 +275,14 @@ out_free: · 274 unmodified lines | |||
| 275 | return ret; | 275 | return ret; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | int __init brcmstb_l2_edge_intc_of_init(struct device_node *np, | 278 | static int __init brcmstb_l2_edge_intc_of_init(struct device_node *np, |
| 279 | struct device_node *parent) | 279 | struct device_node *parent) |
| 280 | { | 280 | { |
| 281 | return brcmstb_l2_intc_of_init(np, parent, &l2_edge_intc_init); | 281 | return brcmstb_l2_intc_of_init(np, parent, &l2_edge_intc_init); |
| 282 | } | 282 | } |
| 283 | IRQCHIP_DECLARE(brcmstb_l2_intc, "brcm,l2-intc", brcmstb_l2_edge_intc_of_init); | 283 | IRQCHIP_DECLARE(brcmstb_l2_intc, "brcm,l2-intc", brcmstb_l2_edge_intc_of_init); |
| 284 | 284 | ||
| 285 | int __init brcmstb_l2_lvl_intc_of_init(struct device_node *np, | 285 | static int __init brcmstb_l2_lvl_intc_of_init(struct device_node *np, |
| 286 | struct device_node *parent) | 286 | struct device_node *parent) |
| 287 | { | 287 | { |
| 288 | return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init); | 288 | return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init); |
| @@ -1482,7 +1482,7 @@ static int lpi_range_cmp(void *priv, struct list_head *a, struct list_head *b) · 1481 unmodified lines | |||
| 1482 | ra = container_of(a, struct lpi_range, entry); | 1482 | ra = container_of(a, struct lpi_range, entry); |
| 1483 | rb = container_of(b, struct lpi_range, entry); | 1483 | rb = container_of(b, struct lpi_range, entry); |
| 1484 | 1484 | ||
| 1485 | return rb->base_id - ra->base_id; | 1485 | return ra->base_id - rb->base_id; |
| 1486 | } | 1486 | } |
| 1487 | 1487 | ||
| 1488 | static void merge_lpi_ranges(void) | 1488 | static void merge_lpi_ranges(void) |
| @@ -1089,11 +1089,10 @@ static void gic_init_chip(struct gic_chip_data *gic, struct device *dev, · 1088 unmodified lines | |||
| 1089 | #endif | 1089 | #endif |
| 1090 | } | 1090 | } |
| 1091 | 1091 | ||
| 1092 | static int gic_init_bases(struct gic_chip_data *gic, int irq_start, | 1092 | static int gic_init_bases(struct gic_chip_data *gic, |
| 1093 | struct fwnode_handle *handle) | 1093 | struct fwnode_handle *handle) |
| 1094 | { | 1094 | { |
| 1095 | irq_hw_number_t hwirq_base; | 1095 | int gic_irqs, ret; |
| 1096 | int gic_irqs, irq_base, ret; | ||
| 1097 | 1096 | ||
| 1098 | if (IS_ENABLED(CONFIG_GIC_NON_BANKED) && gic->percpu_offset) { | 1097 | if (IS_ENABLED(CONFIG_GIC_NON_BANKED) && gic->percpu_offset) { |
| 1099 | /* Frankein-GIC without banked registers... */ | 1098 | /* Frankein-GIC without banked registers... */ |
| @@ -1145,28 +1144,21 @@ static int gic_init_bases(struct gic_chip_data *gic, int irq_start, · 45 unmodified lines | |||
| 1145 | } else { /* Legacy support */ | 1144 | } else { /* Legacy support */ |
| 1146 | /* | 1145 | /* |
| 1147 | * For primary GICs, skip over SGIs. | 1146 | * For primary GICs, skip over SGIs. |
| 1148 | * For secondary GICs, skip over PPIs, too. | 1147 | * No secondary GIC support whatsoever. |
| 1149 | */ | 1148 | */ |
| 1150 | if (gic == &gic_data[0] && (irq_start & 31) > 0) { | 1149 | int irq_base; |
| 1151 | hwirq_base = 16; | ||
| 1152 | if (irq_start != -1) | ||
| 1153 | irq_start = (irq_start & ~31) + 16; | ||
| 1154 | } else { | ||
| 1155 | hwirq_base = 32; | ||
| 1156 | } | ||
| 1157 | 1150 | ||
| 1158 | gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */ | 1151 | gic_irqs -= 16; /* calculate # of irqs to allocate */ |
| 1159 | 1152 | ||
| 1160 | irq_base = irq_alloc_descs(irq_start, 16, gic_irqs, | 1153 | irq_base = irq_alloc_descs(16, 16, gic_irqs, |
| 1161 | numa_node_id()); | 1154 | numa_node_id()); |
| 1162 | if (irq_base < 0) { | 1155 | if (irq_base < 0) { |
| 1163 | WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n", | 1156 | WARN(1, "Cannot allocate irq_descs @ IRQ16, assuming pre-allocated\n"); |
| 1164 | irq_start); | 1157 | irq_base = 16; |
| 1165 | irq_base = irq_start; | ||
| 1166 | } | 1158 | } |
| 1167 | 1159 | ||
| 1168 | gic->domain = irq_domain_add_legacy(NULL, gic_irqs, irq_base, | 1160 | gic->domain = irq_domain_add_legacy(NULL, gic_irqs, irq_base, |
| 1169 | hwirq_base, &gic_irq_domain_ops, gic); | 1161 | 16, &gic_irq_domain_ops, gic); |
| 1170 | } | 1162 | } |
| 1171 | 1163 | ||
| 1172 | if (WARN_ON(!gic->domain)) { | 1164 | if (WARN_ON(!gic->domain)) { |
| @@ -1195,7 +1187,6 @@ error: · 22 unmodified lines | |||
| 1195 | } | 1187 | } |
| 1196 | 1188 | ||
| 1197 | static int __init __gic_init_bases(struct gic_chip_data *gic, | 1189 | static int __init __gic_init_bases(struct gic_chip_data *gic, |
| 1198 | int irq_start, | ||
| 1199 | struct fwnode_handle *handle) | 1190 | struct fwnode_handle *handle) |
| 1200 | { | 1191 | { |
| 1201 | char *name; | 1192 | char *name; |
| @@ -1231,32 +1222,28 @@ static int __init __gic_init_bases(struct gic_chip_data *gic, · 29 unmodified lines | |||
| 1231 | gic_init_chip(gic, NULL, name, false); | 1222 | gic_init_chip(gic, NULL, name, false); |
| 1232 | } | 1223 | } |
| 1233 | 1224 | ||
| 1234 | ret = gic_init_bases(gic, irq_start, handle); | 1225 | ret = gic_init_bases(gic, handle); |
| 1235 | if (ret) | 1226 | if (ret) |
| 1236 | kfree(name); | 1227 | kfree(name); |
| 1237 | 1228 | ||
| 1238 | return ret; | 1229 | return ret; |
| 1239 | } | 1230 | } |
| 1240 | 1231 | ||
| 1241 | void __init gic_init(unsigned int gic_nr, int irq_start, | 1232 | void __init gic_init(void __iomem *dist_base, void __iomem *cpu_base) |
| 1242 | void __iomem *dist_base, void __iomem *cpu_base) | ||
| 1243 | { | 1233 | { |
| 1244 | struct gic_chip_data *gic; | 1234 | struct gic_chip_data *gic; |
| 1245 | 1235 | ||
| 1246 | if (WARN_ON(gic_nr >= CONFIG_ARM_GIC_MAX_NR)) | ||
| 1247 | return; | ||
| 1248 | |||
| 1249 | /* | 1236 | /* |
| 1250 | * Non-DT/ACPI systems won't run a hypervisor, so let's not | 1237 | * Non-DT/ACPI systems won't run a hypervisor, so let's not |
| 1251 | * bother with these... | 1238 | * bother with these... |
| 1252 | */ | 1239 | */ |
| 1253 | static_branch_disable(&supports_deactivate_key); | 1240 | static_branch_disable(&supports_deactivate_key); |
| 1254 | 1241 | ||
| 1255 | gic = &gic_data[gic_nr]; | 1242 | gic = &gic_data[0]; |
| 1256 | gic->raw_dist_base = dist_base; | 1243 | gic->raw_dist_base = dist_base; |
| 1257 | gic->raw_cpu_base = cpu_base; | 1244 | gic->raw_cpu_base = cpu_base; |
| 1258 | 1245 | ||
| 1259 | __gic_init_bases(gic, irq_start, NULL); | 1246 | __gic_init_bases(gic, NULL); |
| 1260 | } | 1247 | } |
| 1261 | 1248 | ||
| 1262 | static void gic_teardown(struct gic_chip_data *gic) | 1249 | static void gic_teardown(struct gic_chip_data *gic) |
| @@ -1399,7 +1386,7 @@ int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq) · 136 unmodified lines | |||
| 1399 | if (ret) | 1386 | if (ret) |
| 1400 | return ret; | 1387 | return ret; |
| 1401 | 1388 | ||
| 1402 | ret = gic_init_bases(*gic, -1, &dev->of_node->fwnode); | 1389 | ret = gic_init_bases(*gic, &dev->of_node->fwnode); |
| 1403 | if (ret) { | 1390 | if (ret) { |
| 1404 | gic_teardown(*gic); | 1391 | gic_teardown(*gic); |
| 1405 | return ret; | 1392 | return ret; |
| @@ -1459,7 +1446,7 @@ gic_of_init(struct device_node *node, struct device_node *parent) · 53 unmodified lines | |||
| 1459 | if (gic_cnt == 0 && !gic_check_eoimode(node, &gic->raw_cpu_base)) | 1446 | if (gic_cnt == 0 && !gic_check_eoimode(node, &gic->raw_cpu_base)) |
| 1460 | static_branch_disable(&supports_deactivate_key); | 1447 | static_branch_disable(&supports_deactivate_key); |
| 1461 | 1448 | ||
| 1462 | ret = __gic_init_bases(gic, -1, &node->fwnode); | 1449 | ret = __gic_init_bases(gic, &node->fwnode); |
| 1463 | if (ret) { | 1450 | if (ret) { |
| 1464 | gic_teardown(gic); | 1451 | gic_teardown(gic); |
| 1465 | return ret; | 1452 | return ret; |
| @@ -1650,7 +1637,7 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, · 184 unmodified lines | |||
| 1650 | return -ENOMEM; | 1637 | return -ENOMEM; |
| 1651 | } | 1638 | } |
| 1652 | 1639 | ||
| 1653 | ret = __gic_init_bases(gic, -1, domain_handle); | 1640 | ret = __gic_init_bases(gic, domain_handle); |
| 1654 | if (ret) { | 1641 | if (ret) { |
| 1655 | pr_err("Failed to initialise GIC\n"); | 1642 | pr_err("Failed to initialise GIC\n"); |
| 1656 | irq_domain_free_fwnode(domain_handle); | 1643 | irq_domain_free_fwnode(domain_handle); |
| @@ -169,8 +169,12 @@ static int imx_irqsteer_probe(struct platform_device *pdev) · 168 unmodified lines | |||
| 169 | 169 | ||
| 170 | raw_spin_lock_init(&data->lock); | 170 | raw_spin_lock_init(&data->lock); |
| 171 | 171 | ||
| 172 | of_property_read_u32(np, "fsl,num-irqs", &irqs_num); | 172 | ret = of_property_read_u32(np, "fsl,num-irqs", &irqs_num); |
| 173 | of_property_read_u32(np, "fsl,channel", &data->channel); | 173 | if (ret) |
| 174 | return ret; | ||
| 175 | ret = of_property_read_u32(np, "fsl,channel", &data->channel); | ||
| 176 | if (ret) | ||
| 177 | return ret; | ||
| 174 | 178 | ||
| 175 | /* | 179 | /* |
| 176 | * There is one output irq for each group of 64 inputs. | 180 | * There is one output irq for each group of 64 inputs. |
| @@ -161,6 +161,9 @@ static void mbigen_write_msg(struct msi_desc *desc, struct msi_msg *msg) · 160 unmodified lines | |||
| 161 | void __iomem *base = d->chip_data; | 161 | void __iomem *base = d->chip_data; |
| 162 | u32 val; | 162 | u32 val; |
| 163 | 163 | ||
| 164 | if (!msg->address_lo && !msg->address_hi) | ||
| 165 | return; | ||
| 166 | |||
| 164 | base += get_mbigen_vec_reg(d->hwirq); | 167 | base += get_mbigen_vec_reg(d->hwirq); |
| 165 | val = readl_relaxed(base); | 168 | val = readl_relaxed(base); |
| 166 | 169 | ||
| @@ -179,7 +179,7 @@ static int mmp_irq_domain_xlate(struct irq_domain *d, struct device_node *node, · 178 unmodified lines | |||
| 179 | return 0; | 179 | return 0; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | const struct irq_domain_ops mmp_irq_domain_ops = { | 182 | static const struct irq_domain_ops mmp_irq_domain_ops = { |
| 183 | .map = mmp_irq_domain_map, | 183 | .map = mmp_irq_domain_map, |
| 184 | .xlate = mmp_irq_domain_xlate, | 184 | .xlate = mmp_irq_domain_xlate, |
| 185 | }; | 185 | }; |
| @@ -716,7 +716,6 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data, · 715 unmodified lines | |||
| 716 | const struct stm32_exti_bank *stm32_bank; | 716 | const struct stm32_exti_bank *stm32_bank; |
| 717 | struct stm32_exti_chip_data *chip_data; | 717 | struct stm32_exti_chip_data *chip_data; |
| 718 | void __iomem *base = h_data->base; | 718 | void __iomem *base = h_data->base; |
| 719 | u32 irqs_mask; | ||
| 720 | 719 | ||
| 721 | stm32_bank = h_data->drv_data->exti_banks[bank_idx]; | 720 | stm32_bank = h_data->drv_data->exti_banks[bank_idx]; |
| 722 | chip_data = &h_data->chips_data[bank_idx]; | 721 | chip_data = &h_data->chips_data[bank_idx]; |
| @@ -725,21 +724,12 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data, · 2 unmodified lines | |||
| 725 | 724 | ||
| 726 | raw_spin_lock_init(&chip_data->rlock); | 725 | raw_spin_lock_init(&chip_data->rlock); |
| 727 | 726 | ||
| 728 | /* Determine number of irqs supported */ | ||
| 729 | writel_relaxed(~0UL, base + stm32_bank->rtsr_ofst); | ||
| 730 | irqs_mask = readl_relaxed(base + stm32_bank->rtsr_ofst); | ||
| 731 | |||
| 732 | /* | 727 | /* |
| 733 | * This IP has no reset, so after hot reboot we should | 728 | * This IP has no reset, so after hot reboot we should |
| 734 | * clear registers to avoid residue | 729 | * clear registers to avoid residue |
| 735 | */ | 730 | */ |
| 736 | writel_relaxed(0, base + stm32_bank->imr_ofst); | 731 | writel_relaxed(0, base + stm32_bank->imr_ofst); |
| 737 | writel_relaxed(0, base + stm32_bank->emr_ofst); | 732 | writel_relaxed(0, base + stm32_bank->emr_ofst); |
| 738 | writel_relaxed(0, base + stm32_bank->rtsr_ofst); | ||
| 739 | writel_relaxed(0, base + stm32_bank->ftsr_ofst); | ||
| 740 | writel_relaxed(~0UL, base + stm32_bank->rpr_ofst); | ||
| 741 | if (stm32_bank->fpr_ofst != UNDEF_REG) | ||
| 742 | writel_relaxed(~0UL, base + stm32_bank->fpr_ofst); | ||
| 743 | 733 | ||
| 744 | pr_info("%pOF: bank%d\n", h_data->node, bank_idx); | 734 | pr_info("%pOF: bank%d\n", h_data->node, bank_idx); |
| 745 | 735 | ||
| @@ -158,8 +158,7 @@ int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq); · 157 unmodified lines | |||
| 158 | * Legacy platforms not converted to DT yet must use this to init | 158 | * Legacy platforms not converted to DT yet must use this to init |
| 159 | * their GIC | 159 | * their GIC |
| 160 | */ | 160 | */ |
| 161 | void gic_init(unsigned int nr, int start, | 161 | void gic_init(void __iomem *dist , void __iomem *cpu); |
| 162 | void __iomem *dist , void __iomem *cpu); | ||
| 163 | 162 | ||
| 164 | int gicv2m_init(struct fwnode_handle *parent_handle, | 163 | int gicv2m_init(struct fwnode_handle *parent_handle, |
| 165 | struct irq_domain *parent); | 164 | struct irq_domain *parent); |