Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1562714imm; Tue, 22 May 2018 06:06:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZopYggtEwpbIwg9EG+ZvhTcYHxiBUi7zC/gwnXI8D/76mfULkWWFfJ/9CXYeDD9Pnj4fnPK X-Received: by 2002:a62:14c3:: with SMTP id 186-v6mr24147218pfu.92.1526994366182; Tue, 22 May 2018 06:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526994366; cv=none; d=google.com; s=arc-20160816; b=bA8ll2605lnyH5mR/+8JJvDfvaRLExAD3Rt94rzhH7wBy3BAcC+vXPTkZNW8y0z4eU 81gl+AWXT+EkjORaDrMius6oroLqiGU/nbJerqekJ/JxotVSz5MkXgp58unI9ELT1C97 NnPqcAixF3vwu+SVI1IU70MsBKPZyFZvsqIkYsPpPe8ZJJujEvGieWPMPlIa6Lnw0Evn 3DKxBI841qqXWtLbM3O3RlSdiABbgMI9KtnMv+buanOrGoDWtUxb/cNxGwEJc2y1N1Pl 08vBqL7Mu7fZ5C4UwgtIKQinq+4PJq0lOWDZaGw/+gjt+NzDc/3Dmsko5ZKD8urP9c// A6uA== 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:cc:to:subject:dkim-signature :arc-authentication-results; bh=EuUv8UmDFuRYl53Z7hfvVsQQwYSWwdrJQYH13Gt8/zk=; b=IPv4Vo6if613TnC3EnEQrBmgx6LwZMXBtmnKfAvhMVRM43VIWPY5P1LgKFgK57+vTm YI74haWYQPOvNrQLJiwzdqNVcSy/iI1pfHGaelqFzy8wF/MayNKldPqmrK/CZ+vKrQTm LKooGPnmp6LhEMbJqICRA2LO0+drkSOYGihveQnLD1CYGSfzBbXdh2nTxzZNMwpHdflK hodfUttK0923evKDMZjE2Ka43n2vJ0RMLGkmWLY24EISbznMlJmMS5K+Nk/aM+XdWlIv HL8+SExljt7r3vhcfuyo0oJH5nXypAH6t67yZQeSLrYyWjlUlBBrR9nSv67G6pcnPjZO QqoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J7J21Wu+; 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 y64-v6si17148064pfj.239.2018.05.22.06.05.40; Tue, 22 May 2018 06:06:06 -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=J7J21Wu+; 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 S1751570AbeEVNFH (ORCPT + 99 others); Tue, 22 May 2018 09:05:07 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:44510 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbeEVNEz (ORCPT ); Tue, 22 May 2018 09:04:55 -0400 Received: by mail-wr0-f193.google.com with SMTP id y15-v6so20041227wrg.11 for ; Tue, 22 May 2018 06:04:55 -0700 (PDT) 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=EuUv8UmDFuRYl53Z7hfvVsQQwYSWwdrJQYH13Gt8/zk=; b=J7J21Wu+xeQgchDmWgGktETa+MU/iac8NvyUnJ80apqr0HtB9b+f1i+SMOdgOuQaeY u/uRHog9LjHZezmIS7I9PiEKLqF5Weu08P1vqeVxoDMC+9y6JZF0462EziJQyW4G1SZ6 b5p6auwMPUUgv9qj3V79nz955oZz+6HRQAptw= 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=EuUv8UmDFuRYl53Z7hfvVsQQwYSWwdrJQYH13Gt8/zk=; b=pJYwQYxVseHgsypzDmBB9sOYPkOOooLzRG/nI6cuVyLLKF4zm5/XxEYQDdmH5mkN6E dSoq1VohM+W7anuEJiUlRP2ssSdK2gpIuqEs5GMVGxuprwg85/wlmBZ8yQM4ADPybmKO bSuB6nF4S7eWGpeM/e8zvyS2Ve8W0s4zsc0EeF53tCO6LHJptVV14N91SmRgOC+S3+27 K4no9y8BrclZ1f4UI5VPxZ4/D7vbU/0YI4m4/S3MHi2KX0FrCs/pXLwToYOGnClCSBWV dGifq1dHiSyS0S+EB7TM68PYIqfLUOo5hhKlBnLFYrqOIvrjYZx9zsZJq0TcRTXUmpaB aNZg== X-Gm-Message-State: ALKqPweDuBUe8oPIJzdkFMeEhqLKxgRSH/n8gyYGJHVySy36HwUFGZQ8 CUsoAO5RRAuXlle+L2VeN5+HJg== X-Received: by 2002:adf:9201:: with SMTP id 1-v6mr15875345wrj.131.1526994294261; Tue, 22 May 2018 06:04:54 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id k30-v6sm31839747wrf.17.2018.05.22.06.04.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 06:04:52 -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 Cc: 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> From: Stanimir Varbanov Message-ID: <9d5e12b1-40bd-adab-05f0-bdb209bf0174@linaro.org> Date: Tue, 22 May 2018 16:04:51 +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: <1526556740-25494-4-git-send-email-vgarodia@codeaurora.org> Content-Type: text/plain; charset=utf-8 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 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. -- regards, Stan