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 8F015242D7B; Mon, 23 Mar 2026 15:16:38 +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=1774278998; cv=none; b=RQRCAKbzdJ5Mw0QRcRdn3xCrcADlQevUuilXm5ulq57NGs95quOd/neAOMa7RKAIA9gb8yUq9MfSugsl0Eq9pYa9YS1NKUJYeU1L/oyggk6ZPDviYmdCn9m9oBi5r3LYvBxTIscoNfJXiCvtz/LwRAYzB30guKqf+bFUss/2sxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774278998; c=relaxed/simple; bh=VJ7m1SdxOyOVEgfcrD00qaIPDgonnRZllNhuG9wJIp4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PmQt/LOF0t5iQFrY61gAHeebIBC1eQp8QjPOn+XfMAVqMHtYlYAaA6yB019sSU1gqhlPLXDaH1PBVdJikxGXIpttpsS6feDiTfdHkwy55BROifMevW8ft92wlO3mWdXqke2o1a9NPUMj72gCU1bwHjMi3c5Uo7v96TKi/w5Gsmg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RKiQnQ6H; 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="RKiQnQ6H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B2D0C4CEF7; Mon, 23 Mar 2026 15:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774278998; bh=VJ7m1SdxOyOVEgfcrD00qaIPDgonnRZllNhuG9wJIp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKiQnQ6HTo9DhHCAYPTSKv4/69KVa+O+umGKtyFExH6hTN71zvLGudgYV5w+4JhkA b6rVBwrV5Q8tT9qJG33MqDpVLbl5YqQSa8DUtyM9zGMN4REY7ZJLNkDHj8FK/8vZ0O YxVPriraTZ7FxdpEmwxdHzjNygZV8fTugQ4d2kO0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Maciej Andrzejewski ICEYE Subject: [PATCH 6.6 486/567] serial: uartlite: fix PM runtime usage count underflow on probe Date: Mon, 23 Mar 2026 14:46:46 +0100 Message-ID: <20260323134546.007052723@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134533.749096647@linuxfoundation.org> References: <20260323134533.749096647@linuxfoundation.org> User-Agent: quilt/0.69 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-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej Andrzejewski ICEYE commit d54801cd509515f674a5aac1d3ea1401d2a05863 upstream. ulite_probe() calls pm_runtime_put_autosuspend() at the end of probe without holding a corresponding PM runtime reference for non-console ports. During ulite_assign(), uart_add_one_port() triggers uart_configure_port() which calls ulite_pm() via uart_change_pm(). For non-console ports, the UART core performs a balanced get/put cycle: uart_change_pm(ON) -> ulite_pm() -> pm_runtime_get_sync() +1 uart_change_pm(OFF) -> ulite_pm() -> pm_runtime_put_autosuspend() -1 This leaves no spare reference for the pm_runtime_put_autosuspend() at the end of probe. The PM runtime core prevents the count from actually going below zero, and instead triggers a "Runtime PM usage count underflow!" warning. For console ports the bug is masked: the UART core skips the uart_change_pm(OFF) call, so the UART core's unbalanced get happens to pair with probe's trailing put. Add pm_runtime_get_noresume() before pm_runtime_enable() to take an explicit probe-owned reference that the trailing pm_runtime_put_autosuspend() can release. This ensures a correct usage count regardless of whether the port is a console. Fixes: 5bbe10a6942d ("tty: serial: uartlite: Add runtime pm support") Cc: stable Signed-off-by: Maciej Andrzejewski ICEYE Link: https://patch.msgid.link/20260305123746.4152800-1-maciej.andrzejewski@m-works.net Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/uartlite.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -870,6 +870,7 @@ of_err: pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, UART_AUTOSUSPEND_TIMEOUT); pm_runtime_set_active(&pdev->dev); + pm_runtime_get_noresume(&pdev->dev); pm_runtime_enable(&pdev->dev); ret = ulite_assign(&pdev->dev, id, res->start, irq, pdata);