Skip to content

Commit 3a85340

Browse files
committed
Merge tag 'drm-xe-fixes-2024-04-25' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
- Fix error paths on managed allocations - Fix PF/VF relay messages Signed-off-by: Dave Airlie <[email protected]> From: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/gxaxtvxeoax7mnddxbl3tfn2hfnm5e4ngnl3wpi4p5tvn7il4s@fwsvpntse7bh
2 parents ca382d6 + e3e9895 commit 3a85340

File tree

5 files changed

+14
-24
lines changed

5 files changed

+14
-24
lines changed

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ static int gt_fw_domain_init(struct xe_gt *gt)
378378
err);
379379

380380
/* Initialize CCS mode sysfs after early initialization of HW engines */
381-
xe_gt_ccs_mode_sysfs_init(gt);
381+
err = xe_gt_ccs_mode_sysfs_init(gt);
382+
if (err)
383+
goto err_force_wake;
382384

383385
/*
384386
* Stash hardware-reported version. Since this register does not exist

drivers/gpu/drm/xe/xe_gt_ccs_mode.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,20 @@ static void xe_gt_ccs_mode_sysfs_fini(struct drm_device *drm, void *arg)
167167
* and it is expected that there are no open drm clients while doing so.
168168
* The number of available compute slices is exposed to user through a per-gt
169169
* 'num_cslices' sysfs interface.
170+
*
171+
* Returns: Returns error value for failure and 0 for success.
170172
*/
171-
void xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
173+
int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
172174
{
173175
struct xe_device *xe = gt_to_xe(gt);
174176
int err;
175177

176178
if (!xe_gt_ccs_mode_enabled(gt))
177-
return;
179+
return 0;
178180

179181
err = sysfs_create_files(gt->sysfs, gt_ccs_mode_attrs);
180-
if (err) {
181-
drm_warn(&xe->drm, "Sysfs creation for ccs_mode failed err: %d\n", err);
182-
return;
183-
}
182+
if (err)
183+
return err;
184184

185-
err = drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
186-
if (err) {
187-
sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs);
188-
drm_warn(&xe->drm, "%s: drmm_add_action_or_reset failed, err: %d\n",
189-
__func__, err);
190-
}
185+
return drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
191186
}

drivers/gpu/drm/xe/xe_gt_ccs_mode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "xe_platform_types.h"
1313

1414
void xe_gt_apply_ccs_mode(struct xe_gt *gt);
15-
void xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt);
15+
int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt);
1616

1717
static inline bool xe_gt_ccs_mode_enabled(const struct xe_gt *gt)
1818
{

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,10 @@ static int process_g2h_msg(struct xe_guc_ct *ct, u32 *msg, u32 len)
10541054
adj_len);
10551055
break;
10561056
case XE_GUC_ACTION_GUC2PF_RELAY_FROM_VF:
1057-
ret = xe_guc_relay_process_guc2pf(&guc->relay, payload, adj_len);
1057+
ret = xe_guc_relay_process_guc2pf(&guc->relay, hxg, hxg_len);
10581058
break;
10591059
case XE_GUC_ACTION_GUC2VF_RELAY_FROM_PF:
1060-
ret = xe_guc_relay_process_guc2vf(&guc->relay, payload, adj_len);
1060+
ret = xe_guc_relay_process_guc2vf(&guc->relay, hxg, hxg_len);
10611061
break;
10621062
default:
10631063
drm_err(&xe->drm, "unexpected action 0x%04x\n", action);

drivers/gpu/drm/xe/xe_huc.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ static int huc_alloc_gsc_pkt(struct xe_huc *huc)
5353
struct xe_gt *gt = huc_to_gt(huc);
5454
struct xe_device *xe = gt_to_xe(gt);
5555
struct xe_bo *bo;
56-
int err;
5756

5857
/* we use a single object for both input and output */
5958
bo = xe_bo_create_pin_map(xe, gt_to_tile(gt), NULL,
@@ -66,13 +65,7 @@ static int huc_alloc_gsc_pkt(struct xe_huc *huc)
6665

6766
huc->gsc_pkt = bo;
6867

69-
err = drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
70-
if (err) {
71-
free_gsc_pkt(&xe->drm, huc);
72-
return err;
73-
}
74-
75-
return 0;
68+
return drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
7669
}
7770

7871
int xe_huc_init(struct xe_huc *huc)

0 commit comments

Comments
 (0)