<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/drivers/remoteproc/imx_dsp_rproc.c, branch docs-6.4-2</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-6.4-2</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=docs-6.4-2'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2022-10-24T16:21:16+00:00</updated>
<entry>
<title>remoteproc: imx_dsp_rproc: Add mutex protection for workqueue</title>
<updated>2022-10-24T16:21:16+00:00</updated>
<author>
<name>Shengjiu Wang</name>
<email>shengjiu.wang@nxp.com</email>
</author>
<published>2022-09-30T07:50:16+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=47e6ab07018edebf94ce873cf50a05ec76ff2dde'/>
<id>urn:sha1:47e6ab07018edebf94ce873cf50a05ec76ff2dde</id>
<content type='text'>
The workqueue may execute late even after remoteproc is stopped or
stopping, some resources (rpmsg device and endpoint) have been
released in rproc_stop_subdevices(), then rproc_vq_interrupt()
accessing these resources will cause kennel dump.

Call trace:
 virtqueue_add_split+0x1ac/0x560
 virtqueue_add_inbuf+0x4c/0x60
 rpmsg_recv_done+0x15c/0x294
 vring_interrupt+0x6c/0xa4
 rproc_vq_interrupt+0x30/0x50
 imx_dsp_rproc_vq_work+0x24/0x40 [imx_dsp_rproc]
 process_one_work+0x1d0/0x354
 worker_thread+0x13c/0x470
 kthread+0x154/0x160
 ret_from_fork+0x10/0x20

Add mutex protection in imx_dsp_rproc_vq_work(), if the state is
not running, then just skip calling rproc_vq_interrupt().

Also the flush workqueue operation can't be added in rproc stop
for the same reason. The call sequence is

rproc_shutdown
-&gt; rproc_stop
   -&gt;rproc_stop_subdevices
   -&gt;rproc-&gt;ops-&gt;stop()
     -&gt;imx_dsp_rproc_stop
       -&gt;flush_work
         -&gt; rproc_vq_interrupt

The resource needed by rproc_vq_interrupt has been released in
rproc_stop_subdevices, so flush_work is not safe to be called in
imx_dsp_rproc_stop.

Fixes: ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
Signed-off-by: Shengjiu Wang &lt;shengjiu.wang@nxp.com&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/1664524216-19949-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
</content>
</entry>
<entry>
<title>remoteproc: imx_dsp_rproc: fix argument 2 of rproc_mem_entry_init</title>
<updated>2022-08-23T20:05:06+00:00</updated>
<author>
<name>Shengjiu Wang</name>
<email>shengjiu.wang@nxp.com</email>
</author>
<published>2022-08-15T12:43:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=729c16326b7f3f4e83e4195f620a6ca0b7dfa25a'/>
<id>urn:sha1:729c16326b7f3f4e83e4195f620a6ca0b7dfa25a</id>
<content type='text'>
There are sparse warning:
drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *va @@     got void [noderef] __iomem *[assigned] cpu_addr @@
drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse:     expected void *va
drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse:     got void [noderef] __iomem *[assigned] cpu_addr
drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void *va @@     got void [noderef] __iomem *[assigned] cpu_addr @@
drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse:     expected void *va
drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse:     got void [noderef] __iomem *[assigned] cpu_addr

Fixes: ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Shengjiu Wang &lt;shengjiu.wang@nxp.com&gt;
Link: https://lore.kernel.org/r/1660567398-24495-1-git-send-email-shengjiu.wang@nxp.com
Acked-by: Mukesh Ojha &lt;quic_mojha@quicinc.com&gt;
Signed-off-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
</content>
</entry>
<entry>
<title>remoteproc: imx_dsp_rproc: Make rsc_table optional</title>
<updated>2022-04-13T17:59:43+00:00</updated>
<author>
<name>Daniel Baluta</name>
<email>daniel.baluta@nxp.com</email>
</author>
<published>2022-03-31T10:32:37+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=79a43db93399cfc7825a908a03320677c52ef919'/>
<id>urn:sha1:79a43db93399cfc7825a908a03320677c52ef919</id>
<content type='text'>
There are cases when we want to test a simple "hello world"
app on the DSP and we do not need a resource table.

