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) | ||
commit | 85a7433202aafafbccea8a7b2491f4df8b1ecd80 | |
tree | c5f5894376e52a3d7294f8a904806c74a910e726 | tree | snapshot (tar.xz tar.gz zip) |
parent | fae6f6adfb957f9bb701a509083aedbe82f14910 | commit | diff |
common: cmd_dump: Gracefully handle ti_sci_cmd_get_clk_state() failure
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>
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>
common/cmd_dump.c | diff | blob | history |