Commit Graph

169 Commits

Author SHA1 Message Date
Doug Ambrisko
bc971e44ed Reduce the Linux ioctl range to what is needed. I didn't know what
I was doing when I first set the range up.
2006-04-14 16:13:28 +00:00
Scott Long
dce223cfb6 After further review and discussion, partially revert the previous commit.
The real problem was that ioctl handlers needed to call amr_wait_command()
with the list lock held.  This not only solves the completion race, it also
prevents bounce buffer corruption that could arise from amr_start() being
called without the proper locks held.

Discussed with: ps
MFC After: 3 days
2006-04-08 05:08:17 +00:00
Paul Saab
026d2aa333 Close a pesky race where after checking the BUSY flag in amr_wait_command,
the completion of the command can occur before tsleep is called and
the command ends up blocking forever since the wakeup has already
been called.

Submitted by:   ups
2006-04-08 02:23:27 +00:00
John Baldwin
44a4a80962 Check the return value of copyin() and return an error if it fails.
Coverity ID:	839
Found by:	Coverity Prevent
MFC after:	1 week
Reviewed by:	ps, scottl
2006-02-23 18:05:38 +00:00
Warner Losh
2805b31bdf Use void * for pointer rather than u_int8_t *, since it doesn't
matter.  Well it does for type punning warnings.
2006-02-04 22:14:20 +00:00
Paul Saab
0e74562fbc Enable 64bit SGL's on PERC 4/DC 2006-02-02 17:51:47 +00:00
Paul Saab
447c943f68 - Move the command setup from amr_start1 into the card specific submit
routines.
- Add or replace cpu_spinwait() with DELAY(1) to a few of the busy
  loops when reading from the controller to work around firmware bugs
  which can crash the controller.
2006-02-02 17:50:59 +00:00
Doug Ambrisko
4302d37921 When the RAID firmware returns a failure, don't hard error the result.
This is important with MegaLib, when issuing a GET_REBUILD_PROG since
it returns an error if the drive is not in rebuild state.

This will be MFC'ed shortly.

Submitted by:	ps
Reviewed by:	scottl
Found by:	ambrisko
2006-01-26 22:39:12 +00:00
Doug Ambrisko
084500bc13 Add in the Linux IOCTL shim and create the megadev0 device so
Linux LSI MegaRaid tools can run on FreeBSD until Linux emulation.

Add in the Linux IOCTL shim and create the megadev0 device so
Linux LSI MegaRaid tools can run on FreeBSD until Linux emulation.

Add glue to build the modules but don't tie it into the build
yet until I test it from the CVS repo. via the mirror on an
amd64 machine.

Tie this into the Linux32 emulation on amd64 so the tools can
run on amd64 kernel.

Cleaned up by:	ps (amr_linux.c)
2006-01-24 21:13:50 +00:00
Scott Long
a4d3c74487 Check the return value of copyin.
Found by: Coverity Prevent (tm)
2006-01-14 17:59:28 +00:00
Jung-uk Kim
9857ff20da - Correct amr_enquiry3 structure[1].
- Remove redundant AMR_CONFIG_ENQ3_SOLICITED_NOTIFY from the previous
commit while I am here.

PR:		kern/29727 [1]
2006-01-13 23:50:21 +00:00
Scott Long
174cda8010 Don't free the ap object if it was never created.
Submitted by: jkim
2006-01-10 01:55:17 +00:00
Scott Long
5351742ea2 Mega update to the LSI MegaRAID driver:
1.  Implement a large set of ioctl shims so that the Linux management apps
from LSI will work.  This includes infrastructure to support adding, deleting
and rescanning arrays at runtime.  This is based on work from Doug Ambrosko,
heavily augmented by LSI and Yahoo.

2.  Implement full 64-bit DMA support.  Systems with more than 4GB of RAM
can now operate without the cost of bounce buffers.  Cards that cannot do
64-bit DMA will automatically revert to using bounce buffers.  This option
can be forced off by setting the 'hw.amr.force_sg32" tunable in the loader.
It should only be turned off for debugging purposes.  This work was sponsored
by Yahoo.

3.  Streamline the command delivery and interrupt handler paths after
much discussion with Dell and LSI.  The logic now closely matches the
intended design, making it both more robust and much faster.  Certain
i/o failures under heavy load should be fixed with this.

