PERFORCE change 169516 for review
Alexander Motin
mav at FreeBSD.org
Thu Oct 15 12:16:05 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=169516
Change 169516 by mav at mav_mavtest on 2009/10/15 12:15:49
Use only cam_periph_acquire() instead of cam_periph_hold() on
init and device reset async. We can't sleep in async handler.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#29 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_da.c#29 (text+ko) ====
@@ -555,13 +555,16 @@
{
struct ada_softc *softc = (struct ada_softc *)periph->softc;
+ cam_periph_async(periph, code, path, arg);
+ if (softc->state != ADA_STATE_NORMAL)
+ break;
/*
* Restore device configuration.
*/
softc->state = ADA_STATE_SET_MULTI;
- (void)cam_periph_hold(periph, PRIBIO);
+ cam_periph_acquire(periph);
xpt_schedule(periph, CAM_PRIORITY_DEV);
- /* FALLTHROUGH*/
+ break;
}
default:
cam_periph_async(periph, code, path, arg);
@@ -737,7 +740,7 @@
* to finish the probe. The reference will be dropped in adadone at
* the end of probe.
*/
- (void)cam_periph_hold(periph, PRIBIO);
+ cam_periph_acquire(periph);
xpt_schedule(periph, CAM_PRIORITY_DEV);
/*
@@ -1020,7 +1023,11 @@
* operation.
*/
xpt_release_ccb(done_ccb);
- cam_periph_unhold(periph);
+ if (bioq_first(&softc->bio_queue) != NULL) {
+ /* Have more work to do, so ensure we stay scheduled */
+ xpt_schedule(periph, CAM_PRIORITY_NORMAL);
+ }
+ cam_periph_release_locked(periph);
return;
}
case ADA_CCB_DUMP:
More information about the p4-projects
mailing list