Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1554999rdb; Wed, 31 Jan 2024 02:06:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZ1B3D7gLREHxG28VteqWVauyCB7UsDnS2B/uuqy0tsNPlozFlGIS0RodKJYw/ANwcST9U X-Received: by 2002:a17:903:40d0:b0:1d8:d58d:7ea1 with SMTP id t16-20020a17090340d000b001d8d58d7ea1mr1486115pld.59.1706695597414; Wed, 31 Jan 2024 02:06:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706695597; cv=pass; d=google.com; s=arc-20160816; b=dOUOwnmDcRLnNsYmTFYiqmjkp64JFWDoprejdcZXYXkvP9PDsuuXYUOTgCuZtOuDH5 a+3rhBghmX+aUoHEUQsv6jDHu/z3lUTk1pSzdsgvzMOZp4peDzNMhrrHANd6JIV32ij+ +EcQGpuDOGOB72rN18LTNaKoac0eg8uS6S+rLN/mVJvP/zfuSg6XnnrI36xxjXb4vXHb tXPyeTWCemgbCqv63sdrrO+eeW8o+zVgbb4bb1xg/UCe8tlfIm0HtJLaMAmAVQMTlPa9 0W5STPATjws07RLYD1+w5aUMDHnf87uQZObmR4ed8JyND6+IE0KszLSvSdRlq1K8rfdJ ym6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=q+B7Vo2cottMmdXXGXfoYLZzlLNQH7AfGyupBO+22Mo=; fh=pIJo9oYaYaUUm2Sy+I2mAzXJNyOxKTGNGgUasqABkgw=; b=Pbhd8GFD6LJNz4pYe/j1BrwGIwXLZmSTx9IrvuaKMj3D/PwbNhyWoFm8zB0e9ea9I/ tzmYayloOAoKkbOunsgq9bHpEPpA2wmBko6t0bYipm2DDgnfB20sMAXcELnWbfB1LH2v +MaLW1Dtp5Yw4/B46u21Z1e+6rqq95Chzf2s+Ze+7qEF2fy1JkTakUYivpxX5s3aS/AE kmXchOG3dp730LqpnzYmkXa1oXMv2KHi6FLtaVh3HCapQI5czj0PJM7cFDYX/iaTzElF fAPeiqNSMXuGYXk7BMW4KxdM+3UU1+9LYdxMT+bI7Et5OKgkAd4Fki19akYUY9p5ApJw 0+Gg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-46175-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCXLPaAwxq6j1xYbqNyGoq4MiK8H2oUdUNINcjPHy3G3O0TTp1RWJaxMQGQcf/A8FsBpIJ5DwRuVlaU0oojanK5eQgk2hven/gIvfVp5kw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t4-20020a170902e84400b001d5ee591d8esi9410442plg.344.2024.01.31.02.06.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:06:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46175-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-46175-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46175-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D2CDA290B51 for ; Wed, 31 Jan 2024 10:03:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D63A69D0C; Wed, 31 Jan 2024 10:03:07 +0000 (UTC) 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