Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2719801pxb; Thu, 3 Feb 2022 12:42:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyU7JMcWf70H5wyw1Oce34Xapi9CQuXnd+miW6njh/0mHN4zB3ncLTYjsypzMm3vDMd2fd X-Received: by 2002:a17:90a:694d:: with SMTP id j13mr15912551pjm.10.1643920933304; Thu, 03 Feb 2022 12:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643920933; cv=none; d=google.com; s=arc-20160816; b=0htiJszXYpwIs5RdMxWupd46A287W6cLf5abmJ6D81EvBI99n0lxSayIaoI5GISq+g y5Yu7TkBdejkxBHn0iFbz43Yfw8sqt1ZSdo4T4dSgbL5lVkGpLed6MPOIRNTl39Qzh8J EItmWmSa4UGcucd7DY6duNVPInb9ZLMFd7uMb9aQxBzkgHWPJ7CbXoRmRrKLvpsuALVC Q2GuQ1n18ZhxNR3cAPJzHs1DYcSk4oBb7OeiwbMe0Ci1vnNhydRnWtvixc14Ptf7oa1j pW+w/COvoC3KB3bMrPQMjjeTrVzVpFExNBJ/yvngXDsLwq805AqmXtQSMNsNxOmT9xL3 4ryQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2bWoedfCzhhRMw88kYNzSI/ywKfOVM30Im3b6E9OhaA=; b=W1VVWiX9HBsd6Rjkr+Dun+S/NZfVsIgTZbc3ag2+6Wc0yiqrhEclnJMsTHFywOfAVK gNzqZVell5h+dWfm86ioTQzr3s6IysP7dNZPqiAvWgGXG/v4G1pQHXSfElgMsdB58kum J/Q4NqxQ94IZjTjiZ+T/T6rQBSNE++7ekTp1Wf3rEPHdKi16CPaGH0KlUcHN8xthVX6A ZfuEkNMcMAwSSJeLpdslNvjcppkixNHxiVqpD2MRqHxf4imKcBvB8576SaJWeC5Kx/wb wwXofXBNnRJZgz2rI2M440BYFBfiQIq2OHKR5VTWLt+3gvbBpnDdj6XG0ixJ92W2+Acw lgCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y28si22433693pfp.161.2022.02.03.12.42.01; Thu, 03 Feb 2022 12:42:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350503AbiBCMHE (ORCPT + 99 others); Thu, 3 Feb 2022 07:07:04 -0500 Received: from foss.arm.com ([217.140.110.172]:42676 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350469AbiBCMGt (ORCPT ); Thu, 3 Feb 2022 07:06:49 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0C7861396; Thu, 3 Feb 2022 04:06:49 -0800 (PST) Received: from e121896.arm.com (unknown [10.57.13.234]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 85AB53F774; Thu, 3 Feb 2022 04:06:47 -0800 (PST) From: James Clark To: suzuki.poulose@arm.com, mathieu.poirier@linaro.org, coresight@lists.linaro.org Cc: leo.yan@linaro.com, mike.leach@linaro.org, James Clark , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 15/15] coresight: Make ETM4x TRCRSCTLRn register accesses consistent with sysreg.h Date: Thu, 3 Feb 2022 12:06:03 +0000 Message-Id: <20220203120604.128396-16-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20220203120604.128396-1-james.clark@arm.com> References: <20220203120604.128396-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a no-op change for style and consistency and has no effect on the binary produced by gcc-11. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 7 +++++-- drivers/hwtracing/coresight/coresight-etm4x.h | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index a0cdd2cd978a..c876a63fa84d 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -1728,8 +1728,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_GROUP_SHIFT) | + (TRCRSCTLRn_SELECT_MASK << TRCRSCTLRn_SELECT_SHIFT)); spin_unlock(&drvdata->spinlock); return size; } diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 4d943faade33..dd2156a5e70b 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -258,6 +258,15 @@ #define TRCBBCTLR_RANGE_SHIFT 0 #define TRCBBCTLR_RANGE_MASK GENMASK(7, 0) +#define TRCRSCTLRn_PAIRINV BIT(21) +#define TRCRSCTLRn_INV BIT(20) +#define TRCRSCTLRn_GROUP_SHIFT 16 +#define TRCRSCTLRn_GROUP_MASK GENMASK(3, 0) +#define TRCRSCTLRn_SELECT_SHIFT 0 +#define TRCRSCTLRn_SELECT_MASK GENMASK(15, 0) + + + /* * System instructions to access ETM registers. * See ETMv4.4 spec ARM IHI0064F section 4.3.6 System instructions -- 2.28.0