Page MenuHomeFreeBSD

D15955.id55260.diff
No OneTemporary

D15955.id55260.diff

Index: sys/arm/allwinner/aw_mmc.c
===================================================================
--- sys/arm/allwinner/aw_mmc.c
+++ sys/arm/allwinner/aw_mmc.c
@@ -176,6 +176,7 @@
static void aw_mmc_cam_poll(struct cam_sim *);
static int aw_mmc_cam_settran_settings(struct aw_mmc_softc *, union ccb *);
static int aw_mmc_cam_request(struct aw_mmc_softc *, union ccb *);
+static void aw_mmc_cam_start_discovery(device_t);
static void aw_mmc_cam_handle_mmcio(struct cam_sim *, union ccb *);
#endif
@@ -378,6 +379,35 @@
return (0);
}
+
+static void
+aw_mmc_cam_start_discovery(device_t dev)
+{
+ struct aw_mmc_softc *sc;
+ union ccb *ccb;
+ uint32_t pathid;
+
+ sc = device_get_softc(dev);
+
+ pathid = cam_sim_path(sc->sim);
+ ccb = xpt_alloc_ccb_nowait();
+ if (ccb == NULL) {
+ device_printf(dev, "Unable to alloc CCB for rescan\n");
+ return;
+ }
+
+ /*
+ * We create a rescan request for BUS:0:0, since the card
+ * will be at lun 0.
+ */
+ if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid,
+ /* target */ 0, /* lun */ 0) != CAM_REQ_CMP) {
+ device_printf(dev, "Unable to create path for rescan\n");
+ xpt_free_ccb(ccb);
+ return;
+ }
+ xpt_rescan(ccb);
+}
#endif /* MMCCAM */
static int
@@ -544,6 +574,9 @@
}
mtx_unlock(&sc->sim_mtx);
+
+ /* Force rescan */
+ aw_mmc_cam_start_discovery(dev);
#else /* !MMCCAM */
child = device_add_child(dev, "mmc", -1);
if (child == NULL) {

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 13, 2:17 AM (5 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26918487
Default Alt Text
D15955.id55260.diff (1 KB)

Event Timeline