Re: [PATCH v16 5/7] spi: pxa2xx: disable DMA for Apple MacBook8,1
From: Andy Shevchenko
Date: Thu Sep 10 2026 - 05:51:37 EST
On Wed, Jul 29, 2026 at 09:21:41PM +0100, Mark Brown wrote:
> On Wed, Jul 29, 2026 at 10:05:57PM +0200, Lukas Wunner wrote:
> > On Sun, Jul 26, 2026 at 06:14:35PM +0200, Lukas Wunner wrote:
>
> > > I'm not sure why Apple chose to keep the DMA controller in reset,
> > > but have you explored enabling it on boot?
>
> > Thinking about this some more and after taking a look at
> > drivers/input/keyboards/applespi.c, I realize messages exchanged via SPI
> > are always 256 bytes in size. That's not a whole lot, and of course
> > messages are only exchanged when a key is pressed or the trackpad is
> > used. So perhaps Apple determined that sending this in PIO mode is
> > ultimately more efficient than keeping a DMA engine powered on all the
> > time. The CPU load saved through offloading the SPI transfer is offset
> > by having to program the DMA engine for each transfer.
>
> > So perhaps usage of PIO mode was indeed an intentional choice by Apple
> > and need not be second-guessed. I'm not sure.
>
> DMA can also add extra latency with interrupt handling, it's possible
> someone decided to trade some CPU time for minimal latency (though you
> could probably arrange for shorter messages...).
Okay, so let's go with the disabled DMA approach, but this will need
a good commit message and a big comment in the code explaining all findings
and some kind of summary of this discussion(s).
--
With Best Regards,
Andy Shevchenko