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 E2E1358E2CB; Wed, 9 Sep 2026 14:33:24 +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=1788964406; cv=none; b=JH/MsXI2OHeOq2wBiZBCvpmL/lhQtWtzXdZ+9ytVegaRt0i1dm8n3JsgomqgSVwuORbGPCm4vILQuMvQx/z6FgW3s612q8j7gYxf8LWscNlSMgXH2bJ0PqKC51eW+Vpd3GPscBrS1FCy9cefVu1DBvYFgVfHtfPPQKjEDlA2tRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788964406; c=relaxed/simple; bh=IlVQ3OT2wC3TWgBtdI0266HCA4rttQKYj/chxA/VERc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NfEl/9cQfIxMpcCuQtxYC5T4zsCijyftLf1iRV8vL+VgfnYKkUjCuAJeNKvo1KJgvlMXyDhLqEaLCCUFtVUHDRxBnNjfJePG37g6JbsPbBD3uLM71GDHKN4vrlzRxHMPqgi+FpGL+gu2HI71//LK2AaK1gsYBTYo1HFFC6HPdtE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aNzsWArn; 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="aNzsWArn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22F871F00A3A; Wed, 9 Sep 2026 14:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788964404; bh=1DoyInOh/CjpG627XuiMBWebKjLJy5UA0xXEXvByw7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aNzsWArnUwU/ohXkL9HbBWuXs4KqgMg3MIikZhpyK6VN+UU+duWTutabW4kDkr8qa uWM6SUGfUJ77RRimF+JKSVRvOBbbyVtOcK/ucLZLelbVjyFJQRwZRYpyJHdpKOZJfa 7NKqOiivgOQBxPno2OySMPSoKNsfvpxChq7udXzA= 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.18 394/583] drm/amdgpu: fix autosuspend cleanup during removal Date: Wed, 9 Sep 2026 15:41:19 +0200 Message-ID: <20260909134251.640825714@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134237.773280130@linuxfoundation.org> References: <20260909134237.773280130@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.18-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 @@ -2539,6 +2539,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);