Received: by 10.192.165.148 with SMTP id m20csp4709932imm; Tue, 1 May 2018 02:14:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoScrMQTOpQYBpEW+VvT0tUn42Hk2tEdx0BrJn0ybUhiIDrKwk/NN+Dy1qPz+9HtxwmgLik X-Received: by 2002:a63:a002:: with SMTP id r2-v6mr90155pge.240.1525166054724; Tue, 01 May 2018 02:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525166054; cv=none; d=google.com; s=arc-20160816; b=gAkyGJIaItXUmIpisU7CE6Ka6yxCnCDDDTOIS9n9cB7Og+FUAugLQT7r5SZlYNVyky plCerSYxXNxsxizwyp8LfOZYNSxYUqAVXBGoLPbzWuLtF4aLy7ylBxTvXrhSuy/R3KN8 fH8v46R6Py7v64bee986xAVnzgrC5KXDe747KS1Av84RVJd/h4Zbq+0DIngGN/AUr3cU rViC2CAoovBhrF8T7P3/rUCR8mSt88lLXU3elDbcd3o8w1IJMzOTc16JfvtxQTu1eKwc RkpM76k+R1UsZjn4talslQ2nCbLn58D900145d0QJEqI5DyzjdqZSoihUaEXQLcP+iQX NFkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=932w/PhhOf1zI/siymMUGxPnw8kvn7aDp00Fy057gMQ=; b=pNsOzqBCcQPhcpASX50HOGROAqz+xSP41RLVbmyzXFfh6BxlqlsubkMkAF+VvxuthB W52ztsOFsKAvY2lvCP8yIIE5cRmNpRD7QPs34uKbvS8s8OnqxXfMqXr/iZbFfT9G3WCw 89HVk0IfBhgSL4oToN6gDrF4Ju8fTeIxeOVrF+8PA9lFu+NnjOYdIcCO76WNjnrohkqL bzsxt//KE97YluWz0sVwzDGZAZxa1SEVZe1e21uOwtKcpCzJwFYD0Ql5DScEuUkOP/Zw HsTFGJCl381b2MSXVssAokG7Q2OIHjXxs0kSvIBCSk7WMBHRAZyt6e2FtkJ4CeY1kH6O vZ9w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h14-v6si9387211plk.535.2018.05.01.02.14.00; Tue, 01 May 2018 02:14:14 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100AbeEAJML (ORCPT + 99 others); Tue, 1 May 2018 05:12:11 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44324 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755044AbeEAJMJ (ORCPT ); Tue, 1 May 2018 05:12:09 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B863A15BE; Tue, 1 May 2018 02:12:08 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.206.73]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 84E473F487; Tue, 1 May 2018 02:12:06 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, robert.walker@arm.com, mark.rutland@arm.com, will.deacon@arm.com, robin.murphy@arm.com, sudeep.holla@arm.com, frowand.list@gmail.com, robh@kernel.org, john.horley@arm.com, Suzuki K Poulose Subject: [PATCH v2 24/27] coresight: tmc-etr: Relax collection of trace from sysfs mode Date: Tue, 1 May 2018 10:10:54 +0100 Message-Id: <1525165857-11096-25-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525165857-11096-1-git-send-email-suzuki.poulose@arm.com> References: <1525165857-11096-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the ETR now uses mode specific buffers, we can reliably provide the trace data captured in sysfs mode, even when the ETR is operating in PERF mode. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index a35a12f..7551272 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1439,19 +1439,17 @@ int tmc_read_prepare_etr(struct tmc_drvdata *drvdata) goto out; } - /* Don't interfere if operated from Perf */ - if (drvdata->mode == CS_MODE_PERF) { - ret = -EINVAL; - goto out; - } - - /* If sysfs_buf is NULL the trace data has been read already */ + /* + * We can safely allow reads even if the ETR is operating in PERF mode, + * since the sysfs session is captured in mode specific data. + * If drvdata::sysfs_data is NULL the trace data has been read already. + */ if (!drvdata->sysfs_buf) { ret = -EINVAL; goto out; } - /* Disable the TMC if we are trying to read from a running session */ + /* Disable the TMC if we are trying to read from a running session. */ if (drvdata->mode == CS_MODE_SYSFS) tmc_etr_disable_hw(drvdata); -- 2.7.4