]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mmccam: Add two new XPT for MMC and use them in mmc_sim and sdhci
authorEmmanuel Vadot <manu@FreeBSD.org>
Thu, 29 Apr 2021 15:48:49 +0000 (17:48 +0200)
committerEmmanuel Vadot <manu@FreeBSD.org>
Fri, 21 May 2021 15:34:05 +0000 (17:34 +0200)
commitaf2253f61c43a7608cdf6995701c1dc361320064
tree7a71070876a9ede5fbbd34c4eb53c66753a34e72
parent788401188f950001cd9796cdcea9a7e5f92050ab
mmccam: Add two new XPT for MMC and use them in mmc_sim and sdhci

For the discovery phase of SD/eMMC we need to do some transaction in a async
way.
The classic CAM XPT_{GET,SET}_TRAN_SETTING cannot be used in a async way.
This also allow us to split the discovery phase into a more complete state
machine and we don't mtx_sleep with a random number to wait for completion
of the tasks.
For mmc_sim we now do the SET_TRAN_SETTING in a taskqueue so we can call
the needed function for regulators/clocks without the cam lock(s). This part is
still needed to be done for sdhci.
We also now save the host OCR in the discovery phase as it wasn't done before and
only worked because the same ccb was reused.

Reviewed by: imp, kibab, bz
Differential Revision: https://reviews.freebsd.org/D30038
sys/cam/cam_ccb.h
sys/cam/cam_xpt.c
sys/cam/mmc/mmc_sim.c
sys/cam/mmc/mmc_sim.h
sys/cam/mmc/mmc_xpt.c
sys/dev/sdhci/sdhci.c