History log of /freebsd-10.0-release/sys/dev/mlx/mlx_pci.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 240963 26-Sep-2012 jhb

Remove FreeBSD 4.x compat shims. Verified by md5.


# 240608 17-Sep-2012 jhb

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)


# 232854 12-Mar-2012 scottl

Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.


# 227843 22-Nov-2011 marius

- There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
(bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
since r52045) but even recently added device drivers do this unnecessarily.
Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
Discussed with: jhb
- Also while at it, use __FBSDID.


# 148570 30-Jul-2005 csjp

Add missing parenthesis around error handling code upon attaching
mlx devices. This fixes an issue where mlx device drives fail to be
detected at system boot.

This is a RELENG_6 candidate.

Submitted by: oliver
PR: kern/84163


# 146734 29-May-2005 nyan

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


# 144161 26-Mar-2005 phk

Don't call mlx_free() i mlx_attach() in case of failure. Doing so
in mlx_attach_pci() is much cleaner.

Inspired by: Coverity


# 143788 18-Mar-2005 das

If mlx_attach() returns an error, don't free sc again.

Spotted by: Ted Unangst using the Coverity Prevent static analysis tool
Reviewed by: scottl


# 143158 05-Mar-2005 imp

Use BUS_PROBE_DEFAULT for pci probe return value


# 129879 30-May-2004 phk

Add missing <sys/module.h> includes


# 127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 119285 22-Aug-2003 imp

Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.


# 117126 01-Jul-2003 scottl

Mega busdma API commit.

Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma. At the moment, this is used for the
asynchronous busdma_swi and callback mechanism. Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg. dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create(). The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms. The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by: tmm, gibbs


# 112946 01-Apr-2003 phk

Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now.

Spell bioq_disksort() consistently with the remaining bioq_*().

#include <geom/geom_disk.h> where this is more appropriate.


# 111979 08-Mar-2003 phk

Centralize the devstat handling for all GEOM disk device drivers
in geom_disk.c.

As a side effect this makes a lot of #include <sys/devicestat.h>
lines not needed and some biofinish() calls can be reduced to
biodone() again.


# 78752 25-Jun-2001 msmith

Driver modifications consistent with my other drivers to facilitate
the use of a single set of sources across 4.x and 5.x branches.

No significant code changes.


# 69292 28-Nov-2000 mdodd

Avoid hardcoding the 'rid' and 'type' of the MEM/IOPORT resource.
Store the 'rid' and 'type' in the softc and use them in mlx.c:mlx_free().

EISA and MCA front ends will require this.

Approved by: msmith


# 67782 28-Oct-2000 msmith

Return -10 from the PCI probe to allow room for an updated driver to
override one built into the kernel.


# 64223 04-Aug-2000 msmith

Add support for 2.x/3.x firmware adapters which are too old to have a
memory-mapped register window. This closes the last known issue with
2.x vintage adapters.


# 60074 06-May-2000 msmith

Change the way that scatter/gather list tables are allocated so that we
can use all of the s/g entries available on smaller cards. This is
necessary if we want to be able to handle a non-page-aligned 64k transfer
on 2.x and 3.x firmware.

Fix a missing splx() that may have left us at splbio() for longer than
desired.

Reduce shadowing of controller-supplied parameters a little.


# 60041 05-May-2000 phk

Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by: peter


# 59391 19-Apr-2000 phk

Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>


# 58188 18-Mar-2000 msmith

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.


# 54419 10-Dec-1999 msmith

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.


# 52544 26-Oct-1999 msmith

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.


# 52225 14-Oct-1999 msmith

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.


# 51973 07-Oct-1999 msmith

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.