History log of /freebsd-10.0-release/sys/dev/aac/aac_disk.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


# 251116 29-May-2013 marius

Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the
same support for aacp(4), I'm lacking the necessary hardware for
testing, though.


# 251115 29-May-2013 marius

- Remove pointless returns.
- Make cm_data a void pointer and cm_flags unsigned as appropriate.

MFC after: 3 days


# 247570 01-Mar-2013 marius

- Make tables, device ID strings etc const. This includes #ifdef'ing 0
aac_command_status_table, which is actually unused since r111532.
While at it, make aac_if a pointer to the now const interface tables
instead of copying them over to the softc (this alone already reduces the
size of aac.ko on amd64 by ~1 KiB).
- Remove redundant softc members.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Remove redundant bzero(9)'ing of the softc.
- Use pci_enable_busmaster(9) instead of duplicating it.
- Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will
just fail).
- Canonicalize the error messages in case of resource allocation failures.
- Add support for using MSI instead of INTx, controllable via the tunable
hw.aac.enable_msi (defaulting to on).

MFC after: 1 month


# 238601 18-Jul-2012 sbruno

On BIO_ERROR, set bio_resid to stop losing data in the error case.

Submitted by: Mark Johnston <markjdb@gmail.com>
Reviewed by: scottl@freebsd.org
MFC after: 2 weeks


# 238201 07-Jul-2012 eadler

Remove variables which are initialized but never used thereafter
reported by gcc46 warning

Approved by: cperciva
MFC after: 1 week


# 212773 16-Sep-2010 emaste

Use device_printf where possible, and otherwise at least include the
driver name in printf strings.

Reported by: Mark Johnston


# 206534 12-Apr-2010 emaste

Whitespace cleanup, in advance of next sync with Adaptec's driver. No
functional change.


# 195614 11-Jul-2009 jkim

Get correct maxio from the controller and drop the tunable.
The default (64K) is too pessimistic for "new comm" hardware.
Also, this is bad because multiple controllers get limited by
the global tunable.

Reviewed by: scottl
Approved by: re (kensmith)


# 177899 03-Apr-2008 emaste

Allow crashdumps on machines with >4GB of RAM as long as the adapter can
do 64-bit S/G.

Submitted by: Alex Bencz
Reviewed by: scottl


# 177619 25-Mar-2008 emaste

Add 64-bit array support for RAIDs > 2TB. This corresponds to ~ Adaptec
driver build 15317.

Tested on:
Adaptec 2230S, Firmware 4.2-0 (8205)
ICP ICP5085BL, Firmware 5.2-0 (12814)

Submitted by: Adaptec


# 177567 24-Mar-2008 emaste

Diff reduction to Adaptec's driver (around build 15317): catch up with a
change in debugging routines.

The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the
Adaptec driver.


# 145811 02-May-2005 scottl

Fix some busdma API violations in the dumpsys handler.

MFC After: 3 days


# 138635 09-Dec-2004 scottl

Complete the repo-copy of aac_ioctl.h from sys/dev/aac/to sys/sys.


# 133540 12-Aug-2004 scottl

Remove the AAC_LOCK macros. They no longer abstract anything and only
obfuscate the code. No functional differences.


# 132771 28-Jul-2004 kan

Avoid casts as lvalues.


# 130006 02-Jun-2004 scottl

Collapse sync fib locking into normal i/o locking. The former didn't
protect the registers so it was trivially possible for a sync command and
i/o command to fight each other and confuse the controller. Make the
sync fib alloc/release functions inline and remove the somewhat worthless
AAC_SYNC_LOCK_FORCE flag. Thanks to Adil Katchi for helping me to track
this down in RELENG_4.


# 129879 30-May-2004 phk

Add missing <sys/module.h> includes


# 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.


# 121307 21-Oct-2003 silby

Change all SYSCTLS which are readonly and have a related TUNABLE
from CTLFLAG_RD to CTLFLAG_RDTUN so that sysctl(8) can provide
more useful error messages.


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 119171 20-Aug-2003 mux

Fix build by correcting a wrong cast.


# 119146 19-Aug-2003 scottl

Make aac(4) compile cleanly on 64-bit machines. The code was already 64-bit
safe, but some (unneeded and/or harmless) downcasts were generating warnings.
The driver still is not endian-clean.


