Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp355847pxu; Wed, 25 Nov 2020 05:07:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLIJzVL3ETeLrVeqzTiUtdu9bDsWCN5n7e2n/E9gCproIbYWiHCsfaRQA92zHUy6yFx0Rk X-Received: by 2002:a17:906:d1c3:: with SMTP id bs3mr2999216ejb.306.1606309659194; Wed, 25 Nov 2020 05:07:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606309659; cv=none; d=google.com; s=arc-20160816; b=RgnFyF2Cqg/K+fiXq+oEyYuV+pnC+188rmXylJgSYNyNDHe2ytNuXz3iTAyXc8VCRA 6W4fI7Mcpnwcg4vZIrkTwjMCqnkn1RQiiiG8cSYqz4VEZq3+C3J+6VUoOkX/lYzFjRbz BibOFUs51gtKruD0H4R/eFHNxFTgOfLP39tJSrCw2fgJ/bXiwXJ8UCzoJa3CvsTDi2y+ P6NOD7sf5JgBwEBrJK/zzMVOyznfEcSPjAlAfAVFbyHuSBCAtyiakwdRe6tx1BNiIfx4 MGRvJMfMgrzro23EOm8mc0bCib1DHrJwiekP8PZ2XhFSlGtRMe2dPYRBzCh0/DMurz8V bXyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=BXaJmG+wTXtQ1LIgHLXOdZkWb3psJr3hG12v2PvvxlE=; b=trNx4lWc9MHlMTAxbhE/c1NxSP1m0XIsjXagshahvY1MZmO9c5PGhnYlI2sNqmFQpO hD3BLoDgvOgP8qupa10WpVM4zgB7SHJxWNDthDASx4LPa9thsdd/JTTEE2qUfXcUEubk J4z1A8sj3IV2xnkHirqHDwJJLnZRxJK9K6E5QGYTDmZpu2D/Lg50Fdcw8W3RQrRYSHaV MquybOYP1lWHwdXE85WhE9KTgcVPL+ETXYIIlmjyTH4e79y4+iBg1Ry2epCdT8uNYe7c e58OyX+LqsSwewD+kFwaM9fYZiXTPtz8woC2j9lr2ug0OmDNZMeQW0aUWE9DRu5A2+dU N6vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tb1NODJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq14si1402523edb.207.2020.11.25.05.07.16; Wed, 25 Nov 2020 05:07:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tb1NODJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729256AbgKYNDv (ORCPT + 99 others); Wed, 25 Nov 2020 08:03:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbgKYNDu (ORCPT ); Wed, 25 Nov 2020 08:03:50 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24D6FC061A4E for ; Wed, 25 Nov 2020 05:03:50 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id m6so1834792wrg.7 for ; Wed, 25 Nov 2020 05:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BXaJmG+wTXtQ1LIgHLXOdZkWb3psJr3hG12v2PvvxlE=; b=Tb1NODJpg8kwIwdN7oQj+EV58bHxyDFPIYQMJPF4FNz9of+yAPa2kYA92zKU+hq3Uy zPV1ZmyDxYUqI5ymigRmZgnaFgok6chy6EymiPCZ5nzYcd5iQweT957e+FRN2j46+XR8 Po9Sl4pv+m1+8H9OwgBkx97tM4iOOmWHOlW9yYMtWte6kMOG3RMQxDxIoI4yuYbvv/OV yGvNeg3TlqNi/bMSi4/Odx3euErYZww+yHDozaDO63ijUqjMKeP0ij1aygvjiW4odH+G StSjnOnjf0KKV/Ir4BdTibLgYDocoeZFpmChDi33FrIFnyPazBstgFrUgprJktbqS52D 7UwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BXaJmG+wTXtQ1LIgHLXOdZkWb3psJr3hG12v2PvvxlE=; b=nnVmIcL4HhH0feaLYwN3rx/mOh34HpMtrFtuXMf849/pldE+JD9mKaG2lQnVX173Vp mf88qQibXkscxiYtME0f7oW6XyE1a/SZtk6qQID6ZTuAg6ebAvzglEpK+npWJdJYF7a8 O2B5KifFTBpINH7oanmF7k+SL8313Ppr2dC3tBpyK835PLpA8lwixgRrGK+hwIslHQH/ ZJgAhi5Z46osTS9yhVsOk0310wn/q9jpBi9zAnNYtyxL78Nk6D1GeUOVoWztK6c0slsU 0EGgue+FrIlqGbll+gSUtr5yys0PTbzceTBETNFLS+OhUYJUbAMYA87htEBEukCsrjQL 4DZw== X-Gm-Message-State: AOAM532yLbBTfD0A3KSGrWwXyPd1leeh4uKFXJR/JYhUzjJZHTGCBMia ZlRcsq3Hm9CfJmd4yCc/ZYioQg== X-Received: by 2002:adf:c702:: with SMTP id k2mr4175742wrg.156.1606309428614; Wed, 25 Nov 2020 05:03:48 -0800 (PST) Received: from [192.168.0.3] (hst-221-112.medicom.bg. [84.238.221.112]) by smtp.googlemail.com with ESMTPSA id z6sm4628966wmi.1.2020.11.25.05.03.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Nov 2020 05:03:48 -0800 (PST) Subject: Re: [PATCH 3/3] media: hfi_venus: Request interrupt for sync cmds To: Alexandre Courbot Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vikash Garodia , Mansur Alisha Shaik , Dikshita Agarwal References: <20201120001037.10032-1-stanimir.varbanov@linaro.org> <20201120001037.10032-4-stanimir.varbanov@linaro.org> From: Stanimir Varbanov Message-ID: <595f8e22-0616-ff8f-78f3-991ef94ebf65@linaro.org> Date: Wed, 25 Nov 2020 15:03:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/25/20 10:08 AM, Alexandre Courbot wrote: > On Fri, Nov 20, 2020 at 9:12 AM Stanimir Varbanov > wrote: >> >> From: Vikash Garodia >> >> 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 >> Signed-off-by: Stanimir Varbanov >> --- >> 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. -- regards, Stan