Commit Graph

3 Commits

Author SHA1 Message Date
Jon Hunter
040c0ad65f drivers: nv-p2p: Drop get_user_pages_locked
The nv-p2p driver does not compile against pre-v5.15 kernels and the
following error is seen ...

 drivers/nv-p2p/nvidia-p2p.c:153:24: error: passing argument 1 of
 'mmap_read_lock' from incompatible pointer type
 [-Werror=incompatible-pointer-types]
  153 |         mmap_read_lock(&current->mm);
      |                        ^~~~~~~~~~~~
      |                        |
      |                        struct mm_struct **

The version of the function get_user_pages_unlocked() used in the nv-p2p
driver has been support since v4.6 and so drop usage of
get_user_pages_locked() completely.

Bug 4142533

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I957197825ddee6b705626b345aaff4647de08533
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983961
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-28 21:44:29 -07:00
Sumit Gupta
8a3c5d434b drivers: nv-p2p: fix compilation error in Nvidia Tegra P2P driver
Fix compilation error on making Nvidia Tegra P2P Driver as OOT.
Error coming because the get_user_pages_locked() API is removed now.
 https://lore.kernel.org/all/20220204020010.68930-6-jhubbard@nvidia.com/T/#mebb2b2dd622f702e76120aeca7896a4fd184d5c1

 kernel-oot/kernel-nvidia-oot/nvidia-oot/drivers/nv-p2p/nvidia-p2p.c
 :169:43: error: implicit declaration of function
 _get_user_pages_locked_; did you mean _get_user_pages_unlocked_?
 [-Werror=implicit-function-declaration]
  169 | user_pages = safe_cast_s64_to_s32(get_user_pages_locked
        (vaddr & PAGE_MASK, nr_pages,
      |                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                   get_user_pages_unlocked
 cc1: all warnings being treated as errors

Bug 4142533

Change-Id: Ic368ec288560f8f3c0acea29cfc935059ce2857e
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978104
Reviewed-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-21 21:24:10 -07:00
Sumit Gupta
c10e9dee5c drivers: nv-p2p: Move Nvidia Tegra P2P Driver to OOT
Make Nvidia Tegra P2P driver for RDMA as an OOT module.
The driver was earlier merged in Kernel-5.10 in the below cl.
 https://git-master.nvidia.com/r/c/linux-nvgpu/+/1821407

Bug 4142533

Change-Id: I6b24b44832d45fa5abedcd04c94d5d1e2576a6a3
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2978103
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-21 21:24:05 -07:00