From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42461C07E99 for ; Mon, 12 Jul 2021 10:56:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06AA960551 for ; Mon, 12 Jul 2021 10:56:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06AA960551 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b2Kit5W1UCoU4CCEMm0TdaaB22UJlc73/QjeQNjT6t0=; b=OGS0RfDYbQPtxj PtBvao3AO/1Eoh88e2soSi+D2YFQS/DQRX5+OauXNIH2ekUSAVIZMDLd5VVChRKGS4gqNHWFr0JAb Ehh29Izn0ZSOli3j45cE8wBN5xastrsDbhM8b8XmpKGAnmTlqWC2Mm9qX0jlgLhDiBslHBiarNPKH Hv5rr2ctl8x6PDZNVp7qnNfzTuoa4XV5iTm5KfZU/u3/S5a9PcX4MWSCtU4uK8LOBmvbf472Q2eGF KPoBdG0ESZj/tENPprjmB3O8O/ewrSOodkO3VXhvbJ7+3Cg+SidgeoJW3wntuhkk5OpmnY8/IB66D NyJkcBMyGcIAdOgoX6oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2taI-0074L6-9w; Mon, 12 Jul 2021 10:54:46 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2taE-0074Jn-1U for linux-arm-kernel@lists.infradead.org; Mon, 12 Jul 2021 10:54:43 +0000 Received: by mail-pg1-x52b.google.com with SMTP id w15so17790820pgk.13 for ; Mon, 12 Jul 2021 03:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JA4gd/MMGfc1bOk2g+m+nyNDBErsTegW/6UjqqXM42A=; b=c0Kl1T0GIdx/YSFtCjVP0ifXWWNh6tWYOQmER2lnFRi+M5/BTGGUVeFI5SfSnC4EWR GslbvfVJP2ce4WA7Piflj2DDrpom0floUP6s6GdYABbKPWkTMUbfW/vctT/PheHaxlqj Y2HcFWqTh7ubkSm7m3VZ25uHBG9qmopsMKIO/1N1M2murbE9LEYgAukMYdeIawDeBl2s ECDUO038erxpjwNCfEu7k2k/TGnpgegN58upQSEpKg5HDl938IX0x3CMRT7chiWRVFQo KZYFmqSF7OxUVfminCutnphxr8nqClfP0CW+31WHqXvHMAi+Etb6mcwYwdm1sIkXai0/ l+3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JA4gd/MMGfc1bOk2g+m+nyNDBErsTegW/6UjqqXM42A=; b=fcLeAbbNCFQepDwkRZvPuVgkjOY4m9opzfBV0Qkeup0h+d9Pr33AtlP11Nz7GU/p/V ZLKUQOYDD2md40gKjnzXEDNH/a1ELYXOBghSgN2afKKdUSEqZg8gayBKB1xcBEcUezfr Hlb+q+E+wfidjxOeM+Mel6L3vtV5f2K+fdkpbOBjHrH//8y2d3c9GfG1zw3Spcm+kqhl huHbUV1/Q9SWtRbh2jBgcmet9bZg2Et3J+0sUoK1gwew4dGbbiCGpPXf5nsdBJ6FdMuo Nav4vhigJFvHkyJcPpkGHFBefIvlBsDUtLM0Wgs1kUeFPhv4035uMo6hfOgqmYPvo3LC 1PrA== X-Gm-Message-State: AOAM530z9oyRFYk4aHwewAcyiwzbgz7WBkvty+e9Rsa58lZ/R64VcpBN vWb1UGfUUTeYYW/mmsRKL40Kfw== X-Google-Smtp-Source: ABdhPJzwlG37y5qH/zJqKUdv7VgIG/DkqI/nK6PluMVwdOragJNswNAZJdb3l/flnshAu013xAMcJA== X-Received: by 2002:a63:43c4:: with SMTP id q187mr52510934pga.172.1626087279943; Mon, 12 Jul 2021 03:54:39 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([202.155.204.36]) by smtp.gmail.com with ESMTPSA id w16sm13265914pgi.41.2021.07.12.03.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 03:54:39 -0700 (PDT) Date: Mon, 12 Jul 2021 18:54:31 +0800 From: Leo Yan To: Suzuki K Poulose Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Mathieu Poirier , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 02/11] coresight: tmc-etr: Add barrier after updating AUX ring buffer Message-ID: <20210712105431.GA704210@leoy-ThinkPad-X240s> References: <20210711104105.505728-1-leo.yan@linaro.org> <20210711104105.505728-3-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210712_035442_138569_3C0D06F8 X-CRM114-Status: GOOD ( 23.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Suzuki, On Mon, Jul 12, 2021 at 11:40:12AM +0100, Suzuki Kuruppassery Poulose wrote: > On 11/07/2021 11:40, Leo Yan wrote: > > Since a memory barrier is required between AUX trace data store and > > aux_head store, and the AUX trace data is filled with memcpy(), it's > > sufficient to use smp_wmb() so can ensure the trace data is visible > > prior to updating aux_head. > > > > Signed-off-by: Leo Yan > > --- > > drivers/hwtracing/coresight/coresight-tmc-etr.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c > > index acdb59e0e661..713205db15a1 100644 > > --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c > > +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c > > @@ -1563,6 +1563,14 @@ tmc_update_etr_buffer(struct coresight_device *csdev, > > */ > > if (etr_perf->snapshot) > > handle->head += size; > > + > > + /* > > + * It requires the ordering between the AUX trace data and aux_head > > + * store, below smp_wmb() ensures the AUX trace data is visible prior > > + * to updating aux_head. > > + */ > > Please could we reword this a bit, something like : > > /* > * Ensure that the AUX trace data is visible before the aux_head > * is updated via perf_aux_output_end(), as expected by the > * perf ring buffer. > */ Will refine with this in next spin. Thanks for review! > > + smp_wmb(); > > + > > Reviewed-by: Suzuki K Poulose _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel