From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB29A33DEDD for ; Thu, 16 Jul 2026 19:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784231885; cv=none; b=Qak0LtgnokpYp7UzGMLr6P6YPU6i58D5bpO3p5ag7P5v1ytIxYskri8rwCJDLH4YPBZoBZzyIiUHrLYdfamoKGkGm/uGLrdv7UxgNp5ir8KczV0AzrXVZrqqblmyswTGznR6bqGpjDKCNcFimboFyVe+Vspniax7c7OqYU2aTCQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784231885; c=relaxed/simple; bh=pPrRe+Xjk6CAM0WQ2SNb/SkAx8gLxSfCcN3TUqvO0mY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RP2nX/bX8a8xenoDLYKfljrrI0qJ1mAOiO4SR1A7qADkiXeRSq79FYMzMalZBZVhabfjj8jeZOYmQURhPCo1DrYLds57+yUxlwCn+4w/I1owwfTvJsNPVcvPcL1wCGQhemmireEiSbZlSCenkvusJqkl34TzPEUlTba0umO7v/8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=sBbc69aG; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="sBbc69aG" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DB76B1476; Thu, 16 Jul 2026 12:57:57 -0700 (PDT) Received: from e129823.arm.com (e129823.arm.com [10.2.213.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D3E103F66F; Thu, 16 Jul 2026 12:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784231882; bh=pPrRe+Xjk6CAM0WQ2SNb/SkAx8gLxSfCcN3TUqvO0mY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sBbc69aGjZ/0dD77ieu+b3FTgMg0b8ogmR2jh+ASoV0ALIbP+4by5mWy9TbJYmy8I 2tQTDrGOxgsNC6gBA+1KDluM+ZJ/co9w4LGoZnrEkJFuFPfKN5ZMIEtpw0WhZA2se6 KZcFfLU9866W4alXTZtJfcNzKrK1SkdJy4fS1UAQ= Date: Thu, 16 Jul 2026 20:57:58 +0100 From: Yeoreum Yun To: Suzuki K Poulose Cc: Yeoreum Yun , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mike.leach@arm.com, james.clark@linaro.org, alexander.shishkin@linux.intel.com, leo.yan@arm.com, jie.gan@oss.qualcomm.com Subject: Re: [PATCH v8 08/13] coresight: etm4x: fix inconsistencies with sysfs configuration Message-ID: References: <20260629090007.1718746-1-yeoreum.yun@arm.com> <20260629090007.1718746-9-yeoreum.yun@arm.com> <78a81992-6beb-4caf-b7bd-5cab635a6de1@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78a81992-6beb-4caf-b7bd-5cab635a6de1@arm.com> [...] > > static void etm4_enable_sysfs_smp_call(void *info) > > { > > struct etm4_enable_arg *arg = info; > > + struct etmv4_drvdata *drvdata; > > struct coresight_device *csdev; > > + unsigned long cfg_hash; > > + int preset; > > if (WARN_ON(!arg)) > > return; > > - csdev = arg->drvdata->csdev; > > + drvdata = arg->drvdata; > > + csdev = drvdata->csdev; > > if (!coresight_take_mode(csdev, CS_MODE_SYSFS)) { > > /* Someone is already using the tracer */ > > arg->rc = -EBUSY; > > return; > > } > > - arg->rc = etm4_enable_hw(arg->drvdata); > > + drvdata->active_config = arg->config; > > I see, we copy the sysfs config to init_arg and then apply it here. Yes it is. Thanks! > > > - /* The tracer didn't start */ > > + /* enable any config activated by configfs */ > > + cscfg_config_sysfs_get_active_cfg(&cfg_hash, &preset); > > + if (cfg_hash) { > > + arg->rc = cscfg_csdev_enable_active_config(csdev, > > + cfg_hash, > > + preset); > > + if (arg->rc) > > + goto err; > > + } > > + > > + drvdata->trcid = arg->path->trace_id; > > + > > + /* Tracer will never be paused in sysfs mode */ > > + drvdata->paused = false; > > + > > + arg->rc = etm4_enable_hw(drvdata); > > if (arg->rc) { > > - coresight_set_mode(csdev, CS_MODE_DISABLED); > > - return; > > + cscfg_csdev_disable_active_config(csdev); > > + goto err; > > } > > + drvdata->sticky_enable = true; > > csdev->path = arg->path; > > + > > + return; > > +err: > > + /* The tracer didn't start */ > > + coresight_set_mode(csdev, CS_MODE_DISABLED); > > Do we need to reset the active_config ? I don't think we don't need to reset active_config since it's a failure path and at the next time, the active_config will be initialised with the drvdata->config again if next trial is via sysfs. If the next trial is perf, it clears active_config in etm4_parse_event_config(). Therefore, we wouldn't need to reset the active_config before relasing mode. > > > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h > > index c0f7da17a186..a974e4d05838 100644 > > --- a/drivers/hwtracing/coresight/coresight-etm4x.h > > +++ b/drivers/hwtracing/coresight/coresight-etm4x.h > > @@ -1068,6 +1068,7 @@ struct etmv4_save_state { > > * allows tracing at all ELs. We don't want to compute this > > * at runtime, due to the additional setting of TRFCR_CX when > > * in EL2. Otherwise, 0. > > + * @active_config: structure holding current applied configuration parameters. > > * @config: structure holding configuration parameters. > > Please could you update the documentation for "config" -> holding sysfs mode > configuration. Thanks I'll update accordingly. -- Sincerely, Yeoreum Yun