Lines Matching full:stm
3 * System Trace Module (STM) master/channel allocation policy management
17 #include <linux/stm.h>
18 #include "stm.h"
26 struct stm_device *stm; member
107 struct stm_device *stm; in stp_policy_node_masters_store() local
115 stm = policy_node->policy->stm; in stp_policy_node_masters_store()
116 if (!stm) in stp_policy_node_masters_store()
120 if (first > last || first < stm->data->sw_start || in stp_policy_node_masters_store()
121 last > stm->data->sw_end) { in stp_policy_node_masters_store()
154 struct stm_device *stm; in stp_policy_node_channels_store() local
162 stm = policy_node->policy->stm; in stp_policy_node_channels_store()
163 if (!stm) in stp_policy_node_channels_store()
167 last >= stm->data->sw_nchannels) { in stp_policy_node_channels_store()
243 if (!policy->stm) in stp_policy_node_make()
246 pdrv = policy->stm->pdrv; in stp_policy_node_make()
256 if (policy->stm->pdrv_node_type) in stp_policy_node_make()
257 type = policy->stm->pdrv_node_type; in stp_policy_node_make()
264 policy_node->first_master = policy->stm->data->sw_start; in stp_policy_node_make()
265 policy_node->last_master = policy->stm->data->sw_end; in stp_policy_node_make()
267 policy_node->last_channel = policy->stm->data->sw_nchannels - 1; in stp_policy_node_make()
300 (policy && policy->stm) ? in stp_policy_device_show()
301 policy->stm->data->name : in stp_policy_device_show()
316 (policy && policy->stm) ? in stp_policy_protocol_show()
317 policy->stm->pdrv->name : in stp_policy_protocol_show()
333 struct stm_device *stm = policy->stm; in stp_policy_unbind() local
340 if (WARN_ON_ONCE(!policy->stm)) in stp_policy_unbind()
343 lockdep_assert_held(&stm->policy_mutex); in stp_policy_unbind()
345 stm->policy = NULL; in stp_policy_unbind()
346 policy->stm = NULL; in stp_policy_unbind()
351 stm_put_protocol(stm->pdrv); in stp_policy_unbind()
352 stm->pdrv = NULL; in stp_policy_unbind()
353 stm_put_device(stm); in stp_policy_unbind()
359 struct stm_device *stm = policy->stm; in stp_policy_release() local
362 if (!stm) in stp_policy_release()
365 mutex_lock(&stm->policy_mutex); in stp_policy_release()
367 mutex_unlock(&stm->policy_mutex); in stp_policy_release()
394 struct stm_device *stm; in stp_policy_make() local
403 * <device_name> is the name of an existing stm device; may in stp_policy_make()
425 stm = stm_find_device(devname); in stp_policy_make()
426 if (!stm) { in stp_policy_make()
435 stm_put_device(stm); in stp_policy_make()
439 mutex_lock(&stm->policy_mutex); in stp_policy_make()
440 if (stm->policy) { in stp_policy_make()
445 stm->policy = kzalloc(sizeof(*stm->policy), GFP_KERNEL); in stp_policy_make()
446 if (!stm->policy) { in stp_policy_make()
451 config_group_init_type_name(&stm->policy->group, name, in stp_policy_make()
454 stm->pdrv = pdrv; in stp_policy_make()
455 stm->pdrv_node_type = pdrv_node_type; in stp_policy_make()
456 stm->policy->stm = stm; in stp_policy_make()
457 ret = &stm->policy->group; in stp_policy_make()
460 mutex_unlock(&stm->policy_mutex); in stp_policy_make()
464 * pdrv and stm->pdrv at this point can be quite different, in stp_policy_make()
468 stm_put_device(stm); in stp_policy_make()
538 stp_policy_node_lookup(struct stm_device *stm, char *s) in stp_policy_node_lookup() argument
544 mutex_lock(&stm->policy_mutex); in stp_policy_node_lookup()
545 if (stm->policy) in stp_policy_node_lookup()
546 policy_node = __stp_policy_node_lookup(stm->policy, s); in stp_policy_node_lookup()
547 mutex_unlock(&stm->policy_mutex); in stp_policy_node_lookup()