Skip to content

Commit cd0ffc8

Browse files
committed
drm/xe/pf: Convert control state to bitmap
In upcoming changes, the number of states will increase as a result of introducing SAVE and RESTORE states. This means that using unsigned long as underlying storage won't work on 32-bit architectures, as we'll run out of bits. Use bitmap instead. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202510231918.XlOqymLC-lkp@intel.com/ Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://patch.msgid.link/20251112132220.516975-4-michal.winiarski@intel.com Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
1 parent 4a43480 commit cd0ffc8

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static unsigned long *pf_peek_vf_state(struct xe_gt *gt, unsigned int vfid)
225225
{
226226
struct xe_gt_sriov_control_state *cs = pf_pick_vf_control(gt, vfid);
227227

228-
return &cs->state;
228+
return cs->state;
229229
}
230230

231231
static bool pf_check_vf_state(struct xe_gt *gt, unsigned int vfid,

drivers/gpu/drm/xe/xe_gt_sriov_pf_control_types.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,19 @@ enum xe_gt_sriov_control_bits {
7373
XE_GT_SRIOV_STATE_STOP_FAILED,
7474
XE_GT_SRIOV_STATE_STOPPED,
7575

76-
XE_GT_SRIOV_STATE_MISMATCH = BITS_PER_LONG - 1,
76+
XE_GT_SRIOV_STATE_MISMATCH, /* always keep as last */
7777
};
7878

79+
#define XE_GT_SRIOV_NUM_STATES (XE_GT_SRIOV_STATE_MISMATCH + 1)
80+
7981
/**
8082
* struct xe_gt_sriov_control_state - GT-level per-VF control state.
8183
*
8284
* Used by the PF driver to maintain per-VF control data.
8385
*/
8486
struct xe_gt_sriov_control_state {
8587
/** @state: VF state bits */
86-
unsigned long state;
88+
DECLARE_BITMAP(state, XE_GT_SRIOV_NUM_STATES);
8789

8890
/** @done: completion of async operations */
8991
struct completion done;

0 commit comments

Comments
 (0)