From: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
To: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
netdev@vger.kernel.org, amd-gfx@lists.freedesktop.org
Cc: simona.vetter@ffwll.ch, airlied@gmail.com,
tejas.upadhyay@intel.com, himal.prasad.ghimiray@intel.com,
rodrigo.vivi@intel.com, riana.tauro@intel.com,
raag.jadav@intel.com, joshua.santosh.ranjan@intel.com,
ashwin.kumar.kulkarni@intel.com, pratik.bari@intel.com,
Hawking.Zhang@amd.com, tao.zhou1@amd.com, YiPeng.Chai@amd.com,
jinzhou.su@amd.com, cesun102@amd.com, lijo.lazar@amd.com,
alexander.deucher@amd.com, christian.koenig@amd.com
Subject: [PATCH v2 2/2] drm/xe: Remove bad VRAM pages debugfs interface
Date: Wed, 7 Oct 2026 13:33:54 +0530 [thread overview]
Message-ID: <20261007080354.3072751-3-aravind.iddamsetty@linux.intel.com> (raw)
In-Reply-To: <20261007080354.3072751-1-aravind.iddamsetty@linux.intel.com>
Drop the "vram_bad_pages" debugfs file added by commit fb19798cc366e
("drm/xe: Expose bad VRAM pages via debugfs"). The retired VRAM pages
are now exported through the drm-ras generic netlink interface, which
is a stable ABI, making the debugfs-only readback redundant.
This is a partial revert of fb19798cc366e: it removes vram_bad_pages_show(),
its DEFINE_SHOW_ATTRIBUTE(), xe_ttm_vram_debugfs_init() and its call site
and declaration, and the now-unused <linux/debugfs.h> include in
xe_ttm_vram_mgr.c. The struct xe_ttm_vram_mgr.max_pages field introduced
by the same commit is intentionally retained: it is the FW-provided
offline-page limit and is now consumed by the drm-ras retired-resources
capacity summary (xe_ttm_vram_get_max_bad_pages()).
The fault-injection debugfs interface (inject_mempage_offline) is left
untouched; it remains the mechanism for triggering page offlining in
test.
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
Assisted-by: Copilot:claude-opus-4.8
---
drivers/gpu/drm/xe/xe_debugfs.c | 2 -
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 71 ----------------------------
drivers/gpu/drm/xe/xe_ttm_vram_mgr.h | 1 -
3 files changed, 74 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index 926020c7526e..6a19737104fb 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -823,8 +823,6 @@ void xe_debugfs_register(struct xe_device *xe)
if (man)
ttm_resource_manager_create_debugfs(man, root, "stolen_mm");
- xe_ttm_vram_debugfs_init(xe, root);
-
for_each_tile(tile, xe, tile_id)
xe_tile_debugfs_register(tile);
diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
index b56b543a56a2..9fbdf1dcde8a 100644
--- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
+++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
@@ -5,7 +5,6 @@
*/
#include <linux/cgroup_dmem.h>
-#include <linux/debugfs.h>
#include <drm/drm_managed.h>
#include <drm/drm_drv.h>
@@ -1120,73 +1119,3 @@ int xe_ttm_vram_inject_fault(struct xe_device *xe)
return -ENOSPC;
}
EXPORT_SYMBOL(xe_ttm_vram_inject_fault);
-
-static int vram_bad_pages_show(struct seq_file *m, void *unused)
-{
- struct xe_device *xe = m->private;
- struct xe_ttm_vram_offline_resource *pos;
- struct ttm_resource_manager *man;
- struct xe_ttm_vram_mgr *mgr;
- struct xe_tile *tile;
- u8 id;
-
- man = ttm_manager_type(&xe->ttm, XE_PL_VRAM0);
- if (man)
- /* TODO Hook with RAS to show max_pages fetched from FW */
- seq_printf(m, "max_pages: %d\n",
- to_xe_ttm_vram_mgr(man)->max_pages);
-
- for_each_tile(tile, xe, id) {
- struct xe_vram_region *vr = tile->mem.vram;
-
- man = ttm_manager_type(&xe->ttm, XE_PL_VRAM0 + id);
- if (!man || !vr)
- continue;
- mgr = to_xe_ttm_vram_mgr(man);
-
- rcu_read_lock();
-
- list_for_each_entry_rcu(pos, &mgr->offlined_pages, offlined_link) {
- u64 pfn;
-
- pfn = (pos->addr + vr->dpa_base) >> PAGE_SHIFT;
- seq_printf(m, "0x%016llx : 0x%016lx : R\n", pfn, PAGE_SIZE);
- }
-
- list_for_each_entry_rcu(pos, &mgr->queued_pages, queued_link) {
- u64 pfn;
-
- pfn = (pos->addr + vr->dpa_base) >> PAGE_SHIFT;
- seq_printf(m, "0x%016llx : 0x%016lx : %c\n",
- pfn, PAGE_SIZE, pos->status ? 'F' : 'P');
- }
-
- rcu_read_unlock();
- }
-
- return 0;
-}
-DEFINE_SHOW_ATTRIBUTE(vram_bad_pages);
-
-/**
- * xe_ttm_vram_debugfs_init - Initialize VRAM debugfs interfaces
- * @xe: The xe device structure pointer
- * @root: The root dentry of the debugfs directory
- *
- * This function registers platform-specific VRAM debugfs files used for
- * testing and debugging. Currently, it exposes the "vram_bad_pages" interface
- * to inspect marked faulty memory pages, restricted specifically to the
- * %XE_CRESCENTISLAND platform.
- *
- * Return: Void.
- */
-void xe_ttm_vram_debugfs_init(struct xe_device *xe, struct dentry *root)
-{
- /*
- * TODO: Replace platform check with xe->info
- * once the feature flag is plumbed through device info.
- */
- if (xe->info.platform != XE_CRESCENTISLAND)
- return;
- debugfs_create_file("vram_bad_pages", 0444, root, xe, &vram_bad_pages_fops);
-}
diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h
index 70fae023d6a3..7a4a041b8218 100644
--- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h
+++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h
@@ -17,7 +17,6 @@ int __xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_ttm_vram_mgr *mgr,
u32 mem_type, u64 size, u64 io_size,
u64 default_page_size);
int xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_vram_region *vram);
-void xe_ttm_vram_debugfs_init(struct xe_device *xe, struct dentry *root);
int xe_ttm_vram_mgr_alloc_sgt(struct xe_device *xe,
struct ttm_resource *res,
u64 offset, u64 length,
--
2.25.1
next prev parent reply other threads:[~2026-10-07 8:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 8:03 [PATCH v2 0/2] drm/xe: Expose retired VRAM pages via drm-ras Aravind Iddamsetty
2026-10-07 8:03 ` [PATCH v2 1/2] " Aravind Iddamsetty
2026-10-07 9:28 ` Christian König
2026-10-07 13:55 ` Rodrigo Vivi
2026-10-07 8:03 ` Aravind Iddamsetty [this message]
2026-10-07 8:38 ` ✗ CI.checkpatch: warning for drm/xe: Expose retired VRAM pages via drm-ras (rev2) Patchwork
2026-10-07 8:40 ` ✓ CI.KUnit: success " Patchwork
2026-10-07 9:27 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-07 10:42 ` ✓ 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=20261007080354.3072751-3-aravind.iddamsetty@linux.intel.com \
--to=aravind.iddamsetty@linux.intel.com \
--cc=Hawking.Zhang@amd.com \
--cc=YiPeng.Chai@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ashwin.kumar.kulkarni@intel.com \
--cc=cesun102@amd.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jinzhou.su@amd.com \
--cc=joshua.santosh.ranjan@intel.com \
--cc=lijo.lazar@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pratik.bari@intel.com \
--cc=raag.jadav@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona.vetter@ffwll.ch \
--cc=tao.zhou1@amd.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