From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6CF469DEF; Wed, 31 Jan 2024 10:03:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706695386; cv=none; b=S/m83gQzufaRZa135PX9OvGrOSjBxZVD58EKAGtPmw2UG9qFUl+O0QJej6oQTPZA1Xi/Nk4YGIYq1p8/RE7DUqcuKeZS4xMyXegx1+SMaurTiOXxce0Ci1D8TVqDS/n0s4H9avl8Ci+jW8Df35OV47d/1JLdWOY8YaBTtShvjlQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706695386; c=relaxed/simple; bh=UMIgl0KfJFBZGMBoXXERCp/2jBmM9yJsvbpc5M33A6w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YOgGgbi4hlNa/1AUCmNysDTa8iR7i75jev+rDKvLr8QZ3UCVE+gSyOLOkyjA4Zr7ApxOfoh5NbeGaQkpcZ3N2hTj6BBNNfKkLuL6TBljzraIRKDazZsK7E4llLlxqTa+bKHciV8jlNBuarUG/6sA5NWGlVrRD1L7oJBAefbLCU8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 6B1EFDA7; Wed, 31 Jan 2024 02:03:47 -0800 (PST) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5901D3F5A1; Wed, 31 Jan 2024 02:02:59 -0800 (PST) Message-ID: <1f5a7c7b-56de-4f19-9d48-652ae6efe50f@arm.com> Date: Wed, 31 Jan 2024 10:02:58 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 05/10] coresight-tpda: Add support to configure CMB element Content-Language: en-US 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 , Song Chai , linux-arm-msm@vger.kernel.org, andersson@kernel.org References: <1706605366-31705-1-git-send-email-quic_taozha@quicinc.com> <1706605366-31705-6-git-send-email-quic_taozha@quicinc.com> <6ccb98f2-2f68-45db-9941-1c7b05da84d0@arm.com> <6fff5991-01ed-44ea-aa08-9f302d2465e8@quicinc.com> From: Suzuki K Poulose In-Reply-To: <6fff5991-01ed-44ea-aa08-9f302d2465e8@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 31/01/2024 01:39, Tao Zhang wrote: > > On 1/30/2024 8:35 PM, Suzuki K Poulose wrote: >> On 30/01/2024 09:02, Tao Zhang wrote: >>> Read the CMB element size from the device tree. Set the register >>> bit that controls the CMB element size of the corresponding port. >>> >>> Reviewed-by: James Clark >>> Signed-off-by: Tao Zhang >>> Signed-off-by: Mao Jinlong >>> --- >>>   drivers/hwtracing/coresight/coresight-tpda.c | 123 +++++++++++-------- >>>   drivers/hwtracing/coresight/coresight-tpda.h |   6 + >>>   2 files changed, 79 insertions(+), 50 deletions(-) >>> >>> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c >>> b/drivers/hwtracing/coresight/coresight-tpda.c >>> index 4ac954f4bc13..fcddff3ded81 100644 >>> --- a/drivers/hwtracing/coresight/coresight-tpda.c >>> +++ b/drivers/hwtracing/coresight/coresight-tpda.c >>> @@ -18,6 +18,7 @@ >>>   #include "coresight-priv.h" >>>   #include "coresight-tpda.h" >>>   #include "coresight-trace-id.h" >>> +#include "coresight-tpdm.h" >>>     DEFINE_CORESIGHT_DEVLIST(tpda_devs, "tpda"); >>>   @@ -28,24 +29,57 @@ static bool coresight_device_is_tpdm(struct >>> coresight_device *csdev) >>>               CORESIGHT_DEV_SUBTYPE_SOURCE_TPDM); >>>   } >>>   +static void tpdm_clear_element_size(struct coresight_device *csdev) >>> +{ >>> +    struct tpda_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); >>> + >>> +    drvdata->dsb_esize = 0; >>> +    drvdata->cmb_esize = 0; >>> +} >>> + >>> +static void tpda_set_element_size(struct tpda_drvdata *drvdata, u32 >>> *val) >>> +{ >>> + >> >> >> >>> +    if (drvdata->dsb_esize == 64) >>> +        *val |= TPDA_Pn_CR_DSBSIZE; >> >> We don't seem to be clearing the fields we modify, before updating >> them. This may be OK in real world where the device connected to TPDA >> port >> may not change. But it is always safer to clear the bits and set it. >> >> e.g.: >>     *val &= ~(TPDA_Pn_CR_DSBSIZE | TPDA_Pn_CR_CMBSIZE); >> >> >> >>> +    else if (drvdata->dsb_esize == 32) >>> +        *val &= ~TPDA_Pn_CR_DSBSIZE; >>> + >>> +    if (drvdata->cmb_esize == 64) >>> +        *val |= FIELD_PREP(TPDA_Pn_CR_CMBSIZE, 0x2); >>> +    else if (drvdata->cmb_esize == 32) >>> +        *val |= FIELD_PREP(TPDA_Pn_CR_CMBSIZE, 0x1); >> >> Similarly here ^^^. I am happy to fix it up if you are OK with it >> (unless there are other changes that need a respin) > > Thank you. I would be very grateful if you could help for this. Given, you need to respin, please incorporate this change too. Suzuki