Page MenuHomeFreeBSD

Always return MMC errors from mmc_handle_reply()
ClosedPublic

Authored by kibab on Oct 24 2020, 11:13 AM.

Details

Summary

There are two ways to propagate the error in MMCCAM:

  • Using cmd.error which is set by the peripheral driver;
  • Using CCB status which is... also set by the driver.

The problem is that those two error conditions don't necessarily match.
This leads to the confusion when handling the MMC reply. So enforce the consistency
by panicking if request is marked as completed successfully but MMC-level error
is present (this hints to the programming error).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sys/cam/mmc/mmc_da.c
255 ↗(On Diff #78681)

Should this '0' be spelled 'MMC_ERR_NONE'?

kibab marked an inline comment as done.Nov 3 2020, 8:07 AM
kibab added inline comments.
sys/cam/mmc/mmc_da.c
255 ↗(On Diff #78681)

Yes. here and below.

kibab marked an inline comment as done.
  • Address reviewer comments
This revision is now accepted and ready to land.Nov 3 2020, 8:14 AM
This revision was automatically updated to reflect the committed changes.