Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp259113pxx; Thu, 29 Oct 2020 01:46:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoaFIFQ1SXuuNdCVAUl3wDXMsIINz9vDw/Dcv+/r2/+fXpRboGao0mIkBEcXcfOIRBR1x6 X-Received: by 2002:a17:906:3fd3:: with SMTP id k19mr3166352ejj.434.1603961159970; Thu, 29 Oct 2020 01:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603961159; cv=none; d=google.com; s=arc-20160816; b=NBWPMgECFExOTrnfYCTnn2xuMu55h8EzNbcQGKpyQYCrh7vVQeMOb3U6QSL/BfawA8 XZSaYoMufsc+h6s8fU7OO4KotlbfQWG7c/UrQxNCreWCMDal1kKNCz+f2w2iusFucRPr EcH3bScX/5E9sL9jWGdiNMfq9FzaK6Vp8oegYnpdOZA+lgUc5ywCO1vzm5VeNMDwN5Ij CCsg9c5OfVewJajaiFGTgTuZ4DAkjCs1w/FRSMgh/bxMxgAFxMt5FD99YXqJgSXQrYMB pjh5zNvcYEtZb79Jz+pYpRW0of+9VmbP6wxsTw8NWd/Ku11n0XCEeAcbJojgCO1HbZCM nOMg== 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=RUmDcUBGRcczAhQPZ8mkhuiQDGJDqGjIuxjB3rNqQMs=; b=s2XIbroWfWSncAAcWamSSuvs55rYR2j4URLNxSlrCLStwQpf2xcxr+gZ0j25ubUF/n IdThmAnoC7Qw6kjps9Qnj2DZIV6MzabAe05adgBdqPeQcnOKmRt6zwVdRqVOl08Mu3Qv P0kR2yQpqKOmvxRJq2d/jOZarPfnGoKCyBy9l1Guc5WFpcu7SrtE/2YSrdzno7lFVlvT Pm/7A0bWa/hjrSTIxbO/4Ie21mhv5vVVIMoZiPlOMvXhv6F1P7egGYRjXWB0XrHLfKj5 j4SvBVqt/DYe5EvWBQOiVq33aepMym9gGET8MT10BwUF7t59/wZwIxaw8VsOgFMLwPHk dRkg== 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 z23si1601241edx.29.2020.10.29.01.45.38; Thu, 29 Oct 2020 01:45: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 S1731242AbgJ2BDt (ORCPT + 99 others); Wed, 28 Oct 2020 21:03:49 -0400 Received: from foss.arm.com ([217.140.110.172]:39068 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730414AbgJ1WKH (ORCPT ); Wed, 28 Oct 2020 18:10:07 -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 99034176A; Wed, 28 Oct 2020 15:10:06 -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 AC3CD3F73C; Wed, 28 Oct 2020 15:10:05 -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 05/26] coresight: etm4x: Handle TRCVIPCSSCTLR accesses Date: Wed, 28 Oct 2020 22:09:24 +0000 Message-Id: <20201028220945.3826358-7-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 TRCVIPCSSCTLR is not present if the TRCIDR4.NUMPC > 0. Thus we should only access the register if it is present, preventing any undesired behavior. Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 28dd278f6d47..d78a37b6592c 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -141,8 +141,9 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) writel_relaxed(config->viiectlr, drvdata->base + TRCVIIECTLR); writel_relaxed(config->vissctlr, drvdata->base + TRCVISSCTLR); - writel_relaxed(config->vipcssctlr, - drvdata->base + TRCVIPCSSCTLR); + if (drvdata->nr_pe_cmp) + writel_relaxed(config->vipcssctlr, + drvdata->base + TRCVIPCSSCTLR); for (i = 0; i < drvdata->nrseqstate - 1; i++) writel_relaxed(config->seq_ctrl[i], drvdata->base + TRCSEQEVRn(i)); @@ -1202,7 +1203,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) state->trcvictlr = readl(drvdata->base + TRCVICTLR); state->trcviiectlr = readl(drvdata->base + TRCVIIECTLR); state->trcvissctlr = readl(drvdata->base + TRCVISSCTLR); - state->trcvipcssctlr = readl(drvdata->base + TRCVIPCSSCTLR); + if (drvdata->nr_pe_cmp) + state->trcvipcssctlr = readl(drvdata->base + TRCVIPCSSCTLR); state->trcvdctlr = readl(drvdata->base + TRCVDCTLR); state->trcvdsacctlr = readl(drvdata->base + TRCVDSACCTLR); state->trcvdarcctlr = readl(drvdata->base + TRCVDARCCTLR); @@ -1310,7 +1312,8 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) writel_relaxed(state->trcvictlr, drvdata->base + TRCVICTLR); writel_relaxed(state->trcviiectlr, drvdata->base + TRCVIIECTLR); writel_relaxed(state->trcvissctlr, drvdata->base + TRCVISSCTLR); - writel_relaxed(state->trcvipcssctlr, drvdata->base + TRCVIPCSSCTLR); + if (drvdata->nr_pe_cmp) + writel_relaxed(state->trcvipcssctlr, drvdata->base + TRCVIPCSSCTLR); writel_relaxed(state->trcvdctlr, drvdata->base + TRCVDCTLR); writel_relaxed(state->trcvdsacctlr, drvdata->base + TRCVDSACCTLR); writel_relaxed(state->trcvdarcctlr, drvdata->base + TRCVDARCCTLR); -- 2.24.1