Skip to content

Commit

Permalink
Merge tag 'irq_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull irq fixes from Borislav Petkov:

 - Move the ->select callback to the correct ops structure in
   irq-mvebu-sei to fix some Marvell Armada platforms

 - Add a workaround for Hisilicon ITS erratum 162100801 which can cause
   some virtual interrupts to get lost

 - More platform_driver::remove() conversion

* tag 'irq_urgent_for_v6.13_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irqchip: Switch back to struct platform_driver::remove()
  irqchip/gicv3-its: Add workaround for hip09 ITS erratum 162100801
  irqchip/irq-mvebu-sei: Move misplaced select() callback to SEI CP domain
  • Loading branch information
Linus Torvalds committed Dec 1, 2024
2 parents 58ac609 + cc47268 commit 63f4993
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 24 deletions.
2 changes: 2 additions & 0 deletions Documentation/arch/arm64/silicon-errata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ stable kernels.
| Hisilicon | Hip{08,09,10,10C| #162001900 | N/A |
| | ,11} SMMU PMCG | | |
+----------------+-----------------+-----------------+-----------------------------+
| Hisilicon | Hip09 | #162100801 | HISILICON_ERRATUM_162100801 |
+----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| Qualcomm Tech. | Kryo/Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 |
+----------------+-----------------+-----------------+-----------------------------+
Expand Down
11 changes: 11 additions & 0 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,17 @@ config HISILICON_ERRATUM_161600802

If unsure, say Y.

config HISILICON_ERRATUM_162100801
bool "Hip09 162100801 erratum support"
default y
help
When enabling GICv4.1 in hip09, VMAPP will fail to clear some caches
during unmapping operation, which will cause some vSGIs lost.
To fix the issue, invalidate related vPE cache through GICR_INVALLR
after VMOVP.

If unsure, say Y.

config QCOM_FALKOR_ERRATUM_1003
bool "Falkor E1003: Incorrect translation due to ASID change"
default y
Expand Down
50 changes: 39 additions & 11 deletions drivers/irqchip/irq-gic-v3-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1)
#define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2)
#define ITS_FLAGS_FORCE_NON_SHAREABLE (1ULL << 3)
#define ITS_FLAGS_WORKAROUND_HISILICON_162100801 (1ULL << 4)

#define RD_LOCAL_LPI_ENABLED BIT(0)
#define RD_LOCAL_PENDTABLE_PREALLOCATED BIT(1)
Expand All @@ -64,6 +65,7 @@ static u32 lpi_id_bits;
#define LPI_PENDBASE_SZ ALIGN(BIT(LPI_NRBITS) / 8, SZ_64K)

static u8 __ro_after_init lpi_prop_prio;
static struct its_node *find_4_1_its(void);

/*
* Collection structure - just an ID, and a redistributor address to
Expand Down Expand Up @@ -3883,13 +3885,28 @@ static void its_vpe_db_proxy_move(struct its_vpe *vpe, int from, int to)
raw_spin_unlock_irqrestore(&vpe_proxy.lock, flags);
}

static void its_vpe_4_1_invall_locked(int cpu, struct its_vpe *vpe)
{
void __iomem *rdbase;
u64 val;

val = GICR_INVALLR_V;
val |= FIELD_PREP(GICR_INVALLR_VPEID, vpe->vpe_id);

guard(raw_spinlock)(&gic_data_rdist_cpu(cpu)->rd_lock);
rdbase = per_cpu_ptr(gic_rdists->rdist, cpu)->rd_base;
gic_write_lpir(val, rdbase + GICR_INVALLR);
wait_for_syncr(rdbase);
}

static int its_vpe_set_affinity(struct irq_data *d,
const struct cpumask *mask_val,
bool force)
{
struct its_vpe *vpe = irq_data_get_irq_chip_data(d);
unsigned int from, cpu = nr_cpu_ids;
struct cpumask *table_mask;
struct its_node *its;
unsigned long flags;

/*
Expand Down Expand Up @@ -3952,6 +3969,11 @@ static int its_vpe_set_affinity(struct irq_data *d,
vpe->col_idx = cpu;

its_send_vmovp(vpe);

its = find_4_1_its();
if (its && its->flags & ITS_FLAGS_WORKAROUND_HISILICON_162100801)
its_vpe_4_1_invall_locked(cpu, vpe);

its_vpe_db_proxy_move(vpe, from, cpu);

out:
Expand Down Expand Up @@ -4259,22 +4281,12 @@ static void its_vpe_4_1_deschedule(struct its_vpe *vpe,

static void its_vpe_4_1_invall(struct its_vpe *vpe)
{
void __iomem *rdbase;
unsigned long flags;
u64 val;
int cpu;

val = GICR_INVALLR_V;
val |= FIELD_PREP(GICR_INVALLR_VPEID, vpe->vpe_id);

/* Target the redistributor this vPE is currently known on */
cpu = vpe_to_cpuid_lock(vpe, &flags);
raw_spin_lock(&gic_data_rdist_cpu(cpu)->rd_lock);
rdbase = per_cpu_ptr(gic_rdists->rdist, cpu)->rd_base;
gic_write_lpir(val, rdbase + GICR_INVALLR);

wait_for_syncr(rdbase);
raw_spin_unlock(&gic_data_rdist_cpu(cpu)->rd_lock);
its_vpe_4_1_invall_locked(cpu, vpe);
vpe_to_cpuid_unlock(vpe, flags);
}

Expand Down Expand Up @@ -4867,6 +4879,14 @@ static bool its_set_non_coherent(void *data)
return true;
}

static bool __maybe_unused its_enable_quirk_hip09_162100801(void *data)
{
struct its_node *its = data;

its->flags |= ITS_FLAGS_WORKAROUND_HISILICON_162100801;
return true;
}

