mirror_ubuntu-kernels/include/linux/soc/mediatek
Jason-JH.Lin 69ff68332d
soc: mediatek: mtk-cmdq: Add cmdq_pkt_acquire_event() function
Add cmdq_pkt_acquire_event() function to support CMDQ user making
an instruction for acquiring event.

CMDQ users can use cmdq_pkt_acquire_event() as `mutex_lock`
and cmdq_pkt_clear_event() as `mutex_unlock` to protect the global
resource modified instructions between them.

cmdq_pkt_acquire_event() would wait for event to be cleared.
After event is cleared by cmdq_pkt_clear_event() in other GCE threads,
cmdq_pkt_acquire_event() would set event and keep executing next
instruction. So the mutex would work like this:

    cmdq_pkt_acquire_event() /* mutex lock */

    /* critical secton instructions that modified global resource */

    cmdq_pkt_clear_event() /* mutex unlock */

Prevent the critical section instructions from being affected by other
GCE threads.

Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240307013458.23550-5-jason-jh.lin@mediatek.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
2024-04-23 12:16:55 +02:00
..
infracfg.h pmdomain: mediatek: Add support for MT8365 2023-10-17 11:41:42 +02:00
mtk_sip_svc.h
mtk_wed.h net: ethernet: mtk_wed: introduce hw_rro support for MT7988 2023-09-19 18:27:56 +02:00
mtk-cmdq.h soc: mediatek: mtk-cmdq: Add cmdq_pkt_acquire_event() function 2024-04-23 12:16:55 +02:00
mtk-mmsys.h soc: mediatek: Support MT8188 VDOSYS1 Padding in mtk-mmsys 2023-12-11 11:36:12 +01:00
mtk-mutex.h soc: mediatek: mutex: support MT8195 VPPSYS 2023-03-06 14:35:45 +01:00