-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [Upstream] [linux 6.6-y] Loongarch: Sync some patches from stable #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Deepin-Kernel-SIG] [Upstream] [linux 6.6-y] Loongarch: Sync some patches from stable #583
Conversation
stable inclusion from stable-v6.6.76 category: bugfix [ Upstream commit 26c0a2d ] The enable_gpe_wakeup() function calls acpi_enable_all_wakeup_gpes(), and the later one may call the preempt_schedule_common() function, resulting in a thread switch and causing the CPU to be in an interrupt enabled state after the enable_gpe_wakeup() function returns, leading to the warnings as follow. [ C0] WARNING: ... at kernel/time/timekeeping.c:845 ktime_get+0xbc/0xc8 [ C0] ... [ C0] Call Trace: [ C0] [<90000000002243b4>] show_stack+0x64/0x188 [ C0] [<900000000164673c>] dump_stack_lvl+0x60/0x88 [ C0] [<90000000002687e4>] __warn+0x8c/0x148 [ C0] [<90000000015e9978>] report_bug+0x1c0/0x2b0 [ C0] [<90000000016478e4>] do_bp+0x204/0x3b8 [ C0] [<90000000025b1924>] exception_handlers+0x1924/0x10000 [ C0] [<9000000000343bbc>] ktime_get+0xbc/0xc8 [ C0] [<9000000000354c08>] tick_sched_timer+0x30/0xb0 [ C0] [<90000000003408e0>] __hrtimer_run_queues+0x160/0x378 [ C0] [<9000000000341f14>] hrtimer_interrupt+0x144/0x388 [ C0] [<9000000000228348>] constant_timer_interrupt+0x38/0x48 [ C0] [<90000000002feba4>] __handle_irq_event_percpu+0x64/0x1e8 [ C0] [<90000000002fed48>] handle_irq_event_percpu+0x20/0x80 [ C0] [<9000000000306b9c>] handle_percpu_irq+0x5c/0x98 [ C0] [<90000000002fd4a0>] generic_handle_domain_irq+0x30/0x48 [ C0] [<9000000000d0c7b0>] handle_cpu_irq+0x70/0xa8 [ C0] [<9000000001646b30>] handle_loongarch_irq+0x30/0x48 [ C0] [<9000000001646bc8>] do_vint+0x80/0xe0 [ C0] [<90000000002aea1c>] finish_task_switch.isra.0+0x8c/0x2a8 [ C0] [<900000000164e34c>] __schedule+0x314/0xa48 [ C0] [<900000000164ead8>] schedule+0x58/0xf0 [ C0] [<9000000000294a2c>] worker_thread+0x224/0x498 [ C0] [<900000000029d2f0>] kthread+0xf8/0x108 [ C0] [<9000000000221f28>] ret_from_kernel_thread+0xc/0xa4 [ C0] [ C0] ---[ end trace 0000000000000000 ]--- The root cause is acpi_enable_all_wakeup_gpes() uses a mutex to protect acpi_hw_enable_all_wakeup_gpes(), and acpi_ut_acquire_mutex() may cause a thread switch. Since there is no longer concurrent execution during loongarch_acpi_suspend(), we can call acpi_hw_enable_all_wakeup_gpes() directly in enable_gpe_wakeup(). The solution is similar to commit 22db063 ("ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep()"). Fixes: 366bb35 ("LoongArch: Add suspend (ACPI S3) support") Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Sasha Levin <sashal@kernel.org>
stable inclusion from stable-v6.6.76 category: bugfix commit f502ea6 upstream. The maximum number of load/store watchpoints and fetch instruction watchpoints is 14 each according to LoongArch Reference Manual, so change 8 to 14 for the related code. Link: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#control-and-status-registers-related-to-watchpoints Cc: stable@vger.kernel.org Fixes: edffa33 ("LoongArch: Add hardware breakpoints/watchpoints support") Reviewed-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewer's Guide by SourceryThis pull request backports two commits from the stable branch (mainline-v6.6.76). The first commit increases the maximum number of hardware breakpoints for LoongArch architecture. The second commit fixes warnings during S3 suspend. Class diagram for LoongArch hardware breakpoint changesclassDiagram
class HardwareBreakpoints {
+LOONGARCH_MAX_BRP: int
+LOONGARCH_MAX_WRP: int
}
note for HardwareBreakpoints "Changed max breakpoints from 8 to 14"
class CSRRegisters {
+DB0-DB13: DataBreakpointRegisters
+IB0-IB13: InstructionBreakpointRegisters
}
note for CSRRegisters "Added DB8-DB13 and IB8-IB13 registers"
class DataBreakpointRegisters {
+ADDR: register
+MASK: register
+CTRL: register
+ASID: register
}
class InstructionBreakpointRegisters {
+ADDR: register
+MASK: register
+CTRL: register
+ASID: register
}
CSRRegisters *-- DataBreakpointRegisters
CSRRegisters *-- InstructionBreakpointRegisters
State diagram for S3 suspend fixstateDiagram-v2
[*] --> Running
Running --> S3_Suspend: Suspend
S3_Suspend --> EnableWakeupGPEs: acpi_hw_enable_all_wakeup_gpes()
EnableWakeupGPEs --> S3_Suspended
S3_Suspended --> Running: Resume
note right of EnableWakeupGPEs: Fixed warning by using correct function
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @opsiff - I've reviewed your changes - here's some feedback:
Overall Comments:
- There are duplicate declarations of acpi_hw_enable_all_wakeup_gpes in acpixf.h. Please remove the redundant declaration so only one remains to prevent any potential linker or type confusion issues.
- Ensure that the extended range for hardware breakpoints (new indices 8-13 and MAX_BRP/WRP increased to 14) is fully supported by the LoongArch hardware. Verify that any usage in dependent code or assumptions about the breakpoint count are updated accordingly.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sourcery-ai[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
stable inclusion
from mainline-v6.6.76
category: bugfix
Commit:
LoongArch: Change 8 to 14 for LOONGARCH_MAX_{BRP,WRP}
LoongArch: Fix warnings during S3 suspend
Summary by Sourcery
Increase the maximum number of hardware breakpoints and fix warnings during S3 suspend.
Bug Fixes:
Enhancements: