All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Vikash Garodia <vgarodia@codeaurora.org>,
	hverkuil@xs4all.nl, mchehab@kernel.org, robh@kernel.org,
	mark.rutland@arm.com, andy.gross@linaro.org,
	bjorn.andersson@linaro.org, stanimir.varbanov@linaro.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	devicetree@vger.kernel.org, acourbot@chromium.org
Subject: Re: [PATCH v2 1/5] media: venus: add a routine to reset ARM9
Date: Sat, 2 Jun 2018 01:15:59 +0300	[thread overview]
Message-ID: <894ab678-bc1d-da04-b552-d53301bd3980@linaro.org> (raw)
In-Reply-To: <1527884768-22392-2-git-send-email-vgarodia@codeaurora.org>

Hi Vikash,

On  1.06.2018 23:26, Vikash Garodia wrote:
> Add a new routine to reset the ARM9 and brings it
> out of reset. This is in preparation to add PIL
> functionality in venus driver.

please squash this patch with 4/5. I don't see a reason to add a 
function which is not used. Shouldn't this produce gcc warnings?

> 
> Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
> ---
>   drivers/media/platform/qcom/venus/firmware.c     | 26 ++++++++++++++++++++++++
>   drivers/media/platform/qcom/venus/hfi_venus_io.h |  5 +++++
>   2 files changed, 31 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
> index 521d4b3..7d89b5a 100644
> --- a/drivers/media/platform/qcom/venus/firmware.c
> +++ b/drivers/media/platform/qcom/venus/firmware.c
> @@ -14,6 +14,7 @@
>   
>   #include <linux/device.h>
>   #include <linux/firmware.h>
> +#include <linux/delay.h>
>   #include <linux/kernel.h>
>   #include <linux/io.h>
>   #include <linux/of.h>
> @@ -22,11 +23,36 @@
>   #include <linux/sizes.h>
>   #include <linux/soc/qcom/mdt_loader.h>
>   
> +#include "core.h"
>   #include "firmware.h"
> +#include "hfi_venus_io.h"
>   
>   #define VENUS_PAS_ID			9
>   #define VENUS_FW_MEM_SIZE		(6 * SZ_1M)
>   
> +static void venus_reset_hw(struct venus_core *core)

can we rename this to venus_reset_cpu? reset_hw sounds like we reset 
vcodec IPs, so I think we can be more exact here.

> +{
> +	void __iomem *reg_base = core->base;

just 'base', please.

> +
> +	writel(0, reg_base + WRAPPER_FW_START_ADDR);
> +	writel(VENUS_FW_MEM_SIZE, reg_base + WRAPPER_FW_END_ADDR);
> +	writel(0, reg_base + WRAPPER_CPA_START_ADDR);
> +	writel(VENUS_FW_MEM_SIZE, reg_base + WRAPPER_CPA_END_ADDR);
> +	writel(0x0, reg_base + WRAPPER_CPU_CGC_DIS);
> +	writel(0x0, reg_base + WRAPPER_CPU_CLOCK_CONFIG);
> +
> +	/* Make sure all register writes are committed. */
> +	mb();

the comment says "register writes" hence shouldn't this be wmb? Also if 
we are going to have explicit memory barrier why not use writel_relaxed?

> +
> +	/*
> +	 * Need to wait 10 cycles of internal clocks before bringing ARM9

Do we know what is the minimum frequency of the internal ARM9 clocks? 
I.e does 1us is enough for all venus versions.

> +	 * out of reset.
> +	 */
> +	udelay(1);
> +
> +	/* Bring Arm9 out of reset */

ARM9

> +	writel_relaxed(0, reg_base + WRAPPER_A9SS_SW_RESET);

in my opinion we should have a wmb here too

regards,
Stan

  reply	other threads:[~2018-06-01 22:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 20:26 [PATCH v2 0/5] Venus updates - PIL Vikash Garodia
2018-06-01 20:26 ` [PATCH v2 1/5] media: venus: add a routine to reset ARM9 Vikash Garodia
2018-06-01 22:15   ` Stanimir Varbanov [this message]
2018-06-05 10:57     ` Vinod
2018-06-06  1:34       ` Alexandre Courbot
2018-07-04  8:35     ` Vikash Garodia
2018-06-22 23:15   ` Bjorn Andersson
2018-06-01 20:26 ` [PATCH v2 2/5] media: venus: add a routine to set venus state Vikash Garodia
2018-06-01 21:21   ` Jordan Crouse
2018-06-04 12:54     ` Tomasz Figa
2018-07-04  7:59       ` Vikash Garodia
2018-07-04  9:00         ` Tomasz Figa
2018-07-04  9:41           ` Vikash Garodia
2018-07-04 10:08             ` Tomasz Figa
2018-06-04 13:50   ` Stanimir Varbanov
2018-07-04  8:08     ` Vikash Garodia
2018-06-05 11:03   ` Vinod
2018-06-01 20:26 ` [PATCH v2 3/5] venus: add check to make scm calls Vikash Garodia
2018-06-01 21:22   ` Jordan Crouse
2018-06-04 12:58   ` Tomasz Figa
2018-06-22 23:19     ` Bjorn Andersson
2018-06-01 20:26 ` [PATCH v2 4/5] media: venus: add no TZ boot and shutdown routine Vikash Garodia
2018-06-01 21:30   ` Jordan Crouse
2018-06-04 13:09   ` Tomasz Figa
2018-06-01 20:26 ` [PATCH v2 5/5] venus: register separate driver for firmware device Vikash Garodia
2018-06-01 21:32   ` Jordan Crouse
2018-06-04 13:18   ` Tomasz Figa
2018-06-04 13:56     ` Stanimir Varbanov
2018-06-05  4:08       ` Tomasz Figa
2018-06-05  8:45         ` Stanimir Varbanov
2018-06-06  5:41           ` Tomasz Figa
2018-06-06 16:46       ` Bjorn Andersson
2018-06-05 21:07   ` Rob Herring
2018-06-06  4:46     ` Tomasz Figa
2018-06-06 12:53       ` Rob Herring
2018-06-06 13:03       ` Vikash Garodia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=894ab678-bc1d-da04-b552-d53301bd3980@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=acourbot@chromium.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=vgarodia@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.