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 4B2AF3932EE for ; Tue, 18 Aug 2026 09:20:40 +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=1787044841; cv=none; b=RhWf0r/Yy2yd/dxirkW0tR0PBiqAMH5gvOI48QCgCkOgYHTIBwwms7d8uG/vguQy9V1l8LBz396W6CARTWyCa6ASyFnjwE/xcDRebDrv9U74za3+YNaPB/lLaICmg57B2fEXZh66C0W4v7kFzLdtH8j8hykcWH+8Tc64Gj+Eim8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787044841; c=relaxed/simple; bh=/unT8OWgoDfpF+WSRg0AarK1VSmp3skzjjymvynFikE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qgn/wrMTeBJvrbrm5MX5o00tdKddNX7MugUplrhC9SEPy6mNNJZI4s85oxvODw42dBllzNC4Y6M8+jJ3oH9aDusVxsvEvBhjnw86XJjgF1qIHDuwZ4OkuNcjXOQqSWLm/2Ex7rE0BBLatFbTRoxdk+VcViUiLxBnoRsFr11AcyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gke7wLBc; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gke7wLBc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F38511F00A3A; Tue, 18 Aug 2026 09:20:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787044840; bh=S7CU6RJfQ2KIdGMOXNjexKqNiyc8867FCIv/81f24/c=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Gke7wLBcV07/c/mYc1QlQX/fJNsVSfRfOsFZ0hcx7g7fT7kHMRlg3iwmzFU1fyUi9 0rOv97ZEylBydgWshNwaetGxXzT71EsvTBS1WngxNyizbfeATvk78SFrjP7Z1SsaoI 3a111ZM/ghVUJqf1vQx+4B2OUrUIpWl0/1030wDJl+qgeiKjkYu2CJqx0n8qcDDsyj SnyZrmSFxpxyj47vr21mdOWzakvLcynFjH3BR+wXpkh0IQ+8sIRZwAW//Az2jx0piA 575eJEEBnm8u49IBFfzQH6/Tch+ofEaDzSWQQ9JCC9RLA0RkVH0lHRlt0iK2G2yHjB eqcFV/FPT6J+g== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wwFzp-00000000ofl-2kds; Tue, 18 Aug 2026 11:20:37 +0200 Date: Tue, 18 Aug 2026 11:20:37 +0200 From: Johan Hovold To: Guangshuo Li Cc: Min Ma , Lizhi Hou , Oded Gabbay , Karol Wachowski , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] accel/amdxdna: fix usage_count leak when autosuspend_delay is negative Message-ID: References: <20260807143200.2500342-1-lgs201920130244@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260807143200.2500342-1-lgs201920130244@gmail.com> On Fri, Aug 07, 2026 at 10:32:00PM +0800, Guangshuo Li wrote: > amdxdna_pm_init() calls pm_runtime_use_autosuspend(), but > amdxdna_pm_fini() does not call the matching > pm_runtime_dont_use_autosuspend() when tearing down runtime PM. > > If 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 > driver teardown, this reference is not dropped and usage_count remains > unbalanced. As I've explained elsewhere, this is just misleading. There is no usage count leak here as the count is balanced whenever the user re-enables autosuspend through sysfs (by writing a non-negative timeout). Drivers should clean up after themselves and disable autosuspend, but this is more of a clean up than a fix and should not be backported. You've sent upwards of 60 of these in the matter of just a few days, some of which have even been picked up. Please send follow-ups (replies or v2s) as soon as possible to prevent further of these from getting merged. > Add the missing pm_runtime_dont_use_autosuspend() call in > amdxdna_pm_fini() before restoring the runtime PM usage reference and > forbidding runtime PM. > > This issue was found by manual code inspection. > > Fixes: 063db451832b ("accel/amdxdna: Enhance runtime power management") > Signed-off-by: Guangshuo Li Johan