summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2002-04-11 10:34:15 +0000
committern_hibma <n_hibma@FreeBSD.org>2002-04-11 10:34:15 +0000
commit7cbe328a88eda9b9baa7d15ba80c4fa79ae59e0a (patch)
tree7e4f3351f48b817d9f9bfe04b74dc83b6e9b42f1 /sys/dev
parenta2bdc11625ac3ed770aed5f838725e3f00c2c279 (diff)
downloadFreeBSD-src-7cbe328a88eda9b9baa7d15ba80c4fa79ae59e0a.zip
FreeBSD-src-7cbe328a88eda9b9baa7d15ba80c4fa79ae59e0a.tar.gz
Delay umass_cam_rescan by 200 ms to make sure attach is finished by the
time we tell CAM to rescan the bus. Together with the previous patch this should avoid the problem where the devices would wedge because they got spoken to over two different pipes. Tested by: Tomas Pluskal <plusik@pohoda.cz>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/umass.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index c458dae..4a4df6a 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -517,7 +517,7 @@ Static void umass_cam_quirk_cb (struct umass_softc *sc, void *priv,
Static void umass_cam_rescan_callback
(struct cam_periph *periph,union ccb *ccb);
-Static void umass_cam_rescan (struct umass_softc *sc);
+Static void umass_cam_rescan (void *addr);
Static int umass_cam_attach_sim (void);
Static int umass_cam_attach (struct umass_softc *sc);
@@ -2097,8 +2097,13 @@ umass_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb)
}
Static void
-umass_cam_rescan(struct umass_softc *sc)
+umass_cam_rescan(void *addr)
{
+ /* Note: The sc is only passed in for debugging prints. If the device
+ * is disconnected before umass_cam_rescan has been able to run the
+ * driver might bomb.
+ */
+ struct umass_softc *sc = (struct umass_softc *) addr;
struct cam_path *path;
union ccb *ccb = malloc(sizeof(union ccb), M_USBDEV, M_WAITOK);
@@ -2155,7 +2160,11 @@ umass_cam_attach(struct umass_softc *sc)
* after booting has completed, when interrupts have been
* enabled.
*/
- umass_cam_rescan(sc);
+
+ /* XXX This will bomb if the driver is unloaded between attach
+ * and execution of umass_cam_rescan.
+ */
+ timeout(umass_cam_rescan, sc, MS_TO_TICKS(200));
}
return(0); /* always succesfull */
OpenPOWER on IntegriCloud