Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp785958pxb; Tue, 12 Apr 2022 13:25:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+nlHp4irhr0FBnH/00kE1Kw6Lib4d1VLR+Q4ElEGdQ3MGn9pYCHsIi1XI3sHinfQZY7BY X-Received: by 2002:a17:903:41c2:b0:158:83f7:f8a9 with SMTP id u2-20020a17090341c200b0015883f7f8a9mr6240566ple.146.1649795110503; Tue, 12 Apr 2022 13:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649795110; cv=none; d=google.com; s=arc-20160816; b=Qkc3RbqnYXS9nMrNUidpwdxyq+3xTGVgRoQmN49duwvTz3lM+S8HP9VZLOKKjnl43D 8bFlepYaPFIGtPtjLj7+qjrPrlYXn0vWeGksOP+JGNgpL7+cUblq6BrSitKnTWmsLMXD y9MLQ9pgI8bgYoSajA/yd4ahcHXREbMXbft0/iQ5Y/CBSmQWt6BQrQE2hLBRUmcuwhm5 5GiBkqC5FACMX/jgsO6VtWQQTYYj8f3HKosKwTSPUJmoS4SpLY8KnrrrmLpwSXvO7D1P gdWyx1miwdekHs6afdHPxRw8vYRKMC3DhG+b+kfAeQpNI42WNA+zP95CIlsY0k++pfk4 0BhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zGX8X6X2Ehyp3CB08h/jWEXGYSF3Q3LC7G8ldUitLiM=; b=EeZznCIUKkldIRMiC7nrm8HJYk2dsS/t9N1Iqbz1qQoSfVD4z3WCPAupa2McYnfudY +c9GZCgsyRogWZHVeodSWeuoG6F9yO/Z9dL1gcaMjhyo6+lE86iSLnht0KO6WCXT1Z9k aW57stC+cImx/ZRZWi18OEXKBGl7L0FehKK0JgOglVc8DGH5dpQAHxBQtpCkUX1+B7UP R8ZuZN7DIoj58MdFzDDbzhN4gPlJeHf4xdjNdQ3bzAJgKeYCyOUIJs4uuPQzZSYQYB0h GuE6JaANAVAseCqkH6DHk3q0hlmqCbc0tIWr4+wdoSCFfnJQ8aL4jBST0JcMyBH8sHrT dNUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R69XYZda; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c3-20020a62e803000000b0050607e753a2si1330332pfi.298.2022.04.12.13.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:25:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R69XYZda; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F9BF140AE; Tue, 12 Apr 2022 13:04:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346412AbiDLMAR (ORCPT + 99 others); Tue, 12 Apr 2022 08:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238470AbiDLL5I (ORCPT ); Tue, 12 Apr 2022 07:57:08 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 216DF60D97 for ; Tue, 12 Apr 2022 03:43:01 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id r13so27057792wrr.9 for ; Tue, 12 Apr 2022 03:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zGX8X6X2Ehyp3CB08h/jWEXGYSF3Q3LC7G8ldUitLiM=; b=R69XYZdaN1fd0yX4ETYXrlNIRY+BKYM261TzoPKETPWm7a7i/ST4cFceKSap4+uNwt uxyHYviRWbmqpO4BvXCyJxpYhkFJ3ptQ0VcdHt1oUYGldOmfK6TIf5JzzXe1sfDrFIyA FFY7nLYK+C+ZtIaTWAFzxItJs9od63dK+PoFRUrqXL/z3P8X5isDP++2KnW5shLnzver DQ3AP65YWYaxU4VkINbS15I6h8n1WnJbSy7AmfUVboU8wA1m8Ij+Oz9xZppHjLlku2xM /LsijyaP/VKUFpDkFTI/MLWmp6JQbmBzEuIs8G7oCe+RH9nb/kaNlse0qx2N6b6K5eiI cwgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zGX8X6X2Ehyp3CB08h/jWEXGYSF3Q3LC7G8ldUitLiM=; b=0T17pWv5Lo4MZaXRWCGx1UH5r9NiISLnedzHD/6anfcX8BU0Vi0UIEnesf8MTKTdNB /KVf329HhhPYhV1+ePm7w4e/SICKu4AqQxdUIzPX4bXyj9m+P/1qwcQSH1TfooqhJp0y bVSXM2dJKSy4Qx9wREuyaidNbQqsMfNBTE2W3WzmAD6CYclm8xe8Aft+SQwJbjh+lVZF TPjTUryeJoJgJJNY7Zz6zaS0fbRuKjrzqYPQ0RzJVYhDlFVB3AF+acoD36e8/Em37ivn jDZRSY/zaudRRyeCjAseBB6jYirrF4lQ+qPnlqxZJCFC/2z9uyERYO2xDzOHZ24HF5K3 rA8w== X-Gm-Message-State: AOAM531sAEuwzRNECAcLVM3+WWDbC2vvo9Hwiy0aYd5X7d6faUKZJ+r0 um12hfK1O92+SYVh112J39XlbHqjKj7R7iScotdS8A== X-Received: by 2002:adf:e108:0:b0:1ef:97ad:5372 with SMTP id t8-20020adfe108000000b001ef97ad5372mr27808945wrz.658.1649760179725; Tue, 12 Apr 2022 03:42:59 -0700 (PDT) MIME-Version: 1.0 References: <20220304171913.2292458-1-james.clark@arm.com> <20220304171913.2292458-16-james.clark@arm.com> <20220323161551.GB3248686@p14s> In-Reply-To: <20220323161551.GB3248686@p14s> From: Mike Leach Date: Tue, 12 Apr 2022 11:42:48 +0100 Message-ID: Subject: Re: [PATCH v3 15/15] coresight: etm4x: Cleanup TRCRSCTLRn register accesses To: Mathieu Poirier Cc: James Clark , suzuki.poulose@arm.com, coresight@lists.linaro.org, Anshuman.Khandual@arm.com, leo.yan@linaro.com, Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Mar 2022 at 16:15, Mathieu Poirier wrote: > > On Fri, Mar 04, 2022 at 05:19:12PM +0000, James Clark wrote: > > This is a no-op change for style and consistency and has no effect on > > the binary output by the compiler. In sysreg.h fields are defined as > > the register name followed by the field name and then _MASK. This > > allows for grepping for fields by name rather than using magic numbers. > > > > Signed-off-by: James Clark > > --- > > drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 7 +++++-- > > drivers/hwtracing/coresight/coresight-etm4x.h | 7 +++++++ > > 2 files changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > > index 3ae6f4432646..6ea8181816fc 100644 > > --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > > +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > > @@ -1726,8 +1726,11 @@ static ssize_t res_ctrl_store(struct device *dev, > > /* For odd idx pair inversal bit is RES0 */ > > if (idx % 2 != 0) > > /* PAIRINV, bit[21] */ > > - val &= ~BIT(21); > > - config->res_ctrl[idx] = val & GENMASK(21, 0); > > + val &= ~TRCRSCTLRn_PAIRINV; > > + config->res_ctrl[idx] = val & (TRCRSCTLRn_PAIRINV | > > + TRCRSCTLRn_INV | > > + TRCRSCTLRn_GROUP_MASK | > > + TRCRSCTLRn_SELECT_MASK); > > spin_unlock(&drvdata->spinlock); > > return size; > > } > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h > > index 15704982357f..2c412841b126 100644 > > --- a/drivers/hwtracing/coresight/coresight-etm4x.h > > +++ b/drivers/hwtracing/coresight/coresight-etm4x.h > > @@ -223,6 +223,13 @@ > > #define TRCBBCTLR_MODE BIT(8) > > #define TRCBBCTLR_RANGE_MASK GENMASK(7, 0) > > > > +#define TRCRSCTLRn_PAIRINV BIT(21) > > +#define TRCRSCTLRn_INV BIT(20) > > +#define TRCRSCTLRn_GROUP_MASK GENMASK(19, 16) > > +#define TRCRSCTLRn_SELECT_MASK GENMASK(15, 0) > > + > > + > > + > > Two extra lines. > > > /* > > * System instructions to access ETM registers. > > * See ETMv4.4 spec ARM IHI0064F section 4.3.6 System instructions > > -- > > 2.28.0 > > Reviewed-by: Mike Leach -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK