When building the DLA KMD driver with GCC 13 the following error is
observed ...
drivers/video/tegra/host/nvdla/nvdla.c: In function ‘nvdla_remove’:
drivers/video/tegra/host/nvdla/nvdla.c:1229:13:
error: the comparison will always evaluate as ‘true’ for the address of
‘clk_cap_kobj’ will never be NULL [-Werror=address]
1229 | if (&pdata->clk_cap_kobj) {
| ^
The 'clk_cap_kobj' member of 'nvhost_device_data' structure is not a
pointer to a structure but a structure and so the address of the
structure is always true. Fix this by testing if the address of the
'clk_cap_attrs' member which is a pointer to memory that is allocated.
Bug 4190030
Change-Id: I8200155b4c0becab51924bcb4357c30163f62666
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934411
Tested-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ninad Malwade <nmalwade@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
OOT kerel builds do not use Kconfig files to define required
config flags. Thus, CONFIG_TEGRA_SOC_HWPM is not defined for OOT
configs. Remove use of CONFIG_TEGRA_SOC_HWPM flag from PVA, DLA
and FLCN drivers.
For OOT builds, HWPM driver is always compiled independent of
CONFIG_TEGRA_SOC_HWPM flag. For safety builds where HWPM
functionality is not allowed, mock HWPM functions will be used.
Bug 4061775
Change-Id: I49d8df6d3293e9bde9e233561363872fc41742f4
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2920819
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The DLA fuses are not exposed via nvmem for upstream Linux kernels and
so when booting upstream Linux kernels the following warnings are seen
for DLA:
nvdla 158c0000.nvdla1: nvmem_cell_get error -2. Assuming DLA instances
are available
nvdla 15880000.nvdla0: nvmem_cell_get error -2. Assuming DLA instances
are available
Disabling DLA instances for devices that don't support DLA is handled by
the bootloader and so for Linux kernel's greater than v5.10, it is not
necessary for the kernel driver to check this.
Bug 3795915
Change-Id: Icbd5e7c522a66a827fe1ed58ed2271a98497bbcd
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2870158
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
[1] For the OOT, there are no implementations for the prepare_suspend,
suspend, resume and complete_resume from the nvhost.
[2] This commit decouples the DLA dependency on the nvhost for the
suspend and the resume operations.
Bug 3977752
Bug 3978072
Change-Id: Ie8ae9d29873559e1c76331294e4c7dfd0ccf0237
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2857153
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
[1] When the multiple clients try to ping at the same time, the
KMD errors out for all clients except one. This behavior
is expected since there is only one command memory and the
KMD errors out when that memory is busy.
[2] This commit fixes the issue by synchronizing the ping operations
across all the clients by introducing a lock.
[3] Alternatively Increasing MAX_COMMANDS_PER_DEVICE will work but
not optimal since,
- the ping is an INIT mode operation.
- the ping operation is inexpensive => the memory is immediately
available even if locked.
- the overall memory allocation will increase.
Considering the use case is rare, the synchronization of ping across
multiple clients is preferred.
Change-Id: I012efd18554a85bb31b79b98bf83386b37251d32
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2813197
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Ken Adams <kadams@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The local DLA header files are located in the same directory as the
source files and so it is not necessary to append the 'nvdla' directory
to the header file path.
It is important to remove the 'nvdla' directory from the header path
because then when building NVDLA as an external module, we can disable
the Makefile search path "$(srctree.nvidia)/drivers/video/tegra/host"
and ensure that headers that are outside of NVDLA directory are not
being included.
Bug 3530486
Change-Id: I44ee3e515bd604f91d40ee4479a56ead022ba05f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2665591
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arvind M <am@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Building the NVDLA against the upstream kernel v5.16 is failing and
errors such as the following are seen.
ERROR: modpost: module nvhost-nvdla uses symbol dma_buf_detach from
namespace DMA_BUF, but does not import it.
ERROR: modpost: module nvhost-nvdla uses symbol dma_buf_put from
namespace DMA_BUF, but does not import it.
ERROR: modpost: module nvhost-nvdla uses symbol dma_buf_get from
namespace DMA_BUF, but does not import it.
Following upstream commit 16b0314aa746 ("dma-buf: move dma-buf symbols
into the DMA_BUF module namespace"), it is now necessary to import the
DMA_BUF module namespace into the Tegra DRM driver to fix this.
JIRA LS-410
Change-Id: I31f43fd4425ce80c975651d902b66f56464b0465
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2661773
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Update the DLA driver to add support for the upstream host1x driver.
The driver is built for upstream kernels only when the configuration
option CONFIG_TEGRA_HOST1X_NEXT is defined.
For the supporting the upstream host1x driver, the DLA driver is
registered with the upstream host1x driver by calling
host1x_driver_register().
Please note that for upstream Linux, the firmware naming conventions
used for upstream are preferred. So that although the same firmware
is used with both upstream and downstream, it is simply the filename
that is changed.
The 'spec_bar()' macro was removed from Linux v5.13 because there were
no upstream users. Include the downstream header arm64-barrier.h that
adds the spec_bar() from upstream so that we can build NVDLA for Linux
v5.13+ kernels.
Finally, add the necessary stub functions to the nvhost.h header file
to allow the driver to build. Please note that these functions are
not used and so stub functions are sufficient.
Bug 3409896
JIRA LS-410
Change-Id: Ifb8f269b260056da0fba6e5e2f88aa813178bff3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653103
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
To build the NVDLA driver as a standalone driver for supporting upstream
Linux kernels, it is simpler to move the DLA device data into the
driver. This greatly simplifies the process of building the driver as an
external module, because we only need the single Makefile that resides
within the 'nvdla' directory.
JIRA LS-410
Change-Id: I235008188e1c1ebda2fcb25fd58b868ff67f0352
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653101
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
To support NVDLA with upstream kernels where the NVHOST driver does not
exist, add a copy of the Falcon register definitions in a local NVDLA
header file. There is no functional change by adding these definitions
and this aligns with how the register definitions are defined for QNX.
JIRA LS-410
Change-Id: I83751671ec78c2df60e59fafe9be1c1612cb44d2
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2656680
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
[1] SC7 power state switches off all modules except for RAM and
AON regions.
[2] DLA suspend operation is responsible for the following.
- Readiness: Checks if there are no outstanding tasks in queues.
- Suspend: Initiates power-off sequence.
[3] DLA resume operation is responsible for the following.
- Resume: Initiates power-on sequence.
[4] In addition, each module maintains is_suspended flag to
communicate the state of suspension.
Jira DLA-5365
Change-Id: I594a1a2731a4f28f552e4be06338fca2fa4e7ca1
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2659248
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
The fuse function tegra_get_sku_id() does not exist in upstream and so
when building downstream drivers against an upstream kernel, the build
fails. The tegra_get_sku_id() calls the function tegra_fuse_readl()
which is supported in upstream and exported so can be used by external
kernel modules. The implementation of the tegra_get_sku_id() has been
moved to the header file 'fuse-helpers.h' that can be used by drivers
and allow drivers to be built as external modules. Therefore, migrate
drivers to use this implementation so we can move the implementation
from the downstream kernel.
Bug 2444929
Change-Id: I5a71044a11b63becc726784b9afb31c6384cb651
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653442
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This reverts commit b72050fa13465850279850c8594f3be4fbf9066f.
[1] WAR is enabled through debugfs node.
[2] WAR is present only on linux and it is applicable only on T194-A01.
Considering the above, this WAR shall be removed from linux as well.
In addition, this commit removes some dependency on fuse for chip id and
revision (tegra_get_chip_id and tegra_chip_get_revision).
Bug 200524968
Jira DLA-5054
Change-Id: Ic1c73ad6d9570d39fbea0b54be4853c734630fa5
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2615127
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Anup Mahindre <amahindre@nvidia.com>
Reviewed-by: Praveen K <kpraveen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
- update DLA1 FW version for multichip support
- include DLA2 driver's build path
- For firmware verification with multi-chip support,
- Need to get way to distinuguish chip.
- Use tegra_get_chip_id() is not recommended practice
- Alternately, using nvhost_device_data's "version" param which distinguishes
chip specific data at compile time
- So encode fw version into "version" param
- include firmware version header to encode
- Inline function can't be used at compile to encode "version" param
through macro
Jira DLA-3182
Change-Id: Id958133739acba583690b9fdf440fa1729b2b51e
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2359966
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This reverts commit c49670d23c368245670556b54ff83cc6b4edb96b.
The original commit was reverted because it exposed DLA UMD driver to
include kernel headers directly.
Since then, DLA UMD driver has been fixed to use headers from
user-space code. And hence restore this commit.
Bug 200471393
Change-Id: I221f56c5d12bd3db79568398a95baa61ffcd8101
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1980599
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This is causing Android builds to fail
This reverts commit 965ceca35c92eba011163f4c637b3b9e0f073f1a.
Change-Id: I84a98d129d25e33d1828033ab48a60102252b516
Signed-off-by: Sharif Inamdar <isharif@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1959908