From: "Tang, CQ" <cq.tang@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Cc: "Auld, Matthew" <matthew.auld@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Onion unwind for scratch page allocation failure
Date: Mon, 19 Oct 2020 16:10:14 +0000 [thread overview]
Message-ID: <9ba0d8874027462cb2229a87decc9628@intel.com> (raw)
In-Reply-To: <20201019083444.1286-1-chris@chris-wilson.co.uk>
I fixed this problem partially (not gen6 code) with patch:
http://intel-gfx-pw.fi.intel.com/series/5911/
Should I continue to fix on internal?
--CQ
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Chris Wilson
> Sent: Monday, October 19, 2020 1:35 AM
> To: intel-gfx@lists.freedesktop.org
> Cc: Auld, Matthew <matthew.auld@intel.com>; Chris Wilson <chris@chris-
> wilson.co.uk>
> Subject: [Intel-gfx] [PATCH] drm/i915/gt: Onion unwind for scratch page
> allocation failure
>
> In switching to using objects for our ppGTT scratch pages, care was not taken
> to avoid trying to unref NULL objects on failure. And for gen6 ppGTT, it
> appears we forgot entirely to unwind after a partial allocation failure.
>
> Fixes: 89351925a477 ("drm/i915/gt: Switch to object allocations for page
> directories")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
> drivers/gpu/drm/i915/gt/gen6_ppgtt.c | 18 ++++++++++++------
> drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 3 ++-
> 2 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
> b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
> index c0d17f87b00f..680bd9442eb0 100644
> --- a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
> +++ b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
> @@ -239,18 +239,24 @@ static int gen6_ppgtt_init_scratch(struct
> gen6_ppgtt *ppgtt)
> I915_CACHE_NONE, PTE_READ_ONLY);
>
> vm->scratch[1] = vm->alloc_pt_dma(vm, I915_GTT_PAGE_SIZE_4K);
> - if (IS_ERR(vm->scratch[1]))
> - return PTR_ERR(vm->scratch[1]);
> + if (IS_ERR(vm->scratch[1])) {
> + ret = PTR_ERR(vm->scratch[1]);
> + goto err_scratch0;
> + }
>
> ret = pin_pt_dma(vm, vm->scratch[1]);
> - if (ret) {
> - i915_gem_object_put(vm->scratch[1]);
> - return ret;
> - }
> + if (ret)
> + goto err_scratch1;
>
> fill32_px(vm->scratch[1], vm->scratch[0]->encode);
>
> return 0;
> +
> +err_scratch1:
> + i915_gem_object_put(vm->scratch[1]);
> +err_scratch0:
> + i915_gem_object_put(vm->scratch[0]);
> + return ret;
> }
>
> static void gen6_ppgtt_free_pd(struct gen6_ppgtt *ppgtt) diff --git
> a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
> b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
> index b236aa046f91..a37c968ef8f7 100644
> --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
> +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
> @@ -607,7 +607,8 @@ static int gen8_init_scratch(struct i915_address_space
> *vm)
> return 0;
>
> free_scratch:
> - free_scratch(vm);
> + while (i--)
> + i915_gem_object_put(vm->scratch[i]);
> return -ENOMEM;
> }
>
> --
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2020-10-19 16:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 8:34 [Intel-gfx] [PATCH] drm/i915/gt: Onion unwind for scratch page allocation failure Chris Wilson
2020-10-19 9:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-10-19 10:51 ` [Intel-gfx] [PATCH] " Matthew Auld
2020-10-19 11:30 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2020-10-19 16:10 ` Tang, CQ [this message]
2020-10-20 16:27 ` [Intel-gfx] [PATCH] " Tang, CQ
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=9ba0d8874027462cb2229a87decc9628@intel.com \
--to=cq.tang@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@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