- Fix error paths on managed allocations

- Fix PF/VF relay messages
 -----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEE6rM8lpABPHM5FqyDm6KlpjDL6lMFAmYqwToZHGx1Y2FzLmRl
 bWFyY2hpQGludGVsLmNvbQAKCRCboqWmMMvqU+dVD/9OLOui9aWfriFVzDNB1MIl
 1EItOsi4W/VpTxIO5s5MrUiWQRDl2xO2jVZHrAwrgSjG2vCHFLlnMZJoOAOo5O14
 cvAlKASTknwjK6ulU9/uhRKGwv7Wbjowg1ITbnFX9VRfYC5uF/pnMe+OqdxtllT8
 F3ZGQrRobHi29EKMWaADcZhByqPwNsHYQB/T5Yg9hOIzf7h4JoXxB02/q1iGlOTt
 T2L3/zP/DIeHVLQ9i7umJ3sCj7EHPKQwBEj3oQpoGp0nphdCXnu46KrPx25j/NV2
 WgGVd7tSh1n876W05FnWRlBOBbY4qVvj3i4RTOuCISgL9lV+EyrFVLqifAXYrpFE
 FjNznH+/BSS/RbfN/wyY+DSta/o4rJuv/eN6Jy4Ert316/SGS8lrOo8rP/xvhg1c
 4DoiomLyIP7kO/AhJ5nGYnisAWMg3cLOarrRNYQ3vddWdaUcIR32vymlKKVaDMNs
 RFNukXN/BGZVtl+RVrtye9+FchhBsZztDfuVvo8iScuqE7TuVVTL1f8ppfDHnsL3
 Jo6afUOHmOhDLMraDJ4tMWu3Td2Z+bRIpJn9zyAbYSfejTVYR9j/WYVHw9l1mHyR
 CoqvJG3EnZC1lyYsYVroYSbb6S4VOwemoq00oileQDac3QndSuqPBb+0gLViFZ4N
 Cd8Inq08stZqJLdHbB1icw==
 =e6VC
 -----END PGP SIGNATURE-----

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 <airlied@redhat.com>

From: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/gxaxtvxeoax7mnddxbl3tfn2hfnm5e4ngnl3wpi4p5tvn7il4s@fwsvpntse7bh
This commit is contained in:
Dave Airlie 2024-04-26 12:53:26 +10:00
commit 3a8534035c
5 changed files with 14 additions and 24 deletions

View File

@ -378,7 +378,9 @@ static int gt_fw_domain_init(struct xe_gt *gt)
err);
/* Initialize CCS mode sysfs after early initialization of HW engines */
xe_gt_ccs_mode_sysfs_init(gt);
err = xe_gt_ccs_mode_sysfs_init(gt);
if (err)
goto err_force_wake;
/*
* Stash hardware-reported version. Since this register does not exist

View File

@ -167,25 +167,20 @@ static void xe_gt_ccs_mode_sysfs_fini(struct drm_device *drm, void *arg)
* and it is expected that there are no open drm clients while doing so.
* The number of available compute slices is exposed to user through a per-gt
* 'num_cslices' sysfs interface.
*
* Returns: Returns error value for failure and 0 for success.
*/
void xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt)
{
struct xe_device *xe = gt_to_xe(gt);
int err;
if (!xe_gt_ccs_mode_enabled(gt))
return;
return 0;
err = sysfs_create_files(gt->sysfs, gt_ccs_mode_attrs);
if (err) {
drm_warn(&xe->drm, "Sysfs creation for ccs_mode failed err: %d\n", err);
return;
}
if (err)
return err;
err = drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
if (err) {
sysfs_remove_files(gt->sysfs, gt_ccs_mode_attrs);
drm_warn(&xe->drm, "%s: drmm_add_action_or_reset failed, err: %d\n",
__func__, err);
}
return drmm_add_action_or_reset(&xe->drm, xe_gt_ccs_mode_sysfs_fini, gt);
}

View File

@ -12,7 +12,7 @@
#include "xe_platform_types.h"
void xe_gt_apply_ccs_mode(struct xe_gt *gt);
void xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt);
int xe_gt_ccs_mode_sysfs_init(struct xe_gt *gt);
static inline bool xe_gt_ccs_mode_enabled(const struct xe_gt *gt)
{

View File

@ -1054,10 +1054,10 @@ static int process_g2h_msg(struct xe_guc_ct *ct, u32 *msg, u32 len)
adj_len);
break;
case XE_GUC_ACTION_GUC2PF_RELAY_FROM_VF:
ret = xe_guc_relay_process_guc2pf(&guc->relay, payload, adj_len);
ret = xe_guc_relay_process_guc2pf(&guc->relay, hxg, hxg_len);
break;
case XE_GUC_ACTION_GUC2VF_RELAY_FROM_PF:
ret = xe_guc_relay_process_guc2vf(&guc->relay, payload, adj_len);
ret = xe_guc_relay_process_guc2vf(&guc->relay, hxg, hxg_len);
break;
default:
drm_err(&xe->drm, "unexpected action 0x%04x\n", action);

View File

@ -53,7 +53,6 @@ static int huc_alloc_gsc_pkt(struct xe_huc *huc)
struct xe_gt *gt = huc_to_gt(huc);
struct xe_device *xe = gt_to_xe(gt);
struct xe_bo *bo;
int err;
/* we use a single object for both input and output */
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)
huc->gsc_pkt = bo;
err = drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
if (err) {
free_gsc_pkt(&xe->drm, huc);
return err;
}
return 0;
return drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
}
int xe_huc_init(struct xe_huc *huc)