From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stanimir Varbanov Subject: Re: [PATCH v4 11/27] venus: core,helpers: add two more clocks found in Venus 4xx Date: Mon, 2 Jul 2018 17:01:17 +0300 Message-ID: References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> <20180627152725.9783-12-stanimir.varbanov@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Alexandre Courbot Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , LKML , linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Tomasz Figa List-Id: linux-arm-msm@vger.kernel.org Hi Alex, Thanks for the review! On 07/02/2018 11:45 AM, Alexandre Courbot wrote: > On Thu, Jun 28, 2018 at 12:34 AM Stanimir Varbanov > wrote: >> >> Add two more clocks for Venus 4xx in core structure and create >> a new power enable function to handle it for 3xx/4xx versions. >> >> Signed-off-by: Stanimir Varbanov >> --- >> drivers/media/platform/qcom/venus/core.h | 4 +++ >> drivers/media/platform/qcom/venus/helpers.c | 51 +++++++++++++++++++++++++++++ >> drivers/media/platform/qcom/venus/helpers.h | 2 ++ >> drivers/media/platform/qcom/venus/vdec.c | 44 ++++++++++++++++++++----- >> drivers/media/platform/qcom/venus/venc.c | 44 ++++++++++++++++++++----- >> 5 files changed, 129 insertions(+), 16 deletions(-) >> >> @@ -1131,15 +1137,21 @@ static int vdec_remove(struct platform_device *pdev) >> static __maybe_unused int vdec_runtime_suspend(struct device *dev) >> { >> struct venus_core *core = dev_get_drvdata(dev); >> + int ret; >> >> - if (core->res->hfi_version == HFI_VERSION_1XX) >> + if (IS_V1(core)) >> return 0; >> >> - writel(0, core->base + WRAPPER_VDEC_VCODEC_POWER_CONTROL); >> + ret = venus_helper_power_enable(core, VIDC_SESSION_TYPE_DEC, true); >> + >> + if (IS_V4(core)) >> + clk_disable_unprepare(core->core0_bus_clk); >> + >> clk_disable_unprepare(core->core0_clk); >> - writel(1, core->base + WRAPPER_VDEC_VCODEC_POWER_CONTROL); >> >> - return 0; >> + ret |= venus_helper_power_enable(core, VIDC_SESSION_TYPE_DEC, false); > > Is it safe to OR two potentially different error messages, at the risk > of getting a third one that is different? venus_helper_power_enable can return zero or ETIMEDOUT, but ... > > If venus_helper_power_enable() fails, shouldn't we just exit early and > signify that the suspend operation failed? > I had the same comment from Tomasz, hence maybe I'm wrong :) so I will re-work that and will exit early if error. -- regards, Stan