diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2007-11-05 13:54:23 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2007-11-05 13:54:23 +0000 |
commit | 9d42dea98fc43e1447f753c94fd699f31d741b20 (patch) | |
tree | 3e0a6fd4e3711d4eab00c67449276f9001ef943a /sys/dev/ciss | |
parent | 70292a328f7e69fe5222b3f4b642515362709050 (diff) | |
download | FreeBSD-src-9d42dea98fc43e1447f753c94fd699f31d741b20.zip FreeBSD-src-9d42dea98fc43e1447f753c94fd699f31d741b20.tar.gz |
Fix NOP message sending in ciss_periodic() which causes panic with
option INVARIANTS.
Reviewed by: simokawa
Tested by: noriyosi_kawano
MFC after: 1 week
Diffstat (limited to 'sys/dev/ciss')
-rw-r--r-- | sys/dev/ciss/ciss.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 15954fe..41f290d 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -183,6 +183,7 @@ static int ciss_name_device(struct ciss_softc *sc, int bus, int target); /* periodic status monitoring */ static void ciss_periodic(void *arg); +static void ciss_nop_complete(struct ciss_request *cr); static void ciss_disable_adapter(struct ciss_softc *sc); static void ciss_notify_event(struct ciss_softc *sc); static void ciss_notify_complete(struct ciss_request *cr); @@ -3100,6 +3101,7 @@ ciss_periodic(void *arg) */ if ((error = ciss_get_request(sc, &cr)) == 0) { cc = CISS_FIND_COMMAND(cr); + cr->cr_complete = ciss_nop_complete; cc->cdb.cdb_length = 1; cc->cdb.type = CISS_CDB_TYPE_MESSAGE; cc->cdb.attribute = CISS_CDB_ATTRIBUTE_SIMPLE; @@ -3107,11 +3109,9 @@ ciss_periodic(void *arg) cc->cdb.timeout = 0; cc->cdb.cdb[0] = CISS_OPCODE_MESSAGE_NOP; - if ((error = ciss_synch_request(cr, 10 * 1000)) != 0) { + if ((error = ciss_start(cr)) != 0) { ciss_printf(sc, "SENDING NOP MESSAGE FAILED\n"); } - - ciss_release_request(cr); } /* @@ -3129,6 +3129,19 @@ ciss_periodic(void *arg) callout_reset(&sc->ciss_periodic, CISS_HEARTBEAT_RATE * hz, ciss_periodic, sc); } +static void +ciss_nop_complete(struct ciss_request *cr) +{ + struct ciss_softc *sc; + + sc = cr->cr_sc; + if (ciss_report_request(cr, NULL, NULL) != 0) { + ciss_printf(sc, "SENDING NOP MESSAGE FAILED\n"); + } + + ciss_release_request(cr); +} + /************************************************************************ * Disable the adapter. * |