From nobody Tue Sep 29 11:19:25 2026 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 0106626738B for ; Sat, 8 Aug 2026 12:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786190499; cv=none; b=spykewPAFjiQ93a1jMNTF5lleTngKJ5cRAzmfTws+vU+D4N+UzzYITsUnJzTcypr4glYv2KxuBVN2ZUqjwo30vLcGhb2tqNbv2KLQMm/hvveHPjQmbMpl9HLohaKt+FPnND9tbrqzQaHIW1USw06ufjRVHx/fOgsljeCLVLeW8I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786190499; c=relaxed/simple; bh=VdKmF0MAy9JnfTs0lWJz1o9FwtWgy0AQWX/cZmeJ1i0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nfj9yDmJ5TCxt4Hgpq5ZeLGhs9ZpytnN8MAHIR0rQOuAzAmXuzrtFWYk5zZBcktFBFZURtugCZsyn8XsY+ngfPg61BVGlfBxDf83sjfvVwq1AKspy2eSaRVxdhrggC7632jNg9YduAy+3vtfN/I7NUeOohq5xhIILqOsFPGwU28= 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=meotUP5x; arc=none smtp.client-ip=209.85.214.178 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="meotUP5x" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2cf50c6f235so4329675ad.0 for ; Sat, 08 Aug 2026 05:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786190497; x=1786795297; 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=K/VDwU6YKDYusuf3bOyqkfoe3Kms6rSYmSwfDWd4AYg=; b=meotUP5xW9HTCr6QK2vUhrYpiZ1EFmoLxKYtRrahu1TkqLv5+VqSMK5iA1h5Jneceu 5FVNZKjkwoYTYTLnwrHb4mhADXsDuplAWFbtJSmaNx6k9+EfYRk8RkQTNmrtD4o8HBON cnl+7BMWdEzh+vIQj8g2NhD2j9iECkDMoYdugWvfZfAMqdDgx/QTct3bF5bFqHVudtbH IChVsTlm3c6Nt/zEgCLwLEpAfeYR9zPAqZiAZiUTHgLUl/c/Axt5S4yBzE19uNIByTH/ 2+DuyLGr7oOJ4J0IWgKI0gAyBvMNo/cZOSvL3e93G6Dm3+eRgfFqsuXF18//Rl5zWBUN iFIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786190497; x=1786795297; 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=K/VDwU6YKDYusuf3bOyqkfoe3Kms6rSYmSwfDWd4AYg=; b=NOr/p7Jan4gK1hAOi6/wbsprbFojK89UM1Eps9UGzbSKEkR4SGYXpR0dtYeJwPUHag IJ+/fXkJo7DgggH+cgfFvSBGEcoCT0FIdzzYKsknWmMa9+NWaDrdctsN+wYpyZK04A7U ra0TonaupfTnUmoZB1nrAQbq9dfmoAO3rLQ5EhuqJS9DrUijaMxXuvgp93bTm94XecM2 4nJPqd96kynIzCJGqPhfLDAHxYelgw/d79xY6Wlerztu8IQRnoY7HFx70GzHOlWYa383 Z2Z8izjFthDyHP/mO+z8JyBeZnohbFk65qCvs8Qq+ZqZPlP4WeG5GMRrhLmbaPekdKay cFYg== X-Forwarded-Encrypted: i=1; AHgh+Rq1lP8QepWmMTcwQ9QWsBRj6vRhS9gZ05wtFdzqblcvmIdmgRsUObpPYPMw3fIenWPmRc4cxq1CUcctEKA=@vger.kernel.org X-Gm-Message-State: AOJu0YzsKC+5LqmarcB2JPYQDXUW/OP5BbmKVxHEWfXGdus8r7Dqhiq0 DsoZ1Er2/ijE0gp5p/jHF7YqLnhwzwEV7wdRZykxDy4BQhraUu6IEDPq X-Gm-Gg: AR+sD12CJDnS8RqNjvnEAS6raesgCK41pioGxhnnzXDzMgXe99QMBVHWfVnfq+liSDx l0eHOY5HwgNpFr+YQAkxZVpiOODHS7vbCD18aj0ZZPPoUZ21uKEg1N1UUTx1Xq3BsjSH5zZUcip H1CUNBHw9y9R3DO9NihSDKzw4ah6X9Mm4JLEGA6opLfcWFUcagF/LSO4lBou2SkUjk6K68hmjWC e5na/r1Sd9tt51femQc9q7z6gg00N2DfYBLlL3Iouk9+drnFDJKGIdI03ZQ6QKK8MMSiBrVjCG5 exFYGTWoptLAutFULnqAVJe/Oa815jGGsR767R84+6dAKGkPYt+kDFImNAe8SPYHTlDfFfO/rgE AdYhng+UdNu/3vWCsxgotlmY1DA3LhDXb8ids/RL0JsU4buUqwSD32Hmg6SIbqruF6K8jAUhmmF DtcL1P+snWZvJ0Q9TAQCFxLWqKQpO5jO7s/REKouk0Oog= X-Received: by 2002:a17:902:da87:b0:2cf:4c0f:5129 with SMTP id d9443c01a7336-2d0caa03fcfmr299424925ad.17.1786190497182; Sat, 08 Aug 2026 05:01:37 -0700 (PDT) Received: from lgs.. ([2001:250:5800:1000::f280]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d14dbeaa88sm18073605ad.39.2026.08.08.05.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2026 05:01:36 -0700 (PDT) From: Guangshuo Li To: Vinod Koul , Frank Li , Michal Simek , Abin Joseph , Guangshuo Li , Radhey Shyam Pandey , Sakari Ailus , Kees Cook , Kedareswara rao Appana , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH] dmaengine: xilinx: zynqmp_dma: fix autosuspend cleanup during teardown Date: Sat, 8 Aug 2026 19:52:28 +0800 Message-ID: <20260808115228.2798481-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" zynqmp_dma_probe() calls pm_runtime_use_autosuspend(), but its failure paths and zynqmp_dma_remove() do 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() calls to the probe failure and remove paths. This issue was found by manual code inspection. Fixes: 64c6f7da8c2c ("dmaengine: zynqmp_dma: Add runtime pm support") Cc: stable@vger.kernel.org Signed-off-by: Guangshuo Li --- drivers/dma/xilinx/zynqmp_dma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dm= a.c index f6a812e49ddc..635c3f6cc5c2 100644 --- a/drivers/dma/xilinx/zynqmp_dma.c +++ b/drivers/dma/xilinx/zynqmp_dma.c @@ -1116,8 +1116,10 @@ static int zynqmp_dma_probe(struct platform_device *= pdev) } if (!pm_runtime_enabled(zdev->dev)) { ret =3D zynqmp_dma_runtime_resume(zdev->dev); - if (ret) + if (ret) { + pm_runtime_dont_use_autosuspend(zdev->dev); return ret; + } } =20 ret =3D zynqmp_dma_chan_probe(zdev, pdev); @@ -1152,6 +1154,7 @@ static int zynqmp_dma_probe(struct platform_device *p= dev) err_disable_pm: if (!pm_runtime_enabled(zdev->dev)) zynqmp_dma_runtime_suspend(zdev->dev); + pm_runtime_dont_use_autosuspend(zdev->dev); pm_runtime_disable(zdev->dev); return ret; } @@ -1172,6 +1175,7 @@ static void zynqmp_dma_remove(struct platform_device = *pdev) zynqmp_dma_chan_remove(zdev->chan); if (pm_runtime_active(zdev->dev)) zynqmp_dma_runtime_suspend(zdev->dev); + pm_runtime_dont_use_autosuspend(zdev->dev); pm_runtime_disable(zdev->dev); } =20 --=20 2.43.0