Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 41cc304

Browse files
committed
Merge tag 'irqchip-4.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent
Pull irqchip updates for 4.15, take #4 from Marc Zyngier - A core irq fix for legacy cases where the irq trigger is not reported by firmware - A couple of GICv3/4 fixes (Kconfig, of-node refcount, error handling) - Trivial pr_err fixes
2 parents b29c6ef + 29f4113 commit 41cc304

File tree

8 files changed

+47
-10
lines changed

8 files changed

+47
-10
lines changed

drivers/irqchip/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,15 @@ config ARM_GIC_V3
4141

4242
config ARM_GIC_V3_ITS
4343
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
4450
depends on PCI
4551
depends on PCI_MSI
52+
default ARM_GIC_V3_ITS
4653

4754
config ARM_NVIC
4855
bool

drivers/irqchip/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ obj-$(CONFIG_ARM_GIC_PM) += irq-gic-pm.o
3030
obj-$(CONFIG_ARCH_REALVIEW) += irq-gic-realview.o
3131
obj-$(CONFIG_ARM_GIC_V2M) += irq-gic-v2m.o
3232
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
3435
obj-$(CONFIG_PARTITION_PERCPU) += irq-partition-percpu.o
3536
obj-$(CONFIG_HISILICON_IRQ_MBIGEN) += irq-mbigen.o
3637
obj-$(CONFIG_ARM_NVIC) += irq-nvic.o

drivers/irqchip/irq-gic-v3.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,18 +1103,18 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
11031103
int nr_parts;
11041104
struct partition_affinity *parts;
11051105

1106-
parts_node = of_find_node_by_name(gic_node, "ppi-partitions");
1106+
parts_node = of_get_child_by_name(gic_node, "ppi-partitions");
11071107
if (!parts_node)
11081108
return;
11091109

11101110
nr_parts = of_get_child_count(parts_node);
11111111

11121112
if (!nr_parts)
1113-
return;
1113+
goto out_put_node;
11141114

11151115
parts = kzalloc(sizeof(*parts) * nr_parts, GFP_KERNEL);
11161116
if (WARN_ON(!parts))
1117-
return;
1117+
goto out_put_node;
11181118

11191119
for_each_child_of_node(parts_node, child_part) {
11201120
struct partition_affinity *part;
@@ -1181,6 +1181,9 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
11811181

11821182
gic_data.ppi_descs[i] = desc;
11831183
}
1184+
1185+
out_put_node:
1186+
of_node_put(parts_node);
11841187
}
11851188

11861189
static void __init gic_of_setup_kvm_info(struct device_node *node)
@@ -1521,7 +1524,7 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
15211524

15221525
err = gic_validate_dist_version(acpi_data.dist_base);
15231526
if (err) {
1524-
pr_err("No distributor detected at @%p, giving up",
1527+
pr_err("No distributor detected at @%p, giving up\n",
15251528
acpi_data.dist_base);
15261529
goto out_dist_unmap;
15271530
}

drivers/irqchip/irq-gic-v4.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,19 @@ int its_map_vlpi(int irq, struct its_vlpi_map *map)
177177
.map = map,
178178
},
179179
};
180+
int ret;
180181

181182
/*
182183
* The host will never see that interrupt firing again, so it
183184
* is vital that we don't do any lazy masking.
184185
*/
185186
irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY);
186187

187-
return irq_set_vcpu_affinity(irq, &info);
188+
ret = irq_set_vcpu_affinity(irq, &info);
189+
if (ret)
190+
irq_clear_status_flags(irq, IRQ_DISABLE_UNLAZY);
191+
192+
return ret;
188193
}
189194

190195
int its_get_vlpi(int irq, struct its_vlpi_map *map)

drivers/irqchip/irq-s3c24xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static int s3c_irq_type(struct irq_data *data, unsigned int type)
156156
irq_set_handler(data->irq, handle_level_irq);
157157
break;
158158
default:
159-
pr_err("No such irq type %d", type);
159+
pr_err("No such irq type %d\n", type);
160160
return -EINVAL;
161161
}
162162

@@ -204,7 +204,7 @@ static int s3c_irqext_type_set(void __iomem *gpcon_reg,
204204
break;
205205

206206
default:
207-
pr_err("No such irq type %d", type);
207+
pr_err("No such irq type %d\n", type);
208208
return -EINVAL;
209209
}
210210

include/linux/irq.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ struct irq_data {
211211
* IRQD_MANAGED_SHUTDOWN - Interrupt was shutdown due to empty affinity
212212
* mask. Applies only to affinity managed irqs.
213213
* IRQD_SINGLE_TARGET - IRQ allows only a single affinity target
214+
* IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set
214215
*/
215216
enum {
216217
IRQD_TRIGGER_MASK = 0xf,
@@ -231,6 +232,7 @@ enum {
231232
IRQD_IRQ_STARTED = (1 << 22),
232233
IRQD_MANAGED_SHUTDOWN = (1 << 23),
233234
IRQD_SINGLE_TARGET = (1 << 24),
235+
IRQD_DEFAULT_TRIGGER_SET = (1 << 25),
234236
};
235237

236238
#define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
@@ -260,18 +262,25 @@ static inline void irqd_mark_affinity_was_set(struct irq_data *d)
260262
__irqd_to_state(d) |= IRQD_AFFINITY_SET;
261263
}
262264

265+
static inline bool irqd_trigger_type_was_set(struct irq_data *d)
266+
{
267+
return __irqd_to_state(d) & IRQD_DEFAULT_TRIGGER_SET;
268+
}
269+
263270
static inline u32 irqd_get_trigger_type(struct irq_data *d)
264271
{
265272
return __irqd_to_state(d) & IRQD_TRIGGER_MASK;
266273
}
267274

268275
/*
269-
* Must only be called inside irq_chip.irq_set_type() functions.
276+
* Must only be called inside irq_chip.irq_set_type() functions or
277+
* from the DT/ACPI setup code.
270278
*/
271279
static inline void irqd_set_trigger_type(struct irq_data *d, u32 type)
272280
{
273281
__irqd_to_state(d) &= ~IRQD_TRIGGER_MASK;
274282
__irqd_to_state(d) |= type & IRQD_TRIGGER_MASK;
283+
__irqd_to_state(d) |= IRQD_DEFAULT_TRIGGER_SET;
275284
}
276285

277286
static inline bool irqd_is_level_type(struct irq_data *d)

include/linux/irqchip/arm-gic-v4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ int its_get_vlpi(int irq, struct its_vlpi_map *map);
109109
int its_unmap_vlpi(int irq);
110110
int its_prop_update_vlpi(int irq, u8 config, bool inv);
111111

112+
struct irq_domain_ops;
112113
int its_init_v4(struct irq_domain *domain, const struct irq_domain_ops *ops);
113114

114115
#endif

kernel/irq/manage.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,18 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
12461246
* set the trigger type must match. Also all must
12471247
* agree on ONESHOT.
12481248
*/
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+
}
12501261

12511262
if (!((old->flags & new->flags) & IRQF_SHARED) ||
12521263
(oldtype != (new->flags & IRQF_TRIGGER_MASK)) ||

0 commit comments

Comments
 (0)