Skip to content

Commit a4c48a3

Browse files
hghimirarodrigovivi
authored andcommitted
drm/xe/mocs: Update handling of xe_force_wake_get return
xe_force_wake_get() now returns the reference count-incremented domain mask. If it fails for individual domains, the return value will always be 0. However, for XE_FORCEWAKE_ALL, it may return a non-zero value even in the event of failure. Update the return handling of xe_force_wake_get() to reflect this behavior, and ensure that the return value is passed as input to xe_force_wake_put(). v3 - return xe_wakeref_t instead of int in xe_force_wake_get() - don't use xe_assert() to report HW errors (Michal) v5 - return unsigned int from xe_force_wake_get() - Remove redundant warn v7 - Fix commit message Cc: Michal Wajdeczko <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Reviewed-by: Badal Nilawar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 6a966d6 commit a4c48a3

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

drivers/gpu/drm/xe/xe_mocs.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -774,25 +774,21 @@ void xe_mocs_init(struct xe_gt *gt)
774774

775775
void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p)
776776
{
777-
struct xe_mocs_info table;
778-
unsigned int flags;
779-
u32 ret;
780777
struct xe_device *xe = gt_to_xe(gt);
778+
struct xe_mocs_info table;
779+
unsigned int fw_ref, flags;
781780

782781
flags = get_mocs_settings(xe, &table);
783782

784783
xe_pm_runtime_get_noresume(xe);
785-
ret = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
786-
787-
if (ret)
784+
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
785+
if (!fw_ref)
788786
goto err_fw;
789787

790788
table.ops->dump(&table, flags, gt, p);
791789

792-
xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
793-
790+
xe_force_wake_put(gt_to_fw(gt), fw_ref);
794791
err_fw:
795-
xe_assert(xe, !ret);
796792
xe_pm_runtime_put(xe);
797793
}
798794

0 commit comments

Comments
 (0)