The perforce version of the MODS kernel driver
does not pull in any of the Tegra specific driver
functions. This prevents the perforce driver
from being compiled on any Tegra system or non
Tegra system with CONFIG_ARCH_TEGRA=y.
To allow the perforce driver to be compiled
replace CONFIG_ARCH_TEGRA with MODS_HAS_TEGRA
which is set based on CONFIG_ARCH_TEGRA in git
but left unset in perforce.
Bug 3397113
Signed-off-by: Lael Jones <lajones@nvidia.com>
Change-Id: Ie113d632c4dcc372058b9a1e3a549a70b8f7c03f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2607859
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
To allocate larger buffer, MODS code is allocating noncontiguous pages
and then calls dma buffer api to do smmu mapping to get a continuous
iova address. This change will fix the error when the scatterlist's
dma address is 0xffffffffffffffff, skip checking the sg since it's
already merged to the head node.
JIRA: TM-129
Signed-off-by: Carl Dong <carld@nvidia.com>
Change-Id: I45aa3b0afcf5c86179fb293cd48326b14c2f3efc
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2552672
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Bug 200582229
This change will add smmu mapping/unmapping support for MODS
allocated memory buffer by using kernel smmu api dma_map_sg_attrs()
and dma_unmap_sg_attrs()
1. new IOCTL MODS_ESC_IOMMU_DMA_MAP_MEMORY and
MODS_ESC_IOMMU_DMA_UNMAP_MEMORY is added to do smmu mapping/unmapping
and get smmu mapped address for MODS allocated buffers;
2. a platform device and driver is added to match mods smmu sid in dtb,
the device is used to do smmu mapping/unampping; and mods smmu devices
are added in dtb to match with the driver with smmu config
Signed-off-by: Dong Qiang <carld@nvidia.com>
Change-Id: I47d4d1c43f14fc6b51f0c00cee127e1d51377f64
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2180897
Reviewed-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
* Add new cl_* macros for printing client-specific messages.
This adds client index to messages in code which is called from
user space. This makes it easier to diagnose errors when multiple
clients (processes) open the driver.
* Use kernel print levels appropriate to messages being printed.
* Print process pid when opening the driver.
* Print information about access token being set or released.
* Print information about PCI devices being enabled or disabled.
PCI device enablement is tied to the driver getting ownership
of the device. It also prevents multiple MODS instances from
owning the same PCI device.
* Print info about device DMA mask, print device DMA mask when DMA
mapping fails.
* Print more info about SRIOV actions.
* Disable SRIOV when the driver is being closed by the process
which enables SRIOV. Leaving SRIOV enabled when disabling PCI
device is an error and leads to stale functions, unusable on
subsequent MODS runs.
* Clean up log messages in a few places.
Change-Id: I51953e984a55c0990e90f89d8260f215c8c58498
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2279439
Tested-by: Ellis Roberts <ellisr@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Map pages to kernel space when clearing memory ranges requested
by userspace. This now seems to be required to clear cache on
kernel 4.9.
Use kmap_atomic assuming that cache clearing does not sleep.
Change-Id: Id1e5f615b41cc46801889766edf73ba34c6346c1
Signed-off-by: Chris Dragan <kdragan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1528123
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>