From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 9BD7F390208 for ; Tue, 9 Jun 2026 07:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780990455; cv=none; b=eaOEbPDJ41GIR9W2Q7JAktXCPPlSFn45A14wbfEbjGlgf9cp5xVgyi9pTKQ0hTX4+6eXQGU9Gii6wgteD/wWYN51UU+Y7h1ohhamshb1qoN56JWYJNXBWlyT5Udb2ZiwabjLmf3YHg5nEFbb5qHrBRIxlTJHXiCfvguYY4aAvpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780990455; c=relaxed/simple; bh=VNK6haiO1QuWOrbg5O8HOhYQnXV3kZqCiU5MhIltFic=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MRHy+y11wNYTQVEQGXYotvQ4EVBUskHayZphb6vQA4KNtedypmSd3tgQonFGP8OcrJzwg7LzOHsIaGtz1VJu5TJPl1gD45JYQBh9sPbFa0w1bSpfoOZAeHtAsqY3C8e/Jp0/sauO6ZJigd1Qetk7OX/aEqQ9R+P3XNgy8b9+4PU= 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=XzVYt8HY; arc=none smtp.client-ip=209.85.216.44 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="XzVYt8HY" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-36d98b68d68so3399624a91.2 for ; Tue, 09 Jun 2026 00:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780990454; x=1781595254; 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; bh=eXLhOufDUGH9RyGTzlJd0uwXniEfiIM0oyP9s5OGvWg=; b=XzVYt8HY6ehdrTXvWA1P3U858GA90G90TOwkDl59T46cxeN9+wf1Br/IfJtDsubA0h SNVQETrW+32G8MbigxxU+JpReacT6HM5Rrsaq+HvqEUNaTK6nKWme78JxiOW6/VBZDvs 3pft5Bi93tkiMoPA2GDX+lJJKhl2/cjH8hxyrAAtR53DmTBp5N54EJe6ajvcurwEROdi NnP33Y9f/sG4u/ePMcUwkDPNpaW0fvKNQDilBAMWqhRxC4RN9weCXK7bmXsb+1TvZJxg /6Bpi9WlEMRHAFQsBNSOrIto7r7tGKwiCITlMwuzaV/F8sIAfD3F6i//txxCiXXmLkvJ dSAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780990454; x=1781595254; 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; bh=eXLhOufDUGH9RyGTzlJd0uwXniEfiIM0oyP9s5OGvWg=; b=Kx5gLxUlT2O8E0TfCrfZzlEXQ1bK4p0TpyMTYZSK3F+6OMmRME3uZG6TKoLwnZpMd0 i95dk03BX0oDDRf9+MLAvPGUEZV22ECMBs0ZyUMGH2p6qmqFJ4EXWPBIQ8GuykIB7hh3 ovj6NNwXgPjYES8O1bJINbuxiSsPfUeXmP7RwyZ2pU/IPIOwfMC0c71Ayn3uyduu9y3I cdNEvKe8we89qVvcwY9E/IFF3Meb3gMouSHmU+I895M1VlSZZqK0avIoIioJSknKWT4c /ndE0ZaJY9AIoTCFhWR0W7o8hh/IBuQKEHAngALZXHefBGcUTWnSYU+uaBjOUfUppvP0 yeCQ== X-Forwarded-Encrypted: i=1; AFNElJ+d+qa4xS5B1fwZGgcrbjI/dAhMTGDYvx+wcKDZAzRM6eCXIbMYt+a2SlVSvx4svIesDbX+aPyQK5vY0cs=@vger.kernel.org X-Gm-Message-State: AOJu0YxUV0lBet/0JJGVkizObBjsIaez44lT9kLCBjxGZbeIbTaFWYxd BfBFvzx1+SP8XVyl2I7iAW7SJeZ+qHs3LoMvNSf37ErMAX8D88H6B8j5 X-Gm-Gg: Acq92OGZPEhJc9WQqCV5R/PmIuLkILsFqMCQM1KrmsaCnx3C/YvgSvNt6TDDSLXWs/j BRfa1rSViJQfUsTytT/NXKKRKigcEyVtHMas501al4lL2VIHafuvyb5Fiz1QAsqwFNAjsbXXRcm SdM7Q0K+3FMEsPI08X9iIrPTk/cXYl4zoQz0Zl2pPU4/CiHTHcxdgKAlISMpgY8d5EFy9W6DBEJ B/zcaGwDGrxkjZFP+FtcZNIHb9M9i/HbwUrslXp2EWBn1MfU0XQ61LWXHvNtp3uGEjdUIzgImux Y/6TCftbiMdk+4Lx/GO2UZsO9id9KjOtCorsCinjrCkJmQKHCSdIPHl6FQd34JGU9UnTaWCH5/u iG6j+aH9x0NLLiJrixGPAhfIzxvxln1gnAl7j3KhdrMVdBYtg9/BqhIPRHoe1+ayrvtCTYHKVeT hW71nx9rQIU2kI6KdPQa2Fz4xFzPM08tkuU9ldDiSJ2MCpRiVxneFPbQ== X-Received: by 2002:a17:90b:380a:b0:36b:b06c:30a1 with SMTP id 98e67ed59e1d1-370ee447ddemr19641700a91.1.1780990453907; Tue, 09 Jun 2026 00:34:13 -0700 (PDT) Received: from haichao.tail057a43.ts.net ([2001:da8:e000:1206:37c9:44fa:729b:6aaa]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36f6c76f55asm18214326a91.7.2026.06.09.00.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 00:34:13 -0700 (PDT) From: Ruoyu Wang To: Boris Brezillon , Rob Herring , Steven Price , =?UTF-8?q?Adri=C3=A1n=20Larumbe?= Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Tomeu Vizoso , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ruoyu Wang Subject: [PATCH] drm/panfrost: fix runtime PM leak on remove Date: Tue, 9 Jun 2026 15:34:07 +0800 Message-ID: <20260609073407.5-1-ruoyuw560@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error. panfrost_remove() uses it to keep the GPU active while runtime PM is disabled and the device is finalized, but the usage counter is not dropped afterwards. Balance the get with pm_runtime_put_noidle() after disabling runtime PM. This drops the extra usage count without requesting a runtime suspend, preserving the existing teardown sequence that avoids suspending after panfrost_device_fini(). Fixes: 876b15d2c88d ("drm/panfrost: Fix module unload") Signed-off-by: Ruoyu Wang --- drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 074c0995ddc26..d78ea7d4d099e 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -1027,6 +1027,7 @@ static void panfrost_remove(struct platform_device *pdev) pm_runtime_get_sync(pfdev->base.dev); pm_runtime_disable(pfdev->base.dev); + pm_runtime_put_noidle(pfdev->base.dev); panfrost_device_fini(pfdev); pm_runtime_set_suspended(pfdev->base.dev); } -- 2.51.0