History log of /freebsd-9.3-release/sys/dev/mlx/
Revision Date Author Comments
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

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


254306 13-Aug-2013 scottl

Merge r254263:

Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register. The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR. Thus, the bit is no longer
a reliable indication of capability, and should not be checked. This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.

This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.

Candidate for 9.2

Submitted by: jhb
Reviewed by: jfv, marius, adrian, achim


239455 20-Aug-2012 delphij

MFC r238997:

Correct a typo.

Reported by: Sascha Wildner <swildner dragonflybsd org>
Reviewed by: scottl


235743 21-May-2012 jhb

Toss bogus mergeinfo.


235738 21-May-2012 sbruno

MFC r235634

Fix and update battery status bits according to linux driver


233024 16-Mar-2012 scottl

MFC 232854,232874,232882,232883,232886 for bus_get_dma_tag()


229093 31-Dec-2011 hselasky

MFC r226173, r227843, r227848 and r227908:
Use DEVMETHOD_END to mark end of device methods.
Remove superfluous device methods.
Add some missing __FBSBID() macros.


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


196403 20-Aug-2009 jhb

Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by: re (kib), attilio


196037 02-Aug-2009 attilio

Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by: ed, hps, jhb, imp, mav, scottl
No answer by: ariff, thompsa, yongari
Tested by: pho,
G. Trematerra <giovanni dot trematerra at gmail dot com>,
Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by: Yahoo! Incorporated
Approved by: re (ksmith)


195534 10-Jul-2009 scottl

Separate the parallel scsi knowledge out of the core of the XPT, and
modularize it so that new transports can be created.

Add a transport for SATA

Add a periph+protocol layer for ATA

Add a driver for AHCI-compliant hardware.

Add a maxio field to CAM so that drivers can advertise their max
I/O capability. Modify various drivers so that they are insulated
from the value of MAXPHYS.

The new ATA/SATA code supports AHCI-compliant hardware, and will override
the classic ATA driver if it is loaded as a module at boot time or compiled
into the kernel. The stack now support NCQ (tagged queueing) for increased
performance on modern SATA drives. It also supports port multipliers.

ATA drives are accessed via 'ada' device nodes. ATAPI drives are
accessed via 'cd' device nodes. They can all be enumerated and manipulated
via camcontrol, just like SCSI drives. SCSI commands are not translated to
their ATA equivalents; ATA native commands are used throughout the entire
stack, including camcontrol. See the camcontrol manpage for further
details. Testing this code may require that you update your fstab, and
possibly modify your BIOS to enable AHCI functionality, if available.

This code is very experimental at the moment. The userland ABI/API has
changed, so applications will need to be recompiled. It may change
further in the near future. The 'ada' device name may also change as
more infrastructure is completed in this project. The goal is to
eventually put all CAM busses and devices until newbus, allowing for
interesting topology and management options.

Few functional changes will be seen with existing SCSI/SAS/FC drivers,
though the userland ABI has still changed. In the future, transports
specific modules for SAS and FC may appear in order to better support
the topologies and capabilities of these technologies.

The modularization of CAM and the addition of the ATA/SATA modules is
meant to break CAM out of the mold of being specific to SCSI, letting it
grow to be a framework for arbitrary transports and protocols. It also
allows drivers to be written to support discrete hardware without
jeopardizing the stability of non-related hardware. While only an AHCI
driver is provided now, a Silicon Image driver is also in the works.
Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware
is possible and encouraged. Help with new transports is also encouraged.

Submitted by: scottl, mav
Approved by: re


191242 18-Apr-2009 ed

Convert mlx(4) and mly(4) to si_drv1 instead of dev2unit().


183397 27-Sep-2008 ed

Replace all calls to minor() with dev2unit().

After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by: kib


182965 12-Sep-2008 sepotvin

Make mlxcontrol work with more than one system drive:
- When searching for the next system drive, return the next one instead
of always returning the first one.
- Plug fd lead and make sure that the MLX_NEXT_CHILD ioctl is called
on the controller fd, not the disk's one.

While there, fix a cut-n-pase error in a warning.

Reviewed by: jhb
Approved by: kan (mentor)
MFC after: 1 month


166901 23-Feb-2007 piso

o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@


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)


144436 31-Mar-2005 sam

plug resource leak

Submitted by: mdodd
Noticed by: Coverity Prevent analysis tool


144434 31-Mar-2005 sam

fix potential null ptr deref

Noticed by: Coverity Prevent analysis tool


144433 31-Mar-2005 sam

avoid null ptr deref

Noticed by: Coverity Prevent analysis tool


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


138090 25-Nov-2004 scottl

Don't use PAGE_SIZE to calculate controller-specific attributes.

PR: kern/21220
Submitted by: Dennis Lindroos
MFC After: 1 week


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


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


126463 01-Mar-2004 scottl

Change another pointer name that was missed in the previous commit.

