Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions arch/riscv/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
struct seq_file;
extern unsigned long boot_cpu_hartid;

enum ipi_message_type {
IPI_RESCHEDULE,
IPI_CALL_FUNC,
IPI_CPU_STOP,
IPI_CPU_CRASH_STOP,
IPI_IRQ_WORK,
IPI_TIMER,
IPI_CPU_BACKTRACE,
IPI_KGDB_ROUNDUP,
IPI_MAX
};

#ifdef CONFIG_SMP

#include <linux/jump_label.h>
Expand Down
4 changes: 2 additions & 2 deletions arch/riscv/kernel/sbi-ipi.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void __init sbi_ipi_init(void)
return;
}

virq = ipi_mux_create(BITS_PER_BYTE, sbi_send_ipi);
virq = ipi_mux_create(IPI_MAX, sbi_send_ipi);
if (virq <= 0) {
pr_err("unable to create muxed IPIs\n");
irq_dispose_mapping(sbi_ipi_virq);
Expand All @@ -75,7 +75,7 @@ void __init sbi_ipi_init(void)
"irqchip/sbi-ipi:starting",
sbi_ipi_starting_cpu, NULL);

riscv_ipi_set_virq_range(virq, BITS_PER_BYTE);
riscv_ipi_set_virq_range(virq, IPI_MAX);
pr_info("providing IPIs using SBI IPI extension\n");

/*
Expand Down
12 changes: 0 additions & 12 deletions arch/riscv/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@
#include <asm/cacheflush.h>
#include <asm/cpu_ops.h>

enum ipi_message_type {
IPI_RESCHEDULE,
IPI_CALL_FUNC,
IPI_CPU_STOP,
IPI_CPU_CRASH_STOP,
IPI_IRQ_WORK,
IPI_TIMER,
IPI_CPU_BACKTRACE,
IPI_KGDB_ROUNDUP,
IPI_MAX
};

static const char * const ipi_names[] = {
[IPI_RESCHEDULE] = "Rescheduling interrupts",
[IPI_CALL_FUNC] = "Function call interrupts",
Expand Down
4 changes: 2 additions & 2 deletions drivers/clocksource/timer-clint.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ static int __init clint_timer_init_dt(struct device_node *np)
}

#ifdef CONFIG_SMP
rc = ipi_mux_create(BITS_PER_BYTE, clint_send_ipi);
rc = ipi_mux_create(IPI_MAX, clint_send_ipi);
if (rc <= 0) {
pr_err("unable to create muxed IPIs\n");
rc = (rc < 0) ? rc : -ENODEV;
goto fail_free_irq;
}

irq_set_chained_handler(clint_ipi_irq, clint_ipi_interrupt);
riscv_ipi_set_virq_range(rc, BITS_PER_BYTE);
riscv_ipi_set_virq_range(rc, IPI_MAX);
clint_clear_ipi();
#endif

Expand Down
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-aclint-sswi.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int __init aclint_sswi_probe(struct fwnode_handle *fwnode)
}

/* Register SSWI irq and handler */
virq = ipi_mux_create(BITS_PER_BYTE, aclint_sswi_ipi_send);
virq = ipi_mux_create(IPI_MAX, aclint_sswi_ipi_send);
if (virq <= 0) {
pr_err("unable to create muxed IPIs\n");
irq_dispose_mapping(sswi_ipi_virq);
Expand All @@ -152,7 +152,7 @@ static int __init aclint_sswi_probe(struct fwnode_handle *fwnode)
aclint_sswi_starting_cpu,
aclint_sswi_dying_cpu);

riscv_ipi_set_virq_range(virq, BITS_PER_BYTE);
riscv_ipi_set_virq_range(virq, IPI_MAX);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-riscv-imsic-early.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ static int __init imsic_ipi_domain_init(void)
return 0;

/* Create IMSIC IPI multiplexing */
virq = ipi_mux_create(IMSIC_NR_IPI, imsic_ipi_send);
virq = ipi_mux_create(IPI_MAX, imsic_ipi_send);
if (virq <= 0)
return virq < 0 ? virq : -ENOMEM;

