lkml.org 
[lkml]   [2020]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] media: hfi_venus: Request interrupt for sync cmds
From
Date


On 11/25/20 10:08 AM, Alexandre Courbot wrote:
> On Fri, Nov 20, 2020 at 9:12 AM Stanimir Varbanov
> <stanimir.varbanov@linaro.org> wrote:
>>
>> From: Vikash Garodia <vgarodia@codeaurora.org>
>>
>> For synchronous commands, update the message queue variable.
>> This would inform video firmware to raise interrupt on host
>> CPU whenever there is a response for such commands.
>>
>> Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
>> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
>> ---
>> drivers/media/platform/qcom/venus/hfi_venus.c | 74 ++++++++++---------
>> 1 file changed, 41 insertions(+), 33 deletions(-)
>>
>> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
>> index 4be4a75ddcb6..b8fdb464ba9c 100644
>> --- a/drivers/media/platform/qcom/venus/hfi_venus.c
>> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c
>> @@ -372,7 +372,7 @@ static void venus_soft_int(struct venus_hfi_device *hdev)
>> }
>>
>> static int venus_iface_cmdq_write_nolock(struct venus_hfi_device *hdev,
>> - void *pkt)
>> + void *pkt, bool sync)
>> {
>> struct device *dev = hdev->core->dev;
>> struct hfi_pkt_hdr *cmd_packet;
>> @@ -397,15 +397,23 @@ static int venus_iface_cmdq_write_nolock(struct venus_hfi_device *hdev,
>> if (rx_req)
>> venus_soft_int(hdev);
>>
>> + /* Inform video firmware to raise interrupt for synchronous commands */
>> + queue = &hdev->queues[IFACEQ_MSG_IDX];
>> + if (sync) {
>> + queue->qhdr->rx_req = 1;
>> + /* ensure rx_req is updated in memory */
>> + wmb();
>> + }
>
> Wouldn't it be safer to do this before calling venus_soft_int()? I
> don't know what the firmware is supposed to do with rx_req but
> intuitively it looks like it should be set before we signal it.
>

I'll leave Vikash to comment. IMO this is a good suggestion.

<cut>

--
regards,
Stan

\
 
 \ /
  Last update: 2020-11-25 14:06    [W:0.125 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site