All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/6] drm/i915: Propagating correct error codes to the userspace
Date: Fri, 9 Oct 2015 16:13:24 +0100	[thread overview]
Message-ID: <5617D994.7030004@intel.com> (raw)
In-Reply-To: <561643F5.1050308@linux.intel.com>

On 08/10/15 11:22, Tvrtko Ursulin wrote:
>
> Hi,
>
> On 08/10/15 07:24, ankitprasad.r.sharma@intel.com wrote:
>> From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
>>
>> Propagating correct error codes to userspace by using ERR_PTR and
>> PTR_ERR macros for stolen memory based object allocation. We generally
>> return -ENOMEM to the user whenever there is a failure in object
>> allocation. This patch helps user to identify the correct reason for the
>> failure and not just -ENOMEM each time.
>>
>> v2: Moved the patch up in the series, added error propagation for
>> i915_gem_alloc_object too (Chris)
>>
>> Signed-off-by: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_gem.c              | 15 +++++-----
>>   drivers/gpu/drm/i915/i915_gem_batch_pool.c   |  4 +--
>>   drivers/gpu/drm/i915/i915_gem_context.c      |  4 +--
>>   drivers/gpu/drm/i915/i915_gem_render_state.c |  4 +--
>>   drivers/gpu/drm/i915/i915_gem_stolen.c       | 43
>> ++++++++++++++++------------
>>   drivers/gpu/drm/i915/i915_guc_submission.c   |  4 +--
>>   drivers/gpu/drm/i915/intel_display.c         |  2 +-
>>   drivers/gpu/drm/i915/intel_fbdev.c           |  6 ++--
>>   drivers/gpu/drm/i915/intel_lrc.c             |  8 +++---
>>   drivers/gpu/drm/i915/intel_overlay.c         |  4 +--
>>   drivers/gpu/drm/i915/intel_pm.c              |  2 +-
>>   drivers/gpu/drm/i915/intel_ringbuffer.c      | 20 ++++++-------
>>   12 files changed, 61 insertions(+), 55 deletions(-)

[snip]

>> diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c
>> b/drivers/gpu/drm/i915/i915_guc_submission.c
>> index 792d0b9..3901698 100644
>> --- a/drivers/gpu/drm/i915/i915_guc_submission.c
>> +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
>> @@ -646,8 +646,8 @@ static struct drm_i915_gem_object
>> *gem_allocate_guc_obj(struct drm_device *dev,
>>       struct drm_i915_gem_object *obj;
>>
>>       obj = i915_gem_alloc_object(dev, size);
>> -    if (!obj)
>> -        return NULL;
>> +    if (IS_ERR(obj))
>> +        return obj;
>
> You have to change kerneldoc for this function now.
> And even more importantly update error handling in the callers!

Or more simply, stop propagating the specific error at this level (it 
doesn't really help and probably can't even happen here), making this:

 >>       obj = i915_gem_alloc_object(dev, size);
 >> -    if (!obj)
 >> +    if (IS_ERR(obj))

leaving the "return NULL;" unchanged.

.Dave.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-10-09 15:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08  6:24 [PATCH v8 0/6] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-10-08  6:24 ` [PATCH 1/6] drm/i915: Clearing buffer objects via CPU/GTT ankitprasad.r.sharma
2015-10-08  6:24 ` [PATCH 2/6] drm/i915: Support for creating Stolen memory backed objects ankitprasad.r.sharma
2015-10-08  6:24 ` [PATCH 3/6] drm/i915: Propagating correct error codes to the userspace ankitprasad.r.sharma
2015-10-08 10:22   ` Tvrtko Ursulin
2015-10-09 15:13     ` Dave Gordon [this message]
2015-10-08 10:49   ` Chris Wilson
2015-10-08  6:24 ` [PATCH 4/6] drm/i915: Add support for stealing purgable stolen pages ankitprasad.r.sharma
2015-10-08 10:43   ` Tvrtko Ursulin
2015-10-08 11:09     ` Chris Wilson
2015-10-08 14:31       ` Tvrtko Ursulin
2015-10-08 15:08         ` Chris Wilson
2015-10-09  8:13           ` Daniel Vetter
2015-10-09  8:11     ` Daniel Vetter
2015-10-08  6:24 ` [PATCH 5/6] drm/i915: Support for pread/pwrite from/to non shmem backed objects ankitprasad.r.sharma
2015-10-08 13:56   ` Tvrtko Ursulin
2015-10-28 11:18     ` Ankitprasad Sharma
2015-10-08  6:24 ` [PATCH 6/6] drm/i915: Migrate stolen objects before hibernation ankitprasad.r.sharma
2015-10-08 11:02   ` Chris Wilson
2015-10-13  5:25     ` Ankitprasad Sharma
2015-10-28 11:22     ` Ankitprasad Sharma
2015-11-11 10:36 [PATCH v9 0/6] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-11-11 10:36 ` [PATCH 3/6] drm/i915: Propagating correct error codes to the userspace ankitprasad.r.sharma
2015-11-11 12:12   ` Chris Wilson
2015-12-09 12:46 [PATCH v10 0/6] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-12-09 12:46 ` [PATCH 3/6] drm/i915: Propagating correct error codes to the userspace ankitprasad.r.sharma
2015-12-09 15:10   ` Tvrtko Ursulin

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=5617D994.7030004@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=intel-gfx@lists.freedesktop.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.