mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-03 06:57:27 +00:00
580.95.05
This commit is contained in:
@@ -83,6 +83,7 @@ static NvU32 nvidia_modeset_enumerate_gpus(nv_gpu_info_t *gpu_info)
|
||||
for (nvl = nv_linux_devices; nvl != NULL; nvl = nvl->next)
|
||||
{
|
||||
nv_state_t *nv = NV_STATE_PTR(nvl);
|
||||
int numa_status = nv_get_numa_status(nvl);
|
||||
|
||||
/*
|
||||
* The gpu_info[] array has NV_MAX_GPUS elements. Fail if there
|
||||
@@ -102,6 +103,10 @@ static NvU32 nvidia_modeset_enumerate_gpus(nv_gpu_info_t *gpu_info)
|
||||
gpu_info[count].pci_info.slot = nv->pci_info.slot;
|
||||
gpu_info[count].pci_info.function = nv->pci_info.function;
|
||||
|
||||
gpu_info->needs_numa_setup =
|
||||
numa_status != NV_IOCTL_NUMA_STATUS_DISABLED &&
|
||||
numa_status != NV_IOCTL_NUMA_STATUS_ONLINE;
|
||||
|
||||
gpu_info[count].os_device_ptr = nvl->dev;
|
||||
|
||||
count++;
|
||||
|
||||
@@ -2458,6 +2458,12 @@ nvidia_ioctl(
|
||||
{
|
||||
nv_ioctl_wait_open_complete_t *params = arg_copy;
|
||||
|
||||
if (arg_size != sizeof(nv_ioctl_wait_open_complete_t))
|
||||
{
|
||||
status = -EINVAL;
|
||||
goto done_early;
|
||||
}
|
||||
|
||||
params->rc = nvlfp->open_rc;
|
||||
params->adapterStatus = nvlfp->adapter_status;
|
||||
goto done_early;
|
||||
@@ -2538,8 +2544,12 @@ nvidia_ioctl(
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* atomically check and alloc attached_gpus */
|
||||
down(&nvl->ldata_lock);
|
||||
|
||||
if (nvlfp->num_attached_gpus != 0)
|
||||
{
|
||||
up(&nvl->ldata_lock);
|
||||
status = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
@@ -2547,12 +2557,15 @@ nvidia_ioctl(
|
||||
NV_KMALLOC(nvlfp->attached_gpus, arg_size);
|
||||
if (nvlfp->attached_gpus == NULL)
|
||||
{
|
||||
up(&nvl->ldata_lock);
|
||||
status = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
memcpy(nvlfp->attached_gpus, arg_copy, arg_size);
|
||||
nvlfp->num_attached_gpus = num_arg_gpus;
|
||||
|
||||
up(&nvl->ldata_lock);
|
||||
|
||||
for (i = 0; i < nvlfp->num_attached_gpus; i++)
|
||||
{
|
||||
if (nvlfp->attached_gpus[i] == 0)
|
||||
@@ -2568,9 +2581,14 @@ nvidia_ioctl(
|
||||
nvidia_dev_put(nvlfp->attached_gpus[i], sp);
|
||||
}
|
||||
|
||||
/* atomically free attached_gpus */
|
||||
down(&nvl->ldata_lock);
|
||||
|
||||
NV_KFREE(nvlfp->attached_gpus, arg_size);
|
||||
nvlfp->num_attached_gpus = 0;
|
||||
|
||||
up(&nvl->ldata_lock);
|
||||
|
||||
status = -EINVAL;
|
||||
break;
|
||||
}
|
||||
@@ -4504,18 +4522,18 @@ nvidia_suspend(
|
||||
|
||||
down(&nvl->ldata_lock);
|
||||
|
||||
if (!nv->is_pm_supported)
|
||||
{
|
||||
status = NV_ERR_NOT_SUPPORTED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (((nv->flags & NV_FLAG_OPEN) == 0) &&
|
||||
((nv->flags & NV_FLAG_PERSISTENT_SW_STATE) == 0))
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (nv->is_pm_unsupported)
|
||||
{
|
||||
status = NV_ERR_NOT_SUPPORTED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ((nv->flags & NV_FLAG_SUSPENDED) != 0)
|
||||
{
|
||||
nvl->suspend_count++;
|
||||
|
||||
Reference in New Issue
Block a user