mirror of
https://github.com/torvalds/linux.git
synced 2026-05-04 22:43:04 -04:00
Some driver components, like eudebug or ccs-mode, can't be used when VFs are enabled. Add functions to allow those components to block the PF from enabling VFs for the requested duration. Introduce trivial counter to allow lockdown or exclusive access that can be used in the scenarios where we can't follow the strict owner semantics as required by the rw_semaphore implementation. Before enabling VFs, the PF will try to arm the "vfs_enabling" guard for the exclusive access. This will fail if there are some lockdown requests already initiated by the other components. For testing purposes, add debugfs file which will call these new functions from the file's open/close hooks. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Christoph Manszewski <christoph.manszewski@intel.com> Reviewed-by: Christoph Manszewski <christoph.manszewski@intel.com> Link: https://patch.msgid.link/20251109162451.4779-1-michal.wajdeczko@intel.com
32 lines
1019 B
C
32 lines
1019 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2023-2024 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_SRIOV_PF_H_
|
|
#define _XE_SRIOV_PF_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct dentry;
|
|
struct drm_printer;
|
|
struct xe_device;
|
|
|
|
#ifdef CONFIG_PCI_IOV
|
|
bool xe_sriov_pf_readiness(struct xe_device *xe);
|
|
int xe_sriov_pf_init_early(struct xe_device *xe);
|
|
int xe_sriov_pf_init_late(struct xe_device *xe);
|
|
int xe_sriov_pf_wait_ready(struct xe_device *xe);
|
|
int xe_sriov_pf_lockdown(struct xe_device *xe);
|
|
void xe_sriov_pf_end_lockdown(struct xe_device *xe);
|
|
void xe_sriov_pf_print_vfs_summary(struct xe_device *xe, struct drm_printer *p);
|
|
#else
|
|
static inline bool xe_sriov_pf_readiness(struct xe_device *xe) { return false; }
|
|
static inline int xe_sriov_pf_init_early(struct xe_device *xe) { return 0; }
|
|
static inline int xe_sriov_pf_init_late(struct xe_device *xe) { return 0; }
|
|
static inline int xe_sriov_pf_lockdown(struct xe_device *xe) { return 0; }
|
|
static inline void xe_sriov_pf_end_lockdown(struct xe_device *xe) { }
|
|
#endif
|
|
|
|
#endif
|