4.  Optimize the locking.  In the interrupt handler, the card can be checked
for completed commands without any locks held, due to the handler being
implicitely serialized and there being no need to look at any shared data.
Only grab the lock to return the command structure to the free pool.  A
small optimization can still be made to collect all of the completions
together and then free them together under a single lock.

Items 3 and 4 significantly increase the performance of the driver.  On an
LSI 320-2X card, transactions per second went from 13,000 to 31,000 in my
testing with these changes.  However, these changes are still fairly
experimental and shouldn't be merged to 6.x until there is more testing.

Thanks to Doug Ambrosko, LSI, Dell, and Yahoo for contributing towards
this.
2005-12-14 03:26:49 +00:00
Scott Long
da7851e1e6 The CAM interface is broken and seems to be causing lockups on boot. It
doesn't appear to have worked in a long time, so just disable it completely
for now.

MFC After: 3 days
2005-11-26 07:30:09 +00:00
Scott Long
fceb189d65 Remove spl markers from AMR.
MFC After:	3 days
2005-11-06 15:13:42 +00:00
Scott Long
9cf8dd43cf Complete the removal of __FreeBSD_version checks from the amr driver. The
driver had advanced enough over the years that direct sharing of code with
FreeBSD 4.x was in no way possible anymore.
2005-08-08 12:16:21 +00:00
Scott Long
b60359e981 Remove a stale __FreeBSD_version check. 2005-08-07 23:53:00 +00:00
Scott Long
4b910da2ea The presence of a on __FreeBSD_version flagged some code that hasn't been in
the right spot since the FreeBSD 3.x days, if not earlier.
2005-08-07 23:51:53 +00:00
Paul Saab
6c9f6695fd Print the actual disk device we failed to complete i/o on. 2005-07-29 01:53:45 +00:00
Paul Saab
8c61487b21 Don't allow ioctl commands to be interrupted by the user. 2005-07-29 01:47:36 +00:00
Paul Saab
ee515ed0d9 polled commands can read or write, so bus_dmamap_sync properly
according to the type of request.

Approved by:	re
2005-06-23 00:21:25 +00:00
Yoshihiro Takahashi
d4fcf3cba5 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)
2005-05-29 04:42:30 +00:00
Sam Leffler
fd1700dc03 handle potential null ptr
Noticed by:	Coverity Prevent analysis tool
2005-03-31 04:58:10 +00:00
Scott Long
e8447f7027 Fix a null pointer de-ref when passthrough ioctls are issued. This
involves some code shuffle to avoid locking problems.

MFC After: 3 days
2005-03-13 06:25:53 +00:00
Warner Losh
494f3ca182 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:24:22 +00:00
Scott Long
55a0283961 Fix the ioctl path by ensuring that amr_start1() gets called for commands
with no associated data.  Also revert previous changes that allocate off
of the stack instead of using malloc, as it's not needed.  Many thanks to
LSI for investigating and fixing these problems.

Submitted by: rajeshpr @ lsil . com
2005-03-04 06:11:00 +00:00
Scott Long
7e22e3674b Remove some unused variables. 2005-02-09 17:19:12 +00:00
Scott Long
29c711f038 Remove the messy locking dance around xpt_done() 2005-02-09 11:50:16 +00:00
Scott Long
35e050281e Add support for the LSI 320-2E PCI-Express controller. Fix a couple of bugs
in the ioctl handler.  Update the LSI copyrights for these.

Obtained from: LSI, Corp
2005-01-23 23:25:41 +00:00
Scott Long
a56d2b5a51 Add my copyright for the locking and busdma work. 2005-01-23 23:22:34 +00:00
Scott Long
5b4a781b96 Lock the AMR driver:
- Introduce the amr_io_lock to control access to command queues, bio queues,
  and the hardware.
- Eliminate the taskqueue and do all completion processing in the ithread.
- Assign a static slot number to each command instead of doing a linear
  search for free slots each time a command is needed.
- Modify the interrupt handler to more closely match what Linux does, for
  safety.
2005-01-16 07:34:26 +00:00
Doug White
f7f3c3e1a6 Free the shared devq last since CAM expects it to be there if
xpt_alloc_device() gets called, which can happen during detach in
certain situations. Fixes module unload.

MFC after:	3 days
2005-01-10 02:34:26 +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
Scott Long
dc0ff2140b Fix a number of bugs and significantly alter the command execution path to
properly support bounce buffers and resource shortages.  This allows the
driver to work properly and reliably with more than 4GB of RAM.  Of the
three data paths that exist in the driver, (block, CAM, ioctl), the ioctl
path has not been well tested with these changes due to difficulty with
finding an application that uses it that actually works.

Sponsored by: The FreeBSD Foundation and FreeBSD Systems, Inc.
2004-12-05 23:48:17 +00:00
Scott Long
0dde762cb8 Set up the data flow flag correctly so that bounced buffers have a chance of
working in amr_enquire().
2004-09-14 16:36:12 +00:00
Doug Ambrisko
05f1103b26 Allow i386 binaries to do amr ioctls such as LSI's megamgr on amd64 and
ia64.

PR:	63155
Submitted by:	Mikhail Teterin
Tested on:	i386, amd64 (via 64bit Xeon system)
2004-08-16 17:23:09 +00:00
Doug Ambrisko
386aa69b89 Add new PCI device ID for PERC4/DI. 2004-08-14 02:48:13 +00:00
Paul Saab
2673a44621 Use a separate flag when doing a kernel coredump when polling for
completion instead of abusing the interrupt enable flag.
2004-07-01 06:56:10 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Colin Percival
9a6caa1afc Check that amrd_sc is non-NULL before dereferencing it, not after.
Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor)
2004-02-22 10:00:05 +00:00
Poul-Henning Kamp
dc08ffec87 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.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
0b7ed341e1 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.
2004-02-18 21:36:53 +00:00
Scott Long
777a986004 Allow amr(4) to get a dynamic major number instead of a static one.
Submitted by:	Andre Guibert de Bruet
2004-02-08 16:07:22 +00:00
Paul Saab
6728a38bf2 crashdump support.
Some bits by:	Rajesh Prabhakaran <rajeshpr@lsil.com>
2003-10-10 22:49:40 +00:00
John Baldwin
e27951b29c Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by:	imp, gibbs
Tested by:		i386 LINT
2003-09-02 17:30:40 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
4fbd232c86 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.
2003-08-22 05:54:52 +00:00
Scott Long
f6b1c44d1f 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
2003-07-01 15:52:06 +00:00
Nate Lawson
2813692cc2 Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry.  Changes all drives
  >1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

Looked over by:	scottl
2003-06-14 22:17:41 +00:00
Poul-Henning Kamp
891619a66d 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.
2003-04-01 15:06:26 +00:00
Poul-Henning Kamp
60794e0478 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.
2003-03-08 08:01:31 +00:00
Poul-Henning Kamp
7ac40f5f59 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)
2003-03-03 12:15:54 +00:00
Scott Long
7874f606d5 Introduce a new taskqueue that runs completely free of Giant, and in
turns runs its tasks free of Giant too.  It is intended that as drivers
become locked down, they will move out of the old, Giant-bound taskqueue
and into this new one.  The old taskqueue has been renamed to
taskqueue_swi_giant, and the new one keeps the name taskqueue_swi.
2003-02-26 03:15:42 +00:00
Poul-Henning Kamp
7d6ddd1027 NO_GEOM cleanup:
Move to new "struct disk *" centered API".

OK'ed by:	emoore
2003-02-24 21:49:27 +00:00
Poul-Henning Kamp
89f8bb39da Use nullclose(), not noclose(). 2003-02-22 10:40:36 +00:00
Poul-Henning Kamp
3eb309c55e Use the standard DISKFLAG_OPEN instead of implementing our own.
Use noclose() instead now that our close method is empty.
2003-02-22 10:10:12 +00:00
Poul-Henning Kamp
3512c1b386 Use system noioctl() instead of homerolled. 2003-02-22 10:02:05 +00:00
Poul-Henning Kamp
b82ff75854 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.
2003-02-21 15:13:26 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Eric Moore
d163d5b8c8 Fix for DELL PERC firmware. Driver was hanging
during load time; this attributed to the mailbox
busy byte not being set prior to issuing a
polling command.

