aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-07-17remoteproc: stm32: Remove memory translation from DT parsingMathieu Poirier1-1/+5
Other than one has to be done after the other, there is no correlation between memory translation and DT parsing. As such move function stm32_rproc_of_memory_translations() to stm32_rproc_probe() so that stm32_rproc_parse_dt() can be extended to look for attach bindings in a clean way. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-5-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Decouple rproc from DT parsingMathieu Poirier1-11/+12
Remove the remote processor from the process of parsing the device tree since (1) there is no correlation between them and (2) to use the information that was gathered to make a decision on whether to synchronise with the M4 or not. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-4-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Request IRQ with platform deviceMathieu Poirier1-2/+3
Request IRQ with platform device rather than remote proc in order to call stm32_rproc_parse_dt() before rproc_alloc(). That way we can know whether we need to synchronise with the MCU or not. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-3-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-17remoteproc: stm32: Decouple rproc from memory translationMathieu Poirier1-4/+4
Remove the remote processor from the process of parsing the memory ranges since there is no correlation between them. Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Loic Pallardy <loic.pallardy@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200714200445.1427257-2-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Properly handle firmware name when attachingMathieu Poirier2-2/+32
This patch prevents the firmware image name from being displayed when the remoteproc core is attaching to a remote processor. This is needed needed since there is no guarantee about the nature of the firmware image that is loaded by the external entity. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-10-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Refactor function rproc_free_vring()Mathieu Poirier1-4/+16
When function rproc_free_vring() clears the virtio device section it does so on the cached resource table rather than the one installed in the remote processor memory. When a remote processor has been booted by another entity there is no need to use a cached table and as such, no need to clear the virtio device section in it. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-9-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Refactor function rproc_trigger_auto_boot()Mathieu Poirier1-0/+9
Refactor function rproc_trigger_auto_boot() to properly deal with scenarios where the remoteproc core needs to attach with a remote processor that has already been booted by an external entity. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-8-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Refactor function rproc_boot()Mathieu Poirier1-11/+17
Refactor function rproc_boot() to properly deal with scenarios where the remoteproc core needs to attach with a remote processor that has already been booted by an external entity. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-7-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Introducing function rproc_validate()Mathieu Poirier1-0/+41
Add a new function to assert the general health of the remote processor before handing it to the remoteproc core. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-6-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Introducing function rproc_actuate()Mathieu Poirier1-1/+58
Introduce function rproc_actuate() that provides the same functionatlity as rproc_fw_boot(), but without the steps that involve interaction with the firmware image. That way we can deal with scenarios where the remoteproc core is attaching to a remote processor that has already been started by another entity. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-5-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Introducing function rproc_attach()Mathieu Poirier1-0/+42
Introducing function rproc_attach() to enact the same actions as rproc_start(), but without the steps related to the handling of a firmware image. That way we can properly deal with scenarios where the remoteproc core needs to attach with a remote processsor that has been booted by another entity. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-4-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Add new attach() remoteproc operationMathieu Poirier1-0/+8
Add an new attach() operation in order to properly deal with scenarios where the remoteproc core needs to attach to a remote processor that has been booted by another entity. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-3-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: Add new RPROC_DETACHED stateMathieu Poirier1-0/+1
Add a new RPROC_DETACHED state to take into account scenarios where the remoteproc core needs to attach to a remote processor that is booted by another entity. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200714195035.1426873-2-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: qcom_q6v5_mss: Monitor MSS_STATUS for boot completionSibi Sankar1-6/+6
On secure devices there exists a race condition which could lock the MSS CONFIG AHB bus thus preventing access to BOOT_STATUS register during SSR. Switch to polling the MSS_STATUS register with an additional 10 us delay to reliably track boot completion. Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200716120514.21588-1-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-16remoteproc: qcom: pil-info: Fix shift overflowBjorn Andersson1-1/+1
On platforms with 32-bit phys_addr_t the shift to get the upper word of the base address of the memory region is invalid. Cast the base to 64 bit to resolv this. Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM") Tested-by: Nathan Chancellor <natechancellor@gmail.com> # build Reported-by: Lee Jones <lee.jones@linaro.org> Reported-by: Nathan Chancellor <natechancellor@gmail.com> Link: https://lore.kernel.org/r/20200716054817.157608-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-15remoteproc: qcom_sysmon: Solve function header bitrot issuesLee Jones1-2/+2
Looks as though 'name' has now been moved into 'struct sysmod_event' which is passed in instead. However, the parameter descriptions were not updated at the same time. Let's do that now. Fixes the following W=1 kernel build warning(s): drivers/remoteproc/qcom_sysmon.c:78: warning: Function parameter or member 'event' not described in 'sysmon_send_event' drivers/remoteproc/qcom_sysmon.c:78: warning: Excess function parameter 'name' description in 'sysmon_send_event' drivers/remoteproc/qcom_sysmon.c:350: warning: Function parameter or member 'event' not described in 'ssctl_send_event' drivers/remoteproc/qcom_sysmon.c:350: warning: Excess function parameter 'name' description in 'ssctl_send_event' Cc: Andy Gross <agross@kernel.org> Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20200715123551.4011154-2-lee.jones@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-15remoteproc: remoteproc_core: Use 'gnu_printf' format notationLee Jones1-0/+3
Fixes the following W=1 kernel build warning(s): drivers/remoteproc/remoteproc_core.c: In function ‘rproc_find_carveout_by_name’: drivers/remoteproc/remoteproc_core.c:257:2: warning: function ‘rproc_find_carveout_by_name’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 257 | vsnprintf(_name, sizeof(_name), name, args); | ^~~~~~~~~ drivers/remoteproc/remoteproc_core.c: In function ‘rproc_mem_entry_init’: drivers/remoteproc/remoteproc_core.c:993:2: warning: function ‘rproc_mem_entry_init’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 993 | vsnprintf(mem->name, sizeof(mem->name), name, args); | ^~~~~~~~~ drivers/remoteproc/remoteproc_core.c: In function ‘rproc_of_resm_mem_entry_init’: drivers/remoteproc/remoteproc_core.c:1029:2: warning: function ‘rproc_of_resm_mem_entry_init’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 1029 | vsnprintf(mem->name, sizeof(mem->name), name, args); | ^~~~~~~~~ Cc: Brian Swetland <swetland@google.com> Cc: Mark Grosen <mgrosen@ti.com> Cc: Guzman Lugo <fernando.lugo@ti.com> Cc: Suman Anna <s-anna@ti.com> Cc: Robert Tivy <rtivy@ti.com> Cc: De Leon <x0095078@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20200715123551.4011154-1-lee.jones@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-13remoteproc: qcom: Add missing slab.hKefeng Wang1-0/+1
drivers/remoteproc/qcom_common.c: In function 'qcom_ssr_get_subsys': drivers/remoteproc/qcom_common.c:210:9: error: implicit declaration of function 'kzalloc'; did you mean 'vzalloc'? [-Werror=implicit-function-declaration] info = kzalloc(sizeof(*info), GFP_KERNEL); ^~~~~~~ vzalloc kzalloc() is declared in linux/slab.h, add include to fix build issue. Tested-by: Alex Elder <elder@linaro.org> Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Link: https://lore.kernel.org/r/20200713020003.134039-1-wangkefeng.wang@huawei.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-08remoteproc: qcom: Add notification types to SSRRishabh Bhatnagar1-1/+43
The SSR subdevice only adds callback for the unprepare event. Add callbacks for prepare, start and prepare events. The client driver for a particular remoteproc might be interested in knowing the status of the remoteproc while undergoing SSR, not just when the remoteproc has finished shutting down. Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Link: https://lore.kernel.org/r/1592965408-16908-3-git-send-email-rishabhb@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-08remoteproc: qcom: Add per subsystem SSR notificationRishabh Bhatnagar2-15/+80
Currently there is a single notification chain which is called whenever any remoteproc shuts down. This leads to all the listeners being notified, and is not an optimal design as kernel drivers might only be interested in listening to notifications from a particular remoteproc. Create a global list of remoteproc notification info data structures. This will hold the name and notifier_list information for a particular remoteproc. The API to register for notifications will use name argument to retrieve the notification info data structure and the notifier block will be added to that data structure's notification chain. Also move from blocking notifier to srcu notifer based implementation to support dynamic notifier head creation. Reviewed-by: Alex Elder <elder@linaro.org> Co-developed-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Link: https://lore.kernel.org/r/1592965408-16908-2-git-send-email-rishabhb@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-01remoteproc: qcom: Update PIL relocation info on loadBjorn Andersson6-12/+55
Update the PIL relocation information in IMEM with information about where the firmware for various remoteprocs are loaded. Reviewed-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200622191942.255460-4-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-01remoteproc: qcom: Introduce helper to store pil info in IMEMBjorn Andersson4-0/+142
A region in IMEM is used to communicate load addresses of remoteproc to post mortem debug tools. Implement a helper function that can be used to store this information in order to enable these tools to process collected ramdumps. Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200622191942.255460-3-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-01Revert "remoteproc: Add support for runtime PM"Mathieu Poirier1-16/+1
This reverts commit a99a37f6cd5a74d5b22c08544aa6c5890813c8ba. Removing PM runtime operations from the remoteproc core in order to: 1) Keep all power management operations in platform drivers. That way we do not loose flexibility in an area that is very HW specific. 2) Avoid making the support for remote processor managed by external entities more complex that it already is. 3) Fix regression introduced for the Omap remoteproc driver. Acked-by: Suman Anna <s-anna@ti.com> Tested-by: Suman Anna <s-anna@ti.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200630163118.3830422-3-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-07-01remoteproc: ingenic: Move clock handling to prepare/unprepare callbacksMathieu Poirier1-58/+26
This patch moves clock related operations to the remoteproc prepare() and unprepare() callbacks so that the PM runtime framework doesn't have to be involved needlessly. This provides a simpler approach and requires less code. Based on the work from Paul Cercueil published here: https://lore.kernel.org/linux-remoteproc/20191116170846.67220-4-paul@crapouillou.net/ Reviewed-by: Suman Anna <s-anna@ti.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200630163118.3830422-2-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-06-30iov_iter: Move unnecessary inclusion of crypto/hash.hHerbert Xu1-0/+1
The header file linux/uio.h includes crypto/hash.h which pulls in most of the Crypto API. Since linux/uio.h is used throughout the kernel this means that every tiny bit of change to the Crypto API causes the entire kernel to get rebuilt. This patch fixes this by moving it into lib/iov_iter.c instead where it is actually used. This patch also fixes the ifdef to use CRYPTO_HASH instead of just CRYPTO which does not guarantee the existence of ahash. Unfortunately a number of drivers were relying on linux/uio.h to provide access to linux/slab.h. This patch adds inclusions of linux/slab.h as detected by build failures. Also skbuff.h was relying on this to provide a declaration for ahash_request. This patch adds a forward declaration instead. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2020-06-08Merge tag 'rproc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteprocLinus Torvalds20-240/+777
Pull remoteproc updates from Bjorn Andersson: "This introduces device managed versions of functions used to register remoteproc devices, add support for remoteproc driver specific resource control, enables remoteproc drivers to specify ELF class and machine for coredumps. It integrates pm_runtime in the core for keeping resources active while the remote is booted and holds a wake source while recoverying a remote processor after a firmware crash. It refactors the remoteproc device's allocation path to simplify the logic, fix a few cleanup bugs and to not clone const strings onto the heap. Debugfs code is simplifies using the DEFINE_SHOW_ATTRIBUTE and a zero-length array is replaced with flexible-array. A new remoteproc driver for the JZ47xx VPU is introduced, the Qualcomm SM8250 gains support for audio, compute and sensor remoteprocs and the Qualcomm SC7180 modem support is cleaned up and improved. The Qualcomm glink subsystem-restart driver is merged into the main glink driver, the Qualcomm sysmon driver is extended to properly notify remote processors about all other remote processors' state transitions" * tag 'rproc-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: (43 commits) remoteproc: Fix an error code in devm_rproc_alloc() MAINTAINERS: Add myself as reviewer for Ingenic rproc driver remoteproc: ingenic: Added remoteproc driver remoteproc: Add support for runtime PM dt-bindings: Document JZ47xx VPU auxiliary processor remoteproc: wcss: Fix arguments passed to qcom_add_glink_subdev() remoteproc: Fix and restore the parenting hierarchy for vdev remoteproc: Fall back to using parent memory pool if no dedicated available remoteproc: Replace zero-length array with flexible-array remoteproc: wcss: add support for rpmsg communication remoteproc: core: Prevent system suspend during remoteproc recovery remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use remoteproc: qcom_q6v5_mss: Drop accesses to MPSS PERPH register space dt-bindings: remoteproc: qcom: Replace halt-nav with spare-regs remoteproc: qcom: pas: Add SM8250 PAS remoteprocs dt-bindings: remoteproc: qcom: pas: Add SM8250 remoteprocs remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region dt-bindings: remoteproc: qcom: Use memory-region to reference memory remoteproc: qcom: pas: Add SC7180 Modem support ...
2020-05-20remoteproc: Fix an error code in devm_rproc_alloc()Dan Carpenter1-1/+1
The comments say that this function should return NULL on error and the caller expects NULL returns as well so I have modified the code to match. Returning an ERR_PTR(-ENOMEM) would lead to an OOps. Reviewed-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Fixes: 305ac5a766b1 ("remoteproc: Add device-managed variants of rproc_alloc/rproc_add") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200520120705.GH172354@mwanda Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-18remoteproc: ingenic: Added remoteproc driverPaul Cercueil3-0/+290
This driver is used to boot, communicate with and load firmwares to the MIPS co-processor found in the VPU hardware of the JZ47xx SoCs from Ingenic. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200515104340.10473-4-paul@crapouillou.net Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-18remoteproc: Add support for runtime PMPaul Cercueil1-1/+16
Call pm_runtime_get_sync() before the firmware is loaded, and pm_runtime_put() after the remote processor has been stopped. Even though the remoteproc device has no PM callbacks, this allows the parent device's PM callbacks to be properly called. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20200515104340.10473-3-paul@crapouillou.net Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-14remoteproc: wcss: Fix arguments passed to qcom_add_glink_subdev()Bjorn Andersson1-1/+1
Recently qcom_add_glink_subdev() was extended to also take the glink_ssr identifier as an argument and I missed this while applying '8a226e2c71bb ("remoteproc: wcss: add support for rpmsg communication")'. Fixes: 8a226e2c71bb ("remoteproc: wcss: add support for rpmsg communication") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200514185856.1598945-1-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: Fix and restore the parenting hierarchy for vdevSuman Anna1-1/+1
The commit 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") has introduced a new vdev subdevice for each vdev declared in the firmware resource table and made it as the parent for the created virtio rpmsg devices instead of the previous remoteproc device. This changed the overall parenting hierarchy for the rpmsg devices, which were children of virtio devices, and does not allow the corresponding rpmsg drivers to retrieve the parent rproc device through the rproc_get_by_child() API. Fix this by restoring the remoteproc device as the parent. The new vdev subdevice can continue to inherit the DMA attributes from the remoteproc's parent device (actual platform device). Cc: stable@vger.kernel.org Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") Signed-off-by: Suman Anna <s-anna@ti.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Link: https://lore.kernel.org/r/20200420160600.10467-3-s-anna@ti.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: Fall back to using parent memory pool if no dedicated availableTero Kristo1-0/+12
In some cases, like with OMAP remoteproc, we are not creating dedicated memory pool for the virtio device. Instead, we use the same memory pool for all shared memories. The current virtio memory pool handling forces a split between these two, as a separate device is created for it, causing memory to be allocated from bad location if the dedicated pool is not available. Fix this by falling back to using the parent device memory pool if dedicated is not available. Cc: stable@vger.kernel.org Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com> Link: https://lore.kernel.org/r/20200420160600.10467-2-s-anna@ti.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: wcss: add support for rpmsg communicationSivaprakash Murugesan1-0/+6
add glink and ssr subdevices for wcss rproc to enable rpmsg communication. Signed-off-by: Sivaprakash Murugesan <sivaprak@codeaurora.org> Link: https://lore.kernel.org/r/1588350492-4663-1-git-send-email-sivaprak@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: core: Prevent system suspend during remoteproc recoveryRishabh Bhatnagar2-0/+7
The system might go into suspend during recovery of any remoteproc. This will interrupt the recovery process in between increasing the recovery time. Make the platform device as wakeup capable and use pm_stay_wake/pm_relax APIs to avoid system from going into suspend during recovery. Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/1588183482-21146-1-git-send-email-rishabhb@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va functionSibi Sankar1-14/+0
Remove unsed q6v5_da_to_va function as the mss driver uses a per segment dump function. Tested-by: Evan Green <evgreen@chromium.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200415071619.6052-2-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after useSibi Sankar1-11/+20
The application processor accessing the mpss region when the Q6 modem is running will lead to an XPU violation. Fix this by un-mapping the mpss segments post copy during mpss authentication and coredumps. Tested-by: Evan Green <evgreen@chromium.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200415071619.6052-1-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: qcom_q6v5_mss: Drop accesses to MPSS PERPH register spaceSibi Sankar1-84/+18
7C retail devices using MSA based boot will result in a fuse combination which will prevent accesses to MSS PERPH register space where the mpss clocks and halt-nav reside. So drop all accesses to the MPSS PERPH register space. Issuing HALT NAV request and turning on the mss clocks as part of SSR will no longer be required since the modem firmware will have the necessary fixes to ensure that there are no pending NAV DMA transactions. Tested-by: Evan Green <evgreen@chromium.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200415145110.20624-3-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-12remoteproc: qcom: pas: Add SM8250 PAS remoteprocsBjorn Andersson1-0/+62
Add audio, compute and sensor DSP compatibles to the Qualcomm PAS binding and driver. Reviewed-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200430180051.3795305-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-11remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-regionSibi Sankar1-3/+18
In the absence of mba and mpss sub-child extract the mba/mpss regions from the memory-region property. Tested-by: Evan Green <evgreen@chromium.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200421143228.8981-5-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-11remoteproc: qcom: pas: Add SC7180 Modem supportSibi Sankar1-0/+1
Add support for booting the Modem DSP found on Qualcomm's SC7180 SoCs. Tested-by: Evan Green <evgreen@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Link: https://lore.kernel.org/r/20200421143228.8981-3-sibis@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-11remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()Wei Yongjun1-2/+2
sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20200509084237.36293-1-weiyongjun1@huawei.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-07soc: qcom: glink_ssr: Internalize ssr_notifiersBjorn Andersson1-0/+8
Rather than carrying a special purpose blocking notifier for glink_ssr in remoteproc's qcom_common.c, move it into glink_ssr so allow wider reuse of the common one. The rpmsg glink header file is used in preparation for the next patch. Acked-by: Chris Lew <clew@codeaurora.org> Acked-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Link: https://lore.kernel.org/r/20200423003736.2027371-3-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-05-07remoteproc: qcom: Pass ssr_name to glink subdeviceBjorn Andersson5-5/+15
Pass ssr_name to glink subdevice in preparation for tying glink_ssr to the glink subdevice, rather than having its own "ssr subdevice". Acked-by: Chris Lew <clew@codeaurora.org> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Acked-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Link: https://lore.kernel.org/r/20200423003736.2027371-2-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-23Merge tag 'rproc-v5.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteprocLinus Torvalds3-17/+24
Pull remoteproc fixes from Bjorn Andersson: "This fixes a regression in the probe error path of the Qualcomm modem remoteproc driver and a mix up of phy_addr_t and dma_addr_t in the Mediatek SCP control driver" * tag 'rproc-v5.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc: remoteproc: mtk_scp: use dma_addr_t for DMA API remoteproc: qcom_q6v5_mss: fix q6v5_probe() error paths remoteproc: qcom_q6v5_mss: fix a bug in q6v5_probe()
2020-04-22remoteproc: Add missing '\n' in log messagesChristophe JAILLET1-2/+1
Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. Fixes: 791c13b709dd ("remoteproc: Fix NULL pointer dereference in rproc_virtio_notify") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/20200411160750.32573-1-christophe.jaillet@wanadoo.fr Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-22remoteproc: Add prepare and unprepare opsLoic Pallardy2-1/+30
On some SoC architecture, it is needed to enable HW like clock, bus, regulator, memory region... before loading co-processor firmware. This patch introduces prepare and unprepare ops to execute platform specific function before firmware loading and after stop execution. Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Suman Anna <s-anna@ti.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20200417002036.24359-2-s-anna@ti.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-22remoteproc: remove rproc_elf32_sanity_checkClement Leger6-27/+4
Since checks are present in the remoteproc elf loader before calling da_to_va, loading a elf64 will work on 32bits flavors of kernel. Indeed, if a segment size is larger than what size_t can hold, the loader will return an error so the functionality is equivalent to what exists today. Acked-by: Suman Anna <s-anna@ti.com> Signed-off-by: Clement Leger <cleger@kalray.eu> Link: https://lore.kernel.org/r/20200422093017.10985-1-cleger@kalray.eu Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-20remoteproc: Add device-managed variants of rproc_alloc/rproc_addPaul Cercueil1-0/+67
Add API functions devm_rproc_alloc() and devm_rproc_add(), which behave like rproc_alloc() and rproc_add() respectively, but register their respective cleanup function to be called on driver detach. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20200417170040.174319-2-paul@crapouillou.net Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-20remoteproc: Use a local copy for the name fieldSuman Anna1-1/+5
The current name field used in the remoteproc structure is simply a pointer to a name field supplied during the rproc_alloc() call. The pointer passed in by remoteproc drivers during registration is typically a dev_name pointer, but it is possible that the pointer will no longer remain valid if the devices themselves were created at runtime like in the case of of_platform_populate(), and were deleted upon any failures within the respective remoteproc driver probe function. So, allocate and maintain a local copy for this name field to keep it agnostic of the logic used in the remoteproc drivers. Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Suman Anna <s-anna@ti.com> Link: https://lore.kernel.org/r/20200417002036.24359-3-s-anna@ti.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-04-20remoteproc: Get rid of tedious error pathMathieu Poirier1-12/+9
Get rid of tedious error management by moving firmware and operation allocation after calling device_initialize(). That way we take advantage of the automatic call to rproc_type_release() to cleanup after ourselves when put_device() is called. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by: Suman Anna <s-anna@ti.com> Link: https://lore.kernel.org/r/20200420231601.16781-5-mathieu.poirier@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>