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=1796381193; b=YxJeEdxnZEjLMc96QjW8O4ZvRKc9flSQPEQtqyR+vJbtewa1UbsrTcFwltWUUxF4e9If LAYXl53dH8QdibjdASJaQ/0aIh2exmKmgGEW6j5XFa1dW0rXH+oNHtT7zy+nYTaLI+zmU eb7IIjcmD3XVtq6DINdahlMny1ZL6o2CZpyf8UN01a4i+a5Zd5lATmzRgMMCbNkrme8SI PCvSuQTpBpxqXHcxOm9iuT60WeCUr7/Vrq66nVR9hQhhIg1KNAiuxlt/l5rXCrAaa0Xzn WoqdbZcMXW6tJ7y9uEatpIZDwV6/4c79ToXK/KjPXGbx76zVr6tX2PhDYhfS1a1dlLQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381193; 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=Ao3+HRxXe5sF4KY2ckr4gOdVwUIXzewqFjvdhYd30vo=; b=JOzDc4wXiJVoL3tg1ryTcIskAphzwep63HKn8JgUIN7GcR+8zvz8VpMqjJgJ14E+Hxmc yWdsBU3hCfV05A6ocyn6G7q74MbJNX7CFb/dmCzMgMZuFtApYygDS9jV5hp7Q2UkoZEvp V6Zi8fJ7AIOt49+nzUbqTrAXmLR7wRwk/PmsWz7bN/WTkdymrpxX2ligzuRVENSNvM2j3 8rvpDbO9OBSvdNXv16jvA+ukeZNBt8H917Gc/wOoFtTMectSSY0E4aYAZCJvvd1qgfPBX tXl/k0XXcfZ00iGLUMtHm71EhoAqGm3vlaI7/VMocYJHMm615zhRjInADPKOmtVPYRA== 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=hVrlQEmq; 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 F38E6606A322; Fri, 4 Dec 2026 10:46:32 +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=hVrlQEmq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FD9D1F0092C; Fri, 4 Dec 2026 10:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381192; bh=Ao3+HRxXe5sF4KY2ckr4gOdVwUIXzewqFjvdhYd30vo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hVrlQEmqBaXMIV1B+n8iAKLnUETx83IVkjSBDNTAqV3JFyC8+UuiOFaPes6l4ub36 VjBJf0/UA65PkZNs7NYiXwnI/2O2wq+rHuiF32/2ukHtYR0aqRA/faDP5K5k4JUIMk QkvGBt+k8KycDw7G0T3SeaDoRBZitRJmheipRcmQ= 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 7.3 599/742] spi: Fix runtime PM imbalance on pump transfer message error Date: Fri, 4 Dec 2026 19:07:43 +0900 Message-ID: <20261204100651.030621939@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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 @@ -1942,7 +1942,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); @@ -1963,9 +1962,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);