Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Mallesh, Koujalagi" <mallesh.koujalagi@intel.com>
To: "Tauro, Riana" <riana.tauro@intel.com>
Cc: <rodrigo.vivi@intel.com>, <anshuman.gupta@intel.com>,
	<badal.nilawar@intel.com>, <karthik.poosa@intel.com>,
	<sk.anirban@intel.com>,  <raag.jadav@intel.com>,
	<himal.prasad.ghimiray@intel.com>, <tejas.upadhyay@intel.com>,
	<aravind.iddamsetty@linux.intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v1 1/4] drm/xe/ras: Add helper to check hard-offlined pages
Date: Thu, 3 Dec 2026 12:14:18 +0530	[thread overview]
Message-ID: <a7d68532-20ce-4b55-9a3c-e6fb60eaa299@intel.com> (raw)
In-Reply-To: <7d334f9d-8bf1-4a3b-885d-4f2702aa0131@intel.com>


On 03-12-2026 10:59 am, Tauro, Riana wrote:
>
> On 02-12-2026 17:27, Mallesh Koujalagi wrote:
>> From: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
>>
>> Introduce page_is_hard_offlined() to encapsulate the lookup of
>> hard-offlined pages in the offlined_pages xarray.
>>
>> Cc: Raag Jadav <raag.jadav@intel.com>
>> Cc: Riana Tauro <riana.tauro@intel.com>
>> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
>> Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
>> Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
>> Co-developed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
>> Signed-off-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
>> ---
>>   drivers/gpu/drm/xe/xe_ras.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
>> index 57d3f4b92fad..6bce682c32d0 100644
>> --- a/drivers/gpu/drm/xe/xe_ras.c
>> +++ b/drivers/gpu/drm/xe/xe_ras.c
>> @@ -254,6 +254,11 @@ static inline const char *comp_to_str(u8 component)
>>       return xe_ras_components[component];
>>   }
>>   +static bool page_is_hard_offlined(struct xe_device *xe, u64 
>> page_address)
>> +{
>> +    return !!xa_load(&xe->ras.state.offlined_pages, page_address >> 
>> XE_PTE_SHIFT);
>> +}
>> +
>
> Why do we need this? Isn't the current condition enough?

hmm..

The current condition works for existing code in handle_page_offline() 
which is not enough.


I added the helper function because the same lookup is needed in a few 
more places

like send_page_offline_cmd() and handle_device_memory_errors() etc. to 
check page is hard-offline or not.


This helper avoid duplicating the lookup and make the check in one place.

Thanks,

-/Mallesh

>
> Riana
>
>>   static int send_page_offline_cmd(struct xe_device *xe, u64 
>> page_address,
>>                    enum xe_ras_page_action action)
>>   {
>> @@ -311,7 +316,6 @@ static int send_page_offline_cmd(struct xe_device 
>> *xe, u64 page_address,
>>     static int handle_page_offline(struct xe_device *xe, u64 
>> page_address, bool notify_fw)
>>   {
>> -    struct xe_ras_state *state = &xe->ras.state;
>>       enum xe_ras_page_action action;
>>       u64 addr;
>>       int ret;
>> @@ -351,7 +355,7 @@ static int handle_page_offline(struct xe_device 
>> *xe, u64 page_address, bool noti
>>       case -EEXIST:
>>           xe_dbg(xe, "[RAS]: Repeated error on already soft-offlined 
>> page address 0x%llx\n",
>>                  page_address);
>> -        if (xa_load(&state->offlined_pages, page_address >> 
>> XE_PTE_SHIFT))
>> +        if (page_is_hard_offlined(xe, page_address))
>>               action = XE_RAS_PAGE_ACTION_REMOVE;
>>           else
>>               action = XE_RAS_PAGE_ACTION_OFFLINE;

  reply	other threads:[~2026-12-03  6:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 11:57 [PATCH v1 0/4] drm/xe/ras: Suppress repeated DB-ECC reports Mallesh Koujalagi
2026-12-02 11:57 ` [PATCH v1 1/4] drm/xe/ras: Add helper to check hard-offlined pages Mallesh Koujalagi
2026-12-02 13:16   ` Raag Jadav
2026-12-02 13:47     ` Mallesh, Koujalagi
2026-12-02 17:51   ` Rodrigo Vivi
2026-12-03  5:29   ` Tauro, Riana
2026-12-03  6:44     ` Mallesh, Koujalagi [this message]
2026-12-02 11:57 ` [PATCH v1 2/4] drm/xe/ras: Downgrade repeated page removal message to debug Mallesh Koujalagi
2026-12-02 17:52   ` Rodrigo Vivi
2026-12-03  5:27   ` Tauro, Riana
2026-12-03  6:53     ` Mallesh, Koujalagi
2026-12-03  7:44       ` Tauro, Riana
2026-12-02 11:57 ` [PATCH v1 3/4] drm/xe/ras: Skip reports for repeated DB-ECC errors Mallesh Koujalagi
2026-12-02 12:08   ` sashiko-bot
2026-12-02 18:21   ` Rodrigo Vivi
2026-12-03  6:29     ` Mallesh, Koujalagi
2026-12-03  5:28   ` Tauro, Riana
2026-12-03  7:04     ` Mallesh, Koujalagi
2026-12-03  7:38       ` Tauro, Riana
2026-12-02 11:57 ` [PATCH v1 4/4] drm/xe/ras: Avoid duplicate logging for recurrent " Mallesh Koujalagi
2026-12-02 12:06   ` sashiko-bot
2026-12-02 17:53   ` Rodrigo Vivi
2026-12-03  5:33   ` Tauro, Riana
2026-12-03  7:06     ` Mallesh, Koujalagi
2026-12-02 13:36 ` ✓ CI.KUnit: success for drm/xe/ras: Suppress repeated DB-ECC reports Patchwork
2026-12-02 14:08 ` ✓ Xe.CI.BAT: " 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=a7d68532-20ce-4b55-9a3c-e6fb60eaa299@intel.com \
    --to=mallesh.koujalagi@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=karthik.poosa@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sk.anirban@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