From patchwork Wed Sep 5 07:55:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 10588379 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 AA99314BD for ; Wed, 5 Sep 2018 07:56:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9566629A36 for ; Wed, 5 Sep 2018 07:56:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 879B629A7A; Wed, 5 Sep 2018 07:56:32 +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=-0.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SUSPICIOUS_RECIPS autolearn=no 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 EE94A29A36 for ; Wed, 5 Sep 2018 07:56:31 +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: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:In-Reply-To: References:List-Owner; bh=e42nBqEDljZRTzyOlSDAMor7bOfRFyEuYyTAPz0H+vQ=; b=uU4 GhGunScpv6H4hxkn+OAx1UY5gDVk4cjAon/2GUHadJMrcdZkj6l2N/i7/MST7khB3ApX4WIAQKvKY W7EOu6Vjn2PhQLLPoAejU+Pi7iLGBVqsrx10siFQvBUmMtK9oHU3Ak2YqlKc0arnvONBnrKb6n6V2 MsmBjMgebh+Oee7Tcwf7w1TrP7cpp0fNvRHGBmfDRQN1C6mcWn3hD9db2iD4tEvURkiAv4ai0l11p 1pxG16mJO1mKPpNtTdX1UpPMfka33Jm4sKUb0HBTaNK/vcdJtcfpKtVYCM9AVkMIc+0+TAClYut1z 1KSNWIRgQCoKWySM6HvzzKn+PZvZHxA==; 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 1fxSfm-0005k3-AI; Wed, 05 Sep 2018 07:56:22 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxSfc-0005af-Qp for linux-arm-kernel@lists.infradead.org; Wed, 05 Sep 2018 07:56:19 +0000 Received: by mail-wr1-x443.google.com with SMTP id a108-v6so6495958wrc.13 for ; Wed, 05 Sep 2018 00:56:01 -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=TpyyeSHjBOdgVSTKkKpugbb2aL2yKcX4jeyVmdysDRI=; b=BSFGIkG9RM19DieEKvGv5qdHXPP1p1kM2a9pPQKlviNbBNMJT9sykJKhQqtZzXezPl I2f1mlIl5imu5YKh4sjxfSNb1rovoBsl0ybdnEpWToe3414gTY3w8lH1w3KW1MOsTEeq 6/HF7ua0wm4bJ/uW7KaQEJ7klS6dTht2S1d8Q= 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; bh=TpyyeSHjBOdgVSTKkKpugbb2aL2yKcX4jeyVmdysDRI=; b=XxsDVJ+F+em6Y7PNGEalReN+l+RngSBrxjM5xtZk4YloqBB/tDSgpO3lHu2rM0zeqg MVzDd4fUZsszte7yp0VYJqMjudBnw5f1BltuBO5Wqt7LJ2wDQlWTUz/XrCneD9UCB5Mi q989E8UqqoSHTnU00PhwSvKpZmuVM+0IpChxRL/wnpNrpz63yeiLp2v6rgwI54E2XcT9 LmaO+oG4vYRQFVYPkhkMMPAkmXi14yUKR+zGpdDXUj7hI9xGIEQYTmr0S0rYMdWX9e09 FzRmznN4nX9jI6DC4Oz7mAyF6vT3T4sn77BCbgLInrYmtLDttVsZ2XtevsN4QEwrOG0X oaaQ== X-Gm-Message-State: APzg51AdHQ/An2Ydb1iweaD8q9O8lLhWHA268Ipnj9CpgHLw8PgEjwIJ xgsjlDACyNisXyuvQLV0/ZF6fEhfZ+7lTw== X-Google-Smtp-Source: ANB0VdYTUmyaeO8Oy7b1210CwQjRqlggTTNJdImlf/Ugs2VhmD6IbJMc5OtJU/ZpqnCwTmyh9zF34A== X-Received: by 2002:adf:9d1c:: with SMTP id k28-v6mr16124528wre.104.1536134160195; Wed, 05 Sep 2018 00:56:00 -0700 (PDT) Received: from localhost.localdomain ([45.76.138.171]) by smtp.gmail.com with ESMTPSA id w4-v6sm1776023wro.24.2018.09.05.00.55.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Sep 2018 00:55:59 -0700 (PDT) From: Leo Yan To: Mathieu Poirier , linux-arm-kernel@lists.infradead.org, Coresight ML , Alexander Shishkin Subject: [PATCH 1/2] coresight: tmc: Fix byte-address alignment for RRP Date: Wed, 5 Sep 2018 15:55:43 +0800 Message-Id: <1536134144-2764-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180905_005612_974613_8C78103E X-CRM114-Status: GOOD ( 11.42 ) 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: Mike Leach , Leo Yan 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 From the comment in the code, it claims the requirement for byte-address alignment for RRP register: 'for 32-bit, 64-bit and 128-bit wide trace memory, the four LSBs must be 0s. For 256-bit wide trace memory, the five LSBs must be 0s'. This isn't consistent with the program, the program sets five LSBs as zeros for 32/64/128-bit wide trace memory and set six LSBs zeros for 256-bit wide trace memory. After checking with the CoreSight Trace Memory Controller technical reference manual (ARM DDI 0461B, section 3.3.4 RAM Read Pointer Register), it proves the comment is right and the program does wrong setting. This patch fixes byte-address alignment for RRP by following correct definition in the technical reference manual. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 0549249..e310613 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -438,10 +438,10 @@ static void tmc_update_etf_buffer(struct coresight_device *csdev, case TMC_MEM_INTF_WIDTH_32BITS: case TMC_MEM_INTF_WIDTH_64BITS: case TMC_MEM_INTF_WIDTH_128BITS: - mask = GENMASK(31, 5); + mask = GENMASK(31, 4); break; case TMC_MEM_INTF_WIDTH_256BITS: - mask = GENMASK(31, 6); + mask = GENMASK(31, 5); break; }