static const struct gic_quirk its_quirks[] = {
#ifdef CONFIG_CAVIUM_ERRATUM_22375
{
Expand Down Expand Up @@ -4913,6 +4933,14 @@ static const struct gic_quirk its_quirks[] = {
.init = its_enable_quirk_hip07_161600802,
},
#endif
#ifdef CONFIG_HISILICON_ERRATUM_162100801
{
.desc = "ITS: Hip09 erratum 162100801",
.iidr = 0x00051736,
.mask = 0xffffffff,
.init = its_enable_quirk_hip09_162100801,
},
#endif
#ifdef CONFIG_ROCKCHIP_ERRATUM_3588001
{
.desc = "ITS: Rockchip erratum RK3588001",
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-imgpdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ static struct platform_driver pdc_intc_driver = {
.of_match_table = pdc_intc_match,
},
.probe = pdc_intc_probe,
.remove_new = pdc_intc_remove,
.remove = pdc_intc_remove,
};

static int __init pdc_intc_init(void)
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-imx-intmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,6 @@ static struct platform_driver imx_intmux_driver = {
.pm = &imx_intmux_pm_ops,
},
.probe = imx_intmux_probe,
.remove_new = imx_intmux_remove,
.remove = imx_intmux_remove,
};
builtin_platform_driver(imx_intmux_driver);
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-imx-irqsteer.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,6 @@ static struct platform_driver imx_irqsteer_driver = {
.pm = &imx_irqsteer_pm_ops,
},
.probe = imx_irqsteer_probe,
.remove_new = imx_irqsteer_remove,
.remove = imx_irqsteer_remove,
};
builtin_platform_driver(imx_irqsteer_driver);
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-keystone.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ MODULE_DEVICE_TABLE(of, keystone_irq_dt_ids);

static struct platform_driver keystone_irq_device_driver = {
.probe = keystone_irq_probe,
.remove_new = keystone_irq_remove,
.remove = keystone_irq_remove,
.driver = {
.name = "keystone_irq",
.of_match_table = of_match_ptr(keystone_irq_dt_ids),
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-ls-scfg-msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static struct platform_driver ls_scfg_msi_driver = {
.of_match_table = ls_scfg_msi_id,
},
.probe = ls_scfg_msi_probe,
.remove_new = ls_scfg_msi_remove,
.remove = ls_scfg_msi_remove,
};

module_platform_driver(ls_scfg_msi_driver);
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-madera.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static void madera_irq_remove(struct platform_device *pdev)

static struct platform_driver madera_irq_driver = {
.probe = madera_irq_probe,
.remove_new = madera_irq_remove,
.remove = madera_irq_remove,
.driver = {
.name = "madera-irq",
.pm = &madera_irq_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-mvebu-pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ MODULE_DEVICE_TABLE(of, mvebu_pic_of_match);

static struct platform_driver mvebu_pic_driver = {
.probe = mvebu_pic_probe,
.remove_new = mvebu_pic_remove,
.remove = mvebu_pic_remove,
.driver = {
.name = "mvebu-pic",
.of_match_table = mvebu_pic_of_match,
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-mvebu-sei.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ static void mvebu_sei_domain_free(struct irq_domain *domain, unsigned int virq,
}

static const struct irq_domain_ops mvebu_sei_domain_ops = {
.select = msi_lib_irq_domain_select,
.alloc = mvebu_sei_domain_alloc,
.free = mvebu_sei_domain_free,
};
Expand Down Expand Up @@ -306,6 +305,7 @@ static void mvebu_sei_cp_domain_free(struct irq_domain *domain,
}

static const struct irq_domain_ops mvebu_sei_cp_domain_ops = {
.select = msi_lib_irq_domain_select,
.alloc = mvebu_sei_cp_domain_alloc,
.free = mvebu_sei_cp_domain_free,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-pruss-intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ static struct platform_driver pruss_intc_driver = {
.suppress_bind_attrs = true,
},
.probe = pruss_intc_probe,
.remove_new = pruss_intc_remove,
.remove = pruss_intc_remove,
};
module_platform_driver(pruss_intc_driver);

Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-renesas-intc-irqpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ static SIMPLE_DEV_PM_OPS(intc_irqpin_pm_ops, intc_irqpin_suspend, NULL);

static struct platform_driver intc_irqpin_device_driver = {
.probe = intc_irqpin_probe,
.remove_new = intc_irqpin_remove,
.remove = intc_irqpin_remove,
.driver = {
.name = "renesas_intc_irqpin",
.of_match_table = intc_irqpin_dt_ids,
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-renesas-irqc.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ MODULE_DEVICE_TABLE(of, irqc_dt_ids);

static struct platform_driver irqc_device_driver = {
.probe = irqc_probe,
.remove_new = irqc_remove,
.remove = irqc_remove,
.driver = {
.name = "renesas_irqc",
.of_match_table = irqc_dt_ids,
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-renesas-rza1.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ MODULE_DEVICE_TABLE(of, rza1_irqc_dt_ids);

static struct platform_driver rza1_irqc_device_driver = {
.probe = rza1_irqc_probe,
.remove_new = rza1_irqc_remove,
.remove = rza1_irqc_remove,
.driver = {
.name = "renesas_rza1_irqc",
.of_match_table = rza1_irqc_dt_ids,
Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-ts4800.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ MODULE_DEVICE_TABLE(of, ts4800_ic_of_match);

static struct platform_driver ts4800_ic_driver = {
.probe = ts4800_ic_probe,
.remove_new = ts4800_ic_remove,
.remove = ts4800_ic_remove,
.driver = {
.name = "ts4800-irqc",
.of_match_table = ts4800_ic_of_match,
Expand Down

0 comments on commit 63f4993

Please sign in to comment.