From nobody Tue Sep 29 11:19:24 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F6942D7393 for ; Sat, 8 Aug 2026 12:11:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786191111; cv=none; b=rVQIOFRzK6XwJfxM1R20Qx5t1p1Iumin+2u6Nr8FCJYj75L8YfTUN+Q7B1VpTnoQZYHONGYWgnXun3w+7XEOOKVsUdC8Qcu1lFuPFRMut7i0stIbWB9QG6pJa3H+GjkG9gaioBUA/KEqjTt+cWg7nAn2h4zim4fkMxTmeUcCwt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786191111; c=relaxed/simple; bh=9wZYwXRVe2G/vTq2B8Znoy+bMm9uJkSKcgJbIjP/slI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cCI7gbgUmsMQCQlqixkGgnDZHzCqr+/N123Zwh0S6xmp4LXj4GL3I8A6ttiHAxLQZitAhVjRo6WfLLlLUNtnv9P2/hQzCHKnYv2w+LJWH1zgniVRB4sOGiitf2aIY3Ws/f6P/T9EoA797BKi0GhCYIZNiLSRusGcSAFPvfefXGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=S5Bnauo8; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S5Bnauo8" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2ced3386430so5421965ad.1 for ; Sat, 08 Aug 2026 05:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786191109; x=1786795909; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=qqtodrANULHy2HebqvyH0gpSUnDrF1cP92+56xd0b6c=; b=S5Bnauo8jx+b1bt++IOJt5EktqgoJQMmvFP7FW3MEIbbNfTm4ae1yc5I13D5ytmfuQ 2kgw5cMLbyKnzTf5kYgDCai8DzwHdUknP+6FzY/ZPvPO5V2Pb5b5ysBhVWwfk09n4D/N IYnan3bPA1ujc26N0w0KlotBUYME4HHMVUfqrAcS8ARsmVtUpZst3fIZKiCSuZL074g6 sTmyz1jDE1N6GypMCopKVo3HrnVHURp+fWJxlc6E2eg7O7JVFNaCDDTLzZzsBl/0Gf7h OaMPmrGKatjS7tltqUo7iOIpSQ4C4uIqGn4UMdripnyKs5nRGfZPBw9hMDNGNDk18ls9 6JLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786191109; x=1786795909; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=qqtodrANULHy2HebqvyH0gpSUnDrF1cP92+56xd0b6c=; b=REmXEMPN0bOnlXVwwb34swFFaZnov44vx3Rgql9+iW0CCqUyIsPehmKY6IsciuoqQk 3nWG5Mtg6zzVMU89n0D4f5tIHG3+R6dpt/UM8Apz6O0pMT7sBXYWPtT+e69n+XW4L0An ov98EwTDDIam++dO7EEEXQKZX7FQdXZuR5uJkOS+S1I/coXqAASMrc/IDBNZteBZkvly GT25CnhMeF4G6c/vS4ZmoelsSIyQdX9NfpDQzieRljcqsO3wuVSUjzLD6hO7i0zQ4FTx kEGTw6o8Vfka/OmsKbXYs41D6y4SUUvGvhXScNnCxBoPVoj+ATW0B5hwBs1JJlN1GMKR 2JEg== X-Forwarded-Encrypted: i=1; AHgh+RqLKHi5ZMWfpWFijLPjVZy590eV99WPJkgK5enL3Xl0oHCbLyMfVhA2wwAYIPML8nAql6ONyrKAQLT4szY=@vger.kernel.org X-Gm-Message-State: AOJu0YyKhdlkzRUgUfI86KGFIC87aq5wGPFzRJiGmidsx9Jsjk+TjAJC rD8kS195yTvOTUooXMfIHxIXvIsAGoUi4Vvbxff0Ffmd5p26PRfiuSE6 X-Gm-Gg: AR+sD11yBoE6Vh5vQHv8ktf1CjpPaSOvCGdCY2Mk4vkr68j0yjCXDBlYqr2UGElLRaQ m3J/kwqc4IKf+a+tcBZEC1EjR4eZM1U86xvtrZIx6/ZSheL2tTi71zKk8rEMCvHsLz/mq9WZjNm dQ28Fu1sKHExnZweIxEn6tYgf+bR1FkVoAP9uTa748Ys3T6mNRNp1cSl2opxtcCp8N/cReKOUBf dYy+7jU2pPnCPhyW1jv84tNs57s4sQfJYC8EaaxCnNlN6TgtdMfTLB73tsLTtRNunhP0wwlKLzQ WAEu8LA+HGBLiiaMfPdWyUDd4MVbzedKNZfxbJTXXnEuGcxdgDLpxsdgz+yBpN8W48HcWB5eiPE ioEfrbySNCFMRIddSVAKqpMKCV/ycnsUnbhypIubjdQlR10aN3z6BwEHKjBZlGTN4QE8RBqrp9q blxAZOq43GqHYhuBOK1Y5RE+uuslinQI8EbfPXbByEHfM= X-Received: by 2002:a17:903:2383:b0:2cf:4544:104b with SMTP id d9443c01a7336-2d294b29144mr139478015ad.5.1786191109424; Sat, 08 Aug 2026 05:11:49 -0700 (PDT) Received: from lgs.. ([2001:250:5800:1000::f280]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d14dbedec6sm18151975ad.44.2026.08.08.05.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2026 05:11:48 -0700 (PDT) From: Guangshuo Li To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter , "Mario Limonciello (AMD)" , =?UTF-8?q?Timur=20Krist=C3=B3f?= , Mario Limonciello , Lijo Lazar , Ivan Lipski , "Jesse.Zhang" , Jammy Zhou , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Guangshuo Li , stable@vger.kernel.org Subject: [PATCH] drm/amdgpu: fix autosuspend cleanup during removal Date: Sat, 8 Aug 2026 20:09:34 +0800 Message-ID: <20260808120934.2813010-1-lgs201920130244@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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) --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/= amdgpu/amdgpu_drv.c index 1aed121f4ddb..e814701bc8fd 100644 --- 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 !=3D AMDGPU_RUNPM_NONE) { pm_runtime_get_sync(dev->dev); pm_runtime_forbid(dev->dev); + pm_runtime_dont_use_autosuspend(dev->dev); } =20 amdgpu_driver_unload_kms(dev); --=20 2.43.0