Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp186175lqe; Thu, 4 Apr 2024 03:54:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUN1b+DGT82euPFVU51+WAxnBZv/oZKZqflU9Mm+hnIpqeFy3ADB9/b1sscauPKunrCVuu0P35FJoSehYf1oeJiM1SkDOdAx1a0yvcanA== X-Google-Smtp-Source: AGHT+IG3O/f+3/xRaTdhdsLUfMlF2R0bSA3V7ncx0et1N5xmMWa45ijwSLmlNC3D1aqgMm4cwhsW X-Received: by 2002:a05:6808:2a79:b0:3c3:76f3:e37 with SMTP id fu25-20020a0568082a7900b003c376f30e37mr1745577oib.21.1712228068397; Thu, 04 Apr 2024 03:54:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712228068; cv=pass; d=google.com; s=arc-20160816; b=FQz+QdWFNw7Qnj/rKMMuMsu7VFmy8zAwZ4THvMFNltylqy2j5cabvkCNSGMESnrfUX bRe137YyHs5c6XhLMVUtr6khBlD0BXdc9pMG8csFWiljV8RXbFmGYzqkQRiNaM9t3aus 6ElBmLOXmyrTEgQlid6YO9gdFD043ls0vKZ2NOpsNlNBRb0C2dJJEA31wipsntP05a8u AsgTGhpZYVCjLfj82hTpcI/Pn+GBCcLfCmGjuzUSepzTiry25Ozku8EogSvfp7TV1TJS M8AYlbcWNkwwKDZUm2GGDfpLgyF1XXLSCB2Qe1pHA85/5zzxH143g7hhZzLb5s2mxf2d aF+Q== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=cTBIV8FTKDYQ1y5Wv6nx6XLZc5CWWb+cHzWguhcbQ4U=; fh=q6ntjCJCJ8L+GYXbPD/odkUtKJTcjFZGKLLMa3Mg8L0=; b=gNZXzAfRCVz7VhJVfVryfNkPHKaxspY9Qd23GPzqdKJB2Nnf8P4EjKYY4MX7I9nmgN No4I+4f1e5GVHSsiu1rXUlvUvjmq1eRAXdIotzr0aSdCH9yzikVMxTe8BUouRMZ8we6S q+KbFcw1YNFln2+qcU4nw1v1xbBwlREfr8EZYkyvyabI2q2iRhmP+T+TMXov+hJSPPPu l3rNOyEyIaN50jGsT+dZ7yGakkPSe3iYiHZkN5uBINU2zABo4niuY2MFU5xUmfF1feM9 DksTplOmiYDvBQAqZBRfa1ErkfjNN/M+wI7hCX7E0tMWuLRz28tfGF9zuiqKa81SEwzq v+Hw==; 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-131264-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id by41-20020a056a0205a900b005ceca1094c3si16302564pgb.853.2024.04.04.03.54.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 03:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131264-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-131264-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131264-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 554CB281E27 for ; Thu, 4 Apr 2024 10:53:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C83DF8062E; Thu, 4 Apr 2024 10:53:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18FF3757F1 for ; Thu, 4 Apr 2024 10:53:42 +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=1712228025; cv=none; b=mg4zIl1BjBJPCAtuSeXkjhzDE+kJiSEfM/WgTDUq0vgnkkUnDlyDtMVh8si9JIuA2oYQKThlJntzrnYyJwyHM7rqu4yKV2vfUB3eABZkIkfqukE5TtGSGPK/iqzWwgHZ7wonta52gPIP39r1K/Cf5BQIWzMxH0giFn8Ob+OwYdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712228025; c=relaxed/simple; bh=ZfXwOSagjY7nn9wvzmDHWJ5KfR31qgkvmugf9YJwCbY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=I8v5mtdIAx21NsLxGgvyGQbo4U1xxsyO6xn7mbYYYvI9biph2gd0nZQGnDVadC/+33uLCm23EDGXEmSTqBLCkuepE87pbathF4OIWZp+5OvqKNgZShPzzKnlSw3g6XiMcuQlOmctwfqGKO9EQrqMEA+wMG4FLc5K4p2QFUpjfgc= 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 03C81FEC; Thu, 4 Apr 2024 03:54:13 -0700 (PDT) Received: from [192.168.1.100] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 348813F7B4; Thu, 4 Apr 2024 03:53:41 -0700 (PDT) Message-ID: Date: Thu, 4 Apr 2024 11:53:25 +0100 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] coresight: tmc: Enable SG capability on ACPI based SoC-400 TMC ETR devices To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: sudeep.holla@arm.com, Mike Leach , Alexander Shishkin , coresight@lists.linaro.org, linux-kernel@vger.kernel.org References: <20240404072934.940760-1-anshuman.khandual@arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20240404072934.940760-1-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/04/2024 08:29, Anshuman Khandual wrote: > This detects and enables the scatter gather capability (SG) on ACPI based > Soc-400 TMC ETR devices via a new property called 'arm-armhc97c-sg-enable'. > The updated ACPI spec can be found below, which contains this new property. > > https://developer.arm.com/documentation/den0067/latest/ > > This preserves current handling for the property 'arm,scatter-gather' both > on ACPI and DT based platforms i.e the presence of the property is checked > instead of the value. > > Cc: Suzuki K Poulose > Cc: Mike Leach > Cc: James Clark > Cc: Alexander Shishkin > Cc: coresight@lists.linaro.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > .../hwtracing/coresight/coresight-tmc-core.c | 28 ++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c > index 72005b0c633e..2b277499b59a 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-core.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c > @@ -4,6 +4,7 @@ > * Description: CoreSight Trace Memory Controller driver > */ > > +#include > #include > #include > #include > @@ -360,7 +361,32 @@ static const struct attribute_group *coresight_etr_groups[] = { > > static inline bool tmc_etr_can_use_sg(struct device *dev) > { > - return fwnode_property_present(dev->fwnode, "arm,scatter-gather"); > + int ret; > + u8 val_u8; > + > + /* > + * Presence of the property 'arm,scatter-gather' is checked > + * on the platform for the feature support, rather than its > + * value. > + */ > + if (is_of_node(dev->fwnode)) { > + return fwnode_property_present(dev->fwnode, "arm,scatter-gather"); > + } else if (is_acpi_device_node(dev->fwnode)) { > + /* > + * TMC_DEVID_NOSCAT test in tmc_etr_setup_caps(), has already ensured > + * this property is only checked for Coresight SoC 400 TMC configured > + * as ETR. > + */ > + ret = fwnode_property_read_u8(dev->fwnode, "arm-armhc97c-sg-enable", &val_u8); > + if (!ret) > + return !!val_u8; > + > + if (fwnode_property_present(dev->fwnode, "arm,scatter-gather")) { > + pr_warn_once("Deprecated ACPI property - arm,scatter-gather\n"); > + return true; > + } > + } > + return false; > } > > static inline bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata) Reviewed-by: James Clark