Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp423254lqt; Thu, 6 Jun 2024 07:35:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpJgTOto/aCoNfbD6xNlqCa3G9HIdMcH0ihQm7h+tKDbirCtYQmb8pnsdHhqrk3L+o3D5aN+zMUDFwI2B6Ikmya6CH8HLKOC4dLwU+qg== X-Google-Smtp-Source: AGHT+IGWSMmrp/NMhRWXFCVD/GqWhSmOm3jLrzZe+BNmwH/MlivPQjcavhPHhu2FMYIgywvdjtia X-Received: by 2002:a05:6512:3da4:b0:52b:8342:e0fe with SMTP id 2adb3069b0e04-52bab4f5eeamr4589816e87.48.1717684529523; Thu, 06 Jun 2024 07:35:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717684529; cv=pass; d=google.com; s=arc-20160816; b=dH72mOx0sq4wKppedi9iVckH+ukLUv4LODgApugCDHKrkVbo0LOtr9vKXwU24jxK9E fBfFPdW06jcNV8fwTyQ6uIAAjmQRgCOgp2nr05Z+YGhB5/mIIxVNvAXpyJvUOYdGeQ3A DtkJN2dolXmLIOwtFoV1fHvH4aBB0gqNcUTeyYQGXNWAAVPhCjvsEJ2+JgzEXRTqcTsT 93jpoT1Uj39D+EJWxqNEuMi+6oN+5GZCRGM6r7w0u26uDtywSQnJAxmwrATGqERrU6Sk wl/4kxu0cXyCjvfQlAIkOm9CgVX+QpwIckwQUrrawxPN3DIuMPDvZ6k/54daQn1ZyUBF U42Q== 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:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DQ1NwK50Oa0TW9kT0k8+/2CfP0iBlQrwviCDbEG6RBU=; fh=icCGCe8WycbQyriL2vgYkXtuNiJIkenZM4b1wEA1/FU=; b=EB6uFlIdUY07r3g/J+NQZmb3nmoHNxWuXMGq8fHSwtW59Zr6CcqGG9qpMSySwjgiiR fcxH4iMB6CFeNxLJ9EMPRF4MErdhrL4cfIQtBXMYSvEiw4mq+ae9U/2GHQ+6wKwp854/ 7HNdxrbqP6qomXs71EPD3KMvuwCmdK46nYvwVSwUyDD42dCkVQKdUTSABcBvUIZ2nZoy jQ52G6LdxqZn0gWe0pZU2kSeP5nZu2zfl6k6q3g16TffGTlkT8yNyzVVTpzltf+/7nBy rnwacEnOU4xICrZgzUSVHK/t+L3Ek0FsGkdCmxBDA7TJS7pAjduMPQTDh+CxmcwKQTXd mxqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yoPRq6ZL; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-204432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80749841si73807266b.973.2024.06.06.07.35.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:35:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yoPRq6ZL; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-204432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 702741F2620F for ; Thu, 6 Jun 2024 14:34:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 612C01A0AEA; Thu, 6 Jun 2024 14:17:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yoPRq6ZL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 845E319CCFB; Thu, 6 Jun 2024 14:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683427; cv=none; b=C6kBtAaIhxAkhlPXpbEFCg2tdGlxwJRN6JuVfFx3vL/aWqIHX5q+YWP2SPde5DJ2JUlP3xowA/oxmQM6c1NPL+ac1laKsb+K9nqvNDZY4xxChb3+0ZJKNEU71Vuxz/fCevLHRFNDMlp3r6+YDrGFp5H0HiHtF/Bwnu8GfMbYZKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717683427; c=relaxed/simple; bh=7FPLIoOdl0Zmsq6B7Q7QW7kzcK/k4/6nu2KE144GnMU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SzxJnqkjW6Qwm5Vg3gEBquVUcLsM+5K00PbAgOS1ZcHk9H4VAVJuQsjSyrowaFxEhxEpt6gzJbw+xiWWslHONj4agQ5icJksniAoolJUym25lgdPojNbpvkb+IRlBt3xeM6BYfIeil3GzL3PC9UD+Vr5UBA8O81xFws8LPPRXCM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yoPRq6ZL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56925C32781; Thu, 6 Jun 2024 14:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717683427; bh=7FPLIoOdl0Zmsq6B7Q7QW7kzcK/k4/6nu2KE144GnMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yoPRq6ZLMsTyHQ/CYMS7UjlpGAGUmRDHt66Pvqfas6tKJkH5+IcU4qlUQeyU7XDE1 0/ceEIqLcc9qLLqxfURFetbxPSk4s0jCjyGYCLCA4Be61QyQF+ytpavoBLnknbAqY6 Ixyx+zIlP1pUpPblxmltKniClJcQ1AyDb7LAKDzE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, Anshuman Khandual , Sasha Levin Subject: [PATCH 6.1 313/473] coresight: etm4x: Fix unbalanced pm_runtime_enable() Date: Thu, 6 Jun 2024 16:04:02 +0200 Message-ID: <20240606131710.288688254@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606131659.786180261@linuxfoundation.org> References: <20240606131659.786180261@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anshuman Khandual [ Upstream commit caa41c47dab7e1054f587e592ab21296e3a6781c ] 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 Fixes: 5214b563588e ("coresight: etm4x: Add support for sysreg only devices") Reviewed-by: James Clark Signed-off-by: Anshuman Khandual Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20240314055843.2625883-2-anshuman.khandual@arm.com Signed-off-by: Sasha Levin --- 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 fda48a0afc1a5..63fe506a60314 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -2053,6 +2053,9 @@ static int etm4_probe_platform_dev(struct platform_device *pdev) ret = etm4_probe(&pdev->dev, NULL, 0); pm_runtime_put(&pdev->dev); + if (ret) + pm_runtime_disable(&pdev->dev); + return ret; } -- 2.43.0