Revert "mailbox: avoid timer start from callback"
authorPhil Elwell <phil@raspberrypi.com>
Tue, 3 Nov 2020 11:49:53 +0000 (11:49 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:03:46 +0000 (16:03 +0000)
commit9f465c869042d8e42de1a19add8cbdd6399dbeaf
treedd7081b6a21773a2d9efd0eed2f58e575ed9a6b8
parentcde93a4d4cbbe140420a6ccb2ec01368566bdda5
Revert "mailbox: avoid timer start from callback"

This reverts commit c7dacf5b0f32957b24ef29df1207dc2cd8307743.

The Pi 400 shutdown/poweroff mechanism relies on being able to set
a GPIO on the expander in the pm_power_off handler, something that
requires two mailbox calls - GET_GPIO_STATE and SET_GPIO_STATE. A
recent kernel change introduces a reasonable possibility that the
GET call doesn't completes, and bisecting led to a commit from
October that changes the timer usage of the mailbox.

My theory is that there is a race condition in the new code that breaks
the poll timer, but that it normally goes unnoticed because subsequent
mailbox activity wakes it up again. The power-off mailbox calls happen
at a time when other subsystems have been shut down, so if one of them
fails then there is nothing to allow it to recover.

See: https://github.com/raspberrypi/linux/issues/3941

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/mailbox/mailbox.c