From patchwork Wed Apr 20 21:22:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 66257 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2683244qge; Wed, 20 Apr 2016 14:22:41 -0700 (PDT) X-Received: by 10.66.139.9 with SMTP id qu9mr15353421pab.101.1461187361247; Wed, 20 Apr 2016 14:22:41 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tp1si1099133pac.137.2016.04.20.14.22.40; Wed, 20 Apr 2016 14:22:41 -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 S1751428AbcDTVWj (ORCPT + 29 others); Wed, 20 Apr 2016 17:22:39 -0400 Received: from mail-io0-f171.google.com ([209.85.223.171]:34467 "EHLO mail-io0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751001AbcDTVWh (ORCPT ); Wed, 20 Apr 2016 17:22:37 -0400 Received: by mail-io0-f171.google.com with SMTP id 2so66453905ioy.1 for ; Wed, 20 Apr 2016 14:22:37 -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; bh=xsacG9nPXfXHjnLrpS/OONBQpymTtNLvX/I6LmPL8c8=; b=D4zbOy//cgbVD48xO/lnEHBiAlMSLOoTs0X5gobeIx87ZIW7He28m6coDo4EGRh7Pk 1psWQTHhWK1mYsQxpTo5kMStnOtIS6ijqoGAaGBS3SKWEEtB+p9ByQuDF9DeFKa/ol64 5mQZHGTdSK31gzT4mVXYLM9omMdCqpQLjGKWg= 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; bh=xsacG9nPXfXHjnLrpS/OONBQpymTtNLvX/I6LmPL8c8=; b=QBGklhA3iQgtdL9GUYiAKnWn2f62jjmOKBHuGl6hCrSWUydvDjkxKo9W40aOXSiTLI gijZNwkg0XHV5vMOcRCYwAekSHjRnsa/F10aJM8wykpYJt4/Tnyq5394msVKtn1ucTsK yJDSXAZj00m3eTh9RtMi3RsLrR9n+hpLspAEyeOmzpk8EpeYV1GpGyTDOlHWAriy+c08 8WTcISgrt70MnB9j0t15RIrcHc0JGX+0VuMbBrd/Zo/ok9/CkA8Zm8o6sO2U+JYfQMpD 54Pb8CG8w4qB6ftUErfHk7yhtyW/kjPJM6OJGf94JxO/3Dw9BvyC/qtNPeJU3yuZnHrb DuwA== X-Gm-Message-State: AOPr4FVXZ7JSobszjD+PdrMDXpEBvZIy/CVYfcirGeYk40uwmsvJRt/qS5qxOaa/nc5Nvkuf X-Received: by 10.107.175.104 with SMTP id y101mr12990622ioe.113.1461187356648; Wed, 20 Apr 2016 14:22:36 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id v67sm3702055ioe.42.2016.04.20.14.22.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 14:22:35 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Suzuki.Poulose@arm.com Subject: [PATCH] coresight: etb10: fixing the right amount of words to read Date: Wed, 20 Apr 2016 15:22:33 -0600 Message-Id: <1461187353-17894-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch rectifies the amount of words to read when the internal buffer is deemed bigger than the amount of space available in the perf ring buffer. The amount to read is set to the amount of space in the perf ring buffer rather than being subtracted by it. Reported-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etb10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.0 diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index a974c39171a9..4d2427600f09 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -440,7 +440,7 @@ static void etb_update_buffer(struct coresight_device *csdev, u32 mask = ~(ETB_FRAME_SIZE_WORDS - 1); /* The new read pointer must be frame size aligned */ - to_read -= handle->size & mask; + to_read = handle->size & mask; /* * Move the RAM read pointer up, keeping in mind that * everything is in frame size units.