On Wed, Oct 07, 2026 at 01:33:54PM +0530, Aravind Iddamsetty wrote:
> 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.

Let's keep this for a while... no need to rush and remove it...

> 
> Cc: Tejas Upadhyay <[email protected]>
> Signed-off-by: Aravind Iddamsetty <[email protected]>
> 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
> 

Reply via email to