Package: nvidia-legacy-340xx-kernel-dkms Version: 340.108-17 Severity: important Tags: patch X-Debbugs-Cc: vej...@gmail.com
Dear Maintainer, * What led up to the situation? When compiling the module when installing a 6.2 linux kernel, the dkms modules compilation failed with: nv-acpi.c:84:19: error: initialization of ‘void (*)(struct acpi_device *)’ from incompatible pointer type ‘int (*)(struct acpi_device *, int)’ [-Werror=incompatible-pointer-types] 84 | .remove = nv_acpi_remove_two_args, | ^~~~~~~~~~~~~~~~~~~~~~~ * What exactly did you do (or not do) that was effective (or ineffective)? The fix is applying this patch: https://gist.github.com/vejeta/86e570b0a431b3f8d26911be506323ae by copying it to: /usr/src/nvidia-legacy-340xx-340.108/patches and adding the file name "nvidia-340xx-fix-linux-6.2.patch" to line 12 in /usr/src/nvidia-legacy-340xx-340.108/dkms.conf like: PATCH=(bashisms.patch 0001-backport-error-on-unknown-conftests.patch 0002-backport-error-on-unknown-conftests-uvm-part.patch unregister_procfs_on_failure.patch kmem_cache_create_usercopy.patch buil nvidia-340xx-fix-linux-6.2.patch) * What was the outcome of this action? The kernel could compile the nvidia 340 module and the system worked perfectly after it. -- System Information: Debian Release: bookworm/sid APT prefers testing-security APT policy: (500, 'testing-security'), (500, 'testing') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 6.2.5-x64v3-xanmod1 (SMP w/8 CPU threads; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to es_ES.UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
From: Juan Manuel Méndez Rey <vej...@gmail.com> Date: Mon, 13 Mar 2023 15:49:30 +0000 Subject: [PATCH] Tentative fix for NVIDIA 340.108 DKMS source for Linux 6.2 Credit goes to Joan Bruguera <joanbruge...@gmail.com> for the inspiration patch: "Tentative fix for NVIDIA 470.161.03 driver for Linux 6.2" --- nv-acpi.c | 19 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/nv-acpi.c b/nv-acpi.c index 07501eb..1fdf71c 100644 --- a/nv-acpi.c +++ b/nv-acpi.c @@ -8,6 +8,7 @@ * _NVRM_COPYRIGHT_END_ */ +#include <linux/version.h> #define __NO_VERSION__ #include "os-interface.h" @@ -24,7 +25,10 @@ static NV_STATUS nv_acpi_extract_object (const union acpi_object *, void *, N static int nv_acpi_add (struct acpi_device *); -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2) +// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)) +static void nv_acpi_remove_one_arg_void(struct acpi_device *device); +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2) static int nv_acpi_remove_two_args(struct acpi_device *device, int type); #else static int nv_acpi_remove_one_arg(struct acpi_device *device); @@ -80,7 +84,10 @@ static const struct acpi_driver nv_acpi_driver_template = { .ids = nv_video_device_ids, .ops = { .add = nv_acpi_add, -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2) +// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)) + .remove = nv_acpi_remove_one_arg_void, +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2) .remove = nv_acpi_remove_two_args, #else .remove = nv_acpi_remove_one_arg, @@ -342,7 +349,10 @@ static int nv_acpi_add(struct acpi_device *device) return 0; } -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2) +// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)) +static void nv_acpi_remove_one_arg_void(struct acpi_device *device) +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2) static int nv_acpi_remove_two_args(struct acpi_device *device, int type) #else static int nv_acpi_remove_one_arg(struct acpi_device *device) @@ -396,7 +406,10 @@ static int nv_acpi_remove_one_arg(struct acpi_device *device) device->driver_data = NULL; } +// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)) return status; +#endif } /* -- 2.39.0