Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp467327pxb; Tue, 14 Sep 2021 01:26:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeBsuIeLhyHo3PT3c4Z/cx4Qjyb0qKK+b5ekBqZ8P03cOJhM6bBHHYj+xYxiNxOnyZacd1 X-Received: by 2002:a17:906:1e11:: with SMTP id g17mr13143727ejj.154.1631607972010; Tue, 14 Sep 2021 01:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631607972; cv=none; d=google.com; s=arc-20160816; b=rQlLnfwVsDdjdvw4CzB+egfJH0nWB+bGz492a4tXsOPguig1CVWSgE5bIeLXrYNkJg Eb3qbIMYuDwvY91FLR9Rw/zsTK56mN7AjdPZGmVFeJmAmbgDUFfx/x7b5D0lFtbHeib6 1PFerLJUrpde+VI2I5Duw9LOHi6zRNyOsPIgrBHjohN6pIkKh2IcPjpd698tWeWCwIv+ etIHoYeFjQFELPBpwmgEshx3lX+PQKr0OuGUhG5YCbAZ4n+nhnC3D9LIDcaG4JkLtUAC IuqtJhswjJSoP57Zc+aKwRQegiLnerOmJkkUv/twmosBqKZTrxM7XFKMz9QBYRsLh08K mZsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=Q/a9JV5BbfbDslrMvDcJU2So0SVlVhu039Jqcq0WeDs=; b=xBK2UAmQSocQ6vjdWh4jVXZJzTt4nmTuKmJJAXz85pZQY61yNZJ1OWDICuLUk6yM3H TiSxR4GaiKdoL/QE4m7lNhmP2TjHL4NsW3ruyjX2l7MRWF75z5x02z1z55J6rApROle8 /uI3b73dB/wuXplkZajkIvFryhwvWJpq+/VJLoZNlyoruUfmIIqHUSKlH1gCSHmnMBQr xVgZwMwS/flTV/+PjNn4gBnmMvEQ6ImHcqw7yM0hA4AL7KqY6ALYAzfD28TvjAvi5wh5 uKcj5wrijg80IZh0ort3jrwCIpMMKePxRV9lMmYCIPMFC8xyVR0dGXP9pMOWRtkPXLjg 0S/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si6321118edr.491.2021.09.14.01.25.48; Tue, 14 Sep 2021 01:26:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230071AbhINIZl (ORCPT + 99 others); Tue, 14 Sep 2021 04:25:41 -0400 Received: from foss.arm.com ([217.140.110.172]:40964 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbhINIZk (ORCPT ); Tue, 14 Sep 2021 04:25:40 -0400 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 0E0A61FB; Tue, 14 Sep 2021 01:24:23 -0700 (PDT) Received: from [10.57.94.84] (unknown [10.57.94.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 617863F719; Tue, 14 Sep 2021 01:24:19 -0700 (PDT) Subject: Re: [PATCH v5 3/9] coresight: tmc-etf: Add comment for store ordering To: Leo Yan , Arnaldo Carvalho de Melo , Peter Zijlstra , Adrian Hunter , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Mathieu Poirier , Mike Leach , Michael Petlan , "Frank Ch. Eigler" , Song Liu , x86@kernel.org, =?UTF-8?Q?Daniel_D=c3=adaz?= , Andrii Nakryiko , Alexei Starovoitov , Sedat Dilek , Andi Kleen , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org References: <20210809111407.596077-1-leo.yan@linaro.org> <20210809111407.596077-4-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: <60c20d8e-4386-5c54-4607-d9399713d2ef@arm.com> Date: Tue, 14 Sep 2021 09:24:18 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210809111407.596077-4-leo.yan@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/08/2021 12:14, Leo Yan wrote: > Since the function CS_LOCK() has contained memory barrier mb(), it > ensures the visibility of the AUX trace data before updating the > aux_head, thus it's needless to add any explicit barrier anymore. > > Add comment to make clear for the barrier usage for ETF. > > Signed-off-by: Leo Yan > --- > drivers/hwtracing/coresight/coresight-tmc-etf.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c > index cd0fb7bfba68..8debd4f40f06 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c > @@ -553,6 +553,11 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev, > if (buf->snapshot) > handle->head += to_read; > > + /* > + * CS_LOCK() contains mb() so it can ensure visibility of the AUX trace > + * data before the aux_head is updated via perf_aux_output_end(), which > + * is expected by the perf ring buffer. > + */ > CS_LOCK(drvdata->base); > out: > spin_unlock_irqrestore(&drvdata->spinlock, flags); > I will queue this. Thanks Suzuki