[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ef1d901e-2bb9-46ec-b071-557c474587fe@collabora.com>
Date: Thu, 7 Mar 2024 11:33:06 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: "Jason-JH.Lin" <jason-jh.lin@...iatek.com>,
Jassi Brar <jassisinghbrar@...il.com>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>
Cc: Jason-ch Chen <jason-ch.chen@...iatek.com>,
Singo Chang <singo.chang@...iatek.com>, Nancy Lin <nancy.lin@...iatek.com>,
Shawn Sung <shawn.sung@...iatek.com>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
Project_Global_Chrome_Upstream_Group@...iatek.com
Subject: Re: [PATCH v2 4/4] soc: mediatek: mtk-cmdq: Add
cmdq_pkt_acquire_event() function
Il 07/03/24 02:34, Jason-JH.Lin ha scritto:
> 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@...iatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Powered by blists - more mailing lists