soc: qcom: add in-kernel pd-mapper implementation
v9 cover soc: qcom: add in-kernel pd-mapper implementation
Protection domain mapper is a QMI service providing mapping between 'protection domains' and services supported / allowed in these domains. For example such mapping is required for loading of the WiFi firmware or for properly starting up the UCSI / altmode / battery manager support.
The existing userspace implementation has several issue. It doesn't play well with CONFIG_EXTRA_FIRMWARE, it doesn't reread the JSON files if the firmware location is changed (or if the firmware was not available at the time pd-mapper was started but the corresponding directory is mounted later), etc.
However this configuration is largely static and common between different platforms. Provide in-kernel service implementing static per-platform data.
---
Changes in v9:
- Adjust locking in pdr_get_domain_list(), releasing the mutex right
after qmi_send_request() (Chris Lew)
- Link to v8: https://lore.kernel.org/r/[email protected]
Changes in v8:
- Reworked pd-mapper to register as an rproc_subdev / auxdev
- Dropped Tested-by from Steev and Alexey from the last patch since the implementation was changed significantly.
- Add sensors, cdsp and mpss_root domains to 660 config (Alexey
Minnekhanov)
- Added platform entry for sm4250 (used for qrb4210 / RB2)
- Added locking to the pdr_get_domain_list() (Chris Lew)
- Remove the call to qmi_del_server() and corresponding API (Chris Lew)
- In qmi_handle_init() changed 1024 to a defined constant (Chris Lew)
- Link to v7: https://lore.kernel.org/r/[email protected]
Changes in v7:
- Fixed modular build (Steev)
- Link to v6: https://lore.kernel.org/r/[email protected]
Changes in v6:
- Reworked mutex to fix lockdep issue on deregistration
- Fixed dependencies between PD-mapper and remoteproc to fix modular
builds (Krzysztof)
- Added EXPORT_SYMBOL_GPL to fix modular builds (Krzysztof)
- Fixed kerneldocs (Krzysztof)
- Removed extra pr_debug messages (Krzysztof)
- Fixed wcss build (Krzysztof)
- Added platforms which do not require protection domain mapping to
silence the notice on those platforms
- Link to v5: https://lore.kernel.org/r/[email protected]
Changes in v5:
- pdr: drop lock in pdr_register_listener, list_lock is already held (Chris Lew)
- pd_mapper: reworked to provide static configuration per platform
(Bjorn)
- Link to v4: https://lore.kernel.org/r/[email protected]
Changes in v4:
- Fixed missing chunk, reenabled kfree in qmi_del_server (Konrad)
- Added configuration for sm6350 (Thanks to Luca)
- Removed RFC tag (Konrad)
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in RFC v3:
- Send start / stop notifications when PD-mapper domain list is changed
- Reworked the way PD-mapper treats protection domains, register all of
them in a single batch
- Added SC7180 domains configuration based on TCL Book 14 GO
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in RFC v2:
- Swapped num_domains / domains (Konrad)
- Fixed an issue with battery not working on sc8280xp
- Added missing configuration for QCS404
To: Bjorn Andersson <[email protected]>
To: Konrad Dybcio <[email protected]>
To: Sibi Sankar <[email protected]>
To: Mathieu Poirier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
Dmitry Baryshkov (5):
soc: qcom: pdr: protect locator_addr with the main mutex
soc: qcom: pdr: fix parsing of domains lists
soc: qcom: pdr: extract PDR message marshalling data
soc: qcom: add pd-mapper implementation
remoteproc: qcom: enable in-kernel PD mapper
drivers/remoteproc/qcom_common.c | 87 +++++ drivers/remoteproc/qcom_common.h | 10 + drivers/remoteproc/qcom_q6v5_adsp.c | 3 + drivers/remoteproc/qcom_q6v5_mss.c | 3 + drivers/remoteproc/qcom_q6v5_pas.c | 3 + drivers/remoteproc/qcom_q6v5_wcss.c | 3 + drivers/soc/qcom/Kconfig | 15 + drivers/soc/qcom/Makefile | 2 + drivers/soc/qcom/pdr_interface.c | 8 +- drivers/soc/qcom/pdr_internal.h | 318 ++--------------- drivers/soc/qcom/qcom_pd_mapper.c | 676 ++++++++++++++++++++++++++++++++++++ drivers/soc/qcom/qcom_pdr_msg.c | 353 +++++++++++++++++++ 12 files changed, 1183 insertions(+), 298 deletions(-)
---
base-commit: 2102cb0d050d34d50b9642a3a50861787527e922
change-id: 20240301-qcom-pd-mapper-e12d622d4ad0
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>
PATCH v9 1/5 soc: qcom: pdr: protect locator_addr with the main mutex
If the service locator server is restarted fast enough, the PDR can rewrite locator_addr fields concurrently. Protect them by placing modification of those fields under the main pdr->lock.
--- drivers/soc/qcom/pdr_interface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/soc/qcom/pdr_interface.c +4 -2
@@ -76,12 +76,12 @@ static int pdr_locator_new_server(struct qmi_handle *qmi, locator_hdl);struct pdr_service *pds; +mutex_lock (&pdr->lock);/* Create a local client port for QMI communication */ pdr->locator_addr.sq_family =AF_QIPCRTR ; pdr->locator_addr.sq_node = svc->node; pdr->locator_addr.sq_port = svc->port; -mutex_lock (&pdr->lock); pdr->locator_init_complete = true;mutex_unlock (&pdr->lock);
@@ -104,10 +104,10 @@ static void pdr_locator_del_server(struct qmi_handle *qmi,mutex_lock (&pdr->lock); pdr->locator_init_complete = false; -mutex_unlock (&pdr->lock); pdr->locator_addr.sq_node =0 ; pdr->locator_addr.sq_port =0 ; +mutex_unlock (&pdr->lock); }static const struct qmi_ops pdr_locator_ops = {
@@ -365,12 +365,14 @@ static int pdr_get_domain_list(struct servreg_get_domain_list_req *req,if (ret <0 )return ret; +mutex_lock (&pdr->lock); ret =qmi_send_request (&pdr->locator_hdl, &pdr->locator_addr, &txn,SERVREG_GET_DOMAIN_LIST_REQ ,SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN , servreg_get_domain_list_req_ei, req); +mutex_unlock (&pdr->lock);if (ret <0 ) {qmi_txn_cancel (&txn);return ret;
Signature · 1 line
2.39.2
Re: [PATCH v9 1/5] soc: qcom: pdr: protect locator_addr with the main mutex
Quoted 9 lines · Dmitry Baryshkov
If the service locator server is restarted fast enough, the PDR can rewrite
locator_addrfields concurrently. Protect them by placing modification of those fields under the mainpdr->lock.Fixes fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")Tested-by Steev Klimaszewski <[email protected]>Tested-by Alexey Minnekhanov <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>
PATCH v9 2/5 soc: qcom: pdr: fix parsing of domains lists
In reply to Dmitry BaryshkovWhile parsing the domains list, start offsets from 0 rather than from domains_read. The domains_read is equal to the total count of the domains we have seen, while the domains list in the message starts from offset 0.
--- drivers/soc/qcom/pdr_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/pdr_interface.c +1 -1
@@ -417,7 +417,7 @@ static int pdr_locate_service(struct pdr_handle *pdr, struct pdr_service *pds)if (ret <0 ) goto out; -for (i = domains_read; i < resp->domain_list_len; i++) { +for (i =0 ; i < resp->domain_list_len; i++) { entry = &resp->domain_list[i];if (strnlen (entry->name,sizeof (entry->name)) ==sizeof (entry->name))
Signature · 1 line
2.39.2
PATCH v9 3/5 soc: qcom: pdr: extract PDR message marshalling data
In reply to Dmitry BaryshkovThe in-kernel PD mapper is going to use same message structures as the QCOM_PDR_HELPERS module. Extract message marshalling data to separate module that can be used by both PDR helpers and by PD mapper.
--- drivers/soc/qcom/Kconfig | 4 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/pdr_internal.h | 306 ++------------------------------------ drivers/soc/qcom/qcom_pdr_msg.c | 319 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 334 insertions(+), 296 deletions(-)
drivers/soc/qcom/Kconfig +4 -0
@@ -75,8 +75,12 @@ config QCOM_OCMEM config QCOM_PDR_HELPERS tristate select QCOM_QMI_HELPERS + select QCOM_PDR_MSG depends on NET +config QCOM_PDR_MSG + tristate + config QCOM_PMIC_PDCHARGER_ULOG tristate "Qualcomm PMIC PDCharger ULOG driver" depends on RPMSG
drivers/soc/qcom/Makefile +1 -0
@@ -8,6 +8,7 @@ obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o obj-$(CONFIG_QCOM_OCMEM) += ocmem.o obj-$(CONFIG_QCOM_PDR_HELPERS) += pdr_interface.o +obj-$(CONFIG_QCOM_PDR_MSG) += qcom_pdr_msg.o obj-$(CONFIG_QCOM_PMIC_GLINK) += pmic_glink.o obj-$(CONFIG_QCOM_PMIC_GLINK) += pmic_glink_altmode.o obj-$(CONFIG_QCOM_PMIC_PDCHARGER_ULOG) += pmic_pdcharger_ulog.o
drivers/soc/qcom/pdr_internal.h +10 -296
357 lines not on this page · raw message
drivers/soc/qcom/qcom_pdr_msg.c new file +319 -0
319 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v9 4/5 soc: qcom: add pd-mapper implementation
In reply to Dmitry BaryshkovExisting userspace protection domain mapper implementation has several issue. It doesn't play well with CONFIG_EXTRA_FIRMWARE, it doesn't reread JSON files if firmware location is changed (or if firmware was not available at the time pd-mapper was started but the corresponding directory is mounted later), etc.
Provide in-kernel service implementing protection domain mapping required to work with several services, which are provided by the DSP firmware.
This module is loaded automatically by the remoteproc drivers when necessary via the symbol dependency. It uses a root node to match a protection domains map for a particular board. It is not possible to implement it as a 'driver' as there is no corresponding device.
--- drivers/soc/qcom/Kconfig | 11 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/pdr_internal.h | 14 + drivers/soc/qcom/qcom_pd_mapper.c | 676 ++++++++++++++++++++++++++++++++++++++ drivers/soc/qcom/qcom_pdr_msg.c | 34 ++ 5 files changed, 736 insertions(+)
drivers/soc/qcom/Kconfig +11 -0
@@ -72,6 +72,17 @@ config QCOM_OCMEM requirements. This is typically used by the GPU, camera/video, and audio components on some Snapdragon SoCs. +config QCOM_PD_MAPPER + tristate "Qualcomm Protection Domain Mapper" + select QCOM_QMI_HELPERS + depends on NET && QRTR + default QCOM_RPROC_COMMON + help + The Protection Domain Mapper maps registered services to the domains + and instances handled by the remote DSPs. This is a kernel-space + implementation of the service. It is a simpler alternative to the + userspace daemon. + config QCOM_PDR_HELPERS tristate select QCOM_QMI_HELPERS
drivers/soc/qcom/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o obj-$(CONFIG_QCOM_OCMEM) += ocmem.o +obj-$(CONFIG_QCOM_PD_MAPPER) += qcom_pd_mapper.o obj-$(CONFIG_QCOM_PDR_HELPERS) += pdr_interface.o obj-$(CONFIG_QCOM_PDR_MSG) += qcom_pdr_msg.o obj-$(CONFIG_QCOM_PMIC_GLINK) += pmic_glink.o
drivers/soc/qcom/pdr_internal.h +14 -0
@@ -13,6 +13,8 @@#define SERVREG_SET_ACK_REQ 0x23#define SERVREG_RESTART_PD_REQ 0x24 +#define SERVREG_LOC_PFR_REQ 0x24 +#define SERVREG_DOMAIN_LIST_LENGTH 32#define SERVREG_RESTART_PD_REQ_MAX_LEN 67#define SERVREG_REGISTER_LISTENER_REQ_LEN 71
@@ -20,6 +22,7 @@#define SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN 74#define SERVREG_STATE_UPDATED_IND_MAX_LEN 79#define SERVREG_GET_DOMAIN_LIST_RESP_MAX_LEN 2389 +#define SERVREG_LOC_PFR_RESP_MAX_LEN 10struct servreg_location_entry {char name[SERVREG_NAME_LENGTH +1 ];
@@ -79,6 +82,15 @@ struct servreg_set_ack_resp {struct qmi_response_type_v01 resp; }; +struct servreg_loc_pfr_req { +char service[SERVREG_NAME_LENGTH +1 ]; +char reason[257 ]; +}; + +struct servreg_loc_pfr_resp { +struct qmi_response_type_v01 rsp; +}; +extern const struct qmi_elem_info servreg_location_entry_ei[];extern const struct qmi_elem_info servreg_get_domain_list_req_ei[];extern const struct qmi_elem_info servreg_get_domain_list_resp_ei[];
@@ -89,5 +101,7 @@ extern const struct qmi_elem_info servreg_restart_pd_resp_ei[];extern const struct qmi_elem_info servreg_state_updated_ind_ei[];extern const struct qmi_elem_info servreg_set_ack_req_ei[];extern const struct qmi_elem_info servreg_set_ack_resp_ei[]; +extern const struct qmi_elem_info servreg_loc_pfr_req_ei[]; +extern const struct qmi_elem_info servreg_loc_pfr_resp_ei[];#endif
drivers/soc/qcom/qcom_pd_mapper.c new file +676 -0
676 lines not on this page · raw message
drivers/soc/qcom/qcom_pdr_msg.c +34 -0
@@ -315,5 +315,39 @@ const struct qmi_elem_info servreg_set_ack_resp_ei[] = { };EXPORT_SYMBOL_GPL (servreg_set_ack_resp_ei); +const struct qmi_elem_info servreg_loc_pfr_req_ei[] = { + { + .data_type =QMI_STRING , + .elem_len =SERVREG_NAME_LENGTH +1 , + .elem_size =sizeof (char ), + .array_type =VAR_LEN_ARRAY , + .tlv_type =0x01 , + .offset = offsetof(struct servreg_loc_pfr_req , service) + }, + { + .data_type =QMI_STRING , + .elem_len =SERVREG_NAME_LENGTH +1 , + .elem_size =sizeof (char ), + .array_type =VAR_LEN_ARRAY , + .tlv_type =0x02 , + .offset = offsetof(struct servreg_loc_pfr_req , reason) + }, + {} +}; +EXPORT_SYMBOL_GPL (servreg_loc_pfr_req_ei); + +const struct qmi_elem_info servreg_loc_pfr_resp_ei[] = { + { + .data_type =QMI_STRUCT , + .elem_len =1 , + .elem_size = sizeof_field(struct servreg_loc_pfr_resp, rsp), + .tlv_type =0x02 , + .offset = offsetof(struct servreg_loc_pfr_resp , rsp), + .ei_array = qmi_response_type_v01_ei, + }, + {} +}; +EXPORT_SYMBOL_GPL (servreg_loc_pfr_resp_ei); +MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Qualcomm Protection Domain messages data" );
Signature · 1 line
2.39.2
PATCH v9 5/5 remoteproc: qcom: enable in-kernel PD mapper
In reply to Dmitry BaryshkovRequest 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.
--- drivers/remoteproc/qcom_common.c | 87 +++++++++++++++++++++++++++++++++++++ drivers/remoteproc/qcom_common.h | 10 +++++ drivers/remoteproc/qcom_q6v5_adsp.c | 3 ++ drivers/remoteproc/qcom_q6v5_mss.c | 3 ++ drivers/remoteproc/qcom_q6v5_pas.c | 3 ++ drivers/remoteproc/qcom_q6v5_wcss.c | 3 ++ 6 files changed, 109 insertions(+)
drivers/remoteproc/qcom_common.c +87 -0
@@ -13,6 +13,7 @@#include <linux/notifier.h> #include <linux/remoteproc.h> #include <linux/remoteproc/qcom_rproc.h> +#include <linux/auxiliary_bus.h> #include <linux/rpmsg/qcom_glink.h> #include <linux/rpmsg/qcom_smd.h> #include <linux/slab.h>
@@ -25,6 +26,7 @@#define to_glink_subdev (d) container_of(d, struct qcom_rproc_glink, subdev)#define to_smd_subdev (d) container_of(d, struct qcom_rproc_subdev, subdev)#define to_ssr_subdev (d) container_of(d, struct qcom_rproc_ssr, subdev) +#define to_pdm_subdev (d) container_of(d, struct qcom_rproc_pdm, subdev)#define MAX_NUM_OF_SS 10#define MAX_REGION_NAME_LENGTH 16
@@ -519,5 +521,90 @@ void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr) }EXPORT_SYMBOL_GPL (qcom_remove_ssr_subdev); +static void pdm_dev_release (struct device *dev) +{ +struct auxiliary_device *adev =to_auxiliary_dev (dev); + +kfree (adev); +} + +static int pdm_notify_prepare (struct rproc_subdev *subdev) +{ +struct qcom_rproc_pdm *pdm =to_pdm_subdev (subdev); +struct auxiliary_device *adev; +int ret; + + adev =kzalloc (sizeof (*adev),GFP_KERNEL ); +if (!adev) +return -ENOMEM ; + + adev->dev.parent = pdm->dev; + adev->dev.release = pdm_dev_release; + adev->name ="pd-mapper" ; + adev->id = pdm->index; + + ret =auxiliary_device_init (adev); +if (ret) { +kfree (adev); +return ret; + } + + ret =auxiliary_device_add (adev); +if (ret) { +auxiliary_device_uninit (adev); +return ret; + } + + pdm->adev = adev; + +return 0 ; +} + + +static void pdm_notify_unprepare (struct rproc_subdev *subdev) +{ +struct qcom_rproc_pdm *pdm =to_pdm_subdev (subdev); + +if (!pdm->adev) +return ; + +auxiliary_device_delete (pdm->adev); +auxiliary_device_uninit (pdm->adev); + pdm->adev =NULL ; +} + +/** +* qcom_add_pdm_subdev() - register PD Mapper subdevice +* @rproc: rproc handle +* @pdm: PDM subdevice handle +* +* Register @pdm so that Protection Device mapper service is started when the +* DSP is started too. +*/ +void qcom_add_pdm_subdev (struct rproc *rproc,struct qcom_rproc_pdm *pdm) +{ + pdm->dev = &rproc->dev; + pdm->index = rproc->index; + + pdm->subdev.prepare = pdm_notify_prepare; + pdm->subdev.unprepare = pdm_notify_unprepare; + +rproc_add_subdev (rproc, &pdm->subdev); +} +EXPORT_SYMBOL_GPL (qcom_add_pdm_subdev); + +/** +* qcom_remove_pdm_subdev() - remove PD Mapper subdevice +* @rproc: rproc handle +* @pdm: PDM subdevice handle +* +* Remove the PD Mapper subdevice. +*/ +void qcom_remove_pdm_subdev (struct rproc *rproc,struct qcom_rproc_pdm *pdm) +{ +rproc_remove_subdev (rproc, &pdm->subdev); +} +EXPORT_SYMBOL_GPL (qcom_remove_pdm_subdev); +MODULE_DESCRIPTION ("Qualcomm Remoteproc helper driver" );MODULE_LICENSE ("GPL v2" );
drivers/remoteproc/qcom_common.h +10 -0
@@ -34,6 +34,13 @@ struct qcom_rproc_ssr {struct qcom_ssr_subsystem *info; }; +struct qcom_rproc_pdm { +struct rproc_subdev subdev; +struct device *dev; +int index; +struct auxiliary_device *adev; +}; + void qcom_minidump(struct rproc *rproc, unsigned int minidump_id, void (*rproc_dumpfn_t)(struct rproc *rproc, struct rproc_dump_segment *segment, void *dest, size_t offset,
@@ -52,6 +59,9 @@ void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr, const char *ssr_name);void qcom_remove_ssr_subdev (struct rproc *rproc,struct qcom_rproc_ssr *ssr); +void qcom_add_pdm_subdev (struct rproc *rproc,struct qcom_rproc_pdm *pdm); +void qcom_remove_pdm_subdev (struct rproc *rproc,struct qcom_rproc_pdm *pdm); +#if IS_ENABLED (CONFIG_QCOM_SYSMON ) struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, const char *name,
drivers/remoteproc/qcom_q6v5_adsp.c +3 -0
@@ -112,6 +112,7 @@ struct qcom_adsp {struct dev_pm_domain_list *pd_list;struct qcom_rproc_glink glink_subdev; +struct qcom_rproc_pdm pdm_subdev;struct qcom_rproc_ssr ssr_subdev;struct qcom_sysmon *sysmon;
@@ -726,6 +727,7 @@ static int adsp_probe(struct platform_device *pdev) goto disable_pm;qcom_add_glink_subdev (rproc, &adsp->glink_subdev, desc->ssr_name); +qcom_add_pdm_subdev (rproc, &adsp->pdm_subdev);qcom_add_ssr_subdev (rproc, &adsp->ssr_subdev, desc->ssr_name); adsp->sysmon = qcom_add_sysmon_subdev(rproc, desc->sysmon_name,
@@ -755,6 +757,7 @@ static void adsp_remove(struct platform_device *pdev)qcom_q6v5_deinit (&adsp->q6v5);qcom_remove_glink_subdev (adsp->rproc, &adsp->glink_subdev); +qcom_remove_pdm_subdev (adsp->rproc, &adsp->pdm_subdev);qcom_remove_sysmon_subdev (adsp->sysmon);qcom_remove_ssr_subdev (adsp->rproc, &adsp->ssr_subdev);qcom_rproc_pds_detach (adsp);
drivers/remoteproc/qcom_q6v5_mss.c +3 -0
@@ -228,6 +228,7 @@ struct q6v5 {struct qcom_rproc_glink glink_subdev;struct qcom_rproc_subdev smd_subdev; +struct qcom_rproc_pdm pdm_subdev;struct qcom_rproc_ssr ssr_subdev;struct qcom_sysmon *sysmon;struct platform_device *bam_dmux;
@@ -2102,6 +2103,7 @@ static int q6v5_probe(struct platform_device *pdev) qproc->mba_perm =BIT (QCOM_SCM_VMID_HLOS );qcom_add_glink_subdev (rproc, &qproc->glink_subdev,"mpss" );qcom_add_smd_subdev (rproc, &qproc->smd_subdev); +qcom_add_pdm_subdev (rproc, &qproc->pdm_subdev);qcom_add_ssr_subdev (rproc, &qproc->ssr_subdev,"mpss" ); qproc->sysmon =qcom_add_sysmon_subdev (rproc,"modem" ,0x12 );if (IS_ERR (qproc->sysmon)) {
@@ -2143,6 +2145,7 @@ static void q6v5_remove(struct platform_device *pdev)qcom_q6v5_deinit (&qproc->q6v5);qcom_remove_sysmon_subdev (qproc->sysmon);qcom_remove_ssr_subdev (rproc, &qproc->ssr_subdev); +qcom_remove_pdm_subdev (rproc, &qproc->pdm_subdev);qcom_remove_smd_subdev (rproc, &qproc->smd_subdev);qcom_remove_glink_subdev (rproc, &qproc->glink_subdev);
drivers/remoteproc/qcom_q6v5_pas.c +3 -0
@@ -111,6 +111,7 @@ struct qcom_adsp {struct qcom_rproc_glink glink_subdev;struct qcom_rproc_subdev smd_subdev; +struct qcom_rproc_pdm pdm_subdev;struct qcom_rproc_ssr ssr_subdev;struct qcom_sysmon *sysmon;
@@ -777,6 +778,7 @@ static int adsp_probe(struct platform_device *pdev)qcom_add_glink_subdev (rproc, &adsp->glink_subdev, desc->ssr_name);qcom_add_smd_subdev (rproc, &adsp->smd_subdev); +qcom_add_pdm_subdev (rproc, &adsp->pdm_subdev); adsp->sysmon =qcom_add_sysmon_subdev (rproc, desc->sysmon_name, desc->ssctl_id);
@@ -811,6 +813,7 @@ static void adsp_remove(struct platform_device *pdev)qcom_remove_glink_subdev (adsp->rproc, &adsp->glink_subdev);qcom_remove_sysmon_subdev (adsp->sysmon);qcom_remove_smd_subdev (adsp->rproc, &adsp->smd_subdev); +qcom_remove_pdm_subdev (adsp->rproc, &adsp->pdm_subdev);qcom_remove_ssr_subdev (adsp->rproc, &adsp->ssr_subdev);adsp_pds_detach (adsp, adsp->proxy_pds, adsp->proxy_pd_count);device_init_wakeup (adsp->dev, false);
drivers/remoteproc/qcom_q6v5_wcss.c +3 -0
@@ -148,6 +148,7 @@ struct q6v5_wcss {bool requires_force_stop;struct qcom_rproc_glink glink_subdev; +struct qcom_rproc_pdm pdm_subdev;struct qcom_rproc_ssr ssr_subdev; };
@@ -1052,6 +1053,7 @@ static int q6v5_wcss_probe(struct platform_device *pdev)return ret;qcom_add_glink_subdev (rproc, &wcss->glink_subdev,"q6wcss" ); +qcom_add_pdm_subdev (rproc, &wcss->pdm_subdev);qcom_add_ssr_subdev (rproc, &wcss->ssr_subdev,"q6wcss" );if (desc->ssctl_id)
@@ -1074,6 +1076,7 @@ static void q6v5_wcss_remove(struct platform_device *pdev)struct q6v5_wcss *wcss = rproc->priv;qcom_q6v5_deinit (&wcss->q6v5); +qcom_remove_pdm_subdev (rproc, &wcss->pdm_subdev);rproc_del (rproc); }
Signature · 1 line
2.39.2
Re: (subset) [PATCH v9 0/5] soc: qcom: add in-kernel pd-mapper implementation
In reply to Dmitry BaryshkovQuoted 5 lines · Dmitry Baryshkov
Protection domain mapper is a QMI service providing mapping between 'protection domains' and services supported / allowed in these domains. For example such mapping is required for loading of the WiFi firmware or for properly starting up the UCSI / altmode / battery manager support.
Quoted 7 lines
The existing userspace implementation has several issue. It doesn't play well with
CONFIG_EXTRA_FIRMWARE, it doesn't reread the JSON files if the firmware location is changed (or if the firmware was not available at the time pd-mapper was started but the corresponding directory is mounted later), etc.[...]
Applied, thanks!
[1/5] soc: qcom: pdr: protect locator_addr with the main mutex
commit: 107924c14e3ddd85119ca43c26a4ee1056fa9b84
[2/5] soc: qcom: pdr: fix parsing of domains lists
commit: 57f20d51f35780f240ecf39d81cda23612800a92
[3/5] soc: qcom: pdr: extract PDR message marshalling data
commit: 0ac5c7d933de6570e0efa62bb5ef9e440311a6fe
[4/5] soc: qcom: add pd-mapper implementation
commit: 1ebcde047c547134e894508468ead0b7bd3b967dBest regards,
Signature · 1 line
Bjorn Andersson <[email protected]>
Re: (subset) [PATCH v9 0/5] soc: qcom: add in-kernel pd-mapper implementation
In reply to Dmitry BaryshkovQuoted 5 lines · Dmitry Baryshkov
Protection domain mapper is a QMI service providing mapping between 'protection domains' and services supported / allowed in these domains. For example such mapping is required for loading of the WiFi firmware or for properly starting up the UCSI / altmode / battery manager support.
Quoted 7 lines
The existing userspace implementation has several issue. It doesn't play well with
CONFIG_EXTRA_FIRMWARE, it doesn't reread the JSON files if the firmware location is changed (or if the firmware was not available at the time pd-mapper was started but the corresponding directory is mounted later), etc.[...]
Applied, thanks!
[5/5] remoteproc: qcom: enable in-kernel PD mapper
commit: 5b9f51b200dcb2c3924ecbff324fa52f1faa84d3
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>