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 CFB7A3E16B9 for ; Wed, 22 Jul 2026 20:04:35 +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=1784750677; cv=none; b=XbK4pLPr5UMhrIhSL9npP6tT8OwNsWgXc+9qT2B3Nmk078eR+13lnotTVNo6XSi87Ar0Nt7DFgLZDwbhIcebWgVyCzEjdvPAOUsO8vAxiBZz4mUBxcAh3M80HL7KT+D2+Yh6YmxSC/s1wsdTHNSJpvMf5Rov1sQCWRusSsViJnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784750677; c=relaxed/simple; bh=CjJZRMZW98EN1r5q3jC2RHLJuj9i+uIanPTZMLLNZoA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BBqlP2s3j+8ZfwQiwe6JUfARFJSwe8FaOJMOsWXCgOfONA+o78vxDIP0kEbfe7jkWhWuSbuWN8K8pn1YCdwtxwV1NW23BJxQi8rAxKa7xU2y3hD44KLGDAzvlKXFB6JTEer7StwoZU5NkWXTkkEJRX6aJRIYHdRV/gO8jAjnP40= 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=a4juYzy+; 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="a4juYzy+" 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 F03121595; Wed, 22 Jul 2026 13:04:30 -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 E64093F59E; Wed, 22 Jul 2026 13:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784750675; bh=CjJZRMZW98EN1r5q3jC2RHLJuj9i+uIanPTZMLLNZoA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a4juYzy+ybwQR85P0FSBjrVoOC07Mc862nVQNopVfJcu+4tWphW4fyEgPVo2Nc1iF 7yD9bSWPLHjkTU7/hg3qv4kggqL69H/sJzuHdQlVkU9pEaSa57M8ALZULfrQhkTkPc HVBjGsokJvMvUri7dVtAO4r5yAlJ/4qGQkGk9Mrw= Date: Wed, 22 Jul 2026 21:04:31 +0100 From: Yeoreum Yun To: Suzuki K Poulose Cc: Leo Yan , 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, 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> <20260706173940.GB1024232@e132581.arm.com> <2005044a-ff4d-4585-963b-1c346d661a35@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: Hi Suzuki, > > On 06/07/2026 18:39, Leo Yan wrote: > > > On Mon, Jun 29, 2026 at 10:00:01AM +0100, Yeoreum Yun wrote: > > > > > > [...] > > > > > > > @@ -922,25 +950,7 @@ static int etm4_enable_sysfs(struct coresight_device *csdev, struct coresight_pa > > > > { > > > > struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); > > > > struct etm4_enable_arg arg = { }; > > > > - unsigned long cfg_hash; > > > > - int ret, preset; > > > > - > > > > - /* enable any config activated by configfs */ > > > > - cscfg_config_sysfs_get_active_cfg(&cfg_hash, &preset); > > > > - if (cfg_hash) { > > > > - ret = cscfg_csdev_enable_active_config(csdev, cfg_hash, preset); > > > > - if (ret) { > > > > - etm4_release_trace_id(drvdata); > > > > - return ret; > > > > - } > > > > - } > > > > - > > > > - raw_spin_lock(&drvdata->spinlock); > > > > - > > > > - drvdata->trcid = path->trace_id; > > > > - > > > > - /* Tracer will never be paused in sysfs mode */ > > > > - drvdata->paused = false; > > > > + int ret; > > > > /* > > > > * Executing etm4_enable_hw on the cpu whose ETM is being enabled > > > > @@ -948,20 +958,20 @@ static int etm4_enable_sysfs(struct coresight_device *csdev, struct coresight_pa > > > > */ > > > > arg.drvdata = drvdata; > > > > arg.path = path; > > > > + > > > > + raw_spin_lock(&drvdata->spinlock); > > > > + arg.config = drvdata->config; > > > > + raw_spin_unlock(&drvdata->spinlock); > > > > + > > > > ret = smp_call_function_single(drvdata->cpu, > > > > etm4_enable_sysfs_smp_call, &arg, 1); > > > > if (!ret) > > > > ret = arg.rc; > > > > if (!ret) > > > > - drvdata->sticky_enable = true; > > > > - > > > > - if (ret) > > > > + dev_dbg(&csdev->dev, "ETM tracing enabled\n"); > > > > + else > > > > etm4_release_trace_id(drvdata); > > > > - raw_spin_unlock(&drvdata->spinlock); > > > > - > > > > - if (!ret) > > > > - dev_dbg(&csdev->dev, "ETM tracing enabled\n"); > > > > return ret; > > > > } > > > > > > This is most valuable change for me, as now we will have much clear > > > scope for what is protected ("drvdata->config"). > > > > > > However, a corner case was mentioned by Sashiko: > > > > > > | It appears etm4_enable_hw() modifies drvdata->ss_status while executing > > > | via IPI, but sshot_ctrl_store() can modify the same array concurrently > > > > Could we stop modifying the drvdata->ss_status in enable_hw() ? We moved > > it outside the config claiming that the status is not used(or useful). # > > Then why not remove the updating from enable_hw() > > This is because of the consistency with the former. > If we remove those parts in the etm4x_enbale_hw(), the PENDING and STATUS > bits will be never cleared according to the case. > > This will be handled in the future for the PENDING and STATUS bit > hanlding in the perf session and sysfs accordingly > before that, to keep the old behavior, remain as-is. If you don't mind, could I keep it as-is and post next version among this week? Thanks! -- Sincerely, Yeoreum Yun