Skip to content

Commit 9de2606

Browse files
committed
drm/xe/eustall: Store forcewake reference in stream structure
Calls to xe_force_wake_put() should generally pass the exact reference returned by xe_force_wake_get(). Since EU stall grabs and releases forcewake in different functions, xe_eu_stall_disable_locked() is currently calling put with a hardcoded RENDER domain. Although this works for now, it's somewhat fragile in case the power domain(s) required by stall sampling change in the future, or if workarounds show up that require us to obtain additional domains. Stash the original reference obtained during stream enable inside the stream structure so that we can use it directly when the stream is disabled. Cc: Harish Chegondi <harish.chegondi@intel.com> Reviewed-by: Harish Chegondi <harish.chegondi@intel.com> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://patch.msgid.link/20251110232017.1475869-34-matthew.d.roper@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
1 parent defdf27 commit 9de2606

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/xe/xe_eu_stall.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct xe_eu_stall_data_stream {
4949
wait_queue_head_t poll_wq;
5050
size_t data_record_size;
5151
size_t per_xecore_buf_size;
52+
unsigned int fw_ref;
5253

5354
struct xe_gt *gt;
5455
struct xe_bo *bo;
@@ -660,13 +661,12 @@ static int xe_eu_stall_stream_enable(struct xe_eu_stall_data_stream *stream)
660661
struct per_xecore_buf *xecore_buf;
661662
struct xe_gt *gt = stream->gt;
662663
u16 group, instance;
663-
unsigned int fw_ref;
664664
int xecore;
665665

666666
/* Take runtime pm ref and forcewake to disable RC6 */
667667
xe_pm_runtime_get(gt_to_xe(gt));
668-
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_RENDER);
669-
if (!xe_force_wake_ref_has_domain(fw_ref, XE_FW_RENDER)) {
668+
stream->fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_RENDER);
669+
if (!xe_force_wake_ref_has_domain(stream->fw_ref, XE_FW_RENDER)) {
670670
xe_gt_err(gt, "Failed to get RENDER forcewake\n");
671671
xe_pm_runtime_put(gt_to_xe(gt));
672672
return -ETIMEDOUT;
@@ -832,7 +832,7 @@ static int xe_eu_stall_disable_locked(struct xe_eu_stall_data_stream *stream)
832832
xe_gt_mcr_multicast_write(gt, ROW_CHICKEN2,
833833
_MASKED_BIT_DISABLE(DISABLE_DOP_GATING));
834834

835-
xe_force_wake_put(gt_to_fw(gt), XE_FW_RENDER);
835+
xe_force_wake_put(gt_to_fw(gt), stream->fw_ref);
836836
xe_pm_runtime_put(gt_to_xe(gt));
837837

838838
return 0;

0 commit comments

Comments
 (0)