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 7060020551B for ; Thu, 9 Jan 2025 12:21:14 +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=1736425276; cv=none; b=KiIObSQrSEAaBsJBKBRvkRuLrSLoGP4hM3tFpfvaPX5TBxMob+9q5ScpFNArbqae/wzMWgfDD7PD0i/HWgDpvRHVVln1ds9tbgZKQmLIRymFzM64KXyGpR32Ry1pvUm/nDvdOtoS3AlSR4VVudCILepi0hRS2jCrExWbp2Emmkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736425276; c=relaxed/simple; bh=IKuNN0nuMilkXgVunOqoLMMm1/sekK/xORAUcWLl5zQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cG/PKpvEzjklu7jb40gWboRZRLI3gtO7j73jnxMFtNGwV6DbH+fI00vsw2cGR1zB8zXK91Jqe+QlO6stQAod11BPccEsevAlDNSy4UvPvB7vv6VVn72WuuhDBiEjwwUeKYaJXJgeCd29S5Jq/EXco4a6VPupBpz0zDwGr1v02ak= 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; 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 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 1638812FC; Thu, 9 Jan 2025 04:21:42 -0800 (PST) Received: from [10.57.32.219] (unknown [10.57.32.219]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B72273F673; Thu, 9 Jan 2025 04:21:12 -0800 (PST) Message-ID: <4f9d2bed-7ce0-429e-83cc-ad6cbcc6085e@arm.com> Date: Thu, 9 Jan 2025 12:21:11 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] coresight/etm4x: disallow altering config via sysfs while enabled Content-Language: en-GB To: Yeoreum Yun Cc: mike.leach@linaro.org, james.clark@linaro.org, alexander.shishkin@linux.intel.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20241221165934.1161856-1-yeoreum.yun@arm.com> <20241221165934.1161856-2-yeoreum.yun@arm.com> <6bbc9b64-3ecb-46c3-8c4e-55dba6301ef3@arm.com> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 09/01/2025 12:01, Yeoreum Yun wrote: > Hi Suzuki, > >> Is it not better to have separate "configs" for perf and sysfs ? >> And etmX driver can populate the "running" config, based on the >> mode specific config. That way, the configs can be updated >> independently without affecting the running config or the perf one. >> > > That was i've tried but I've accepted Mike's opinion that > it's enough to check whether CS_MODE_DISABLED via coresight_get_mode() > in *_store(). > > "the .._store functions in sysfs should use coresight_get_mode() to ensure > this is set to CS_MODE_DISABLED before altering the config, > which ensures that the trace system is inactive. > We don't' really care about reading the config if trace is running." There are two issues with that : 1. Sprinkling the get_mode call in each sysfs stor function doesn't look good to me. 2. Someone preparing for a sysfs session must not be prevented from doing so just because there is a perf session running. Suzuki > Thanks. >