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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 90FB5C2D0A3 for ; Mon, 9 Nov 2020 18:33:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 09C8620663 for ; Mon, 9 Nov 2020 18:33:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rARShB0V"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AW98BPBr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09C8620663 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=QO4uzudL1GVBG3Xi76TYfRF//GT/RLDTqWoCN4gIoXY=; b=rARShB0VAbnecI8RL8/2Agywo wQXE2d7on05BvtygnGCVNC00KtD4aY5W5jtjktnhtXKtcd2pXr2VlyHfuBP5UOjtyS4kg8oYQCnbV hUeK9u+FPOOTi3Mq7u9VxXq7BuATlENmsjIgjj3sccN7MXEnfxRrrWM4rxQGZgYql9vau1Kvugew5 EJrVtXbvEVB/loQSCGXSzfPQ8hDh1plYaTA252heFgNH9ihirkliAn8OzPuZutCXToOvpv4X2UVLE bGClDgb10DhdblqZWWqaBRIlspS/dMuag6KwFJDWN9SUwk78XEAN1X4hexCvsMoorjBi3Vkxknj+d ezQfTOsNw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcByZ-00064g-QP; Mon, 09 Nov 2020 18:33:11 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcByO-00061e-Sv for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2020 18:33:03 +0000 Received: by mail-pf1-x443.google.com with SMTP id y7so8939706pfq.11 for ; Mon, 09 Nov 2020 10:33:00 -0800 (PST) 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=Aos7KVRDO/C6OJn4w3QYdJlpwzC57/3vij3hTuiACNM=; b=AW98BPBrorl9HFqhKBhVARXdI8EFQoRYhbe0rU+Lm9pQsv5uwDCVSIfrfrjsM4Z6oF S/vU6AkGcIg5QI4cmlL2RC0mLvddOT6rADflifsmyHCY+sFY633QoJmmyPRHujQufSzJ wshivmsYT8zqI6dgIS68k6BlODeuC+jg2CB7kNm6lPnmysTsYdDwbJBp27Nac2x26T+M HCfBb2Ax2wqm9Xu2FVVUzuq4OleL0kmA2AvjSANuAAjBGpjFsTkjNlSC8/mID8i7y07z 3+DljRumA1KgYf/j0UNwhBkALghRMSlsgArbBjWnjDs6J8MYCcGo1tjXfvJhhS6aqAOY 7DAg== 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=Aos7KVRDO/C6OJn4w3QYdJlpwzC57/3vij3hTuiACNM=; b=UgnJt6RO6BMh2j19bqfl/puA9K3cHIXsowu448m9tSo1jLg3WmFEkxr97iD2hkxooL c1ufbGHupJ9CgZxtZlFOZ/hAYtDxnZFdkxcNBHRs1pv1e3aI8EFsNnxqKtkQ304Pgeid xbUFqGVG35y5/ewuNyLURuGxlUwFfVPRRFLL27NTJCdphonnCoqXEOfGHSgCl62WTFgv rjuamSccmM8eZE9Gvj7eaoQShiE447PSBCPHY1D6aoDygHz6lEma14xw0PbrcftIdpvF i1QgfCj7mxr8SbkQlslv4TBjlli3uS0PFQ4eKEPetPBSkazqLFRO8cDEXSWy1CWTzwKK 6RVw== X-Gm-Message-State: AOAM532clQ93AKDiBeRWPQa2l2hKdqOURkxNew7ortECWzLuGaaLAtlP q8fyqb6ztk92YhDRHwc+JvdHNA== X-Google-Smtp-Source: ABdhPJwuFMrqeEvKhu/AMfyAokOfgrSpiKzySM4kXBNZ6OuVgRdHLd9H/qpEwZp1z1tUXKx4xeqOlw== X-Received: by 2002:a62:75c6:0:b029:18a:d510:ff60 with SMTP id q189-20020a6275c60000b029018ad510ff60mr14844959pfc.35.1604946778471; Mon, 09 Nov 2020 10:32:58 -0800 (PST) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id j184sm12308821pfg.207.2020.11.09.10.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 10:32:57 -0800 (PST) Date: Mon, 9 Nov 2020 11:32:55 -0700 From: Mathieu Poirier To: Suzuki K Poulose Subject: Re: [PATCH v3 22/26] coresight: etm4x: Add necessary synchronization for sysreg access Message-ID: <20201109183255.GA3396611@xps15> References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-24-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201028220945.3826358-24-suzuki.poulose@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_133301_110379_DCF3A657 X-CRM114-Status: GOOD ( 24.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org 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 On Wed, Oct 28, 2020 at 10:09:41PM +0000, Suzuki K Poulose wrote: > As per the specification any update to the TRCPRGCTLR must be synchronized > by a context synchronization event (in our case an explicist ISB) before > the TRCSTATR is checked. > > Cc: Mike Leach > Cc: Mathieu Poirier > Signed-off-by: Suzuki K Poulose > --- > drivers/hwtracing/coresight/coresight-etm4x-core.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index e36bc1c722c7..4bc2f15b6332 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -178,6 +178,15 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) > /* Disable the trace unit before programming trace registers */ > etm4x_relaxed_write32(csa, 0, TRCPRGCTLR); > > + /* > + * If we use system instructions, we need to synchronize the > + * write to the TRCPRGCTLR, before accessing the TRCSTATR. > + * See ARM IHI0064F, section > + * "4.3.7 Synchronization of register updates" > + */ > + if (!csa->io_mem) > + isb(); > + When I first read the documentation on system instruction section 4.3.7 really got me thinking... At the very top, right after the title "Synchronization of register updates" one can read "Software running on the PE...". Later in the text, when specifying the synchronisation rules, the term "trace analyzer" is used. _Typically_ a trace analyzer is an external box. Arm documentation is precise and usually doesn't overlook that kind of detail. The question is to understand if a context synchronisation event is also needed when programming is done on the PE. If so I think the documentation should be amended. In that case: Reviewed-by: Mathieu Poirier > /* wait for TRCSTATR.IDLE to go up */ > if (coresight_timeout(csa, TRCSTATR, TRCSTATR_IDLE_BIT, 1)) > dev_err(etm_dev, > @@ -256,6 +265,10 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) > /* Enable the trace unit */ > etm4x_relaxed_write32(csa, 1, TRCPRGCTLR); > > + /* Synchronize the register updates for sysreg access */ > + if (!csa->io_mem) > + isb(); > + > /* wait for TRCSTATR.IDLE to go back down to '0' */ > if (coresight_timeout(csa, TRCSTATR, TRCSTATR_IDLE_BIT, 0)) > dev_err(etm_dev, > -- > 2.24.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel