Page MenuHomeFreeBSD

sdhci: Try to complete the last transaction if dumping
ClosedPublic

Authored by jhibbits on Tue, Dec 16, 2:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 16, 9:59 PM
Unknown Object (File)
Tue, Dec 16, 9:37 PM
Unknown Object (File)
Tue, Dec 16, 9:33 PM
Unknown Object (File)
Tue, Dec 16, 9:09 PM
Unknown Object (File)
Tue, Dec 16, 8:15 PM
Subscribers
None

Details

Summary

If the kernel panics while a thread is in the middle of an SDHCI
transaction, trying to dump to a dump target on the MMC would result in
a hang. Fix this by completing the transaction first.

Obtained from: Hewlett Packard Enterprise

Diff Detail

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

Event Timeline

jhibbits created this revision.
sys/dev/sdhci/sdhci.c
2198–2202

I realize that I could skip this whole bit, putting it into an else block, but I chose to just "undo and redo" instead. I don't think it makes it any less readable, and the new bit should rarely execute anyway (at most once in a runtime).

sys/dev/sdhci/sdhci.c
2195

two different conditions worry me. Why'd you do that?
And why is it OK?

Avoid the extra release_host/acquire_host, since we know it's already in that taken state.

sys/dev/sdhci/sdhci.c
2195

We're trying to grab the bus. If it's busy, then there may be a transaction in progress. We can't just wait for the bus to be free because nothing will release the bus when the system is stopped. The goal here is to complete any request that's in flight, until the device (eMMC, etc) is available to dump to. This is done above in sdhci_generic_request() if dumping.

Ok. This makes good sense. I'd be tempted to return 0 rather than err, but both are fine.

This revision is now accepted and ready to land.Wed, Dec 17, 5:33 AM