diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-06-25 12:02:49 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-06-25 12:02:49 +0000 |
commit | 888ba07b84f7a8381a72440b55a3aea166ed0700 (patch) | |
tree | 00028f94da195e880f0a2bbc6ff6dcad05f4ea33 /sys/arch/amd64 | |
parent | 04e28d7009fd0534017d3379463a7ec02c84d18e (diff) |
Print the last non-wakeup interrupt received during suspend. Note that
this may print an (MSI) interrupt that sneaks in just before we actually
enter the idle loop on the primary CPU. While such an interrupt shouldn't
happen, they won't prevent the machine from reaching a low power idle state.
So at this point these non-wakeup interrupts only need to be investigated
when the primary CPU gets woken up repeatedly.
ok mglocker@, deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/intr.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c index 88c65f26855..44fad990d58 100644 --- a/sys/arch/amd64/amd64/intr.c +++ b/sys/arch/amd64/amd64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.60 2024/06/15 18:01:44 kettenis Exp $ */ +/* $OpenBSD: intr.c,v 1.61 2024/06/25 12:02:48 kettenis Exp $ */ /* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */ /* @@ -74,6 +74,7 @@ struct pic softintr_pic = { }; int intr_suspended; +struct intrhand *intr_nowake; /* * Fill in default interrupt table (in case of spurious interrupt @@ -537,8 +538,10 @@ intr_handler(struct intrframe *frame, struct intrhand *ih) * We may not be able to mask MSIs, so block non-wakeup * interrupts while we're suspended. */ - if (intr_suspended && (ih->ih_flags & IPL_WAKEUP) == 0) + if (intr_suspended && (ih->ih_flags & IPL_WAKEUP) == 0) { + intr_nowake = ih; return 0; + } #ifdef MULTIPROCESSOR if (ih->ih_flags & IPL_MPSAFE) @@ -749,6 +752,13 @@ intr_disable_wakeup(void) if (pic->pic_hwunmask) pic->pic_hwunmask(pic, pin); } + + if (intr_nowake) { + printf("last non-wakeup interrupt: irq%d/%s\n", + *(int *)intr_nowake->ih_count.ec_data, + intr_nowake->ih_count.ec_name); + intr_nowake = NULL; + } } #endif |