Date: Sun, 25 Oct 2009 11:45:04 GMT From: Alexander Motin <mav@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 169793 for review Message-ID: <200910251145.n9PBj44O097468@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=169793 Change 169793 by mav@mav_mavtest on 2009/10/25 11:44:40 Replace DELAY() with device freezing to not spent 1s in a loop. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#14 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_pmp.c#14 (text+ko) ==== @@ -578,7 +578,12 @@ softc->pm_step++; if (softc->pm_step >= softc->pm_ports) { softc->pm_step = 0; - DELAY(5000); + cam_freeze_devq(periph->path); + cam_release_devq(periph->path, + RELSIM_RELEASE_AFTER_TIMEOUT, + /*reduction*/0, + /*timeout*/5, + /*getcount_only*/0); printf("PM reset done\n"); softc->state = PMP_STATE_CONNECT; } @@ -607,7 +612,12 @@ softc->pm_step++; } else { if (softc->pm_try < 100) { - DELAY(10000); + cam_freeze_devq(periph->path); + cam_release_devq(periph->path, + RELSIM_RELEASE_AFTER_TIMEOUT, + /*reduction*/0, + /*timeout*/10, + /*getcount_only*/0); softc->pm_try++; } else { printf("PM status: %d - %08x\n", softc->pm_step, res); @@ -621,18 +631,13 @@ softc->pm_step++; } } - if (softc->pm_step < softc->pm_ports) { - xpt_release_ccb(done_ccb); - xpt_schedule(periph, priority); - return; - } else { + if (softc->pm_step >= softc->pm_ports) { + softc->state = PMP_STATE_CLEAR; softc->pm_step = 0; - softc->state = PMP_STATE_CLEAR; - xpt_release_ccb(done_ccb); - xpt_schedule(periph, priority); - return; } - break; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; case PMP_STATE_CLEAR: softc->pm_step++; if (softc->pm_step < softc->pm_ports) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910251145.n9PBj44O097468>