Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Francois Dugast <francois.dugast@intel.com>,
	Matthew Auld <matthew.auld@intel.com>,
	"Daniele Ceraolo Spurio" <daniele.ceraolospurio@intel.com>
Subject: Re: [PATCH v3 04/13] drm/xe: Stop ignoring errors from xe_ttm_stolen_mgr_init()
Date: Mon, 10 Feb 2025 23:35:44 +0530	[thread overview]
Message-ID: <0834da51-8b61-4224-a6fb-8b2f550643e2@intel.com> (raw)
In-Reply-To: <20250207221945.2878241-5-lucas.demarchi@intel.com>



On 08-02-2025 03:49, Lucas De Marchi wrote:
> Make sure to differentiate normal behavior, e.g. there's no stolen, from
> allocation errors or failure to initialize lower layers.
> 
> Reviewed-by: Francois Dugast <francois.dugast@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_device.c         |  4 +++-
>   drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 17 +++++++++--------
>   drivers/gpu/drm/xe/xe_ttm_stolen_mgr.h |  2 +-
>   3 files changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index ac3e344fe04ec..9c97f88bc0455 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -827,7 +827,9 @@ int xe_device_probe(struct xe_device *xe)
>   	}
>   
>   	/* Allocate and map stolen after potential VRAM resize */
> -	xe_ttm_stolen_mgr_init(xe);
> +	err = xe_ttm_stolen_mgr_init(xe);
> +	if (err)
> +		return err;
>   
>   	/*
>   	 * Now that GT is initialized (TTM in particular),
> diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
> index 423856cc18d40..e1a1200fdf22d 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
> @@ -201,17 +201,16 @@ static u64 detect_stolen(struct xe_device *xe, struct xe_ttm_stolen_mgr *mgr)
>   #endif
>   }
>   
> -void xe_ttm_stolen_mgr_init(struct xe_device *xe)
> +int xe_ttm_stolen_mgr_init(struct xe_device *xe)
>   {
> -	struct xe_ttm_stolen_mgr *mgr = drmm_kzalloc(&xe->drm, sizeof(*mgr), GFP_KERNEL);
>   	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
> +	struct xe_ttm_stolen_mgr *mgr;
>   	u64 stolen_size, io_size;
>   	int err;
>   
> -	if (!mgr) {
> -		drm_dbg_kms(&xe->drm, "Stolen mgr init failed\n");
> -		return;
> -	}
> +	mgr = drmm_kzalloc(&xe->drm, sizeof(*mgr), GFP_KERNEL);
> +	if (!mgr)
> +		return -ENOMEM;
>   
>   	if (IS_SRIOV_VF(xe))
>   		stolen_size = 0;
> @@ -224,7 +223,7 @@ void xe_ttm_stolen_mgr_init(struct xe_device *xe)
>   
>   	if (!stolen_size) {
>   		drm_dbg_kms(&xe->drm, "No stolen memory support\n");
> -		return;
> +		return 0;
>   	}
>   
>   	/*
> @@ -240,7 +239,7 @@ void xe_ttm_stolen_mgr_init(struct xe_device *xe)
>   				     io_size, PAGE_SIZE);
>   	if (err) {
>   		drm_dbg_kms(&xe->drm, "Stolen mgr init failed: %i\n", err);
> -		return;
> +		return err;
>   	}
>   
>   	drm_dbg_kms(&xe->drm, "Initialized stolen memory support with %llu bytes\n",
> @@ -248,6 +247,8 @@ void xe_ttm_stolen_mgr_init(struct xe_device *xe)
>   
>   	if (io_size)
>   		mgr->mapping = devm_ioremap_wc(&pdev->dev, mgr->io_base, io_size);
> +
> +	return 0;
>   }
>   
>   u64 xe_ttm_stolen_io_offset(struct xe_bo *bo, u32 offset)
> diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.h b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.h
> index 1777245ff8101..8e877d1e839bd 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.h
> +++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.h
> @@ -12,7 +12,7 @@ struct ttm_resource;
>   struct xe_bo;
>   struct xe_device;
>   
> -void xe_ttm_stolen_mgr_init(struct xe_device *xe);
> +int xe_ttm_stolen_mgr_init(struct xe_device *xe);

LGTM
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

>   int xe_ttm_stolen_io_mem_reserve(struct xe_device *xe, struct ttm_resource *mem);
>   bool xe_ttm_stolen_cpu_access_needs_ggtt(struct xe_device *xe);
>   u64 xe_ttm_stolen_io_offset(struct xe_bo *bo, u32 offset);


  reply	other threads:[~2025-02-10 18:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 22:19 [PATCH v3 00/13] Cleanup error handling on probe Lucas De Marchi
2025-02-07 22:19 ` [PATCH v3 01/13] drm/xe: Fix xe_display_fini() calls Lucas De Marchi
2025-02-10 17:56   ` Ghimiray, Himal Prasad
2025-02-10 19:08     ` Ghimiray, Himal Prasad
2025-02-07 22:19 ` [PATCH v3 02/13] drm/xe: Fix error handling in xe_irq_install() Lucas De Marchi
2025-02-10 17:58   ` Ghimiray, Himal Prasad
2025-02-07 22:19 ` [PATCH v3 03/13] drm/xe: Fix xe_tile_init_noalloc() error propagation Lucas De Marchi
2025-02-10  5:52   ` Upadhyay, Tejas
2025-02-10 17:59   ` Ghimiray, Himal Prasad
2025-02-07 22:19 ` [PATCH v3 04/13] drm/xe: Stop ignoring errors from xe_ttm_stolen_mgr_init() Lucas De Marchi
2025-02-10 18:05   ` Ghimiray, Himal Prasad [this message]
2025-02-07 22:19 ` [PATCH v3 05/13] drm/xe: Remove leftover pxp comment Lucas De Marchi
2025-02-07 22:19 ` [PATCH v3 06/13] drm/xe: Add callback support for driver remove Lucas De Marchi
2025-02-10 17:41   ` Rodrigo Vivi
2025-02-12  5:45     ` Lucas De Marchi
2025-02-07 22:19 ` [PATCH v3 07/13] drm/xe: Cleanup unwind of gt initialization Lucas De Marchi
2025-02-10 18:54   ` Ghimiray, Himal Prasad
2025-02-07 22:19 ` [PATCH v3 08/13] drm/xe: Cleanup extra calls to xe_hw_fence_irq_finish() Lucas De Marchi
2025-02-10 18:56   ` Ghimiray, Himal Prasad
2025-02-07 22:19 ` [PATCH v3 09/13] drm/xe/oa: Move fini to xe_oa Lucas De Marchi
2025-02-07 22:19 ` [PATCH v3 10/13] drm/xe: Move drm_dev_unplug() out of display function Lucas De Marchi
2025-02-10  5:44   ` Upadhyay, Tejas
2025-02-07 22:19 ` [PATCH v3 11/13] drm/xe/oa: Handle errors in xe_oa_register() Lucas De Marchi
2025-02-07 22:19 ` [PATCH v3 12/13] drm/xe/pmu: Fail probe if xe_pmu_register() fails Lucas De Marchi
2025-02-10 11:17   ` Upadhyay, Tejas
2025-02-10 19:00   ` Ghimiray, Himal Prasad
2025-02-07 22:19 ` [PATCH v3 13/13] drm/xe/hwmon: Stop ignoring errors on probe Lucas De Marchi
2025-02-07 22:31   ` Raag Jadav
2025-02-10  5:31   ` Nilawar, Badal
2025-02-10 15:15     ` Lucas De Marchi
2025-02-10 16:54       ` Nilawar, Badal
2025-02-07 23:42 ` ✓ CI.Patch_applied: success for Cleanup error handling on probe (rev3) Patchwork
2025-02-07 23:42 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-07 23:43 ` ✓ CI.KUnit: success " Patchwork
2025-02-08  0:00 ` ✓ CI.Build: " Patchwork
2025-02-08  0:02 ` ✓ CI.Hooks: " Patchwork
2025-02-08  0:03 ` ✓ CI.checksparse: " Patchwork
2025-02-10  6:05 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-10  6:55 ` ✗ Xe.CI.Full: 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=0834da51-8b61-4224-a6fb-8b2f550643e2@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.auld@intel.com \
    --cc=rodrigo.vivi@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