Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp55457pxx; Wed, 28 Oct 2020 18:00:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXQkpIIlyYGtjnqLjT5OnKyaZR3aSD/FnPS2rD8EEOuYICIja40gWkNmHkElVA48mMBHwb X-Received: by 2002:a50:88e5:: with SMTP id d92mr1622421edd.145.1603933251264; Wed, 28 Oct 2020 18:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603933251; cv=none; d=google.com; s=arc-20160816; b=RpgIXHfIlpz3N1pjliSggMAlvPhjrIQoiZ0zAybPHKxfGmnw+sJ5w/K5F/eTQCWS5M Il9UNItItpMEj7poPl6mKrDe+ainOKZ3yaNHBbXrbUdv8QV3s4gWaCWx2xPIBJPiGTcu dibQgtcSrtRHy+VgTZTE5sYqh8PlULWbpYYhw2cBzZkMUCr5jflfiLfrjohPqxsj9r0B VFTPjXk9FHp6tL6PFH/4ndK4mS6Jcjf0EdfOF2qkr37u6bLpHsIM1lW8n0BI8giIubOE f3DiXFuMMhBaOtWx+p+3539fyEvvg4poQ/kBHZh2v5mGxWlqXKHNBva2ArltbRSrXnY4 ybvg== 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=3jaYmmv/ssepdgq/IJoryrFZgVqiK1XTkPITcyvDQDE=; b=MMJzTdiRvD7BzOf1y4PZojCXbJeLq8aiDHu1CrgxVzjKYi8xeiT/H3F3CMqdQ/ylRk RdDUbKls9iePy5oo0vCCXy+UaZWNm62EVdzsogZJFcXDui3ZP1vyE9/2JGp8VkZGVDOK M9MIhcdP9XdB9IKXPT8Gh2FH7hv6eUJpYY/8rNTnydbt9icBLBZGpqPYSr3OOl5+KaOh mtl8bFr79ZVpZYLh7tJpIaBXll6UuUx/1jEng76dI6tjY0DccsIddIPUwfxMN4J04K5L xooGfaQDqf3ok2FHXRNyV2+bYi0plyA1ZOPUh5ke9ZqtsHtSCkwhUvjM21Ukmfgp7ZcP 81Qg== 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 q7si752838ejy.607.2020.10.28.18.00.29; Wed, 28 Oct 2020 18:00: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 S1730442AbgJ1WKH (ORCPT + 99 others); Wed, 28 Oct 2020 18:10:07 -0400 Received: from foss.arm.com ([217.140.110.172]:39050 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730438AbgJ1WKG (ORCPT ); Wed, 28 Oct 2020 18:10:06 -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 775461764; Wed, 28 Oct 2020 15:10:05 -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 9485C3F73C; Wed, 28 Oct 2020 15:10:04 -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 04/26] coresight: etm4x: Fix accesses to TRCPROCSELR Date: Wed, 28 Oct 2020 22:09:23 +0000 Message-Id: <20201028220945.3826358-6-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 TRCPROCSELR is not implemented if the TRCIDR3.NUMPROC == 0. Skip accessing the register in such cases. Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index cbbe755d1d16..28dd278f6d47 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -124,8 +124,8 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) if (coresight_timeout(drvdata->base, TRCSTATR, TRCSTATR_IDLE_BIT, 1)) dev_err(etm_dev, "timeout while waiting for Idle Trace Status\n"); - - writel_relaxed(config->pe_sel, drvdata->base + TRCPROCSELR); + if (drvdata->nr_pe) + writel_relaxed(config->pe_sel, drvdata->base + TRCPROCSELR); writel_relaxed(config->cfg, drvdata->base + TRCCONFIGR); /* nothing specific implemented */ writel_relaxed(0x0, drvdata->base + TRCAUXCTLR); @@ -1185,7 +1185,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) state = drvdata->save_state; state->trcprgctlr = readl(drvdata->base + TRCPRGCTLR); - state->trcprocselr = readl(drvdata->base + TRCPROCSELR); + if (drvdata->nr_pe) + state->trcprocselr = readl(drvdata->base + TRCPROCSELR); state->trcconfigr = readl(drvdata->base + TRCCONFIGR); state->trcauxctlr = readl(drvdata->base + TRCAUXCTLR); state->trceventctl0r = readl(drvdata->base + TRCEVENTCTL0R); @@ -1292,7 +1293,8 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) writel_relaxed(state->trcclaimset, drvdata->base + TRCCLAIMSET); writel_relaxed(state->trcprgctlr, drvdata->base + TRCPRGCTLR); - writel_relaxed(state->trcprocselr, drvdata->base + TRCPROCSELR); + if (drvdata->nr_pe) + writel_relaxed(state->trcprocselr, drvdata->base + TRCPROCSELR); writel_relaxed(state->trcconfigr, drvdata->base + TRCCONFIGR); writel_relaxed(state->trcauxctlr, drvdata->base + TRCAUXCTLR); writel_relaxed(state->trceventctl0r, drvdata->base + TRCEVENTCTL0R); -- 2.24.1