From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E73BB3D5226; Thu, 9 Jul 2026 06:54:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783580046; cv=none; b=Cqf0D45r08bD75L6ZaraFf5SDSdd65ItPrvZHsbkFj+mG5Ei3ZQpsicu5HfKRebatZxLScCflP/gwkpQtKoTDyXa8H2GLWnrmla3V/+p3kdBvsEmcaMcvI8JbEEMvWAOHxRpNcO+99C5IbkkEDVhAGGPjtdoka28UVnSaDpYGWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783580046; c=relaxed/simple; bh=ydBjedsFlM5zE7n02K5dZMnmI4uwth9M252K9flBJwo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ajqGTCrWAdtE0LoTemWrIgGYjIBj6Ib/vk9o833NzBRCXpufK/Soh7LlKtpwGb8NtpnuUaY07ZpHu8hUPEi85DlxjGjXfmW3nRpjNCeErMDOaKDlHf5ffoXIt3aLDNBF87fdhsuYq+uiKp9uQr+ZdNGsMoMFAChvlfNTLxpfyxQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eve+Ku/b; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eve+Ku/b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA18F1F000E9; Thu, 9 Jul 2026 06:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783580044; bh=Umjxh1wdEigWfrDYfCtSPiAZ4y/Nii4EbVro+PImADI=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=eve+Ku/buy7nr9gkUgllmP30UOO+QyApAmLGK6h4Qn42Nr4HNLucG+pYmO07Wtxmk DWtBcDkCybkjMlqjaJAwd+FunPhP/l5E8qcTL2xsPlkrRQwgTqcC58b15eC4WZCrNW fy+PA4ct/pREL/oK75G/cagLF2JMP2E0x1x6qNQGOEUW/edqJPbb3eXflbtPImj6rr 6mU9S7lgocbnzdZMe07a8786qBJXU0lxf05aRXoxRuFJMsGDl2iAXDkYuqhNkARf4s MxPTFY6X9AF2y/gnXEoGeobYHJvx5MR4EWTe2hp42in/8iWVNNdGaLMqCpALPbiZyj rFX4rJG1dpVLQ== Message-ID: <9320a573-ebf8-459b-a313-3a8b73a6180b@kernel.org> Date: Thu, 9 Jul 2026 08:53:54 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/6] tty: serial: propagate errors from uart_ops.pm callback To: Praveen Talari , Greg Kroah-Hartman , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Andy Shevchenko , Matthias Brugger , AngeloGioacchino Del Regno , Richard Genoud , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Krzysztof Kozlowski , Peter Griffin , Alim Akhtar , Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Maxime Coquelin , Alexandre Torgue , Peter Korsgaard , Michal Simek , Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Thomas Bogendoerfer , bjorn.andersson@oss.qualcomm.com, Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-omap@vger.kernel.org, linux-mips@vger.kernel.org, Mukesh Kumar Savaliya , aniket.randive@oss.qualcomm.com, chandana.chiluveru@oss.qualcomm.com References: <20260709-add_return_check_for_uart_change_pm-v1-0-e85c6ffa8ec4@oss.qualcomm.com> Content-Language: en-US From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jwlvuwyfo5mh7w5iMfnZE+vHFwp/wARAQABzSFKaXJpIFNsYWJ5 IDxqaXJpc2xhYnlAa2VybmVsLm9yZz7CwXcEEwEIACEFAlW3RUwCGwMFCwkIBwIGFQgJCgsC BBYCAwECHgECF4AACgkQvSWxBAa0cEnVTg//TQpdIAr8T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20260709-add_return_check_for_uart_change_pm-v1-0-e85c6ffa8ec4@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 09. 07. 26, 8:25, Praveen Talari wrote: > The uart_ops.pm callback has been declared void since its introduction, > which means any error from a driver's power management implementation is > silently discarded by uart_change_pm(). Beyond losing the error > information, uart_change_pm() unconditionally updates state->pm_state > even when the underlying hardware transition failed. This causes the > serial core to track a power state that does not reflect reality: > subsequent calls to uart_change_pm() see the stale cached state as > matching the requested state and skip the callback entirely, leaving the > hardware permanently stuck with no further recovery attempt. > > On modern platforms where the .pm callback performs real work — > enabling clock trees, interacting with runtime PM, asserting voltage > regulators — this is a correctness gap. Failures are invisible to the > PM framework, the port proceeds to call ops->startup() on potentially > unpowered hardware, and suspend/resume errors are hidden from the core > that needs to handle them. > > This series fixes the problem in four steps: > > Patch 1 changes the uart_ops.pm callback signature from void to int, > updates uart_change_pm() to propagate errors and only commit > state->pm_state on success, and handles the return value at every > call site in serial_core.c with appropriate policy per context > (propagate, log, or skip-on-failure). So does this break build without the below applied? IOW: breaks bisectability? > Patch 2 updates the 8250 driver family: serial8250_do_pm() and > serial8250_pm() are updated to return int (with the exported symbol > declaration updated in serial_8250.h), and the 8250 sub-driver > pm callbacks are updated to return 0. > > Patch 3 updates the remaining non-8250 serial drivers. All .pm > implementations are updated to return 0. The sh-sci forward > declaration shared with rsci is also updated. > > Patch 4 updates arch-level implementations: SA1100 (assabet, h3xxx), > OMAP1/ams-delta (modem_pm, now propagates regulator errors), and > MIPS/Alchemy (alchemy_8250_pm). > > All existing .pm implementations return 0, so there is no functional > change for any current driver. The series purely adds the infrastructure > for drivers to report errors going forward, with the serial core ready > to handle them correctly. OK, now I miss the rationale behind the patchset. Neither there is a possible code path to actually test this? thanks, -- js suse labs