HomeFreeBSD

mmc_cam_sim_default_action: do not touch the ccb after dispatching it

Description

mmc_cam_sim_default_action: do not touch the ccb after dispatching it

If MMC_SIM_CAM_REQUEST() is successful the ccb could be running or being
completed as the method returns. Modifying the ccb status could override
whatever status was already set by a MMC driver.

I am not sure what was the purpose of setting the status to CAM_REQ_INVALID
in the success path. I assume that it was to catch a possibility that the
ccb could be completed without its status explicitly set. So, I am keeping
the code, it's just moved to before the MMC_SIM_CAM_REQUEST call.

Without this change I was getting random and phantom EIO errors on Rock64
running off an SD card (dwmmc driver) plus occasional panics like:

Memory modified after free 0xffffa00003985800(2040) val=6 @ 0xffffa00003985854
panic: Most recently used by CAM CCB

MFC after: 1 week

Details

Provenance
avgAuthored on Jul 9 2021, 2:53 PM
Parents
rG693ddf4dc4b9: Fix LINT kernel build issues after c3987b8ea793c11f61fecb14ef93195a23e3522c .
Branches
Unknown
Tags
Unknown