From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796403853; b=YUvN3cFApzqXmDasR4AIeaKikvruvyc7AWyF0eijEGHQ9OhIWbkrZxaPjwRaAusqd+MX u8iEBIag2q3v55OuXDkrS3Ba06GyYWLH7NeDbxtKoRcT92gc6fEfWsnbej/LJnN03z8Il EfbBiSi/0UAD4CBo3M8MFMGj6z78/mtUJPH+EPzcF4Y3yjEmjcFtfU/Ula7q4OEAKIZS3 4N914hnP4n+BEsFRqM/8BiscTxRhtKtEhejq7ITrhgwtiipiLPm/mgeSWFjLt0k3Q5OfA fqGlzZa3OoBqwW2Xyro3I4kshAJhNeN8ByIo2NA9Gv26lehsqNVJXryhlu7PpF25hOQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796403853; h=DMARC-Filter:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=R2+pA7qimLjwoMl8Iw5fQlc7smSARtFufZwSkFJx8GE=; b=MSJCHXgWmq25qt6iVq2kaNWq6DflHivXghGq8Ahbnit371hOxCng2Oz2onTH6NIhS/Ls c2woJpU5uTR8uzRwbulxKO/0bt7dqAUbQjwFMHOtfIaStzddvGUos/cSYEhAWwH6XdOyB b/6gnolOKjkY8oXHFgNOyAkDJhois2Vzz9Zvc28y12z5gw8d+J6RwGWJhhGP2rftWrjdG Tn8nSQwCS+A0y7x7fiebcJcmE5UIsP+BxcJvViSuaZMqw4+JySz14kPdA06UbuoM6R9q9 zj5R2Vv3Qg2ahZyU9vGJQAWTBHayIVThhwKnPSAroPAj2bRECTDoOYV9/S8DrrBQicA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=BWGI9aKI; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 192A7606A322; Fri, 4 Dec 2026 17:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 192A7606A322 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.a=rsa-sha256 header.s=foss header.b=BWGI9aKI 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 32A5F14BF; Fri, 4 Dec 2026 09:04:08 -0800 (PST) Received: from localhost (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 911DE3F86F; Fri, 4 Dec 2026 09:04:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796403851; bh=CtXSsvgs1n0QHq7oUjxT6jybDm8nkasCM4qKl6fB/9s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BWGI9aKIFN8inIFcSB7xLIOQpUXVesowFn491PQCT8wu4v+1KSEjh1wSsFA1He0PO uaCuLZ3o9yvXYzTZ3t6IcCxWZTIUv6qdcu/kvskPTeX+VFG/+yoa6REaPnh4mKl0Ut fAIaFPJ6Ipgq/eEN4B0KoxKRIw7sd2n4aUh6CZik= Date: Fri, 4 Dec 2026 17:04:08 +0000 From: Leo Yan To: iav@iav.lv Cc: Suzuki K Poulose , Mike Leach , James Clark , Andrew Morton , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Corbet , Shuah Khan , Randy Dunlap , Douglas Anderson , Petr Mladek , Feng Tang Subject: Re: [PATCH RFC 03/10] coresight: cpu-debug: Publish the per-CPU data under debug_lock Message-ID: <20261204170408.GF3159023@e132581.arm.com> References: <20261127-b4-coresight-cpu-debug-lockup-v1-0-69d3ad1e0fc8@iav.lv> <20261127-b4-coresight-cpu-debug-lockup-v1-3-69d3ad1e0fc8@iav.lv> X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261127-b4-coresight-cpu-debug-lockup-v1-3-69d3ad1e0fc8@iav.lv> On Fri, Nov 27, 2026 at 08:38:40AM +0200, Igor Velkov via B4 Relay wrote: [...] > Store the pointer once the device is known to be usable, and change it > only under debug_lock, which the knob holds while it takes or drops the > runtime PM references of the published devices. The problem is the duplicate check per_cpu(debug_drvdata, cpu) still runs outside debug_lock in __debug_probe(). Maybe it is good to go a bit further: - Call debug_func_init() from debug_init() and debug_func_exit() from debug_exit(). The debugfs knob and notifier would then exist for the lifetime of the driver. That would let us drop debug_count and avoid racing debugfs setup in probe against teardown in remove. - In __debug_probe(), after the SMP call succeeds and the hardware checks pass, take debug_lock, check if the CPU slot is duplicated, and publish drvdata before unlocking. Thanks, Leo