Commit Graph

30 Commits

Author SHA1 Message Date
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
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
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
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
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
Poul-Henning Kamp
9626b608de 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
2000-05-05 09:59:14 +00:00
Mike Smith
59548657bc Disable the returning of "wedged" commands; this is wrong and needs to be
rethought.
2000-04-24 19:56:26 +00:00
Poul-Henning Kamp
8177437d85 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
2000-04-15 05:54:02 +00:00
Poul-Henning Kamp
c244d2de43 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.
2000-04-02 15:24:56 +00:00
Mike Smith
78601fc5f8 Update to latest working version.
- Add periodic status monitoring routine.  Currently just detects
   lost commands, further functionality pending data from AMI.
   Add some new commands states; WEDGED (never coming back) and
   LATE (for when a command that wasmarked as WEDGED comes bacj,

 - Remove a number of redundant efforts to poll the card for completed
   commands.  This is what interrupt handlers are for.

 - Limit the maximum number of outstanding I/O transactions.  It seems
   that some controllers report more than they can really handle,
   and exceding this limit can cause the controller to lock up.

 - Don't use 'wait' mode for anything where the controller might not
   be able to generate interrupts.  (Keep the 'wait' mode though sa it
   will become useful when we start taking userspace commands.

 - Use a similar atomic locking trategy to the Mylex driver to prevent
   some reentrancy problems.

 - Correctly calculate the block count for non-whoile-bloch transfers
   (actually illegal).

 - Use the dsik device's si_drv1 field instead of b_driver1 in the
   buf struct to pass the driver identifier arond.

 - Rewrite amr_start and amr_done() along the lines of the Mylex driver
   in order to improve robustnes.

 - Always force the PCI busmaster bit on.
2000-04-01 00:35:15 +00:00
Mike Smith
9992d96f25 Fix detection of the card-ready-for-command state. Use an ultimate
timeout closer to the 1-second value that AMI use in their Linux
driver, and mark the mailbox structures as volatile so that gcc
doesn't over-optimise access to them.

This should fix the "controller wedged" bug.

Submitted by:	Brian Dean <brdean@unx.sas.com>
2000-03-23 18:33:19 +00:00
Poul-Henning Kamp
21144e3bf1 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.
2000-03-20 10:44:49 +00:00
Mike Smith
a3c8168096 Increase the time we spend waiting for the controller to become ready to
accept a new command; in high load cases it may be too busy for the old
value.

This loop needs something to tie it to real time, rather than just the CPU's
ability to fetch from the L1 data cache, but this hack works for now.

Approved by:	jkh
2000-02-17 23:33:57 +00:00
Peter Wemm
87280b0a70 Fix a printf format problem on the Alpha, where size_t == unsigned long,
not unsigned int as on the x86.
1999-12-12 20:53:31 +00:00
Matthew N. Dodd
fe0d408987 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
1999-12-03 08:41:24 +00:00
Mike Smith
83f2409369 Don't print the chipset value; it's not useful.
Now we know what some of the state values are, print the current array
state.
1999-11-02 03:24:09 +00:00
Mike Smith
ba2ace5164 Change the queueing model used by the controller to drastically reduce
the time spent at splbio().  We now avoid it unless we are actually
manipulating the command queues themselves.  This doesn't improve
performance noticeably, but should improve concurrency somewhat.
1999-10-26 23:18:57 +00:00
Mike Smith
cd4ace0c76 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>
1999-10-22 20:55:15 +00:00
Mike Smith
d5a51e03e7 This is a driver for the AMI MegaRAID family of controllers. It all of
the AMI PCI controllers using the 8LD firmware interface (40LD firmware
will be supported as soon as I have hardware to test with).

These controllers are rebadged by Dell as the PERC, as well as by HP
and possibly other vendors.
1999-10-07 02:23:12 +00:00