Page MenuHomeFreeBSD

bcm2835_sdhci: don't use DMA for kernel dumps
ClosedPublic

Authored by mhorne on Sep 9 2021, 6:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 12:43 PM
Unknown Object (File)
Oct 8 2024, 4:50 PM
Unknown Object (File)
Oct 4 2024, 8:22 PM
Unknown Object (File)
Oct 4 2024, 4:34 PM
Unknown Object (File)
Oct 4 2024, 3:03 PM
Unknown Object (File)
Oct 4 2024, 11:49 AM
Unknown Object (File)
Oct 4 2024, 7:55 AM
Unknown Object (File)
Oct 4 2024, 6:00 AM
Subscribers

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mhorne requested review of this revision.Sep 9 2021, 6:29 PM
mhorne edited the test plan for this revision. (Show Details)EditedSep 9 2021, 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.Sep 20 2021, 7:50 PM
This revision was automatically updated to reflect the committed changes.