Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp756022ybl; Fri, 9 Aug 2019 13:24:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBq7aNVow6MV504eQTSVBTCy3tK5Rve43/zkB0ZBqDJ4z/RXjdNyeyOzpMKeFTh6Hff7kT X-Received: by 2002:a17:902:f089:: with SMTP id go9mr20604006plb.81.1565382292723; Fri, 09 Aug 2019 13:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565382292; cv=none; d=google.com; s=arc-20160816; b=yaBy2h+38Yf7ZOO8cTaVFQOrusNZi/fSSbJFReTITW5Wh2pN+KWZcpGGcLNRWtyCft vP+Px1axuF4TkCENWXpdFcg3XQqqXUI5sbVa6lgVpQqS4fDBNxPkOVtPaLFRQSKaFJAn d46rX/BNYuE/UAwR2hlpZrKj+WGWrZDsTo7Pux6Q1QFL8Hi9EAeUzMIoiTeAHvu4TT2S 45twP+dQpXqG449dZTZ+zD1soOwrofHX3kEAGtv4Al1ta7GUbcBfu46hHD+stCynq75k u3KK7IBwlYcGpenQoqMsRNUebO32HgBY3aYz7zzVnxjltdrF0/fpGidxe4xW7HU4dQzi GYMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=kc//5wSK6WFlmTTvjwkok8tpntxs4Pv501PXTXdOfnc=; b=VvcYyEs0khYVYwtY0OKYPhHBt3t4Ei7xLhgLCiDLgHKCq8Fx4k5nK+uI8COSE7xG3B dPYenMMn63C7WcfW/AxB9+s8MmWy1LFdYEBKLqo45y3FDwInDTVHwtVWXhTjYRV37M9B wZJm2bbCmiDON69HRfmrY0RYNFbAqHXAHGxH1UWsfpPsdmqwkAPEeyWLiDyYtMu3da4y Nm/BZCJVUJMBBqG5IzbSaHrm76TBBGxeLpTgv8rti3V9GbH3QpNtPRObAabG8jEWX7uN zbn41TP84fB6alkgo4iErEypWbTGINXZ4kfJBlVixpbje+GDh2IXqyLwyiv2h7uHu4al //+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="p/JCX4Jh"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si57941038pgn.290.2019.08.09.13.24.37; Fri, 09 Aug 2019 13:24:52 -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=@google.com header.s=20161025 header.b="p/JCX4Jh"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbfHIUXe (ORCPT + 99 others); Fri, 9 Aug 2019 16:23:34 -0400 Received: from mail-pg1-f201.google.com ([209.85.215.201]:42705 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfHIUXd (ORCPT ); Fri, 9 Aug 2019 16:23:33 -0400 Received: by mail-pg1-f201.google.com with SMTP id l12so13675769pgt.9 for ; Fri, 09 Aug 2019 13:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=kc//5wSK6WFlmTTvjwkok8tpntxs4Pv501PXTXdOfnc=; b=p/JCX4JhVEw8kIjVj8ThqkCPM1bt8O7sHsmAgsHuB1eIMXYdn28R//CrTjTd/ikSf4 qv1AvwyfwMZ8B9jv+EIxv4udxMLY5yxfx3cgCDSozVoNdmU01CwY++sXeEhic+fQW+mB eD13JyLXksSENbq7Lc9O2HkyIHs15JzyRV77eG23VPM3j8JRAan2/D15AdHmKUhEwIfh jj9IAhXzzBVEqjYdPukdVLXh3RIiTRO9Tz3U8fmpUFG+mQ2pxT3s6OTIGrwFQfUPJEeZ CfQdaco/0I1C8clYTr6Ko2xI1WK/GBmbW3VMKyb5eGpU0raw6N99u4AGOWC59yT85XjA p9bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=kc//5wSK6WFlmTTvjwkok8tpntxs4Pv501PXTXdOfnc=; b=lUlg5rvjcZbRQHPDlcK9z73QNYIKd3vsj6drCxblWII34rXklvmvGq4GUrPcz8Dmlf RSu4a0miqRl3k2e24wHZM5oaEvr8aBJGfLHTSNgLmQWNoYQiXP+0+sx86QIM9yzG9ulr C+VouFodTU+GRTq6U2k5udhb01fnyp8xuCMgR8Do4aGz/H7xknd8WPj/KOTd+3zo1voE /f0K5Xha2lyda6orHrvsD4frCWl7pCp3p7RGUVnY8byfRMMuJ/tEKND1HVLE1i3lVKFA w3k0TdyKnIg6fiOVum89yRTcsewDnZuyHbMaBTA47bdVtZ+tUTxyuoyqX1Uu9wx2ui9O BoNA== X-Gm-Message-State: APjAAAVW7GQM9GnCH9QbpzymPi5EgbDotA0dv+RTFXJIg+Asy4jlx7BU 3X2c33oQsXrwp2tQ7PQ2Hvrj4SVsMQ== X-Received: by 2002:a63:211c:: with SMTP id h28mr18867782pgh.438.1565382212981; Fri, 09 Aug 2019 13:23:32 -0700 (PDT) Date: Fri, 9 Aug 2019 13:23:30 -0700 Message-Id: <20190809202330.51183-1-yabinc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH] coresight: tmc-etr: Fix perf_data check. From: Yabin Cui To: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yabin Cui 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 When tracing etm data of multiple threads on multiple cpus through perf interface, each cpu has a unique etr_perf_buffer while sharing the same etr device. There is no guarantee that the last cpu starts etm tracing also stops last. This makes perf_data check fail. Fix it by checking etr_buf instead of etr_perf_buffer. Signed-off-by: Yabin Cui --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c index 17006705287a..f466f05afe08 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c @@ -1484,7 +1484,7 @@ tmc_update_etr_buffer(struct coresight_device *csdev, goto out; } - if (WARN_ON(drvdata->perf_data != etr_perf)) { + if (WARN_ON(drvdata->perf_data != etr_buf)) { lost = true; spin_unlock_irqrestore(&drvdata->spinlock, flags); goto out; @@ -1556,7 +1556,7 @@ static int tmc_enable_etr_sink_perf(struct coresight_device *csdev, void *data) } etr_perf->head = PERF_IDX2OFF(handle->head, etr_perf); - drvdata->perf_data = etr_perf; + drvdata->perf_data = etr_perf->etr_buf; /* * No HW configuration is needed if the sink is already in -- 2.23.0.rc1.153.gdeed80330f-goog