Commit graph

11 commits

Author SHA1 Message Date
Scott Long 20fc2576fe Apply a torniquet to the problem of the drive unexpectedly disconnecting
during a data phase.  Before, we would try to recover the autosense, but
the DMA engine would still be active with interrupted transfer, and we'd
quickly spiral out of control and cause massive data corruption.  For now,
just reset the chip and cancel everything.  The better solution is to
cancel the DMA operation, but there is no clear way to do that right now.
The data corruption problem is severe enough to warrant this fix in the
interim.  Thanks to Kris Kenneway to sacrificing countless filesystems to
this bug.

MFC After: 3 days
2005-04-25 22:11:43 +00:00
Scott Long 4bd55c43ea If we get interrupted during a data phase and the DMA engine is still
pumping data despite our scsi data counters being at 0, something has
gone massively wrong.  The consequence of happily ignoring this is more
DMA phase errors and a disk full of spammed sectors.  Instead, panic on
the first occurance to hopefully limit the damage.

MFC After: 3 days
2005-04-22 03:37:10 +00:00
Marius Strobl e993bdf0b7 Merge some style and minor changes from NetBSD:
- ncr53c9x.c:
  1.108: Remove unreachable break after return and goto statements.
  1.109: avoid strong words; use 'screw' instead
  1.110: Fix some typos. From Tom Cosgrove via jmc@openbsd.
  1.114: nuke trailing whitespace

  1.107 was already merged, 1.112 and 1.113 are not relevant for FreeBSD.
  1.111 is a functional change and will be merged later.

- ncr53c9xreg.h:
  1.12: DMA, not dma nor Dma.
  1.13: Fix some typos. From Tom Cosgrove via jmc@openbsd.
  1.14: nuke trailing whitespace

- ncr53c9xvar.h:
  1.43: Fix some typos. From Tom Cosgrove via jmc@openbsd.
  1.44: Constify.

  1.42 and 1.46 were already merged, 1.45 is not relevant for FreeBSD.
2005-04-17 17:44:01 +00:00
Scott Long a6b86949fc The existing locking in the esp driver appears to be fairly adequate, so
set the interrupt handler to be INTR_MPSAFE now that xpt_done() can be
called without Giant.  Giant is still on the top half of the driver and
the timeout handlers.
2005-03-02 15:56:42 +00:00
Warner Losh 098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Tom Rhodes 8be373eedd Add some style(9) touch ups; style(9) states that new code should follow
these conventions and, well, this is a new driver.

Tested on:	i386, sparc64
Reviewed by:	scottl
2004-08-02 22:55:23 +00:00
Scott Long 6387afd9c5 Pass the correct argument to ncr53c9x_timeout() 2004-06-13 18:45:57 +00:00
Scott Long 1da2ceea66 Get rid of UMA zones and instead allocate all ecb's up front and track them
in a TAILQ.  Re-arrange some of the ecb elements so that they can stay
stable through alloc/free cycles while the rest get bzero'd.

- Use the tag_id from the ecb rather than fro the ccb.  The latter is only
for target mode.

- Honor the ccb flags for tag_action when deciding whether to do a tagged
or untagged transaction.

- Re-arrange autosense completion so that it works correctly in failure
cases.

- Turn on the PI_TAG_ABLE flag so that CAM will send us tagged transactions.

This enables tagged queueing in the driver.
2004-06-13 09:08:44 +00:00
Scott Long fec4efc10b When autosense is retrieved, tell CAM about it instead of juust pretending
that the command succeeded.  Sheesh!  This makes CDROMs no longer cause an
instant panic at boot.  Thanks to Jake Burkholder for providing a remote
test setup.
Also make device resets work, thanks to another typo.
2004-06-12 05:19:17 +00:00
Scott Long 13bbbdd9c2 Make the XPT_CALC_GEOMETRY op dependent on the sc_extended_geometry flag
that is set in the bus front-end.
2004-06-11 15:33:20 +00:00
Scott Long c31d0cf77b Port the NetBSD esp(4) driver. This only includes the sbus front-end, so
its primary use is for the FEPS/FAS366 SCSI found in Sun Ultra 1e and 2
machines.  Once the pci front-end is ported, this driver can replace the
amd(4) driver.

The code as-is is fairly stable.  I've disabled tagged-queueing until I can
figure out a corruption bug related to it.  I'm importing it now so that
people with these machines can (finally) stop netbooting and report bugs
before 5.3.
2004-06-10 05:11:39 +00:00