Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2475868rwl; Mon, 27 Mar 2023 00:13:24 -0700 (PDT) X-Google-Smtp-Source: AKy350aHrHUiTpJxjWrX4kzU3FsvgQS/VVwg44w+RiU+8iO9JoKd/y7YHDLpNUpxGhbClTVXGayf X-Received: by 2002:a17:906:16d2:b0:91f:b13f:a028 with SMTP id t18-20020a17090616d200b0091fb13fa028mr11760867ejd.34.1679901204107; Mon, 27 Mar 2023 00:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679901204; cv=none; d=google.com; s=arc-20160816; b=qUYX8V17h1+HujHRPbLeM2VzOc/v1UXmmyebR93PKoKGRUe2AFpDyFN7rz0ebL8Fpx 1EpzqE3Q2DGUKaAGmNKl9Ggczz8Au6GIl3+kATvxjkUWwjQAxn9YhFRT5LKtF+L6YN6W eKRnE0+u7rYon/1RoQrtc3mT/w0MPx7WoAwACMBsCa6QTNpnD9faFg3v6eerRsQ8SIDi kwzP8BJ6KPh6fUlo2xrnVyTpwAqpOBQwNoaxXPSs2TbxIKAKGRvkW+75ymfrpcyjS2IY ZD8hTysPKTyDaO3TTW42vd9Bj6muhaobaXJNfiUdsImOvadbt5rj9HOZUbeb/Ew1J+pU 13FA== 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:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=EXRlzh/rBQO3dxlb4NEK2QXdnyJZoEfzEISuMf/Iix8=; b=I768S2DdVrjWFMhbTgxE8p1R49fNSVkOjUpHqxKVRbgRzB75Zb+sk1WCNm82WqhTeP qPw2RaffNWvyQZt8Z4PrdjI58hKujAkSXS8ERuFD1nsqmvNnSkp/ZtkgofHAZiSMPTR1 rw3bFMhQ7a+M+2ku5nQJdU6f/TuKjB3IuT3wucP8gQyRL5fzAtKMsRUMHd+8e/Z8ls+S Azgvw0IYBHLVwfZcJN7RI5FtIRLHa83VO2vlGDHqioHGMKLGHaGYLozG49MNj0PbJd08 arKUWNguhaCNW4hITHQPLyfvrk/3+FzUFqNyN9txG1bezO7mccXCjR5b/8pRXxJAkCBH XUYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DCxWgtbF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fy24-20020a1709069f1800b0093defbd626dsi7986577ejc.1012.2023.03.27.00.12.59; Mon, 27 Mar 2023 00:13:24 -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; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DCxWgtbF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232345AbjC0HL2 (ORCPT + 99 others); Mon, 27 Mar 2023 03:11:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232183AbjC0HLZ (ORCPT ); Mon, 27 Mar 2023 03:11:25 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10364482; Mon, 27 Mar 2023 00:11:24 -0700 (PDT) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32R2Q6ZA001186; Mon, 27 Mar 2023 07:11:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=EXRlzh/rBQO3dxlb4NEK2QXdnyJZoEfzEISuMf/Iix8=; b=DCxWgtbF40uTohGqX4QdeCvdzQao8HD3XrfX8b7U+L9TEIIzPDABG3XtRnw+qJE9a3TY cYt7401YqCFIycLpvnhJcJRANvB/gRbpQ+uBnmbvei4WJQNXUT/KS2pY9yTMML91MF8U gWIdQNaikNWIU6Oi1BwmRLDvBI2O6m+EbaO90LBum1hp16HsYwPyGwd+v/j1isYSzoiP A+0ES8amQ1l3gUkaOCphdvytONcb5e6o+L/bjxEzWeZlsuRpHbI8HRCgXrLCXDuakhuj tpU7AZwBVNCDQCubHDD8DKEpYP1HjzQU5wZOOEmtqf/jveXzinyZMbJuT1huqAnyAFSQ yQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3phsrsbn3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 07:11:12 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32R7BC7m009475 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Mar 2023 07:11:12 GMT Received: from [10.239.133.211] (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 27 Mar 2023 00:11:07 -0700 Message-ID: Date: Mon, 27 Mar 2023 15:11:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 04/11] coresight-tpdm: Add reset node to TPDM node Content-Language: en-US To: Suzuki K Poulose , Mathieu Poirier , Alexander Shishkin , Konrad Dybcio , Mike Leach , Rob Herring , Krzysztof Kozlowski CC: Jinlong Mao , Leo Yan , "Greg Kroah-Hartman" , , , , , Tingwei Zhang , Yuanfang Zhang , Trilok Soni , Hao Zhang , , Bjorn Andersson References: <1679551448-19160-1-git-send-email-quic_taozha@quicinc.com> <1679551448-19160-5-git-send-email-quic_taozha@quicinc.com> <4cde9235-e86a-73a0-5c6c-ac193328006b@arm.com> From: Tao Zhang In-Reply-To: <4cde9235-e86a-73a0-5c6c-ac193328006b@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: UTwmiRHHDPF6TwzGhv60l_CsbFP9Ku-5 X-Proofpoint-GUID: UTwmiRHHDPF6TwzGhv60l_CsbFP9Ku-5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-24_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 bulkscore=0 suspectscore=0 malwarescore=0 impostorscore=0 phishscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303270057 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS 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 Hi Suzuki, On 3/23/2023 10:48 PM, Suzuki K Poulose wrote: > On 23/03/2023 14:41, Suzuki K Poulose wrote: >> On 23/03/2023 06:04, 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. > > Please justify why this "do everything" magic knob is required > when there are tunables for individual controls in the later > patches. We want to have a single knob that resets all the datasets, which saves the need to configure the individual controls one by one. Since it is often necessary to reset all the datasets, this knob will be more user-friendly. Tao > > Suzuki > >>> >>> Signed-off-by: Tao Zhang >>> --- >>>   drivers/hwtracing/coresight/coresight-tpdm.c | 28 >>> ++++++++++++++++++++++++++++ >>>   1 file changed, 28 insertions(+) >>> >>> diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c >>> b/drivers/hwtracing/coresight/coresight-tpdm.c >>> index 5e1e2ba..104638d 100644 >>> --- a/drivers/hwtracing/coresight/coresight-tpdm.c >>> +++ b/drivers/hwtracing/coresight/coresight-tpdm.c >>> @@ -161,6 +161,33 @@ static void tpdm_datasets_setup(struct >>> tpdm_drvdata *drvdata) >>>       drvdata->datasets |= pidr & GENMASK(TPDM_DATASETS - 1, 0); >>>   } >>> +static ssize_t reset_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, 10, &val); >>> +    if (ret || val != 1) >>> +        return -EINVAL; >>> + >>> +    spin_lock(&drvdata->spinlock); >>> +    /* Reset all datasets to ZERO, and init the default data*/ >>> +    tpdm_init_datasets(drvdata); >> >> With the suggested rename in the previous patch, you wouldn't need >> a comment here. >> >>> + >>> +    spin_unlock(&drvdata->spinlock); >>> + >> >> >>> +    /* Disable tpdm if enabled */ >>> +    if (drvdata->enable) >>> +        coresight_disable(drvdata->csdev); >> >> Couldn't this be done via disable_source ? Please don't overload >> the sysfs handle. >> >>> + >>> +    return size; >>> +} >>> +static DEVICE_ATTR_WO(reset); >> >> Documentation for the sysfs node please ? >> >> Suzuki >> >