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)
Thu, Apr 4, 7:16 AM
Unknown Object (File)
Jan 14 2024, 3:18 PM
Unknown Object (File)
Jan 11 2024, 12:36 AM
Unknown Object (File)
Jan 11 2024, 12:12 AM
Unknown Object (File)
Dec 23 2023, 5:29 PM
Unknown Object (File)
Dec 20 2023, 4:52 AM
Unknown Object (File)
Dec 14 2023, 8:37 PM
Unknown Object (File)
Sep 20 2023, 10:28 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.