summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fae6f6a)
raw | patch | inline | side by side (parent: fae6f6a)
author | Andrew Halaney <ahalaney@redhat.com> | |
Tue, 5 Mar 2024 20:56:47 +0000 (14:56 -0600) | ||
committer | Nishanth Menon <nm@ti.com> | |
Wed, 6 Mar 2024 14:29:58 +0000 (08:29 -0600) |
If one has a kernel with configs like this:
CONFIG_DEVMEM=y
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
CONFIG_STRICT_DEVMEM=y
CONFIG_IO_STRICT_DEVMEM=y
then mmap'ing /dev/mem will fail. This results in all sort of issues,
but eventually will lead to a segfault if invoked like so on the
j784s4-evm:
[root@fedora build]# k3conf dump clock 218
Map fail
Map fail
Map fail
k3_sec_proxy_send: Thread23 verification failed. ret = -2
|-----------------------------------------------------------------------|
| VERSION INFO |
|-----------------------------------------------------------------------|
| K3CONF | (version v0.3-4-g16ee9a4 built Tue Mar 05 15:48:09 UTC 2024) |
| SoC | J784S4 SR1.0 |
|-----------------------------------------------------------------------|
Map fail
Map fail
Map fail
k3_sec_proxy_send: Thread23 verification failed. ret = -2
Segmentation fault (core dumped)
[root@fedora build]#
Let's at least avoid the segfault by not using the NULL pointer returned
by ti_sci_cmd_get_clk_state().
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
CONFIG_DEVMEM=y
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
CONFIG_STRICT_DEVMEM=y
CONFIG_IO_STRICT_DEVMEM=y
then mmap'ing /dev/mem will fail. This results in all sort of issues,
but eventually will lead to a segfault if invoked like so on the
j784s4-evm:
[root@fedora build]# k3conf dump clock 218
Map fail
Map fail
Map fail
k3_sec_proxy_send: Thread23 verification failed. ret = -2
|-----------------------------------------------------------------------|
| VERSION INFO |
|-----------------------------------------------------------------------|
| K3CONF | (version v0.3-4-g16ee9a4 built Tue Mar 05 15:48:09 UTC 2024) |
| SoC | J784S4 SR1.0 |
|-----------------------------------------------------------------------|
Map fail
Map fail
Map fail
k3_sec_proxy_send: Thread23 verification failed. ret = -2
Segmentation fault (core dumped)
[root@fedora build]#
Let's at least avoid the segfault by not using the NULL pointer returned
by ti_sci_cmd_get_clk_state().
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
common/cmd_dump.c | patch | blob | history |
diff --git a/common/cmd_dump.c b/common/cmd_dump.c
index 26f4f54b1a4f6a886590275ac6c78861d353d259..f104631aa0d184b5eb887aea8d4582fa78d57df5 100644 (file)
--- a/common/cmd_dump.c
+++ b/common/cmd_dump.c
for (row = 0; row < soc_info.sci_info.num_clocks; row++) {
if (dev_id == c[row].dev_id) {
+ const char *clk_state = ti_sci_cmd_get_clk_state(dev_id, c[row].clk_id);
+ if (!clk_state)
+ return -1;
snprintf(table[found + 1][0], TABLE_MAX_ELT_LEN, "%5d",
c[row].dev_id);
snprintf(table[found + 1][1], TABLE_MAX_ELT_LEN, "%5d",
c[row].clk_id);
strncpy(table[found + 1][2], c[row].clk_name,
TABLE_MAX_ELT_LEN);
- strncpy(table[found + 1][3],
- ti_sci_cmd_get_clk_state(dev_id, c[row].clk_id),
+ strncpy(table[found + 1][3], clk_state,
TABLE_MAX_ELT_LEN);
ti_sci_cmd_get_clk_freq(c[row].dev_id, c[row].clk_id,
&freq);