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 7200DC4167B for ; Fri, 8 Dec 2023 15:31:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574327AbjLHPbd (ORCPT ); Fri, 8 Dec 2023 10:31:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233549AbjLHPba (ORCPT ); Fri, 8 Dec 2023 10:31:30 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 493E41732; Fri, 8 Dec 2023 07:31:36 -0800 (PST) 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 6CE9D106F; Fri, 8 Dec 2023 07:32:21 -0800 (PST) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 527983F6C4; Fri, 8 Dec 2023 07:31:34 -0800 (PST) Message-ID: <22cfb197-b8bd-46c5-f3cb-ea04b95c0792@arm.com> Date: Fri, 8 Dec 2023 15:31:32 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH V3 08/10] coresight: tmc: Move ACPI support from AMBA driver to platform driver To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Lorenzo Pieralisi , Sudeep Holla , Mike Leach , Maxime Coquelin , Alexandre Torgue , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-stm32@st-md-mailman.stormreply.com References: <20231208053939.42901-1-anshuman.khandual@arm.com> <20231208053939.42901-9-anshuman.khandual@arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20231208053939.42901-9-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/12/2023 05:39, Anshuman Khandual wrote: > Add support for the tmc devices in the platform driver, which can then be > used on ACPI based platforms. This change would now allow runtime power > management for ACPI based systems. The driver would try to enable the APB > clock if available. > > Cc: Lorenzo Pieralisi > Cc: Sudeep Holla > Cc: Suzuki K Poulose > Cc: Mike Leach > Cc: James Clark > Cc: linux-acpi@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Cc: coresight@lists.linaro.org > Tested-by: Sudeep Holla # Boot and driver probe only > Acked-by: Sudeep Holla # For ACPI related changes > Signed-off-by: Anshuman Khandual > --- > Changes in V3: > > - Added commnets for 'drvdata->pclk' > - Used coresight_init_driver()/coresight_remove_driver() helpers instead > - Dropped pm_runtime_put() from __tmc_probe() > - Added pm_runtime_put() on success path in tmc_probe() > - Added pm_runtime_put() on success/error paths in tmc_platform_probe() > - Check for drvdata instead of drvdata->pclk in suspend and resume paths > > drivers/acpi/arm64/amba.c | 2 - > .../hwtracing/coresight/coresight-tmc-core.c | 137 ++++++++++++++++-- > drivers/hwtracing/coresight/coresight-tmc.h | 2 + > 3 files changed, 124 insertions(+), 17 deletions(-) > > diff --git a/drivers/acpi/arm64/amba.c b/drivers/acpi/arm64/amba.c > index 6d24a8f7914b..d3c1defa7bc8 100644 > --- a/drivers/acpi/arm64/amba.c > +++ b/drivers/acpi/arm64/amba.c > @@ -22,10 +22,8 @@ > static const struct acpi_device_id amba_id_list[] = { > {"ARMH0061", 0}, /* PL061 GPIO Device */ > {"ARMH0330", 0}, /* ARM DMA Controller DMA-330 */ > - {"ARMHC501", 0}, /* ARM CoreSight ETR */ > {"ARMHC502", 0}, /* ARM CoreSight STM */ > {"ARMHC503", 0}, /* ARM CoreSight Debug */ > - {"ARMHC97C", 0}, /* ARM CoreSight SoC-400 TMC, SoC-600 ETF/ETB */ > {"", 0}, > }; > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c > index ad61d02f5f75..8482830d73ef 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-core.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c > @@ -23,6 +23,8 @@ > #include > #include > #include > +#include > +#include > > #include "coresight-priv.h" > #include "coresight-tmc.h" > @@ -437,24 +439,17 @@ static u32 tmc_etr_get_max_burst_size(struct device *dev) > return burst_size; > } > > -static int tmc_probe(struct amba_device *adev, const struct amba_id *id) > +static int __tmc_probe(struct device *dev, struct resource *res, void *dev_caps) I don't think the dev_caps argument is used anymore since the v3 changes.