From 441dbba86f5fa4305672760b454bdf77d07684aa Mon Sep 17 00:00:00 2001
From: Alberto Milone <alberto.milone@canonical.com>
Date: Thu, 26 Sep 2019 11:52:09 +0200
Subject: [PATCH 1/1] Do not call pci_save_state() when suspending on Linux >=
 4.15.0-54

Fixes LP: #1836630
---
 nvidia/nv.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/nvidia/nv.c b/nvidia/nv.c
index 06e4b6c..9ebc359 100644
--- a/nvidia/nv.c
+++ b/nvidia/nv.c
@@ -4202,7 +4202,15 @@ nv_power_management(

             nv_disable_pat_support();

+#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 15, 0)
+#if LINUX_VERSION_CODE == KERNEL_VERSION(4, 15, 0) && \
+    defined(UTS_UBUNTU_RELEASE_ABI) && \
+    UTS_UBUNTU_RELEASE_ABI > 54/* Ubuntu kernel ABI */
+#else
+            /* Save state */
             pci_save_state(nvl->pci_dev);
+#endif/* End Ubuntu kernel ABI */
+#endif /* End <= 4.15 */
             break;
         }
         case NV_PM_ACTION_RESUME:
--
2.20.1

