Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp1374528imk; Mon, 4 Jul 2022 01:35:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vtRAlkVHBCERhIbhb6Lqp8a0BNLxrplEBEHNKpXXImn63Iv7JMx+ZNg0MzDpqsVvTnWjd0 X-Received: by 2002:a17:906:7a58:b0:724:c5f7:21e9 with SMTP id i24-20020a1709067a5800b00724c5f721e9mr26888480ejo.90.1656923724226; Mon, 04 Jul 2022 01:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656923724; cv=none; d=google.com; s=arc-20160816; b=0Pc1EDF9OcU31cZ0wy19ZOvzp4urnNQDyKjy7DEKTp/rqufKaETuPirVprSy5uoi9D BUAuKk30KwTWnFOmEsu/W+z8gb5z8BW5ExITj/iYpJR7p0oEeH3p6ABwo2Ka673yjrsT ZSjNiaefqlg0dYrfNxskhtWvbvImzoMrHCnADjqkWHRNmNRtHyNrv8iD9Hjm7m4S1+Hp ssCP9LZEfOSIGjhFmZnuJIhqa7A4zbHOysCQbq1F4g1PpBOaZzmSnqFrLMwT1KhNsZBS PUlxDIxvE1gTHe5efNjoPP7PCeTvDZAlPD9mLYiYciZdXczTK/NApmMhtpC6zzsAkvRL erZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=s0X3OXDZ+bM8Kln7AQPu4r8yIcFwpLnAHC12SH0eaqM=; b=uRHoc8vgGCLxR7utygatGb6O871S2JX53M3WWI+DFriXbcKKNbwPrzp6eaCbNeWiop +8/AeyvayxU9hZTiWiQFpp8Cs8V6ISd5QSw/TgUEtk7FcSp0A9zGLFdYO8aNM/Vn8GiF aFFAWfsVkC0bqKQnLbSJOi4aUSJfws3Vk49esJxpHcZYdnkV0wwiXZBeSCiR5nb1FP/3 1lbkk+YdaKj3P8txJychjCQxOZloEGP/jmdQcai2bmX2x9t4Q3bzfWcYXd/MUqkma2UI 4S6bXJ/mZ8+NRcfVIziMi62bbUm3kVVQCqA3RcPMuznfo8Wq42prqzIOvH+etrFGF+I1 ukwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cQBoIeUc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn19-20020a17090794d300b00715702f1e9esi7031541ejc.799.2022.07.04.01.34.56; Mon, 04 Jul 2022 01:35:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cQBoIeUc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233508AbiGDIMW (ORCPT + 99 others); Mon, 4 Jul 2022 04:12:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233122AbiGDIMA (ORCPT ); Mon, 4 Jul 2022 04:12:00 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13B8FAE51 for ; Mon, 4 Jul 2022 01:11:59 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id z12so2665595wrq.7 for ; Mon, 04 Jul 2022 01:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=s0X3OXDZ+bM8Kln7AQPu4r8yIcFwpLnAHC12SH0eaqM=; b=cQBoIeUcOlaE5MUPaV6tsoq5qOk1bRxeAte8eRBQfzXqDN+CvvTqVjYZ/oujx8eOfU c/aU1+iG3PXV7v5HLbi/vmjOuyiGX4UG/iKChrwttjkcvfYrlcLTLDDAuE8+WoDqtsNQ vI6PDB+Jn9rxkOO0K3rclzzb5E+Mi3+FHFcvIhHfOitpa0Acg2h0jtCE4JUxQ65moQmc jKx6HUNHf7IkcUQ4/pR9+XaHXx0/l0j8WBxZmdfzKAX6YgW5X1zkftZXfLspmVm7Mnd/ j9X3n5fOvDa54Cnafw+AkDXGySZpgzCePj2QyGVgjx/xrsZ9a4uo7PbKPwYEdKoxF1Wa PJqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s0X3OXDZ+bM8Kln7AQPu4r8yIcFwpLnAHC12SH0eaqM=; b=qk4CWszY+nAzOz9cROaE+8Ej5ns4oBHSh2Ty89G+Lywwxdct4dcxcTmU4i8s6B9LP6 L8AMjd++o17GHrErUMWPyOVogwIJFlq+2uCJx6ivl/yV7xFxPuu055A8ezUYtjbHLIHX +sv1fA36Qz3icaeKfGtOVlxyMCjZSd3kFvQ4yqlfU2KgXFF3adY3NF0nFyyDZsPosMUd sfaWUJXyfSFOJh9ON5VXq8QAyWwlhksCh8gUbwLnTdeeyIizKl3t32D+xHMDaNsV/T8v U7I1p7363zbpfylBiT/j0YzHTI7oEhr2ya5BBjOeTgIMnz3ecGW5ldEqLJVU89NfenB8 Nd9A== X-Gm-Message-State: AJIora9y4pi9VGK3mkIMMp1cLl9BBTRkeRSocax/8cfcSwTtNrQqrheT /LpEbwVC6KCJWdxDnV9FgNs+pw== X-Received: by 2002:a05:6000:1889:b0:21d:28e8:b6a with SMTP id a9-20020a056000188900b0021d28e80b6amr24864840wri.14.1656922317684; Mon, 04 Jul 2022 01:11:57 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:c4c4:4ed1:ae43:27f2]) by smtp.gmail.com with ESMTPSA id u3-20020adfdd43000000b0021d650e4df4sm4388276wrm.87.2022.07.04.01.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 01:11:57 -0700 (PDT) From: Mike Leach To: suzuki.poulose@arm.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: mathieu.poirier@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-perf-users@vger.kernel.org, leo.yan@linaro.org, quic_jinlmao@quicinc.com, Mike Leach Subject: [PATCH v2 06/13] coresight: etmX.X: stm: Remove unused legacy source Trace ID ops Date: Mon, 4 Jul 2022 09:11:42 +0100 Message-Id: <20220704081149.16797-7-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220704081149.16797-1-mike.leach@linaro.org> References: <20220704081149.16797-1-mike.leach@linaro.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CoreSight sources provide a callback (.trace_id) in the standard source ops which returns the ID to the core code. This was used to check that sources all had a unique Trace ID. Uniqueness is now gauranteed by the Trace ID allocation system, and the check code has been removed from the core. This patch removes the unneeded and unused .trace_id source ops from the ops structure and implementations in etm3x, etm4x and stm. Signed-off-by: Mike Leach --- drivers/hwtracing/coresight/coresight-etm.h | 1 - .../coresight/coresight-etm3x-core.c | 37 ------------------- .../coresight/coresight-etm4x-core.c | 8 ---- drivers/hwtracing/coresight/coresight-stm.c | 8 ---- include/linux/coresight.h | 3 -- 5 files changed, 57 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm.h b/drivers/hwtracing/coresight/coresight-etm.h index 3667428d38b6..9a0d08b092ae 100644 --- a/drivers/hwtracing/coresight/coresight-etm.h +++ b/drivers/hwtracing/coresight/coresight-etm.h @@ -283,7 +283,6 @@ static inline unsigned int etm_readl(struct etm_drvdata *drvdata, u32 off) } extern const struct attribute_group *coresight_etm_groups[]; -int etm_get_trace_id(struct etm_drvdata *drvdata); void etm_set_default(struct etm_config *config); void etm_config_trace_mode(struct etm_config *config); struct etm_config *get_etm_config(struct etm_drvdata *drvdata); diff --git a/drivers/hwtracing/coresight/coresight-etm3x-core.c b/drivers/hwtracing/coresight/coresight-etm3x-core.c index 273f37be322b..911d961dd736 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm3x-core.c @@ -455,42 +455,6 @@ static int etm_cpu_id(struct coresight_device *csdev) return drvdata->cpu; } -int etm_get_trace_id(struct etm_drvdata *drvdata) -{ - unsigned long flags; - int trace_id = -1; - struct device *etm_dev; - - if (!drvdata) - goto out; - - etm_dev = drvdata->csdev->dev.parent; - if (!local_read(&drvdata->mode)) - return drvdata->traceid; - - pm_runtime_get_sync(etm_dev); - - spin_lock_irqsave(&drvdata->spinlock, flags); - - CS_UNLOCK(drvdata->base); - trace_id = (etm_readl(drvdata, ETMTRACEIDR) & ETM_TRACEID_MASK); - CS_LOCK(drvdata->base); - - spin_unlock_irqrestore(&drvdata->spinlock, flags); - pm_runtime_put(etm_dev); - -out: - return trace_id; - -} - -static int etm_trace_id(struct coresight_device *csdev) -{ - struct etm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - - return etm_get_trace_id(drvdata); -} - int etm_read_alloc_trace_id(struct etm_drvdata *drvdata) { int trace_id; @@ -731,7 +695,6 @@ static void etm_disable(struct coresight_device *csdev, static const struct coresight_ops_source etm_source_ops = { .cpu_id = etm_cpu_id, - .trace_id = etm_trace_id, .enable = etm_enable, .disable = etm_disable, }; diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 3f4f7ddd14ec..b7c7980cc71c 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -228,13 +228,6 @@ static int etm4_cpu_id(struct coresight_device *csdev) return drvdata->cpu; } -static int etm4_trace_id(struct coresight_device *csdev) -{ - struct etmv4_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - - return drvdata->trcid; -} - int etm4_read_alloc_trace_id(struct etmv4_drvdata *drvdata) { int trace_id; @@ -998,7 +991,6 @@ static void etm4_disable(struct coresight_device *csdev, static const struct coresight_ops_source etm4_source_ops = { .cpu_id = etm4_cpu_id, - .trace_id = etm4_trace_id, .enable = etm4_enable, .disable = etm4_disable, }; diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index 9ef3e923a930..f4b4232614b0 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -281,15 +281,7 @@ static void stm_disable(struct coresight_device *csdev, } } -static int stm_trace_id(struct coresight_device *csdev) -{ - struct stm_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - - return drvdata->traceid; -} - static const struct coresight_ops_source stm_source_ops = { - .trace_id = stm_trace_id, .enable = stm_enable, .disable = stm_disable, }; diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 9f445f09fcfe..247147c11231 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -314,14 +314,11 @@ struct coresight_ops_link { * Operations available for sources. * @cpu_id: returns the value of the CPU number this component * is associated to. - * @trace_id: returns the value of the component's trace ID as known - * to the HW. * @enable: enables tracing for a source. * @disable: disables tracing for a source. */ struct coresight_ops_source { int (*cpu_id)(struct coresight_device *csdev); - int (*trace_id)(struct coresight_device *csdev); int (*enable)(struct coresight_device *csdev, struct perf_event *event, u32 mode); void (*disable)(struct coresight_device *csdev, -- 2.17.1