Commit Graph

8 Commits

Author SHA1 Message Date
Jon Hunter
ecf383265b drivers: Don't use strlcpy()
For Linux v6.8, the function strlcpy() has been removed. The function
strscpy() was added in Linux v4.3 and has been preferred over strlcpy().
See upstream Linux commit 30035e45753b ("string: provide strscpy()") for
more details. The Linux checkpatch.pl script warns against using
strlcpy().

The function strscpy() takes the same arguments as strlcpy(), but
returns a type of ssize_t instead of size_t. Update the drivers to use
strscpy() instead of strlcpy().

Bug 4448428

Change-Id: Id6f196f0e81decf1545f9aa4f74f5c63a7f72a48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3059457
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-01-25 09:11:11 -08:00
Laxman Dewangan
c3e3d472a3 clk-bpmp: Use conftest to determine clk_hw_determine_rate_no_reparent()
The clock ops needs the determine_rate() callback in clock ops if
set_parent() is needed by commit 33b70fbc4f815f("clk: Introduce
clk_hw_determine_rate_no_reparent()") and commit 326cc42f9fdc3
("clk: Forbid to register a mux without determine_rate")
from Linux 6.4.

Add conftest method to determine if clk_hw_determine_rate_no_reparent()
present.

Bug 4346767

Change-Id: I8e4573e1a045fc76b7741aaa88b571574f14377e
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032325
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-12-12 09:29:15 -08:00
Timo Alho
320dee5c7d clk: tegra: fix error return case for recalc_rate
tegra-bpmp clocks driver makes implicit conversion of signed error
code to unsigned value in recalc_rate operation. The behavior for
recalc_rate, according to it's specification, should be that "If the
driver cannot figure out a rate for this clock, it must return 0."

Bug 3640397
Bug 4090576

Signed-off-by: Timo Alho <talho@nvidia.com>
Change-Id: I96cfbe466351fde035e0de6aeae1b9e6d929cec4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-stable/+/2975580
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977080
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-11 14:07:05 -07:00
Bitan Biswas
2a4c0e02e1 Revert "tegra: clk: bpmp: add missing bpmp-abi.h definitions"
This reverts commit 071c49bf11.

Reason for revert: jammy-src tree includes needed BPMP commits

bug 3856746

Change-Id: Idc3d000faf0191954d7a2d0361d6771543b2c40a
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2862025
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Abhilash G <abhilashg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Abhilash G <abhilashg@nvidia.com>
2023-05-05 07:34:44 -07:00
Timo Alho
071c49bf11 tegra: clk: bpmp: add missing bpmp-abi.h definitions
Older kernels do not have new definitions for
BPMP_CLK_RATE_PARENT_CHANGE_DENIED and
BPMP_CLK_STATE_CHANGE_DENIED. To fix compile issues, add them directly
to clk-bpmp.c

Bug 3856746

Signed-off-by: Timo Alho <talho@nvidia.com>
Change-Id: Ibdaf0e8ccfe5feca3153a61c9e2f972136b94147
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2802621
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2022-11-04 16:28:03 -07:00
Peter De Schrijver
b2fd0f798c clk: tegra: support BPMP-FW ABI deny flags
Support BPMP_CLK_STATE_CHANGE_DENIED by not populating state changing
operations when the flag is set.

Support BPMP_CLK_RATE_PARENT_CHANGE_DENIED by not populating rate or
parent  changing operations when the flag is set.

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Change-Id: I26b6a5efdf74c5a52bce67d0afd018007a977574
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2799593
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Timo Alho <talho@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-31 12:15:11 -07:00
Manish Bhardwaj
1c7751c581 bpmp: add support for virtual bpmp driver
Using this patch we are adding support for
virtualised bpmp driver in nvidia-oot.

JIRA ESLC-6885

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: Ia863055082f64dfcafdbba114816c56af2e7f640
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2781331
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-01 11:09:33 -07:00
Timo Alho
b01a848777 [tegra-bpmp] create (partial) downstream fork of tegra-bpmp driver
Make a downstream fork of clock, reset, powergate, and debugfs parts
of tegra-bpmp driver by copying the respective files from mainline
Linux 5.19.11 (commit fcf22aefe87101424563a8dd8adec8a75b8c7576).

JIRA ESLC-6885

Signed-off-by: Timo Alho <talho@nvidia.com>
Change-Id: Ieae8e9f27325d84faf8adc5e8834ffe42ba5e696
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2782102
Tested-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-01 11:09:29 -07:00