Commit Graph

57 Commits

Author SHA1 Message Date
gson 549d91253b Turn the "esiop_intr: I shouldn't be there !" panic into a printf
followed by a return from the interrupt handler.  The condition is
triggered on some KVM virtual hosts, apparently harmlessly, and not
panicing makes it possible to boot a NetBSD GENERIC kernel on those
hosts.  Also make the same change to siop to minimize divergence
between siop and esiop.  Fixes PR kern/48277.
2013-11-02 13:59:14 +00:00
gson 69b89ed80e Fix incorrect function names in panic message strings. 2013-10-30 08:40:32 +00:00
uebayasi 8184d5dc03 Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants.  These are provided by sys/param.h now.
2010-11-13 13:51:57 +00:00
jakllsch f2005c3157 Allow e?siop_dump_script() to work with on-chip RAM. Prefix
DUMP_SCRIPT with SIOP_.  Additionally, avoid undefining DEBUG,
condition on SIOP_DEBUG instead.
2010-09-09 14:50:25 +00:00
jakllsch 488f603517 Add (missing) newlines to error messages. 2010-05-02 17:37:52 +00:00
jakllsch 295766de32 Improve error paths in (e)siop_scsipi_request():
- When terminating the adapter request after the cmd has been removed
   from the free list, put that cmd back on the free list before returing.
 - Correctly indicate which bus_dma_load() failed.

Analysis and fix from Michael L. Hitch in PR/42844.
2010-04-09 19:25:52 +00:00
mrg ebc9e23316 various aprint_* fixes. 2010-03-11 03:54:56 +00:00
dholland dedb5db201 Make ESIOP_DEBUG compile (on some platforms? depends on bus definitions...)
From Chris Ross in PR 42792.
2010-02-12 06:40:52 +00:00
bouyer 6d07b400dc Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
2009-10-19 18:41:07 +00:00
tsutsui 4466014699 Remove unnecessary whitespace. 2009-09-04 18:29:52 +00:00
tsutsui 49d9fc80f4 Misc cleanup:
- some KNF
- u_intNN_t -> uintNN_t
- wrap long lines and fix indent
- remove return statements at the end of void functions
- use __arraycount()

