[PATCH v6 09/13] coresight: etm4x: missing cscfg_csdev_disable_active_config() in perf enable
Leo Yan
leo.yan at arm.com
Fri May 15 02:39:23 PDT 2026
On Wed, Apr 22, 2026 at 02:21:59PM +0100, Yeoreum Yun wrote:
[...]
> @@ -895,6 +895,8 @@ static int etm4_parse_event_config(struct coresight_device *csdev,
> * Missing BB support could cause silent decode errors
> * so fail to open if it's not supported.
> */
> + if (cfg_hash)
> + cscfg_csdev_disable_active_config(csdev);
I prefer do a bit refactoring for this.
we just save cfg_hash and cfg_preset into drvdata in
etm4_parse_event_config():
drvdata->cfg_hash = ATTR_CFG_GET_FLD(attr, configid);
if (drvdata->cfg_hash)
drvdata->preset = ATTR_CFG_GET_FLD(attr, preset);
Then create two helpers:
etm4_cscfg_enable(csdev) {
struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
return cscfg_csdev_enable_active_config(csdev, drvdata->cfg_hash,
drvdata->preset);
}
etm4_cscfg_disable(csdev) {
cscfg_csdev_disable_active_config(csdev);
}
These helpers will be used by etm4_{enable|disable}_perf()
and etm4_{enable|disable}_sysfs(). This might benefit the future cscfg
refactoring.
Thanks,
Leo
P.s. I will stop review at here. I assume ETMv3 changes just mirror
ETMv4's. So all ETMv4's comments would apply on ETMv3 patches. If I
miss anything, please let me know.
More information about the linux-arm-kernel
mailing list