drm/xe/reg_sr: Apply limit to register whitelisting
If RING_MAX_NONPRIV_SLOTS denotes the maximum number of whitelisting slots, then it makes sense to refuse going above it. v2: - Use xe_gt_err() instead of drm_err() for more detailed info in the error message. (Matt) Cc: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20230609143815.302540-3-gustavo.sousa@intel.com Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
1011812c64
commit
5eeb8b4438
@ -235,6 +235,13 @@ void xe_reg_sr_apply_whitelist(struct xe_hw_engine *hwe)
|
||||
|
||||
p = drm_debug_printer(KBUILD_MODNAME);
|
||||
xa_for_each(&sr->xa, reg, entry) {
|
||||
if (slot == RING_MAX_NONPRIV_SLOTS) {
|
||||
xe_gt_err(gt,
|
||||
"hwe %s: maximum register whitelist slots (%d) reached, refusing to add more\n",
|
||||
hwe->name, RING_MAX_NONPRIV_SLOTS);
|
||||
break;
|
||||
}
|
||||
|
||||
xe_reg_whitelist_print_entry(&p, 0, reg, entry);
|
||||
xe_mmio_write32(gt, RING_FORCE_TO_NONPRIV(mmio_base, slot),
|
||||
reg | entry->set_bits);
|
||||
|
Loading…
x
Reference in New Issue
Block a user