580.94.06

This commit is contained in:
russellcnv
2025-10-27 13:41:40 -07:00
parent 1babfa3dab
commit e2dbb3d99c
74 changed files with 55029 additions and 53585 deletions

View File

@@ -32,7 +32,8 @@ static inline int pci_devid_is_self_hosted_hopper(unsigned short devid)
static inline int pci_devid_is_self_hosted_blackwell(unsigned short devid)
{
return (devid >= 0x2940 && devid <= 0x297f) // GB100 Self-Hosted
|| (devid >= 0x31c0 && devid <= 0x31ff); // GB110 Self-Hosted
|| (devid >= 0x31c0 && devid <= 0x31ff) // GB110 Self-Hosted
|| (devid == 0x31a1); //
}
static inline int pci_devid_is_self_hosted(unsigned short devid)

View File

@@ -737,8 +737,6 @@ static NV_STATUS nv_acpi_evaluate_dsm_method(
rmStatus = nv_acpi_extract_object(dsm, pOutData, *pSize, &data_size);
*pSize = data_size;
kfree(output.pointer);
}
else
{
@@ -751,6 +749,7 @@ static NV_STATUS nv_acpi_evaluate_dsm_method(
"NVRM: %s: DSM data invalid!\n", __FUNCTION__);
}
kfree(output.pointer);
return rmStatus;
}
@@ -1183,6 +1182,7 @@ NvBool nv_acpi_power_resource_method_present(
(object_package->package.count != 0x1))
{
nv_printf(NV_DBG_ERRORS,"NVRM: _PR3 object is not a type 'package'\n");
kfree(buf.pointer);
return NV_FALSE;
}
@@ -1194,8 +1194,10 @@ NvBool nv_acpi_power_resource_method_present(
{
nv_printf(NV_DBG_ERRORS,
"NVRM: _PR3 object does not contain POWER Reference\n");
kfree(buf.pointer);
return NV_FALSE;
}
kfree(buf.pointer);
return NV_TRUE;
}
@@ -1325,6 +1327,7 @@ static acpi_status nv_acpi_find_battery_info(
if (object_package->type != ACPI_TYPE_PACKAGE)
{
nv_printf(NV_DBG_INFO, "NVRM: Battery method output is not package\n");
kfree(buf.pointer);
return AE_OK;
}
@@ -1350,11 +1353,13 @@ static acpi_status nv_acpi_find_battery_info(
if ((object_package->package.elements[battery_technology_offset].type != ACPI_TYPE_INTEGER) ||
(object_package->package.elements[battery_technology_offset].integer.value != BATTERY_RECHARGABLE))
{
kfree(buf.pointer);
return AE_OK;
}
battery_present = NV_TRUE;
kfree(buf.pointer);
/* Stop traversing acpi tree. */
return AE_CTRL_TERMINATE;
}

View File

@@ -71,6 +71,45 @@ void nvidia_modeset_resume(NvU32 gpuId)
}
}
void nvidia_modeset_remove(NvU32 gpuId)
{
if (nv_modeset_callbacks && nv_modeset_callbacks->remove)
{
nv_modeset_callbacks->remove(gpuId);
}
}
static void nvidia_modeset_get_gpu_info(nv_gpu_info_t *gpu_info,
const nv_linux_state_t *nvl)
{
nv_state_t *nv = NV_STATE_PTR(nvl);
int numa_status = nv_get_numa_status(nvl);
gpu_info->gpu_id = nv->gpu_id;
gpu_info->pci_info.domain = nv->pci_info.domain;
gpu_info->pci_info.bus = nv->pci_info.bus;
gpu_info->pci_info.slot = nv->pci_info.slot;
gpu_info->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->os_device_ptr = nvl->dev;
}
void nvidia_modeset_probe(const nv_linux_state_t *nvl)
{
if (nv_modeset_callbacks && nv_modeset_callbacks->probe)
{
nv_gpu_info_t gpu_info;
nvidia_modeset_get_gpu_info(&gpu_info, nvl);
nv_modeset_callbacks->probe(&gpu_info);
}
}
static NvU32 nvidia_modeset_enumerate_gpus(nv_gpu_info_t *gpu_info)
{
nv_linux_state_t *nvl;
@@ -82,9 +121,6 @@ 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
* are more GPUs than that.
@@ -96,19 +132,7 @@ static NvU32 nvidia_modeset_enumerate_gpus(nv_gpu_info_t *gpu_info)
break;
}
gpu_info[count].gpu_id = nv->gpu_id;
gpu_info[count].pci_info.domain = nv->pci_info.domain;
gpu_info[count].pci_info.bus = nv->pci_info.bus;
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;
nvidia_modeset_get_gpu_info(&gpu_info[count], nvl);
count++;
}

View File

@@ -1661,6 +1661,8 @@ nv_pci_probe
nv_kmem_cache_free_stack(sp);
nvidia_modeset_probe(nvl);
return 0;
goto err_free_all;
@@ -1760,6 +1762,8 @@ nv_pci_remove(struct pci_dev *pci_dev)
*/
nv_linux_stop_open_q(nvl);
nvidia_modeset_remove(nv->gpu_id);
LOCK_NV_LINUX_DEVICES();
down(&nvl->ldata_lock);
nv->flags |= NV_FLAG_PCI_REMOVE_IN_PROGRESS;
@@ -1899,14 +1903,18 @@ nv_pci_shutdown(struct pci_dev *pci_dev)
{
nv_linux_state_t *nvl = pci_get_drvdata(pci_dev);
if ((nvl != NULL) && nvl->is_forced_shutdown)
{
nvl->is_forced_shutdown = NV_FALSE;
return;
}
if (nvl != NULL)
{
nv_state_t *nv = NV_STATE_PTR(nvl);
if (nvl->is_forced_shutdown)
{
nvl->is_forced_shutdown = NV_FALSE;
return;
}
nvidia_modeset_remove(nv->gpu_id);
nvl->nv_state.is_shutdown = NV_TRUE;
}

View File

@@ -1335,6 +1335,18 @@ static int nv_platform_device_remove_wrapper(struct platform_device *pdev)
}
#endif
static void nv_platform_device_shutdown(struct platform_device *pdev)
{
nv_linux_state_t *nvl = platform_get_drvdata(pdev);
if (nvl != NULL && !nvl->is_forced_shutdown)
{
nv_state_t *nv = NV_STATE_PTR(nvl);
nvidia_modeset_remove(nv->gpu_id);
}
}
const struct of_device_id nv_platform_device_table[] =
{
{ .compatible = "nvidia,tegra234-display",},
@@ -1358,6 +1370,7 @@ struct platform_driver nv_platform_driver = {
},
.probe = nv_platform_device_probe,
.remove = nv_platform_device_remove_wrapper,
.shutdown = nv_platform_device_shutdown,
};
int nv_platform_count_devices(void)