Page MenuHomeFreeBSD

mmc_da: implement d_dump method, sddadump
ClosedPublic

Authored by avg on Jan 11 2022, 2:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 5:35 PM
Unknown Object (File)
Jan 29 2024, 9:08 PM
Unknown Object (File)
Jan 25 2024, 7:22 AM
Unknown Object (File)
Dec 20 2023, 5:45 AM
Unknown Object (File)
Dec 12 2023, 9:49 AM
Unknown Object (File)
Nov 5 2023, 8:47 PM
Unknown Object (File)
Oct 15 2023, 8:42 AM
Unknown Object (File)
Oct 15 2023, 8:42 AM
Subscribers
None

Details

Summary

sddadump has been derived from sddastart.

mmc_sim interface has grown a new method, cam_poll, to support polled
operation.

mmc_sim code has been changed to provide a sim_poll hook only if the
controller implements the new method. The hooks is implemented in terms
of the new mmc_sim_cam_poll method.
Additionally, in-progress CCB-s now have CAM_REQ_INPROG status to
satisfy xpt_pollwait().

mmc_sim_cam_poll method has been implemented in dwmmc host controller.

Test Plan

Tested on Rock64:

panic: kdb_sysctl_panic
cpuid = 3
time = 1641841341
KDB: stack backtrace:
db_trace_self() at db_trace_self
db_trace_self_wrapper() at db_trace_self_wrapper+0x30
vpanic() at vpanic+0x174
panic() at panic+0x44
kdb_sysctl_panic() at kdb_sysctl_panic+0x68
sysctl_root_handler_locked() at sysctl_root_handler_locked+0xe0
sysctl_root() at sysctl_root+0x1ac
userland_sysctl() at userland_sysctl+0x140
sys___sysctl() at sys___sysctl+0x68
do_el0_sync() at do_el0_sync+0x4b0
handle_el0_sync() at handle_el0_sync+0x90
--- exception, esr 0x56000000
Uptime: 1m55s
Dumping 161 out of 996 MB:..3%..13%..23%..33%..43%..53%..62%..72%..82%..92%
Dump complete

After the reboot:

Jan 10 19:04:53 rock64b savecore[896]: reboot after panic: kdb_sysctl_panic
Writing crash summary to /var/crash/core.txt.3.

The vmcore file was usable with kgdb.
zpool scrub did not detect any damage (writes outside of the swap / dump partition).

Diff Detail

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

Event Timeline

avg requested review of this revision.Jan 11 2022, 2:02 PM

This seems to be sane, but I've not had time to study it in detail.

sys/cam/mmc/mmc_da.c
2040

when would that be possible during a system core dump?

This revision is now accepted and ready to land.Jan 11 2022, 2:55 PM
sys/cam/mmc/mmc_da.c
2040

I guess it can happen if a different eMMC partition is accessed right before a crash / panic.
But so far I haven't seen any practical use of those.

Makes sense, just couple minors points.

sys/cam/mmc/mmc_sim.c
53

How can this be NULL if it is assigned in cam_sim_alloc() and never changed?

170–171

CAM_REQ_INPROG should already be set by xpt_action(). It should not be needed here.

sys/cam/mmc/mmc_sim.c
53

Hmm, I just thoughtlessly copied the check from mmc_cam_sim_default_action().
I guess it can be safely removed from both places.

sys/cam/mmc/mmc_sim.c
170–171

I see. Thank you for the advice.

address comments from mav

This revision now requires review to proceed.Jan 11 2022, 7:04 PM
avg marked 2 inline comments as done.Jan 11 2022, 7:05 PM
This revision is now accepted and ready to land.Jan 11 2022, 7:17 PM
sys/cam/mmc/mmc_da.c
2055

/ MMC_SECTOR_SIZE would be more clear.

2057

We really should make a define for this but that's out of scope of this review.

2063

MMC_SECTOR_SIZE * count would be more clear

sys/cam/mmc/mmc_da.c
2055

Let me do this as a follow-up commit (I promise!) and cover sddastart as well.
Thanks!

manu added inline comments.
sys/cam/mmc/mmc_da.c
2055

Sure :)

This revision was automatically updated to reflect the committed changes.