mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikko Perttunen <cyndis@kapsi.fi>
To: Dmitry Osipenko <digetx@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] gpu: host1x: Continue CDMA execution starting with a next job
Date: Tue, 9 Oct 2018 14:10:34 +0900	[thread overview]
Message-ID: <b508bf7e-e329-b903-e851-d679bac93027@kapsi.fi> (raw)
In-Reply-To: <20180807130713.1016-4-digetx@gmail.com>

Reviewed-by: Mikko Perttnuen <mperttunen@nvidia.com>

On 07/08/2018 22.07, Dmitry Osipenko wrote:
> Currently gathers of a hung job are getting NOP'ed and a restarted CDMA
> executes the NOP'ed gathers. There shouldn't be a reason to not restart
> CDMA execution starting with a next job, avoiding the unnecessary churning
> with gathers NOP'ing.
> 
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>   drivers/gpu/host1x/cdma.c       | 23 +++++++++++------------
>   drivers/gpu/host1x/hw/cdma_hw.c | 13 -------------
>   2 files changed, 11 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c
> index 6aa6fa1498e8..9e4f01c7f663 100644
> --- a/drivers/gpu/host1x/cdma.c
> +++ b/drivers/gpu/host1x/cdma.c
> @@ -323,7 +323,7 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma,
>   {
>   	struct host1x *host1x = cdma_to_host1x(cdma);
>   	u32 restart_addr, syncpt_incrs, syncpt_val;
> -	struct host1x_job *job;
> +	struct host1x_job *job, *next_job = NULL;
>   
>   	syncpt_val = host1x_syncpt_load(cdma->timeout.syncpt);
>   
> @@ -341,8 +341,13 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma,
>   		__func__);
>   
>   	list_for_each_entry(job, &cdma->sync_queue, list) {
> -		if (syncpt_val < job->syncpt_end)
> +		if (syncpt_val < job->syncpt_end) {
> +
> +			if (!list_is_last(&job->list, &cdma->sync_queue))
> +				next_job = list_next_entry(job, list);
> +
>   			goto syncpt_incr;
> +		}
>   
>   		host1x_job_dump(dev, job);
>   	}
> @@ -355,17 +360,11 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma,
>   	/*
>   	 * Increment with CPU the remaining syncpts of a partially executed job.
>   	 *
> -	 * Syncpt increments must be done inline with the pushbuffer from a
> -	 * GATHER buffer to maintain the order (slots are modified to be a
> -	 * GATHER of syncpt incrs).
> -	 *
> -	 * Note: save in restart_addr the location where the timed out buffer
> -	 * started in the PB, so we can start the refetch from there (with the
> -	 * modified NOP-ed PB slots). This lets things appear to have completed
> -	 * properly for this buffer and resources are freed.
> +	 * CDMA will continue execution starting with the next job or will get
> +	 * into idle state.
>   	 */
> -	if (job)
> -		restart_addr = job->first_get;
> +	if (next_job)
> +		restart_addr = next_job->first_get;
>   	else
>   		restart_addr = cdma->last_pos;
>   
> diff --git a/drivers/gpu/host1x/hw/cdma_hw.c b/drivers/gpu/host1x/hw/cdma_hw.c
> index ce320534cbed..bc203532ae6d 100644
> --- a/drivers/gpu/host1x/hw/cdma_hw.c
> +++ b/drivers/gpu/host1x/hw/cdma_hw.c
> @@ -40,7 +40,6 @@ static void cdma_timeout_cpu_incr(struct host1x_cdma *cdma, u32 getptr,
>   				u32 syncpt_incrs, u32 syncval, u32 nr_slots)
>   {
>   	struct host1x *host1x = cdma_to_host1x(cdma);
> -	struct push_buffer *pb = &cdma->push_buffer;
>   	unsigned int i;
>   
>   	for (i = 0; i < syncpt_incrs; i++)
> @@ -48,18 +47,6 @@ static void cdma_timeout_cpu_incr(struct host1x_cdma *cdma, u32 getptr,
>   
>   	/* after CPU incr, ensure shadow is up to date */
>   	host1x_syncpt_load(cdma->timeout.syncpt);
> -
> -	/* NOP all the PB slots */
> -	while (nr_slots--) {
> -		u32 *p = (u32 *)(pb->mapped + getptr);
> -		*(p++) = HOST1X_OPCODE_NOP;
> -		*(p++) = HOST1X_OPCODE_NOP;
> -		dev_dbg(host1x->dev, "%s: NOP at %pad+%#x\n", __func__,
> -			&pb->dma, getptr);
> -		getptr = (getptr + 8) & (pb->size - 1);
> -	}
> -
> -	wmb();
>   }
>   
>   /*
> 

  parent reply	other threads:[~2018-10-09  5:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 13:07 [PATCH v2 0/3] host1x_cdma_update_sync_queue() clean up Dmitry Osipenko
2018-08-07 13:07 ` [PATCH v2 1/3] gpu: host1x: Cancel only job that actually got stuck Dmitry Osipenko
2018-08-07 13:07 ` [PATCH v2 2/3] gpu: host1x: Don't complete a completed job Dmitry Osipenko
2018-10-09  5:00   ` Mikko Perttunen
2018-08-07 13:07 ` [PATCH v2 3/3] gpu: host1x: Continue CDMA execution starting with a next job Dmitry Osipenko
2018-08-18 15:10   ` Dmitry Osipenko
2018-10-09  5:10   ` Mikko Perttunen [this message]
2018-10-09  9:16     ` Dmitry Osipenko

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=b508bf7e-e329-b903-e851-d679bac93027@kapsi.fi \
    --to=cyndis@kapsi.fi \
    --cc=digetx@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome