Repository navigation
Conversation
…ont... commit 46e5ba3 upstream. Add early exist to the suspend function if suspending client is not the last one. It fixes the case where user calls put function from the thread context and it gets interrupted by the device interrupt where another asynchronous put is called. In that case, in the interrupt context the call will return error as semaphore cannot be taken and reference counting gets broken. By adding an early exit if context is not the last one, we ensure that only last client executes suspending procedure. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
commit 8d6e134 upstream. The get/put fast paths update pm->base.usage under the global runtime PM spinlock, but the slow paths update the same non-atomic counter while holding only the per-device semaphore. A pm_device_runtime_get() call from an ISR can then interleave with the last-user pm_device_runtime_put() read-modify-write running in a thread: the fast path sees usage == 1 with the device active, increments the counter and returns 0, and the interrupted thread overwrites the counter with 0 and suspends the device. The ISR ends up holding a runtime PM reference on a suspended device and the usage count is permanently off by one. Serialize all usage read-modify-write sequences of the non-ISR-safe paths through the global spinlock: the unbalanced check, decrement and last-user decision in runtime_suspend(), the suspend failure restores, the slow-path get increment and the resume failure decrement. State keeps being written under the per-device semaphore: every transition away from the active state happens with usage == 0, which is now visible under the spinlock, so the fast-path "usage > 0 and state active" check cannot claim a reference on a device that is about to be suspended. The ISR-safe paths already serialize everything under the per-device spinlock and are unchanged. The counter updates are factored into small runtime_usage_*() helpers so that every read-modify-write visibly goes through the same lock. The race window was confirmed on qemu_x86 by disassembly (the usage load and store are split across a branch, so the timer IRQ can be delivered in between) and reproduced deterministically with the stress test added in the following commit, which fails without this fix and passes with it. Fixes the race left open by commit 46e5ba3 ("pm: device_runtime: Fix managing the device from multiple contexts"). Signed-off-by: Holt Sun <holt.sun@nxp.com>
PR: 122748 Add missing copyright text to mspm0g110x.dtsi and mspm0g310x.dtsi which were triggering check_compliance warnings. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
PR: 122748 Run clang-format on source file to avoid unexpected line changes in future commits. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
PR: 122748 Add support for pm device runtime. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
…r UART PR: 122748 Add disabling power states for uart peripheral. These low power modes will disrupt uart operations. This information came from the datasheets table called "Operating Modes". Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
PR: 122748 Add policy locks to prevent system from entering a low power mode that would disrupt uart operations. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
PR: 122748 Disabling and reenabling FEN improperly causing the BUSY flag to indicate the UART is still busy. Since we are always using FIFO just keep it set. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
… it... PR: 122748 Don't update configuration until we are certain its all valid. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
…rx ... PR: 122748 If a uart peripheral driver doesn't support disable_rx then test will fail with a compile error. Instead if disable_rx is not found then default to 0/false. The test already handles when this property is 1 or 0 so no need to prevent the entire test from working. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
…Lau... PR: 122748 Add support for TI's lp_mspm0g3519 and lp_mspm0l2228 launchpad. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
…chpad PR: 122748 Add support for TI's lp_mspm0g3519 and lp_mspm0l2228 board. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
… L2... PR: 122748 Add support for TI's lp_mspm0g3519 and lp_mspm0l2228 board. Signed-off-by: Franklin Cooper Jr <fcooper@ti.com>
fcooperti
force-pushed
the
v4.4.0-ti-next_uart_pm_test
branch
from
October 21, 2026 11:45
7217858 to
91887ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commits are made up of ones pending upstream as well as a couple that are already merged.