Approved by: ps
MFC: 7 days
2003-01-09 21:02:28 +00:00
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
Eric Moore
c664b80dbc Problem: Hang while bootup on Perc2/SC.
Fix: Error handling wasn't implemented
in newly implemented polling code for quartz
controllers.

Approved by: re@
2002-12-13 17:27:44 +00:00
Eric Moore
d6b32def6c (1) Problem: PANIC when loading/unloading driver
as module. This also fix's issue kern/45713.
Fix - polling was implemented incorrectly for
adapter enquiry and adapter flush.
(2) Problem: PANIC when unloading driver
as module.
Fix - device nodes are not destroyed for amr0,
and amrd* when driver is unloaded
(3) Problem: PANIC from loading driver when
3ware adapter present, error message "Warning
"amrd is usurping twed's bmaj"
Fix - put #idef freebsd version < 500000 for
bmaj -1 -> amrd_cdevsw
(4) Problem: warnings in driver when compiling
with DAMR_DEBUG param enabled in Makefile
Fix - fix the warnings so driver can compile
when -Werror is present in Makefile.

Approved by: jhb
MFC: 7 days
2002-12-11 20:59:46 +00:00
Eric Moore
ca4722f57e Added support for DELL Perc4/DI.
Reviewed by: ps
Approved by: jhb
MFC after: 5 days
2002-11-21 16:06:10 +00:00
Eric Moore
f462788495 Incorrect typecast. 2002-10-31 14:10:00 +00:00
Eric Moore
e8b5e74b61 amr.c,
amr_cam.c,
amrreg.h,
amrvar.h:
- added support for 12/16 byte cdb's, effecting CAM branch only ( non-disk support )

amrreg.h:
- increased number of scatter gather elements from 16 to 26.

amr_pci.c:
- amr_pci_free(), incorrect bus tag meant for 'amr_mailbox_dmat' was being freed

all:
- copyright change requested by scottl

Reviewed by:	ps,scottl
MFC after:	1 week
2002-10-30 22:00:11 +00:00
Eric Moore
1a6b414672 (1) added LSI Logic copyright, and legal line 3 in license, and string
changes for "LSILogic"
(2) enabled non-disk support through CAM interface
(3) HA_INQ (a) enabled tagged queuing (b) disable reset during
	driver loading (b) renamed BSDi string to LSI
(4) disabled detecting disk devices during SCSI INQUIRY
(5) changed dcdb single element sglist to send one entire buffer chunk
(6) nsgelem not set in sglist
(7) ap_data_transfer_length not set for dcdb
(8) changed "struct thread" to "d_thread_t" for compatibliity { xxx_open,
	xxx_close, xxx_ioctl }
(9) miscellaneous compatiblity fixes
(10) bug fix for 0x0409/0x1000 card
(11) added compiling amr_cam.c in sys/conf/files
(12) added compiling amr_cam.c in sys/modules/amr/Makefile

