Messages in this thread | | | Date | Mon, 23 Jan 2023 23:11:05 +0900 | From | Hector Martin <> | Subject | Re: [PATCH] soc: apple: apple-pmgr-pwrstate: Switch to IRQ-safe mode |
| |
On 23/01/2023 20.22, Eric Curtin wrote: > On Mon, 23 Jan 2023 at 07:01, Hector Martin <marcan@marcan.st> wrote: >> >> This requires changing the reset path locking primitives to the spinlock >> path in genpd, instead of the mutex path. >> >> Signed-off-by: Hector Martin <marcan@marcan.st> >> --- > > It seems we need this to avoid a race from reading #asahi-dev IRC, > commit message could be more detailed here. > > Reviewed-by: Eric Curtin <ecurtin@redhat.com>
Not exactly, that was unrelated. We just need this to be able to switch power states from IRQ/atomic context, which came up when adding runtime PM to the DART driver (IIRC, this was a few weeks back and I threw runtime PM into like 3 drivers that day so I might be misremembering, but we definitely need it for one of them :-)).
The power state part of the driver itself is trivially IRQ-safe already, so there is no reason not to do it. We just have to switch the locking primitive the reset code uses (genpd already supports both), which is only used to provide the reset functionality safely since it involves the same register as the power state control.
- Hector
| |