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: 8895261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 993AB9F1D3 for ; Wed, 20 Apr 2016 21:24:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C77112026F for ; Wed, 20 Apr 2016 21:24:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06629201FA for ; Wed, 20 Apr 2016 21:24:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aszaP-00060T-5U; Wed, 20 Apr 2016 21:23:01 +0000 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aszaM-0005yA-6t for linux-arm-kernel@lists.infradead.org; Wed, 20 Apr 2016 21:22:58 +0000 Received: by mail-io0-x232.google.com with SMTP id u185so66390091iod.3 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=msBHTsnVzfDQxgPzoiK+H59f6hnGkIcPrQGq8Iyc9BUznD+CtrGPZNNgtu8sPKa3YY Q1VtUFMJsaVBpr4yO/0EKKGPetaCKAwvdyzTNNjMTPiL79WSzWDasp3LoyBVm6srUbdp WNJ/Smt4ZT3Bj3Ygcgs0QZkzb9b+sB48UfcCgFXQI9eO4ys0Pc26ncStu26r4I9MxSVU mdb74Erw8QrxZClPLxNJwkNJmK3OJmYTlGv/HKKEbP8Zi9uLFlh+3boYC3I8wy/n0IqO jd319JknR/DRuECHVdS8u+oYx+rE4TRLF7bX1V9jeYhRdu3tBvSFA7Z3+8VeTsxr6XXC hL3A== X-Gm-Message-State: AOPr4FUA3v4AsHfBekmj9cMRF6FvlVSpsstipgU7Ic6MQeFEh4p6lGZAq0HU2v0RIrMnFetv 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160420_142258_295165_3A9E158B X-CRM114-Status: GOOD ( 12.50 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Suzuki.Poulose@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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.