Commit Graph

4 Commits

Author SHA1 Message Date
Mikko Perttunen
7438b785d4 gpu: host1x-nvhost: Retry interrupted firmware requests
Firmware requests triggered by userspace action can be executed
in interruptible context, which can cause signals to interrupt
firmware loading.

Ordinarily, one would propagate the error code to userspace and
let it retry. However, request_firmware does not have proper
handling of retryable errors, as sysfs fallbacks will clobber
the original error code. Furthermore, pm_runtime, through which
we would propagate the error code, doesn't support transient
resume failures either.

As such, as a quick fix, change to request_firmware_direct and
retry it directly in situ 10 times.

Bug 4753613

Co-developed-by: Zuyi Hu <zuyih@nvidia.com>
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: Idb9a04d4fa80aeffbfd0ad0176cce55c4dedf488
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3202848
(cherry picked from commit a17e81cad18bbdfef0194471524b675d74501054)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3219109
(cherry picked from commit 30c08f369a8f3acd642fcec70814086bd472e734)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3253514
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
Tested-by: Zuyi Hu <zuyih@nvidia.com>
2025-07-24 10:19:10 +00:00
Arvind M
8942623b15 gpu: host1x-nvhost: avoid setting flcn irq at boot
[1] The DLA firmware configures the DEST and MASK registers during
    the initialization.
[2] In OOT, the DLA KMD is accidentally setting the interrupts. This
    will result in enabling additional interrupts that the firmware
    does not handle (like NVDLA_GENERIC_INTR_FAULT_CRITICAL).
[3] This commit fixes the issue by avoiding the interrupt settings
    at the DLA KMD.

Bug 3960841

Change-Id: Ied77ac7564ae3b3202b9cceaf08ad3c7da9f947c
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2861253
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-03 14:06:51 +00:00
Jon Hunter
c103925414 gpu: host1x-nvhost: Fix casting and functions declarations
Sparse reports the following warnings for the host1x-nvhost driver ...

 drivers/gpu/host1x-nvhost/falcon.c:65:27: warning: cast to restricted __le32
 drivers/gpu/host1x-nvhost/nvhost.c:205:22: warning: symbol
	'nvhost_syncpt_get_by_id' was not declared. Should it be static?
 drivers/gpu/host1x-nvhost/nvhost.c:768:5: warning: symbol
 	'nvhost_module_runtime_resume' was not declared. Should it be static?
 drivers/gpu/host1x-nvhost/nvhost.c:796:5: warning: symbol
 	'nvhost_module_runtime_suspend' was not declared. Should it be static?

Fix the above by correcting the cast in falcon_copy_firmware_image(), remove
the function nvhost_syncpt_get_by_id() because it is not used, and make the
nvhost_module_runtime_resume/suspend functions static.

JIRA LS-410

Change-Id: I2c923fccd0b6e53d17198617b90905c6cd06eb5c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2670180
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 14:06:51 +00:00
Jon Hunter
7343e4379b gpu: host1x-nvhost: Add host1x-nvhost driver
Add a new host1x-nvhost driver that provides an nvhost interface for
the upstream Linux host1x driver so that downstream drivers that use
this interface can be supported on upstream.

Note that some of the nvhost function prototypes are moved from their
default header file to the include/linux/nvhost.h header file so
simplify building with upstream and downstream kernels.

JIRA LS-410

Change-Id: Icdbb34e879dcd91f6e3dd093b7fb400d1be4d561
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653097
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-04-03 14:06:51 +00:00