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 E63E741F342 for ; Thu, 16 Jul 2026 12:42:30 +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=1784205753; cv=none; b=phNyEtUFewkmGigL+NsEG3nd70Y0VX9GTql8nVQuke0eM9sJutx5iQNoPxDgxR+11Vk4hMcnvks/WwocoP4EKJCQD/ZQIlNKrf3FZgIk8PibQfLdeyJujBVRFYlaqa41fH7nVYxf1/Y8SYGqro22btRoX5e0IUf6JBqfb8muHPE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784205753; c=relaxed/simple; bh=Bu3u6wPSdJa2kf7X/oaorEhXjHXCtj79kYQ35nA1rTs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kg7ixTbhsUhtwMUnWzuw39tdMj0BFOau4nU1MENlGoXhCj7abAfUjmsGlhJYV7U8+FAAYYY88gCqiwHHgn4dMu347nnkCPSba50+xLAfuVqruQpqgxcdrCUkqpLox2bcK6mMZedDpfYvW2jB+ZqVSpDRCZvKNalAVOzzsPq+Yxk= 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=Y7JV1byS; 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="Y7JV1byS" 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 EF3F11476; Thu, 16 Jul 2026 05:42:25 -0700 (PDT) Received: from [10.2.197.99] (ewhatever.cambridge.arm.com [10.2.197.99]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB1D33F7B4; Thu, 16 Jul 2026 05:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1784205750; bh=Bu3u6wPSdJa2kf7X/oaorEhXjHXCtj79kYQ35nA1rTs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Y7JV1bySJv8kadfk00E+z5GQ/401Y+MIhxN7sxJjscQd4rCtCSNvrNN4ZAuK8iUUI RFmjRwBEtiJbXkoWnWDxr2Hcr/U767395SwiY0pU2h3i208J3xW7u/8Nwq6FrFj2HH MKEAwrxR3Q8tmKXM4vCsRX765WJYiP5f9AGyDF0E= Message-ID: Date: Thu, 16 Jul 2026 13:42:26 +0100 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 v8 08/13] coresight: etm4x: fix inconsistencies with sysfs configuration To: Yeoreum Yun , Leo Yan Cc: 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 References: <20260629090007.1718746-1-yeoreum.yun@arm.com> <20260629090007.1718746-9-yeoreum.yun@arm.com> <20260706172159.GA1024232@e132581.arm.com> <20260707082510.GD1024232@e132581.arm.com> Content-Language: en-US From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07/07/2026 10:54, Yeoreum Yun wrote: > On Tue, Jul 07, 2026 at 09:59:36AM +0100, Yeoreum Yun wrote: >> On Tue, Jul 07, 2026 at 09:25:10AM +0100, Leo Yan wrote: >>> 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. >> >> Yes. but if I add a little bit more comment. the "active_config" >> is accessed after "mode changed (perf of sysfs)" it accesses atomically >> and the "active_config" is refered from the configfs not "config" >> after this patch. So we can remove the "feat_csdev->drv_spinlock". Ack Suzuki