Changeset 8179d4c in rtems-libbsd for rtemsbsd/sys
- Timestamp:
- 03/26/15 12:48:37 (9 years ago)
- Branches:
- 4.11, 5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
- Children:
- d0ecc91
- Parents:
- 9ea1778
- git-author:
- Sebastian Huber <sebastian.huber@…> (03/26/15 12:48:37)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (03/26/15 12:53:24)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rtemsbsd/sys/dev/dw_mmc/dw_mmc.c
r9ea1778 r8179d4c 81 81 struct mtx bus_mtx; 82 82 bus_space_handle_t bushandle; 83 int bus_busy; 83 84 uint32_t biu_clock; 84 85 uint32_t ciu_clock; … … 125 126 "dw_mmc", MTX_DEF) 126 127 127 #define DW_MMC_BUS_LOCK(_sc) mtx_lock(&(_sc)->bus_mtx)128 #define DW_MMC_BUS_UNLOCK(_sc) mtx_unlock(&(_sc)->bus_mtx)129 #define DW_MMC_BUS_LOCK_INIT(_sc) \130 mtx_init(&_sc->bus_mtx, device_get_nameunit(_sc->dev), \131 "dw_mmc", MTX_DEF)132 133 128 static int 134 129 dw_mmc_poll_reset_completion(struct dw_mmc_softc *sc, uint32_t ctrl_resets) … … 357 352 358 353 DW_MMC_LOCK_INIT(sc); 359 DW_MMC_BUS_LOCK_INIT(sc);360 354 361 355 dw_mmc_platform_install_intr(sc); … … 955 949 struct dw_mmc_softc *sc = device_get_softc(brdev); 956 950 957 DW_MMC_BUS_LOCK(sc); 958 951 DW_MMC_LOCK(sc); 952 while (sc->bus_busy) 953 msleep(sc, &sc->sc_mtx, PZERO, "dw_mmc: acquire host", 0); 954 sc->bus_busy = 1; 955 DW_MMC_UNLOCK(sc); 959 956 return (0); 960 957 } … … 965 962 struct dw_mmc_softc *sc = device_get_softc(brdev); 966 963 967 DW_MMC_BUS_UNLOCK(sc); 968 964 DW_MMC_LOCK(sc); 965 sc->bus_busy = 0; 966 wakeup(sc); 967 DW_MMC_UNLOCK(sc); 969 968 return (0); 970 969 }
Note: See TracChangeset
for help on using the changeset viewer.