From patchwork Tue May 3 17:33:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 67078 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp719155qge; Tue, 3 May 2016 10:35:16 -0700 (PDT) X-Received: by 10.98.19.131 with SMTP id 3mr5365892pft.17.1462296916899; Tue, 03 May 2016 10:35:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si243457paw.142.2016.05.03.10.35.16; Tue, 03 May 2016 10:35:16 -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; dkim=pass header.i=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964974AbcECRes (ORCPT + 29 others); Tue, 3 May 2016 13:34:48 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:36131 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964956AbcECRen (ORCPT ); Tue, 3 May 2016 13:34:43 -0400 Received: by mail-io0-f176.google.com with SMTP id u185so34094449iod.3 for ; Tue, 03 May 2016 10:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=D26ODV31S4tScoWsnSIeQjof3v3RBUzqSu8lnFopdLU=; b=YdafYW/2N8vI3At269XQQQePUQdtKV0SpQLxjLztU0rsOxNKCyP+jtpCYVqQXxhkA0 EjVAU+FKiotcDQybgncgKKPa6RfLDciv94pYwWDJaXrQ5tzAhjR0Hf7gzUknx9A7z2/J bLu9H20T/4a55KvRTGcLHEcalqfrjXWjdZ6oY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D26ODV31S4tScoWsnSIeQjof3v3RBUzqSu8lnFopdLU=; b=nJZlwkdf+F+SeHlc4n9FX3PJrGSPuGfSsVbLo+IyqYfkfGgFFkG+KvyhEoNIoHPTNh ryZ8CcdnP5H4wMkmBo2wiCXFfngifNnLjoF3r1K8vHup50ytxn2GFScOO/MPRINFlB1u xfI1MQLi90pzn+RWlM2F3GGmzi8zEfx10REASZozPnzhxjH/i2RRUextOQ/3kJ6KRR29 m2ap6GuiWEcbX0NDdoNvAv5M1QyxuCl2I8oHWXzKF+9kY9ih8xFTM4oHigC6xCv/Mb+K D84/y0KM3+ao/mjD6/VUNYAxaJ6OEqlFtS7F5N2KPVgcvtLqpkQftm1TGoU45nU6wIWE Ta8g== X-Gm-Message-State: AOPr4FV30mIa2sNUNNQwV8LG9fGo1O/OqnjtZAGcIpOW3U8bDBUiD5Wjx9xOlGAa+vBDFisy X-Received: by 10.107.63.214 with SMTP id m205mr4953195ioa.15.1462296882415; Tue, 03 May 2016 10:34:42 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id k33sm103957iod.44.2016.05.03.10.34.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 May 2016 10:34:41 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/27] coresight: tmc: dump system memory content only when needed Date: Tue, 3 May 2016 11:33:55 -0600 Message-Id: <1462296841-12327-22-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1462296841-12327-1-git-send-email-mathieu.poirier@linaro.org> References: <1462296841-12327-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Calling tmc_etf/etr_dump_hw() is required only when operating from sysFS. When working from Perf, the system memory is harvested from the AUX trace API. Signed-off-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 7 ++++++- drivers/hwtracing/coresight/coresight-tmc-etr.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) -- 2.5.0 diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index bc0efc1e5b49..b5e5e6ac67eb 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -74,7 +74,12 @@ static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata) CS_UNLOCK(drvdata->base); tmc_flush_and_stop(drvdata); - tmc_etb_dump_hw(drvdata); + /* + * When operating in sysFS mode the content of the buffer needs to be + * read before the TMC is disabled. + */ + if (local_read(&drvdata->mode) == CS_MODE_SYSFS) + tmc_etb_dump_hw(drvdata); tmc_disable_hw(drvdata); CS_LOCK(drvdata->base); diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 0c107811a232..7208584d0da7 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -76,7 +76,12 @@ static void tmc_etr_disable_hw(struct tmc_drvdata *drvdata) CS_UNLOCK(drvdata->base); tmc_flush_and_stop(drvdata); - tmc_etr_dump_hw(drvdata); + /* + * When operating in sysFS mode the content of the buffer needs to be + * read before the TMC is disabled. + */ + if (local_read(&drvdata->mode) == CS_MODE_SYSFS) + tmc_etr_dump_hw(drvdata); tmc_disable_hw(drvdata); CS_LOCK(drvdata->base);