From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0643F4F30D1 for ; Mon, 19 Oct 2026 13:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792414950; cv=none; b=jQPaeXh8sUdQ0uWz5QwksBiJaP1f9ELW8fJaqkq4cT/mymNY/d6jifgPUuDqYDhWhYxO9Mh8Pc5/5bPm9cKAt7kDpFq3T5UtwuGq4RbUlebCeEM+EmZB0HyrQBocRhYWZKH5CShr+32tKu4he7lFmft5W5yBSF9prPO+V8LrNBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792414950; c=relaxed/simple; bh=ITGubtGNjSygiFFFgjcYQsMniq1IJVNmaGpLd6Hctno=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CJyFALz2861RBNST/bwoR8sqXs+jOptYPcmBGkHgsAH9KlCHAtMG+dhmuh0PVc93jAofH7SAwH37fa9i/aQI5Oq5FG08Hzy0A5QWV1iU3IGaQIjRGC0sb8M+XNxzZbNOW/mbckIF3mVytLP9Dca2O/MlICQjXZvm1otKIizsXt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Eu2K9O4V; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Eu2K9O4V" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-c4322d310e7so158247666b.0 for ; Mon, 19 Oct 2026 06:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1792414947; x=1793019747; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=O9/kdLN3peEHedgTST7BmoC/amAyj0eADKM6T0Uw2sA=; b=Eu2K9O4VznZMFk1AXlGIlIYy4+kG7PLuf1qCQsfBF6nFMwvfyxX6J63U09xH4YfG7a +xsrPTNgH2rDwGjiJBqYHUIqFsitoidIa03Bw67u8asMl03yueH9uRCqQ9zzkpJZEPyD AkyuXgAUSzlvTT2Au3mi9AUmjUw37Qc7xKn6qbHPNA+HopblxbYruKhBiWFWfbnew/FN EFAJ5idL0+iK+KDXdmLiS1cYsZSztvY1rc9q9KtTD8LhFT+dDXGu30nwUChuXz5q2Dqs xY4Jo2vNyjVpCAlg9bK14Z8jKLxR9F5bktKR9BMqHoPlOHXJEu39+5cGbuCzwYot94av liEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792414947; x=1793019747; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=O9/kdLN3peEHedgTST7BmoC/amAyj0eADKM6T0Uw2sA=; b=iHc/r/KoHPvNQz5oQspyTCsNI8bITgmjLdmPPbco5SiCJXg8/JVul1HqJfprU8HVf9 8ADch8s7ctQAUfs/EwGeAVT29wiiphtFah3K19jBOmoOYlHPd+rd45aaZv9+/7TkKeRD n0u3TUEsN00JBq8adRoTlqV9B0zWW8Y0CgleRH+PqvI0hRt4fH/qPth8EYZqpqWiBPUF 1evtaDtSJgrH4RWKeLN186E1AskLFl0gqtbO09M/1r8v+ctVz8o8I+ThYnMt45Nb48Du ahut964ypeqbr7L3g/mZXzlA1+JzVCT+g3lu+zCNyX6QTfC4MHsQF5epgEfybn4g0g0a BJCA== X-Forwarded-Encrypted: i=1; AKwUvByBjBvF4IybhvQhL6xbmKpTlY11YkbqhV622yrXA0KvDryf3Lemlq7SI5MEVlH9rOsnYYNU05Vn9EE2eIU=@vger.kernel.org X-Gm-Message-State: AFq9FYIs4yB7ne+4N3kUpJdg8nU+pCmEfClvjB7oEuXMfKhcRP8J/xTV EeaJd24vlurbyfSLBfjSUFXhLQh3PSD9JWuWTvQS2Ad4ng6eufhGbSA7FxHb//frxJU= X-Gm-Gg: AYBFou25Elw48jLvJ/PzLbwixgU2lviXP6DtLHk2JCwNpPdYcvpIEV3JYPx+cPvI5Th 73EDvUlbI7UHY0DtZ9bV9SiNp3B5b+tIQq5dEF8rG2xybhEKyTHjMngKL1ZzjDKJWCx8V7aAKER 5f5fCsDEpKnLg49ap6crUUjgFlppUlR0rNj7uCfoTuJLEvWgxdVdgI3HgytWB5S+u/1kq3Cuj4j s3QnA4HvTzLuI8p+DtyBwu0Sq7M2/XA3nAZIlqU6blcjTJNcC7Oo9c1loQODTuP2F+sNexd45OC kRMQzwu8c8zrK3oO24qB/+wLGtZErxvT1IjpcU2uM7sYga8yJ1gFdOUV4HcKkBWXsbZ25ZdV8Kq j515PIw4ptAu2LNXKD4+8K9M7x2P328sxBByRGNLwUAHi7bT8WxP2uZG2L9ZvcnfylLH0zcJ/Rk +3onNtRkHFnUcHClVC03CbIU3H0bGYcFc8WfCz/uCMA4ULulu+2sCnzgy62Cmw+TtOeUADuJ6am o8= X-Received: by 2002:a17:907:b046:20b0:c42:102f:15db with SMTP id a640c23a62f3a-c42102f3704mr293529366b.34.1792414946853; Mon, 19 Oct 2026 06:02:26 -0700 (PDT) Received: from [192.168.1.3] ([37.18.141.193]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48dfd510201sm24019139f8f.55.2026.10.19.06.02.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Oct 2026 06:02:25 -0700 (PDT) Message-ID: <5a438ddf-4e6e-4c7e-b6e5-0434f9d9dbe8@linaro.org> Date: Mon, 19 Oct 2026 14:02:23 +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 15/25] coresight: perf: Serialize AUX pause and resume with event stops To: Leo Yan Cc: Ingo Molnar , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , Suzuki K Poulose , Mike Leach , Anshuman Khandual , Yeoreum Yun , Jonathan Corbet , Suyash Mahar , Amir Ayupov References: <20260915-arm_cs_support_aux_sample-v1-0-35cf6f297d20@arm.com> <20260915-arm_cs_support_aux_sample-v1-15-35cf6f297d20@arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20260915-arm_cs_support_aux_sample-v1-15-35cf6f297d20@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 15/09/2026 16:49, Leo Yan wrote: > A PMU NMI can throttle a group during an AUX pause or resume, stopping > its CoreSight event before the callback finishes. The callback can then > restart tracing or reopen an AUX output handle after teardown. > > Use per-CPU atomic STOP and AUX bits to serialize these callbacks. Reject > AUX operations while a stop is pending and defer stops until an active > AUX operation finishes. Complete deferred stops through etm_event_stop() > and set PERF_HES_STOPPED only after disabling the source and path. > > Assisted-by: Codex:gpt-6 > Signed-off-by: Leo Yan > --- > drivers/hwtracing/coresight/coresight-etm-perf.c | 104 ++++++++++++++++++----- > 1 file changed, 84 insertions(+), 20 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c > index 8f803914e9abfb18e080ff68371ad8b32042f180..8020a4d8af18bb669441824cfdb687f4fa299eb4 100644 > --- a/drivers/hwtracing/coresight/coresight-etm-perf.c > +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c > @@ -4,6 +4,7 @@ > * Author: Mathieu Poirier > */ > > +#include > #include > #include > #include > @@ -26,6 +27,9 @@ > #include "coresight-syscfg.h" > #include "coresight-trace-id.h" > > +#define ETM_PERF_ACT_STOP BIT(0) > +#define ETM_PERF_ACT_AUX BIT(1) No comments other than naming. But would PAUSE_RESUME be better than AUX, or at least add a comment? It's a bit ambiguous what AUX means, and etm_event_aux_begin() is very close to perf_aux_output_begin(). Or maybe ACTION? Reviewed-by: James Clark