Skip to content

Commit 9855350

Browse files
committed
515.65.01
1 parent 1e2a1b5 commit 9855350

File tree

35 files changed

+382
-263
lines changed

35 files changed

+382
-263
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Release 515 Entries
44

5+
### [515.65.01] 2022-08-02
6+
7+
#### Fixed
8+
9+
- Collection of minor fixes to issues, [#6](https://github.com/NVIDIA/open-gpu-kernel-modules/pull/61) by @Joshua-Ashton
10+
- Remove unnecessary use of acpi_bus_get_device().
11+
512
### [515.57] 2022-06-28
613

714
#### Fixed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NVIDIA Linux Open GPU Kernel Module Source
22

33
This is the source release of the NVIDIA Linux open GPU kernel modules,
4-
version 515.57.
4+
version 515.65.01.
55

66

77
## How to Build
@@ -17,7 +17,7 @@ as root:
1717

1818
Note that the kernel modules built here must be used with gsp.bin
1919
firmware and user-space NVIDIA GPU driver components from a corresponding
20-
515.57 driver release. This can be achieved by installing
20+
515.65.01 driver release. This can be achieved by installing
2121
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
2222
option. E.g.,
2323

@@ -167,15 +167,15 @@ for the target kernel.
167167
## Compatible GPUs
168168

169169
The open-gpu-kernel-modules can be used on any Turing or later GPU
170-
(see the table below). However, in the 515.57 release,
170+
(see the table below). However, in the 515.65.01 release,
171171
GeForce and Workstation support is still considered alpha-quality.
172172

173173
To enable use of the open kernel modules on GeForce and Workstation GPUs,
174174
set the "NVreg_OpenRmEnableUnsupportedGpus" nvidia.ko kernel module
175175
parameter to 1. For more details, see the NVIDIA GPU driver end user
176176
README here:
177177

178-
https://us.download.nvidia.com/XFree86/Linux-x86_64/515.57/README/kernel_open.html
178+
https://us.download.nvidia.com/XFree86/Linux-x86_64/515.65.01/README/kernel_open.html
179179

180180
In the below table, if three IDs are listed, the first is the PCI Device
181181
ID, the second is the PCI Subsystem Vendor ID, and the third is the PCI
@@ -704,6 +704,8 @@ Subsystem Device ID.
704704
| NVIDIA RTX A5500 | 2233 10DE 165A |
705705
| NVIDIA RTX A5500 | 2233 17AA 165A |
706706
| NVIDIA A40 | 2235 10DE 145A |
707+
| NVIDIA A10 | 2236 10DE 1482 |
708+
| NVIDIA A10G | 2237 10DE 152F |
707709
| NVIDIA A10M | 2238 10DE 1677 |
708710
| NVIDIA GeForce RTX 3060 Ti | 2414 |
709711
| NVIDIA GeForce RTX 3080 Ti Laptop GPU | 2420 |

kernel-open/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
7272
EXTRA_CFLAGS += -I$(src)
7373
EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
7474
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
75-
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"515.57\"
75+
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"515.65.01\"
7676

7777
EXTRA_CFLAGS += -Wno-unused-function
7878

kernel-open/common/inc/nv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,7 @@ NvBool NV_API_CALL rm_disable_iomap_wc(void);
989989

990990
void NV_API_CALL rm_init_dynamic_power_management(nvidia_stack_t *, nv_state_t *, NvBool);
991991
void NV_API_CALL rm_cleanup_dynamic_power_management(nvidia_stack_t *, nv_state_t *);
992+
void NV_API_CALL rm_enable_dynamic_power_management(nvidia_stack_t *, nv_state_t *);
992993
NV_STATUS NV_API_CALL rm_ref_dynamic_power(nvidia_stack_t *, nv_state_t *, nv_dynamic_power_mode_t);
993994
void NV_API_CALL rm_unref_dynamic_power(nvidia_stack_t *, nv_state_t *, nv_dynamic_power_mode_t);
994995
NV_STATUS NV_API_CALL rm_transition_dynamic_power(nvidia_stack_t *, nv_state_t *, NvBool);

kernel-open/conftest.sh

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5288,22 +5288,6 @@ compile_test() {
52885288
rm -f conftest$$.c
52895289
;;
52905290

5291-
acpi_bus_get_device)
5292-
#
5293-
# Determine if the acpi_bus_get_device() function is present
5294-
#
5295-
# acpi_bus_get_device() was removed by commit ac2a3feefad5
5296-
# ("ACPI: bus: Eliminate acpi_bus_get_device()") in
5297-
# v5.18-rc2 (2022-04-05).
5298-
#
5299-
CODE="
5300-
#include <linux/acpi.h>
5301-
int conftest_acpi_bus_get_device(void) {
5302-
return acpi_bus_get_device();
5303-
}"
5304-
compile_check_conftest "$CODE" "NV_ACPI_BUS_GET_DEVICE_PRESENT" "" "functions"
5305-
;;
5306-
53075291
dma_resv_add_fence)
53085292
#
53095293
# Determine if the dma_resv_add_fence() function is present.
@@ -5365,6 +5349,23 @@ compile_test() {
53655349
compile_check_conftest "$CODE" "NV_RESERVATION_OBJECT_RESERVE_SHARED_HAS_NUM_FENCES_ARG" "" "types"
53665350
;;
53675351

5352+
get_task_ioprio)
5353+
#
5354+
# Determine if the __get_task_ioprio() function is present.
5355+
#
5356+
# __get_task_ioprio was added by commit 893e5d32d583
5357+
# ("block: Generalize get_current_ioprio() for any task") for
5358+
# v5.20 linux-next (2022-06-23).
5359+
#
5360+
CODE="
5361+
#include <linux/ioprio.h>
5362+
void conftest_get_task_ioprio(void) {
5363+
__get_task_ioprio();
5364+
}"
5365+
5366+
compile_check_conftest "$CODE" "NV_GET_TASK_IOPRIO_PRESENT" "" "functions"
5367+
;;
5368+
53685369
# When adding a new conftest entry, please use the correct format for
53695370
# specifying the relevant upstream Linux kernel commit.
53705371
#

