]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/guc: Limit scheduling properties to avoid overflow
authorJohn Harrison <John.C.Harrison@Intel.com>
Thu, 6 Oct 2022 21:38:10 +0000 (14:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:04 +0000 (13:32 +0100)
commit97f0bd7a950232da743b67d269a25f6ca4b8f75e
tree61b3a93413e846ca5056b630852b0998072cf2ac
parent9bd16a467c4e52ec264208fd659c4a2538419179
drm/i915/guc: Limit scheduling properties to avoid overflow

[ Upstream commit 31341d5dc9b604eaa909934015ce28470ab815fd ]

GuC converts the pre-emption timeout and timeslice quantum values into
clock ticks internally. That significantly reduces the point of 32bit
overflow. On current platforms, worst case scenario is approximately
110 seconds. Rather than allowing the user to set higher values and
then get confused by early timeouts, add limits when setting these
values.

v2: Add helper functions for clamping (review feedback from Tvrtko).
v3: Add a bunch of BUG_ON range checks in addition to the checks
already in the clamping functions (Tvrtko)

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221006213813.1563435-2-John.C.Harrison@Intel.com
Stable-dep-of: 7ca6dc37287e ("drm/i915: Fix compute pre-emption w/a to apply to compute engines")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i915/gt/intel_engine.h
drivers/gpu/drm/i915/gt/intel_engine_cs.c
drivers/gpu/drm/i915/gt/sysfs_engines.c
drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c