Re: [PATCH v16 5/7] spi: pxa2xx: disable DMA for Apple MacBook8,1

From: Shih-Yuan Lee (FourDollars)

Date: Tue Jul 21 2026 - 11:26:52 EST


On Tue, Jul 21, 2026 at 11:05 PM Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> On Tue, Jul 21, 2026 at 10:34:20PM +0800, Shih-Yuan Lee (FourDollars) wrote:
> > On Tue, Jul 21, 2026 at 5:26 PM Shih-Yuan Lee (FourDollars)
> > > On Tue, Jul 21, 2026 at 5:18 PM Lukas Wunner <lukas@xxxxxxxxx> wrote:
>
> > > > It would seem better to fix up the incorrect interrupt number in a quirk,
> > > > rather than disabling DMA wholesale.
>
> > > I appreciate the comment. Based on the Bugzilla feedback regarding the
> > > incorrect interrupt assignment, it seems fixing the IRQ value via a
> > > quirk is indeed a better approach than disabling DMA wholesale. While
> > > I am not certain this will resolve the issue entirely, it looks very
> > > promising. I will investigate the IRQ mis-assignment problem further.
>
> > 1. DMAR/IOMMU Validation Failure (Error -22)
> > On modern kernels with Interrupt Remapping (DMAR) enabled, overriding
> > pdev->irq to 21 causes the dw_dmac_pci driver probe to fail with
> > -EINVAL (-22) during request_irq(). This is because the
> > DMAR/IOMMU strictly validates the PCI Requester ID (source ID) against
> > the GSI mapping defined in the ACPI _PRT table. Forcing a device
> > mapped to GSI 20 (00:15.0) to register on GSI 21 triggers a
> > source ID mismatch check, which the kernel rejects.
>
> That really seems like something we ought to be able to do, though I
> think the idiom here is to patch the ACPI tables so they are correct
> rather than quirk things in C code. ICBW about the preferred approach
> there.
>
> BTW, if you're using a LLM to assist with analysis please don't just
> paste the output into mail. Instead make sure you understand what the
> LLM is saying and write up the salient bits.
Hi Mark,

You are absolutely correct. The standard idiom for correcting firmware
bugs in ACPI tables is indeed using the Initrd ACPI Table Override
mechanism (compiling a modified DSDT with corrected _PRT routing and
prepending it to the initramfs).

Actually, I was just following Lukas's suggestion to modify
drivers/dma/dw/pci.c to do a quick proof-of-concept test, and I used
an AI assistant to help me write and deploy the driver quirk code.

I have previous experience with the Initrd ACPI Table Override
mechanism, so I can definitely try that on my machine next to see if
we can get DMA working properly by aligning the PCI routing and DMAR
mapping correctly).

Also, I will keep your advice in mind regarding LLM usage, and will
make sure to write up the key points myself rather than pasting raw
output.

Thanks,

Shih-Yuan