Commit Graph

11 Commits

Author SHA1 Message Date
Pedro F. Giffuni
718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 14:52:40 +00:00
John Baldwin
0fca6f8bf5 Add locking to mlx(4) to make it MPSAFE along with some other fixes:
- Use callout(9) rather than timeout(9).
- Add a mutex as an I/O lock that protects the adapter and is used
  for the I/O path.
- Add an sx lock as a configuration lock that protects the relationship
  of configured volumes.
- Freeze the request queue when a DMA load is deferred with EINPROGRESS
  and unfreeze the queue when the DMA callback is invoked.
- Explicitly poll the hardware while waiting to submit a command to
  allow completed commands to free up slots in the command ring.
- Remove driver-wide 'initted' variable from mlx_*_fw_handshake() routines.
  That state should be per-controller instead.  Add it as an argument
  since the first caller knows when it is the first caller.
- Remove explicit bus_space tag/handle and use bus_*() rather than
  bus_space_*().
- Move duplicated PCI device ID probing into a  mlx_pci_match() routine.
- Don't check for PCIM_CMD_MEMEN (the PCI bus will enable that when
  allocating the resource) and use pci_enable_busmaster() rather than
  manipulating the register directly.

Tested by:	no one despite multiple requests (hope it works)
2012-09-17 15:27:30 +00:00
Scott Long
4161b1a1e9 Don't use PAGE_SIZE to calculate controller-specific attributes.
PR: kern/21220
Submitted by: Dennis Lindroos
MFC After: 1 week
2004-11-25 12:15:49 +00:00
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
Mike Smith
421f2f7d74 Add features required for basic userland management utility:
- implement user-initiated background drive rebuild
 - implement user-initiated background consistency check
 - log controller-initiated background rebuild/check operations

Try to fix the elusive "invalid log operation" bug, and panic if we do
hit this one in the hopes of getting better information.

Tidy up diagnostic messages.

Try to use disk_create/disk_destroy correctly.  This isn't working
properly yet, but it's not clear whose fault that is.
2000-04-11 02:52:46 +00:00
Mike Smith
da8bb3a3bf Update to the latest development version of the Mylex driver. Changes in
this version include:

 - Support for version 2.x firmware (2.42 or later recommended).  This
   means we are the only open-source driver supporting these adapters.
   This code has only been tested on a Digital KZPCA adapter in an Alpha
   system, but is believed to be correct.  NOTE: EISA adapters are not
   yet supported.

 - Support the BIOS/Firmware initialisation handshake protocol.  This
   allows the driver to bring the card up to operational state even if
   the BIOS can't be run (eg. if it's an x86 BIOS in an Alpha system).

 - A working command pasthrough interface.  This allows a user-space
   configuration tool (under development) to issue arbitrary commands
   to the controller or to devices in the system.
2000-03-18 02:01:37 +00:00
Mike Smith
9eee27f16d Updates resulting from new documentation from Mylex and some cleaning:
- Don't keep private copies of some of the data fields from the
   ENQUIRY and ENQUIRY2 commands.  Instead, standardise on the ENQUIRY2
   command for initial adapter information, and keep a copy of the entire
   structure.  Refer to it where appropriate.

 - Move all of the controller description functionality into a new
   function.  Print lots more controller data if bootverbose is set.
   Add knowledge of the DAC960 PR, PT, PTL0 and PRL controllers, rename
   the 960PTL -> PTL0 and 1100P -> 1100PVX.

 - Correctly terminate an error message.

The controller interface procedures have been reviewed against the
Mylex-supplied documentation; no changes appear necessary at this
time.
1999-12-22 01:21:28 +00:00
Mike Smith
5792b7fe0b Major update to the Mylex DAC960 driver adding new hardware support
and fixing some major bugs.

 - Add support for the v5 firmware interface, used by the DAC1164P
   (tested) and AcceleRAID 352 (untested but should work).  We now cover
   all of the Mylex family's protocols except for v2 (used by EISA and
   Alpha-compatible cards).

 - Fix an accounting bug which resulted in endless 'poll still busy'
   messages.  In situations of high controller load the count of poll
   commands could be incremented without actually successfully launching
   a command.  This totally removes the accounting for status poll
   commnads; it was its own worst enemy.

 - Add some simple reentry prevention locks to processing of the waiting
   and completed command queues to prevent races which could result in
   I/O being done or completed twice (both are fatal).  This highlights
   a need for simple locking primitives in both the UP and SMP kernels.

 - Streamline the handling of command completion to reduce the amount of
   redundant work being done.  Remove the code which tests for commands
   that have gone missing in action; nobody has ever seen one of these
   and it wouldn't have worked properly anyhow.

 - Handle disconnection of drives from the controller in the detach,
   not shutdown method.  This avoids problems flushing the cache in
   a panic when a drive is mounted.

 - Don't call bus_generic_detach when disconnecting drives; it doesn't
   actually do anything useful.

 - Increment the log message index regardless of whether we actually
   retrieved one or not.  If we run into a message that we can't fetch,
   we don't want to spin endlessly complaining about the fact.

 - Don't assume that interrupts will work when we're flushing the
   controller.  We may think they are enabled, but in eg. a panic
   situation the controller may not be able to deliver an interrupt.
1999-12-11 00:00:13 +00:00
Mike Smith
4b006d7bb7 Move some hardware-related items to the hardware-related header.
Shift to using the same queueing strategy that the amr driver uses.
Some simple tests indicate that we use about 2% of the CPU at around
500tps with the controller completely saturated with I/O.
1999-10-26 23:20:43 +00:00
Mike Smith
f6b84b08c9 Add support for the version 4 firmware interface and the DAC960 PG and
PJ cards.  This will probably also support the AcceleRAID and
eXtremeRAID cards, but nobody has volunteered one for testing, so I
haven't enabled their PCI device IDs.

Slightly clean up communication between the disk devices and the
controller device as per new practice, and move some more register-
related items int mlxreg.h from mlxvar.h.

Remove some unnecessary read-modify-write operations to the card
control registers; they don't behave like that.

Increase the status polling interval to 10 seconds.  It's still possible
to load the card up to the point where a status poll will find the
previous poll still running, but this will reduce the incidence of
complaints.
1999-10-14 02:54:06 +00:00
Mike Smith
1ac4b82b11 This is a driver for the Mylex DAC960 family of integrated RAID
controllers.  It currently supports the P, PL, PD and PU variants,
with more to be supported shortly.
1999-10-07 02:20:32 +00:00