Get rid of the broken 5.18 patch. 5.18 RC users can reportedly use the latest 510 series driver as is.

pull/101/head
Tk-Glitch 2 years ago
parent 14718bb2a3
commit 420b64bc83

@ -293,7 +293,6 @@ source=($_source_name
'kernel-5.16.patch' # 5.16 workaround
'kernel-5.16-std.diff' # 5.16 workaround for 470.6x
'kernel-5.17.patch' # 5.17 workaround
'kernel-5.18.patch' # 5.18 workaround
)
msg2 "Selected driver integrity check behavior (md5sum or SKIP): $_md5sum" # If the driver is "known", return md5sum. If it isn't, return SKIP
@ -333,8 +332,7 @@ md5sums=("$_md5sum"
'f5fd091893f513d2371654e83049f099'
'd684ca11fdc9894c14ead69cb35a5946'
'0f987607c98eb6faeb7d691213de6a70'
'a70bc9cbbc7e8563b48985864a11de71'
'8d8ee9f89cfd18f8b3b9f64c2c7630e9')
'a70bc9cbbc7e8563b48985864a11de71')
if [ "$_autoaddpatch" = "true" ]; then
# Auto-add *.patch files from $startdir to source=()
@ -679,12 +677,6 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf
_whitelist517=( 470.62.* 495*)
fi
# 5.18
if (( $(vercmp "$_kernel" "5.18") >= 0 )); then
_kernel518="1"
_whitelist518=( 470.62.* 495* 510*)
fi
# Loop patches (linux-4.15.patch, lol.patch, ...)
for _p in $(printf -- '%s\n' ${source[@]} | grep .patch); do # https://stackoverflow.com/a/21058239/1821548
# Patch version (4.15, "", ...)
@ -747,9 +739,6 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf
if [ "$_patch" = "5.17" ]; then
_whitelist=(${_whitelist517[@]})
fi
if [ "$_patch" = "5.18" ]; then
_whitelist=(${_whitelist518[@]})
fi
patchy=0
if (( $(vercmp "$_kernel" "$_patch") >= 0 )); then
@ -1084,20 +1073,6 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf
fi
fi
# 5.17
if [ "$_kernel518" = "1" ]; then
patchy=0
for yup in "${_whitelist518[@]}"; do
[[ $pkgver = $yup ]] && patchy=1
done
if [ "$patchy" = "1" ]; then
msg2 "Applying kernel-5.18.patch for dkms..."
patch -Np1 -i "$srcdir"/kernel-5.18.patch
else
msg2 "Skipping kernel-5.18.patch as it doesn't apply to this driver version..."
fi
fi
# Legacy quirks
if [ "$_oldstuff" = "1" ]; then
msg2 "Applying 01-ipmi-vm.diff for dkms..."

@ -1,101 +0,0 @@
diff --git a/kernel-dkms/nvidia/nv.c b/kernel-dkms/nvidia/nv.c
--- a/kernel-dkms/nvidia/nv.c
+++ b/kernel-dkms/nvidia/nv.c
@@ -22,6 +22,7 @@
*/
#include "nvmisc.h"
+#include "linux/dma-mapping.h"
#include "os-interface.h"
#include "nv-linux.h"
#include "nv-p2p.h"
@@ -2765,13 +2766,13 @@
*/
if (!nvl->tce_bypass_enabled)
{
- pci_set_dma_mask(nvl->pci_dev, new_mask);
+ dma_set_mask(&nvl->pci_dev->dev, new_mask);
/* Certain kernels have a bug which causes pci_set_consistent_dma_mask
* to call GPL sme_active symbol, this bug has already been fixed in a
* minor release update but detect the failure scenario here to prevent
* an installation regression */
#if !NV_IS_EXPORT_SYMBOL_GPL_sme_active
- pci_set_consistent_dma_mask(nvl->pci_dev, new_mask);
+ dma_set_coherent_mask(&nvl->pci_dev->dev, new_mask);
#endif
}
}
diff --git a/kernel-dkms/nvidia/linux_nvswitch.c b/kernel-dkms/nvidia/linux_nvswitch.c
--- a/kernel-dkms/nvidia/linux_nvswitch.c
+++ b/kernel-dkms/nvidia/linux_nvswitch.c
@@ -24,6 +24,7 @@
#include <linux/version.h>
+#include "linux/dma-direction.h"
#include "conftest.h"
#include "nvlink_errors.h"
#include "nvlink_linux.h"
@@ -2140,11 +2139,11 @@
)
{
if (direction == NVSWITCH_DMA_DIR_TO_SYSMEM)
- return PCI_DMA_FROMDEVICE;
+ return DMA_FROM_DEVICE;
else if (direction == NVSWITCH_DMA_DIR_FROM_SYSMEM)
- return PCI_DMA_TODEVICE;
+ return DMA_TO_DEVICE;
else
- return PCI_DMA_BIDIRECTIONAL;
+ return DMA_BIDIRECTIONAL;
}
NvlStatus
@@ -2165,9 +2164,9 @@
dma_dir = _nvswitch_to_pci_dma_direction(direction);
- *dma_handle = (NvU64)pci_map_single(pdev, cpu_addr, size, dma_dir);
+ *dma_handle = (NvU64)dma_map_single(&pdev->dev, cpu_addr, size, (enum dma_data_direction) dma_dir);
- if (pci_dma_mapping_error(pdev, *dma_handle))
+ if (dma_mapping_error(&pdev->dev, *dma_handle))
{
pr_err("nvidia-nvswitch: unable to create PCI DMA mapping\n");
return -NVL_ERR_GENERIC;
@@ -2194,7 +2193,7 @@
dma_dir = _nvswitch_to_pci_dma_direction(direction);
- pci_unmap_single(pdev, dma_handle, size, dma_dir);
+ dma_unmap_single(&pdev->dev, dma_handle, size, (enum dma_data_direction) dma_dir);
return NVL_SUCCESS;
}
@@ -2211,7 +2210,7 @@
if (!pdev)
return -NVL_BAD_ARGS;
- if (pci_set_dma_mask(pdev, DMA_BIT_MASK(dma_addr_width)))
+ if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(dma_addr_width)))
return -NVL_ERR_GENERIC;
return NVL_SUCCESS;
@@ -2234,7 +2233,7 @@
dma_dir = _nvswitch_to_pci_dma_direction(direction);
- pci_dma_sync_single_for_cpu(pdev, dma_handle, size, dma_dir);
+ dma_sync_single_for_cpu(&pdev->dev, dma_handle, size, dma_dir);
return NVL_SUCCESS;
}
@@ -2256,7 +2255,7 @@
dma_dir = _nvswitch_to_pci_dma_direction(direction);
- pci_dma_sync_single_for_device(pdev, dma_handle, size, dma_dir);
+ dma_sync_single_for_device(&pdev->dev, dma_handle, size, (enum dma_data_direction)dma_dir);
return NVL_SUCCESS;
}
Loading…
Cancel
Save