Spotted by: njl


126461 01-Mar-2004 scottl

Check and free the actual pointer the was used in a malloc instead of
checking and freeing a different pointer that may or may not have been
assigned the same value. This should fix panics under load that were
recently reported.


126113 22-Feb-2004 cperciva

Don't free meo until we're finished using it.

Reported by: "Ted Unangst" <tedu@coverity.com>
Approved by: rwatson (mentor), scottl


126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


126076 21-Feb-2004 phk

Device megapatch 1/6:

Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.


125975 18-Feb-2004 phk

Change the disk(9) API in order to make device removal more robust.

Previously the "struct disk" were owned by the device driver and this
gave us problems when the device disappared and the users of that device
were not immediately disappearing.

Now the struct disk is allocate with a new call, disk_alloc() and owned
by geom_disk and just abandonned by the device driver when disk_create()
is called.

Unfortunately, this results in a ton of "s/\./->/" changes to device
drivers.

Since I'm doing the sweep anyway, a couple of other API improvements
have been carried out at the same time:

The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to
DISKFLAG_NEEDSGIANT

A version number have been added to disk_create() so that we can detect,
report and ignore binary drivers with old ABI in the future.

Manual page update to follow shortly.


119665 02-Sep-2003 scottl

Prepare for locking mlx(4) by cleaning up the use of busdma. No real
functional changes should result from this.


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.


118707 09-Aug-2003 scottl

Don't provide a mutex in the S/G list dma tag since it will never be defered.
Fix some nearby style.


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.


111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


111509 25-Feb-2003 jhb

Chase the musical variable names.

Pointy hat to: jhb
Reported by: des


111499 25-Feb-2003 jhb

Limit the maximum I/O size to 8 pages for version 2 controllers. This
fixes problems with some mlx(4) cards in Alpha machines.

Reviewed by: msmith (ages ago)


111497 25-Feb-2003 jhb

Fix a small fat-finger: s/mlxd/mxld/.

Reported by: Bob Willcox <bob@immure.com>


111469 25-Feb-2003 phk

NO_GEOM cleanup:

Move to "struct disk*" centric API.
Retire major #131 (mlxd)


111216 21-Feb-2003 phk

NO_GEOM cleanup:

Change the argument to disk_destroy() to be the same struct disk * as
disk_create() takes.

This enables drivers to ignore the (now) bogus dev_t which disk_create()
returns.


111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


103870 23-Sep-2002 alfred

use __packed.


103714 20-Sep-2002 phk

(This commit touches about 15 disk device drivers in a very consistent
and predictable way, and I apologize if I have gotten it wrong anywhere,
getting prior review on a patch like this is not feasible, considering
the number of people involved and hardware availability etc.)

If struct disklabel is the messenger: kill the messenger.

Inside struct disk we had a struct disklabel which disk drivers used to
communicate certain metrics to the disklayer above (GEOM or the disk
mini-layer). This commit changes this communication to use four
explicit fields instead.

Amongst the benefits is that the fields do not get overwritten by
wrong or bogus on-disk disklabels.

Once that is clear, <sys/disk.h> which is included in the drivers
no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in,
the few places that needs them, have gotten explicit #includes for
them.

The disklabel inside struct disk is now only for internal use in
the disk mini-layer, so instead of embedding it, we malloc it as
we need it.

This concludes (modulus any mistakes) the series of disklabel related
commits.

I belive it all amounts to a NOP for all the rest of you :-)

Sponsored by: DARPA & NAI Labs.


103675 20-Sep-2002 phk

Make FreeBSD "struct disklabel" agnostic, step 311 of 723:

Rename diskerr() to disk_err() for naming consistency.

Drop the by now entirely useless struct disklabel argument.

Add a flag argument for new-line termination.

Fix a couple of printf-format-casts to %j instead of %l.

Correctly print the name of all bio commands.

Move the function from subr_disklabel.c to subr_disk.c,
and from <sys/disklabel.h> to <sys/disk.h>.

Use the new disk_err() throughout, #include <sys/disk.h> as needed.

Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs.

Remove unused disklabel members of softc for aac, amr and mlx, which seem
to originally have been intended for diskerr() use, but which only rotted
and got Copy&Pasted at least two times to many.

Sponsored by: DARPA & NAI Labs.


92612 18-Mar-2002 bde

Fixed printf format errors in previous commit. %llu is no more suitable
than %u for printing signed 64-bit types. It fails on different machines,
and has the wrong signdness.

Fixed old printf format error on the same line. %u is not suitable for
printing 32-bit types on all machines.

"Fixed" format printf error in previous commit. This file is not
formatted in KNF. Partially restore bug for bug compatibility: indent
the printf args too much, but don't format them for 160-column terminals.


92608 18-Mar-2002 imp

Formats that print the block number need to be changed from %u to
%llu due to recent changes in bio_pblkno's type.


