<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/firmware/tegra/bpmp-debugfs.c, branch linux-6.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-04-03T12:29:05Z</updated>
<entry>
<title>firmware: tegra: bpmp: Fix error paths in debugfs</title>
<updated>2023-04-03T12:29:05Z</updated>
<author>
<name>Mikko Perttunen</name>
</author>
<published>2023-03-01T13:47:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60b3a99a3b50c94814b84795e38e2161767ea277'/>
<id>urn:sha1:60b3a99a3b50c94814b84795e38e2161767ea277</id>
<content type='text'>
Some error paths in mrq_debug_read and bpmp_debug_show would overwrite
the return error code with a subsequent call to mrq_debug_close.

Change the code to only change the error code if there was no prior
error.

Signed-off-by: Mikko Perttunen &lt;mperttunen@nvidia.com&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: bpmp: Do not support big-endian</title>
<updated>2022-10-24T13:18:23Z</updated>
<author>
<name>Thierry Reding</name>
</author>
<published>2022-09-22T13:41:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=228722c519644f8fee2ef75fe8e9d53cd40a3c6c'/>
<id>urn:sha1:228722c519644f8fee2ef75fe8e9d53cd40a3c6c</id>
<content type='text'>
The CPU and BPMP inter-processor communication code is only partially
endian-aware, so it doesn't work properly when run on a big-endian CPU
anyway. Running Tegra SoCs in big-endian mode has also never been
supported, especially not on those with 64-bit ARM processors.

If big-endian support ever becomes necessary this can be added back but
will need additional fixes for completeness.

Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: bpmp: Prefer u32 over uint32_t</title>
<updated>2022-10-24T13:17:56Z</updated>
<author>
<name>Thierry Reding</name>
</author>
<published>2022-09-22T13:41:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=236d3907aa7c03168dbc4d0e8faa77d10bbb969f'/>
<id>urn:sha1:236d3907aa7c03168dbc4d0e8faa77d10bbb969f</id>
<content type='text'>
The canonical type for 32-bit unsigned integers in the kernel is u32, so
use that instead of uint32_t.

Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: Switch over to memdup_user()</title>
<updated>2022-09-15T10:45:42Z</updated>
<author>
<name>Qing Wang</name>
</author>
<published>2021-10-18T11:31:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa586abcfe4b43e170d72586b6f11bcc48f6766c'/>
<id>urn:sha1:fa586abcfe4b43e170d72586b6f11bcc48f6766c</id>
<content type='text'>
This patch fixes the following Coccinelle warning:

drivers/firmware/tegra/bpmp-debugfs.c:379: WARNING opportunity for memdup_user

Use memdup_user() rather than duplicating its implementation. This is a
little bit restricted to reduce false positives.

Signed-off-by: Qing Wang &lt;wangqing@vivo.com&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: Fix error check return value of debugfs_create_file()</title>
<updated>2022-07-08T15:56:03Z</updated>
<author>
<name>Lv Ruyi</name>
</author>
<published>2022-04-19T01:36:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=afcdb8e55c91c6ff0700ab272fd0f74e899ab884'/>
<id>urn:sha1:afcdb8e55c91c6ff0700ab272fd0f74e899ab884</id>
<content type='text'>
If an error occurs, debugfs_create_file() will return ERR_PTR(-ERROR),
so use IS_ERR() to check it.

Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Lv Ruyi &lt;lv.ruyi@zte.com.cn&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: Fix error application of sizeof() to pointer</title>
<updated>2021-10-18T14:04:01Z</updated>
<author>
<name>Lv Ruyi</name>
</author>
<published>2021-10-09T08:59:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=711e26c00e4c7b7cef0420c76a61e6d818e12687'/>
<id>urn:sha1:711e26c00e4c7b7cef0420c76a61e6d818e12687</id>
<content type='text'>
Application of sizeof() to pointer yields the number of bytes of the
pointer, but it should use the length of buffer in the code.

