From: "Tauro, Riana" <riana.tauro@intel.com>
To: "Mallesh, Koujalagi" <mallesh.koujalagi@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: <anshuman.gupta@intel.com>, <rodrigo.vivi@intel.com>,
<aravind.iddamsetty@linux.intel.com>, <raag.jadav@intel.com>,
<ravi.kishore.koppuravuri@intel.com>, <tejas.upadhyay@intel.com>
Subject: Re: [PATCH v3 2/7] drm/xe/hw_error: Initialize hw_error_work per tile
Date: Wed, 4 Nov 2026 18:28:28 +0530 [thread overview]
Message-ID: <eb674144-e405-4029-acc6-858ee2ee5753@intel.com> (raw)
In-Reply-To: <8ec923e1-fafa-44a6-80f0-05e9ce7b14d2@intel.com>
On 04-11-2026 15:01, Mallesh, Koujalagi wrote:
>
>
> On 03-11-2026 11:39 am, Riana Tauro wrote:
>> Since hw_error_work is now being reused generically, initialize it per tile
>> so that we don't hit uninitialized work for non-root tile. While at it,
>> disable hw_error_work on remove to prevent UAF during unwind.
>>
>> Signed-off-by: Riana Tauro<riana.tauro@intel.com>
>> ---
>> v2: move disable work to xe_device_remove
>> add dgfx and sriov check (Sashiko)
>> ---
>> drivers/gpu/drm/xe/xe_device.c | 3 +++
>> drivers/gpu/drm/xe/xe_hw_error.c | 24 ++++++++++++++++++++++--
>> drivers/gpu/drm/xe/xe_hw_error.h | 1 +
>> 3 files changed, 26 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
>> index 07a7ab6ac083..8f498e3e3e58 100644
>> --- a/drivers/gpu/drm/xe/xe_device.c
>> +++ b/drivers/gpu/drm/xe/xe_device.c
>> @@ -45,6 +45,7 @@
>> #include "xe_guc.h"
>> #include "xe_guc_pc.h"
>> #include "xe_hw_engine_group.h"
>> +#include "xe_hw_error.h"
>> #include "xe_hwmon.h"
>> #include "xe_i2c.h"
>> #include "xe_irq.h"
>> @@ -1118,6 +1119,8 @@ int xe_device_probe(struct xe_device *xe)
>>
>> void xe_device_remove(struct xe_device *xe)
>> {
>> + xe_hw_error_work_disable(xe);
>> +
>> xe_display_unregister(xe);
>>
>> drm_dev_unplug(&xe->drm);
>> diff --git a/drivers/gpu/drm/xe/xe_hw_error.c b/drivers/gpu/drm/xe/xe_hw_error.c
>> index a934b649575c..aaa2437d40bf 100644
>> --- a/drivers/gpu/drm/xe/xe_hw_error.c
>> +++ b/drivers/gpu/drm/xe/xe_hw_error.c
>> @@ -537,6 +537,24 @@ static void process_hw_errors(struct xe_device *xe)
>> }
>> }
>>
>> +/**
>> + * xe_hw_error_work_disable - Disable hw error work
>> + * @xe: xe device instance
>> + *
>> + * This function disables work for hardware error handling for all tiles.
>> + */
>> +void xe_hw_error_work_disable(struct xe_device *xe)
>> +{
>> + struct xe_tile *tile;
>> + u8 id;
>> +
>> + if (!IS_DGFX(xe) || IS_SRIOV_VF(xe))
>> + return;
>> +
>> + for_each_tile(tile, xe, id)
>> + disable_work_sync(&tile->hw_error_work);
>> +}
>> +
>> /**
>> * xe_hw_error_init - Initialize hw errors
>> * @xe: xe device instance
>> @@ -546,12 +564,14 @@ static void process_hw_errors(struct xe_device *xe)
>> */
>> void xe_hw_error_init(struct xe_device *xe)
>> {
>> - struct xe_tile *tile = xe_device_get_root_tile(xe);
>> + struct xe_tile *tile;
>> + u8 id;
>>
>> if (!IS_DGFX(xe) || IS_SRIOV_VF(xe))
>> return;
>>
>> - INIT_WORK(&tile->hw_error_work, hw_error_work);
>> + for_each_tile(tile, xe, id)
>> + INIT_WORK(&tile->hw_error_work, hw_error_work);
>
> What will happen when probe failure occurred after xe_hw_error_ini(),
> how are tile workers cancel?
>
Makes sense. Will add it in xe_device_probe error path
Thanks
Riana
> Thanks,
>
> -/Mallesh
>
>> process_hw_errors(xe);
>> }
>> diff --git a/drivers/gpu/drm/xe/xe_hw_error.h b/drivers/gpu/drm/xe/xe_hw_error.h
>> index 5e3a11424108..944699331a93 100644
>> --- a/drivers/gpu/drm/xe/xe_hw_error.h
>> +++ b/drivers/gpu/drm/xe/xe_hw_error.h
>> @@ -12,4 +12,5 @@ struct xe_device;
>>
>> void xe_hw_error_irq_handler(struct xe_tile *tile, const u32 master_ctl);
>> void xe_hw_error_init(struct xe_device *xe);
>> +void xe_hw_error_work_disable(struct xe_device *xe);
>> #endif
next prev parent reply other threads:[~2026-11-04 12:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 6:09 [PATCH v3 0/7] Handle non-fatal errors routed via IRQ Riana Tauro
2026-11-03 6:09 ` [PATCH v3 1/7] drm/xe/hw_error: Reuse CSC worker for generic error handling Riana Tauro
2026-11-03 6:27 ` Mallesh, Koujalagi
2026-11-03 6:09 ` [PATCH v3 2/7] drm/xe/hw_error: Initialize hw_error_work per tile Riana Tauro
2026-11-03 6:23 ` sashiko-bot
2026-11-03 6:42 ` Tauro, Riana
2026-11-04 9:31 ` Mallesh, Koujalagi
2026-11-04 12:58 ` Tauro, Riana [this message]
2026-11-03 6:09 ` [PATCH v3 3/7] drm/xe/ras: Treat non-fatal PCIe errors as recovered Riana Tauro
2026-11-03 6:19 ` Mallesh, Koujalagi
2026-11-03 6:09 ` [PATCH v3 4/7] drm/xe/pci: Add upstream switch port lookup helper Riana Tauro
2026-11-03 6:09 ` [PATCH v3 5/7] drm/xe/xe_ras: Add a flag for uncorrectable internal error Riana Tauro
2026-11-03 8:19 ` Mallesh, Koujalagi
2026-11-03 6:09 ` [PATCH v3 6/7] drm/xe: Add support for wa_14028434957 Riana Tauro
2026-11-03 6:33 ` sashiko-bot
2026-11-03 6:45 ` Tauro, Riana
2026-11-04 10:38 ` Mallesh, Koujalagi
2026-11-04 10:44 ` Tauro, Riana
2026-11-03 6:09 ` [PATCH v3 7/7] drm/xe/xe_ras: Skip double-bit ECC page offlining on AER path Riana Tauro
2026-11-03 6:23 ` sashiko-bot
2026-11-03 7:32 ` ✓ CI.KUnit: success for Handle non-fatal errors routed via IRQ (rev3) Patchwork
2026-11-03 8:05 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-03 13:34 ` ✓ 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=eb674144-e405-4029-acc6-858ee2ee5753@intel.com \
--to=riana.tauro@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=aravind.iddamsetty@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.