From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 29DE22F237F; Tue, 17 Jun 2025 15:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175342; cv=none; b=auxAgTI4EPgiyIJYMl+5VBmi/1MlbZi8ikMMIBSDuWv4K4ud2YspBmWDf/95O+4WzGvty8/pnUdb5rJaO/Qof7AJ22QW07rzBnJR938yjORdFwYorFVW61J1q2cX0iEM348XiO6QCSGydaLj4UNxCpI/+OBxG0plgodYGlqQBDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175342; c=relaxed/simple; bh=jngA7PtLvzZFxEPN6jQo+UT60KPhZzPLBXeOMi/i/wM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jz5kxpKlJW1sxz7ZgBjLn3vIjA4VBC3uz9kntLBDT0LZV/ynpSXZO5IJaQVkcPJlVxvYqHVFqAQjl2Zi4brc59DzqvuhIP0QtzCjK5vX+zHlOIUBgSInKRchWFZudHFrj/pCHBzo2K4UNDNaaFtO59dKmKwl6AVG0ag1xvacV1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QG84wYML; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QG84wYML" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 411F8C4CEE3; Tue, 17 Jun 2025 15:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750175341; bh=jngA7PtLvzZFxEPN6jQo+UT60KPhZzPLBXeOMi/i/wM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QG84wYMLh4C1CMT2tKAXzuKVLpke734y83QRQ6EQSAE+nfjq3Vcm5pENtMdMEVkAY lSvreBN3zyHaP/WJ5SkHCB+sNHM0+Sz1vKz5Gm6GUvnvyQ9psXc4iLiEuWj8MvOcnW f9DAG3lxKiMRMq0eJzXXhaE8F51PyoWYFIae3ocQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alexander Dahl , =?UTF-8?q?Bence=20Cs=C3=B3k=C3=A1s?= , Mark Brown , Sasha Levin Subject: [PATCH 6.15 075/780] spi: atmel-quadspi: Fix unbalanced pm_runtime by using devm_ API Date: Tue, 17 Jun 2025 17:16:23 +0200 Message-ID: <20250617152454.564695628@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250617152451.485330293@linuxfoundation.org> References: <20250617152451.485330293@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bence Csókás [ Upstream commit 8856eafcc05ecf54d6dd2b6c67804fefd276472c ] Fix unbalanced PM in error path of `atmel_qspi_probe()` by using `devm_pm_runtime_*()` functions. Reported-by: Alexander Dahl Closes: https://lore.kernel.org/linux-spi/20250110-paycheck-irregular-bcddab1276c7@thorsis.com/ Fixes: 5af42209a4d2 ("spi: atmel-quadspi: Add support for sama7g5 QSPI") Signed-off-by: Bence Csókás Link: https://patch.msgid.link/20250327195928.680771-4-csokas.bence@prolan.hu Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/atmel-quadspi.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 244ac01068629..e7b61dc4ce676 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -1436,22 +1436,17 @@ static int atmel_qspi_probe(struct platform_device *pdev) pm_runtime_set_autosuspend_delay(&pdev->dev, 500); pm_runtime_use_autosuspend(&pdev->dev); - pm_runtime_set_active(&pdev->dev); - pm_runtime_enable(&pdev->dev); - pm_runtime_get_noresume(&pdev->dev); + devm_pm_runtime_set_active_enabled(&pdev->dev); + devm_pm_runtime_get_noresume(&pdev->dev); err = atmel_qspi_init(aq); if (err) goto dma_release; err = spi_register_controller(ctrl); - if (err) { - pm_runtime_put_noidle(&pdev->dev); - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); - pm_runtime_dont_use_autosuspend(&pdev->dev); + if (err) goto dma_release; - } + pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_put_autosuspend(&pdev->dev); @@ -1530,10 +1525,6 @@ static void atmel_qspi_remove(struct platform_device *pdev) */ dev_warn(&pdev->dev, "Failed to resume device on remove\n"); } - - pm_runtime_disable(&pdev->dev); - pm_runtime_dont_use_autosuspend(&pdev->dev); - pm_runtime_put_noidle(&pdev->dev); } static int __maybe_unused atmel_qspi_suspend(struct device *dev) -- 2.39.5