The drmm_add_action_or_reset function automatically invokes the action (sysfs removal) in the event of a failure; therefore, there's no necessity to call it within the return check. Modify the return type of xe_gt_ccs_mode_sysfs_init to int, allowing the caller to pass errors up the call chain. Should sysfs creation or drmm_add_action_or_reset fail, error propagation will prompt a driver load abort. -v2 Edit commit message (Nikula/Lucas) use err_force_wake label instead of new. (Lucas) Avoid unnecessary warn/error messages. (Lucas) Fixes:f3bc5bb4d5
("drm/xe: Allow userspace to configure CCS mode") Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240412181211.1155732-3-himal.prasad.ghimiray@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> (cherry picked from commita99641e387
) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
24 lines
519 B
C
24 lines
519 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2023 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_GT_CCS_MODE_H_
|
|
#define _XE_GT_CCS_MODE_H_
|
|
|
|
#include "xe_device_types.h"
|
|
#include "xe_gt.h"
|
|
#include "xe_gt_types.h"
|
|
#include "xe_platform_types.h"
|
|
|
|
void xe_gt_apply_ccs_mode(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)
|
|
{
|
|
/* Check if there are more than one compute engines available */
|
|
return hweight32(CCS_MASK(gt)) > 1;
|
|
}
|
|
|
|
#endif
|
|
|