Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp603411rdb; Thu, 31 Aug 2023 20:50:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGADfxs5tadpQi8v9HIn/+IjpjZI5/ygLH74D4EmkWE6vmxBQk4mofTDIYKmezkba58yHJ+ X-Received: by 2002:a17:906:224a:b0:9a1:f415:7c24 with SMTP id 10-20020a170906224a00b009a1f4157c24mr903427ejr.46.1693540246994; Thu, 31 Aug 2023 20:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693540246; cv=none; d=google.com; s=arc-20160816; b=wWOUkBQgwli3utEsehQEpb99+3M6s6cOnjlBJpLaEnheGTU295QnJaklj+lzut/UT6 tKbE1sos3s8qzvnjxsrhUUxznPucEVu+/XdOqaKLiqjxMgT1ct8aCpayxtxtEpukaCpb Q3sBN1AindGaaH/hiOpThZKDsFkOon5EC8bRSQrwZXOBt1IFayEj+c+CnLASASODJNN3 P+GA8nVmjCfLIUV1+Nv49cA/TESvP8Qm4fGuNL6qYh2Rl9TBvWvhlmEjWJCm4YJamUsS AUS2a4B3ZW1OVuFyscnt4s8YUw+LJOJ/A0TNMFe4y1OezLrLuNbUj1sXPPwllrsLjQHV qTYQ== 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=QepKpaPEtNHBVbKfFvz2vj8ciqaRsMyff0sOetqmoyI=; fh=EIolEX5wSdLd6JOc/IXAoJmWROGfd5OoUhU7Zjw1aJQ=; b=ttcQP9ULdvN1bdPc7ISS7WdzKAzT0V5doOEmDsfv1tGFXJiuN+2pIX2kDW23c/ssLY FUzdE+VbFSIGywcBU94CzQt+qOoTvBhW2zrR+au09JEe3FNph2Brwf2wkZ+hYPlU4Y5w Hzy3HSFiiQNTYZANbIUwe3ehosCM+hDg3ZnUWA6ULkeRgVUscJB699Lffieru3XqtT9c QiB47ANdi+6pGWG48u2yspJ7IzyJdk5h7A/w73zbuyzNkCNzqFJ6aMKwBb14+CXtdrqq +sRMvqHeohl++/rWYCjFoRwAYasL2uCobz5eBdJr2nFOeaIZKlZEnKbyApN0Hc7FkuhW +zwg== 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 gx17-20020a170906f1d100b009a1bb8f4272si1779058ejb.581.2023.08.31.20.50.08; Thu, 31 Aug 2023 20:50:46 -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 S1345239AbjHaUeR (ORCPT + 99 others); Thu, 31 Aug 2023 16:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347416AbjHaUeQ (ORCPT ); Thu, 31 Aug 2023 16:34:16 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 230ADE5D; Thu, 31 Aug 2023 13:34:11 -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 E5284C15; Thu, 31 Aug 2023 13:34:49 -0700 (PDT) Received: from [10.57.91.85] (unknown [10.57.91.85]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CE9663F740; Thu, 31 Aug 2023 13:34:07 -0700 (PDT) Message-ID: <46a48c06-0d6c-d943-5f20-bd0002c76342@arm.com> Date: Thu, 31 Aug 2023 21:34:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v8 06/13] coresight-tpdm: Add reset node to TPDM node 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: <1692681973-20764-1-git-send-email-quic_taozha@quicinc.com> <1692681973-20764-7-git-send-email-quic_taozha@quicinc.com> From: Suzuki K Poulose In-Reply-To: <1692681973-20764-7-git-send-email-quic_taozha@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 22/08/2023 06:26, Tao Zhang wrote: > TPDM device need a node to reset the configurations and status of > it. This change provides a node to reset the configurations and > disable the TPDM if it has been enabled. > > Signed-off-by: Tao Zhang > --- > .../ABI/testing/sysfs-bus-coresight-devices-tpdm | 10 ++++++++++ > drivers/hwtracing/coresight/coresight-tpdm.c | 22 ++++++++++++++++++++++ > 2 files changed, 32 insertions(+) > > diff --git a/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpdm b/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpdm > index 4a58e64..2936226 100644 > --- a/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpdm > +++ b/Documentation/ABI/testing/sysfs-bus-coresight-devices-tpdm > @@ -11,3 +11,13 @@ Description: > Accepts only one of the 2 values - 1 or 2. > 1 : Generate 64 bits data > 2 : Generate 32 bits data > + > +What: /sys/bus/coresight/devices//reset_dataset > +Date: March 2023 > +KernelVersion 6.5 > +Contact: Jinlong Mao (QUIC) , Tao Zhang (QUIC) > +Description: > + (Write) Reset the dataset of the tpdm. > + > + Accepts only one value - 1. > + 1 : Reset the dataset of the tpdm > diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c b/drivers/hwtracing/coresight/coresight-tpdm.c > index 951ad4d..d6e7c8c 100644 > --- a/drivers/hwtracing/coresight/coresight-tpdm.c > +++ b/drivers/hwtracing/coresight/coresight-tpdm.c > @@ -162,6 +162,27 @@ static int tpdm_datasets_setup(struct tpdm_drvdata *drvdata) > return 0; > } > > +static ssize_t reset_dataset_store(struct device *dev, > + struct device_attribute *attr, > + const char *buf, > + size_t size) > +{ > + int ret = 0; > + unsigned long val; > + struct tpdm_drvdata *drvdata = dev_get_drvdata(dev->parent); > + > + ret = kstrtoul(buf, 0, &val); > + if (ret || val != 1) > + return -EINVAL; > + > + spin_lock(&drvdata->spinlock); > + tpdm_reset_datasets(drvdata); > + spin_unlock(&drvdata->spinlock); > + > + return size; > +} > +static DEVICE_ATTR_WO(reset_dataset); > + > /* > * value 1: 64 bits test data > * value 2: 32 bits test data > @@ -202,6 +223,7 @@ static ssize_t integration_test_store(struct device *dev, > static DEVICE_ATTR_WO(integration_test); > > static struct attribute *tpdm_attrs[] = { > + &dev_attr_reset_dataset.attr, Should this be only visible when DSB data set is present ? Suzuki > &dev_attr_integration_test.attr, > NULL, > };