Re: [PATCH v16 5/7] spi: pxa2xx: disable DMA for Apple MacBook8,1
Mark Brown <[email protected]> Wed, 29 Jul 2026 21:21:41 +0100
| Newsgroups | org.kernel.vger.linux-spi,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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...).
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpqYNQACgkQJNaLcl1U h9BqEQf/Y/vxR7/K+t1UI7aKLyxQEME3eMNStgxoERmSOrRiqcMIW+tIyiXeEl1r doZ6PIi8JZV+kKlLU/ulZukqSgrVb1cV9WsaOVqVrYyOf7x0Urglr0y9ToJEofHS DjZrrM7/iARNi1UjdVTIQKLvjOpmJ7yIHBxKmHjiSRH0QzGt72rC9AHBmzJO4SCI FwzNo9NEsycT2C7CjEk8Vv7q2PNww3xUdP3s0qR40huULnKJdBRaIUiJjCLvb2J3 FPQVQJ+2A3JpelotEiNiXhanyCOngwCI7vkJ7F0UlZmFkLPK/8Tw+oOHaU9hyjAa 4PDpZ/4YiXdLrt97HT4vKhHVn8ajzw== =UPNZ -----END PGP SIGNATURE-----