Reviewed by:ps
MFC after:1 week
1 week
2002-10-18 21:29:14 +00:00
Poul-Henning Kamp
37c841831f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
Poul-Henning Kamp
7812d86f03 (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.
2002-09-20 19:36:05 +00:00
Poul-Henning Kamp
f90c382c0c 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.
2002-09-20 12:52:03 +00:00
Justin T. Gibbs
e211c13e86 Add IDs for upcoming LSI U320 products that use the MegaRAID interface.
Adjust format of one comment so it doesn't wrap at 80 columns.
Submitted by:	"Moore, Eric Dean" <emoore@lsil.com>
2002-08-30 18:28:00 +00:00
Bruce Evans
1b7fb13116 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.
2002-03-18 23:24:00 +00:00
Warner Losh
8321855307 Formats that print the block number need to be changed from %u to
%llu due to recent changes in bio_pblkno's type.
2002-03-18 20:50:04 +00:00
Mike Smith
21550f28f8 Staticise the amr devclass. 2002-01-08 06:47:02 +00:00
John Baldwin
19f0fedd94 Comment tokens after #undef <macroname> and #endif.
Reported by:	gcc30
2001-12-13 11:12:30 +00:00
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
John Baldwin
282873e2c0 - Change the taskqueue locking to protect the necessary parts of a task
while it is on a queue with the queue lock and remove the per-task locks.
- Remove TASK_DESTROY now that it is no longer needed.
- Go back to inlining TASK_INIT now that it is short again.

Inspired by:	dfr
2001-10-26 18:46:48 +00:00
John Baldwin
1de1c550b1 Add locking to taskqueues. There is one mutex per task, one mutex per
queue, and a mutex to protect the global list of taskqueues.  The only
visible change is that a TASK_DESTROY() macro has been added to mirror
the TASK_INIT() macro to destroy a task before it is free'd.

Submitted by:	Andrew Reiter <awr@watson.org>
2001-10-26 06:32:21 +00:00
Julian Elischer
b40ce4165d 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
2001-09-12 08:38:13 +00:00
Peter Wemm
3a88b43443 Fix warning: 179: warning: label `done' defined but not used 2001-06-15 00:09:28 +00:00
Poul-Henning Kamp
079f2df393 Make the disk mini-layer check for and handle zero-length transfers
instead of the underlying drivers.
2001-05-06 21:55:22 +00:00
Poul-Henning Kamp
a468031ce8 Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror().

Most of this patch is generated by scripts.
2001-05-06 20:00:03 +00:00
Hellmuth Michaelis
b40cbf61a7 In case the driver runs on an HP NetRaid controller, attempt to properly
decode the BIOS and firmware version and announce the board as HP NetRaid.

This has been tested with a NetRaid 3si controller, the BIOS/firmware
printout should also work for other NetRaid controllers but the type
detection for other NetRaids (such as the 1si) will not work due to the
lack of hardware.

Reviewed by:	msmith
2001-03-28 14:11:15 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Mark Murray
ed34d0ade2 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.
2001-03-01 17:09:09 +00:00
Mike Smith
29e79e51ee Probe generic i960 devices for the old AMI signature as well as the current
one, in order to support adapters with older firmware.

Submitted by:	"Prasanth S." <prasanths@ami.co.in>
2000-12-22 22:23:56 +00:00
Mike Smith
ee435af1ae Remove some over- 2000-11-28 20:51:04 +00:00
Mike Smith
b60f56f73b MFS:
Fix amr_map_command so that 40LD-specific commands get the scatter-gather
   list count in the right place.  I don't understand why AMI did it like
   this, but now the AMI MegaManager can talk to the newer (1600 and later)
   controllers.

   Remove an unused variable.

   Include <machine/clock.h> when necessary.

   Tweak some debugging levels to make things more intelligible.
2000-11-28 19:28:22 +00:00
Mike Smith
6e64832134 Don't test the return value from the actual command when determining
success/failure for submission of the command.  The caller will want
to deal with this itself.
2000-11-21 06:58:24 +00:00
David Malone
ca89ee278e Further use of M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Approved by:	msmith
2000-11-18 15:21:22 +00:00
Mike Smith
e10f2ee576 Return -10 from the PCI probe to allow room for an updated driver to
override one built into the kernel.
2000-10-28 10:46:30 +00:00
Mike Smith
6dc6d3bb7c Fix typo in the 4.x case. 2000-10-27 23:40:45 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Mike Smith
4bf9a87a4c Whoops. The AMR_QUARTZ_GOFASTER option is meant to disable, not enable
this check.  It looks like it doesn't work on at least the 466 controllers.
2000-09-11 23:19:13 +00:00
Mike Smith
9f1776230d Major update to the AMI MegaRAID driver.
- New support for 40LD firmware found in Series 475 and 471 adapters.
 - Better support for 8LD firmware adapters
 - Ioctl passthrough interface for userland utilities.
 - Improved error handling and queueing.
 - Several bugfixes (including the 'still open' shutdown bug and
   closing some small race conditions).
 - Zone-style command allocator, reducing memory wasted under heavy
   load conditions.
 - CAM interface (disabled and not fully working) for SCSI passthrough
   access to non-disk devices

Thanks to AMI for supplying a pile of new adapters and various other
help in making this happen.
2000-08-30 07:52:50 +00:00
Mike Smith
ff69e08ad6 The AMI MegaRAID's internal memory map conflicts with scatter/gather
map physical addresses below 0x2000 (accoding to AMI).  If we
allocate our s/g tables and get an address below this point, leak the
memory and try again.

This should fix booting from these controllers.
2000-06-10 19:22:39 +00:00