Loading drivers/hwtracing/coresight/coresight-tmc-etr.c +3 −1 Original line number Diff line number Diff line Loading @@ -1455,8 +1455,10 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev) coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0); /* Free memory outside the spinlock if need be */ if (drvdata->etr_buf) if (drvdata->etr_buf) { tmc_etr_free_sysfs_buf(drvdata->etr_buf); drvdata->etr_buf = NULL; } } out: mutex_unlock(&drvdata->mem_lock); Loading drivers/hwtracing/coresight/coresight-tmc.c +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ static int tmc_read_prepare(struct tmc_drvdata *drvdata) { int ret = 0; if (!drvdata->enable) return -EPERM; switch (drvdata->config_type) { case TMC_CONFIG_TYPE_ETB: case TMC_CONFIG_TYPE_ETF: Loading drivers/hwtracing/coresight/coresight.c +60 −32 Original line number Diff line number Diff line Loading @@ -211,10 +211,12 @@ static int coresight_enable_link(struct coresight_device *csdev, if (atomic_inc_return(&csdev->refcnt[refport]) == 1) { if (link_ops(csdev)->enable) { ret = link_ops(csdev)->enable(csdev, inport, outport); if (ret) if (ret) { atomic_dec(&csdev->refcnt[refport]); return ret; } } } csdev->enable = true; Loading Loading @@ -302,13 +304,12 @@ static bool coresight_disable_source(struct coresight_device *csdev) return !csdev->enable; } void coresight_disable_path(struct list_head *path) static void coresight_disable_list_node(struct list_head *path, struct coresight_node *nd) { u32 type; struct coresight_node *nd; struct coresight_device *csdev, *parent, *child; list_for_each_entry(nd, path, link) { csdev = nd->csdev; type = csdev->type; Loading Loading @@ -339,6 +340,31 @@ void coresight_disable_path(struct list_head *path) break; } } /** * During enabling path, if it is failed, then only those enabled * devices need to be disabled. This function is to disable devices * which is enabled before the failed device. * * @path the head of the list * @nd the failed device node */ static void coresight_disable_previous_devs(struct list_head *path, struct coresight_node *nd) { list_for_each_entry_continue(nd, path, link) { coresight_disable_list_node(path, nd); } } void coresight_disable_path(struct list_head *path) { struct coresight_node *nd; list_for_each_entry(nd, path, link) { coresight_disable_list_node(path, nd); } } int coresight_enable_path(struct list_head *path, u32 mode) Loading Loading @@ -388,7 +414,7 @@ int coresight_enable_path(struct list_head *path, u32 mode) out: return ret; err: coresight_disable_path(path); coresight_disable_previous_devs(path, nd); goto out; } Loading Loading @@ -838,6 +864,7 @@ static ssize_t enable_source_store(struct device *dev, if (ret) return ret; } else { atomic_set(csdev->refcnt, 1); coresight_disable(csdev); } Loading Loading @@ -1072,6 +1099,7 @@ static ssize_t reset_source_sink_store(struct bus_type *bus, csdev = coresight_get_source(cspath->path); if (!csdev) continue; atomic_set(csdev->refcnt, 1); __coresight_disable(csdev); } Loading Loading
drivers/hwtracing/coresight/coresight-tmc-etr.c +3 −1 Original line number Diff line number Diff line Loading @@ -1455,8 +1455,10 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev) coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0); coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0); /* Free memory outside the spinlock if need be */ if (drvdata->etr_buf) if (drvdata->etr_buf) { tmc_etr_free_sysfs_buf(drvdata->etr_buf); drvdata->etr_buf = NULL; } } out: mutex_unlock(&drvdata->mem_lock); Loading
drivers/hwtracing/coresight/coresight-tmc.c +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ static int tmc_read_prepare(struct tmc_drvdata *drvdata) { int ret = 0; if (!drvdata->enable) return -EPERM; switch (drvdata->config_type) { case TMC_CONFIG_TYPE_ETB: case TMC_CONFIG_TYPE_ETF: Loading
drivers/hwtracing/coresight/coresight.c +60 −32 Original line number Diff line number Diff line Loading @@ -211,10 +211,12 @@ static int coresight_enable_link(struct coresight_device *csdev, if (atomic_inc_return(&csdev->refcnt[refport]) == 1) { if (link_ops(csdev)->enable) { ret = link_ops(csdev)->enable(csdev, inport, outport); if (ret) if (ret) { atomic_dec(&csdev->refcnt[refport]); return ret; } } } csdev->enable = true; Loading Loading @@ -302,13 +304,12 @@ static bool coresight_disable_source(struct coresight_device *csdev) return !csdev->enable; } void coresight_disable_path(struct list_head *path) static void coresight_disable_list_node(struct list_head *path, struct coresight_node *nd) { u32 type; struct coresight_node *nd; struct coresight_device *csdev, *parent, *child; list_for_each_entry(nd, path, link) { csdev = nd->csdev; type = csdev->type; Loading Loading @@ -339,6 +340,31 @@ void coresight_disable_path(struct list_head *path) break; } } /** * During enabling path, if it is failed, then only those enabled * devices need to be disabled. This function is to disable devices * which is enabled before the failed device. * * @path the head of the list * @nd the failed device node */ static void coresight_disable_previous_devs(struct list_head *path, struct coresight_node *nd) { list_for_each_entry_continue(nd, path, link) { coresight_disable_list_node(path, nd); } } void coresight_disable_path(struct list_head *path) { struct coresight_node *nd; list_for_each_entry(nd, path, link) { coresight_disable_list_node(path, nd); } } int coresight_enable_path(struct list_head *path, u32 mode) Loading Loading @@ -388,7 +414,7 @@ int coresight_enable_path(struct list_head *path, u32 mode) out: return ret; err: coresight_disable_path(path); coresight_disable_previous_devs(path, nd); goto out; } Loading Loading @@ -838,6 +864,7 @@ static ssize_t enable_source_store(struct device *dev, if (ret) return ret; } else { atomic_set(csdev->refcnt, 1); coresight_disable(csdev); } Loading Loading @@ -1072,6 +1099,7 @@ static ssize_t reset_source_sink_store(struct bus_type *bus, csdev = coresight_get_source(cspath->path); if (!csdev) continue; atomic_set(csdev->refcnt, 1); __coresight_disable(csdev); } Loading