[PATCH v1] drm/xe/pm: Wait for lmem ready in resume

Poosa, Karthik karthik.poosa at intel.com
Mon Apr 21 11:30:23 UTC 2025


On 15-04-2025 11:01, Poosa, Karthik wrote:
>
>
> On 10-04-2025 17:36, Gupta, Anshuman wrote:
>>> -----Original Message-----
>>> From: Poosa, Karthik<karthik.poosa at intel.com>
>>> Sent: Thursday, April 10, 2025 4:31 PM
>>> To:intel-xe at lists.freedesktop.org
>>> Cc: Gupta, Anshuman<anshuman.gupta at intel.com>; Nilawar, Badal
>>> <badal.nilawar at intel.com>; Vivi, Rodrigo<rodrigo.vivi at intel.com>; Poosa,
>>> Karthik<karthik.poosa at intel.com>
>>> Subject: [PATCH v1] drm/xe/pm: Wait for lmem ready in resume
>>>
>>> Add wait for LMEM ready during system and runtime resume.
>>> This wait is there in probe and is missing during resume.
>>>
>>> Signed-off-by: Karthik Poosa<karthik.poosa at intel.com>
>>> ---
>>>   drivers/gpu/drm/xe/xe_device.c | 2 +-
>>>   drivers/gpu/drm/xe/xe_device.h | 1 +
>>>   drivers/gpu/drm/xe/xe_pm.c     | 8 ++++++++
>>>   3 files changed, 10 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
>>> index 75e753e0a682..4c0d9eb51d1f 100644
>>> --- a/drivers/gpu/drm/xe/xe_device.c
>>> +++ b/drivers/gpu/drm/xe/xe_device.c
>>> @@ -630,7 +630,7 @@ static bool verify_lmem_ready(struct xe_device *xe)
>>>   	return !!val;
>>>   }
>>>
>>> -static int wait_for_lmem_ready(struct xe_device *xe)
>>> +int wait_for_lmem_ready(struct xe_device *xe)
>>>   {
>>>   	unsigned long timeout, start;
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_device.h
>>> b/drivers/gpu/drm/xe/xe_device.h index 0bc3bc8e6803..60bc92f9ab22
>>> 100644
>>> --- a/drivers/gpu/drm/xe/xe_device.h
>>> +++ b/drivers/gpu/drm/xe/xe_device.h
>>> @@ -47,6 +47,7 @@ int xe_device_probe_early(struct xe_device *xe);  int
>>> xe_device_probe(struct xe_device *xe);  void xe_device_remove(struct
>>> xe_device *xe);  void xe_device_shutdown(struct xe_device *xe);
>>> +int wait_for_lmem_ready(struct xe_device *xe);
>>>
>>>   void xe_device_wmb(struct xe_device *xe);
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index
>>> 4e112fbacada..2e59670660c1 100644
>>> --- a/drivers/gpu/drm/xe/xe_pm.c
>>> +++ b/drivers/gpu/drm/xe/xe_pm.c
>>> @@ -182,6 +182,10 @@ int xe_pm_resume(struct xe_device *xe)
>>>   	if (err)
>>>   		return err;
>>>
>>> +	err = wait_for_lmem_ready(xe);
>> In Xe we are referring this as a vram.
>> Do  we have any spec, that document this ?
I can change the API to wait_for_vram_ready.
Although I didn't find any specific mention of this in any spec, it's 
prudent to include this wait here, as this is done in probe.
>>> +	if (err)
>>> +		goto err;
>>> +
>>>   	xe_display_pm_resume_early(xe);
>>>
>>>   	/*
>>> @@ -478,6 +482,10 @@ int xe_pm_runtime_resume(struct xe_device *xe)
>>>   		if (err)
>>>   			goto out;
>>>
>>> +		err = wait_for_lmem_ready(xe);
>>> +		if (err)
>>> +			goto out;
>>> +
>>>   		xe_display_pm_resume_early(xe);
>>>
>>>   		/*
>>> --
>>> 2.25.1


More information about the Intel-xe mailing list