Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp102440pxx; Wed, 28 Oct 2020 19:46:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmPqkLZU746PipqOHzcPyEm0gTOwoO7DjEkQJJ+778hdysbOCe+6eR9lHzvlHOUFjalz0g X-Received: by 2002:a17:906:3a97:: with SMTP id y23mr2051185ejd.250.1603939611218; Wed, 28 Oct 2020 19:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603939611; cv=none; d=google.com; s=arc-20160816; b=boAkceJifpjKEJ3/khaZCu6syqjQNw5fARn82ieMtXw8tG8iDlk1lgwb7aLNzyUXmM 9EwU8v/xm7RZoUQL6U2TlyPu3cTEw64Z/CXpPh7mhTsHzV5Al0DtrRyBvA4VAU1l9lLa fk/CAe1PdVJ67htYwZnftXdDJZ9Gge1k83AUCy80gruwKa3ClCnK1nswMrnpfCnjTlKz WL02iAi8CtjNxq2JH7qb9UXJDzdWKLaDHUTcfItyIMVGGLMisSH83UxeSYsj9VyFQumk vYvXVXTTp4Ui/n6tyeVdfhV6qw4OY0vpeUKHrXoNUjVuuKKYfiNM4aZ3kpLXC3zK+0X7 9P9g== 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=pSC6Z507UQD3AqoyI2fpO+EHTCCRQ9pEn5v60p8fdxU=; b=hR/Xtxw3qcrKFTAcmkrF/Q9vkaGs4EtCsXD7q2ubydUI1DH8DHyoxwD8ESebMgnX44 6MF0+ApAAGsALhUnJJ44EVpg27/eKScya0oKVj2LDXPTpgokxbUM48YP1l9K6VAQs2e0 +Yn8v9+aorMJpNXDMc+QjtPpl/JQCVoh7qZotvaDb0dqWKnAa3FKufv4PdL89F/ql0ok p0kONaVdbVX9370d8NK7A2tOj7O5vjPISSYh6+Db3HnhK6xLy64MrR81mTT8O3dM6tck G5WJ3jsaav/wRN4/lDvTi6Qm3McSg8JdJiKiDxMo4T9+Sj4bLfLOUNhGjKWTgofCp5E8 a/GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si1015781eds.379.2020.10.28.19.46.29; Wed, 28 Oct 2020 19:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730451AbgJ1WKI (ORCPT + 99 others); Wed, 28 Oct 2020 18:10:08 -0400 Received: from foss.arm.com ([217.140.110.172]:39038 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730424AbgJ1WKE (ORCPT ); Wed, 28 Oct 2020 18:10:04 -0400 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 5E9C61763; Wed, 28 Oct 2020 15:10:04 -0700 (PDT) Received: from ewhatever.cambridge.arm.com (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7A6223F73C; Wed, 28 Oct 2020 15:10:03 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: mathieu.poirier@linaro.org, mike.leach@linaro.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, Suzuki K Poulose Subject: [PATCH v3 03/26] coresight: etm4x: Update TRCIDR3.NUMPROCS handling to match v4.2 Date: Wed, 28 Oct 2020 22:09:22 +0000 Message-Id: <20201028220945.3826358-5-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201028220945.3826358-1-suzuki.poulose@arm.com> References: <20201028220945.3826358-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since ETMv4.2, TRCIDR3.NUMPROCS has been extended to a 5bit field by encoding the top 2 bits[4:3] in TRCIDR3.[13:12], which were RES0. Fix the driver to compute the field correctly for ETMv4.2+ Cc: Mike Leach Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index af0ab2f44865..cbbe755d1d16 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -724,8 +724,13 @@ static void etm4_init_arch_data(void *info) else drvdata->sysstall = false; - /* NUMPROC, bits[30:28] the number of PEs available for tracing */ - drvdata->nr_pe = BMVAL(etmidr3, 28, 30); + /* + * NUMPROC - the number of PEs available for tracing, 5bits + * = TRCIDR3.bits[13:12]bits[30:28] + * bits[4:3] = TRCIDR3.bits[13:12] (since etm-v4.2, otherwise RES0) + * bits[3:0] = TRCIDR3.bits[30:28] + */ + drvdata->nr_pe = (BMVAL(etmidr3, 12, 13) << 3) | BMVAL(etmidr3, 28, 30); /* NOOVERFLOW, bit[31] is trace overflow prevention supported */ if (BMVAL(etmidr3, 31, 31)) -- 2.24.1