Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/thorpej_scsipi]: src/sys/dev/sbus Eliminate sleeping from adapter routines.



details:   https://anonhg.NetBSD.org/src/rev/f55334ab0222
branches:  thorpej_scsipi
changeset: 477295:f55334ab0222
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Oct 20 21:02:23 1999 +0000

description:
Eliminate sleeping from adapter routines.

diffstat:

 sys/dev/sbus/isp_sbus.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r aa34e420653f -r f55334ab0222 sys/dev/sbus/isp_sbus.c
--- a/sys/dev/sbus/isp_sbus.c   Wed Oct 20 20:42:10 1999 +0000
+++ b/sys/dev/sbus/isp_sbus.c   Wed Oct 20 21:02:23 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_sbus.c,v 1.14 1999/10/14 02:16:04 mjacob Exp $ */
+/* $NetBSD: isp_sbus.c,v 1.14.2.1 1999/10/20 21:02:23 thorpej Exp $ */
 /*
  * SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
  *
@@ -332,8 +332,8 @@
 {
        struct isp_sbussoftc *sbc = (struct isp_sbussoftc *) isp;
        bus_dmamap_t dmamap;
-       int dosleep = (xs->xs_control & XS_CTL_NOSLEEP) != 0;
        int in = (xs->xs_control & XS_CTL_DATA_IN) != 0;
+       int error;
 
        if (xs->datalen == 0) {
                rq->req_seg_count = 1;
@@ -345,8 +345,17 @@
                panic("%s: dma map already allocated\n", isp->isp_name);
                /* NOTREACHED */
        }
-       if (bus_dmamap_load(sbc->sbus_dmatag, dmamap, xs->data, xs->datalen,
-           NULL, dosleep ? BUS_DMA_WAITOK : BUS_DMA_NOWAIT) != 0) {
+       error = bus_dmamap_load(sbc->sbus_dmatag, dmamap, xs->data, xs->datalen,
+           NULL, BUS_DMA_NOWAIT);
+       switch (error) {
+       case 0:
+               break;
+
+       case ENOMEM:
+       case EAGAIN:
+               return (CMD_EAGAIN);
+
+       default:
                XS_SETERR(xs, HBA_BOTCH);
                return (CMD_COMPLETE);
        }



Home | Main Index | Thread Index | Old Index