pm: pm_idle() ignores a positive non-zero prepare() veto
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
The bug is in the three ret < 0 checks in drivers/power/pm/pm_idle.c, one in the non-SMP path and two in the SMP path. Read pm_changestate.c to confirm that it reverts the domain and returns any non-zero prepare value, and check the prepare contract in include/nuttx/power/pm.h. Build the host reproducer from the issue's src/ and shim/ and run it. Done means that a +1 veto leaves the idle handler at PM_NORMAL, the SMP and system-domain fallbacks are unchanged, and the reproducer prints VETO_HONORED.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Mechanism. The prepare() contract aborts a transition on any non-zero return, and pm_changestate() reverts the domain state and returns that value. The non-SMP pm_idle() tests only ret < 0, so a +1 veto is swallowed: the domain reverts to PM_NORMAL while the idle handler still receives the refused PM_SLEEP.
Location. drivers/power/pm/pm_idle.c:160,187,243 (three ret < 0 sites: non-SMP plus two SMP); drivers/power/pm/pm_changestate.c; include/nuttx/power/pm.h (non-zero means abort). Affected NuttX 13.1.0 (commit 2b5c0de5), confirmed by source inspection; measured on a hosted harness with the real pm_changestate.c, not sim:nsh.
Trigger. pm_checkstate() selects PM_SLEEP, a registered driver's prepare() returns +1, and pm_changestate() returns +1. Only the non-SMP branch is exercised; the SMP sites were checked by source inspection only, not run.
Expected. Any non-zero pm_changestate() return vetoes the transition, so the idle handler receives the reverted state (PM_NORMAL), not PM_SLEEP.
Evidence. Measured: before domain_state=0, idle_handler_state=3 (VETO_SWALLOWED); after idle_handler_state=0 (VETO_HONORED).
Patch. Change the three checks to ret != OK, keeping fallbacks (oldstate for the SMP CPU branch, PM_NORMAL for system and non-SMP), consistent with upstream 46d555e (identified by source inspection).
- Ngôn ngữ chính
- C
- Star
- 4.1k
- Fork
- 1.8k
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 852
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/nuttx
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/nuttx#22270 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
apache/nuttx#22171 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Please rerun `pre-commit run -a`Đang mởArch: all Arch: arm Area: Build system OS: Linux Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/nuttx#19435 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Arch: all OS: Linux Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/nuttx#16249 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
new issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
llvm/llvm-project#245835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
InauguralSystems/EigenScript#2537 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix a typo in H5Centry.cCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
taosdata/TDengine#35812 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày