Commit Graph

4451 Commits

Author SHA1 Message Date
Mark Murray fb15ada363 Provide more splsofttq() protection for the reseed task (running out of
taskqueue_swi).
2000-07-10 06:40:23 +00:00
Mark Murray 43975bd56c Make sure that tasks (running out of taskqueue_swi at splsofttq)
are not interfered with by the harvester.
2000-07-09 16:00:31 +00:00
Mark Murray 11197ed12c Small style change; make function names less likely to clash with
existing names. "null" is too common a string; use "null_".
2000-07-09 12:29:24 +00:00
Mark Murray a909184e9d Add entropy-harvesting calls.
/dev/random now has new-and-improved entropy!
2000-07-09 12:26:38 +00:00
Mark Murray 585ebe2b41 Yarrow tweaks; separate the fast and slow reseed tasks so that they don't
stomp on each other; provide constant names (as enums) for the harvester
to use (makes it more self-documenting).
2000-07-09 11:52:12 +00:00
Mark Murray 769afb047c Fix bug with a vraiable that needs to be per-process, not static;
fix formatting of long macros.

Pointed out by:	bde
2000-07-09 11:49:07 +00:00
Andrew Gallatin 19a6b3fea6 use contigfree() rather than free() to free memory allocated with
contigmalloc().

