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)
Wed, Nov 20, 9:10 AM
Unknown Object (File)
Mon, Nov 18, 11:15 AM
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
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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41451
Build 38340: arc lint + arc unit

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.