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 4E6D424CEEA; Sat, 12 Sep 2026 14:08:36 +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=1789222117; cv=none; b=u93SKzhfL/lLq8aaFEebdYEhP1Yn7tqo6Et8uXhLGXQtfrYUD88SfOtMx8RVi3tl3qY1AP4G/CpDm2pN9dl579SUvkaziulq+mCqxZYCgeuHL0Og+Zu4meshzAm+Y+Cu/mFmy9RHbppefpuMZZWxp/lgXklZju0cFqdvckQPbxo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789222117; c=relaxed/simple; bh=4g787zOVlcCfkngv3m4SUmBeiDOEU2wSyi1ZmlSvyuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QBrsHHfx/JaM6Ccy9q2z24IrhHNjivRL0grgoiXEzeqk2XgOSH0CAO+U86G655F8Jqhvqk9RTCDzv+yNox7la4FC2tdcLAj+oFytylSMuWqKa2mG7w+cnJllO2gkStJPyKo/r91q6NVJ6B0QmSOvcUpnclR+1fLKk0meNtVCWO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=T5mwdpj+; 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="T5mwdpj+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 071BB1F000FF; Sat, 12 Sep 2026 14:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789222116; bh=nZOpUUqMsUJSLKMuXiErXIdyw4zL/xYWZpJngeoW4lE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T5mwdpj+sTf/Na+vEEVrZipW3mp4NmiWQCe5pWKVb0JmeLqXW2JfS+66ToKr4JoPw wcMBDSO1waHADafz77YRwRT4wHrGX3rMgFK87nhoGq69TG/SV3jwvbO8rRLHTcLADX 2SOweDatqk7C+P3TDRDvbhDtD47f0c2twFUuT13Y= 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 6.6 0522/1424] drm/amdgpu: fix autosuspend cleanup during removal Date: Sat, 12 Sep 2026 08:49:14 +0200 Message-ID: <20260912065618.983381265@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@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 6.6-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 @@ -2247,6 +2247,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); } if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2) &&