reviewed by: wpaul
2000-07-08 00:14:12 +00:00
Duncan Barclay 766748ceac Move newbus detection code to alloc routines.
Work around pccard nasties.
2000-07-07 19:13:11 +00:00
Mark Murray c9ec235ca1 Add entropy gathering code. This will work whether the module is
compiled in or loaded.
2000-07-07 09:03:59 +00:00
Nick Hibma 1d3e7ea3dd Properly fix world.
Sorry for breaking things in the first place.
2000-07-06 13:23:35 +00:00
Ollivier Robert ee76ce7fa5 Fix buildworld. 2000-07-06 08:37:34 +00:00
Bill Paul 1be1972c4b Close PR# 19617: add support for VIA VT6102 NICs to VIA Rhine driver. 2000-07-05 21:37:21 +00:00
Nick Hibma 0c880a36fb Use the packed attribute for the descriptor on the wire 2000-07-05 08:11:43 +00:00
Matt Jacob 1fcf5deb4a Oops! If we're deciding a command is now really dead, make *darned*
sure that it really is by issuing a ISPCTL_ABORT_CMD just on the
off chance the f/w will start it up again and, ha ha, start using
the DMA resources we gave it but are now taking away.
2000-07-05 06:44:17 +00:00
Matt Jacob 3e97a5b432 Clean up ISPCTL_ABORT_CMD function to not be too chatty if it succeeds,
or even if it fails with INVALID_PARM (which just means that the handle
doesn't refer to an active commane).
2000-07-05 06:41:36 +00:00
Jun-ichiro itojun Hagino 2f0dab8f41 be sure to wipe out m_pkthdr when you set M_PKTHDR, you may see junk pointer
in m_pkthdr portion.
actually, we should not change pkthdr mbuf <-> non-pkthdr mbuf.
2000-07-04 18:43:32 +00:00
Poul-Henning Kamp 77978ab8bc Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.
Pointed out by:	bde
2000-07-04 11:25:35 +00:00
Poul-Henning Kamp 0cfaeeee87 Fix the "almost clone" semantics. 2000-07-04 10:06:34 +00:00
Kirk McKusick e6796b67d9 Move the truncation code out of vn_open and into the open system call
after the acquisition of any advisory locks. This fix corrects a case
in which a process tries to open a file with a non-blocking exclusive
lock. Even if it fails to get the lock it would still truncate the
file even though its open failed. With this change, the truncation
is done only after the lock is successfully acquired.

Obtained from:	 BSD/OS
2000-07-04 03:34:11 +00:00
Matt Jacob 9678910bae A side effect of new 12160 f/w- there is only one set whether target
mode enabled or not now (like the FC cards).
2000-07-04 02:06:00 +00:00
Matt Jacob 99af801d6b roll new Qlogic 2200 firmware in place 2000-07-04 02:05:13 +00:00
Matt Jacob 8c4eab6214 roll new Qlogic 2100 firmware in place 2000-07-04 02:04:48 +00:00
Matt Jacob 615493f292 roll new 12160.h firmware in place 2000-07-04 02:04:24 +00:00
Matt Jacob c464389f4b Remove obsolete isp_dogactive tag. 2000-07-04 01:06:42 +00:00
Matt Jacob 8bdda719ae Fix completely stupid and idiotiuc sprintfs in isp_inline.h with
with the STRNCAT function.
2000-07-04 01:06:23 +00:00
Matt Jacob f6e75de230 Add in config_hook for catching when interrupts are safe- this allows
us to not the ints are ok and also to (re)ENABLE isp interrupts. Remove
all splcam()/splx() invocates and replace them with ISP_LOCK/ISP_UNLOCK
macros.
2000-07-04 01:05:43 +00:00
Matt Jacob df9d46b6d9 Add in isp_lock/isp_unlock inlines. Add in an islocked/intsok flag
to isp_osinfo substructure (all in prep for SMP). Define MBOX_WAIT_COMPLETE
and MBOX_NOTIFY_COMPLETE macros so that we can now (temp) use tsleep
to wait for mailbox completion. Requires us to guess whether we're
servicing an interrupt or not- will use intr_nesting_level.

Add local strncat function.
2000-07-04 01:04:35 +00:00
Matt Jacob 1d460ef8d5 Change delay loop in new isp_mboxcmd to the use of the new MBOX_WAIT_COMPLETE
macro. Change notification of completion of a mailbox command in isp_intr
to MBOX_NOTIFY_COMPLETE macro.
2000-07-04 01:02:38 +00:00
Matt Jacob 469b6b9efb Change startup locking. Use new isp_handle_index function
for indexing off of handles to get dma maps.
2000-07-04 01:01:15 +00:00
Cameron Grant e71eb9c328 do-nothing module that depends on all sound drivers 2000-07-03 21:00:44 +00:00
Cameron Grant f314f3dad2 add module metadata. this is a hack, sound drivers will eventually present a
bus to which pcm, mixer, etc will attach.
2000-07-03 20:52:27 +00:00
Poul-Henning Kamp 82d9ae4e32 Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:
Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

        -sysctl_vm_zone SYSCTL_HANDLER_ARGS
        +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
2000-07-03 09:35:31 +00:00
Gerard Roudier 3b2b8a84d3 - Various comment fixes and additions.
- Add 2 explicit (paranoid?) memory barriers in the
  interrupt code (After the reading of the `flag' and
  prior to looking at the data, of course. :-) ).
- Remove obsolete informations from the README.sym file.

This commit actually results in no object difference
for IA32, but 2x`mb' added for Alpha.
2000-07-02 21:26:50 +00:00
Ollivier Robert c790e2240e This is the patch to make my soundcard, a Creative Ensoniq AudioPCI (an
es1371 chip, device id 0x58801274 rev 0x02).

Submitted by:	Kenneth Wayne Culver <culverk@wam.umd.edu>
2000-07-02 14:17:41 +00:00
Paul Saab 898e18b849 Only try to detect Linksys PCMCIA cards when we are in a pccard
environment.  This fixes the breakage to ISA ethernet cards.

Reviewed by:	peter
2000-06-29 07:31:37 +00:00
Mark Murray d44f401738 Staticize a variable.
This fixes the case where linking randomdev into the kernel statically
can cause panics at shutdown time.

Reported by:	sos
2000-06-28 18:51:15 +00:00
Roger Hardiman 231b1f331e Update to driver 2.14. Adds new Tuner types for Hauppauge WinTV cards 2000-06-28 15:09:12 +00:00
Matt Jacob 28445eef28 Fix usage of DELAY (SYS_DELAY is the platform independent local
define).  Fix stupidity wrt checking whether we've gone to
LOOP_PDB_RCVD loopstate- it's okay to be greater than this state.
D'oh! Protect calls to isp_pdb_sync and isp_fclink_state with IS_FC
macros.

Completely redo mailbox command routine (in preparation to make this
possibly wait rather than poll for completion).

Make a major attempt to solve the 'lost interrupt' problem

1. Problem

The Qlogic cards would appear to 'lose' interrupts, i.e., a legitimate
regular SCSI command placed on the request queue would never complete
and the watchdog routine in the driver would eventually wakeup and
catch it. This would typically only happen on Alphas, although a
couple folks with 700MHz Intel platforms have also seen this.

For a long time I thought it was a foulup with f/w negotiations of
SYNC and/or WIDE as it always seemed to happen right after the
platform it was running on had done a SET TARGET PARAMETERS mailbox
command to (re)enable sync && wide (after initially forcing
ASYNC/NARROW at startup). However, occasionally, the same thing
would also occur for the Fibre Channel cards as well (which, ahem,
have no SET TARGET PARAMETERS for transfer mode).

After finally putting in a better set of watchdog routines for the
platforms for this driver, it seemed to be the case that the command
in question (usually a READ CAPACITY) just had up and died- the
watchdog routine would catch it after ~10 seconds. For some platforms
(NetBSD/OpenBSD)- an ABORT COMMAND mailbox command was sent (which
would always fail- indicating that the f/w denied knowledge of this
command, i.e., the f/w thought it was a done command). In any case,
retrying the command worked. But this whole problem needed to be
really fixed.

2. A False Step That Went in The Right Direction

The mailbox code was completely rewritten to no longer try and grab
the mailbox semaphore register and to try and 'by hand' complete
async fast posting completions. It was also rewritten to now have
separate in && out bitpatterns for registers to load to start and
retrieve to complete. This means that isp_intr now handles mailbox
completions.

This substantially simplifies the mailbox handling code, and carries
things 90% toward getting this to be a non-polled routine for this
driver.

This did not solve the problem, though.

3. Register Debouncing

I saw some comments in some errata sheets and some notes in a Qlogic
produced Linux driver (for the Qlogic 2100) that seemed to indicate
that debouncing of reads of the mailbox registers might be needed,
so I added this.  This did not affect the problem. In fact, it made
the problem worse for non-2100 cards.

5. Interrupt masking/unmasking

The driver *used* to do a substantial amount of masking/unmasking
of the interrupt control register. This was done to make sure that
the core common code could just assume it would never get pre-empted.

This apparently substantially contributed to the lost interrupt
problem.  The rewrite of the ICR (Interrupt Control Register),
which is a separate register from the ISR (Interrupt Status Register)
should not have caused any change to interrupt assertions pending.
The manual does not state that it will, and the register layout
seems to imply that the ICR is just an active route gate. We only
enable PCI Interrupts and RISC Interrupts- this should mean that
when the f/w asserts a RISC interrupt and (and the ICR allows RISC
Interrupts) and we have PCI Interrupts enabled, we should get a
PCI interrupt. Apparently this is a latch- not a signal route.

Removing this got rid of *most* but not all, lost interrupts.

5. Watchdog Smartening

I made sure that the watchdog routine would catch cases where the
Qlogic's ISR showed an interrupt assertion. The watchdog routine
now calls the interrupt service routine if it sees this. Some
additional internal state flags were added so that the watchdog
routine could then know whether the command it was in the middle
of burying (because we had time it out) was in fact completed by
the interrupt service routine.

6. Occasional Constipation Of Commands..

In running some very strenous high IOPs tests (generating about
11000 interrupts/second across one Qlogic 1040, one Qlogic 1080
and one Qlogic 2200 on an Alpha PC164), I found that I would get
occasional but regular 'watchdog timeouts' on both the 1080 and
the 2100 cards. This is under FreeBSD, and the watchdog timeout
routine just marks the command in error and retries it.

Invariably, right after this 'watchdog timeout' error, I'd get a
command completion for the command that I had thought timed out.
That is, I'd get a command completion, but the handle returned by
the firmware mapped to no current command. The frequency of this
problem is low under such a load- it would usually take an 30
minutes per 'lost' interrupt.

I doubled the timeout for commands to see if it just was an edge
case of waiting too short a period. This has no effect.

I gathered and printed out microtimes for the watchdog completed
command and the completion that couldn't find a command- it was
always the case that the order of occurrence was "timeout, completion"
separated by a time on the order of 100 to 150 ms.

This caused me to consider 'firmware constipation' as to be a
possible culprit. That is, resubmission of a command to the device
that had suffered a watchdog timeout seemed to cause the presumed
dead command to show back up.

I added code in the watchdog routine that, when first entered for
the command, marks the command with a flag, reissues a local timeout
call for one second later, but also then issues a MARKER Request
Queue entry to the Qlogic f/w. A MARKER entry is used typically
after a Bus Reset to cause the f/w to get synchronized with respect
to either a Bus, a Nexus or a Target.

Since I've added this code, I always now see the occasional watchdog
timeout, but the command that was about to be terminated always
now seems to be completed after the MARKER entry is issued (and
before the timeout extension fires, which would come back and
*really* terminate the command).
2000-06-27 19:44:31 +00:00
Matt Jacob b85389e117 Add in the enabling of interrupts (to isp_attach). Clean up a busted
comment. Check against firmware state- not loop state when enabling
target mode. Other changes have to do with no longer enabling/disabling
interrupts at will.

Rearchitect command watchdog timeouts-

First of all, set the timeout period for a command that has a
timeout (in isp_action) to the period of time requested *plus* two
seconds. We don't want the Qlogic firmware and the host system to
race each other to report a dead command (the watchdog is there to
catch dead and/or broken firmware).

Next, make sure that the command being watched isn't done yet. If
it's not done yet, check for INT_PENDING and call isp_intr- if that
said it serviced an interrupt, check to see whether the command is
now done (this is what the "IN WATCHDOG" private flag is for- if
isp_intr completes the command, it won't call xpt_done on it because
isp_watchdog is still looking at the command).

If no interrupt was pending, or the command wasn't completed, check
to see if we've set the private 'grace period' flag. If so, the
command really *is* dead, so report it as dead and complete it with
a CAM_CMD_TIMEOUT value.

If the grace period flag wasn't set, set it and issue a SYNCHRONIZE_ALL
Marker Request Queue entry and re-set the timeout for one second
from now (see Revision 1.45 isp.c notes for more on this) to give
the firmware a final chance to complete this command.
2000-06-27 19:31:02 +00:00
Matt Jacob cc28790740 Clean up private storage so that we can use the spriv_field0 to
store a bitmask of whether we've set a value into ccb->ccb_h.status,
whether we're in the watchdog routine for this command now, whether
we've set a grace period for this command and whether this command is
actually done.

See comments of rev 1.45 of isp.c for more complete information.
2000-06-27 19:22:13 +00:00
Matt Jacob e2adf86e4e Add 8 bits of volatile mailbox busy mask- this will be the bitmask of
output mailbox values we want to get back out of the chip once a mailbox
command is done. Add storage for the maximum number of output mailbox
registers to the softc.

Roll minor version number.
2000-06-27 19:17:39 +00:00
Matt Jacob 40e88de6c3 Add mailbox bitmask macros (numbers of available mailbox registers
based upon Qlogic chip type). Define maximum mailboxes. Add INT_PENDING_MASK
macro. Change mailbox offset macro name.
2000-06-27 19:15:43 +00:00
Matt Jacob 986973a448 Add an isp_handle_index function- this is prepatory to loading more into
the handle (i.e., generation number), so we will now need a function that
will take a handle and return a flat index [ 0 .. maxhandles-1 ] for
auxillary routines that need an index to get at buddy store values
(like dma maps or xflist pointers).
2000-06-27 19:14:14 +00:00
Mark Murray 1f67cd8737 I am guilty of an act of ommission. There is no longer a /dev/urandom
device with Yarrow, and although I coded for that in dev/MAKEDEV, I forgot
to _tell_ folks.

This commit adds back the /dev/urandom device (as a duplicate) of /dev/random,
until such time as it can be properly announced.

This will help the openssl users quite a lot.
2000-06-27 09:38:40 +00:00
Gerard Roudier 2096333bc2 - Fix a harmless compilation warning on Alpha.
(Reported by Matthew Jacob)
- Fix a couple of __inline__ (changed to __inline).
- Check also against DT_DATA_IN phase on parity/crc error.
  (Merged from Pamela Delaney's changes in the Linux driver)
- Fix support for phase mismatch handling from the C code for
  the C1010 (only useful for testing issue).
- Add an asynchonous notification handler for `lost device'
  (AC_LOST).
2000-06-26 21:09:45 +00:00
Mark Murray d4262fb0dd style(9) fixes from BDE.
We shouldn't use '#include ""', rather '#include<>'.
2000-06-26 12:14:20 +00:00
Roger Hardiman 4dcedbebe2 Update to driver 2.13.
This merges in changes from NetBSD which ensure bktr0
(actually bktr%d) is printed at the start of any output lines.

Submitted by:	Thomas Klausner <wiz@danbala.ifoer.tuwien.ac.at>
2000-06-26 09:41:32 +00:00
Mark Murray d147096d0f Fix include for non-module case.
Thanks-to:	SOS
2000-06-25 20:03:44 +00:00
Mark Murray 39d9385710 Fix include for the non-module case.
Thanks-to:	SOS
2000-06-25 19:00:20 +00:00
Mark Murray 0de838f6c0 Remove old entropy-harvesting hooks; this is going to be re-engineered
later.
2000-06-25 09:55:12 +00:00