From patchwork Tue Aug 9 22:33:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 12940035 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 17A4BC19F2D for ; Tue, 9 Aug 2022 22:35:33 +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=pQpRzGKEreLwwB9YrFekkzc1YJZru9UaelkDyhvS/4E=; b=HQj0oKQXUv2IRq 2ggJUTgQwitnpNZloSSODhQd4jIjEbCawLGEwv93WTvzeieRthfmSq62biMYyy/VHk/oQhsS2X7fa KLLBLn1XcLm92XpbJrBaZNWLA4gms2Nmw5zG+3jXkKFVNFc5cqKTaSvfVk4ZGaOcq/xEh4KbFEMJ7 OW/4M9PElaM+V49PPTCml2N3T+e8ZLxKk5eie5mCHT+Qeg6dqxcBydX0jdHMpzE81LQszuFXXVCSA m5XDqunHpQL+ZcgRhtIKSuEF4c0S2p4Rue4MMNc41WWSZHwJ9RgBJvj9+2JQZnLQSXhV7RyaYcOwf SRo5/HiBBmGKzueyywww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oLXnw-0073fS-Tc; Tue, 09 Aug 2022 22:34:29 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oLXne-0073Uv-VU for linux-arm-kernel@lists.infradead.org; Tue, 09 Aug 2022 22:34:13 +0000 Received: by mail-wr1-x433.google.com with SMTP id p10so15797139wru.8 for ; Tue, 09 Aug 2022 15:34:09 -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=DeGX8nF0J+NtV1pTcJJ/EmsZLaXqQa78Qzzsccc5Pfw=; b=H0HlXUkQpJdgEYtpWV+ElfAYT1ZXsr67OzrljzDFFkh7XjjzdFcdZVXOoZO5FSj5P5 XSrufCh4fp6w92iH+t48NsG4qRZQgc+duWUXXlYKeKaG6z4WB1w7aVMFgYb/sIXayTmD 7eciqpczvMuWJPr5P/v2GVzCwnEWQSAiT6XknQ42YqThpS3X0/T8Oi8+4ant1QxwnXYO HcGiSvJKtPsKT04+O3m/GFuwzjL159B79YAE8dni5VrjXG47loS3OP6oWtRfBIJeCESt nUvkJRDkPOTsv4KHAObGI5BzaqwDJv57x7n13dAypXwO2agsJMUS2zhLSEYEey7MoPIF BScA== 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=DeGX8nF0J+NtV1pTcJJ/EmsZLaXqQa78Qzzsccc5Pfw=; b=ZiY6Z2iqEqqvr0ybY2QtrlB7OhhbqFqAR+aPll6bBzkX1Yxxkdv9z+xt9q5XTEfNsi GuUsZ6cjiKJDLJvRQCZILZ1fUAEFFdz7pJYTM26Osss/I37KaGCqeuR8BGFUfzZzbJMK 8kwFfCRTO3td85yNoEstnHxtM0D4n7gewtovv7Z4yLm+m5WVPiEbkVhRgXmC/v2bvy6P WLBvoNG5sZXCqNRRe0uTh4NyEH7unOFuckDsaWArd9Mh0S9OixwKDrI85eXDiu8/7l5p KU0dqSxsdUp6HPMYRUJa8yxiS45V68bUuutv7aNgmfD3o7DR11wbSY0HJmSGkKGrzhgn HbVw== X-Gm-Message-State: ACgBeo3OhXHKnf36Ulx/OEazADygZLnoyMIW9n3eHPVcKL8lz1ZPWyqz wI37zvIz9jD3ctlLa7D5+ghouQ== X-Google-Smtp-Source: AA6agR7B4EKPKod5fL4m/2YtVvmqVRZa4owY4+pLORhXmW9cJEfbHZxi6mLHNZ/imEtuPsUJXBYKEQ== X-Received: by 2002:a5d:6d46:0:b0:21f:8b7:4c1d with SMTP id k6-20020a5d6d46000000b0021f08b74c1dmr15567158wri.455.1660084448295; Tue, 09 Aug 2022 15:34:08 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:a6:74a6:5a0e:f3e2]) by smtp.gmail.com with ESMTPSA id e20-20020a05600c4b9400b003a2cf1ba9e2sm311650wmp.6.2022.08.09.15.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 15:34:07 -0700 (PDT) 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 v3 02/13] coresight: Remove obsolete Trace ID unniqueness checks Date: Tue, 9 Aug 2022 23:33:50 +0100 Message-Id: <20220809223401.24599-3-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220809223401.24599-1-mike.leach@linaro.org> References: <20220809223401.24599-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220809_153411_037392_47CBAE61 X-CRM114-Status: GOOD ( 14.75 ) 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 c7b7c518a0a3..cde1b4704727 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -85,45 +85,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) { @@ -432,12 +393,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);