Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp258279pxx; Thu, 29 Oct 2020 01:44:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgamnX8BOlJwqLWOqZmo5xWfS7phfYy4deRhNvll/GNET0Gw0GtUqvkaflE3LtieSoNgAD X-Received: by 2002:aa7:c955:: with SMTP id h21mr2854881edt.315.1603961039913; Thu, 29 Oct 2020 01:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603961039; cv=none; d=google.com; s=arc-20160816; b=vUNbiz4jzfe3bH8MhYExtWqg2jdxZ12pir06tVWGJJ6qKxFKUaBEpojVyv+zvdJIFv Svav2OYruIf+v5ZcYR/J9KVXXImw6eJho+MZrNFy9Sye9b+Y3HnX8ta74Hq/W0KI6MS3 oFmlLLaj971I2Sl0yQt8Inb9/krRjUelDhCJsQnbwndeQFRiKUTMT3IGEt+yUYdZMx/b 7n2egxLBmzFFSnZrZtpS0F3oSWu7jnlzZMGNEFOZo3bPwDBrAo6kScB37YomoDJ1+fAW 3oe2fLHkfpd8FmxOKhdczxVmcsggsVjhM98CiYKpDprAXNw9iRu/j9lB/4/NWlH/ssXp EOQg== 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=MEYYqRiEf6dRsD/mre6lcTQ7G1RKmPWx5XvE7T9UU18=; b=AvgKFdFyg+1/p/dWX/3nCQfTy3Czdzf+ho1zmTGKtDbYFVd/4gU1FyJT+nHVvvNgkC QckMD1fAzOz3bv3dYEIjjD/wmSrNxjS0N1B6rp6fHm7ZjXb72EzZTlhkdm5yOVKOMjTo r04qj0xGyPJB46Nt56hHV/kKAiyJwGpTA+OwSD80jsJ6zXiRYrBOzYT3w7q5wvsKIyjc GAESa+u/Xm/JFwzX9ecjRFx9vV40Qrsue8fENw2RfP1ppVnqIL0YaKxLq6Q1cHpmbjJu Z5ZaOWKAuyL1loGegkS8vHS3Anvj5mYty55lGetMQbeW9d1UkXaxKVauJayYaFdVXJb1 bLuA== 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 p61si1546025edd.445.2020.10.29.01.43.37; Thu, 29 Oct 2020 01:43:59 -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 S1731207AbgJ2BDi (ORCPT + 99 others); Wed, 28 Oct 2020 21:03:38 -0400 Received: from foss.arm.com ([217.140.110.172]:39076 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730466AbgJ1WKL (ORCPT ); Wed, 28 Oct 2020 18:10:11 -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 B6A3B176B; Wed, 28 Oct 2020 15:10:07 -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 C63BD3F68F; Wed, 28 Oct 2020 15:10:06 -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 06/26] coresight: etm4x: Handle access to TRCSSPCICRn Date: Wed, 28 Oct 2020 22:09:25 +0000 Message-Id: <20201028220945.3826358-8-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 TRCSSPCICR is present only if all of the following are true: TRCIDR4.NUMSSCC > n. TRCIDR4.NUMPC > 0b0000 . TRCSSCSR.PC == 0b1 Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index d78a37b6592c..0310eac9dc16 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -175,8 +175,9 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) drvdata->base + TRCSSCCRn(i)); writel_relaxed(config->ss_status[i], drvdata->base + TRCSSCSRn(i)); - writel_relaxed(config->ss_pe_cmp[i], - drvdata->base + TRCSSPCICRn(i)); + if (drvdata->nr_pe) + writel_relaxed(config->ss_pe_cmp[i], + drvdata->base + TRCSSPCICRn(i)); } for (i = 0; i < drvdata->nr_addr_cmp; i++) { writeq_relaxed(config->addr_val[i], @@ -1228,7 +1229,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) for (i = 0; i < drvdata->nr_ss_cmp; i++) { state->trcssccr[i] = readl(drvdata->base + TRCSSCCRn(i)); state->trcsscsr[i] = readl(drvdata->base + TRCSSCSRn(i)); - state->trcsspcicr[i] = readl(drvdata->base + TRCSSPCICRn(i)); + if (drvdata->nr_pe) + state->trcsspcicr[i] = readl(drvdata->base + TRCSSPCICRn(i)); } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { @@ -1344,8 +1346,9 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) drvdata->base + TRCSSCCRn(i)); writel_relaxed(state->trcsscsr[i], drvdata->base + TRCSSCSRn(i)); - writel_relaxed(state->trcsspcicr[i], - drvdata->base + TRCSSPCICRn(i)); + if (drvdata->nr_pe) + writel_relaxed(state->trcsspcicr[i], + drvdata->base + TRCSSPCICRn(i)); } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { -- 2.24.1