Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4481328rwd; Tue, 23 May 2023 08:15:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5VEKefJFbFyi4nYSOA9wOn6VHeJOQvAhXr755OxWnaFdpsvfzKVohUsIv+5CEcnKRwr1WE X-Received: by 2002:a05:6a00:2411:b0:646:c30d:e9c2 with SMTP id z17-20020a056a00241100b00646c30de9c2mr15689345pfh.28.1684854900014; Tue, 23 May 2023 08:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684854899; cv=none; d=google.com; s=arc-20160816; b=Jqt2/UZQmZQXu6GPmcoTW7Bt/y8Ryx8qq33ah49cxL9ueIMAsPSCQqva+wjh+0w9vK 3F8LxYuACyw4bbUzb55O2/8ZTqCslJLzTkI/Ape/n+pviBpHh7jGQsHqpxTCS3js0pjz kt0riOvVgIJQ8dXCTGJydrkkoTt0Mctn+fhh7VR4Gta+pT+Q39cqNTHIslEd8eBbzSYg 4UCjqIhkPpwqfjiPkqYxrYGMaG3FfAclBPN6ihD/GDhuESlW+vxv0d0Rha4p3tLBRv7V lNw+IpbJoW9k921ibEEqvNhfE3oLkugiVWbxsWWcvvhcRQ8Cd675kG3MC9AAb/X0vuEN nxtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:subject:user-agent:mime-version:date:message-id; bh=UduxPAzhRl4Q4mLt+XRtFU0sdTfQSfHvGChsDdt2YKI=; b=jE2RakqOdTdbC2Uet0TTnpIU5NSZ9ft4+pkD7Xx5XiaRkNkkKkUyCZCOucEZ83yp/w OjLddCRw/qE6TrAPnO184EApFjSx9wUA9xYihObokvHe6WGwjUSLNztntem2Lijo9tTV wMte9o8yFU4JgSrsEmSebi6x1uqL17bkLl6zfUOCbuOwwbOHZkxtUYjlz96SZnfkgSzp 1IFUw47Ao6q+W7LAX8dFqPIY5FffpHE6aH9zArNntSGvYolezZJ78y9OFRMD0EIvh5dc cRdK9mlD46c5fzhTDbmb3MMlbSB3+mkmHjgiWCw1UbZ8xGVsDrDBZMtWu8XkExDH5yfG w9wg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a63714f000000b0051f869d7089si1526133pgn.74.2023.05.23.08.14.46; Tue, 23 May 2023 08:14:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236530AbjEWOs6 (ORCPT + 99 others); Tue, 23 May 2023 10:48:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232287AbjEWOs5 (ORCPT ); Tue, 23 May 2023 10:48:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8CA7ACD; Tue, 23 May 2023 07:48:55 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EE5CF139F; Tue, 23 May 2023 07:49:39 -0700 (PDT) Received: from [10.57.73.71] (unknown [10.57.73.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CB453F840; Tue, 23 May 2023 07:48:52 -0700 (PDT) Message-ID: Date: Tue, 23 May 2023 15:48:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v4 02/11] coresight-tpda: Add DSB dataset support From: Suzuki K Poulose To: Tao Zhang , Mathieu Poirier , Alexander Shishkin , Konrad Dybcio , Mike Leach , Rob Herring , Krzysztof Kozlowski Cc: Jinlong Mao , Leo Yan , Greg Kroah-Hartman , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Tingwei Zhang , Yuanfang Zhang , Trilok Soni , Hao Zhang , linux-arm-msm@vger.kernel.org, andersson@kernel.org References: <1682586037-25973-1-git-send-email-quic_taozha@quicinc.com> <1682586037-25973-3-git-send-email-quic_taozha@quicinc.com> <444bc278-a3e3-7d99-6020-7c3337371f66@arm.com> In-Reply-To: <444bc278-a3e3-7d99-6020-7c3337371f66@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 On 23/05/2023 11:07, Suzuki K Poulose wrote: > On 27/04/2023 10:00, Tao Zhang wrote: >> Read the DSB element size from the device tree. Set the register >> bit that controls the DSB element size of the corresponding port. >> >> Signed-off-by: Tao Zhang >> --- >>   drivers/hwtracing/coresight/coresight-core.c |  1 + >>   drivers/hwtracing/coresight/coresight-tpda.c | 92 >> +++++++++++++++++++++++++--- >>   drivers/hwtracing/coresight/coresight-tpda.h |  4 ++ >>   drivers/hwtracing/coresight/coresight-tpdm.c |  2 +- >>   include/linux/coresight.h                    |  1 + >>   5 files changed, 90 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-core.c >> b/drivers/hwtracing/coresight/coresight-core.c >> index 2af416b..f1eacbb 100644 >> --- a/drivers/hwtracing/coresight/coresight-core.c >> +++ b/drivers/hwtracing/coresight/coresight-core.c >> @@ -1092,6 +1092,7 @@ static int coresight_validate_source(struct >> coresight_device *csdev, >>       if (subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_PROC && >>           subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_SOFTWARE && >> +        subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_TPDM && >>           subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_OTHERS) { >>           dev_err(&csdev->dev, "wrong device subtype in %s\n", function); >>           return -EINVAL; > > Please see the comment at the bottom. > >> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c >> b/drivers/hwtracing/coresight/coresight-tpda.c >> index 8d2b9d2..af9c72f 100644 >> --- a/drivers/hwtracing/coresight/coresight-tpda.c >> +++ b/drivers/hwtracing/coresight/coresight-tpda.c >> @@ -21,6 +21,56 @@ >>   DEFINE_CORESIGHT_DEVLIST(tpda_devs, "tpda"); >> +/* Search and read element data size from the TPDM node in >> + * the devicetree. Each input port of TPDA is connected to >> + * a TPDM. Different TPDM supports different types of dataset, >> + * and some may support more than one type of dataset. >> + * Parameter "inport" is used to pass in the input port number >> + * of TPDA, and it is set to 0 in the recursize call. >> + * Parameter "parent" is used to pass in the original call. >> + */ >> +static int tpda_set_element_size(struct tpda_drvdata *drvdata, >> +               struct coresight_device *csdev, int inport, bool parent) The name parent is a bit confusing. It could imply parent device ? That is kind of inverse ? because, parent = true, indicates the parent device of tpda, which is not true. Could we simply say bool match_inport => When true, the dest_port of the connection from the csdev must match the inport ? And ... >> +{ >> +    static int nr_inport; >> +    int i; >> +    static bool tpdm_found; >> +    struct coresight_device *in_csdev; >> + >> +    if (inport > (TPDA_MAX_INPORTS - 1)) >> +        return -EINVAL; >> + >> +    if (parent) { >> +        nr_inport = inport; >> +        tpdm_found = false; >> +    } >> + >> +    for (i = 0; i < csdev->pdata->nr_inconns; i++) { >> +        in_csdev = csdev->pdata->in_conns[i]->src_dev; >> +        if (!in_csdev) >> +            break; >> + >> +        if (parent) >> +            if (csdev->pdata->in_conns[i]->dest_port != inport) >> +                continue; The above can become : if (match_inport && csdev->pdata->in_conns[i]->dest_port != inport) continue; Suzuki