<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/firmware/tegra, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/firmware/tegra?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/firmware/tegra?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-09-15T10:45:42Z</updated>
<entry>
<title>firmware: tegra: Switch over to memdup_user()</title>
<updated>2022-09-15T10:45:42Z</updated>
<author>
<name>Qing Wang</name>
<email>wangqing@vivo.com</email>
</author>
<published>2021-10-18T11:31:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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>
<email>lv.ruyi@zte.com.cn</email>
</author>
<published>2022-04-19T01:36:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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: bpmp: Do only aligned access to IPC memory area</title>
<updated>2022-06-24T15:57:29Z</updated>
<author>
<name>Timo Alho</name>
<email>talho@nvidia.com</email>
</author>
<published>2022-06-22T13:22:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a4740b148a04dc60e14fe6a1dfe216d3bae214fd'/>
<id>urn:sha1:a4740b148a04dc60e14fe6a1dfe216d3bae214fd</id>
<content type='text'>
Use memcpy_toio and memcpy_fromio variants of memcpy to guarantee no
unaligned access to IPC memory area. This is to allow the IPC memory to
be mapped as Device memory to further suppress speculative reads from
happening within the 64 kB memory area above the IPC memory when 64 kB
memory pages are used.

Signed-off-by: Timo Alho &lt;talho@nvidia.com&gt;
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: Fix error application of sizeof() to pointer</title>
<updated>2021-10-18T14:04:01Z</updated>
<author>
<name>Lv Ruyi</name>
<email>lv.ruyi@zte.com.cn</email>
</author>
<published>2021-10-09T08:59:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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: bpmp: Use devm_platform_ioremap_resource()</title>
<updated>2021-10-07T18:52:24Z</updated>
<author>
<name>Cai Huoqing</name>
<email>caihuoqing@baidu.com</email>
</author>
<published>2021-09-08T10:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f11c34bddf8cd2a3107a7d11b6446c66deda9590'/>
<id>urn:sha1:f11c34bddf8cd2a3107a7d11b6446c66deda9590</id>
<content type='text'>
Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.

Signed-off-by: Cai Huoqing &lt;caihuoqing@baidu.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>
<email>arnd@arndb.de</email>
</author>
<published>2021-09-27T12:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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>
<email>hch@lst.de</email>
</author>
<published>2021-08-10T15:54:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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: bpmp: Fix Tegra234-only builds</title>
<updated>2021-06-11T11:31:51Z</updated>
<author>
<name>Thierry Reding</name>
<email>treding@nvidia.com</email>
</author>
<published>2021-04-13T12:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bd778b893963d67d7eb01f49d84ffcd3eaf229dd'/>
<id>urn:sha1:bd778b893963d67d7eb01f49d84ffcd3eaf229dd</id>
<content type='text'>
The tegra186_bpmp_ops symbol is used on Tegra234, so make sure it's
available.

Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>firmware: tegra: Fix error return code in tegra210_bpmp_init()</title>
<updated>2021-06-01T15:06:41Z</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2021-05-13T13:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7fea67710e9f6a111a2c9440576f2396ccd92d57'/>
<id>urn:sha1:7fea67710e9f6a111a2c9440576f2396ccd92d57</id>
<content type='text'>
When call irq_get_irq_data() to get the IRQ's irq_data failed, an
appropriate error code -ENOENT should be returned. However, we directly
return 'err', which records the IRQ number instead of the error code.

Fixes: 139251fc2208 ("firmware: tegra: add bpmp driver for Tegra210")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&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>
<email>arnd@arndb.de</email>
</author>
<published>2020-10-26T16:49:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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>
</feed>