remoteproc core allows us having an optional rsc_table.

Signed-off-by: Daniel Baluta &lt;daniel.baluta@nxp.com&gt;
Acked-by: Shengjiu Wang &lt;shengjiu.wang@gmail.com&gt;
Link: https://lore.kernel.org/r/20220331103237.340796-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
</content>
</entry>
<entry>
<title>remoteproc: imx_dsp_rproc: use common rproc_elf_load_segments</title>
<updated>2022-04-13T17:14:17+00:00</updated>
<author>
<name>Peng Fan</name>
<email>peng.fan@nxp.com</email>
</author>
<published>2022-04-13T03:30:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=c7457143668a98e5ddb0ab92d1c61d8899f7ac74'/>
<id>urn:sha1:c7457143668a98e5ddb0ab92d1c61d8899f7ac74</id>
<content type='text'>
remoteproc elf loader supports the specific case that segments
have PT_LOAD and memsz/filesz set to zero, so no duplicate
code.

Acked-by: Daniel Baluta &lt;daniel.baluta@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://lore.kernel.org/r/20220413033038.1715945-3-peng.fan@oss.nxp.com
Signed-off-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
</content>
</entry>
<entry>
<title>remoteproc: imx_dsp_rproc: mark PM functions as __maybe_unused</title>
<updated>2021-10-14T16:05:21+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-10-14T07:52:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=51063f54ffaffa8d24eeb9dda5a30916a38b0fe0'/>
<id>urn:sha1:51063f54ffaffa8d24eeb9dda5a30916a38b0fe0</id>
<content type='text'>
When CONFIG_PM_SLEEP is disabled, we get a harmless warning:

drivers/remoteproc/imx_dsp_rproc.c:1145:12: error: 'imx_dsp_resume' defined but not used [-Werror=unused-function]
 1145 | static int imx_dsp_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~
drivers/remoteproc/imx_dsp_rproc.c:1110:12: error: 'imx_dsp_suspend' defined but not used [-Werror=unused-function]
 1110 | static int imx_dsp_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~

Mark these as __maybe_unused to get a clean build.

Fixes: ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/20211014075239.3714694-1-arnd@kernel.org
Signed-off-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
</content>
</entry>
<entry>
<title>remoteproc: imx_dsp_rproc: Correct the comment style of copyright</title>
<updated>2021-10-13T15:20:49+00:00</updated>
<author>
<name>Shengjiu Wang</name>
<email>shengjiu.wang@nxp.com</email>
</author>
<published>2021-10-13T02:39:09+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5621dc3c97cd4705a8ced8103c2f2da24de9fb96'/>
<id>urn:sha1:5621dc3c97cd4705a8ced8103c2f2da24de9fb96</id>
<content type='text'>
Change '//' on copyright line to C style comments.

Reported-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
Signed-off-by: Shengjiu Wang &lt;shengjiu.wang@nxp.com&gt;
Link: https://lore.kernel.org/r/1634092749-3707-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
</content>
</entry>
<entry>
<title>remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX</title>
<updated>2021-10-12T15:16:58+00:00</updated>
<author>
<name>Shengjiu Wang</name>
<email>shengjiu.wang@nxp.com</email>
</author>
<published>2021-10-11T09:20:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ec0e5549f3586d2cb99a05edd006d722ebad912c'/>
<id>urn:sha1:ec0e5549f3586d2cb99a05edd006d722ebad912c</id>
<content type='text'>
Provide a basic driver to control DSP processor found on NXP i.MX8QM,
i.MX8QXP, i.MX8MP and i.MX8ULP.

Currently it is able to resolve addresses between DSP and main CPU,
start and stop the processor, suspend and resume.

The communication between DSP and main CPU is based on mailbox, there
are three mailbox channels (tx, rx, rxdb).

This driver was tested on NXP i.MX8QM, i.MX8QXP, i.MX8MP and i.MX8ULP.

Signed-off-by: Shengjiu Wang &lt;shengjiu.wang@nxp.com&gt;
Link: https://lore.kernel.org/r/1633944015-789-4-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
</content>
</entry>
</feed>
