From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796389429; b=lTk4Uud3+QMlp2PJo5dqZ2w01bBkaJcixr75bilTzwgwlW5mdTyEVcy0LiMfYj//ok/p mhfRI3XlvmmdGdraoWPM5TEdUeZFZHR4n5X5Cj7zaoQ0O0KbOFUDuX0dmz+WaPFnytsy2 acuzUi2LsR87IW8UzMh0kydutETm0O5cl4xe5J6TGi5wYrWpjxuLE8rBKQ4YEV7phG3cs hPdax733JlHQ0x4LZDbUUavaDEQsKnlkvNYeuQy47PjcL4myCmes38fO+rilxOlVzs+ba N5HFZUiI830CnRQI6THNyAcezSITz3gtbikd79Cgv363xqNT04UDeBFacYo3US7mu0w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389429; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=m6fpbcwnTDlqQh2W/mUlKtWox0vPj3Nkc3pRlF8reDY=; b=KC6B7Mdbje0Zy6RFyr2Mxpvr2/60/nQ7RfYyIUp1LPTgq4NSl7I5rj7ewIx0gOYn2Cry iH5m8cMM85sMVSkpuwi7EqpdPsv2vrCHmpAHk8Z99bhk9t7h51EKKcs1Lj5RVdPwcSYpo 2fkUgr0gjyc9qNXkYrLAGWh5GHC0LQVLOhaQxYI2YhQOUKKiswxuKkvASP5APFtlRXe7q +p2Cm3qkl2cN2vpbEJ66JqhNNun4UsPvQAblbOh+REh0JiCoIF5SFf18wuLcR2m1cg7jJ 8N8+NAhXg142I9TImn8rCCt+UJMrf7cVr5SYlkjg1aaq5gKKJ7RCzWw0sMEhgYc9Axw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=W5C0AsgU; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2443F606A32C; Fri, 4 Dec 2026 13:03:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=W5C0AsgU Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C8511F0092C; Fri, 4 Dec 2026 13:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389428; bh=m6fpbcwnTDlqQh2W/mUlKtWox0vPj3Nkc3pRlF8reDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W5C0AsgUbFxMaAujrbJFjUh3nYgwITJ23mkoi9Fa0DlhJBVitDEvN+i3wL5acHLIc Sg7kAuvx89dF4IlKjgzlu9nR6+GrlrlK/KZI8++OCb2OLVoOLYUuVooWmgyyb+3TyL QEBEzt3357s+dTjiYlZBh9hrEGC84oI9e09iwEAU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sebastian Reichel , Alexander Shiyan , Mark Brown Subject: [PATCH 6.1 0989/1059] spi: Fix runtime PM imbalance on pump transfer message error Date: Fri, 4 Dec 2026 19:08:40 +0900 Message-ID: <20261204100709.617853539@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Reichel commit bb5caf7a2e0b2dae8e8905d32fc376703eabcfc4 upstream. The current SPI message pumping code may drop the runtime PM twice when an SPI message cannot be sent: spi_master spi2: noqueue transfer failed rockchip-spi feb20000.spi: Runtime PM usage count underflow! Fix the problem by always keeping the runtime PM count increased when exiting __spi_pump_transfer_message(), as the caller handles decreasing it. Note, that the function already keeps the RPM usage counter increased for the error paths following after the prepare_transfer_hardware step. Cc: stable@vger.kernel.org Fixes: bef4a48f4ef7 ("spi: Fix null dereference on suspend") Signed-off-by: Sebastian Reichel Tested-by: Alexander Shiyan Link: https://patch.msgid.link/20261110-spi-runtime-pm-fix-v1-1-8601ebb2f6a8@collabora.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1653,7 +1653,6 @@ static int __spi_pump_transfer_message(s if (!was_busy && ctlr->auto_runtime_pm) { ret = pm_runtime_get_sync(ctlr->dev.parent); if (ret < 0) { - pm_runtime_put_noidle(ctlr->dev.parent); dev_err(&ctlr->dev, "Failed to power device: %d\n", ret); @@ -1674,9 +1673,6 @@ static int __spi_pump_transfer_message(s "failed to prepare transfer hardware: %d\n", ret); - if (ctlr->auto_runtime_pm) - pm_runtime_put(ctlr->dev.parent); - msg->status = ret; spi_finalize_current_message(ctlr);