Skip to content

Commit 80ade29

Browse files
committed
Merge tag 'irq-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Thomas Gleixner: "A set of fixes/updates for the interrupt subsystem: - Remove setup_irq() and remove_irq(). All users have been converted so remove them before new users surface. - A set of bugfixes for various interrupt chip drivers - Add a few missing static attributes to address sparse warnings" * tag 'irq-urgent-2020-04-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/irq-bcm7038-l1: Make bcm7038_l1_of_init() static irqchip/irq-mvebu-icu: Make legacy_bindings static irqchip/meson-gpio: Fix HARDIRQ-safe -> HARDIRQ-unsafe lock order irqchip/sifive-plic: Fix maximum priority threshold value irqchip/ti-sci-inta: Fix processing of masked irqs irqchip/mbigen: Free msi_desc on device teardown irqchip/gic-v4.1: Update effective affinity of virtual SGIs irqchip/gic-v4.1: Add support for VPENDBASER's Dirty+Valid signaling genirq: Remove setup_irq() and remove_irq()
2 parents 08dd387 + b596302 commit 80ade29

File tree

11 files changed

+51
-63
lines changed

11 files changed

+51
-63
lines changed

drivers/irqchip/irq-bcm7038-l1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static const struct irq_domain_ops bcm7038_l1_domain_ops = {
416416
.map = bcm7038_l1_map,
417417
};
418418

419-
int __init bcm7038_l1_of_init(struct device_node *dn,
419+
static int __init bcm7038_l1_of_init(struct device_node *dn,
420420
struct device_node *parent)
421421
{
422422
struct bcm7038_l1_chip *intc;

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/dma-iommu.h>
1515
#include <linux/efi.h>
1616
#include <linux/interrupt.h>
17+
#include <linux/iopoll.h>
1718
#include <linux/irqdomain.h>
1819
#include <linux/list.h>
1920
#include <linux/log2.h>
@@ -3672,6 +3673,20 @@ static int its_vpe_set_affinity(struct irq_data *d,
36723673
return IRQ_SET_MASK_OK_DONE;
36733674
}
36743675

3676+
static void its_wait_vpt_parse_complete(void)
3677+
{
3678+
void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
3679+
u64 val;
3680+
3681+
if (!gic_rdists->has_vpend_valid_dirty)
3682+
return;
3683+
3684+
WARN_ON_ONCE(readq_relaxed_poll_timeout(vlpi_base + GICR_VPENDBASER,
3685+
val,
3686+
!(val & GICR_VPENDBASER_Dirty),
3687+
10, 500));
3688+
}
3689+
36753690
static void its_vpe_schedule(struct its_vpe *vpe)
36763691
{
36773692
void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
@@ -3702,6 +3717,8 @@ static void its_vpe_schedule(struct its_vpe *vpe)
37023717
val |= vpe->idai ? GICR_VPENDBASER_IDAI : 0;
37033718
val |= GICR_VPENDBASER_Valid;
37043719
gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER);
3720+
3721+
its_wait_vpt_parse_complete();
37053722
}
37063723

37073724
static void its_vpe_deschedule(struct its_vpe *vpe)
@@ -3910,6 +3927,8 @@ static void its_vpe_4_1_schedule(struct its_vpe *vpe,
39103927
val |= FIELD_PREP(GICR_VPENDBASER_4_1_VPEID, vpe->vpe_id);
39113928

39123929
gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER);
3930+
3931+
its_wait_vpt_parse_complete();
39133932
}
39143933

