Skip to content

Commit dec0029

Browse files
committed
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
2 parents 02fc87b + 75f1133 commit dec0029

File tree

12 files changed

+52
-15
lines changed

12 files changed

+52
-15
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)
@@ -1523,7 +1526,7 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end)
15231526

15241527
err = gic_validate_dist_version(acpi_data.dist_base);
15251528
if (err) {
1526-
pr_err("No distributor detected at @%p, giving up",
1529+
pr_err("No distributor detected at @%p, giving up\n",
15271530
acpi_data.dist_base);
15281531
goto out_dist_unmap;
15291532
}

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-imgpdc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static int pdc_intc_probe(struct platform_device *pdev)
325325

326326
/* Ioremap the registers */
327327
priv->pdc_base = devm_ioremap(&pdev->dev, res_regs->start,
328-
res_regs->end - res_regs->start);
328+
resource_size(res_regs));
329329
if (!priv->pdc_base)
330330
return -EIO;
331331

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

drivers/irqchip/irq-sni-exiu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ static int __init exiu_init(struct device_node *node,
196196
}
197197

198198
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;
201201
goto out_free;
202202
}
203203

drivers/irqchip/qcom-irq-combiner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int __init combiner_probe(struct platform_device *pdev)
238238
{
239239
struct combiner *combiner;
240240
size_t alloc_sz;
241-
u32 nregs;
241+
int nregs;
242242
int err;
243243

244244
nregs = count_registers(pdev);

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

0 commit comments

Comments
 (0)