Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5766649ioo; Wed, 1 Jun 2022 12:07:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIhZp5C3ClHqhdZu5oC+y8CUFQWl5E9PRPHFy39MJ73+K5TyucxkKoT9GyXn2RyBucz4du X-Received: by 2002:a17:903:40ce:b0:164:248:1464 with SMTP id t14-20020a17090340ce00b0016402481464mr928459pld.16.1654110446070; Wed, 01 Jun 2022 12:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654110446; cv=none; d=google.com; s=arc-20160816; b=h7a7k1zUr4p5wNzlNSXKZ10xm+7A4zcEBfb0cBcQDsXkVft2R8bM8vmXhf4FPef5p1 xmvDnzQf2TRHsFxZFcnosTwZB7kiHiA9GpaUdsZBMooriLBkKlTRHNgiwRBDZddkMaHP pXDKk7k6s+1dnT+Qff0+mLKM3TPCj5cLaXChhsYT+RLIknuC8a3k8CY6roGJ1aU4ZFth 66tcAGOxChjXyfzN2WqsNWl9nQUGZ81YEK3GNzm4iWI3eLkSH7cSJ0lSVD8xzwXWOxGy Rofgs//sKXpKY3YvaBiP01dzGRL1JsQEWgca1y9o68SNpgjAHcTuEjYjHBeQ7rqFm6bS CUpA== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=JzwU+Petv3opj20PMMylWlYsRNNK+sGYjjlrG4Vllr4=; b=Ze43j2k8bN7WTUVjQAxbm3YpNI5DlREWiXMUZxozxca6QkxM1X4AlCWD6d5t+WEgK/ 8gTxiU8y89N8L3Feidphf3rfLvwpytUEZ7kk9OUCb520g+OOr7KlXZZFMKwnduTg+6jJ BQdYY79p36iBJ7FD1zl5XUq7pVnJIu+zXXIfXdwxKWXxopX18jz/qH5os0e2qggLQsmx bZGeKTonYpMyY1KBviZtiaR1AFdg+wgVpWjGcpaxHASti7JPs0+Y382FyAOm09RiP2qW +uSA2XoPqsvP9mawkv4tAnU+0Iw02HpFGyHSEV28an4YRjuU306GzmUqjlZUrrmjaqCS 52tQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id nr12-20020a17090b240c00b001e289e03da5si2749969pjb.25.2022.06.01.12.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:07:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E7B01116E9; Wed, 1 Jun 2022 11:48:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351066AbiFAJbG (ORCPT + 99 others); Wed, 1 Jun 2022 05:31:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351056AbiFAJbA (ORCPT ); Wed, 1 Jun 2022 05:31:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3890B87201; Wed, 1 Jun 2022 02:30:59 -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 A601323A; Wed, 1 Jun 2022 02:30:58 -0700 (PDT) Received: from [10.57.38.89] (unknown [10.57.38.89]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A7803F66F; Wed, 1 Jun 2022 02:30:56 -0700 (PDT) Message-ID: <006b7edd-20d2-3165-7c83-352b7fb312e7@arm.com> Date: Wed, 1 Jun 2022 10:30:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v7 02/10] Coresight: Add coresight TPDM source driver To: Jinlong Mao , Mathieu Poirier , Alexander Shishkin , Konrad Dybcio , Mike Leach Cc: Greg Kroah-Hartman , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tingwei Zhang , Yuanfang Zhang , Tao Zhang , Trilok Soni , Hao Zhang , linux-arm-msm@vger.kernel.org, Bjorn Andersson References: <20220509133947.20987-1-quic_jinlmao@quicinc.com> <20220509133947.20987-3-quic_jinlmao@quicinc.com> <38bb1ec9-56bc-0cdf-6c46-d448a46ec886@arm.com> <7d6b2e24-21f4-eef1-a722-23cdcd1d8a88@quicinc.com> From: Suzuki K Poulose In-Reply-To: <7d6b2e24-21f4-eef1-a722-23cdcd1d8a88@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 01/06/2022 10:21, Jinlong Mao wrote: > Hi Suzuki, > > On 5/24/2022 3:00 PM, Jinlong Mao wrote: >> Hi Suzuki, >> >> Thank you for the review. >> >> On 5/23/2022 4:57 PM, Suzuki K Poulose wrote: >>> Hi >>> >>> On 09/05/2022 14:39, Mao Jinlong wrote: >>>> Add driver to support Coresight device TPDM (Trace, Profiling and >>>> Diagnostics Monitor). TPDM is a monitor to collect data from >>>> different datasets. This change is to add probe/enable/disable >>>> functions for tpdm source. >>>> >>>> Signed-off-by: Tao Zhang >>>> Signed-off-by: Mao Jinlong >>>> --- >>>>   drivers/hwtracing/coresight/Kconfig          |  13 ++ >>>>   drivers/hwtracing/coresight/Makefile         |   1 + >>>>   drivers/hwtracing/coresight/coresight-core.c |   5 +- >>>>   drivers/hwtracing/coresight/coresight-tpdm.c | 146 >>>> +++++++++++++++++++ >>>>   drivers/hwtracing/coresight/coresight-tpdm.h |  26 ++++ >>>>   include/linux/coresight.h                    |   1 + >>>>   6 files changed, 191 insertions(+), 1 deletion(-) >>>>   create mode 100644 drivers/hwtracing/coresight/coresight-tpdm.c >>>>   create mode 100644 drivers/hwtracing/coresight/coresight-tpdm.h >>>> > >>>> +/** >>>> + * struct tpdm_drvdata - specifics associated to an TPDM component >>>> + * @base:       memory mapped base address for this component. >>>> + * @dev:        The device entity associated to this component. >>>> + * @csdev:      component vitals needed by the framework. >>>> + * @lock:       lock for the enable value. >>>> + * @enable:     enable status of the component. >>>> + */ >>>> + >>>> +struct tpdm_drvdata { >>>> +    void __iomem        *base; >>>> +    struct device        *dev; >>>> +    struct coresight_device    *csdev; >>>> +    struct mutex        lock; >>> >>> Why mutex lock ? Couldn't this be a spinlock ? >> 1. There is no irq for TPDM >> 2. As there are 7 dataset types, there will be some FOR loop to configure >> tpdm registers which may cause some time. How long does it take to configure ? Is it too long enough to trigger RCU stalls ? as long as we don't do any sleeping/blocking operations we should be fine with a spinlock. Suzuki >> > I think we can use mutex lock here. Do you have any more comments for > this ? > > Thanks > Jinlong Mao >>> >>>> +    bool            enable; >>>> +}; >>>> + >>>> +#endif  /* _CORESIGHT_CORESIGHT_TPDM_H */ >>>> diff --git a/include/linux/coresight.h b/include/linux/coresight.h >>>> index 247147c11231..a9efac55029d 100644 >>>> --- a/include/linux/coresight.h >>>> +++ b/include/linux/coresight.h >>>> @@ -61,6 +61,7 @@ enum coresight_dev_subtype_source { >>>>       CORESIGHT_DEV_SUBTYPE_SOURCE_PROC, >>>>       CORESIGHT_DEV_SUBTYPE_SOURCE_BUS, >>>>       CORESIGHT_DEV_SUBTYPE_SOURCE_SOFTWARE, >>>> +    CORESIGHT_DEV_SUBTYPE_SOURCE_DATA_ONLY, >>> >>> super minor nit: I find the choice of name a bit odd. >>> We could simply make it something like : >>> >>>     CORESIGHT_DEV_SUBTYPE_SOURCE_OTHERS: >>> >>> Suzuki >> I will check and update. >>> >>>>   }; >>>>     enum coresight_dev_subtype_helper { >>> >>> _______________________________________________ >>> CoreSight mailing list -- coresight@lists.linaro.org >>> To unsubscribe send an email to coresight-leave@lists.linaro.org >> _______________________________________________ >> CoreSight mailing list -- coresight@lists.linaro.org >> To unsubscribe send an email to coresight-leave@lists.linaro.org