Lines Matching +full:protection +full:- +full:domain
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Qualcomm Protection Domain mapper
25 const char *domain; member
27 /* NULL-terminated array */
57 list_for_each_entry(service, &data->services, list) { in qcom_pdm_find()
58 if (!strcmp(service->name, name)) in qcom_pdm_find()
71 struct qcom_pdm_domain *domain; in qcom_pdm_add_service_domain() local
75 list_for_each_entry(domain, &service->domains, list) { in qcom_pdm_add_service_domain()
76 if (!strcmp(domain->name, domain_name)) in qcom_pdm_add_service_domain()
77 return -EBUSY; in qcom_pdm_add_service_domain()
82 return -ENOMEM; in qcom_pdm_add_service_domain()
84 INIT_LIST_HEAD(&service->domains); in qcom_pdm_add_service_domain()
85 service->name = service_name; in qcom_pdm_add_service_domain()
87 list_add_tail(&service->list, &data->services); in qcom_pdm_add_service_domain()
90 domain = kzalloc(sizeof(*domain), GFP_KERNEL); in qcom_pdm_add_service_domain()
91 if (!domain) { in qcom_pdm_add_service_domain()
92 if (list_empty(&service->domains)) { in qcom_pdm_add_service_domain()
93 list_del(&service->list); in qcom_pdm_add_service_domain()
97 return -ENOMEM; in qcom_pdm_add_service_domain()
100 domain->name = domain_name; in qcom_pdm_add_service_domain()
101 domain->instance_id = instance_id; in qcom_pdm_add_service_domain()
102 list_add_tail(&domain->list, &service->domains); in qcom_pdm_add_service_domain()
108 const struct qcom_pdm_domain_data *domain) in qcom_pdm_add_domain() argument
115 domain->domain, in qcom_pdm_add_domain()
116 domain->instance_id); in qcom_pdm_add_domain()
120 for (i = 0; domain->services[i]; i++) { in qcom_pdm_add_domain()
122 domain->services[i], in qcom_pdm_add_domain()
123 domain->domain, in qcom_pdm_add_domain()
124 domain->instance_id); in qcom_pdm_add_domain()
136 struct qcom_pdm_domain *domain, *tdomain; in qcom_pdm_free_domains() local
138 list_for_each_entry_safe(service, tservice, &data->services, list) { in qcom_pdm_free_domains()
139 list_for_each_entry_safe(domain, tdomain, &service->domains, list) { in qcom_pdm_free_domains()
140 list_del(&domain->list); in qcom_pdm_free_domains()
141 kfree(domain); in qcom_pdm_free_domains()
144 list_del(&service->list); in qcom_pdm_free_domains()
165 offset = req->domain_offset_valid ? req->domain_offset : 0; in qcom_pdm_get_domain_list()
167 rsp->resp.result = QMI_RESULT_SUCCESS_V01; in qcom_pdm_get_domain_list()
168 rsp->resp.error = QMI_ERR_NONE_V01; in qcom_pdm_get_domain_list()
170 rsp->db_rev_count_valid = true; in qcom_pdm_get_domain_list()
171 rsp->db_rev_count = 1; in qcom_pdm_get_domain_list()
173 rsp->total_domains_valid = true; in qcom_pdm_get_domain_list()
174 rsp->total_domains = 0; in qcom_pdm_get_domain_list()
178 service = qcom_pdm_find(data, req->service_name); in qcom_pdm_get_domain_list()
180 struct qcom_pdm_domain *domain; in qcom_pdm_get_domain_list() local
182 rsp->domain_list_valid = true; in qcom_pdm_get_domain_list()
183 rsp->domain_list_len = 0; in qcom_pdm_get_domain_list()
185 list_for_each_entry(domain, &service->domains, list) { in qcom_pdm_get_domain_list()
186 u32 i = rsp->total_domains++; in qcom_pdm_get_domain_list()
189 u32 j = rsp->domain_list_len++; in qcom_pdm_get_domain_list()
191 strscpy(rsp->domain_list[j].name, domain->name, in qcom_pdm_get_domain_list()
192 sizeof(rsp->domain_list[i].name)); in qcom_pdm_get_domain_list()
193 rsp->domain_list[j].instance = domain->instance_id; in qcom_pdm_get_domain_list()
195 pr_debug("PDM: found %s / %d\n", domain->name, in qcom_pdm_get_domain_list()
196 domain->instance_id); in qcom_pdm_get_domain_list()
201 pr_debug("PDM: service '%s' offset %d returning %d domains (of %d)\n", req->service_name, in qcom_pdm_get_domain_list()
202 req->domain_offset_valid ? req->domain_offset : -1, rsp->domain_list_len, rsp->total_domains); in qcom_pdm_get_domain_list()
224 pr_warn_ratelimited("PDM: service '%s' crash: '%s'\n", req->service, req->reason); in qcom_pdm_pfr()
255 .domain = "msm/adsp/audio_pd",
264 .domain = "msm/adsp/charger_pd",
270 .domain = "msm/adsp/root_pd",
276 .domain = "msm/adsp/root_pd",
285 .domain = "msm/adsp/sensor_pd",
291 .domain = "msm/adsp/audio_pd",
297 .domain = "msm/adsp/root_pd",
303 .domain = "msm/cdsp/root_pd",
309 .domain = "msm/slpi/root_pd",
315 .domain = "msm/slpi/sensor_pd",
321 .domain = "msm/modem/root_pd",
329 .domain = "msm/modem/root_pd",
338 .domain = "msm/modem/root_pd",
348 .domain = "msm/modem/root_pd",
354 .domain = "msm/modem/wlan_pd",
571 qmi_handle_release(&data->handle); in qcom_pdm_stop()
586 return ERR_PTR(-ENODEV); in qcom_pdm_start()
592 return ERR_PTR(-ENODEV); in qcom_pdm_start()
595 domains = match->data; in qcom_pdm_start()
598 return ERR_PTR(-ENODEV); in qcom_pdm_start()
603 return ERR_PTR(-ENOMEM); in qcom_pdm_start()
605 INIT_LIST_HEAD(&data->services); in qcom_pdm_start()
607 ret = qmi_handle_init(&data->handle, SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN, in qcom_pdm_start()
614 refcount_set(&data->refcnt, 1); in qcom_pdm_start()
622 ret = qmi_add_server(&data->handle, SERVREG_LOCATOR_SERVICE, in qcom_pdm_start()
654 refcount_inc(&__qcom_pdm_data->refcnt); in qcom_pdm_probe()
672 if (refcount_dec_and_mutex_lock(&data->refcnt, &qcom_pdm_mutex)) { in qcom_pdm_remove()
680 { .name = "qcom_common.pd-mapper" },
686 .name = "qcom-pdm-mapper",
693 MODULE_DESCRIPTION("Qualcomm Protection Domain Mapper");