Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp424130imm; Tue, 22 May 2018 22:31:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpVtfPaBowOOwRINVeakY9W+Gash2A0H19Mz4tf1rcbRvWrW+xHSAAzhJisoKkV8unEU6dm X-Received: by 2002:a63:375d:: with SMTP id g29-v6mr1166279pgn.413.1527053488412; Tue, 22 May 2018 22:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527053488; cv=none; d=google.com; s=arc-20160816; b=Ny22z0EqKe+Rnylh5l0WHZ6YNjNfPtQnXZfGg8NrcOyz13wLSTo/V0lsE7JP6bLqNB ozRfYJ8q/V4LrpXmaDGGMo03mmVTvsGHl3Qxqfw6hCmWaYTfJPBIGUPAk2w5QNaWfwmd MelGMFKv+UM+lkUVGFjOHLL1M09CYJqmysu7LpU/RHASd40zdEY7uxREnS5w479Itful fTOYGNuQ16zNlzDVtuqz7YWW0amVVaAaWqaIp3wZm9RxUAXWY9ZECKvU8oSE3kWIDvNL FVpFE6OqpScvU4fWx+WTeYOJIAD8F6uw79M+BJZJYHc8IWV1bZwNNgsOVE51PYX0EoWd wgzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=/Kp21ZMgXdAp/d9ATIekF0CddMO32AfiCaZ5I4knTWc=; b=UAEZTrEAPnhGtG9qCUDmS9CdPEXuZL0J74siewRUjdVODCb5AcCU18PE4j6lpBIZnd O4M+6kEPoB1nHyVe6K7VzPNDr//TgbzRhVqTcLCDxJ4NK2SbpDqNpzKWiAbCiXP7G7st EZJz8Gr/1agLPMlqav7zPk9d8quTLByw26hgAkGpH45FLfBw9A51oPHredAY9yj/EHYp 3qz36DGtMbqX1wCkqLK+dZOLdGkSCuZ/UOywVdKXZQ96RcvSId2ZvgqfXDaWxJAre3VU ogdmwtB6LxUaJi6QdezszEYcGC+NGgEU6BRSyCb9IqVOYbUTzRPtvbLMssFG0Lv0ZlnU YF+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=oMVTzNyM; dkim=pass header.i=@codeaurora.org header.s=default header.b=oMVTzNyM; 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 p84-v6si17870958pfa.180.2018.05.22.22.31.13; Tue, 22 May 2018 22:31:28 -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=oMVTzNyM; dkim=pass header.i=@codeaurora.org header.s=default header.b=oMVTzNyM; 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 S1754010AbeEWFbC (ORCPT + 99 others); Wed, 23 May 2018 01:31:02 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58868 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753866AbeEWFbA (ORCPT ); Wed, 23 May 2018 01:31:00 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C1E336090E; Wed, 23 May 2018 05:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527053459; bh=IcHqv3i+7Y+aLbpb+B2YmSjDi975c/as4HTuE4clwM8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oMVTzNyM+6qzSx669oFOaieMdGSFxR8IjNO39VIfeJ0eD0QkqMRv4ZppAxHv8/gSC noAZ+ha5iDrtB+0m+FNeFPkwEHoGwYJ4jeo2qCs874n80pkHMeGbOyrgY/A4enLzKo mI64I+5cXlVKQXL4QUgTAOM5PCvMXPsBiXI4SYD0= 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 mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 50AF660262; Wed, 23 May 2018 05:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527053459; bh=IcHqv3i+7Y+aLbpb+B2YmSjDi975c/as4HTuE4clwM8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oMVTzNyM+6qzSx669oFOaieMdGSFxR8IjNO39VIfeJ0eD0QkqMRv4ZppAxHv8/gSC noAZ+ha5iDrtB+0m+FNeFPkwEHoGwYJ4jeo2qCs874n80pkHMeGbOyrgY/A4enLzKo mI64I+5cXlVKQXL4QUgTAOM5PCvMXPsBiXI4SYD0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 23 May 2018 11:00:59 +0530 From: Vikash Garodia To: Stanimir Varbanov Cc: 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, linux-media-owner@vger.kernel.org Subject: Re: [PATCH 3/4] venus: add check to make scm calls In-Reply-To: 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> Message-ID: <7ec3133c8fd5599ca3cb538cddf846c4@codeaurora.org> X-Sender: vgarodia@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stan, On 2018-05-23 02:27, Stanimir Varbanov wrote: > 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. Yes, that's a good idea to abstract the decision to use tz or non-tz way as much as possible to firmware.c. Will add this in my next patch. > regards, > Stan