Received: by 2002:ad5:54c3:0:0:0:0:0 with SMTP id k3-v6csp6369imm; Tue, 22 May 2018 12:53:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp2HMchGjEOzvKVJ27Za/iNFLwsNWT+/7EdRDVFpY1Vj4HIsn/PqmzVfL0rubGVDoI3Gmn4 X-Received: by 2002:a63:350d:: with SMTP id c13-v6mr16260862pga.426.1527018836925; Tue, 22 May 2018 12:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527018836; cv=none; d=google.com; s=arc-20160816; b=FXh5PrzmO8cXbNMmwcQtSUd1xLPOXi70yMBO+5Qhs23dCrhwzuU1VuMQjQmS380/+X 5M71gSKkTP5/TH8jdqz/ySMSrsIK1/2kwzVx0XIihEZVS41KMZ2ggDIPB4A1K+I7oVUQ 9bimSuEuH7RdHCBgfviWpyjhSVxvf0EJChnm1/rq8IgZmT8P6mrZYa7Ui+FZ7sATU5R5 Rn0k+np19giRnjyv/5f9qc7fZHyI9xvJYeav/+Uq/XPzXHdavK1omJuco8MTRWeQV9sr q9H6Y0k9xpc6DhPBguE7P+9oGK7Z7iTT0IjW8JBzXRlib4Wt3lOuK8YRZxzXONi+/4Zg xJcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=N8txPrBEiSRh7ct55DHDu8pw+SaP2AEynjA/43OE3AA=; b=cPQ/XwHNe1d3NWyjsPXx9dR//cFAcqprpI+oMGzDnrTGl5EbimK8dML+kMcc/+AJMb dNL/r+TdDMr6/hGFtjT9X9tIn7g41SQ+JSUO+JDuGWNEQnUT2Z47GlbuxU8QQf21+mNS 2TpUcJlQchw/JWiWJqA3LVk6lfo0l1zYnYQwukEMH5jCN/CZyL2/cPfViog2HjsnBNoS HabBOgLf+OvP06PRnI8ygAjj5OmQyXUaLRroemN3vE4BDXIoOkhq7mw3eikvtlYAwmPn zs93t16JXeMhYizWoFm8YhR1wuWp6b7AWDvZAPf51QHqLtfORIjm50LXUxEx/ADATZeN VclQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EkOZoqiV; dkim=pass header.i=@codeaurora.org header.s=default header.b=EkOZoqiV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2-v6si16173260pfh.346.2018.05.22.12.53.38; Tue, 22 May 2018 12:53:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EkOZoqiV; dkim=pass header.i=@codeaurora.org header.s=default header.b=EkOZoqiV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752733AbeEVTud (ORCPT + 99 others); Tue, 22 May 2018 15:50:33 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33178 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752016AbeEVTub (ORCPT ); Tue, 22 May 2018 15:50:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BFA4260262; Tue, 22 May 2018 19:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527018630; bh=Fcqm7Fr5rmXPQxYtVZ9cpxMzATa7jmDXX8iQmVAih/4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EkOZoqiV60px0vWdOMhqObzpddScmMR+kO2PumsInqyAUJE5h0b7tK8IWv5ooiK7a RP6T0Bdl/o73i6Lx8UsaCnfcTAEfb6/z11i/5f1egEDBENGoBn54YBjw5erbrHZyrO audehh+cjUtfsZEGQRnE03y6JnzGTYA9WWTyLUD4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2ADB860262; Tue, 22 May 2018 19:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527018630; bh=Fcqm7Fr5rmXPQxYtVZ9cpxMzATa7jmDXX8iQmVAih/4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EkOZoqiV60px0vWdOMhqObzpddScmMR+kO2PumsInqyAUJE5h0b7tK8IWv5ooiK7a RP6T0Bdl/o73i6Lx8UsaCnfcTAEfb6/z11i/5f1egEDBENGoBn54YBjw5erbrHZyrO audehh+cjUtfsZEGQRnE03y6JnzGTYA9WWTyLUD4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2ADB860262 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org Date: Tue, 22 May 2018 13:50:27 -0600 From: Jordan Crouse To: Stanimir Varbanov Cc: Vikash Garodia , hverkuil@xs4all.nl, mchehab@kernel.org, andy.gross@linaro.org, bjorn.andersson@linaro.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, acourbot@google.com Subject: Re: [PATCH 3/4] venus: add check to make scm calls Message-ID: <20180522195026.GA16550@jcrouse-lnx.qualcomm.com> Mail-Followup-To: Stanimir Varbanov , Vikash Garodia , hverkuil@xs4all.nl, mchehab@kernel.org, andy.gross@linaro.org, bjorn.andersson@linaro.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, acourbot@google.com References: <1526556740-25494-1-git-send-email-vgarodia@codeaurora.org> <1526556740-25494-4-git-send-email-vgarodia@codeaurora.org> <9d5e12b1-40bd-adab-05f0-bdb209bf0174@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d5e12b1-40bd-adab-05f0-bdb209bf0174@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22, 2018 at 04:04:51PM +0300, Stanimir Varbanov wrote: > Hi Vikash, > > On 05/17/2018 02:32 PM, Vikash Garodia wrote: > > In order to invoke scm calls, ensure that the platform > > has the required support to invoke the scm calls in > > secure world. This code is in preparation to add PIL > > functionality in venus driver. > > > > Signed-off-by: Vikash Garodia > > --- > > drivers/media/platform/qcom/venus/hfi_venus.c | 26 +++++++++++++++++++------- > > 1 file changed, 19 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c > > index f61d34b..9bcce94 100644 > > --- a/drivers/media/platform/qcom/venus/hfi_venus.c > > +++ b/drivers/media/platform/qcom/venus/hfi_venus.c > > @@ -27,6 +27,7 @@ > > #include "hfi_msgs.h" > > #include "hfi_venus.h" > > #include "hfi_venus_io.h" > > +#include "firmware.h" > > > > #define HFI_MASK_QHDR_TX_TYPE 0xff000000 > > #define HFI_MASK_QHDR_RX_TYPE 0x00ff0000 > > @@ -570,13 +571,19 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) > > static int venus_power_off(struct venus_hfi_device *hdev) > > { > > int ret; > > + void __iomem *reg_base; > > > > if (!hdev->power_enabled) > > return 0; > > > > - ret = qcom_scm_set_remote_state(TZBSP_VIDEO_STATE_SUSPEND, 0); > > - if (ret) > > - return ret; > > + if (qcom_scm_is_available()) { > > + ret = qcom_scm_set_remote_state(TZBSP_VIDEO_STATE_SUSPEND, 0); > > I think it will be clearer if we abstract qcom_scm_set_remote_state to > something like venus_set_state(SUSPEND|RESUME) in firmware.c and export > the functions to be used here. This specific function is a little odd because the SCM function got overloaded and used as a hardware workaround for the adreno a5xx zap shader. When we added it for the GPU we knew the day would come that we would need it for Venus so we kept the name purposely generic. You can wrap if if you want but just know that there are other non video entities out there using it. Jordan -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project