From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4C71157D226; Wed, 9 Sep 2026 14:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963059; cv=none; b=R+SiHQMtxYuuFZPuV3b27fQ/n7d67VIt2K72bNeAGcl7eVS1WhXjyrIJdW9LIcCXKA5ND+B9BSw9IGeY3pAgdYBMy5ZxVCJ2TpwDU43IG8aGSYcIstSsdcMvM4/9Rs4+aqvsyyUoOXFQ1uZDPmrGFUgN4tu2GSbj6a+kROp224A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788963059; c=relaxed/simple; bh=idwfWDk/FSHTB+cKwdu87ruk30NIb9L43u4ZoPNVLF8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uzY+CME5s9lSjkDzCl8ZbMWTGav5ctVcMn4wENMDfFnnVasnktYyO1Wp0Zbun/swpch/YkUW9+Yt/c1ZFnYs9bp3ZH5Yr6i6Kf94hY1chKkX+V6MgAbY9CecLAQTsvb0bYEnJAuZyYGB4bgrFoA3a9Wb0GQDJU4jnl5Jo1qB2yU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ixM1ajRc; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ixM1ajRc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B7FD1F00A3D; Wed, 9 Sep 2026 14:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788963058; bh=s+AjgHAi9tJhB0+yI3u47iMz2vmmLIWiSXDLDadv0VE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ixM1ajRcqcKibYSvUolBU9pI7jiH/HbHQ+UNBi8r1qZvK7ioq9ixCvuhAX0a52esE a2zwwMUFBr/H0nYukXrYPCk+lBPga0EZcX2g0azg12s5i0aldOyZEJ8KCRh5Csz3xZ KM21K1rm4F0jnDptUe0Z9Zd1Xgz0tGEvk1IubfM0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , "Mario Limonciello (AMD)" , Mario Limonciello , Alex Deucher Subject: [PATCH 7.2 505/556] drm/amdgpu: fix autosuspend cleanup during removal Date: Wed, 9 Sep 2026 15:43:05 +0200 Message-ID: <20260909134248.230834229@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134230.441546314@linuxfoundation.org> References: <20260909134230.441546314@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li commit ef5fcf2a6c320676bf8be2dadac93d9023b468b7 upstream. amdgpu_pci_probe() calls pm_runtime_use_autosuspend(), but amdgpu_pci_remove() does not call the matching pm_runtime_dont_use_autosuspend(). If the autosuspend delay is set to a negative value while autosuspend is enabled, the runtime PM core increments usage_count to prevent runtime suspend. Without calling pm_runtime_dont_use_autosuspend() during teardown, this reference is not dropped and usage_count remains unbalanced. The documentation for pm_runtime_use_autosuspend() also notes that it is important to undo it with pm_runtime_dont_use_autosuspend() at driver exit time, unless runtime PM was initially enabled with devm_pm_runtime_enable(). Add the missing pm_runtime_dont_use_autosuspend() call to the remove path. This issue was found by manual code inspection. Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li Reviewed-by: Mario Limonciello (AMD) Link: https://patch.msgid.link/20260808120934.2813010-1-lgs201920130244@gmail.com Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -2548,6 +2548,7 @@ amdgpu_pci_remove(struct pci_dev *pdev) if (adev->pm.rpm_mode != AMDGPU_RUNPM_NONE) { pm_runtime_get_sync(dev->dev); pm_runtime_forbid(dev->dev); + pm_runtime_dont_use_autosuspend(dev->dev); } amdgpu_driver_unload_kms(dev);