freebsd-dev/sys/cam/mmc
Andriy Gapon 66c183f43f 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
2021-07-12 21:29:26 +03:00
..
mmc_all.h mmcam: Use a static length sbuf buffer 2020-08-04 20:02:23 +00:00
mmc_bus.h
mmc_da.c mmccam: Read the common members of CSD v1.0 and v2.0 2021-06-19 19:06:54 +02:00
mmc_sim_if.m mmccam: Add mmc_sim, a generic sim for mmc driver to use 2021-04-27 19:00:38 +02:00
mmc_sim.c mmc_cam_sim_default_action: do not touch the ccb after dispatching it 2021-07-12 21:29:26 +03:00
mmc_sim.h mmccam: Add two new XPT for MMC and use them in mmc_sim and sdhci 2021-05-21 17:34:05 +02:00
mmc_xpt.c cam: drop unused 'saved_ccb' field from softcs 2021-07-06 10:04:38 +01:00
mmc.h Fix setting RCA for MMC cards 2018-06-19 20:02:03 +00:00