From patchwork Wed Nov 23 19:49:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 13054263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A279C4332F for ; Wed, 23 Nov 2022 20:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=//CfDqfBRTbviw4L12KAf1oS5fMNw3bQ2Vy1NZ1wn6c=; b=mbVGOfhLW7QEIx l4CIC86cEBmahxgheMHw9lJ6aCY4Q3dR9ZhPUF4ZyUEk7oStXyPqVx4UvwG2rfKg3yiQpxnpr2UDV cTbvyRouAVahaPyQc5h90Z1e4vcPCtJTQQtJoQZiGpNXb/RycDygCdYSCiV628eZYwAtmyf97dibY ylW0aVYYI6EpoJyRff2x2OACHNvbCR6+Zho7nAoTBrmeaSUBzhmeyiv+1wBBYSBoluwR+sBjdOZQq WSGDeVVrpl/MfCbW0eaoJHoKAqkOqaRP7XpbAaxawou25IFBiPKNqBj3bA2+lv32iPJZbzFslt9Sa zdfCTRQc1PMbHcDxH4lA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxwMt-002H4G-Pc; Wed, 23 Nov 2022 20:29:16 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxwKj-002FuA-Ob for linux-arm-kernel@bombadil.infradead.org; Wed, 23 Nov 2022 20:27:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PCemn0i95mwoh/MU/VK1Wd9F6OgWQRZUEuH/awNPIM8=; b=eFRz99Arr+Qtw5NeQN+u1l8C40 wi+nAO5+f5k3ss0u06qFVuBaulagaLBYt+uckwOKWZGiR4PuUJquIzyfbuRrkDjYJEodNekasrJfG O6JtCiAzp6Ry5EinZjfihZLYayubBWhT9/b57t0kaeqnPAjF6nTrHoKWDYlB8iL30Dg5Byil2OPSY OHi/q3+3MU2Z51O4HWPFXb3ARr+basXez5RaluRYZ7bgbY/CtAD9GoFqButRoCDbNL/UvOlSp7U2t MQtypdknLJudH3L7atrrcFdjTh86JAOrRq8U5cpZElv6fre0Y9zfIefvdsAr3jeFKXjBoO+LVf3es jO0nAZtw==; Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxvlI-003uma-VT for linux-arm-kernel@lists.infradead.org; Wed, 23 Nov 2022 19:50:27 +0000 Received: by mail-wr1-x42b.google.com with SMTP id i12so27159655wrb.0 for ; Wed, 23 Nov 2022 11:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=PCemn0i95mwoh/MU/VK1Wd9F6OgWQRZUEuH/awNPIM8=; b=z218x5Q/M0KY3qzQjZ577viE1gZ3bAfoy6NYn4+j6+8OpNLrY8knQqojg2+3XwSHzZ icsi5lw4DkpkIPl3CtoPL7b+PG2gYUWUBwoK179GdLQ0HNkEq/fOKpapRca+exFZZ6JZ cuqciA8aWKjlWbkCUUXzOJn0LkCitykQ0f/BDEiIPoidhisHE/C+O626GoBso6sVbtV0 mVuUbGP/5nqB6Nb6ArObEcCHtvIVhVzPAoo0hm3lWsHDdlDeevMlhdM8DOFKR9C6afQy /P712JroPFpdZE4kvQwuAmo3N/kS41ZAhuxVKdC2MXXpKG9UaZ4X3dlk85AGz5/ppqIX zUqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PCemn0i95mwoh/MU/VK1Wd9F6OgWQRZUEuH/awNPIM8=; b=7V7VEMNfaXBRwkG9AmdcnG/cgwCz4jPHD3q7LOqclTlZrE2lLI4P1as06JBYvSsYtA GK88s4Ey4EPB8ucVM2P/loAaNTULAvxAsDxK4NtyBBt+wRd2WdlwONAZaktdDWJbrNhq vz6iK/aA8PyrHh/N6GrR5u0oVu7vmkJu9QpWRj2RsBN5hq11r6rNoR7xUWjnvAYzbzFc PFxu2zVdiDbdCDCWfMMogvLwTTt+VOPYkxh+zZ3kuZ+Bz2jvLQ6g091vjtk+Sakv9MmR eX0raFRm47OaT/dDazTJFpsSS3eB8YGihLgDJX5eupbjUA7btkxMYgEMC/Gr+0YlcfcS SNcA== X-Gm-Message-State: ANoB5pk80dqLNEXcQv8xXz0vksFSPtgnk+YZtfwbnxx5neH1I3NHI3PD djyAxKcsaWhGEtVD7Q3ronyLrg== X-Google-Smtp-Source: AA0mqf54X/O6AocXr0g+3elhIcOrpuwp4viSFFefXweQE2Lq6dzCpZcO2F6C9p34Ri1y3O2WMYFVcA== X-Received: by 2002:adf:e687:0:b0:241:c3c6:cf78 with SMTP id r7-20020adfe687000000b00241c3c6cf78mr14949792wrm.237.1669233022875; Wed, 23 Nov 2022 11:50:22 -0800 (PST) Received: from linaro.org ([2a00:23c5:6809:2201:fcbc:7b5d:8d6c:43a4]) by smtp.gmail.com with ESMTPSA id w5-20020a5d6805000000b002364c77bcacsm7267414wru.38.2022.11.23.11.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 11:50:22 -0800 (PST) From: Mike Leach To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: mathieu.poirier@linaro.org, suzuki.poulose@arm.com, 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 v6 02/14] coresight: Remove obsolete Trace ID unniqueness checks Date: Wed, 23 Nov 2022 19:49:58 +0000 Message-Id: <20221123195010.6859-3-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221123195010.6859-1-mike.leach@linaro.org> References: <20221123195010.6859-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221123_195025_427685_7FA5C104 X-CRM114-Status: GOOD ( 13.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The checks for sources to have unique IDs has been removed - this is now guaranteed by the ID allocation mechanisms, and inappropriate where multiple ID maps are in use in larger systems Signed-off-by: Mike Leach Reviewed-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-core.c | 45 -------------------- 1 file changed, 45 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index f3068175ca9d..ce3aa845ecc2 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -112,45 +112,6 @@ struct coresight_device *coresight_get_percpu_sink(int cpu) } EXPORT_SYMBOL_GPL(coresight_get_percpu_sink); -static int coresight_id_match(struct device *dev, void *data) -{ - int trace_id, i_trace_id; - struct coresight_device *csdev, *i_csdev; - - csdev = data; - i_csdev = to_coresight_device(dev); - - /* - * No need to care about oneself and components that are not - * sources or not enabled - */ - if (i_csdev == csdev || !i_csdev->enable || - i_csdev->type != CORESIGHT_DEV_TYPE_SOURCE) - return 0; - - /* Get the source ID for both components */ - trace_id = source_ops(csdev)->trace_id(csdev); - i_trace_id = source_ops(i_csdev)->trace_id(i_csdev); - - /* All you need is one */ - if (trace_id == i_trace_id) - return 1; - - return 0; -} - -static int coresight_source_is_unique(struct coresight_device *csdev) -{ - int trace_id = source_ops(csdev)->trace_id(csdev); - - /* this shouldn't happen */ - if (trace_id < 0) - return 0; - - return !bus_for_each_dev(&coresight_bustype, NULL, - csdev, coresight_id_match); -} - static int coresight_find_link_inport(struct coresight_device *csdev, struct coresight_device *parent) { @@ -459,12 +420,6 @@ static int coresight_enable_source(struct coresight_device *csdev, u32 mode) { int ret; - if (!coresight_source_is_unique(csdev)) { - dev_warn(&csdev->dev, "traceID %d not unique\n", - source_ops(csdev)->trace_id(csdev)); - return -EINVAL; - } - if (!csdev->enable) { if (source_ops(csdev)->enable) { ret = coresight_control_assoc_ectdev(csdev, true);