From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31181C77B7A for ; Thu, 25 May 2023 09:10:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233942AbjEYJKJ (ORCPT ); Thu, 25 May 2023 05:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239380AbjEYJKA (ORCPT ); Thu, 25 May 2023 05:10:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 224A5E4B; Thu, 25 May 2023 02:09:51 -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 DC5651042; Thu, 25 May 2023 02:10:35 -0700 (PDT) Received: from [10.57.70.156] (unknown [10.57.70.156]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5DA9A3F67D; Thu, 25 May 2023 02:09:48 -0700 (PDT) Message-ID: <320ee3b4-63ed-ec50-03c6-906803e34571@arm.com> Date: Thu, 25 May 2023 10:09:47 +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 03/11] coresight-tpdm: Initialize DSB subunit configuration To: Tao Zhang , Mathieu Poirier , Alexander Shishkin , Konrad Dybcio , Mike Leach , Rob Herring , Krzysztof Kozlowski Cc: Jinlong Mao , 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-4-git-send-email-quic_taozha@quicinc.com> <92b73ba2-00c5-9f18-ed27-a302f4e79bb2@quicinc.com> From: Suzuki K Poulose In-Reply-To: <92b73ba2-00c5-9f18-ed27-a302f4e79bb2@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 25/05/2023 09:12, Tao Zhang wrote: > > On 5/23/2023 9:42 PM, Suzuki K Poulose wrote: >> On 27/04/2023 10:00, Tao Zhang wrote: >>> DSB is used for monitoring “events”. Events are something that >>> occurs at some point in time. It could be a state decode, the >>> act of writing/reading a particular address, a FIFO being empty, >>> etc. This decoding of the event desired is done outside TPDM. >>> DSB subunit need to be configured in enablement and disablement. >>> A struct that specifics associated to dsb dataset is needed. It >>> saves the configuration and parameters of the dsb datasets. This >>> change is to add this struct and initialize the configuration of >>> DSB subunit. >>> >>> Signed-off-by: Tao Zhang ... >>> + * dataset types. It covers Basic Counts(BC), Tenure Counts(TC), >>> + * Continuous Multi-Bit(CMB), Multi-lane CMB(MCMB) and Discrete Single >>> + * Bit(DSB). This function will initialize the configuration according >>> + * to the dataset type supported by the TPDM. >>> + */ >>>   static void __tpdm_enable(struct tpdm_drvdata *drvdata) >>>   { >>>       CS_UNLOCK(drvdata->base); >>> @@ -110,15 +144,24 @@ static const struct coresight_ops tpdm_cs_ops = { >>>       .source_ops    = &tpdm_source_ops, >>>   }; >>>   -static void tpdm_init_default_data(struct tpdm_drvdata *drvdata) >>> +static int tpdm_datasets_setup(struct tpdm_drvdata *drvdata) >>>   { >>>       u32 pidr; >>>   -    CS_UNLOCK(drvdata->base); >>>       /*  Get the datasets present on the TPDM. */ >>>       pidr = readl_relaxed(drvdata->base + CORESIGHT_PERIPHIDR0); >>>       drvdata->datasets |= pidr & GENMASK(TPDM_DATASETS - 1, 0); >>> -    CS_LOCK(drvdata->base); >> >> Why are we removing the CS_{UN,}LOCK here ? > > CS_UNLOCK is used before writing data to Coresight registers. Here this > function > > doesn't need to write data to any registers, so I remove the > CS_{UN,}LOCK here. Please make this a separate patch to avoid confusing and keep it at the beginning of the series. Suzuki