From patchwork Tue May 14 19:40:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 10943693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 678646C5 for ; Tue, 14 May 2019 19:40:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 574E8288E2 for ; Tue, 14 May 2019 19:40:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B7B5288E6; Tue, 14 May 2019 19:40:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEDAA288E2 for ; Tue, 14 May 2019 19:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QWfpsZCJTRFQeDaPwuzRHs5u9kV/KHyREfWH4GdMaiw=; b=oGooCV4/P0mBVSiThCtii5WmfK R9tTPRWhMS+pSyxxDFPmKVZfj/YDOgPP3f+WAG8dn2l6+hVha0sVHNsikWBIPoGYmnPf71gaf17om 705ZHmE+2myMw8qK4Z41kG+H26QsG84bhqF5P7rERwf6SOWr3Eh7EykXbe7QkPJSqTAxarzyKEp+U 7Lue/658WDL91zr1fgRCLIHf9kB2lTJH3Nbc93i2i6gWgNYz3/7cjSLdtfxfef+sfz43SSRVDIX+Y Vw2lzm+CoXB03TtIQlD4KHGkp/2pWzCYi61kfhd78en++Ae+6SbfGorRnghOYp3vDHM4T2sQv67MZ pKM/slTQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQdHt-0006OM-Jw; Tue, 14 May 2019 19:40:33 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQdHj-0006FY-2Y for linux-arm-kernel@lists.infradead.org; Tue, 14 May 2019 19:40:24 +0000 Received: by mail-pl1-x643.google.com with SMTP id f97so105667plb.5 for ; Tue, 14 May 2019 12:40:22 -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=6Xpd5fXby+7ekbmSJL/l5IgMLyrh9k2LAW0LAUPjY/8=; b=pIIANLrZhKqr2Fkh7C78m66NcKxrJVDij+1KZsZeOGF17vSoHGgodtnEYmpBobXjPz cfMMa12eAB3UL39IcMaJpuecD4/zq384Tw2Yetz7jKKTsuI+7rD4lJXq09bSsnOKSU6g kW/npFVGXFftSCPBEjY0JkYT9zTHgwsT2tI0RT6BG8bV//YTisJfE+xu+j7B4KAAgRyx BlQU4t3uOWYSxDb1nqpf4clAfeWxd+QuPH/Np2GZs009YZ4IS2PrcRkm+9p2+XvoET1F ZVJc+lo5lA2kv2Gkpy/zPMWOL2yb7IYWiJf34p4TNhcsF1NBUkSN3nuu5UB1ItvvYgYp m/sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6Xpd5fXby+7ekbmSJL/l5IgMLyrh9k2LAW0LAUPjY/8=; b=ddWZtiORAAa/oVqaGbTbKc+NMBjGwkZor32o6H8w8RKEA/sS3Hm7AcXWKkiag8aG7i QOE61iioSXKz7OduUCAU4NLvhyqXxobnKvcJIO83Ry26AtlmmeZuz05yaeBY4KTZk/iE UYDaERI81Fk68nFJ0GTKa9v053zEnCZO/5NKpJSUgK0yKq7xW8PgwJEpH20TNZZ1Tcq+ /omoerfNQN9hJc089MJEAeSoQXr8YPQZi/H8PxlrE7a9/nZQjQ17rSjBjd4ZddPxptf0 Yp05KB9XMAXySnYGrWIA3kzqFIjD6GF3iGEDaOX5yRI4exfcN8HUxKq3EDLzRY7lX0+r 29GQ== X-Gm-Message-State: APjAAAX8XnKp4eYQ40kkHdO3Tpz4eZc17+Jx/Tb1ItF68pMPnUtV6EAG iDMd5FQGvYr9356oe1oCksq2M82Qva0= X-Google-Smtp-Source: APXvYqwMLGXfFNFWvtXZg67czC687qRDohmxuHMnmeo+hQ11WZtQSlnx57Y/9WBgt8drUlR2t1QX/Q== X-Received: by 2002:a17:902:22:: with SMTP id 31mr40062070pla.15.1557862821987; Tue, 14 May 2019 12:40:21 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id w66sm5791196pfb.47.2019.05.14.12.40.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 12:40:21 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 1/6] coresight: etb10: Properly set AUX buffer head in snapshot mode Date: Tue, 14 May 2019 13:40:13 -0600 Message-Id: <20190514194018.23420-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190514194018.23420-1-mathieu.poirier@linaro.org> References: <20190514194018.23420-1-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190514_124023_112773_358C0A29 X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: suzuki.poulose@arm.com, alexander.shishkin@linux.intel.com, coresight@lists.linaro.org, acme@kernel.org, peterz@infradead.org, mingo@redhat.com, leo.yan@linaro.org, mike.leach@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Unify amongst sink drivers how the AUX ring buffer head is communicated to user space. That way the same algorithm in cs_etm_find_snapshot() can be used to determine where the latest data is and how much of it to access. Signed-off-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etb10.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index 4ee4c80a4354..60e753b1768d 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -548,13 +548,14 @@ static unsigned long etb_update_buffer(struct coresight_device *csdev, writel_relaxed(0x0, drvdata->base + ETB_RAM_WRITE_POINTER); /* - * In snapshot mode we have to update the handle->head to point - * to the new location. + * In snapshot mode we simply increment the head by the number of byte + * that were written. User space function cs_etm_find_snapshot() will + * figure out how many bytes to get from the AUX buffer based on the + * position of the head. */ - if (buf->snapshot) { - handle->head = (cur * PAGE_SIZE) + offset; - to_read = buf->nr_pages << PAGE_SHIFT; - } + if (buf->snapshot) + handle->head += to_read; + __etb_enable_hw(drvdata); CS_LOCK(drvdata->base); out: