From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751221AbbJBEsE (ORCPT ); Fri, 2 Oct 2015 00:48:04 -0400 Received: from mga09.intel.com ([134.134.136.24]:11951 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbbJBEsB (ORCPT ); Fri, 2 Oct 2015 00:48:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,621,1437462000"; d="scan'208";a="817707544" From: Alexander Shishkin To: Mathieu Poirier Cc: Greg KH , a.p.zijlstra@chello.nl, Arnaldo Carvalho de Melo , Ingo Molnar , Jon Corbet , Adrian Hunter , Chunyan Zhang , Mike Leach , Tor Jeremiassen , Al Grant , =?utf-8?Q?Pawe?= =?utf-8?Q?=C5=82?= Moll , "linux-arm-kernel\@lists.infradead.org" , linux-doc@vger.kernel.org, "linux-kernel\@vger.kernel.org" Subject: Re: [RFC PATCH 06/20] coresight: etm3x: unlocking tracer in default arch init In-Reply-To: References: <1442593594-10665-1-git-send-email-mathieu.poirier@linaro.org> <1442593594-10665-7-git-send-email-mathieu.poirier@linaro.org> <87eghgjg4v.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 02 Oct 2015 07:47:56 +0300 Message-ID: <87vbap3mgz.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Poirier writes: > On 30 September 2015 at 05:33, Alexander Shishkin > wrote: >> Mathieu Poirier writes: >> >>> Calling function 'smp_call_function_single()' to unlock the >>> tracer and calling it right after to perform the default >>> initialisation doesn't make sense. >>> >>> Moving 'etm_os_unlock()' just before making the default >>> initialisation results in the same outcome while saving >>> one call to 'smp_call_function_single()'. >>> >>> Signed-off-by: Mathieu Poirier >>> --- >>> drivers/hwtracing/coresight/coresight-etm3x.c | 8 +++++--- >>> 1 file changed, 5 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c >>> index c6880c1ade55..a4c158df0fef 100644 >>> --- a/drivers/hwtracing/coresight/coresight-etm3x.c >>> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c >>> @@ -1867,6 +1867,11 @@ static void etm_init_arch_data(void *info) >>> * certain registers might be ignored. >>> */ >>> etm_clr_pwrdwn(drvdata); >>> + >>> + /* Make sure all registers are accessible */ >>> + etm_os_unlock(drvdata); >> >> In case of co-processor register access, this will end up unlocking the >> local ETM instead of the one on target cpu, by the looks of it. > > "etm_init_arch_data()" is also called from "smp_function_calls()" and > as such, will end up executing the correct CPU. Yes, but it doesn't unlock the OSLAR register, which also needs to be done on target cpu. Regards, -- Alex