The MODULE_IMPORT_NS macro adds a namespace tag to the module
information. The DMA_BUF namespace is required for Linux v5.16+ kernels
for drivers that use DMA BUF, there is no reason not to populate this
for earlier kernels. Furthermore, some 3rd party kernels prior to v5.16
may require this too and so drop the version check around the DMA BUF
namespace.
Bug 4119327
Change-Id: If8a5e90340f7a0582247cb91611d275ec1f4990e
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979260
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Determining whether the header file iosys-map.h is present in the kernel
is currently determine by kernel version. However, for Linux v5.15,
iosys-map.h has been backported in order to support simple-framebuffer
for early display. Therefore, we cannot rely on the kernel version to
indicate whether iosys-map is present. This is also true for 3rd party
Linux kernels that backport changes as well. Fix this by adding a
compile time flag, that will be set accordingly by the conftest script
if this header is present.
Bug 4119327
Bug 4228080
Change-Id: Ibd814285b2a07932ede2fbe9e6dc8fd03039d0c3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2971954
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Remove the module pointer from the class_create() based
on following change in core kernel
======
driver core: class: remove module * from class_create()
The module pointer in class_create() never actually did anything, and it
shouldn't have been requred to be set as a parameter even if it did
something. So just remove it and fix up all callers of the function in
the kernel tree at the same time.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
=====
Bug 4276500
Change-Id: Ifa0a92a282151ce12dc4a48f4f4b5b9499d3fbd8
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2976600
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Avoid using suspend_freq to set the Fmax for the device, since it will
re-enable the actmon watermark interrupts again if the suspend_freq is
not zero in the devfreq_suspend_device call.
Since we want to make sure device is running at Fmax but avoid using
suspend_freq, we can forcelly override the resume_freq with the
scaling_max_freq to reach the same effect.
Bug 4271562
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ia19a7ef9de14643abf1b174b6180e40a847de132
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974074
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Add more checks in nvmap code so as to avoid any possible races.
- Update is_nvmap_id_ro and is_nvmap_dmabuf_fd_ro functions so that they
return error value during error conditions and also update their callers
to handle those error values.
- Move all trace statements from end of the function to before handle
refcount or dup count is decremented, this make sure we are not
dereferencing any freed handle/reference/dambuf.
- Increment ref's dup count wherever we feel data race is possible, and
decrement it accordingly towards end of function.
Bug 4253911
Change-Id: I50fc7cc98ebbf3c50025bc2f9ca32882138fb272
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2972602
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The script conftest.sh can be used at build time to determine which
kernel headers or versions of kernel functions/macros are present in the
kernel that drivers are being compiled against. This is useful for cases
where changes are backported from upstream Linux kernels that may change
kernel functions and so we can no longer rely on the kernel version to
indicate which version of the kernel function to use.
The conftest.h header file is a top-level header file that includes all
the header files that are generated by the conftest.sh script. This
header file can be included by drivers so that they can use the various
definitions that are generated by conftest.sh. This file is located
along with the conftest.sh script because this is copied to the output
directory where all the generated header files are placed.
Bug 4119327
Bug 4228080
Change-Id: I781884e359e9688640661548620e01a178debac9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2974065
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
The suspend_freq is a fixed value for devfreq core, while the
resume_freq will be changed dynamically based on the last previous
updated frequency value of the device.
When device is put into suspend mode, devfreq core will update the
resume frequency with the suspend frequency. Therefore, when the device
is resumed back again, it will run at suspend_freq.
Forcelly set the suspend_freq as Fmax so that device will run at Fmax
when it is resumed back.
Bug 4269900
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Ic6511613ae5d02831a66dd1c2a93f21c142bf3a7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2973229
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Fix issues about unused value of err and overwriting write_size
value.
write_size:
assigned_value: Assigning value from err to write_size here, but that
stored value is overwritten before it can be used.
...
value_overwrite: Overwriting previous write to write_size with value
from copied.
err:
returned_value: Assigning value from nvvc_process_rxdataavaiable()
to err here, but that stored value is overwritten before
it can be used.
CID 10174057
CID 10174058
Bug 3952896
Change-Id: I21ef42b7c1c3fec83e558f80d954b65dbb14a5b8
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2969244
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
- smmu and hsp support added for fsicom multi core
feature in fsicom kernel driver
- probe, suspend and resume will be called for smmu_inst
0 only as it will have single dev node for comm.
- mailbox 2,5 and 1,4 is used for TX and RX comm. respectively
with FSI
Jira SS-5744
Change-Id: I859d5945853195ba76996a8c36ca19efd9c4409f
Signed-off-by: pshaw <pshaw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952268
Reviewed-by: Praveen James <pjames@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The original resume_freq will be overridden when the device is put
into suspend mode. Therefore, the resume cycle won't always use the
max frequency of the device to set the actmon count weight.
Change the implementation to use scaling_max_freq to always use the
max frequency of the device to set the actmon count weight.
Bug 4252125
Signed-off-by: Johnny Liu <johnliu@nvidia.com>
Change-Id: Iaaae8ada989cd1ed7dd728fb526ad4391a2f192c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2967098
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
In Android's user-build, debugfs is not configured. This has led to
multiple warning errors related to Debugfs usage in the nvidia-oot
build. Add CONFIG_DEBUG_FS conditional compilation around the
functions that use it.
drivers/scsi/ufs/ufs-tegra-common.c:39:13: error: unused function
'ufs_tegra_init_debugfs' [-Werror,-Wunused-function]
static void ufs_tegra_init_debugfs(struct ufs_hba *hba)
^
1 error generated.
drivers/platform/tegra/aon/tegra-aon-debug.c:732:13:
error: unused function 'tegra_aondbg_recv_msg'
[-Werror,-Wunused-function]
static void tegra_aondbg_recv_msg(struct mbox_client *cl, void *rx_msg)
^
drivers/platform/tegra/aon/tegra-aon-debug.c:749:12:
error: unused function 'aon_dbg_init' [-Werror,-Wunused-function]
static int aon_dbg_init(struct tegra_aondbg *aon)
^
2 errors generated.
Bug 4230728
Change-Id: I4210c3574b4d76205fdca45990e9ccc02c18620a
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2964635
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Simplify the MC-HWPM driver and fix the hang seen during probe of it.
These changes are made to scale the driver for future SOCs as well.
The hang is seen because MC registers are accessed in function
get_platform_dram_num_channels() before the MC aperture is io-mapped.
Bug 4235766
Change-Id: I3c8f9229898ac459c616aca0ef400a8b4c16e66a
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2963195
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>