Fixes: 06c2d9a078ab ("firmware: tegra: Reduce stack usage")
Reported-by: Zeal Robot &lt;zealci@zte.com.cn&gt;
Signed-off-by: Lv Ruyi &lt;lv.ruyi@zte.com.cn&gt;
Reviewed-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Tested-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: Reduce stack usage</title>
<updated>2021-10-07T18:52:17Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2021-09-27T12:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06c2d9a078abe784fd9fd0f1534e318e827712b4'/>
<id>urn:sha1:06c2d9a078abe784fd9fd0f1534e318e827712b4</id>
<content type='text'>
Building the bpmp-debugfs driver for Arm results in a warning for stack usage:

drivers/firmware/tegra/bpmp-debugfs.c:321:16: error: stack frame size of 1224 bytes in function 'bpmp_debug_store' [-Werror,-Wframe-larger-than=]
static ssize_t bpmp_debug_store(struct file *file, const char __user *buf,

It should be possible to rearrange the code to not require two separate
buffers for the file name, but the easiest workaround is to use dynamic
allocation.

Fixes: 5e37b9c137ee ("firmware: tegra: Add support for in-band debug")
Link: https://lore.kernel.org/all/20201204193714.3134651-1-arnd@kernel.org/
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
[treding@nvidia.com: consistently return NULL on failure]
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: Stop using seq_get_buf()</title>
<updated>2021-08-11T10:17:18Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-08-10T15:54:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd00d75007d27677158bf6e64000d2e266035294'/>
<id>urn:sha1:dd00d75007d27677158bf6e64000d2e266035294</id>
<content type='text'>
Opencode a copy of mrq_debug_read() in bpmp_debug_show() so that it
can use seq_write() directly instead of poking holes into the seq_file
abstractions using seq_get_buf().

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: fix strncpy()/strncat() confusion</title>
<updated>2020-11-10T19:15:17Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2020-10-26T16:49:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9294996f0be40e9da818ed891c82397ab63c00d0'/>
<id>urn:sha1:9294996f0be40e9da818ed891c82397ab63c00d0</id>
<content type='text'>
The way that bpmp_populate_debugfs_inband() uses strncpy()
and strncat() makes no sense since the size argument for
the first is insufficient to contain the trailing '/'
and the second passes the length of the input rather than
the output, which triggers a warning:

In function 'strncat',
    inlined from 'bpmp_populate_debugfs_inband' at ../drivers/firmware/tegra/bpmp-debugfs.c:422:4:
include/linux/string.h:289:30: warning: '__builtin_strncat' specified bound depends on the length of the source argument [-Wstringop-overflow=]
  289 | #define __underlying_strncat __builtin_strncat
      |                              ^
include/linux/string.h:367:10: note: in expansion of macro '__underlying_strncat'
  367 |   return __underlying_strncat(p, q, count);
      |          ^~~~~~~~~~~~~~~~~~~~
drivers/firmware/tegra/bpmp-debugfs.c: In function 'bpmp_populate_debugfs_inband':
include/linux/string.h:288:29: note: length computed here
  288 | #define __underlying_strlen __builtin_strlen
      |                             ^
include/linux/string.h:321:10: note: in expansion of macro '__underlying_strlen'
  321 |   return __underlying_strlen(p);

Simplify this to use an snprintf() instead.

Fixes: 5e37b9c137ee ("firmware: tegra: Add support for in-band debug")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: Add support for in-band debug</title>
<updated>2020-07-14T16:01:50Z</updated>
<author>
<name>Jon Hunter</name>
</author>
<published>2020-07-12T10:01:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e37b9c137ee5a3a9dc2815ca51f71746c2609a6'/>
<id>urn:sha1:5e37b9c137ee5a3a9dc2815ca51f71746c2609a6</id>
<content type='text'>
Add support for retrieving BPMP debug information via in-band messaging
as opposed to using shared-memory which older BPMP firmware used. Note
that it is possible to detect at runtime whether the BPMP firmware being
used supports the in-band messaging for retrieving the debug
informaation. Therefore, if the BPMP firmware supports the in-band
messaging for debug use this and otherwise fall-back to using shared
memory.

Signed-off-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
</feed>
