summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc/qcom_common.c
Commit message (Collapse)AuthorAgeFilesLines
* remoteproc: qcom: enable in-kernel PD mapperDmitry Baryshkov2024-06-251-0/+87
| | | | | | | | | | | | | Request in-kernel protection domain mapper to be started before starting Qualcomm DSP and release it once DSP is stopped. Once all DSPs are stopped, the PD mapper will be stopped too. Reviewed-by: Chris Lew <quic_clew@quicinc.com> Tested-by: Steev Klimaszewski <steev@kali.org> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240622-qcom-pd-mapper-v9-5-a84ee3591c8e@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
* remoteproc: qcom: Expand MD_* as MINIDUMP_*Mukesh Ojha2023-07-151-6/+6
| | | | | | | | | Expand MD_* as MINIDUMP_* which makes more sense than the abbreviation. Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com> Link: https://lore.kernel.org/r/1683133352-10046-2-git-send-email-quic_mojha@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
* remoteproc: qcom: Add full coredump fallback mechanismSiddharth Gupta2023-07-151-2/+11
| | | | | | | | | | | | | If a remoteproc's firmware does not support minidump but the driver adds an ID, the minidump driver does not collect any coredumps when the remoteproc crashes. This hinders the purpose of coredump collection. This change adds a fallback mechanism in the event of a crash. Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com> Link: https://lore.kernel.org/r/20230224211707.30916-3-quic_gokukris@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
* remoteproc: qcom: pas: Adjust the phys addr wrt the mem regionYogesh Lal2023-02-141-4/+9
| | | | | | | | | | | | | The minidump table in the toc contains physical addresses that may lie before the physical address of the first elf segment in relocatable images. This change adds a custom dump function for minidumps which calculates the offset into the carveout region using the start of the physical address instead of the start of the first elf segment. Signed-off-by: Yogesh Lal <quic_ylal@quicinc.com> Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/1667409129-6254-1-git-send-email-quic_ylal@quicinc.com
* remoteproc: qcom: fix sparse warningsMukesh Ojha2023-02-141-2/+2
| | | | | | | | | | | | This patch try to address below sparse warnings. drivers/remoteproc/qcom_common.c:126:27: warning: restricted __le32 degrades to integer drivers/remoteproc/qcom_common.c:133:32: warning: cast to restricted __le32 drivers/remoteproc/qcom_common.c:133:32: warning: cast from restricted __le64 Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/1675180866-16695-1-git-send-email-quic_mojha@quicinc.com
* remoteproc: qcom: replace kstrdup with kstrndupMukesh Ojha2023-02-141-1/+1
| | | | | | | | | | Since, there is no guarantee that region.name will be 0-terminated from the firmware side, replace kstrdup with kstrndup. Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/1676383691-29738-1-git-send-email-quic_mojha@quicinc.com
* remoteproc: qcom: correct kerneldocKrzysztof Kozlowski2022-07-181-2/+2
| | | | | | | | | | | | Correct kerneldoc warnings like: drivers/remoteproc/qcom_common.c:68: warning: expecting prototype for struct minidump_subsystem_toc. Prototype was for struct minidump_subsystem instead Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20220519073349.7270-1-krzysztof.kozlowski@linaro.org
* remoteproc: qcom: Add capability to collect minidumpsSiddharth Gupta2020-12-101-0/+146
| | | | | | | | | | | | | | | | | This patch adds support for collecting minidump in the event of remoteproc crash. Parse the minidump table based on remoteproc's unique minidump-id, read all memory regions from the remoteproc's minidump table entry and expose the memory to userspace. The remoteproc platform driver can choose to collect a full/mini dump by specifying the coredump op. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Co-developed-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Co-developed-by: Gurbir Arora <gurbaror@codeaurora.org> Signed-off-by: Gurbir Arora <gurbaror@codeaurora.org> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Link: https://lore.kernel.org/r/1605819935-10726-4-git-send-email-sidgup@codeaurora.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: qcom: Add missing slab.hKefeng Wang2020-07-131-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>
* remoteproc: qcom: Add notification types to SSRRishabh Bhatnagar2020-07-081-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>
* remoteproc: qcom: Add per subsystem SSR notificationRishabh Bhatnagar2020-07-081-13/+77
| | | | | | | | | | | | | | | | | | | | | 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>
* soc: qcom: glink_ssr: Internalize ssr_notifiersBjorn Andersson2020-05-071-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>
* remoteproc: qcom: Pass ssr_name to glink subdeviceBjorn Andersson2020-05-071-1/+8
| | | | | | | | | | | 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>
* remoteproc: qcom: Move glink_ssr notification after stopBjorn Andersson2019-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | glink_ssr is used to signal a remote processor "A" about the stopping of another remote processor "B", so that in the event that remote processor B is ever booted again the fifos of the glink channel between A and B is in a known state. But if remote processor A receives this notification before B is actually stopped the newly reset fifo indices will be interpreted as there being "data" on the channel and either side of the channel will enter a fatal error handler. Move the glink_ssr notification to the "unprepare" state of the rproc_subdev to avoid this issue. This has the side effect of us not notifying the dying remote processor itself about its fate, which has been seen to block in certain resource constraint scenarios. Tested-by: Sibi Sankar <sibis@codeaurora.org> Reviewed-by: Sibi Sankar <sibis@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174Thomas Gleixner2019-05-301-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* remoteproc: rename subdev probe and remove functionsAlex Elder2018-06-261-8/+8
| | | | | | | | | Rename functions used when subdevices are started and stopped to reflect the new naming scheme. Tested-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by Alex Elder <elder@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: Make client initialize ops in rproc_subdevBjorn Andersson2018-06-261-8/+10
| | | | | | | | | | | | | In preparation of adding the additional prepare and unprepare operations make the client responsible for filling out the function pointers of the rproc_subdev. This makes the arguments to rproc_add_subdev() more manageable, in particular when some of the functions are left out. Tested-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> [elder@linaro.org: added comment about assigning function pointers] Signed-off-by Alex Elder <elder@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: fix null pointer dereference on glink only platformsSibi Sankar2018-04-051-0/+6
| | | | | | | | | Currently calling list_del on smd subdev remove path results in null pointer dereference on glink only platforms. Fix this by adding safety checks in glink/smd subdev remove paths. Signed-off-by: Sibi Sankar <sibis@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: Pass type of shutdown to subdev removeBjorn Andersson2018-02-121-3/+3
| | | | | | | | | | remoteproc instances can be stopped either by invoking shutdown or by an attempt to recover from a crash. For some subdev types it's expected to clean up gracefully during a shutdown, but are unable to do so during a crash - so pass this information to the subdev remove functions. Acked-By: Chris Lew <clew@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: qcom: Register segments for core dumpSarangdhar Joshi2018-02-121-0/+44
| | | | | | | | | Register MDT segments with the remoteproc core dump functionality in order to include them in a core dump, in case of a recovery of the remote processor. Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* Merge tag 'rproc-v4.16' of git://github.com/andersson/remoteprocLinus Torvalds2018-02-051-19/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull remoteproc updates from Bjorn Andersson: "This contains a few bug fixes and a cleanup up of the resource-table handling in the framework, which removes the need for drivers with no resource table to provide a fake one" * tag 'rproc-v4.16' of git://github.com/andersson/remoteproc: remoteproc: Reset table_ptr on stop remoteproc: Drop dangling find_rsc_table dummies remoteproc: Move resource table load logic to find remoteproc: Don't handle empty resource table remoteproc: Merge rproc_ops and rproc_fw_ops remoteproc: Clone rproc_ops in rproc_alloc() remoteproc: Cache resource table size remoteproc: Remove depricated crash completion virtio_remoteproc: correct put_device virtio_device.dev
| * remoteproc: Drop dangling find_rsc_table dummiesBjorn Andersson2018-01-151-19/+0
| | | | | | | | | | | | | | | | | | As the core now deals with the lack of a resource table, remove the dangling custom dummy implementations of find_rsc_table from drivers. Reviewed-By: Loic Pallardy <loic.pallardy@st.com> Tested-By: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: qcom: Use PTR_ERR_OR_ZERO() in glink probVasyl Gomonovych2017-11-281-1/+1
|/ | | | | | | | | | | | Fix ptr_ret.cocci warnings: drivers/remoteproc/qcom_common.c:60:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* Merge tag 'rpmsg-v4.14' of git://github.com/andersson/remoteprocLinus Torvalds2017-09-091-0/+49
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull rpmsg updates from Bjorn Andersson: "This extends the Qualcomm GLINK implementation to support the additional features used for communicating with modem and DSP coprocessors in modern Qualcomm platforms. In addition to this there's support for placing virtio RPMSG buffers in non-System RAM" * tag 'rpmsg-v4.14' of git://github.com/andersson/remoteproc: (29 commits) rpmsg: glink: initialize ret to zero to ensure error status check is correct rpmsg: glink: fix null pointer dereference on a null intent dt-bindings: soc: qcom: Extend GLINK to cover SMEM remoteproc: qcom: adsp: Allow defining GLINK edge rpmsg: glink: Export symbols from common code rpmsg: glink: Release idr lock before returning on error rpmsg: glink: Handle remote rx done command rpmsg: glink: Request for intents when unavailable rpmsg: glink: Use the intents passed by remote rpmsg: glink: Receive and store the remote intent buffers rpmsg: glink: Add announce_create ops and preallocate intents rpmsg: glink: Add rx done command rpmsg: glink: Make RX FIFO peak accessor to take an offset rpmsg: glink: Use the local intents when receiving data rpmsg: glink: Add support for TX intents rpmsg: glink: Fix idr_lock from mutex to spinlock rpmsg: glink: Add support for transport version negotiation rpmsg: glink: Introduce glink smem based transport rpmsg: glink: Do a mbox_free_channel in remove rpmsg: glink: Return -EAGAIN when there is no FIFO space ...
| * remoteproc: qcom: adsp: Allow defining GLINK edgeBjorn Andersson2017-09-011-0/+49
| | | | | | | | | | | | | | Introduce the GLINK subdev, which allows the definition of a GLINK edge as child of a remoteproc. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: qcom: Make ssr_notifiers localBjorn Andersson2017-09-011-1/+1
| | | | | | | | | | | | | | | | The ssr_notifiers variable should be local, so add the missing static storage classifier. Fixes: 1e140df04965 ("remoteproc: qcom: Add support for SSR notifications") Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: qcom: Use PTR_ERR_OR_ZEROHimanshu Jha2017-08-291-1/+1
| | | | | | | | | | | | | | Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* | remoteproc: qcom: Add support for SSR notificationsBjorn Andersson2017-08-021-0/+71
|/ | | | | | | | | | | | This adds the remoteproc part of subsystem restart, which is responsible for emitting notifications to other processors in the system about a dying remoteproc instance. These notifications are propagated to the various communication systems in the various remote processors to shut down communication links that was left in a dangling state as the remoteproc was stopped (or crashed). Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: qcom: wcnss: Make SMD handling commonBjorn Andersson2017-02-061-0/+50
| | | | | | | Move the SMD edge handling to the Qualcomm common file to make it reusable for other Qualcomm remoteproc drivers. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* remoteproc: qcom: Extract non-mdt related helperBjorn Andersson2017-02-061-0/+46
In preparation for moving the mdt loader out of remoteproc let's move the somewhat unrelated resource table dummy helper to a Qualcomm "common" file. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>