kernel-open/nvidia/nv-acpi.c

Lines changed: 17 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -715,28 +715,18 @@ NV_STATUS NV_API_CALL nv_acpi_ddc_method(
715715
)
716716
{
717717
acpi_status status;
718-
struct acpi_device *device = NULL;
719718
union acpi_object *ddc = NULL;
720-
struct list_head *node, *next;
721719
NvU32 i, largestEdidSize;
722720
acpi_handle dev_handle = NULL;
723721
acpi_handle lcd_dev_handle = NULL;
722+
acpi_handle handle = NULL;
724723

725724
if (!nv_acpi_get_device_handle(nv, &dev_handle))
726725
return NV_ERR_NOT_SUPPORTED;
727726

728727
if (!dev_handle)
729728
return NV_ERR_INVALID_ARGUMENT;
730729

731-
#if defined(NV_ACPI_BUS_GET_DEVICE_PRESENT)
732-
status = acpi_bus_get_device(dev_handle, &device);
733-
#else
734-
return NV_ERR_NOT_SUPPORTED;
735-
#endif
736-
737-
if (ACPI_FAILURE(status) || !device)
738-
return NV_ERR_INVALID_ARGUMENT;
739-
740730
if (!NV_MAY_SLEEP())
741731
{
742732
#if defined(DEBUG)
@@ -747,16 +737,16 @@ NV_STATUS NV_API_CALL nv_acpi_ddc_method(
747737
return NV_ERR_NOT_SUPPORTED;
748738
}
749739

750-
list_for_each_safe(node, next, &device->children)
740+
while (lcd_dev_handle == NULL)
751741
{
752742
unsigned long long device_id = 0;
753-
struct acpi_device *dev =
754-
list_entry(node, struct acpi_device, node);
755743

756-
if (!dev)
757-
continue;
744+
status = acpi_get_next_object(ACPI_TYPE_DEVICE, dev_handle,
745+
handle, &handle);
746+
if (ACPI_FAILURE(status) || (handle == NULL))
747+
break;
758748

759-
status = acpi_evaluate_integer(dev->handle, "_ADR", NULL, &device_id);
749+
status = acpi_evaluate_integer(handle, "_ADR", NULL, &device_id);
760750
if (ACPI_FAILURE(status))
761751
/* Couldnt query device_id for this device */
762752
continue;
@@ -766,16 +756,13 @@ NV_STATUS NV_API_CALL nv_acpi_ddc_method(
766756
case 0x0118:
767757
case 0x0400:
768758
case 0xA420:
769-
lcd_dev_handle = dev->handle;
759+
lcd_dev_handle = handle;
770760
nv_printf(NV_DBG_INFO, "NVRM: %s Found LCD: %x\n",
771761
__FUNCTION__, device_id);
772762
break;
773763
default:
774764
break;
775765
}
776-
777-
if (lcd_dev_handle != NULL)
778-
break;
779766
}
780767

781768
if (lcd_dev_handle == NULL)
@@ -1125,15 +1112,14 @@ NV_STATUS NV_API_CALL nv_acpi_mux_method(
11251112
)
11261113
{
11271114
acpi_status status;
1128-
struct acpi_device *device = NULL;
11291115
struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
11301116
union acpi_object *mux = NULL;
11311117
union acpi_object mux_arg = { ACPI_TYPE_INTEGER };
11321118
struct acpi_object_list input = { 1, &mux_arg };
11331119
acpi_handle dev_handle = NULL;
11341120
acpi_handle mux_dev_handle = NULL;
1121+
acpi_handle handle = NULL;
11351122
unsigned long long device_id = 0;
1136-
struct list_head *node, *next;
11371123

11381124
if ((strcmp(pMethodName, "MXDS") != 0)
11391125
&& (strcmp(pMethodName, "MXDM") != 0))
@@ -1154,16 +1140,6 @@ NV_STATUS NV_API_CALL nv_acpi_mux_method(
11541140
if (!dev_handle)
11551141
return NV_ERR_INVALID_ARGUMENT;
11561142

1157-
#if defined(NV_ACPI_BUS_GET_DEVICE_PRESENT)
1158-
status = acpi_bus_get_device(dev_handle, &device);
1159-
#else
1160-
return NV_ERR_NOT_SUPPORTED;
1161-
#endif
1162-
1163-
1164-
if (ACPI_FAILURE(status) || !device)
1165-
return NV_ERR_INVALID_ARGUMENT;
1166-
11671143
if (!NV_MAY_SLEEP())
11681144
{
11691145
#if defined(DEBUG)
@@ -1172,23 +1148,16 @@ NV_STATUS NV_API_CALL nv_acpi_mux_method(
11721148
return NV_ERR_NOT_SUPPORTED;
11731149
}
11741150

1175-
list_for_each_safe(node, next, &device->children)
1151+
while (mux_dev_handle == NULL)
11761152
{
1177-
struct acpi_device *dev = list_entry(node, struct acpi_device, node);
1178-
1179-
if (!dev)
1180-
continue;
1181-
1182-
status = acpi_evaluate_integer(dev->handle, "_ADR", NULL, &device_id);
1183-
if (ACPI_FAILURE(status))
1184-
/* Could not query device_id for this device */
1185-
continue;
1186-
1187-
if (device_id == muxAcpiId)
1188-
{
1189-
mux_dev_handle = dev->handle;
1153+
status = acpi_get_next_object(ACPI_TYPE_DEVICE, dev_handle,
1154+
handle, &handle);
1155+
if (ACPI_FAILURE(status) || (handle == NULL))
11901156
break;
1191-
}
1157+
1158+
status = acpi_evaluate_integer(handle, "_ADR", NULL, &device_id);
1159+
if (ACPI_SUCCESS(status) && (device_id == muxAcpiId))
1160+
mux_dev_handle = handle;
11921161
}
11931162

11941163
if (mux_dev_handle == NULL)

kernel-open/nvidia/nv-dmabuf.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,12 @@ nv_dma_buf_reuse(
797797
}
798798

799799

800-
801-
802-
803-
804-
805-
800+
if (buf->ops != &nv_dma_buf_ops)
801+
{
802+
nv_printf(NV_DBG_ERRORS, "NVRM: Invalid dma-buf fd\n");
803+
status = NV_ERR_INVALID_ARGUMENT;
804+
goto cleanup_dmabuf;
805+
}
806806

807807

808808
priv = buf->priv;

kernel-open/nvidia/nv-pci.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,13 @@ nv_pci_probe
608608
dev_pm_set_driver_flags(nvl->dev, DPM_FLAG_NEVER_SKIP);
609609
#endif
610610

611+
/*
612+
* Dynamic power management should be enabled as the last step.
613+
* Kernel runtime power management framework can put the device
614+
* into the suspended state. Hardware register access should not be done
615+
* after enabling dynamic power management.
616+
*/
617+
rm_enable_dynamic_power_management(sp, nv);
611618
nv_kmem_cache_free_stack(sp);
612619

613620
return 0;
@@ -683,8 +690,9 @@ nv_pci_remove(struct pci_dev *pci_dev)
683690
if ((NV_ATOMIC_READ(nvl->usage_count) != 0) && !(nv->is_external_gpu))
684691
{
685692
nv_printf(NV_DBG_ERRORS,
686-
"NVRM: Attempting to remove minor device %u with non-zero usage count!\n",
687-
nvl->minor_num);
693+
"NVRM: Attempting to remove device %04x:%02x:%02x.%x with non-zero usage count!\n",
694+
NV_PCI_DOMAIN_NUMBER(pci_dev), NV_PCI_BUS_NUMBER(pci_dev),
695+
NV_PCI_SLOT_NUMBER(pci_dev), PCI_FUNC(pci_dev->devfn));
688696

689697
/*
690698
* We can't return from this function without corrupting state, so we wait for
@@ -708,9 +716,10 @@ nv_pci_remove(struct pci_dev *pci_dev)
708716
if (!nvl)
709717
{
710718
/* The device was not found, which should not happen */
711-
nv_printf(NV_DBG_ERRORS, "NVRM: Failed removal of minor device! %04x:%02x:%02x.%x\n",
719+
nv_printf(NV_DBG_ERRORS,
720+
"NVRM: Failed removal of device %04x:%02x:%02x.%x!\n",
712721
NV_PCI_DOMAIN_NUMBER(pci_dev), NV_PCI_BUS_NUMBER(pci_dev),
713-
NV_PCI_SLOT_NUMBER(pci_dev), PCI_FUNC(pci_dev->devfn));
722+
NV_PCI_SLOT_NUMBER(pci_dev), PCI_FUNC(pci_dev->devfn));
714723
WARN_ON(1);
715724
goto done;
716725
}
@@ -719,8 +728,9 @@ nv_pci_remove(struct pci_dev *pci_dev)
719728
}
720729

721730
nv_printf(NV_DBG_ERRORS,
722-
"NVRM: Continuing with GPU removal for minor device %u\n",
723-
nvl->minor_num);
731+
"NVRM: Continuing with GPU removal for device %04x:%02x:%02x.%x\n",
732+
NV_PCI_DOMAIN_NUMBER(pci_dev), NV_PCI_BUS_NUMBER(pci_dev),
733+
NV_PCI_SLOT_NUMBER(pci_dev), PCI_FUNC(pci_dev->devfn));
724734
}
725735

726736
rm_check_for_gpu_surprise_removal(sp, nv);

kernel-open/nvidia/nv.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5443,7 +5443,19 @@ NvBool NV_API_CALL nv_s2idle_pm_configured(void)
54435443
return NV_FALSE;
54445444
}
54455445

5446+
/*
5447+
* init_sync_kiocb() internally uses GPL licensed __get_task_ioprio() from
5448+
* v5.20-rc1.
5449+
*/
5450+
#if defined(NV_GET_TASK_IOPRIO_PRESENT)
5451+
memset(&kiocb, 0, sizeof(kiocb));
5452+
kiocb.ki_filp = file;
5453+
kiocb.ki_flags = iocb_flags(file);
5454+
kiocb.ki_ioprio = IOPRIO_DEFAULT;
5455+
#else
54465456
init_sync_kiocb(&kiocb, file);
5457+
#endif
5458+
54475459
kiocb.ki_pos = 0;
54485460
iov_iter_kvec(&iter, READ, &iov, 1, sizeof(buf));
54495461

kernel-open/nvidia/nvidia.Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_ops_has_map_atomic
199199
NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_has_dynamic_attachment
200200
NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_buf_attachment_has_peer2peer
201201
NV_CONFTEST_FUNCTION_COMPILE_TESTS += dma_set_mask_and_coherent
202-
NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_bus_get_device
202+
NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_task_ioprio
203203

204204
NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_gpl_of_node_to_nid
205205
NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_gpl_sme_active

0 commit comments

Comments
 (0)