Skip to content

Commit 7218be3

Browse files
Chun-Kuang HuAngeloGioacchino Del Regno
authored andcommitted
soc: mediatek: cmdq: Rename cmdq_pkt_jump() to cmdq_pkt_jump_abs()
In order to distinguish absolute jump and relative jump, cmdq_pkt_jump() append absolute jump command, so rename it to cmdq_pkt_jump_abs(). Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20240222154120.16959-4-chunkuang.hu@kernel.org [Angelo: Added temporary wrapper to avoid build breakage] Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
1 parent ade1765 commit 7218be3

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

drivers/soc/mediatek/mtk-cmdq-helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value)
393393
}
394394
EXPORT_SYMBOL(cmdq_pkt_assign);
395395

396-
int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
396+
int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
397397
{
398398
struct cmdq_instruction inst = {};
399399

@@ -402,7 +402,7 @@ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
402402
inst.value = addr >> shift_pa;
403403
return cmdq_pkt_append_command(pkt, inst);
404404
}
405-
EXPORT_SYMBOL(cmdq_pkt_jump);
405+
EXPORT_SYMBOL(cmdq_pkt_jump_abs);
406406

407407
int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
408408
{

include/linux/soc/mediatek/mtk-cmdq.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,24 @@ int cmdq_pkt_poll_mask(struct cmdq_pkt *pkt, u8 subsys,
248248
int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value);
249249

250250
/**
251-
* cmdq_pkt_jump() - Append jump command to the CMDQ packet, ask GCE
252-
* to execute an instruction that change current thread PC to
253-
* a physical address which should contains more instruction.
251+
* cmdq_pkt_jump_abs() - Append jump command to the CMDQ packet, ask GCE
252+
* to execute an instruction that change current thread
253+
* PC to a absolute physical address which should
254+
* contains more instruction.
254255
* @pkt: the CMDQ packet
255-
* @addr: physical address of target instruction buffer
256+
* @addr: absolute physical address of target instruction buffer
256257
* @shift_pa: shift bits of physical address in CMDQ instruction. This value
257258
* is got by cmdq_get_shift_pa().
258259
*
259260
* Return: 0 for success; else the error code is returned
260261
*/
261-
int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa);
262+
int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa);
263+
264+
/* This wrapper has to be removed after all users migrated to jump_abs */
265+
static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
266+
{
267+
return cmdq_pkt_jump_abs(pkt, addr, shift_pa);
268+
}
262269

263270
/**
264271
* cmdq_pkt_finalize() - Append EOC and jump command to pkt.
@@ -376,6 +383,11 @@ static inline int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value)
376383
return -EINVAL;
377384
}
378385

386+
static inline int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
387+
{
388+
return -EINVAL;
389+
}
390+
379391
static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
380392
{
381393
return -EINVAL;

0 commit comments

Comments
 (0)