From patchwork Tue Nov 1 16:30:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 13027200 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 3C6CDC433FE for ; Tue, 1 Nov 2022 16:32:44 +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=ZiWpwTRKQj63lNvGhb/EtSTVVaJ0oBS15Wjjw/oBtG4=; b=BO53OM+8u1ggrR NxC28X8FUjoe5J7qIOlbOPXI4RfNXt28A4wOTTo/blupMTRKZ5zdxWVaUQ9Eu29E2HUfs/nfsPhtw M4ojY2huyfe6I4HmPfPrzAAbFLMV/mv2ZyNQ9FRQ5XvOu7M1f4LROmD4teQzEp0ncYxDE7hHk/rRr ivSfirN1a0asvD7iBVTnb/xh3lWnQP12JYpZA1vWayuO+RstPYzEwkdT09I6yKan0qvP8dZD2ubHp raIbJz9jkuYrMZ5Q8SaixhYyyhvxbZBfhnqgDSEsP86ASe+tHa5/ZvevSyTdtc0C8JyyqnbIsR/zt +wNFRkcyP5aJqUdoZ+nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opuAu-005ztI-8J; Tue, 01 Nov 2022 16:31:40 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opuAf-005zk1-RL for linux-arm-kernel@lists.infradead.org; Tue, 01 Nov 2022 16:31:28 +0000 Received: by mail-wr1-x429.google.com with SMTP id l14so20910810wrw.2 for ; Tue, 01 Nov 2022 09:31:24 -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:subject:date:message-id:reply-to; bh=5MdleZXvt+JyHILxZIr8nt6Rc30u8pB2zD6TyZEOZ4E=; b=N0OHoOCfoadYHDve9A10mdduXwDqxckCMBXiPMJkrQLef+eysdKmGp4/vghZIe6ts5 RlaYTAUndyvkgq6ziXZryvLpbUbZE0lyW/8Gj8n1sLV2ZKKVpSbFlR464jusNnUk+qsP U6Ig1UJvGX74Eq/KxUFdJO48PqCtqAGHkH7oQU9+5ocuFdkxGVTgWndwIS4fvh60r0vC mMQ7nFtRlksH0XF5JDnRlPJesa5boH7ytuNNYo7ugu4Qq7GIUjp/zAB48IU0B6G+VCIw yv5W6gOPpJKVMlBfo+uaBR5KA3j71cIO47kulqokHpqSqrA07kMTrDkOgb+cwcZPGDql SEAQ== 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=5MdleZXvt+JyHILxZIr8nt6Rc30u8pB2zD6TyZEOZ4E=; b=ubDP4um+Kz5wCuFl97jfFvoTmOtQaT9U5ELgLxn/OEiFGf0jCb4Z/FDsWVkZYFD6Df HmJzTR5o1dxXI76JIumP4Eup/1DKRVbxtORo88nnktZt9w7epZSRp5vvfzFe5pv/c8aQ 7eyQcCHr3yj9GwrovvPvaqd8d7dltF2Xj0GeZ8SYYMiW7b61JvRjs1yE5UZio/q/ey2w Zbtpx3NAPQJcVFWPdauekL2BsVABByGd9agb3x+Mec6fuF5RunZHwidkNSlOa+txa/LZ QOdC8Ls+VD9xw/9iYzjSYfA+AWDnt5vKbfm/D/vlFzz1VnlfspT9aVnyHi9Dhp+EW+xV IdnQ== X-Gm-Message-State: ACrzQf3yr9KeOw4owRznohN+NGqcADudBYxfUS5H/dwqVrTKqwl21b3w 0zL6pAJWaJUrANiOBszIJBMn4g== X-Google-Smtp-Source: AMsMyM6rZBY+SRuvU6afB3H/N607It4scVT7TDau8qicMc11AO4dH+gwLsmVyLpvWDm+RkYOsw0I/g== X-Received: by 2002:adf:f4c7:0:b0:236:c415:c707 with SMTP id h7-20020adff4c7000000b00236c415c707mr8974540wrp.24.1667320283203; Tue, 01 Nov 2022 09:31:23 -0700 (PDT) Received: from linaro.org ([2a00:23c5:6809:2201:e844:18b6:fc5:bbc9]) by smtp.gmail.com with ESMTPSA id bu15-20020a056000078f00b0022ac1be009esm8339844wrb.16.2022.11.01.09.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 09:31:22 -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 v5 02/14] coresight: Remove obsolete Trace ID unniqueness checks Date: Tue, 1 Nov 2022 16:30:51 +0000 Message-Id: <20221101163103.17921-3-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221101163103.17921-1-mike.leach@linaro.org> References: <20221101163103.17921-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221101_093125_932701_D1088B06 X-CRM114-Status: GOOD ( 13.71 ) 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 554a18039e10..45828564f0c8 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -113,45 +113,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) { @@ -460,12 +421,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);