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 0BD7034BA50 for ; Fri, 15 May 2026 13:36:04 +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=1778852166; cv=none; b=MPHpPpHIhe2FXkockjiXmglKOuBMjocOGYa7CMCNN7Ll+R0rvwPf0jnOLo+izs5MiZlKAL/A1bnYjeCd7UnVCIrlMj4EA6YIxjFbF64dcN7FdJO+HlbngFPadCiEK2cg3AiGrxqnhUYTxv0frc9cPg3bvaA9YfblReNKeQRB2Gw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778852166; c=relaxed/simple; bh=VAr2I76Y4CubSxuDXZhrTgZY47uaYkt1AThe6DWpw/U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E010LXNJTyqpEIzl4nOXcq0fekEcHPPWh1zIYuyLRUfwoZ8t33GcXORES++D9Heo6A3294gY+LJ0FyRBbKFaU0LrOEDxbWdyUt2NgttKWz/aDmqziunZEXbk9rX8Sx2Oc9Zsmn3RnVDIrD86yBAWfVPekcfJIO38C3KkdA3CrMI= 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=IvU0nJjv; 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="IvU0nJjv" 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 2999E27D3; Fri, 15 May 2026 06:35:59 -0700 (PDT) Received: from e129823.arm.com (e129823.arm.com [10.1.197.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A12813F85F; Fri, 15 May 2026 06:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778852164; bh=VAr2I76Y4CubSxuDXZhrTgZY47uaYkt1AThe6DWpw/U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IvU0nJjvsfLetCj5DR4TbgEs+1sBcQJXIDt0av4N6w4q/WckQ4+N9Q/jKXY/HY8ll 39Ly+fCy4K3L073lF3TNvdR/+VzKOfoCWvO0brHTCeE/XUB2pEfY7OIS2CzGlTKDKi otOWttvT7j2YMcLMSLhAnSrKsG3KTbeWd0eUdAeo= Date: Fri, 15 May 2026 14:35:59 +0100 From: Yeoreum Yun To: Leo Yan 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 v6 09/13] coresight: etm4x: missing cscfg_csdev_disable_active_config() in perf enable Message-ID: References: <20260422132203.977549-1-yeoreum.yun@arm.com> <20260422132203.977549-10-yeoreum.yun@arm.com> <20260515093923.GJ34802@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: <20260515093923.GJ34802@e132581.arm.com> Hi Leo, > 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. I think this seems some over-engineering since the etm4_cscfg_enable/disable() just an wrapper for cscfg_csdev_enable/disable_active_config() but just increase size of drvdata. It's not late to delay when we do refactoring the cscfg and at that time, we can consider some place to save cfg_hash and preset. If we do right now, personally, there seems no benefit for this. Am I missing something? Thanks. [...] -- Sincerely, Yeoreum Yun