# 116553 18-Jun-2003 scottl

Fixing some glaring problems with aac_disk_dump().
- Mark that it cannot handle greater than 4GB of RAM at this time. Fixing
that will come later. Fail any attempts to dump above thati limit.
- If a call to aac_disk_dump() needs to be split into multiple i/o's,
increment the virtual offset after each i/o instead of just dumping the
same offset over and over again.
- Bail out if bus_dmamap_load() returns an error. Error recovery is likely
not possible.


# 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.


# 111691 01-Mar-2003 scottl

The aac driver has evolved enough over the last few months that it no
longer resembles the 4.x version very much. Garbage collect the legacy
bits.


# 111532 26-Feb-2003 scottl

Bring aac out from under Giant:
- the mutex aac_io_lock protects the main codepaths which handle queues and
hardware registers. Only one acquire/release is done in the top-half and
the taskqueue. This mutex also applies to the userland command path and
CAM data path.
- Move the taskqueue to the new Giant-free version.
- Register the disk device with DISKFLAG_NOGIANT so the top-half processing
runs without Giant.
- Move the dynamic command allocator to the worker thread to avoid locking
issues with bus_dmamem_alloc().

This gives about 20% improvement in most of my benchmarks.


# 111525 26-Feb-2003 scottl

Move to 'struct disk*' API

Submitted by: phk


# 111220 21-Feb-2003 phk

NO_GEOM cleanup:

Retire the "d_dump_t" and use the "dumper_t" type instead.

Dumper_t takes a void * as first arg which is more general than the
dev_t taken by d_dump_t. (Remember: we could have net-dumpers if
somebody wrote us one!)

Define the convention for GEOM controlled disk devices to be that the
first argument to the dumper function is the struct disk pointer.

Change device drivers accordingly.


# 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.


# 109088 10-Jan-2003 scottl

Major bugfixes for large memory and fast systems.

aac.c:
Re-arrange the interrupt handler to optimize the common case of
the adapter interrupting us because one or more commands are complete,
and do a read across the pci bus to ensure that all posted status
writes are flushed. This should close a race that could cause command
completion interrupts to be lost.
Follow the spec a bit closer when filling out command structures.
Enable the Fast Response feature to eliminate the need for the card
to DMA successfull command completions back into host memory.
Tell the controller how much physical memory we have. Without this
there was a chance that our DMA regions would collide with the
memory window used by the cache on the controller. The result would
be massive data corruption. This seemed to mainly affect systems with
>2GB of memory.
Fix a few whitespace problems.

aac_debug.c:
Add an extra diagnostic when printing out commands.

aac_disk.c:
Add extra sanity checks.

aacreg.h:
Prepare for making this 64-bit clean by reducing the use of enumeration
types in structures.

Many thanks to Justin Gibbs for helping track these down.


# 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.


# 95536 26-Apr-2002 scottl

Add a CAM interface to the aac driver. This is useful in case you should
ever connect a SCSI Cdrom/Tape/Jukebox/Scanner/Printer/kitty-litter-scooper
to your high-end RAID controller. The interface to the arrays is still
via the block interface; this merely provides a way to circumvent the
RAID functionality and access the SCSI buses directly. Note that for
somewhat obvious reasons, hard drives are not exposed to the da driver
through this interface, though you can still talk to them via the pass
driver. Be the first on your block to low-level format unsuspecting
drives that are part of an array!

To enable this, add the 'aacp' device to your kernel config.

MFC after: 3 days


# 95350 24-Apr-2002 scottl

Prepare for a major update to the aac driver:
Update the aac driver with the new crashdump api.
Protect sync fibs with a mutex.
Align all DMA buffers on a PAGE_SIZE boundary.

MFC after: 3 days


# 93495 31-Mar-2002 phk

The AAC, TWE and IDA diskdrivers cannot dump until I and msmith
have ripped all the i386 specific formatting code from their
dump routines. Due to the potential for trashing disks, I did
not want to do this "blind".


# 89112 09-Jan-2002 msmith

Staticise the aac devclass.


# 87310 03-Dec-2001 scottl

Use d_thread_t to reduce diffs between current and stable.
Spell ACQUIRE correctly.


# 87183 02-Dec-2001 scottl

