From patchwork Tue Aug 23 09:09: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: 12951894 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 64618C32772 for ; Tue, 23 Aug 2022 09:12:14 +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=H0jft/0M1cBnOv CFP8AQ1pfd2w/v3edsstnxsnLNpfEoYgf1AutGBtIRd9hH+9K2mjctpUyRGke8Ds0TAlpaS93WUHC s+Jw8RsK5MrW0V4S8LK/sqTebutoL7cr70TlViYGeh7VK3g2sKCMuBdaJ+Rpno0LjrcfZxqTJnhfg c72uQOg7nHPfjA3SLrl8MBuqsWBTHa9Ldcmo4iW+KocbnVSmu1xFSEbdVrRctjQr/a81W+ALW/2Ls MIRYm/A/KkNXOkL0bMPzGe4ckPPQeB7pzv7dGIMlhdJvNgSvbSHj9YEojg60Q4m7oiGlpeYp0y+i0 kJFr9mEk1OgL74BamVyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQPw6-004Kcg-D0; Tue, 23 Aug 2022 09:11:02 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQPvO-004KKd-CM for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2022 09:10:21 +0000 Received: by mail-wm1-x330.google.com with SMTP id j26so6872312wms.0 for ; Tue, 23 Aug 2022 02:10:16 -0700 (PDT) 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; bh=DeGX8nF0J+NtV1pTcJJ/EmsZLaXqQa78Qzzsccc5Pfw=; b=TkCnT5TT/j1+VD+ja7Ce6+jps9TFVDUcjUPFgi3QD5qNTd4UtGD7kx5dQMNalf8H7Z HcKh9q8cerh1KGRJEUIugPs3/+rnZXiJPfFPiaEBqoGYUfGZWtd3q1D/Sa1Urr7coyXn 7ptKIPuQMAqPxfH6dNNWaFvFmOXj6SmqxlsVZv9vOBZ8nSiZVGlRxitu8k1wfbbd7Cc9 pbcOl4PyxZxLfCxj858Zf2bO5hPE5yHul438XbuiqQ6ue+mGGVEUmEnm9PrKuo5jM1h6 Iz193k+0UpI4TRCP29J5JEUS5yUN0LIfpJvF1kCmgaMnVNvjYQ0/GZMvsOLj1DUypnqQ XOrw== 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; bh=DeGX8nF0J+NtV1pTcJJ/EmsZLaXqQa78Qzzsccc5Pfw=; b=tuqONaRt6Dd41lPJpv+yJqtlvd/8ggA4ZHTybGZbp13FkUjaf0F3jzZfs7Xs2EP3VW 98WmYExhQH/OZtNjTFkeHYDBSpANTQTo1V73ZicgpZ5B2SEOiIDyZmQb0Y7MGvrAZXWC iv9rJM1rdil5F4d/t/LK7ZeeYZcP9Uveq2yMxmbxfgD5sLCIjJTPqaMuxunkHklFhjSu eVapCeYhD5lV6tdvKMdhK2CZgaEVYddzCKRxmk3hDsTieztklQzc5+143gnMTD+Njx0I KmsZ4/RhdDjjiYFnJE0mWz3FkPZDhutavSfQDZW+TSyB4eOmzQybXoK9zD35bx2e/mSY 5a5w== X-Gm-Message-State: ACgBeo017mCXhmfO8EUgoGysdFkhcVzJIOjHNzhDljcChB0dHV/GYm2H rt2ZyrSmqfYFZnKBSOpeywUvMA== X-Google-Smtp-Source: AA6agR6Y5XJoqHuf1SW5JDiawMpiIHPzX/sjuPfTe/y8hUpqflUeXG2hO8snD1W2tHdoOOM7kcbiLg== X-Received: by 2002:a05:600c:3b9f:b0:3a5:45d9:8a69 with SMTP id n31-20020a05600c3b9f00b003a545d98a69mr1506230wms.186.1661245815809; Tue, 23 Aug 2022 02:10:15 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:4553:cf11:6cff:b293]) by smtp.gmail.com with ESMTPSA id w6-20020adfde86000000b002253d162491sm10760721wrl.52.2022.08.23.02.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 02:10:15 -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 v4 02/13] coresight: Remove obsolete Trace ID unniqueness checks Date: Tue, 23 Aug 2022 10:09:58 +0100 Message-Id: <20220823091009.14121-3-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220823091009.14121-1-mike.leach@linaro.org> References: <20220823091009.14121-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220823_021018_496233_724DE0A2 X-CRM114-Status: GOOD ( 13.60 ) 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 --- 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);