Message ID | 20240123054608.1790189-2-anshuman.khandual@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-34733-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp137861dyi; Mon, 22 Jan 2024 21:47:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKlrPmZk64JW8HWrQxH5rqzhZZz1X1WkrmnZ6vbSwotxPIRUT5rEu2NXRzycPeJU7vC3II X-Received: by 2002:ac2:4894:0:b0:50e:1eae:a980 with SMTP id x20-20020ac24894000000b0050e1eaea980mr2009173lfc.118.1705988827287; Mon, 22 Jan 2024 21:47:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705988827; cv=pass; d=google.com; s=arc-20160816; b=RRTHhbxUGn9pkyJYk9H7GnAgS5uyru42RsjaMhY4/BPhUAGYw4+BoHT/r2mDwAAaYq QEsANM1ZHDnsJETKjt9Y85ArPF+1onRRPNBCgaShiyoQ8VLMau24aGHU/zi3eo9t/YEq f8GpbOPUmcx0u/aqArSMMI7MuiEYisS1CiCElTk/LZl0K0LWM8A1TujiWds9A/5XlF/8 6rmfVaA3wbAjgM7eFwaVhcZbp39x4pGESmnToxicsDMG5tdS6l5S3ye9Dq9p8GMXJjzA e5OPSdVmh7Qi/nzs2ezaKdi0f38cG+Fbx9sHfaHUfMo4xY2v3lfjIFTezi1E6Zoh05my Cojw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=uKvi1MBuI9S/2ioWbx3VXUVD9UWxK/npXigiTLvDfS8=; fh=Ve3FBKFNYuN9a2kLR4CVDWk9WsPfmS1fLiG/J19ZIic=; b=mxR4/my68jrHD1W/QQS76kQoG6uwTKButFyRxtrmx9EsF4AwfBDCeLTzpK5bV1NUxB h6ntRtcnzZCbhL/0EoswB1m7FKjdweYjIYBdKzrc3yR+UpZiGAbTUMXc6MbK9aFCwyPX e+y8TNbxVxFiOyTWqL+NGEY/3kxynqDEZSK2LV/szidBPKkXWfHs+krnKeUKAY1rb8oA R3HhqE00SYZ0V7x6zlZHt6kepLKVDh22NHxHtH1DRzwK2eB946CcoMXh2EJVoc8sYR6f fXstnQpz52AzPtpCMgI+YOW+VGJaoghRUnrYoc13ylrpQCI/y3twl6In+Lkee7EJEgFB PHqQ== 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-34733-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34733-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t16-20020a170906179000b00a28b4437aedsi11389259eje.603.2024.01.22.21.47.07 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 21:47:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34733-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-34733-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34733-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id DC40C1F236CB for <ouuuleilei@gmail.com>; Tue, 23 Jan 2024 05:47:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFF315662; Tue, 23 Jan 2024 05:46:37 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B3735225; Tue, 23 Jan 2024 05:46:34 +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=1705988796; cv=none; b=qUqKdi4AShVv1nZfdIzKBw8jiXzT/N7aHlDRinPx9jzSYQdNubpKlmwqFn/tNESTf1CotI38lXROfNGAAuYIcNAIyglIayFL6Cby8kFBv6skCEA2wota+WHJBVHfRK05FFRCDOnlnPetYzxmU2W/+OQYLP7VJziTPiyVy1GpdFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705988796; c=relaxed/simple; bh=qifqUoKag7tPFe5WpqFju8z5JkQh256jXXW4tN+n9oM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Pd7BkiFpcJHpTZ8+QaydharPPMtJ4OQW0rkaq+Lsvw9T+VwBcwDp1Ys7pmE03XuapiWaAgylRi+yaL7jlT7iVZspXAmjK4vO1ZLrCando0c69ub1EroTWLaR0m+/4eraG8LNjF1qgFTpD5f7uPa/Prcm6PqsMwE8K0YuhbJ0dE8= 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 4A5F7FEC; Mon, 22 Jan 2024 21:47:19 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.40.228]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1A0613F762; Mon, 22 Jan 2024 21:46:27 -0800 (PST) From: Anshuman Khandual <anshuman.khandual@arm.com> To: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Anshuman Khandual <anshuman.khandual@arm.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Sudeep Holla <sudeep.holla@arm.com>, Mike Leach <mike.leach@linaro.org>, James Clark <james.clark@arm.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-stm32@st-md-mailman.stormreply.com, Hanjun Guo <guohanjun@huawei.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org>, Leo Yan <leo.yan@linaro.org> Subject: [PATCH V4 01/11] coresight: etm4x: Fix unbalanced pm_runtime_enable() Date: Tue, 23 Jan 2024 11:15:58 +0530 Message-Id: <20240123054608.1790189-2-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240123054608.1790189-1-anshuman.khandual@arm.com> References: <20240123054608.1790189-1-anshuman.khandual@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788858940567521811 X-GMAIL-MSGID: 1788858940567521811 |
Series |
coresight: Move remaining AMBA ACPI devices into platform driver
|
|
Commit Message
Anshuman Khandual
Jan. 23, 2024, 5:45 a.m. UTC
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().
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: James Clark <james.clark@arm.com>
Cc: Leo Yan <leo.yan@linaro.org>
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 <anshuman.khandual@arm.com>
---
Changes in V4:
- New patch in the series
drivers/hwtracing/coresight/coresight-etm4x-core.c | 3 +++
1 file changed, 3 insertions(+)
Comments
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 <lpieralisi@kernel.org> > Cc: Hanjun Guo <guohanjun@huawei.com> > Cc: Sudeep Holla <sudeep.holla@arm.com> > Cc: "Rafael J. Wysocki" <rafael@kernel.org> > Cc: Len Brown <lenb@kernel.org> > Cc: Suzuki K Poulose <suzuki.poulose@arm.com> > Cc: Mike Leach <mike.leach@linaro.org> > Cc: James Clark <james.clark@arm.com> > Cc: Leo Yan <leo.yan@linaro.org> > 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 <anshuman.khandual@arm.com> > --- > 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
On 2/15/24 16:34, Suzuki K Poulose wrote: > 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" Sure, will add this 'Fixes' tag here. > >> >> Cc: Lorenzo Pieralisi <lpieralisi@kernel.org> >> Cc: Hanjun Guo <guohanjun@huawei.com> >> Cc: Sudeep Holla <sudeep.holla@arm.com> >> Cc: "Rafael J. Wysocki" <rafael@kernel.org> >> Cc: Len Brown <lenb@kernel.org> >> Cc: Suzuki K Poulose <suzuki.poulose@arm.com> >> Cc: Mike Leach <mike.leach@linaro.org> >> Cc: James Clark <james.clark@arm.com> >> Cc: Leo Yan <leo.yan@linaro.org> >> 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 <anshuman.khandual@arm.com> >> --- >> 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. Understood.
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; }