87599 10-Dec-2001 obrien

Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


83291 10-Sep-2001 kris

Fix some signed/unsigned integer confusion, and add bounds checking of
arguments to some functions.

Obtained from: NetBSD
Reviewed by: peter
MFC after: 2 weeks


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.


78234 15-Jun-2001 peter

Fix warning: 193: warning: label `done' defined but not used


76324 06-May-2001 phk

Make the disk mini-layer check for and handle zero-length transfers
instead of the underlying drivers.


76322 06-May-2001 phk

Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror().

Most of this patch is generated by scripts.


74810 26-Mar-2001 phk

Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.


73280 01-Mar-2001 markm

Turn on interrupt-entropy harvesting for all/any mass storage devices
I could find. I have no doubt missed a couple.

Interrupt entropy harvesting is still conditional on the
kern.random.sys.harvest_interrupt sysctl.


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


68877 18-Nov-2000 dwmalone

Further use of M_ZERO.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>
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.


67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


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.


60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


60833 23-May-2000 jake

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


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


59447 20-Apr-2000 msmith

One minor bugfix:

- Free resources in all the possible attachment failure cases.

One critical bugfix:

- Fix a race where it was possible to get out of synch with the log
messages from the controller, if the controller hung up for any
period of time (eg. while resetting a SCSI bus). This would result
in an endless string of console errors, bringing the machine to a
halt.


59391 19-Apr-2000 phk

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


59249 15-Apr-2000 phk

Complete the bio/buf divorce for all code below devfs::strategy

Exceptions:
Vinum untouched. This means that it cannot be compiled.
Greg Lehey is on the case.

CCD not converted yet, casts to struct buf (still safe)

atapi-cd casts to struct buf to examine B_PHYS


59136 11-Apr-2000 msmith

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.


58934 02-Apr-2000 phk

Move B_ERROR flag to b_ioflags and call it BIO_ERROR.

(Much of this done by script)

Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.

Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.

Add bio_queue field for struct bio aware disksort.

Address a lot of stylistic issues brought up by bde.


58345 20-Mar-2000 phk

Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
field in struct buf: b_iocmd. The b_iocmd is enforced to have
exactly one bit set.

B_WRITE was bogusly defined as zero giving rise to obvious coding
mistakes.

Also eliminate the redundant struct buf flag B_CALL, it can just
as efficiently be done by comparing b_iodone to NULL.

Should you get a panic or drop into the debugger, complaining about
"b_iocmd", don't continue. It is likely to write on your disk
where it should have been reading.

This change is a step in the direction towards a stackable BIO capability.

A lot of this patch were machine generated (Thanks to style(9) compliance!)

Vinum users: Greg has not had time to test this yet, be careful.


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.


55093 25-Dec-1999 msmith

Fix the firmware build number output (again).


55080 24-Dec-1999 msmith

Cosmetic fix; get the firmware build code and customisation tag the
right way around.

Submitted by: "Chris D. Faulhaber" <jedgar@fxp.org>


54979 22-Dec-1999 msmith

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.


54515 12-Dec-1999 peter

time_t is an int on the Alpha, not long.


54419 11-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.


54279 08-Dec-1999 ken

Revamp the devstat priority system. All disks now have the same priority.
The same goes for CD drivers and tape drivers. In systems with mixed IDE
and SCSI, devices in the same priority class will be sorted in attach
order.

Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of
drivers have been modified to use that priority.

This includes the necessary changes to all drivers, except the ATA drivers.
Soren will modify those separately.

This does not include and does not require any change in the devstat
version number, since no known userland applications use the priority
enumerations.

Reviewed by: msmith, sos, phk, jlemon, mjacob, bde


54073 03-Dec-1999 mdodd

Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered(). 'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t. Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything. I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by: peter, dfr


52785 02-Nov-1999 msmith

Correctly compute the block count. In reality, it seems that the
controller will never return the command if it's not exactly a multiple
of a block in size.

Cosmetic formatting for RAID level output.


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.


52439 22-Oct-1999 msmith

Use the physical block number, not the logical block number, for I/O
operations. The latter only works where the partion begins at the bottom
of the disk. Whoops.

Submitted by: Chris Csanady <cc@137.org>


52276 16-Oct-1999 msmith

Use a much larger buffer for message log retrieval until we are sure that
32 bytes is safe.

Handle successful completion of message log retrieval commands.

With these changes, the driver correctly handles the consequences of drive
death and replacement in a reliable array. Note that the massive backlog
of I/O during handling of such an event can kill the system if softupdates
is enabled.


52275 16-Oct-1999 msmith

Fix mlx_diagnose_command so that it actually works. I can't believe this
has been broken since implemented.


52273 16-Oct-1999 msmith

Save the drive device_t correctly so we can print it later.

The drive number is 5 bits, not 4, in the read/write command.


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.