39153934
static void its_vpe_4_1_deschedule(struct its_vpe *vpe,
@@ -4035,6 +4054,7 @@ static int its_sgi_set_affinity(struct irq_data *d,
40354054
* not on the host (since they can only be targetting a vPE).
40364055
* Tell the kernel we've done whatever it asked for.
40374056
*/
4057+
irq_data_update_effective_affinity(d, mask_val);
40384058
return IRQ_SET_MASK_OK;
40394059
}
40404060

drivers/irqchip/irq-gic-v3.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ static int __gic_update_rdist_properties(struct redist_region *region,
873873
gic_data.rdists.has_rvpeid &= !!(typer & GICR_TYPER_RVPEID);
874874
gic_data.rdists.has_direct_lpi &= (!!(typer & GICR_TYPER_DirectLPIS) |
875875
gic_data.rdists.has_rvpeid);
876+
gic_data.rdists.has_vpend_valid_dirty &= !!(typer & GICR_TYPER_DIRTY);
876877

877878
/* Detect non-sensical configurations */
878879
if (WARN_ON_ONCE(gic_data.rdists.has_rvpeid && !gic_data.rdists.has_vlpis)) {
@@ -893,10 +894,11 @@ static void gic_update_rdist_properties(void)
893894
if (WARN_ON(gic_data.ppi_nr == UINT_MAX))
894895
gic_data.ppi_nr = 0;
895896
pr_info("%d PPIs implemented\n", gic_data.ppi_nr);
896-
pr_info("%sVLPI support, %sdirect LPI support, %sRVPEID support\n",
897-
!gic_data.rdists.has_vlpis ? "no " : "",
898-
!gic_data.rdists.has_direct_lpi ? "no " : "",
899-
!gic_data.rdists.has_rvpeid ? "no " : "");
897+
if (gic_data.rdists.has_vlpis)
898+
pr_info("GICv4 features: %s%s%s\n",
899+
gic_data.rdists.has_direct_lpi ? "DirectLPI " : "",
900+
gic_data.rdists.has_rvpeid ? "RVPEID " : "",
901+
gic_data.rdists.has_vpend_valid_dirty ? "Valid+Dirty " : "");
900902
}
901903

902904
/* Check whether it's single security state view */
@@ -1620,6 +1622,7 @@ static int __init gic_init_bases(void __iomem *dist_base,
16201622
gic_data.rdists.has_rvpeid = true;
16211623
gic_data.rdists.has_vlpis = true;
16221624
gic_data.rdists.has_direct_lpi = true;
1625+
gic_data.rdists.has_vpend_valid_dirty = true;
16231626

16241627
if (WARN_ON(!gic_data.domain) || WARN_ON(!gic_data.rdists.rdist)) {
16251628
err = -ENOMEM;

drivers/irqchip/irq-mbigen.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,16 @@ static int mbigen_irq_domain_alloc(struct irq_domain *domain,
220220
return 0;
221221
}
222222

223+
static void mbigen_irq_domain_free(struct irq_domain *domain, unsigned int virq,
224+
unsigned int nr_irqs)
225+
{
226+
platform_msi_domain_free(domain, virq, nr_irqs);
227+
}
228+
223229
static const struct irq_domain_ops mbigen_domain_ops = {
224230
.translate = mbigen_domain_translate,
225231
.alloc = mbigen_irq_domain_alloc,
226-
.free = irq_domain_free_irqs_common,
232+
.free = mbigen_irq_domain_free,
227233
};
228234

229235
static int mbigen_of_create_domain(struct platform_device *pdev,

drivers/irqchip/irq-meson-gpio.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,17 @@ struct meson_gpio_irq_controller {
144144
static void meson_gpio_irq_update_bits(struct meson_gpio_irq_controller *ctl,
145145
unsigned int reg, u32 mask, u32 val)
146146
{
147+
unsigned long flags;
147148
u32 tmp;
148149

150+
spin_lock_irqsave(&ctl->lock, flags);
151+
149152
tmp = readl_relaxed(ctl->base + reg);
150153
tmp &= ~mask;
151154
tmp |= val;
152155
writel_relaxed(tmp, ctl->base + reg);
156+
157+
spin_unlock_irqrestore(&ctl->lock, flags);
153158
}
154159

155160
static void meson_gpio_irq_init_dummy(struct meson_gpio_irq_controller *ctl)
@@ -196,21 +201,24 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_controller *ctl,
196201
unsigned long hwirq,
197202
u32 **channel_hwirq)
198203
{
204+
unsigned long flags;
199205
unsigned int idx;
200206

201-
spin_lock(&ctl->lock);
207+
spin_lock_irqsave(&ctl->lock, flags);
202208

203209
/* Find a free channel */
204210
idx = find_first_zero_bit(ctl->channel_map, NUM_CHANNEL);
205211
if (idx >= NUM_CHANNEL) {
206-
spin_unlock(&ctl->lock);
212+
spin_unlock_irqrestore(&ctl->lock, flags);
207213
pr_err("No channel available\n");
208214
return -ENOSPC;
209215
}
210216

211217
/* Mark the channel as used */
212218
set_bit(idx, ctl->channel_map);
213219

220+
spin_unlock_irqrestore(&ctl->lock, flags);
221+
214222
/*
215223
* Setup the mux of the channel to route the signal of the pad
216224
* to the appropriate input of the GIC
@@ -225,8 +233,6 @@ meson_gpio_irq_request_channel(struct meson_gpio_irq_controller *ctl,
225233
*/
226234
*channel_hwirq = &(ctl->channel_irqs[idx]);
227235

228-
spin_unlock(&ctl->lock);
229-
230236
pr_debug("hwirq %lu assigned to channel %d - irq %u\n",
231237
hwirq, idx, **channel_hwirq);
232238

@@ -287,13 +293,9 @@ static int meson_gpio_irq_type_setup(struct meson_gpio_irq_controller *ctl,
287293
val |= REG_EDGE_POL_LOW(params, idx);
288294
}
289295

290-
spin_lock(&ctl->lock);
291-
292296
meson_gpio_irq_update_bits(ctl, REG_EDGE_POL,
293297
REG_EDGE_POL_MASK(params, idx), val);
294298

295-
spin_unlock(&ctl->lock);
296-
297299
return 0;
298300
}
299301

drivers/irqchip/irq-mvebu-icu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct mvebu_icu_irq_data {
6666
unsigned int type;
6767
};
6868

69-
DEFINE_STATIC_KEY_FALSE(legacy_bindings);
69+
static DEFINE_STATIC_KEY_FALSE(legacy_bindings);
7070

7171
static void mvebu_icu_init(struct mvebu_icu *icu,
7272
struct mvebu_icu_msi_data *msi_data,

drivers/irqchip/irq-sifive-plic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#define CONTEXT_THRESHOLD 0x00
5757
#define CONTEXT_CLAIM 0x04
5858

59-
#define PLIC_DISABLE_THRESHOLD 0xf
59+
#define PLIC_DISABLE_THRESHOLD 0x7
6060
#define PLIC_ENABLE_THRESHOLD 0
6161

6262
struct plic_priv {

drivers/irqchip/irq-ti-sci-inta.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#define VINT_ENABLE_SET_OFFSET 0x0
3838
#define VINT_ENABLE_CLR_OFFSET 0x8
3939
#define VINT_STATUS_OFFSET 0x18
40+
#define VINT_STATUS_MASKED_OFFSET 0x20
4041

4142
/**
4243
* struct ti_sci_inta_event_desc - Description of an event coming to
@@ -116,7 +117,7 @@ static void ti_sci_inta_irq_handler(struct irq_desc *desc)
116117
chained_irq_enter(irq_desc_get_chip(desc), desc);
117118

118119
val = readq_relaxed(inta->base + vint_desc->vint_id * 0x1000 +
119-
VINT_STATUS_OFFSET);
120+
VINT_STATUS_MASKED_OFFSET);
120121

121122
for_each_set_bit(bit, &val, MAX_EVENTS_PER_VINT) {
122123
virq = irq_find_mapping(domain, vint_desc->events[bit].hwirq);

include/linux/irq.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,6 @@ enum {
573573
#define IRQ_DEFAULT_INIT_FLAGS ARCH_IRQ_INIT_FLAGS
574574

575575
struct irqaction;
576-
extern int setup_irq(unsigned int irq, struct irqaction *new);
577-
extern void remove_irq(unsigned int irq, struct irqaction *act);
578576
extern int setup_percpu_irq(unsigned int irq, struct irqaction *new);
579577
extern void remove_percpu_irq(unsigned int irq, struct irqaction *act);
580578

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243

244244
#define GICR_TYPER_PLPIS (1U << 0)
245245
#define GICR_TYPER_VLPIS (1U << 1)
246+
#define GICR_TYPER_DIRTY (1U << 2)
246247
#define GICR_TYPER_DirectLPIS (1U << 3)
247248
#define GICR_TYPER_LAST (1U << 4)
248249
#define GICR_TYPER_RVPEID (1U << 7)
@@ -686,6 +687,7 @@ struct rdists {
686687
bool has_vlpis;
687688
bool has_rvpeid;
688689
bool has_direct_lpi;
690+
bool has_vpend_valid_dirty;
689691
};
690692

691693
struct irq_domain;

0 commit comments

Comments
 (0)