Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp57782imm; Tue, 22 May 2018 13:59:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr2xxgxfdRFW2sRAJiDF2HBY+MD5lkRXSriZXCufckYkHL7fd38xi+8tI6yqVL3+x2DBPHb X-Received: by 2002:a62:4c53:: with SMTP id z80-v6mr37625pfa.181.1527022770057; Tue, 22 May 2018 13:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527022770; cv=none; d=google.com; s=arc-20160816; b=x8S4h4cJZOQHHp+sNEhs0TkBBs1kWdnDgqUfK4L+Y71xjUbks5tzJ5MlUahyRHEUag 39dI/Cxv4MiGLoxomIrb5cXT3FTEaJHBxy27BJ1e7HXlddt5T+LYtURjg45ZRRHfze5M wMRqRdkYy9RyfpuklYITrAXAh8qP0JN0TwLnaZ/2fpVizMt3VwEMtovmG7Dq6z5eqvtT hjZ/V/wXxyI7AVyf1CU/HSOXMv9/mz1U7HQf2X6P7Mam74fR8Fai0AnP+URKpHqhHPNH kH1xj4W8pTQnVt3JdhJKxKRCw18mzlQFlKI/qw5j8TKE7BxswQmItW5bp/srHLG3mYo2 qTyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=42qvXbxSvfmy9s5SqmcXDtMf3liRPDqlP2wNriY9YyE=; b=cHtTHy8na2DX8Wo5KPvpjOIxGy1L1N5pBnY/9ldrQLzQmpwclCEQ0I+7bYFirCaU0q 6BRoagviPxVbkAXtSBi46FsnRT4LTzdjhyxCVIHcl+Bp7ck8cVYtkGOtqfGIwUtXXhXo Y0EMvdMgWkQxd4yluhGpFOwCRHPgjZLaQ1bfAsMpc1oCf2V8s4xX0KIC/osSTIiRAy3h 7zNTCGdHv6xG0fBWPpzGWoqn3nnhnKMtoMQ5CXEXsw/XFs8xXbQ6ZQmgzGsZ0YG1P0+a OZTQ87Xx8Xzg6cpZBzm08tLQ0Sdf0VJqJAMydfXkUFJOjSXaTnJSORrt5Gvr4W1kd/iS j/Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BfvoZn8D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q28-v6si17534340pfl.317.2018.05.22.13.59.15; Tue, 22 May 2018 13:59:30 -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=@linaro.org header.s=google header.b=BfvoZn8D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753109AbeEVU57 (ORCPT + 99 others); Tue, 22 May 2018 16:57:59 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35633 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079AbeEVU54 (ORCPT ); Tue, 22 May 2018 16:57:56 -0400 Received: by mail-wm0-f67.google.com with SMTP id o78-v6so3479642wmg.0 for ; Tue, 22 May 2018 13:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=42qvXbxSvfmy9s5SqmcXDtMf3liRPDqlP2wNriY9YyE=; b=BfvoZn8D+c/pTY/AnbMqeS5z9N1Kapioefq1eYLSLVUr0nyV2L3IJu22Oo9WdJ4xjQ lw/DkEhv8mZxsF2LwL+yCMUbNgCu3SBCHDEkRHNNEAKUhkGvdqcGfPEiy7BYW/wwm2Lc MIm8Z6sqzQxckzhdaRg6gjw1H0GYX+8oOtNDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=42qvXbxSvfmy9s5SqmcXDtMf3liRPDqlP2wNriY9YyE=; b=jy3X56TNMGWAor0Ug2k80lT0IXkoafQG/ZStGkZUpDHsBMG25sbJTK4iOZpc/qCJ+P O5z3OUtF0RwCVaOEcXUrSoSduy4Ax5AUSP5MzYRUIgn7b+TGZSgdIgk3srr9bihSXCdx 3Qiz54q5KiAYS1vuX5zj5YsyFNOrPVqM18x1TOfuEoOliHWf3W0ETSQS3rZpyr1seY/7 i/Du9Fx9rxvkH5r5OZ9fsGb9m6cvQe/6xMgM039noE7khvOGfDi5jMrof11Nd5STlpxo F+uJT9cHOi6Ik6mpII8USfYlSuMQAbs/GwLhm5Uzt3PDh/EubUJpB8tTU8KfB9/umfsT Khlw== X-Gm-Message-State: ALKqPwe43djb2P5A4dqY8xFQxHHKf9hu24nY4yWR2EOETyUzI4lYxUJE pTGclCRhs50cM0PDA2ugI1cvvg== X-Received: by 2002:a1c:c10b:: with SMTP id r11-v6mr2474249wmf.120.1527022675696; Tue, 22 May 2018 13:57:55 -0700 (PDT) Received: from [192.168.1.7] (hst-221-2.medicom.bg. [84.238.221.2]) by smtp.googlemail.com with ESMTPSA id 67-v6sm897872wmw.32.2018.05.22.13.57.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 13:57:55 -0700 (PDT) Subject: Re: [PATCH 3/4] venus: add check to make scm calls To: 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> <20180522195026.GA16550@jcrouse-lnx.qualcomm.com> From: Stanimir Varbanov Message-ID: Date: Tue, 22 May 2018 23:57:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180522195026.GA16550@jcrouse-lnx.qualcomm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jordan, On 22.05.2018 22:50, Jordan Crouse wrote: > 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. Sorry I wasn't clear, by abstract it I meant to introduce a new venus_set_state function in venus/firmware.c where we'll select tz/non-tz functions for suspend / resume depending on the configuration. regards, Stan