Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp408428rdb; Thu, 15 Feb 2024 04:10:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXEKuUrUVreRXqmpQzY00HmyIkm1ZXZ/Mvw1s8u5y9i/QROFnNIcXl6ZpuBLeoqrHrTP574SaE75nVG0q61ZbbwpILZv31WAoUfToTSGQ== X-Google-Smtp-Source: AGHT+IHIY6rqa3dUmhRRbdVDi9rgWtnUzTq3xmOZzT6Hr2qal6E3ounEVTIwgpSj14yR5bMF6Uwc X-Received: by 2002:a05:6e02:2148:b0:363:d9eb:c2de with SMTP id d8-20020a056e02214800b00363d9ebc2demr1455100ilv.6.1707999019883; Thu, 15 Feb 2024 04:10:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707999019; cv=pass; d=google.com; s=arc-20160816; b=TtSesRtnvZ+FJhIEScpP2Pb6zSh1rUYiR3vrh+MwrR43+0aXPsCBYAk1p1spBJ1HMM 0ZWIekvGBDq+y+aNeyXc5XFPk+KTKfrqWPtHK62rVoZ9NlaO87w3EjZB+ug6TzUynLJ7 ccsjDKttno8ZcdVUCzym83afGr6u6f45PUSVTPNOIwHS6LdZ8EdE+mJ6NcIudhtbJvLz a8u4iAufef+95PKJ6DdHKL1NqLvKymCe9WPyUOZbRZ2Hvv3fUNoHctKDaGZA2pbej7Ab uIxp8ndollBmM7/9h24GnzXs4TwGSL7VPLK/xp6k+BEv0lABCtJ0s5S9DBd0IEqGRLml QW0Q== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Nq+KeAI0yWzRuUfqJVFGtUPIM06TNJoqzDPASPwFoNM=; fh=1SdChNPjaj7JbnzJXANM9ms+xDUbJRlyQxmkVj4Uci0=; b=NaDbFJjpXEEBmgxQPOx/bQEjTFPjc5IX+WIY3k2oD0V7eJkTVER0j13vdS93dlIRCC GKFyFyrjrIJqfdGGE44z5DUcELo+XLtZW1K6MbyuuWiVW1q7mxZoORINSkhUYRhgBVA/ vjL4D7W+fvLCVqr2BOytPxIoWwzcuYJwDmgzKINaPeWeEsxsjgMZUu7aFX1yOl06HvIR BamWbsAD7iXg7CE05BdKlEfs+gQeyvrcy9MKHamEKXXAAdM6Yy/SCcmaJ46rryWJGK1j XkkReniGqRSYwdj/0h7YYHgRe7u9EYGJC1X4y2/fiPKUDv8YQt+n59jByREkbZDTKjIq uIdw==; 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-66734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b6-20020a633406000000b005dc0b1b0116si1019813pga.119.2024.02.15.04.10.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 04:10:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-66734-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66734-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 43995B2C0B8 for ; Thu, 15 Feb 2024 11:07:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D71412FB0F; Thu, 15 Feb 2024 11:04:11 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6180712EBEF; Thu, 15 Feb 2024 11:04:08 +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=1707995050; cv=none; b=WNZJ0YEIv3gfjfXHiSZpDMHnpNhks6SPPLZ0de6ZJ5bY6xbxFsXV7TFQN7zYH6/k0d0nbT33tTfWoFqUZInH9S4fQDRF9Eguwdy1ErYiIEEzW9CJn4ugcv/aAzrqe7Nmms9rV32Tp/I0+5Y3X/SQ7gq+1/Kc6toOuB2O293smEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707995050; c=relaxed/simple; bh=MyzTrVGiM5zowB9EEdnskgg9bJSOjLv5uQVVIRr+/Lo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MPRCPQ7nQVPUou0n966A3RYSeH2nQAUCXgkE5N3O16hCtTUFIPEB694Q6VAqLvSIIOtgp4gYozFDSku45bka3XPiIDC3YJOJ7v5f1axX7v0MD4Vk2qDtuY/zowZazizcwD8cRW/aN+bBh7gW4zqmcxMJOsw8GXETEXMrxhWo0eo= 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 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 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 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> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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