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 A32342D594F for ; Fri, 17 Apr 2026 07:52:59 +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=1776412384; cv=none; b=fPURdaPqDPIxjpjNnCk1jCsbPM4gwL8hGzfhZ+6nZeemeL4dThjMjIC+8XOLd3ooXKlWNjYDYgDPh78JlI4D7SELVielMwyoKwIZTSwSxTq7zzldiqlsDLIDv+vpa1ePB08g59Lfc+akzR8lgbbmFofVO/NrX00l2mitzKADV1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776412384; c=relaxed/simple; bh=JeVqxJf/IWIdjjFYdX/EzgOh5qNuv0u1m7eLpaiUOzw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Z/IfwiXRCYYziMfDOgWcfPb/llYwpapupgYMPU7Llw429VfiZ+ug7V8lhZFmEHq8KLCY1B1cCNqxZ2JbrYvXmEcG0DFvvxOp2xnZ4AIWU/Eq+uHpDtTFD3XsxSqf35S1La6bPTyccOrinA2fMacPZdGNJjPXY5lwGwutCZStviU= 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=FrPDRkwR; 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="FrPDRkwR" 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 7279B1FC7; Fri, 17 Apr 2026 00:52:52 -0700 (PDT) Received: from localhost (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A3DD03F7B4; Fri, 17 Apr 2026 00:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1776412378; bh=JeVqxJf/IWIdjjFYdX/EzgOh5qNuv0u1m7eLpaiUOzw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FrPDRkwRnK/Md38TY+WIZJh3m1M9DuW+2bANAD0vZkUFQyvvPfsbMx6m/OweRO4Ky gdC4JHOFkxCkCjRg9p2tnEQa9mefuM5MpgmjBSX5lH3nJ+VHvrwBqo35lj3j2/gqcS JdU+hqmP8S2MPFCBfHdXadBgSWJzxZl26fFAOHE8= Date: Fri, 17 Apr 2026 08:52:55 +0100 From: Leo Yan To: Yeoreum Yun Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, suzuki.poulose@arm.com, mike.leach@arm.com, james.clark@linaro.org, alexander.shishkin@linux.intel.com, jie.gan@oss.qualcomm.com Subject: Re: [PATCH v5 06/12] coresight: etm4x: fix leaked trace id Message-ID: <20260417075255.GO356832@e132581.arm.com> References: <20260415165528.3369607-1-yeoreum.yun@arm.com> <20260415165528.3369607-7-yeoreum.yun@arm.com> <20260416165541.GN356832@e132581.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 Levi, On Thu, Apr 16, 2026 at 06:06:41PM +0100, Yeoreum Yun wrote: [...] > > We should use paired way for allocation and release. For example: > > > > coresight_enable_sysfs() > > { > > ... > > coresight_path_assign_trace_id(path); > > > > failed: > > coresight_path_unassign_trace_id(path); > > } > > > > coresight_disable_sysfs() > > { > > coresight_path_unassign_trace_id(path); > > } > > > > But this requires broader refactoring. E.g., the STM driver currently > > allocates system trace IDs statically during probe, we might need to > > consolidate for all modules to use dynamic allocation. > > So IIUC, Do we want to "map" per "session" and save this map information > in the "sink" driver? or just use "global" map but locate it in sink > driver? I prefer to save map in the sink's driver data, this is more scalable as the trace ID is allocated within a session rather than system wide. > I totally agree for above suggestion -- unsigned trace id > in the coresight_XXX function -- (but we need to add another callback > for this) but I think we don't need to sustain map per session > and it seems enough to use current storage for trace_id not move to > sink driver. > > Anyway It would be better to refactorying wiht another patchset... Yeah, we can come back to these ideas when work on it. Thanks, Leo