From nobody Tue Sep 29 11:55:24 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 C55D7306741 for ; Sat, 8 Aug 2026 12:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786191289; cv=none; b=Ik72LHmjpd6OP6wToz6kP9VP6dSsVn94QXzgE8QGq7BFGpcN3Bf0o7CLRZsBhNYZOSinCVSu9EDmeocS7tn2iV5jpT+wne/KoGB1epmmF3SarOBZHEGsCVbwgUY5+d+he+9DoqG8EtGD9EndbPFdQ5oX8KzmtqHZkyhdX0njAJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786191289; c=relaxed/simple; bh=iE5PAbMMog2SxG6r0T33gdxPgeSe49yLUjzn1kRovLw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CS4nr09oCFEAQe7nWWpLGY8e9qyW/WoZo2xtW53Ch8ijfCyzZc/OYwyz6GF9W+Vaghr/RABJgOHiBIELXrgtXh9e6iyxCh8IVCaeFH1K3YXBJ0GCwLu1mJ4VXsuAXLIgok8MHRkmXzzIs41Bx85WB73s9+zxurog34gONvb6Tnc= 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=RSQCkVQy; arc=none smtp.client-ip=209.85.214.169 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="RSQCkVQy" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2cea3004256so5282665ad.0 for ; Sat, 08 Aug 2026 05:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786191287; x=1786796087; 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=fR3OipClJn+6ckgYC/3aH7kLb8zueZhnpSjG/5qdPqk=; b=RSQCkVQyVCNs0xzzva2u8P0iUco0kN8U6rDCIO+tUucYlTX92ybr9/ciEyp5PbAFqp 42Lb85+GE9fau9z+6BpR8jy8eRGnQxI26yiN7iM0Nhiz6+Y2S09TBtLvvjY8OabpLxQJ MIBffNrtW/JA2qx8QvrDKqaKZCbzCVbSQFigyqX5IytpFO+giub5JtowHO1e6vT9WZXf 3nL3LrvJiLPdnZPZzZtBE361BV7OFXmxvA9tQj0leIM+taOZMQsoYY2jHwTD0IjR17PJ tCCiNYkd1aDCqirG9lvTf8L7Ip3k2MnwUOhlthTbA4ed0Iq1NVN55MZD7rQNU7xR4P47 M6Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786191287; x=1786796087; 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=fR3OipClJn+6ckgYC/3aH7kLb8zueZhnpSjG/5qdPqk=; b=XO19SjFQro8v1eK16yPd+PuimrByt+tahxJ/WUa7OBKIcMxg/THnKqRSs5YbCzbERw YvoIS1tsHwi+WTi9KgAT2XNe/EugxWq4vVZVGz/SW5UNkD++oQMTIohrxL5iRx1No9jZ u+61z48fVYbT1HsS8EVTckSty4HZ5jZ2OLVxlOi7FB5SCgWX77vxL87TYAfNuYdQxCTG 086bIlItXypkZPlOe/+0G/oH+wkvb8sAhThrWxylRCFZZJaidLPZG3Lgt+J8sqmII3vs Fb+cFoUHzj4KZ5jrI0sTm484iSEhpNTBpBU0dLr0CCXjt3vdHmMwENxAXvIJ2L8tOqVf +ytA== X-Forwarded-Encrypted: i=1; AHgh+RruNN0mN5hb8Ayy9a4mqiMUvnU6UOskw32muOZ17/scjhxKsPzHWLXZl9MCXp0K1roiz/LWLOTusknCdeA=@vger.kernel.org X-Gm-Message-State: AOJu0YwIgKeyh7aOcgtPfDl38JRUDkVeMHAkWyv+dYMRTjDFWGB/29ea 4tYOpqdoaIMFavCcwlqn0PwRg+58ueMU5Lsi6Q3cio1D1q3YcSOt+k9x X-Gm-Gg: AR+sD11HWpX6+3rqsA+ij97foxDgrXjMIHOVraTdtPxbNvodOCPaCa1WkRA9zR0Jtos wFkk1ctUyHaznV1cVc9QgzOBRQnuKNf5AiVc/v869ZClfrEgWnuONhKU+0dy2Bh03Lhq2oytfiz XOn/yB9Ameb7lDFncZHBREnTVlofRA8qW1CjMFAdZ0crKS7POYqucRrh19Pqjjwrl5TFdirTXHo XW2WKc8uMU53RL2kb2kSioktxEC7RKKbqvgzWlNYOi3pjyVTgbsJpNwep+HccQRvL3AfVXz6/FP bnHDjl6wCly0NVbM5EAyW6iBKYYBitQrUDgouxuFJo/1F3wDqHSe7pnV6Mc0RosJBc3UNczvJXY XJNFsoBDQnyooDaOlQvICf+OaCO8IPKMdCYrF+M+YaIXFtNInRRRSOIU8hCGyYUQhJIDKP/3HTB m6mu4n1riigMye2Q4D1lKpjfLg+p464oRULSUfzs+LOWBNQNGNOcR8H7Eyow== X-Received: by 2002:a17:902:e945:b0:2ca:d151:383a with SMTP id d9443c01a7336-2d0ca98f97dmr360786285ad.20.1786191287049; Sat, 08 Aug 2026 05:14:47 -0700 (PDT) Received: from lgs.. ([101.76.249.46]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d14ccdb26bsm18584345ad.22.2026.08.08.05.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2026 05:14:46 -0700 (PDT) From: Guangshuo Li To: Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Guangshuo Li , stable@vger.kernel.org Subject: [PATCH] drm/etnaviv: fix runtime PM cleanup during teardown Date: Sat, 8 Aug 2026 20:14:34 +0800 Message-ID: <20260808121434.2815841-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" etnaviv_gpu_platform_probe() calls pm_runtime_use_autosuspend() and enables runtime PM before registering the component. If component_add() fails, the probe path returns without undoing the autosuspend setting or disabling runtime PM. The remove path also disables runtime PM without calling 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(). Undo the autosuspend setting on both probe failure and device removal, and disable runtime PM on the component registration failure path. This issue was found by manual code inspection. Fixes: a8c21a5451d8 ("drm/etnaviv: add initial etnaviv DRM driver") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnavi= v/etnaviv_gpu.c index c314b3cb5e70..7acf2ed651f3 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1964,6 +1964,8 @@ static int etnaviv_gpu_platform_probe(struct platform= _device *pdev) err =3D component_add(dev, &gpu_ops); if (err < 0) { dev_err(dev, "failed to register component: %d\n", err); + pm_runtime_dont_use_autosuspend(dev); + pm_runtime_disable(dev); return err; } =20 @@ -1975,6 +1977,7 @@ static void etnaviv_gpu_platform_remove(struct platfo= rm_device *pdev) struct etnaviv_gpu *gpu =3D dev_get_drvdata(&pdev->dev); =20 component_del(&pdev->dev, &gpu_ops); + pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_disable(&pdev->dev); =20 mutex_destroy(&gpu->lock); --=20 2.43.0