All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Li Zhong <floridsleeves@gmail.com>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org
Cc: airlied@redhat.com, ville.syrjala@linux.intel.com,
	christian.koenig@amd.com, sumit.semwal@linaro.org,
	daniel@ffwll.ch, airlied@linux.ie,
	tvrtko.ursulin@linux.intel.com, rodrigo.vivi@intel.com,
	joonas.lahtinen@linux.intel.com,
	Li Zhong <floridsleeves@gmail.com>
Subject: Re: [PATCH v1] drivers/gpu/drm/i915/gt: Check the return value of i915_active_acquire()
Date: Mon, 19 Sep 2022 11:34:29 +0300	[thread overview]
Message-ID: <877d1zrcdm.fsf@intel.com> (raw)
In-Reply-To: <20220918220731.1026200-1-floridsleeves@gmail.com>

On Sun, 18 Sep 2022, Li Zhong <floridsleeves@gmail.com> wrote:
> i915_active_acquire() could return error when the acquire fails. Check
> and return the error code.

The commit message should explain why you don't need to do further error
handling. Or do you?

Side note, the distribution list is excessive.

BR,
Jani.


> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_timeline.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.c b/drivers/gpu/drm/i915/gt/intel_timeline.c
> index b9640212d659..d8333ab64574 100644
> --- a/drivers/gpu/drm/i915/gt/intel_timeline.c
> +++ b/drivers/gpu/drm/i915/gt/intel_timeline.c
> @@ -211,7 +211,10 @@ int intel_timeline_pin(struct intel_timeline *tl, struct i915_gem_ww_ctx *ww)
>  	GT_TRACE(tl->gt, "timeline:%llx using HWSP offset:%x\n",
>  		 tl->fence_context, tl->hwsp_offset);
>  
> -	i915_active_acquire(&tl->active);
> +	err = i915_active_acquire(&tl->active);
> +	if (err)
> +		return err;
> +
>  	if (atomic_fetch_inc(&tl->pin_count)) {
>  		i915_active_release(&tl->active);
>  		__i915_vma_unpin(tl->hwsp_ggtt);

-- 
Jani Nikula, Intel Open Source Graphics Center

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Li Zhong <floridsleeves@gmail.com>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org
Cc: tvrtko.ursulin@linux.intel.com, airlied@linux.ie,
	sumit.semwal@linaro.org, Li Zhong <floridsleeves@gmail.com>,
	rodrigo.vivi@intel.com, airlied@redhat.com,
	christian.koenig@amd.com
Subject: Re: [PATCH v1] drivers/gpu/drm/i915/gt: Check the return value of i915_active_acquire()
Date: Mon, 19 Sep 2022 11:34:29 +0300	[thread overview]
Message-ID: <877d1zrcdm.fsf@intel.com> (raw)
In-Reply-To: <20220918220731.1026200-1-floridsleeves@gmail.com>

On Sun, 18 Sep 2022, Li Zhong <floridsleeves@gmail.com> wrote:
> i915_active_acquire() could return error when the acquire fails. Check
> and return the error code.

The commit message should explain why you don't need to do further error
handling. Or do you?

Side note, the distribution list is excessive.

BR,
Jani.


> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_timeline.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.c b/drivers/gpu/drm/i915/gt/intel_timeline.c
> index b9640212d659..d8333ab64574 100644
> --- a/drivers/gpu/drm/i915/gt/intel_timeline.c
> +++ b/drivers/gpu/drm/i915/gt/intel_timeline.c
> @@ -211,7 +211,10 @@ int intel_timeline_pin(struct intel_timeline *tl, struct i915_gem_ww_ctx *ww)
>  	GT_TRACE(tl->gt, "timeline:%llx using HWSP offset:%x\n",
>  		 tl->fence_context, tl->hwsp_offset);
>  
> -	i915_active_acquire(&tl->active);
> +	err = i915_active_acquire(&tl->active);
> +	if (err)
> +		return err;
> +
>  	if (atomic_fetch_inc(&tl->pin_count)) {
>  		i915_active_release(&tl->active);
>  		__i915_vma_unpin(tl->hwsp_ggtt);

-- 
Jani Nikula, Intel Open Source Graphics Center

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Li Zhong <floridsleeves@gmail.com>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org
Cc: airlied@linux.ie, sumit.semwal@linaro.org,
	Li Zhong <floridsleeves@gmail.com>,
	daniel@ffwll.ch, rodrigo.vivi@intel.com, airlied@redhat.com,
	christian.koenig@amd.com
Subject: Re: [Intel-gfx] [PATCH v1] drivers/gpu/drm/i915/gt: Check the return value of i915_active_acquire()
Date: Mon, 19 Sep 2022 11:34:29 +0300	[thread overview]
Message-ID: <877d1zrcdm.fsf@intel.com> (raw)
In-Reply-To: <20220918220731.1026200-1-floridsleeves@gmail.com>

On Sun, 18 Sep 2022, Li Zhong <floridsleeves@gmail.com> wrote:
> i915_active_acquire() could return error when the acquire fails. Check
> and return the error code.

The commit message should explain why you don't need to do further error
handling. Or do you?

Side note, the distribution list is excessive.

BR,
Jani.


> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_timeline.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.c b/drivers/gpu/drm/i915/gt/intel_timeline.c
> index b9640212d659..d8333ab64574 100644
> --- a/drivers/gpu/drm/i915/gt/intel_timeline.c
> +++ b/drivers/gpu/drm/i915/gt/intel_timeline.c
> @@ -211,7 +211,10 @@ int intel_timeline_pin(struct intel_timeline *tl, struct i915_gem_ww_ctx *ww)
>  	GT_TRACE(tl->gt, "timeline:%llx using HWSP offset:%x\n",
>  		 tl->fence_context, tl->hwsp_offset);
>  
> -	i915_active_acquire(&tl->active);
> +	err = i915_active_acquire(&tl->active);
> +	if (err)
> +		return err;
> +
>  	if (atomic_fetch_inc(&tl->pin_count)) {
>  		i915_active_release(&tl->active);
>  		__i915_vma_unpin(tl->hwsp_ggtt);

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-09-19  8:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 22:07 [PATCH v1] drivers/gpu/drm/i915/gt: Check the return value of i915_active_acquire() Li Zhong
2022-09-18 22:07 ` [Intel-gfx] " Li Zhong
2022-09-18 22:07 ` Li Zhong
2022-09-19  8:34 ` Jani Nikula [this message]
2022-09-19  8:34   ` [Intel-gfx] " Jani Nikula
2022-09-19  8:34   ` Jani Nikula
2022-09-19 19:25 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2022-09-19 19:25 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2022-09-19 19:47 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-20  1:59 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=877d1zrcdm.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=floridsleeves@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=ville.syrjala@linux.intel.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 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.