Add functionality and fix bugs so the driver will work with soon-to-be
released management apps.

1. Implement poll(). This will check for queued aif's so that a
subsequent ioctl call to retrieve the next aif will not block.
2. Don't catch signals when sleeping on a fib sent from userland. This
causes a race and panic due to the pthread context switcher waking
up the tsleep at inopportune times.
3. Fix some whitespace nits.

MFC after: 3 days


# 86313 12-Nov-2001 ps

Fix a signed bug in the crashdump code for systems with > 2GB of ram.

Reviewed by: peter


# 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


# 83114 05-Sep-2001 scottl

Bring the aac driver *much* closer to style(9).

Reviewed by: ken


# 82830 02-Sep-2001 scottl

Work around a bug where the driver's copy of the disklabel gets corrupted
and causes diskerr() to panic.


# 82527 29-Aug-2001 scottl

Mega update to the aac driver.
1. Correctly handle commands initiated by the adapter. These commands
are defered to a kthread responsible for their processing, then are
properly returned to the controller.
2. Add/remove disk devices when notified by the card that a container was
created/deleted/offline.
3. Implement crashdump functionality.
4. Support all ioctls needed for the management CLI to work. The linux
version of this app can be found at the Dell or HP website. A native
version will be forthcoming.

MFC-after: 4.4-RELEASE


# 81154 05-Aug-2001 scottl

Once again throw out the calculation of si_iosize_max and set it to 64K.
Although it can go higher, it is not safe to so do on arrays with many
members. Compromise by adding a tunable, "hw.aac.iosize_max" that can be
set at boottime. Also document in the aac(4) manpage.

MFC after: 4 weeks


# 81151 05-Aug-2001 scottl

Bugfixes. Close a race and logic bug in the timeout handling, don't call the
interrupt handler from the upper half, etc. This fixes some serious stability
problems that we were seeing on our production server. These patches have
been tested for almost 6 months and are a highly recommended MFC candidate.

Reviewed by: gibbs, merry, msmith
MFC after: 4 days


# 81082 02-Aug-2001 scottl

Reformat for 80 columns. Sorry, but I had to do it.


# 76324 06-May-2001 phk

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


# 74810 26-Mar-2001 phk

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


# 74604 21-Mar-2001 scottl

Back out rev 1.4. The advertised 64K limit on transfers only applies when
using 64bit S/G entries. With this reverted, we are seeing >92MB/sec reads
and >42MB/sec writes on a RAID-5 container.


# 74365 16-Mar-2001 msmith

Fix a typo which would cause containers between 1GB and 2GB to have the wrong
geometry reported.

Submitted by: mark tinguely <tinguely@web.cs.ndsu.NoDak.edu>


# 73948 07-Mar-2001 scottl

Set si_iosize_max to 64K, even though the adapter seems to be able to do more.
This puts us safely in line with Adaptec documentation and shouldn't really
affect anything.

MFC candidate for 4.3


# 70393 27-Dec-2000 msmith

Major bugfix and minor update. This should resolve the current issues
with the driver locking up under load.

- Restructure so that we use a static pool of commands/FIBs, rather than
allocating them in clusters. The cluster allocation just made things
more complicated, and allowed us to waste more memory in peak load
situations.
- Make queueing macros more like my other drivers. This adds queue stats
for free. Add some debugging to take advantage of this.
- Reimplement the periodic timeout scan. Kick the interrupt handler
and the start routine every scan as well, just to be safe. Track busy
commands properly.
- Bring resource cleanup into line with resource allocation. We should
now clean up correctly after a failed probe/unload/etc.
- Try to start new commands when old ones are completed. We weren't doing
this before, which could lead to deadlock when the controller was full.
- Don't try to build a new command if we have found a deferred command.
This could cause us to lose the deferred command.
- Use diskerr() to report I/O errors.
- Don't bail if the AdapterInfo structure is the wrong size. Some variation
seems to be normal. We need to improve our handing of 2.x firmware sets.
- Improve some comments in an attempt to try to make things clearer.
- Restructure to avoid some warnings.


# 67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


# 65793 13-Sep-2000 msmith

A new driver for PCI:SCSI RAID controllers based on the Adaptec FSA
design. This includes integrated Dell RAID controllers, the Dell
PERC 2/QC and the HP NetRAID-4M.