Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp270471pxu; Thu, 7 Jan 2021 04:44:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZp3BdfQ4npkv7Y4XdW9TlnVfmNLTuENq+TA5zeiGHfqWHaKeQv7msD20lnvVYqdWf5MSy X-Received: by 2002:a50:e84d:: with SMTP id k13mr1536547edn.154.1610023489434; Thu, 07 Jan 2021 04:44:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610023489; cv=none; d=google.com; s=arc-20160816; b=09lmnGjA8rNtrq9V0jezlNZ791skI05bVTOcQIBeixFU9FE46bdhqrvVr0ECObFpMz Hhiz6kkQwDkSevD4JSB8zw8b/T8Gr+C+nf9yOJDPEfRv8ZPc1wGzBlvP6sVF16oOgL0Z bM+J7fDix9vGPGGBVItcHOHGTYdP64J8cijpId77JzsRPAnGqpGB+cuQYy9R4DQJd9Pp 2jdjuvG3+V80CCr5BoMuqOBkw3wQ+upzS/folxjd5lorpaI11Xlj6SYVusg64g1t+6gx 3oZiIvCZ4KgmSxDfKf3b1BJqIvFGGLcVy26q3urW1zqKUgRcnv6/DR+M63ChnESgBVFE nGng== 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=YfM+tf49TQbWPtTxREiGqL4x9Ea6tp57I5gqrUX2WHc=; b=EZ7mweqOgHZCOM4k8gF1Vgz46uLdzjGJSWWjr9XxXrJMjgtVybzXsTySmlgHLwjWAF Sh0Ae5sZhxpFgmCb3H6Q7qhz3dZY8PCxBaaYOJ2NxAbSLHB635YuphFELtZc2bbiuv/u JB/PnLGAoy97RytWWcmAQDQ4uNgeAaFB1mve/TrMpkZQE7aGXufjcPgQAXKgOeYpufN1 zAhNzAm/C5STS4aLQZUZ2wX0L3/5U7RLL19E1TirihwOo1GSSlJEYZLRBc0cPomXddT7 Lw7HLjwoNiPgYvstyTYqoMnjEBaSdaqdlWGKWa7xAbzlSlmzyjh1gjX3q6i9OOHMTEHT eadw== 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 i11si2123202ejb.22.2021.01.07.04.44.25; Thu, 07 Jan 2021 04:44:49 -0800 (PST) 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 S1728594AbhAGMln (ORCPT + 99 others); Thu, 7 Jan 2021 07:41:43 -0500 Received: from foss.arm.com ([217.140.110.172]:59984 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728524AbhAGMle (ORCPT ); Thu, 7 Jan 2021 07:41:34 -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 3062C152F; Thu, 7 Jan 2021 04:39:44 -0800 (PST) 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 EFC453F719; Thu, 7 Jan 2021 04:39:42 -0800 (PST) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org, leo.yan@linaro.org, mike.leach@linaro.org, anshuman.khandual@arm.com, Suzuki K Poulose , liuqi115@huawei.com Subject: [PATCH v6 22/26] coresight: etm4x: Run arch feature detection on the CPU Date: Thu, 7 Jan 2021 12:38:55 +0000 Message-Id: <20210107123859.674252-23-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20210107123859.674252-1-suzuki.poulose@arm.com> References: <20210107123859.674252-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 As we are about to add support for system register based devices, we don't get an AMBA pid. So, the detection code could check the system registers running on the CPU to check for the architecture specific features. Thus we move the arch feature detection to run on the CPU. We cannot always read the PID from the HW (i.e even for AMBA devices), as the as the PID could be overridden by DT for broken devices. So, use the PID from AMBA layer if available. Cc: Mathieu Poirier Cc: Mike Leach Cc: liuqi115@huawei.com Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 228845f6fdd8..f4fbb65b4cc1 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -60,6 +60,7 @@ static u64 etm4_get_access_type(struct etmv4_config *config); static enum cpuhp_state hp_online; struct etm4_init_arg { + unsigned int pid; struct etmv4_drvdata *drvdata; struct csdev_access *csa; }; @@ -884,6 +885,8 @@ static void etm4_init_arch_data(void *info) etm4_os_unlock_csa(drvdata, csa); etm4_cs_unlock(drvdata, csa); + etm4_check_arch_features(drvdata, init_arg->pid); + /* find all capabilities of the tracing unit */ etmidr0 = etm4x_relaxed_read32(csa, TRCIDR0); @@ -1750,6 +1753,7 @@ static int etm4_probe(struct device *dev, void __iomem *base, u32 etm_pid) init_arg.drvdata = drvdata; init_arg.csa = &desc.access; + init_arg.pid = etm_pid; if (smp_call_function_single(drvdata->cpu, etm4_init_arch_data, &init_arg, 1)) @@ -1794,8 +1798,6 @@ static int etm4_probe(struct device *dev, void __iomem *base, u32 etm_pid) drvdata->boot_enable = true; } - etm4_check_arch_features(drvdata, etm_pid); - return 0; } -- 2.24.1