| 1193 | } |
| 1194 | |
| 1195 | static void |
| 1196 | its_device_release(device_t dev, struct its_dev *its_dev) |
| 1197 | { |
| 1198 | struct gicv3_its_softc *sc; |
| 1199 | |
| 1200 | KASSERT(its_dev->lpis.lpi_busy == 0, |
| 1201 | ("its_device_release: Trying to release an inuse ITS device")); |
| 1202 | |
| 1203 | /* Unmap device in ITS */ |
| 1204 | its_cmd_mapd(dev, its_dev, 0); |
| 1205 | |
| 1206 | sc = device_get_softc(dev); |
| 1207 | |
| 1208 | /* Remove the device from the list of devices */ |
| 1209 | mtx_lock_spin(&sc->sc_its_dev_lock); |
| 1210 | TAILQ_REMOVE(&sc->sc_its_dev_list, its_dev, entry); |
| 1211 | mtx_unlock_spin(&sc->sc_its_dev_lock); |
| 1212 | |
| 1213 | /* Free ITT */ |
| 1214 | KASSERT(its_dev->itt != 0, ("Invalid ITT in valid ITS device")); |
| 1215 | contigfree((void *)its_dev->itt, its_dev->itt_size, M_GICV3_ITS); |
| 1216 | |
| 1217 | /* Free the IRQ allocation */ |
| 1218 | vmem_free(sc->sc_irq_alloc, its_dev->lpis.lpi_base, |
| 1219 | its_dev->lpis.lpi_num); |
| 1220 | |
| 1221 | free(its_dev, M_GICV3_ITS); |
| 1222 | } |
| 1223 | |
| 1224 | static struct gicv3_its_irqsrc * |
| 1225 | gicv3_its_alloc_irqsrc(device_t dev, struct gicv3_its_softc *sc, u_int irq) |
no test coverage detected