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 57015C4829E for ; Thu, 15 Feb 2024 11:04:23 +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-Type: Content-Transfer-Encoding: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=b4CLvwtoZ9Ol5dKmPpqRrfsCZVXJ2ZnNkh8H0KRgzH8=; b=hjuiv2rJ0u7s+2 gHSz4nuXpRWZ/41etdOTSRusRH1q1y29Vaq+5PnydZsww/aKFfr+tZqVy08u+IpHT3i1xmMyfMRz7 fVRBWIw+dRXAPjbl2YSH32gzFHOqu7UJYtrD051qGkO/2M60IJCKyVnZwVbRhHtY6oSQ3BqJwuuH+ Moz+Y55wmI9uy3UCdwI4L9uWhbziqoMUCLwWvri+7t7vRGQdoS/P3tVnXMfsyd4qpqHlpzpwU3t9R T4mCQerOJ8kw7XtTQluYb1Gqkl1scwkDjMkGkxkJ2mYudEgATZ4YKIqnW9ojVEafxCYLHW31FcQRz XuyijQMsq2Hj4HdmqUAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raZXH-0000000Fvxk-2nUI; Thu, 15 Feb 2024 11:04:11 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raZXE-0000000FvwZ-3IYk for linux-arm-kernel@lists.infradead.org; Thu, 15 Feb 2024 11:04:10 +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 96E301FB; Thu, 15 Feb 2024 03:04:48 -0800 (PST) Received: from [10.57.49.250] (unknown [10.57.49.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A86443F7B4; Thu, 15 Feb 2024 03:04:05 -0800 (PST) Message-ID: <68eb9e4e-de77-4854-8212-816c66d5f657@arm.com> Date: Thu, 15 Feb 2024 11:04:04 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V4 01/11] coresight: etm4x: Fix unbalanced pm_runtime_enable() Content-Language: en-GB To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org Cc: Lorenzo Pieralisi , Sudeep Holla , 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, Hanjun Guo , "Rafael J. Wysocki" , Len Brown , Leo Yan References: <20240123054608.1790189-1-anshuman.khandual@arm.com> <20240123054608.1790189-2-anshuman.khandual@arm.com> From: Suzuki K Poulose In-Reply-To: <20240123054608.1790189-2-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240215_030408_965409_0BAF7CA9 X-CRM114-Status: GOOD ( 18.31 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 23/01/2024 05:45, Anshuman Khandual wrote: > There is an unbalanced pm_runtime_enable() in etm4_probe_platform_dev() > when etm4_probe() fails. This problem can be observed via the coresight > etm4 module's (load -> unload -> load) sequence when etm4_probe() fails > in etm4_probe_platform_dev(). > > [ 63.379943] coresight-etm4x 7040000.etm: Unbalanced pm_runtime_enable! > [ 63.393630] coresight-etm4x 7140000.etm: Unbalanced pm_runtime_enable! > [ 63.407455] coresight-etm4x 7240000.etm: Unbalanced pm_runtime_enable! > [ 63.420983] coresight-etm4x 7340000.etm: Unbalanced pm_runtime_enable! > [ 63.420999] coresight-etm4x 7440000.etm: Unbalanced pm_runtime_enable! > [ 63.441209] coresight-etm4x 7540000.etm: Unbalanced pm_runtime_enable! > [ 63.454689] coresight-etm4x 7640000.etm: Unbalanced pm_runtime_enable! > [ 63.474982] coresight-etm4x 7740000.etm: Unbalanced pm_runtime_enable! > > This fixes the above problem - with an explicit pm_runtime_disable() call > when etm4_probe() fails during etm4_probe_platform_dev(). Fixes: 5214b563588e ("coresight: etm4x: Add support for sysreg only devices" > > Cc: Lorenzo Pieralisi > Cc: Hanjun Guo > Cc: Sudeep Holla > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: Suzuki K Poulose > Cc: Mike Leach > Cc: James Clark > Cc: Leo Yan > 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 > --- > Changes in V4: > > - New patch in the series > > drivers/hwtracing/coresight/coresight-etm4x-core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index ce1995a2827f..7c693b45ac05 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -2217,6 +2217,9 @@ static int etm4_probe_platform_dev(struct platform_device *pdev) > ret = etm4_probe(&pdev->dev); > > pm_runtime_put(&pdev->dev); > + if (ret) > + pm_runtime_disable(&pdev->dev); > + > return ret; > } > Looks good to me. I have glanced through the other platform device driver code in coresight subsystem and they all seem to be safe, except for Ultrasoc-smb, which doesn't do any power managment. It may be, because it is only supported on an ACPI system. Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel