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 5DEA530E0CC for ; Tue, 7 Jul 2026 08:25:13 +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=1783412715; cv=none; b=McKzuDt9WCmks3H4968E1b9LBEVcdyA2Jimfe8PFWmTyKhOvO1WZgl/c6Qzg3EUnd0gPXwGAXZWKLR8/V6Qw3PvI4dA5o9jdKjciBiu52lBw8vw29GUhkygOtIPmeXOGKBFfg9cB043H2l4G4j+OyvFd/xaMLMulKHAY9gMpVD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783412715; c=relaxed/simple; bh=jTlDX4SJ8ICjOTtRkPF6dVggVhq5GVFKrlcBmkhYrSg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KcAR+JNw1m32VBmSWpPr/9q4+c8oPBC49C8nOPb8plRfJ6tNYH8pWb3ws6GbiH9wRhPolx7QJfZ+Ffah2TbgMmoE8F6fKhwvWIUXnKQCSEfyXOiQ+lg/3OHxP+XqYvmAGHij6nXZUaljOJGbFU57C+kLYkx/hufjwqwxReUyLqs= 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=qRhJHQeJ; 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="qRhJHQeJ" 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 572771BCA; Tue, 7 Jul 2026 01:25:08 -0700 (PDT) Received: from localhost (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2CAEB3F85F; Tue, 7 Jul 2026 01:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1783412712; bh=jTlDX4SJ8ICjOTtRkPF6dVggVhq5GVFKrlcBmkhYrSg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qRhJHQeJFTMPutQU9UP102WwIdjd8bs6xrqbqyS51byqrh8GhrN0VUPIh5/l49eSz YtMR2EKg1Sz4YjRrXf0Th4/p7GI35GfHVx//uL4l42681FCqNceeoto7EsGpTIvOZZ JydQf8KR3jouazYOzmI1DC/UPKJiMZEyhVflnjds= Date: Tue, 7 Jul 2026 09:25:10 +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 v8 08/13] coresight: etm4x: fix inconsistencies with sysfs configuration Message-ID: <20260707082510.GD1024232@e132581.arm.com> References: <20260629090007.1718746-1-yeoreum.yun@arm.com> <20260629090007.1718746-9-yeoreum.yun@arm.com> <20260706172159.GA1024232@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: On Mon, Jul 06, 2026 at 07:16:42PM +0100, Yeoreum Yun wrote: [...] > > I try best to not paste any non-sense AI reviews, record one from > > Sashiko [1]: > > > > | If a user writes to a sysfs attribute like pe_sel_store(), it acquires > > | drvdata->spinlock without disabling interrupts. If an IPI is then handled > > | on the same CPU, etm4_enable_sysfs_smp_call() will call > > | cscfg_csdev_enable_active_config() which attempts to acquire the exact > > | same spinlock, hanging the CPU." > > > > The flow for acquiring drvdata->spinlock in SMP call is: > > > > etm4_enable_sysfs_smp_call() > > `> cscfg_csdev_enable_active_config() > > `> cscfg_csdev_enable_config() > > `> cscfg_prog_config() > > `> cscfg_set_on_enable() > > `> raw_spin_lock_irqsave(feat_csdev->drv_spinlock, flags); > > > > We might expect the complaint from LOCKDEP with this patch. > > Hmm. I miss the this point and there is two solution: > > 1. Remove "feat_csdev->drv_spinlock" > > Before this patch, the "feat_csdev->drv_spinlock" is for > synchronizing with the "drvdata->config". However, > After this patch, the the configfs only show the "active" config > and the active config can be used only after taking the "mode". > > Furthermore, the sysfs only uses the "config" not "active config", > there is no race between the sysfs and the configfs. > > When I check the, "feat_csdev->drv_spinlock" is for the > active/deactive the configfs config, so I seems safe to remove. My interpretation is: After this series, we updates active_config on local CPU within atomic context, it is nature to be protected. So we don't need to use feat_csdev->drv_spinlock when updating active_config. If so, it is fine for me to remove feat_csdev->drv_spinlock. > 2. sysfs with _irqsave? > > However, this make a latency for the sysfs. > > I think the (1) seems good. > > Any comments? @Suzuki and @Leo? Yeah, it is good to wait a bit for Suzuki if any ideas. Thanks, Leo