XXX: many inconsistent aprint_error_dev(9) vs printf(9)
2009-05-16 03:57:57 +00:00
tsutsui 31ec75e9f1 Split device_t/softc.
No crash on:
esiop0 at pci0 dev 11 function 0: Symbios Logic 53c875 (ultra-wide scsi)
siop0 at pci0 dev 9 function 0: Symbios Logic 53c810a (fast scsi)
siop0 at gsc0 hpa 0xf0830000 path 2/0/7 irq 3 ipl 6: NCR53C720 rev 2
2009-05-15 17:55:44 +00:00
cegger 4b83748ce5 ansify function definitions 2009-03-15 15:52:12 +00:00
dsl 82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl 454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
cegger 7088512994 use aprint_*_dev and device_xname 2008-04-08 12:07:25 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
martin eb9963a5e5 Do not stop callouts on polled commands. Problem noticed by Chris Ross
when trying to do a kernel dump on sparc64.
Approved by Manuel Bouyer.
2007-09-30 11:59:41 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
garbled 8e03013027 Comment out the debug options to siop, and change the undef to define.
This way they will be compiled by the i386 DEBUG kernel and tested.
2006-11-02 15:08:30 +00:00
garbled a68eec4cf9 Make these compile when SIOP_DEBUG is enabled, by nuking the reference to
t_offset, which no longer seems to exist.
2006-11-02 14:55:04 +00:00
christos f6e519df16 Coverity CID 3015: Check before using (from Arnaud Lacombe) 2006-09-29 14:28:46 +00:00
perry 3d4ed1fbc7 __inline__ -> inline 2005-12-24 23:41:33 +00:00
bouyer 98fae666e4 Some drives disconnect after the last data phase without a save data pointer
message. In such case we would not update resid with the proper value
(eventually resid would not be updated at all if there was only one data
phase). To fix this, have the script save the offset in the data tables at
disconnect time if there was a transfer, and use this to compute the resid
if the current offset is 0.
Problem reported and patch tested by edwin, Roy Bixler and YAMAMOTO Takashi.
Fix kern/31990 by YAMAMOTO Takashi.
2005-11-18 23:10:32 +00:00
bouyer 091d59fa24 Don't assume all LUNs are probed before scsipi sets the mode, and always check
if lun_tagtbl needs to be allocated. Patch from john heasley in kern/29603.
2005-03-23 21:23:15 +00:00
perry 18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
bouyer eea7ca5986 Rmove a redundant BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE, and fix
another one (POST -> PRE)
2004-05-20 20:57:50 +00:00
bouyer 516871a573 Add support for the Ignore Wide Residue SCSI message. 2004-05-17 20:12:34 +00:00
bouyer 83478e12f3 when an unexpected disconnect occurs only compute the resid; do the
real save data pointers when we get the message (or rather, at disconnect
time following the message).
Factor out code to do this, and to deal with xs->resid, in siop_common.c.
2004-05-17 18:37:02 +00:00
bouyer 76fa396c1d Properly compute xs->resid, instead of assuming it'll always be 0 when
a command is done.
2004-05-17 11:10:24 +00:00
bouyer 751597cddb cbd -> cdb
Command Block Descriptor -> Command Descriptor Block
Pointed out by Allen Briggs.
2004-03-16 19:10:43 +00:00
bouyer 542c876565 Extract the code printing the CBD from scsipi_print_sense(), so that it's
usable in other context.
Use the new scsipi_print_cbd() to dump the command in case of timeout
in siop/esiop.
2004-03-15 22:43:43 +00:00
bouyer 6338d77271 The real value of the message is in msgin, not
esiop_cmd->cmd_tables->msg_in[0], so print the correct value.
2004-03-10 21:51:29 +00:00
wiz c5670263e0 Fix some typos. From Tom Cosgrove via jmc@openbsd. 2003-11-02 11:07:44 +00:00
mycroft 0b179751bd XXX: gcc 2003-10-29 01:12:23 +00:00
christos 8bfd5e3292 Fix uninitialized variable warnings 2003-10-25 18:34:14 +00:00
bouyer 3200934182 Remove unused esiop_scsicmd() prototype. 2003-08-04 19:50:11 +00:00
drochner 71bedfd458 Avoid an obscure gcc3 complaint about
"dereferencing type-punned pointer" by a cast to "void *".
I don't completely understand the warning, but it helps.
2003-07-03 11:12:32 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
thorpej 749715f6ee Use aprint_*(). 2003-01-31 00:26:25 +00:00
wiz e00173a7f2 Spell 'should' correctly. 2002-07-18 11:59:06 +00:00
bouyer af09484589 Be more verbose when returning XS_DRIVER_STUFFUP 2002-05-18 16:09:43 +00:00
thorpej 4daab7072a Don't access a scsipi channel's periph table directly; use
scsipi_lookup_periph().
2002-05-16 02:50:53 +00:00
bouyer 50bb653982 More debug printfs. 2002-05-04 17:51:16 +00:00
bouyer 1a268e6df1 Add a missing esiop_script_sync(), and debug messages improvements. 2002-04-29 15:44:16 +00:00
bouyer eea7ef4c53 Use a u_int32_t in script RAM instead of the SEM bit in ISTAT to pass flags
between script and driver. This allows more than one flag, and is easier to
manage (we almost can't read/write istat outside of the irq handler).
2002-04-27 18:46:49 +00:00
bouyer 5387f035d3 Implement a ring for the completed commands. This avoid a (problematic only
if error occurs after status is collected) race condition
when using the status byte to detect completed commands (a command descriptor
could be recycled before the device disconnected), and make the
interrupt routine handling completed commands more efficient (no need to
scan target * lun * tag array any more).
2002-04-27 17:39:51 +00:00
bouyer 4b307fe0af It's not safe to access the SCNTL1 register while the SCRIPT is running.
On the 1010 this can wedge the chip. So abort the script instead.
the abort interrupt will trigger a bus reset.
2002-04-25 20:05:10 +00:00
bouyer f66f6c27a6 - We can't share the per-lun DSA entry for untagged and tag table DSA;
there may be tagged commands still running when we queue a request sense
  command.
  Solve this by using 2 DSA entry per LUN
- Now that we have the command DSA before select, we can load T/L/Q in
  SCRATCHC. This makes the selection timeout handler simpler.
- Avoid a race condition when setting the free flag in the cmd ring (see
  comment in the script)
- don't forget to update the ID in the head of LUN table after a sync/wide
  negotiation. This fixes the command timeout at the first data command
  after negotiation (the bus reset handler did update the ID properly,
  so subsequent commands were OK).
- for DMA interrupts, clear fifo if it's not empty. Leaving the fifo dirty
  would prevent subsequent interrupts from coming in.
- Various improvements in debug messages
- misc cleanups.
2002-04-25 19:34:02 +00:00
bouyer b46922a07a For a new command, use the id in the command table and get rid of the ID in the
scheduler slot. This costs a few more instructions but divide the size of the
scheduler ring by 2, saving 1k of onboard RAM (a bus with 15 devices would
overflow the on-board RAM by 128 bytes).
2002-04-24 09:43:14 +00:00