Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp355893imu; Thu, 8 Nov 2018 09:13:27 -0800 (PST) X-Google-Smtp-Source: AJdET5dhFfNLZV6nZpgHV6MvrjOKvj87V3n/r07eJxDDHeLyWdIoDbF5RXsQ4+X/0NBlIEe9BF9y X-Received: by 2002:a63:f547:: with SMTP id e7mr4542741pgk.182.1541697207646; Thu, 08 Nov 2018 09:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541697207; cv=none; d=google.com; s=arc-20160816; b=tK8vSq0kLI8XSf+5OGk7Uq/l+4+V59QDf+RluLBbI+vKQ11x7LBi3suNe+94wp7sBg pbJf4MFGNnrKYnFN7Bzcnc7itwMMTD+aeq0rBbad64XrLihn32/s2+yNCCmmSu06PAkB virTMhHiYFk2Jfj93Q+bPZt/ueWAVHMDQtXOqr5rHZr29R1pWr2Ln00onDS/XAdFubnk GOY9coZOjRlUiX1+poTBcvLO/0SNHzCrbQHMlKkIEysloeE+CTSNnOWkkWePCOIiQq6P CD3ph68Z4uxCDI6vR3zPuGYvY+HtvtccI+HHZk+SDcF5ify7Jai5BvjJhHj+JtWBx6/V X3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=z0vATZAVKWZJzs8dQw40UbQUkQVwB6LY+8/ipn/unQM=; b=E0/ig7Z8K0nbC0W2+3a3WoOHz0IBpyDdu2zv95kAJpXjBPDxbkMM01DHDEV/VffLZ5 bFDDXcDUuuNBcrxkLQ3ZChaPilXVqpRwVuCJEWBY0CKsS+FLBW4lkHDL3ty+2oUL5e18 ytP4/rzQ5qz1hMMn0CQtIKO0PPaI5WdjEixDDwh4dUeR4v0jDHQpcL3TEpjbyzrUMVvR g3/vjhGoZWuKRHVyRDL8SEC632rMAUKjYSCH6oTY2Fvd9KBKCkwj1mmO9xJYPcYBwB57 zWEroR6xQj8GSX3KZjI3zhLxF56SB7HK5JrrI66xdExr0LyPOU9MPj/UQWUGQCestEuM rZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A7dK8Npy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si4653125plo.134.2018.11.08.09.13.07; Thu, 08 Nov 2018 09:13:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A7dK8Npy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727158AbeKICrA (ORCPT + 99 others); Thu, 8 Nov 2018 21:47:00 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34340 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbeKICq6 (ORCPT ); Thu, 8 Nov 2018 21:46:58 -0500 Received: by mail-lj1-f194.google.com with SMTP id u6-v6so18698867ljd.1 for ; Thu, 08 Nov 2018 09:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z0vATZAVKWZJzs8dQw40UbQUkQVwB6LY+8/ipn/unQM=; b=A7dK8NpypGsvhlwb/g58OxKEI6PL2eL81NmdrhPdhLlJevdQ3+5NPTJsv8iVgDlmQH LT1FapHFI0O6/BUUmhKOeMX37nGZn+fAeeM2570IyrgneSO7V8stf0hu6/VXPOAyk7Da +Z48Xcz7HUXoEYlQowJdQ7Hs84rQFxwMKqWwQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z0vATZAVKWZJzs8dQw40UbQUkQVwB6LY+8/ipn/unQM=; b=OGhirnfUEnXz5ZHjtiyv17h1lywWzBOZtshCHApHQ1SefcB8FehdtwH1C3xl0w/7Lu BELUWibZ9S0njfXl7zzEudQ1dfwjvBpcY+Eqp9HbSiGApmeSBEPYsCJ+Hd2WdpSeSCgC Hc/fOw8Sg0O7rTKX9j/2NSHIkJiCCMmBGzZ0SYsnGumEVrKSHkwxFMfpuVxtaShJK2DM XfSXWDgHgzFkk6YuOCjhcCuzYApAGImapIrazy27fUkm2C3Zkf0btCd1WkLyGG6KjgkD 6h2z62AD975STr6Zo5AxK8pG0bgPNQtuf9uiAQquavJxb0hbg13PTddLO42Rwt0BOGfn AXnQ== X-Gm-Message-State: AGRZ1gLkSsbmfgsCa17Q8JkPxGskcIk3ZeuhI6NRxQKoZ7Pmb9qiH5Xa 4HhRacb2EkJsjfz/1jsMol5cE1wVFry0K1kUML+dXg== X-Received: by 2002:a2e:9c08:: with SMTP id s8-v6mr2930268lji.149.1541697030329; Thu, 08 Nov 2018 09:10:30 -0800 (PST) MIME-Version: 1.0 References: <1541456790-28282-1-git-send-email-mathieu.poirier@linaro.org> <1541456790-28282-4-git-send-email-mathieu.poirier@linaro.org> <20181107032350.GH3983@leoy-ThinkPad-X240s> <054f82c1-451f-3c82-d5ab-e156c50e0c10@arm.com> In-Reply-To: <054f82c1-451f-3c82-d5ab-e156c50e0c10@arm.com> From: Mathieu Poirier Date: Thu, 8 Nov 2018 10:10:19 -0700 Message-ID: Subject: Re: [PATCH 3/3] coresight: etm3x: Release CLAIM tag when operated from perf To: "Suzuki K. Poulose" Cc: Leo Yan , linux-arm-kernel , Alexander Shishkin , coresight@lists.linaro.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 8 Nov 2018 at 02:49, Suzuki K Poulose wrote: > > Leo, > > On 07/11/2018 03:23, leo.yan@linaro.org wrote: > > Hi Mathieu, > > > > On Mon, Nov 05, 2018 at 03:26:30PM -0700, Mathieu Poirier wrote: > >> This patch deals with the release of the CLAIM tag when the ETM is > >> operated from perf. Otherwise the tag is left asserted and subsequent > >> requests to use the device fail. > >> > >> Signed-off-by: Mathieu Poirier > >> --- > >> drivers/hwtracing/coresight/coresight-etm3x.c | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c > >> index fd5c4cca7db5..000796394662 100644 > >> --- a/drivers/hwtracing/coresight/coresight-etm3x.c > >> +++ b/drivers/hwtracing/coresight/coresight-etm3x.c > >> @@ -603,6 +603,8 @@ static void etm_disable_perf(struct coresight_device *csdev) > >> */ > >> etm_set_pwrdwn(drvdata); > >> > >> + coresight_disclaim_device_unlocked(drvdata->base); > >> + > > > > > > Just remind, this isn't consistent with the sequency in function > > etm_disable_hw(), which has the reversed sequence between > > etm_set_pwrdwn() and coresight_disclaim_device_unlocked(). > > > > Not sure which one sequence is more suitable, at the first glance, > > accessing register after pwrdwn related operation might have risk for > > deadlock? > > Good point. > > I assume that the CLAIMSET/CLR registers are in the same power domain as > the LAR (Software Lock Access register) accessed below. But I will > confirm this with the architect. Based on the response, we could > streamline both the sequences. In this case etm_set_pwrdwn() sets bit 0 of ETMCR, which disables the ETM. That being said the Embedded Trace Macrocell Architecture Specification (ID101211) mentions in section 3.5.1 that despite ETMCR bit 0 being set to 1, it is always possible to write to the claim set registers. As such I moved the release of the claim tag in function etm_disable_hw() below etm_set_pwrdwn() in the second revision of this set [1]. [1]. https://lkml.org/lkml/2018/11/8/223 > > Suzuki > > > > > Thanks, > > Leo Yan > > > >> CS_LOCK(drvdata->base); > >> } > >> > >> -- > >> 2.7.4 > >>