diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2005-05-11 18:48:54 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2005-05-11 18:48:54 +0000 |
commit | da5aa746a14ecbe5b33033f82aeb9a5db51432f2 (patch) | |
tree | 647a9d07027a45006fbad1ebe8b98cb90e5aa2f0 | |
parent | 7847cf8cac3ace56d062c6d1962f2df02d25d329 (diff) |
Reset IO completion values to 0 to disable completion holdof. This improves
read performance.
This will only work with firmwares that are launched post 5/13/2005.
Help LSI, ok mickey@
-rw-r--r-- | sys/dev/ic/ami.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 70eaa498760..d23894fe769 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.36 2005/05/09 19:50:48 marco Exp $ */ +/* $OpenBSD: ami.c,v 1.37 2005/05/11 18:48:53 marco Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -326,6 +326,7 @@ ami_attach(sc) const char *p; void *idata; int error; + u_int32_t *pp; if (!(idata = ami_allocmem(sc->dmat, &idatamap, idataseg, NBPG, 1, "init data"))) { @@ -484,7 +485,36 @@ ami_attach(sc) p = "target"; } - AMI_UNLOCK_AMI(sc, lock); + /* reset the IO completion values to 0 + * the firmware either has at least pp[0] IOs outstanding + * -or- + * it times out pp[1] us before it completes any IO + * if the values remain unchanged it locksteps the driver + * to a maximum of 4 outstanding IOs and it hits the 5us timer + * continuously (these are the default values) + * this trick only works with firmwares newer than 5/13/05 + */ + ccb = ami_get_ccb(sc); + ccb->ccb_data = NULL; + cmd = ccb->ccb_cmd; + + cmd->acc_cmd = AMI_MISC; + cmd->acc_io.aio_channel = AMI_SET_IO_CMPL; /* sub opcode */ + cmd->acc_io.aio_param = 0; + cmd->acc_io.aio_data = htole32(pa); + + /* set parameters */ + pp = idata; + pp[0] = 0; /* minimal outstanding commands, 0 disable */ + pp[1] = 0; /* maximal timeout in us, 0 disable */ + if (ami_cmd(ccb, 0, 1) != 0) { + AMI_DPRINTF(AMI_D_MISC, ("setting io completion values" + " failed\n")); + } + else { + AMI_DPRINTF(AMI_D_MISC, ("setting io completion values" + " succeeded\n")); + } if (sc->sc_flags & AMI_BROKEN) { sc->sc_link.openings = 1; @@ -502,6 +532,8 @@ ami_attach(sc) else sc->sc_link.openings = sc->sc_maxcmds; } + + AMI_UNLOCK_AMI(sc, lock); } ami_freemem(sc->dmat, &idatamap, idataseg, NBPG, 1, "init data"); |