Files
nvdriver/kernel-open/nvidia/gpu_owner.h
Eric Hartford 5a02e03a79 Merge pull request #16 from morebrackets/fix/v100-16gb-iommu-irq-linux7
Fix 16GB V100 VRAM sizing, strict IOMMU DMA, IRQ deadlock, and Linux 7.0 build
2026-11-30 20:00:37 -05:00

49 lines
2.6 KiB
C

/* SPDX-License-Identifier: MIT */
#ifndef NV_RS_GPU_OWNER_H
#define NV_RS_GPU_OWNER_H
#include "gpu_bridge.h"
struct nv_rs_gpu_owner;
/* External GPU references pin module text; driver base refs do not. The final
* put runs in active VFS/probe or exit-joined work context, which keeps current
* callback code alive through the return after module_put. */
bool nv_rs_gpu_module_get(void);
void nv_rs_gpu_module_put(void);
int nv_rs_gpu_owner_queue_init(void);
/* Stop new owner creation first. Waits retained cleanup owners/timers, then
* joins workers. Persistent cleanup errors deliberately prevent teardown. */
void nv_rs_gpu_owner_queue_destroy(void);
/* Takes the caller's PCI lease only on success; engine/IRQ state is quiescent. */
int nv_rs_gpu_owner_create(struct nv_rs_pci *, const struct nv_rs_probe_info *, struct nv_rs_gpu_owner **);
/* Exclusive probe owns a newly published owner through registration. */
int nv_rs_gpu_owner_register_open(struct nv_rs_gpu_owner *);
/* Process context only; retires the prepared registry key, then may sleep
* waiting for a sequence mutex. Caller holds no lock a sequence needs.
* No owner access after return. Hardware must already be quiescent. */
void nv_rs_gpu_owner_remove(struct nv_rs_gpu_owner *);
/* Caller holds registry/removal serialization until acquiring its Rust lease. */
void *nv_rs_gpu_owner_state(struct nv_rs_gpu_owner *);
struct nv_rs_pci *nv_rs_gpu_owner_pci_get(struct nv_rs_gpu_owner *);
unsigned int nv_rs_gpu_owner_pending(void);
unsigned int nv_rs_gpu_owner_retries(void);
/* Requires a retained owner. Diagnostic for operation/removal waiters. */
unsigned int nv_rs_gpu_owner_waiters(struct nv_rs_gpu_owner *);
/* Opt-in persistent runtime bring-up lifecycle (`runtime_engines=1`). */
bool nv_rs_runtime_engines(void);
/* Opt-in storm-guarded PGRAPH-only PCI IRQ arming (`live_pci_irq=1`). */
bool nv_rs_live_pci_irq(void);
bool nv_rs_unlock_ada_tensor(void);
bool nv_rs_dyn_bar1_p2p(void);
bool nv_rs_disable_ecc(void);
bool nv_rs_unpriv_profiling(void);
int nv_rs_gpu_owner_runtime_start(struct nv_rs_gpu_owner *owner);
void nv_rs_gpu_owner_runtime_stop(struct nv_rs_gpu_owner *owner);
void nv_rs_runtime_park(struct nv_rs_pci *pci);
int nv_rs_runtime_park_wait(struct nv_rs_pci *pci);
void nv_rs_runtime_gr_reset_complete(struct nv_rs_pci *pci, int rc);
int nv_rs_runtime_request_gr_reset(struct nv_rs_pci *pci);
void nv_rs_runtime_hshub_get_args(struct nv_rs_pci *pci, u32 *out_cfg4);
void nv_rs_runtime_hshub_complete(struct nv_rs_pci *pci, int rc);
int nv_rs_runtime_request_hshub_update(struct nv_rs_pci *pci, u32 cfg0, u32 cfg1, u32 cfg2, u32 cfg6);
u32 nv_rs_pci_gpu_id(struct nv_rs_pci *pci);
#endif