public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Das, Nirmoy" <nirmoy.das@linux.intel.com>
To: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>,
	thomas.hellstrom@linux.intel.com, matthew.auld@intel.com,
	chris@chris-wilson.co.uk
Subject: Re: [Intel-gfx] [PATCH 5/6] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large
Date: Wed, 15 Jun 2022 17:54:31 +0200	[thread overview]
Message-ID: <13125ed8-5881-be96-8a0f-955fd6dd75ce@linux.intel.com> (raw)
In-Reply-To: <20220603093830.1529520-6-gwan-gyeong.mun@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1978 bytes --]

Hi Gwan-gyeong,

On 6/3/2022 11:38 AM, Gwan-gyeong Mun wrote:
> The ttm_bo_init_reserved() functions returns -ENOSPC if the size is too big
> to add vma. The direct function that returns -ENOSPC is drm_mm_insert_node_in_range().
> To handle the same error as other code returning -E2BIG when the size is
> too large, it converts return value to -E2BIG.
>
> Signed-off-by: Gwan-gyeong Mun<gwan-gyeong.mun@intel.com>
> Cc: Chris Wilson<chris@chris-wilson.co.uk>
> Cc: Matthew Auld<matthew.auld@intel.com>
> Cc: Thomas Hellström<thomas.hellstrom@linux.intel.com>
> Testcase: igt@gem_create@create-massive
> Closes:https://gitlab.freedesktop.org/drm/intel/-/issues/4991

This "Closes" tag should move to the last patch as you are removing the 
|GEM_WARN_ON() from there.|

|The series is ||Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> once 
Jani's  concern is
|

|addressed and this series can go as it is.|

|
|

|Thanks,|

|Nirmoy |

||

||

> ---
>   drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index 8231a6fc5437..f162e2492cd3 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -1243,6 +1243,17 @@ int __i915_gem_ttm_object_init(struct intel_memory_region *mem,
>   				   bo_type, &i915_sys_placement,
>   				   page_size >> PAGE_SHIFT,
>   				   &ctx, NULL, NULL, i915_ttm_bo_destroy);
> +
> +	/*
> +	 * XXX: The ttm_bo_init_reserved() functions returns -ENOSPC if the size
> +	 * is too big to add vma. The direct function that returns -ENOSPC is
> +	 * drm_mm_insert_node_in_range(). To handle the same error as other code
> +	 * that returns -E2BIG when the size is too large, it converts -ENOSPC to
> +	 * -E2BIG.
> +	 */
> +	if (size >> PAGE_SHIFT > INT_MAX && ret == -ENOSPC)
> +		ret = -E2BIG;
> +
>   	if (ret)
>   		return i915_ttm_err_to_gem(ret);
>   

[-- Attachment #2: Type: text/html, Size: 39727 bytes --]

  reply	other threads:[~2022-06-15 15:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03  9:38 [Intel-gfx] [PATCH 0/6] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation Gwan-gyeong Mun
2022-06-03  9:38 ` [Intel-gfx] [PATCH 1/6] drm/i915/gem: Typecheck page lookups Gwan-gyeong Mun
2022-06-03  9:38 ` [Intel-gfx] [PATCH 2/6] drm/i915: Check for integer truncation on scatterlist creation Gwan-gyeong Mun
2022-06-03  9:38 ` [Intel-gfx] [PATCH 3/6] drm/i915: Check for integer truncation on the configuration of ttm place Gwan-gyeong Mun
2022-06-03  9:38 ` [Intel-gfx] [PATCH 4/6] drm/i915: Check if the size is too big while creating shmem file Gwan-gyeong Mun
2022-06-03  9:38 ` [Intel-gfx] [PATCH 5/6] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large Gwan-gyeong Mun
2022-06-15 15:54   ` Das, Nirmoy [this message]
2022-06-03  9:38 ` [Intel-gfx] [PATCH 6/6] drm/i915: Remove truncation warning for large objects Gwan-gyeong Mun
2022-06-03 10:31 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation (rev2) Patchwork
2022-06-03 10:31 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-06-03 12:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-06-03 13:19 ` [Intel-gfx] [PATCH 0/6] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation Jani Nikula
2022-06-14  8:49   ` Gwan-gyeong Mun
2022-06-03 14:33 ` [Intel-gfx] ✓ Fi.CI.IGT: success for Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-06-03  9:24 [Intel-gfx] [PATCH 0/6] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation Gwan-gyeong Mun
2022-06-03  9:24 ` [Intel-gfx] [PATCH 5/6] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large Gwan-gyeong Mun

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=13125ed8-5881-be96-8a0f-955fd6dd75ce@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=gwan-gyeong.mun@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=matthew.auld@intel.com \
    --cc=thomas.hellstrom@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