/* Set vIRQ range */
riscv_ipi_set_virq_range(virq, IMSIC_NR_IPI);
riscv_ipi_set_virq_range(virq, IPI_MAX);

/* Announce that IMSIC is providing IPIs */
pr_info("%pfwP: providing IPIs using interrupt %d\n", imsic->fwnode, IMSIC_IPI_ID);
Expand Down
1 change: 0 additions & 1 deletion drivers/irqchip/irq-riscv-imsic-state.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <linux/timer.h>

#define IMSIC_IPI_ID 1
#define IMSIC_NR_IPI 8

struct imsic_vector {
/* Fixed details of the vector */
Expand Down
12 changes: 6 additions & 6 deletions drivers/media/platform/mediatek/vpu/mtk_vpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ struct mtk_vpu {
struct vpu_regs reg;
struct vpu_run run;
struct vpu_wdt wdt;
struct vpu_ipi_desc ipi_desc[IPI_MAX];
struct vpu_ipi_desc ipi_desc[IPI_VPU_MAX];
struct share_obj __iomem *recv_buf;
struct share_obj __iomem *send_buf;
struct device *dev;
Expand All @@ -221,7 +221,7 @@ struct mtk_vpu {
struct mutex vpu_mutex; /* for protecting vpu data data structure */
u32 wdt_refcnt;
wait_queue_head_t ack_wq;
bool ipi_id_ack[IPI_MAX];
bool ipi_id_ack[IPI_VPU_MAX];
};

static inline void vpu_cfg_writel(struct mtk_vpu *vpu, u32 val, u32 offset)
Expand Down Expand Up @@ -296,7 +296,7 @@ int vpu_ipi_register(struct platform_device *pdev,
return -EPROBE_DEFER;
}

if (id < IPI_MAX && handler) {
if (id < IPI_VPU_MAX && handler) {
ipi_desc = vpu->ipi_desc;
ipi_desc[id].name = name;
ipi_desc[id].handler = handler;
Expand All @@ -319,7 +319,7 @@ int vpu_ipi_send(struct platform_device *pdev,
unsigned long timeout;
int ret = 0;

if (id <= IPI_VPU_INIT || id >= IPI_MAX ||
if (id <= IPI_VPU_INIT || id >= IPI_VPU_MAX ||
len > sizeof(send_obj->share_buf) || !buf) {
dev_err(vpu->dev, "failed to send ipi message\n");
return -EINVAL;
Expand Down Expand Up @@ -748,7 +748,7 @@ static void vpu_ipi_handler(struct mtk_vpu *vpu)
s32 id = readl(&rcv_obj->id);

memcpy_fromio(data, rcv_obj->share_buf, sizeof(data));
if (id < IPI_MAX && ipi_desc[id].handler) {
if (id < IPI_VPU_MAX && ipi_desc[id].handler) {
ipi_desc[id].handler(data, readl(&rcv_obj->len),
ipi_desc[id].priv);
if (id > IPI_VPU_INIT) {
Expand Down Expand Up @@ -934,7 +934,7 @@ static int mtk_vpu_probe(struct platform_device *pdev)
#ifdef CONFIG_DEBUG_FS
debugfs_remove(vpu_debugfs);
#endif
memset(vpu->ipi_desc, 0, sizeof(struct vpu_ipi_desc) * IPI_MAX);
memset(vpu->ipi_desc, 0, sizeof(struct vpu_ipi_desc) * IPI_VPU_MAX);
vpu_mutex_destroy:
mutex_destroy(&vpu->vpu_mutex);
disable_vpu_clk:
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/platform/mediatek/vpu/mtk_vpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef void (*ipi_handler_t) (void *data,
* handle VP8 video encoder job,, and vice versa.
* @IPI_MDP: The interrupt from vpu is to notify kernel to
* handle MDP (Media Data Path) job, and vice versa.
* @IPI_MAX: The maximum IPI number
* @IPI_VPU_MAX: The maximum VPU IPI number
*/

enum ipi_id {
Expand All @@ -60,7 +60,7 @@ enum ipi_id {
IPI_VENC_H264,
IPI_VENC_VP8,
IPI_MDP,
IPI_MAX,
IPI_VPU_MAX,
};

/**
Expand Down
Loading