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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fixes from Thomas Glexiner:

- unbreak the irq trigger type check for legacy platforms

- a handful fixes for ARM GIC v3/4 interrupt controllers

- a few trivial fixes all over the place

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
genirq/matrix: Make - vs ?: Precedence explicit
irqchip/imgpdc: Use resource_size function on resource object
irqchip/qcom: Fix u32 comparison with value less than zero
irqchip/exiu: Fix return value check in exiu_init()
irqchip/gic-v3-its: Remove artificial dependency on PCI
irqchip/gic-v4: Add forward definition of struct irq_domain_ops
irqchip/gic-v3: pr_err() strings should end with newlines
irqchip/s3c24xx: pr_err() strings should end with newlines
irqchip/gic-v3: Fix ppi-partitions lookup
irqchip/gic-v4: Clear IRQ_DISABLE_UNLAZY again if mapping fails
genirq: Track whether the trigger type has been set

+52 -15
+7
drivers/irqchip/Kconfig
··· 41 41 42 42 config ARM_GIC_V3_ITS 43 43 bool 44 + select GENERIC_MSI_IRQ_DOMAIN 45 + default ARM_GIC_V3 46 + 47 + config ARM_GIC_V3_ITS_PCI 48 + bool 49 + depends on ARM_GIC_V3_ITS 44 50 depends on PCI 45 51 depends on PCI_MSI 52 + default ARM_GIC_V3_ITS 46 53 47 54 config ARM_NVIC 48 55 bool
+2 -1
drivers/irqchip/Makefile
··· 30 30 obj-$(CONFIG_ARCH_REALVIEW) += irq-gic-realview.o 31 31 obj-$(CONFIG_ARM_GIC_V2M) += irq-gic-v2m.o 32 32 obj-$(CONFIG_ARM_GIC_V3) += irq-gic-v3.o irq-gic-common.o 33 - obj-$(CONFIG_ARM_GIC_V3_ITS) += irq-gic-v3-its.o irq-gic-v3-its-pci-msi.o irq-gic-v3-its-platform-msi.o irq-gic-v4.o 33 + obj-$(CONFIG_ARM_GIC_V3_ITS) += irq-gic-v3-its.o irq-gic-v3-its-platform-msi.o irq-gic-v4.o 34 + obj-$(CONFIG_ARM_GIC_V3_ITS_PCI) += irq-gic-v3-its-pci-msi.o 34 35 obj-$(CONFIG_PARTITION_PERCPU) += irq-partition-percpu.o 35 36 obj-$(CONFIG_HISILICON_IRQ_MBIGEN) += irq-mbigen.o 36 37 obj-$(CONFIG_ARM_NVIC) += irq-nvic.o
+7 -4
drivers/irqchip/irq-gic-v3.c
··· 1103 1103 int nr_parts; 1104 1104 struct partition_affinity *parts; 1105 1105 1106 - parts_node = of_find_node_by_name(gic_node, "ppi-partitions"); 1106 + parts_node = of_get_child_by_name(gic_node, "ppi-partitions"); 1107 1107 if (!parts_node) 1108 1108 return; 1109 1109 1110 1110 nr_parts = of_get_child_count(parts_node); 1111 1111 1112 1112 if (!nr_parts) 1113 - return; 1113 + goto out_put_node; 1114 1114 1115 1115 parts = kzalloc(sizeof(*parts) * nr_parts, GFP_KERNEL); 1116 1116 if (WARN_ON(!parts)) 1117 - return; 1117 + goto out_put_node; 1118 1118 1119 1119 for_each_child_of_node(parts_node, child_part) { 1120 1120 struct partition_affinity *part; ··· 1181 1181 1182 1182 gic_data.ppi_descs[i] = desc; 1183 1183 } 1184 + 1185 + out_put_node: 1186 + of_node_put(parts_node); 1184 1187 } 1185 1188 1186 1189 static void __init gic_of_setup_kvm_info(struct device_node *node) ··· 1526 1523 1527 1524 err = gic_validate_dist_version(acpi_data.dist_base); 1528 1525 if (err) { 1529 - pr_err("No distributor detected at @%p, giving up", 1526 + pr_err("No distributor detected at @%p, giving up\n", 1530 1527 acpi_data.dist_base); 1531 1528 goto out_dist_unmap; 1532 1529 }
+6 -1
drivers/irqchip/irq-gic-v4.c
··· 177 177 .map = map, 178 178 }, 179 179 }; 180 + int ret; 180 181 181 182 /* 182 183 * The host will never see that interrupt firing again, so it ··· 185 184 */ 186 185 irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY); 187 186 188 - return irq_set_vcpu_affinity(irq, &info); 187 + ret = irq_set_vcpu_affinity(irq, &info); 188 + if (ret) 189 + irq_clear_status_flags(irq, IRQ_DISABLE_UNLAZY); 190 + 191 + return ret; 189 192 } 190 193 191 194 int its_get_vlpi(int irq, struct its_vlpi_map *map)
+1 -1
drivers/irqchip/irq-imgpdc.c
··· 325 325 326 326 /* Ioremap the registers */ 327 327 priv->pdc_base = devm_ioremap(&pdev->dev, res_regs->start, 328 - res_regs->end - res_regs->start); 328 + resource_size(res_regs)); 329 329 if (!priv->pdc_base) 330 330 return -EIO; 331 331
+2 -2
drivers/irqchip/irq-s3c24xx.c
··· 156 156 irq_set_handler(data->irq, handle_level_irq); 157 157 break; 158 158 default: 159 - pr_err("No such irq type %d", type); 159 + pr_err("No such irq type %d\n", type); 160 160 return -EINVAL; 161 161 } 162 162 ··· 204 204 break; 205 205 206 206 default: 207 - pr_err("No such irq type %d", type); 207 + pr_err("No such irq type %d\n", type); 208 208 return -EINVAL; 209 209 } 210 210
+2 -2
drivers/irqchip/irq-sni-exiu.c
··· 196 196 } 197 197 198 198 data->base = of_iomap(node, 0); 199 - if (IS_ERR(data->base)) { 200 - err = PTR_ERR(data->base); 199 + if (!data->base) { 200 + err = -ENODEV; 201 201 goto out_free; 202 202 } 203 203
+1 -1
drivers/irqchip/qcom-irq-combiner.c
··· 238 238 { 239 239 struct combiner *combiner; 240 240 size_t alloc_sz; 241 - u32 nregs; 241 + int nregs; 242 242 int err; 243 243 244 244 nregs = count_registers(pdev);
+10 -1
include/linux/irq.h
··· 211 211 * IRQD_MANAGED_SHUTDOWN - Interrupt was shutdown due to empty affinity 212 212 * mask. Applies only to affinity managed irqs. 213 213 * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target 214 + * IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set 214 215 */ 215 216 enum { 216 217 IRQD_TRIGGER_MASK = 0xf, ··· 232 231 IRQD_IRQ_STARTED = (1 << 22), 233 232 IRQD_MANAGED_SHUTDOWN = (1 << 23), 234 233 IRQD_SINGLE_TARGET = (1 << 24), 234 + IRQD_DEFAULT_TRIGGER_SET = (1 << 25), 235 235 }; 236 236 237 237 #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) ··· 262 260 __irqd_to_state(d) |= IRQD_AFFINITY_SET; 263 261 } 264 262 263 + static inline bool irqd_trigger_type_was_set(struct irq_data *d) 264 + { 265 + return __irqd_to_state(d) & IRQD_DEFAULT_TRIGGER_SET; 266 + } 267 + 265 268 static inline u32 irqd_get_trigger_type(struct irq_data *d) 266 269 { 267 270 return __irqd_to_state(d) & IRQD_TRIGGER_MASK; 268 271 } 269 272 270 273 /* 271 - * Must only be called inside irq_chip.irq_set_type() functions. 274 + * Must only be called inside irq_chip.irq_set_type() functions or 275 + * from the DT/ACPI setup code. 272 276 */ 273 277 static inline void irqd_set_trigger_type(struct irq_data *d, u32 type) 274 278 { 275 279 __irqd_to_state(d) &= ~IRQD_TRIGGER_MASK; 276 280 __irqd_to_state(d) |= type & IRQD_TRIGGER_MASK; 281 + __irqd_to_state(d) |= IRQD_DEFAULT_TRIGGER_SET; 277 282 } 278 283 279 284 static inline bool irqd_is_level_type(struct irq_data *d)
+1
include/linux/irqchip/arm-gic-v4.h
··· 109 109 int its_unmap_vlpi(int irq); 110 110 int its_prop_update_vlpi(int irq, u8 config, bool inv); 111 111 112 + struct irq_domain_ops; 112 113 int its_init_v4(struct irq_domain *domain, const struct irq_domain_ops *ops); 113 114 114 115 #endif
+12 -1
kernel/irq/manage.c
··· 1246 1246 * set the trigger type must match. Also all must 1247 1247 * agree on ONESHOT. 1248 1248 */ 1249 - unsigned int oldtype = irqd_get_trigger_type(&desc->irq_data); 1249 + unsigned int oldtype; 1250 + 1251 + /* 1252 + * If nobody did set the configuration before, inherit 1253 + * the one provided by the requester. 1254 + */ 1255 + if (irqd_trigger_type_was_set(&desc->irq_data)) { 1256 + oldtype = irqd_get_trigger_type(&desc->irq_data); 1257 + } else { 1258 + oldtype = new->flags & IRQF_TRIGGER_MASK; 1259 + irqd_set_trigger_type(&desc->irq_data, oldtype); 1260 + } 1250 1261 1251 1262 if (!((old->flags & new->flags) & IRQF_SHARED) || 1252 1263 (oldtype != (new->flags & IRQF_TRIGGER_MASK)) ||
+1 -1
kernel/irq/matrix.c
··· 384 384 { 385 385 struct cpumap *cm = this_cpu_ptr(m->maps); 386 386 387 - return m->global_available - cpudown ? cm->available : 0; 387 + return (m->global_available - cpudown) ? cm->available : 0; 388 388 } 389 389 390 390 /**