Repository navigation
Conversation
… took A poll-only mailbox (the T6050 ASCWrap v6 ones) receives from a delayed work on system_highpri_wq and from an hrtimer. Neither is stopped by a system sleep: the workqueue is not freezable. If the mailbox's consumer is runtime-active when the sleep starts, the PM core holds it active, the mailbox stays started, and in the noirq phase genpd powers the mailbox's domain off under the poller. The next poll reads the control register of an unpowered block and takes an SError: apple-mailbox 2302600000.mailbox: PM: genpd_suspend_noirq returned 0 after 17 usecs SError Interrupt on CPU6, code 0x00000000be000000 -- SError Workqueue: events_highpri apple_mbox_v8_rx_poll_work apple_mbox_poll_locked+0xa4/0x1e8 (P) apple_mbox_v8_rx_poll_work+0x4c/0x84 Kernel panic - not syncing: Asynchronous SError Interrupt On the K116s this is the GPU's mailbox, and it happens on every suspend-to-idle entered while the GPU is in use, which is any suspend with the lid open: the machine never comes back. With the lid closed the GPU has idled and stopped its mailbox before the sleep starts. Mark the receiver asleep in suspend_noirq, under rx_lock so that a poll in flight finishes first, and have apple_mbox_poll_locked() leave the registers alone until resume_noirq. Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
Note on #1844 (interrupt receive for the T6050 GPU mailboxes), opened at the same time: the two touch the same function but merge without conflict in either order (checked with This change is still needed with #1844. The once-per-jiffy poller keeps running there as a watchdog, and it is that poller that read the unpowered mailbox in the trace above. The interrupt path of #1844 also receives through |
|
On @DjDeveloperr's note in #1844 about suspend: agreed. With #1844 the recv interrupt is live on these mailboxes and is This PR alone is not affected: today the line is never enabled on the T6050 ascwrap-v6 mailboxes, so the two pollers are the only readers. For the order of landing:
I can build and run the combination on the K116s. I do not know yet whether the line fires on this board, so it may only exercise the "never fires" side. |
|
Hardware run for the question in #1844: integration/aurora adb5a7e (with #1844) plus the K116s commits, without this PR, on the K116s (16" M5 Pro OLED, 27.2 stub, Linux at EL2).
With the T6050 pollers gone there is nothing left for this fence to guard on these mailboxes, so I am closing this. If the T8152 poller stays (i.e. #1851 does not go in) and someone sees the same read-after-power-off there, the fence could be revived with the poller-gated read @DjDeveloperr pointed out. |
On the K116s (16" M5 Pro, T6050) a suspend-to-idle entered while the GPU is in use panics in the noirq phase. With the console suspended that looks like a machine that never wakes: no key, power button or lid brings it back. In practice it is every suspend with the lid open (
systemctl suspend, the menu's Sleep); a lid-close suspend works because the GPU has idled first.With
no_console_suspendandpm_test=platform:Cause: the T6050 ASCWrap v6 mailboxes are
rx_poll_only. They receive from a delayed work onsystem_highpri_wqand from the fast hrtimer, and a system sleep stops neither. If the consumer (here the GPU) is runtime-active when the sleep starts, the PM core holds it active, so the mailbox stays started. In the noirq phase genpd powers the mailbox's domain off, and 22 us later the poller readsi2a_controlof the unpowered block.Fix:
apple_mbox_suspend_noirq()marks the receiver asleep underrx_lock, so a poll in flight finishes before genpd goes on, andapple_mbox_poll_locked()returns without touching the registers untilapple_mbox_resume_noirq()clears the mark. Every poll path (work, fast timer,apple_mbox_poll_one()) goes through that function withrx_lockheld. The driver's noirq callback runs before genpd's power-off, so the order is right.Tested on a K116s, 27.2 stub, Linux at EL2
Kernel integration/aurora aa68b3c plus my K116s series, with and without
CONFIG_PM_DEBUG. Lid open, desktop session running.pm_test=devicespm_test=platformpm_test=platformwith a GL workload runningAfter each resume the GPU renders correctly (an offscreen GLES scene matches its reference) and the kernel log has no aurora errors.
This branch is that commit cherry-picked onto a34d26c; it applied cleanly and I have not rebuilt it on that tip.
Notes
apple_mbox_has_rx_poller(), so the ASCWrap v8 ones too). I only have a T6050 to test on.