Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Tauro, Riana" <riana.tauro@intel.com>
To: "Upadhyay, Tejas" <tejas.upadhyay@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Cc: "Gupta, Anshuman" <anshuman.gupta@intel.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	"aravind.iddamsetty@linux.intel.com"
	<aravind.iddamsetty@linux.intel.com>,
	"Nilawar, Badal" <badal.nilawar@intel.com>,
	"Jadav, Raag" <raag.jadav@intel.com>,
	"Koppuravuri, Ravi Kishore" <ravi.kishore.koppuravuri@intel.com>,
	"Koujalagi,  Mallesh" <mallesh.koujalagi@intel.com>,
	"Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
Subject: Re: [PATCH v3 4/6] drm/xe/xe_ras: Add function to get maximum pages firmware can store
Date: Thu, 1 Oct 2026 17:10:20 +0530	[thread overview]
Message-ID: <4d153fee-64cf-4110-b5ac-0e0fe9db03fb@intel.com> (raw)
In-Reply-To: <DS0PR11MB8718AB9D11A1EA84670A835D818A2@DS0PR11MB8718.namprd11.prod.outlook.com>


On 01-10-2026 17:06, Upadhyay, Tejas wrote:
>
>> -----Original Message-----
>> From: Tauro, Riana <riana.tauro@intel.com>
>> Sent: 28 September 2026 11:49
>> To: intel-xe@lists.freedesktop.org
>> Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman
>> <anshuman.gupta@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>;
>> aravind.iddamsetty@linux.intel.com; Nilawar, Badal
>> <badal.nilawar@intel.com>; Jadav, Raag <raag.jadav@intel.com>;
>> Koppuravuri, Ravi Kishore <ravi.kishore.koppuravuri@intel.com>; Koujalagi,
>> Mallesh <mallesh.koujalagi@intel.com>; Upadhyay, Tejas
>> <tejas.upadhyay@intel.com>; Ghimiray, Himal Prasad
>> <himal.prasad.ghimiray@intel.com>
>> Subject: [PATCH v3 4/6] drm/xe/xe_ras: Add function to get maximum pages
>> firmware can store
>>
>> Add function to get maximum number of pages that firmware can store for
>> offline tracking. This will be used to report max pages to userspace.
>>
>> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
>> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
>> ---
>> v2: fix commit message (Himal)
>> ---
>>   drivers/gpu/drm/xe/xe_ras.c       | 15 +++++++++++++++
>>   drivers/gpu/drm/xe/xe_ras.h       |  1 +
>>   drivers/gpu/drm/xe/xe_ras_types.h |  2 ++
>>   3 files changed, 18 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c index
>> 9a1a8190578b..cfc7f07e9ced 100644
>> --- a/drivers/gpu/drm/xe/xe_ras.c
>> +++ b/drivers/gpu/drm/xe/xe_ras.c
>> @@ -401,9 +401,13 @@ static void get_offlined_list(struct xe_device *xe)  {
>>   	struct xe_ras_offline_list_response response = {0};
>>   	struct xe_ras_offline_list_request request = {0};
>> +	struct xe_ras_state *state = &xe->ras.state;
>>
>>   	get_offline_pages(xe, XE_SYSCTRL_CMD_GET_OFFLINE_LIST,
>> &request, sizeof(request),
>>   			  &response, sizeof(response), &response.common,
>> false);
> Isnt it better to  snapshot max_entries into a local in get_offlined_list() as soon as the first response comes back, not after the whole paginated fetch completes. I mean better to not depend on "whatever's left in resp when the function returns."

yeah i am adding this for next rev. The last response can be 0s cannot 
be guarantee to have max entries

Thanks
Riana

>   
> Tejas
>> +
>> +	if (response.max_entries)
>> +		state->max_pages = response.max_entries;
>>   }
>>
>>   static struct pci_dev *find_usp_dev(struct pci_dev *pdev) @@ -1105,6
>> +1109,17 @@ bool xe_ras_get_disable_page_offline(struct xe_device *xe)
>>   	return xe->ras.state.disable_page_offline;
>>   }
>>
>> +/**
>> + * xe_ras_get_max_pages - Get the maximum number of pages
>> + * @xe: xe device instance
>> + *
>> + * Return: Maximum number of pages that can be stored in flash  */
>> +u32 xe_ras_get_max_pages(struct xe_device *xe) {
>> +	return xe->ras.state.max_pages;
>> +}
>> +
>>   /**
>>    * xe_ras_init - Initialize Xe RAS
>>    * @xe: xe device instance
>> diff --git a/drivers/gpu/drm/xe/xe_ras.h b/drivers/gpu/drm/xe/xe_ras.h index
>> ac1253d6ead9..561c656e2ad3 100644
>> --- a/drivers/gpu/drm/xe/xe_ras.h
>> +++ b/drivers/gpu/drm/xe/xe_ras.h
>> @@ -22,5 +22,6 @@ int xe_ras_set_threshold(struct xe_device *xe, u8
>> severity, u8 component, u32 th  void xe_ras_init(struct xe_device *xe);  enum
>> xe_ras_recovery_action xe_ras_process_errors(struct xe_device *xe);  bool
>> xe_ras_get_disable_page_offline(struct xe_device *xe);
>> +u32 xe_ras_get_max_pages(struct xe_device *xe);
>>
>>   #endif
>> diff --git a/drivers/gpu/drm/xe/xe_ras_types.h
>> b/drivers/gpu/drm/xe/xe_ras_types.h
>> index 40224db38906..e09b50a6f77b 100644
>> --- a/drivers/gpu/drm/xe/xe_ras_types.h
>> +++ b/drivers/gpu/drm/xe/xe_ras_types.h
>> @@ -415,5 +415,7 @@ struct xe_ras_set_health_response {  struct
>> xe_ras_state {
>>   	/** @disable_page_offline: cached configfs policy, immutable after init
>> */
>>   	bool disable_page_offline;
>> +	/** @max_pages: Total number of pages that can be stored by
>> firmware */
>> +	u32 max_pages;
>>   };
>>   #endif
>> --
>> 2.47.1

  reply	other threads:[~2026-10-01 11:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  6:18 [PATCH v3 0/6] Add support to handle memory double-bit ecc errors Riana Tauro
2026-09-28  6:18 ` [PATCH v3 1/6] drm/xe/xe_ras: Handle page offline requests for device memory " Riana Tauro
2026-09-28  6:34   ` sashiko-bot
2026-09-28  8:55   ` Ghimiray, Himal Prasad
2026-10-01 10:50   ` Upadhyay, Tejas
2026-10-01 11:27     ` Tauro, Riana
2026-09-28  6:18 ` [PATCH v3 2/6] drm/xe/xe_ras: Add support to query page offline queue and list Riana Tauro
2026-09-28  6:35   ` sashiko-bot
2026-10-01 11:24   ` Upadhyay, Tejas
2026-10-01 11:37     ` Tauro, Riana
2026-10-01 12:11   ` Ghimiray, Himal Prasad
2026-09-28  6:18 ` [PATCH v3 3/6] drm/xe: Separate drm-ras netlink data from device and firmware RAS state Riana Tauro
2026-09-28  6:51   ` sashiko-bot
2026-09-28  8:59   ` Ghimiray, Himal Prasad
2026-09-28  6:18 ` [PATCH v3 4/6] drm/xe/xe_ras: Add function to get maximum pages firmware can store Riana Tauro
2026-09-28  6:43   ` sashiko-bot
2026-10-01 11:36   ` Upadhyay, Tejas
2026-10-01 11:40     ` Tauro, Riana [this message]
2026-09-28  6:18 ` [PATCH v3 5/6] drm/xe/xe_ttm_vram: Report max_pages reported by firmware to userspace Riana Tauro
2026-10-01 11:37   ` Upadhyay, Tejas
2026-09-28  6:18 ` [PATCH v3 6/6] drm/xe/xe_ras: Track offlined pages by firmware to avoid duplicates Riana Tauro
2026-09-28  7:07   ` sashiko-bot
2026-09-28  9:00   ` Ghimiray, Himal Prasad
2026-09-28  9:17     ` Ghimiray, Himal Prasad
2026-09-28  9:22       ` Tauro, Riana
2026-09-28 14:42 ` ✓ CI.KUnit: success for Add support to handle memory double-bit ecc errors (rev3) Patchwork
2026-09-28 15:27 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-28 17:40 ` ✓ Xe.CI.FULL: " 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=4d153fee-64cf-4110-b5ac-0e0fe9db03fb@intel.com \
    --to=riana.tauro@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=aravind.iddamsetty@linux.intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mallesh.koujalagi@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=ravi.kishore.koppuravuri@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tejas.upadhyay@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