Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp277378rdb; Mon, 22 Jan 2024 21:47:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2ztGDIL5krJiL3llp7T7jTYRLGDfXKnAxUZbnD+I9MiRqx8OQwsk3aQa7lAwTdL2Oz5O/ X-Received: by 2002:aa7:8888:0:b0:6d9:bb2f:3a69 with SMTP id z8-20020aa78888000000b006d9bb2f3a69mr3521615pfe.28.1705988832426; Mon, 22 Jan 2024 21:47:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705988832; cv=pass; d=google.com; s=arc-20160816; b=yPXOqe+0p6M5lpq8xp4Ui44R/eaAJL6/PsmoDB3JD1x5Sf+vtMJDsI6rmiUjP6jwmQ UGF/q7pugvXVlYCtvE8q771rBKXQcrlr6KpfS/JUXu90ApRub+SMj73MXe17KLP8ELbb ZqsJutZkkp5k4Q2D9uovgUsx5LIXXajYii+yeRN+CssoqCamnne1fexWO/6XAMLGWW3H Nz+nCOreTWguX8C8vcNC3BLG2bGvIozQH+z5kHy5EKWpGwORzmC3GkYVpnBfaXBwO97H P389oAm80bIQAsM0FfjAeGeaxLvGcZKNVFlY0mUZkfn86O1DF0HFUCrUadgpp92tCkTW qSqQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b7-20020a63eb47000000b005cfa56b8305si8565863pgk.315.2024.01.22.21.47.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 21:47:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34733-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34733-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A8C98284007 for ; Tue, 23 Jan 2024 05:46:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9297525B; Tue, 23 Jan 2024 05:46:36 +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 To: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Anshuman Khandual , 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 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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; } -- 2.25.1