From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A086D606A68C for ; Fri, 4 Dec 2026 17:05:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=U/oQyqq3; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=BWGI9aKI DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=R2+pA7qimLjwoMl8Iw5fQlc7smSARtFufZwSkFJx8GE=; b=U/oQyqq3gNbMnMYNgO683td9Hz T0K2UU44fdHS40HkffN9LXasQ3tS0gZ52Hev98kuRErVrwdfkRGweAMdsAMjx1IT5CYFO4vjV1gJp N19p6lsGuE8DrCjRhbXge8lCu5XCGZR6CHGjoM38Ei+OLnL7A7WM7BmL8iTNTckrPmutYl9++XzpK m+YVzhz9CYeaZZbWavnYfyl32VECRRnGhK4lPOG6H+TzeeXAbBA+suPxUK2XuyUofQqWj9xZxrKqy Z7Sq79JS73ekNIXfY7G/A+MkzLL6+OjlHGQKSpwxlqgMgW17c1ypimvx286CXy7LUp0HW3U1ulH7l mvLBarCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZWiP-000000010fZ-0Qa9; Fri, 04 Dec 2026 17:04:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZWhf-000000010e2-3yI3 for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 17:04:33 +0000 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-Archived-By: 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_090423_509381_B9A05434 X-CRM114-Status: GOOD ( 11.48 ) X-Spam-Score: -4.4 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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