Fix riace condition between host1x_syncpt_alloc()
and host1x_syncpt_put() by using kref_put_mutex()
instead of kref_put() + manual mutex locking.
This ensures no thread can acquire the
syncpt_mutex after the refcount drops to zero
but before syncpt_release acquires it.
This prevents races where syncpoints could
be allocated while still being cleaned up
from a previous release.
Remove explicit mutex locking in syncpt_release
as kref_put_mutex() handles this atomically.
Bug 5170956
Change-Id: I9e2348482d5c9646556576772f6b90fa7df3acd2
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3369121
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Enhance IOCTL handler to identify and
handle dma_fence_chain objects that might contain
host1x dma fences. This fixes issues
when userspace passes a dma_fence_chain
(created by DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT
operations) to HOST1X_IOCTL_FENCE_EXTRACT.
The updated code iteratively unwraps fence
chains until it finds a host1x_syncpt_fence or
reaches a fence it can't process. This ensures
proper operation with DRM-based applications
that use timeline syncobj features which internally
use dma_fence_chain.
Bug 4983872
Change-Id: I3eef9d54e2c42180cb5c74236cd64f42a863b7ea
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3364940
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Leslin Varghese <lvarghese@nvidia.com>
Tested-by: Arunmozhikannan Soundarapandian <asoundarapan@nvidia.com>
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
Port the tegra_hv_comm driver to the OOT kernel. This driver allows an
IVC channel to be used as an emulated serial device.
Make the following changes to simplify maintaining compatibility with
different kernel versions:
- Use a generic port type instead of defining a custom one.
- Use existing conftest to determine whether platform_device.remove
returns void.
- Add a conftest to determine whether uart_state.xmit exists.
- Use tty_port.xmit_fifo in kernels where uart_state.xmit has been
removed.
Jira HYP-20929
Change-Id: I1bc218f591d6d741fc39ae5392a9ea95bdc3f117
Signed-off-by: Daniel Kudrow <dkudrow@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3340420
(cherry picked from commit a67e7fd330be5d6c55e35c0ce810ff5124378ae7 in embedded/7.0.3.0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3301386
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
When EP boot up first and RP in power OFF state, default PERST# input is
high due to onboard pull up. When RP is powered ON, it causes a glitch
from high to low due to default pinctl settings, it is perceived as
PERST# assert by Endpoint. In tegra264_pcie_ep_rst_assert() PRNST#
signal is released (set high), this will cause PCIe link up failure.
This WAR is initially added for RP reboot case, to handle a scenario
where EP function driver still executing core_deinit as part of PERST#
assert and mean while RP boot up and ready for link up again. However
on Thor it is measured that core_deinit is taking only ~1.4 msec which
completes before RP boots. So, it is safe to remove PRNST# release WAR
in tegra264_pcie_ep_rst_assert(), this fixes link up failure when RP
boot after EP.
Bug 4981895
Change-Id: Ie24652a267bf3e3bc740d9c40e5b6d6671429b00
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3345684
(cherry picked from commit 8944b4a4d767a144b7204865d26b4e989ee003b6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3338072
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
* Add virtual i2c bus support for 2nd, 3rd
& 4th Hawks to read/write EEPROM data
while streaming
* Move MAX96712 function declarations to
a proper header file instead of using extern
declarations in .c files. This fixes checkpatch
warnings about externs in .c files and improves
code organization
Bug 4807682
Change-Id: Ie4e7f7b9adc6fe6255a517cd5f076afdc754384a
Signed-off-by: Praveen AC <pac@nvidia.com>
(cherry picked from commit 57dc20f5a8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3365540
Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Add support to select initial operating mode (GPIO or TIMER)
through DT property "nvpps-event-mode-init".
This allows users to specify which mode the driver should
start in rather than always defaulting to GPIO mode if gpios
property is specified in DT.
Key changes:
- Add DT property parsing for initial event mode
- Add validation to ensure selected mode is supported
- If this property is not specified, default mode selection
happens based on if nvpps-gpios property is defined or not
- Add informative debug messages about selected mode
- Add error handling for invalid configurations(eg: init
mode is GPIO but gpios property is not defined). If
validation fails, probe returns error instead of
defaulting to TIMER mode.
bug 5253938
Change-Id: I64c2a6565eeb46d6b07cf266cd4189fba9f0fba3
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3352704
(cherry picked from commit 091bb3ff50972e8dc3d7b941d850b4c1457b2a9e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3361726
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Enabled RST# IRQ during EP_START after tegra264_pcie_ep_rst_deassert is
invoked for EP and disable RST# IRQ during EP_STOP after
tegra264_pcie_ep_rst_assert is executed for EP and EP is not available
anymore. This prevents unwanted EP accesses during RP reset sequence
causing PERST# to toggle, while EP is not ready or available.
Bug 5281037
Change-Id: I43e1fd6c6ccfaae64a6bb2375a3685f186766d78
Signed-off-by: Prakhar Srivastava <prasrivastav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3363313
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Add support for configurable timestamp capture interval
through device tree property 'ts-capture-interval'.
This allows users to tune how frequently timestamps are
to be captured in TIMER mode.
- Add support for device tree property 'ts-capture-interval' (in ms)
- Defaults to 1000ms if property not specified
- Validate interval is within allowed range (100ms - 1000ms)
- Update timer configuration to use configurable capture interval
Bug 5242056
Change-Id: I4a327558576a86650890be4ae7e1ccfa5abe3c1d
Signed-off-by: Sheetal Tigadoli <stigadoli@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3348872
(cherry picked from commit 1317865f5dc042348e1e39b2aa54a7bb6aa1ffdb)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3361722
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
The original checking for cdi_dev_package buffer size is wrong,
it should not check the max size against max I2C payload size.
If the cdi_dev_package buffer size is too big for i2c transfer,
it will be breaking down to smaller sizes and transferred using
multiple I2C messages.
Define a new MAX_CDI_DEV_PACKAGE_BUFFER_SIZE for checking the
cdi_dev_package buffer size.
Bug 5107765
Jira CAMERASW-333779
Change-Id: Ieec049d51af4911dfd31410f43aa4733b75d265d
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3365281
Reviewed-by: Kevin Xie (SW-TEGRA) <kevixie@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ganesh Ram Savithri Sreenivas Murthy <ganeshrams@nvidia.com>
Reviewed-by: Samuel Hung <samuelh@nvidia.com>
[1] BUG_ON -> WARN_ON as per the recommendation from svcacv.
[2] Updated the power management interface
- Setting delay for rail, power and clock gating is easier to
manage with separate API.
- delay_us has been removed from the gating.
- New stat interface has been exposed for any stats related
to the power management operations.
[3] Supports autosuspend feature.
[4] Supports lpwr telemetries for the rail, power, and clock.
- idle time in us
- active time in us
- idle count
- active count
- entry and exit latencies in us (max, min and total)
Bug 5185298
Jira DLA-7905
Change-Id: I81267d7c3e9c35c81d29a19efe9192d436322ee9
Signed-off-by: Arvind M <am@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3318099
(cherry picked from commit c7cf5bb3b24dd9ed58e55a3fec56c8b1503c7e01)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3338010
Reviewed-by: Vishal Thoke <vthoke@nvidia.com>
Reviewed-by: Mitch Harwell <mharwell@nvidia.com>
Tested-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ayush Kumar <ayushk@nvidia.com>
Conditionally disabled the legacy TEGRA_SYNCPT_INCR IOCTL for T264
platforms since it's no longer needed. This IOCTL is superseded by the
newer TEGRA_SYNCPOINT_INCREMENT IOCTL which provides better functionality
and follows the modern API design.
The conditional compilation helps reduce the attack surface on T264
platforms by removing legacy code paths that aren't needed.
Use CONFIG_ARCH_TEGRA_264_SOC as the proper platform-specific flag
to identify T264 platforms, as this is the standard architecture flag
used throughout the codebase.
This change affects:
1. The IOCTL definition in the tegra_drm_ioctls table
2. The IOCTL handler function implementation
This improves code cleanliness by removing unnecessary legacy code
on newer platforms while maintaining backward compatibility for
older platforms that might depend on this IOCTL.
Bug 5060574
Change-Id: Idd21d69ebd992f976770016b5805f7d6af89c88d
Signed-off-by: Mainak Sen <msen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3342657
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>