Page MenuHomeFreeBSD

bcm2835_sdhci: don't use DMA for kernel dumps

Authored by mhorne on Thu, Sep 9, 6:29 PM.



When handling a data irq, the sdhci driver calls the sdhci_platform_will_handle()
method, to determine if it should allow the platform driver to handle the transfer
or fall back to programmed I/O. While dumping, the data irq path may be invoked
directly (not from an interrupt context), which the bcm2835_sdhci DMA code
is not prepared to handle. Return early in this case, to force the fallback to PIO.

Otherwise, the KASSERT that follows will be triggered, and the dump will
fail. On non-INVARIANTS kernels, the system will hang, waiting for a DMA
interrupt that will never arrive.

Test Plan

Without this patch, attempting to dump to a swap partition on the SD card fails on my RPI 2B. With it, it completes successfully.

Diff Detail

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mhorne requested review of this revision.Thu, Sep 9, 6:29 PM
mhorne edited the test plan for this revision. (Show Details)EditedThu, Sep 9, 6:32 PM

It is possible that this check would be better placed in the sdhci driver itself, where SDHCI_PLATFORM_WILL_HANDLE() is actually called. This is the only driver that implements this method, however.

aggressive pong. :-)

I think it's fine to address it here for the time being.

This revision is now accepted and ready to land.Mon, Sep 20, 7:50 PM