drm/xe/ct: hold fast_lock when reserving space for g2h
authorMatthew Auld <matthew.auld@intel.com>
Mon, 10 Jul 2023 09:40:42 +0000 (10:40 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:35:22 +0000 (11:35 -0500)
commitdad33831d8d137ee28b21c3c2296463a01aa5b78
treeec6373da8a531982ea152586d41af0ef6575942b
parentc4bbc32e09ab9f74c725a8719df2b509c8ad8780
drm/xe/ct: hold fast_lock when reserving space for g2h

Reserving and checking for space on the g2h side relies on the
fast_lock, and not the CT lock since we need to release space from the
fast CT path. Make sure we hold it when checking for space and reserving
it. The main concern is calling __g2h_release_space() as we are reserving
something and since the info.space and info.g2h_outstanding operations
are not atomic we can get some nonsense values back.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_guc_ct.c