linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/2] MIPS: Fix idle VS timer enqueue
@ 2025-04-03 16:11 Marco Crivellari
  2025-04-03 16:11 ` [PATCH v7 1/2] " Marco Crivellari
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Marco Crivellari @ 2025-04-03 16:11 UTC (permalink / raw)
  To: linux-mips, linux-kernel
  Cc: Thomas Bogendoerfer, Marco Crivellari, Frederic Weisbecker,
	Anna-Maria Behnsen, Thomas Gleixner, Peter Zijlstra, Huacai Chen,
	Maciej W . Rozycki

This patch aims to fix idle routine while the CPU receive an interrupt,
because __r4k_wait() only checks if TIF_NEED_RESCHED is set before
going to sleep.
The same behavior has been changed in LoongArch [1].

Code (cross) compiled successfully and I manage to test it on a VM
emulating a malta board. I ran QEMU with:

qemu-system-mips64el -M malta -m 2G -kernel vmlinux -serial stdio -drive \
file=rootfs.ext2,format=raw -append "rootwait root=/dev/sda" -cpu 5Kc

rootfs generated using buildroot (malta default configuration).

- [1] https://github.com/chenhuacai/linux/commit/a8aa673ea46c03b3f62992ffa4ffe810ac84f6e3

---
Changes in v7:
 - patch 2 to handle __r4k_wait() moved to .cpuidle.text section
 - removed .noreorder section from __r4k_wait()
 - idle region of 32-bytes
 - removed C wrapper r4k_wait() and renamed __r4k_wait() to r4k_wait()
 - changes discussed in:
    https://lore.kernel.org/lkml/20250315194002.13778-1-marco.crivellari@suse.com/T/#m07f2568d9099101637063bd057a497ceb846be3d

Changes in v6:
 - typo in comment, capitalise sentences and full stops

Changes in v5:
 - comment: idle interrupt region, instead of rollback region

Changes in v4:
 - comments: 36 byte region

Changes in v3:
 - changed "daddiu k0, 1" with PTR_ADDIU k0, 5
 - replaced CONFIG_CPU_MICROMIPS with 3 _ssnop followed by _ehb
 - integrated the commit message with explanation about
   CONFIG_CPU_MICROMIPS replacement

Changes in v2:
 - Changes introduced by Huacai:
    https://lore.kernel.org/linux-mips/20250214105047.150835-1-marco.crivellari@suse.com/T/#m75d9c587829e15e0d7baec13078be4e65c936408

Marco Crivellari (2):
  MIPS: Fix idle VS timer enqueue
  MIPS: Move __r4k_wait() to .cpuidle.text section

 arch/mips/include/asm/idle.h |  3 +-
 arch/mips/kernel/genex.S     | 63 +++++++++++++++++++++---------------
 arch/mips/kernel/idle.c      |  7 ----
 3 files changed, 38 insertions(+), 35 deletions(-)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-04-30  3:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 16:11 [PATCH v7 0/2] MIPS: Fix idle VS timer enqueue Marco Crivellari
2025-04-03 16:11 ` [PATCH v7 1/2] " Marco Crivellari
2025-04-11 14:03   ` Marco Crivellari
2025-04-25  8:30   ` Marco Crivellari
2025-04-27  9:53   ` Huacai Chen
2025-04-28  1:32     ` Maciej W. Rozycki
2025-04-28  7:22       ` Marco Crivellari
2025-04-03 16:11 ` [PATCH v7 2/2] MIPS: Move r4k_wait() to .cpuidle.text section Marco Crivellari
2025-04-28  2:26   ` Huacai Chen
2025-04-28  3:28     ` Maciej W. Rozycki
2025-04-28  4:11       ` Huacai Chen
2025-04-28 10:20         ` Marco Crivellari
2025-04-28 10:23           ` Thomas Bogendoerfer
2025-04-28 17:56             ` Maciej W. Rozycki
2025-04-30  3:15             ` Huacai Chen
2025-04-27  8:16 ` [PATCH v7 0/2] MIPS: Fix idle VS timer enqueue Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).