public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] Fix pointer tests in error-handling paths
Date: Mon, 25 Jan 2016 17:54:39 +0000	[thread overview]
Message-ID: <56A6615F.8020404@intel.com> (raw)
In-Reply-To: <20160122133431.GT16147@nuc-i3427.alporthouse.com>

On 22/01/16 13:34, Chris Wilson wrote:
> On Fri, Jan 22, 2016 at 01:17:44PM +0000, Tvrtko Ursulin wrote:
>>
>> On 22/01/16 13:01, Chris Wilson wrote:
>>> On Fri, Jan 22, 2016 at 12:19:32PM +0000, Dave Gordon wrote:
>>>> In the error-handling paths of i915_gem_do_execbuffer() and
>>>> intel_crtc_page_flip(), the local pointer-to-request variables
>>>> were expected to be either valid pointers or NULL. Since
>>>>
>>>>    2682708 drm/i915: simplify allocation of driver-internal requests
>>>>
>>>> they could also be ERR_PTR() values, so the tests need to be
>>>> updated to accommodate this case.
>>>>
>>>> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
>>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>
>>> Quick quiz, name at least testcase that exercised this code?
>>
>> gem_close_race did it for me, but can you explain the weird ERR_PTR
>> of *ffca ? :)
>
> -54
>
> That's odd. gem_close_race should be a mix of ENOENT, EINVAL iirc.
> -Chris

Assuming that's the fault address, it will actually be the sum of the 
errno mistakenly passed to i915_gem_request_cancel(), plus the offset of 
'ringbuf' in the drm_i915_gem_request structure:

void i915_gem_request_cancel(struct drm_i915_gem_request *req)
{
         intel_ring_reserved_space_cancel(req->ringbuf);

         i915_gem_request_unreference(req);
}

As it happens, 'ringbuf' is at offset 0x38 (56), so the errno was -2,
which is the expected error -ENOENT :)

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

  reply	other threads:[~2016-01-25 17:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 19:02 [PATCH v4 0/3] improve handling of the driver's default (kernel) context Dave Gordon
2016-01-19 19:02 ` [PATCH v4 1/3] drm/i915: simplify allocation of driver-internal requests Dave Gordon
2016-01-20  9:56   ` Tvrtko Ursulin
2016-01-20 10:20     ` Chris Wilson
2016-01-22 11:12   ` Tvrtko Ursulin
2016-01-22 12:19     ` [PATCH] Fix pointer tests in error-handling paths Dave Gordon
2016-01-22 13:01       ` Chris Wilson
2016-01-22 13:17         ` Tvrtko Ursulin
2016-01-22 13:34           ` Chris Wilson
2016-01-25 17:54             ` Dave Gordon [this message]
2016-01-22 13:07       ` Tvrtko Ursulin
2016-01-25 16:28         ` Daniel Vetter
2016-01-25 17:07           ` Tvrtko Ursulin
2016-01-25 17:57       ` [PATCH v2] " Dave Gordon
2016-01-27 12:33         ` Maarten Lankhorst
2016-01-27 12:41           ` Tvrtko Ursulin
2016-01-27 13:45             ` Maarten Lankhorst
2016-01-19 19:02 ` [PATCH v4 2/3] drm/i915: abolish separate per-ring default_context pointers Dave Gordon
2016-01-19 19:02 ` [PATCH v4 3/3] drm/i915: tidy up a few leftovers Dave Gordon
2016-01-20  7:49 ` ✗ Fi.CI.BAT: warning for improve handling of the driver's default (kernel) context Patchwork
2016-01-20 17:31   ` Dave Gordon
2016-01-21  8:19     ` Daniel Vetter
2016-01-21  8:21 ` [PATCH v4 0/3] " Daniel Vetter
2016-01-27 15:43 ` ✓ Fi.CI.BAT: success for improve handling of the driver's default (kernel) context (rev3) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-01-28 10:48 [PATCH] Fix pointer tests in error-handling paths Tvrtko Ursulin
2016-01-28 10:49 ` 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=56A6615F.8020404@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox