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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDF8CC4167B for ; Tue, 28 Nov 2023 07:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SXbC8SeOdVOCcK/aO7ylQ/FaekQijlDREvFM0WTt1g8=; b=swGkobPLHVKEeX 7w8vxc8cuIAOYMcMYgd/SCiCfovoamzbeX4Ay6D8AkNu7qKrSOZ6Su5Ss68Kspi7bp/Dwqa/Nnw7Z U7nn6UdUlHxmkL7wk9nT+Qf4/Yuo318oUK4u8h3ZqASF20DoFmL8SXOogpvuCgZU+q40MoSy+43nC flZjfLNXBL2sCd3qj/2bU7iKoDW11t/NvhyPVFLw6Vi3rKslj7Y6gqoYf2Nrn8OwdvhhEHUMxaG+W YRqYrf+mLjq6+gklmaQl0pTKdjMfjxfI1PfaHAuNDTqglXZmDed1pc/JWd1i9vrpoddmVkDbkthey msOkm14Fi+ID+dfLTepA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7sEE-004KqX-2E; Tue, 28 Nov 2023 07:09:54 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r7sEB-004Kpe-0t for linux-arm-kernel@lists.infradead.org; Tue, 28 Nov 2023 07:09:52 +0000 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 5F9F5C15; Mon, 27 Nov 2023 23:10:35 -0800 (PST) Received: from [10.163.33.60] (unknown [10.163.33.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5221B3F5A1; Mon, 27 Nov 2023 23:09:44 -0800 (PST) Message-ID: <8305dee1-6668-4011-aaf7-68d072a1251c@arm.com> Date: Tue, 28 Nov 2023 12:39:42 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5/7] coresight: tmc: Move ACPI support from AMBA driver to platform driver To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, Lorenzo Pieralisi , Mike Leach , James Clark , 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: <20231027072943.3418997-1-anshuman.khandual@arm.com> <20231027072943.3418997-6-anshuman.khandual@arm.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231127_230951_409464_AF5BE5B0 X-CRM114-Status: GOOD ( 23.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/22/23 22:34, Sudeep Holla wrote: > On Fri, Oct 27, 2023 at 12:59:41PM +0530, 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 >> Signed-off-by: Anshuman Khandual >> --- >> drivers/acpi/arm64/amba.c | 2 - >> .../hwtracing/coresight/coresight-tmc-core.c | 127 +++++++++++++++--- >> drivers/hwtracing/coresight/coresight-tmc.h | 1 + >> 3 files changed, 113 insertions(+), 17 deletions(-) > > [...] > >> diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c >> index 7ec5365e2b64..618bc0b7a1a5 100644 >> --- a/drivers/hwtracing/coresight/coresight-tmc-core.c >> +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c > > [...] > >> @@ -573,9 +579,9 @@ static void tmc_shutdown(struct amba_device *adev) >> spin_unlock_irqrestore(&drvdata->spinlock, flags); >> } >> >> -static void tmc_remove(struct amba_device *adev) >> +static void __tmc_remove(struct device *dev) >> { >> - struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev); >> + struct tmc_drvdata *drvdata = dev_get_drvdata(dev); >> >> /* >> * Since misc_open() holds a refcount on the f_ops, which is >> @@ -586,6 +592,11 @@ static void tmc_remove(struct amba_device *adev) >> coresight_unregister(drvdata->csdev); >> } >> >> +static void tmc_remove(struct amba_device *adev) >> +{ >> + __tmc_remove(&adev->dev); >> +} >> + >> static const struct amba_id tmc_ids[] = { >> CS_AMBA_ID(0x000bb961), >> /* Coresight SoC 600 TMC-ETR/ETS */ >> @@ -613,6 +624,92 @@ static struct amba_driver tmc_driver = { >> >> module_amba_driver(tmc_driver); >> >> +static int tmc_platform_probe(struct platform_device *pdev) >> +{ >> + struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> + struct tmc_drvdata *drvdata; >> + int ret = 0; >> + >> + drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); >> + if (!drvdata) >> + return -ENOMEM; >> + >> + drvdata->pclk = coresight_get_enable_apb_pclk(&pdev->dev); >> + if (IS_ERR(drvdata->pclk)) >> + return -ENODEV; >> + > > --->8 >> + if (res) { >> + drvdata->base = devm_ioremap_resource(&pdev->dev, res); >> + if (IS_ERR(drvdata->base)) { >> + clk_put(drvdata->pclk); >> + return PTR_ERR(drvdata->base); >> + } >> + } >> + > --- > > You need drop the above hunk as _tmc_probe() already takes care of that. Dropped. > This is the root cause for the issue I reported in the other thread. Also > sorry for the confusion, I had to refer to coresight-tmc-core.c and post > the patch to unify module_init/exit but completely mixed up the file/patch > and referred coresight-tpiu-core.c instead as that patch was dealing with > it. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel