Commit Graph

57926 Commits

Author SHA1 Message Date
Olivier Houchard
c2d5c96b29 userret() now only takes 2 parameters. 2006-03-01 18:33:45 +00:00
Simon L. B. Nielsen
925374d453 Correct a remote kernel panic when processing zero-length RPC records
via TCP. [06:10]

Security:	FreeBSD-SA-06:10.nfs
Approved by:	cperciva
2006-03-01 14:17:32 +00:00
Roman Kurakin
c068fdddc4 Update low-level code. (to version 1.4)
Obtained from:	Cronyx Engineering
MFC after:	3 days
2006-03-01 09:50:20 +00:00
Søren Schmidt
0b03bcd2f9 Work around the deadlock that occours when ATA waits for the taskqueue
to call back for completition and something else is holding the taskqueue
waiting for ATA to return data.
This should clear up the "semaphore timeout !! DANGER Will Robinson !!"
in most situations, and log "taskqueue timeout - completing request directly"
instead, with a delayed "WARNING - freeing taskqueue zombie request" when
the taskqueue finally calls us back with the now stale request.
(It would have been nice if there was a way to remove a scheduled item from
 a taskqueue, but that is not currently implemented in the kernel).

A real fix for this is in the works but wont make it to 6.1RELEASE

definite MFC candidate.
2006-03-01 07:48:41 +00:00
Scott Long
3469383f4f Big update to the iir driver:
- Don't use a common buffer in the softc to store per-command data.  Reserve
  a buffer in the command itself.
- Don't allocate DMA memory for the kernel command structures when all you
  really need is DMA memory for the scratch buffer embedded in them.  Instead
  allocate a slab for the scratch buffers and divide it up as needed.
- Call bus_dmamap_unload() at the completion of commands.
- Preserve and clear the CAM CCB status flags at completion.
- Reorder some low-level command operations to try to close races.
- Limit the simq to 32 commands for now.  There are some serious problems
  with the driver under load that are not well understood, so keeping the
  simq lower helps avoid this.  It has been tested at a higher value, but
  this is a safe value that doesn't show much performance degredation.

These changes allow the driver to work reliably with >4GB of memory on i386
and amd64, and also work around deadlocks seen under very high load in
certain situations.  The work-around is far from ideal, but without and
documentation it is hard to know what the right fix is.

MFC candidate
2006-03-01 07:24:39 +00:00
David Xu
80452384e6 Regenerate. 2006-03-01 06:49:38 +00:00
David Xu
48d0e3ac7d s/timer_t/int/g 2006-03-01 06:48:31 +00:00
Warner Losh
e8bfdb2a33 Don't free ifaces yet, should fix a panic 2006-03-01 06:31:24 +00:00
David Xu
61d3a4efc2 Let kernel POSIX timer code and mqueue code to use integer as a resource
handle, the timer_t and mqd_t types will be a pointer which userland
will define it.
2006-03-01 06:29:34 +00:00
Sam Leffler
5225f08dc9 guard function decls with _KERNEL so user code can include this file 2006-03-01 05:59:56 +00:00
Maksim Yevmenkin
d168d95487 Integrate kbdmux(4) into syscons(4) and kbd code.
By default syscons(4) will look for the kbdmux(4) keyboard first, and then,
if not found, look for any keyboard.

Current kbd code is modified so if kbdmux(4) is the current keyboard, all
new keyboards are automatically added to the kbdmux(4).

Switch to kbdmux(4) can be done at boot time, by loading kbdmux module at
the loader prompt, or at runtime, by kldload'ing the kbdmux module and
releasing current active keyboard.

If, for whatever reason, kbdmux(4) is not required/desired then just do
not load it and everything should work as before. It is also possible to
kldunload kbdmux at runtime and syscons(4) will automatically switch to
the first available keyboard.

No response from:	freebsd-current@
MFC after:		1 day
2006-02-28 23:46:23 +00:00
Andre Oppermann
464fcfbc5c Rework TCP window scaling (RFC1323) to properly scale the send window
right from the beginning and partly clean up the differences in handling
between SYN_SENT and SYN_RCVD (syncache).

Further changes to this code to come.  This is a first incremental step
to a general overhaul and streamlining of the TCP code.

PR:		kern/15095
PR:		kern/92690 (partly)
Reviewed by:	qingli (and tested with ANVL)
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-02-28 23:05:59 +00:00
John Baldwin
215e7c161a Rework how we wire up interrupt sources to CPUs:
- Throw out all of the logical APIC ID stuff.  The Intel docs are somewhat
  ambiguous, but it seems that the "flat" cluster model we are currently
  using is only supported on Pentium and P6 family CPUs.  The other
  "hierarchy" cluster model that is supported on all Intel CPUs with
  local APICs is severely underdocumented.  For example, it's not clear
  if the OS needs to glean the topology of the APIC hierarchy from
  somewhere (neither ACPI nor MP Table include it) and setup the logical
  clusters based on the physical hierarchy or not.  Not only that, but on
  certain Intel chipsets, even though there were 4 CPUs in a logical
  cluster, all the interrupts were only sent to one CPU anyway.
- We now bind interrupts to individual CPUs using physical addressing via
  the local APIC IDs.  This code has also moved out of the ioapic PIC
  driver and into the common interrupt source code so that it can be
  shared with MSI interrupt sources since MSI is addressed to APICs the
  same way that I/O APIC pins are.
- Interrupt source classes grow a new method pic_assign_cpu() to bind an
  interrupt source to a specific local APIC ID.
- The SMP code now tells the interrupt code which CPUs are avaiable to
  handle interrupts in a simpler and more intuitive manner.  For one thing,
  it means we could now choose to not route interrupts to HT cores if we
  wanted to (this code is currently in place in fact, but under an #if 0
  for now).
- For now we simply do static round-robin of IRQs to CPUs when the first
  interrupt handler just as before, with the change that IRQs are now
  bound to individual CPUs rather than groups of up to 4 CPUs.
- Because the IRQ to CPU mapping has now been moved up a layer, it would
  be easier to manage this mapping from higher levels.  For example, we
  could allow drivers to specify a CPU affinity map for their interrupts,
  or we could allow a userland tool to bind IRQs to specific CPUs.

The MFC is tentative, but I want to see if this fixes problems some folks
had with UP APIC kernels on 6.0 on SMP machines (an SMP kernel would work
fine, but a UP APIC kernel (such as GENERIC in RELENG_6) would lose
interrupts).

MFC after:	1 week
2006-02-28 22:24:55 +00:00
Christian Brueffer
97303ec95b Fix a c/p error.
Obtained from:	The TrustedBSD Project
Approved by:	rwatson (mentor)
2006-02-28 21:25:00 +00:00
John Baldwin
eac727ae4a Allow PHOLD()'s of curproc even if P_WEXIT is set. Normally we don't want
to allow PHOLD()'s of processes that have P_WEXIT set as once that flag
is set we aren't guaranteed to block in exit1() waiting for the PRELE()
(we might already be past the wait).  However, curproc is a bit of a
special case.  By the time P_WEXIT is set, the process is single-threaded,
so the only thread for which can do a PHOLD(curproc) is the thread
executing in exit1().  The fact that this thread is executing ensures
that the process won't go away before the current hold is released via
PRELE().  This fixes some panics due to kicking off softupdate operations
inside of exit1() after the recent PHOLD changes to fix ptrace/procfs vs
exit races.

MFC after:	1 week
Tested by:	pho
2006-02-28 20:11:30 +00:00
Paul Saab
26e4fb05dc regen for 32bit sendfile 2006-02-28 19:39:52 +00:00
Paul Saab
fa545f434c Fix 32bit sendfile by implementing kern_sendfile so that it takes
the header and trailers as iovec arguments instead of copying them
in inside of sendfile.

Reviewed by:	jhb
MFC after:	3 weeks
2006-02-28 19:39:18 +00:00
Matt Jacob
29ae59edff Fix mpt_reset to try mpt_hard_reset more than once, and to try
mpt_soft_reset more than once. And to wait for MPT_DB_STATE_READY
twice. I mean, this is crucial- give the IOC a chance to get
ready.

If mpt_reset is called to reinit things, and we succeed, make
sure to re-enable interrupts. This is what has mostly led to
system lockup after having to hard reset the chip. Also, if
we think that interrupts aren't function in mpt_cam_timeout,
for goodness sake, turn them on again.

In read_cfg_header, return distinguishing errnos so the caller
can decide what's an error. It's *not* an error to fail to
read a RAID page from a non-RAID capable device like the FC929X.

Some whitespace fixes (removing spaces from ends of lines).
2006-02-28 07:44:50 +00:00
Maksim Yevmenkin
2d6b1da721 Make ukbd(4) to not delay break scancodes in "raw" mode.
Developed with:		Norbert Koch < NKoch at demig dot de >
No response from:	freebsd-current@
Tested by:		Norbert Koch < NKoch at demig dot de >
MFC after:		1 day
2006-02-28 03:34:06 +00:00
Andrew Thompson
43dc0e8c41 Fix up the Bridge Identifier field in the BPDU packet.
- use the cu_bridge_id rather than the cu_rootid for the bridge address [1]
 - the memcmp return value is not signed so the wrong interface may have been
   selected
 - fix up the calculation of sc_bridge_id

PR:		kern/93909 [1]
MFC after:	3 days
2006-02-28 00:13:24 +00:00
Kris Kennaway
7d65872fff Correct the vnode locking in fdescfs.
PR:		kern/93905
Submitted by:	Kostik Belousov <kostikbel@gmail.com>
Reviewed by:	jeff
MFC After:	1 week
2006-02-28 00:05:44 +00:00
Olivier Houchard
493be2ca17 Get this to compile with the recent UART changes. 2006-02-27 23:19:13 +00:00
Maksim Yevmenkin
40a3c5ea70 Plug memory leak
MFC after:	1 day
2006-02-27 21:47:38 +00:00
Warner Losh
04a6a8a8e5 Since we set the decription, we don't need to also print it. Noticed by: ru@ 2006-02-27 19:40:37 +00:00
Warner Losh
b0e8c55437 Don't forget to free the ifaces when we free the ivars 2006-02-27 19:36:22 +00:00
Sam Leffler
ebecf80294 backout 1.136 until we can resolve report that it causes output to stall 2006-02-27 17:20:23 +00:00
Wojciech A. Koszek
51b4ccb464 This patch fixes a problem, which exists if you have IPSEC in your kernel
and want to have crypto support loaded as KLD. By moving zlib to separate
module and adding MODULE_DEPEND directives, it is possible to use such
configuration without complication. Otherwise, since IPSEC is linked with
zlib (just like crypto.ko) you'll get following error:

	interface zlib.1 already present in the KLD 'kernel'!

Approved by:	cognet (mentor)
2006-02-27 16:56:22 +00:00
Wojciech A. Koszek
cf62a08f65 Connect zlib to the build.
Approved by:	cognet (mentor)
2006-02-27 16:50:51 +00:00
Yaroslav Tykhiy
82967ff0b8 CODA_COMPAT_5 may not be defined unconditionally in the coda5 module.
Otherwise a kernel build would break in the coda5 module if the main
kernel conf file enabled CODA_COMPAT_5, too.  Redefined symbols are
strictly disallowed by -Werror.

To overcome this issue, introduce a different symbol indicating coda5
build, CODA5_MODULE, and translate it to CODA_COMPAT_5 appropriately
in /sys/coda/coda.h.

MFC after:	3 days
2006-02-27 12:04:13 +00:00
Gleb Smirnoff
73bb09f2d0 One more grammar nit.
Submitted by:	ru
2006-02-27 07:22:32 +00:00
Maksim Yevmenkin
0722466d60 Disable custom locking in the vkbd(4) for now and make it rely on the
Giant mutex (just like the rest of keyboard drivers and syscons(4) do).

Tested by:	markus
MFC after:	1 day
2006-02-27 06:17:48 +00:00
Ian Dowse
564d760afe Add the Tripp-Lite U209-000-R serial adapter.
PR:		usb/78543, usb/93347
MFC after:	1 week
2006-02-27 01:01:27 +00:00
Matt Jacob
6a9fa0152c Remove the ill-considered effect of using the type definitions as
distributed by LSI-Logic. For FreeBSD, just use the posix defines
instead of trying to figure out how wide an int is. Apologies to all.
2006-02-26 22:50:14 +00:00
Matt Jacob
c6435ff3dd propagate role of device for ISP_GET_PDBINFO 2006-02-26 22:40:56 +00:00
Ian Dowse
cc06b755fe The UQ_OPEN_CLEARSTALL entry added in revision 1.48 is no longer
required now that we save the data toggle when closing a pipe.

Verified by:	Fredrik Lindberg
2006-02-26 22:20:45 +00:00
Warner Losh
eef5d4a37e Move de driver to dev/de 2006-02-26 17:54:04 +00:00
Warner Losh
38637d7d9d Remove de driver from old location. 2006-02-26 17:52:51 +00:00
Warner Losh
6e5832cd99 Repo copy de driver to dev/de, and adjust. 2006-02-26 17:52:04 +00:00
Warner Losh
acb2d038a7 Move de from pci to dev/de 2006-02-26 17:51:22 +00:00
David Xu
27b8220d12 1. Remove aio entry from lists earlier in aio_free_entry,
so other threads can not see it if we unlock the proc
   lock (this can happen in knlist_delete).  Don't do wakeup,
   it is not necessary.

2. Decrease kaio_buffer_count in biohelper rather than
   doing it in aio_bio_done_notify.

3. In aio_bio_done_notify, don't send notification if KAIO_RUNDOWN
   was set, because the process is already in single thread mode.

4. Use assignment to initialize aiothreadflags.

5. AIOCBLIST_RUNDOWN is not useful, axe the code using it.

6. use LIO_NOP instead of zero.
2006-02-26 12:56:23 +00:00
Gleb Smirnoff
fcf9061858 Fix several typos and trim spaces at eol.
PR:		kern/93759
Submitted by:	Antoine Brodin <antoine.brodin laposte.net>
2006-02-26 11:44:28 +00:00
Matt Jacob
8b14319c98 Shorten the time for waiting for TMF commands to complete- let's
not hang the system for 5 seconds. If a TMF doesn't complete within,
oh, say 500ms, that's enough.

Put in a printout to catch mpt_recover_commands being activated with
no commands.
2006-02-26 07:46:09 +00:00
Matt Jacob
ca8ee7080f a) Delay for port enable to succeed should be 30 seconds (at least) for
*both* SAS and FC, not just SAS.

b) Don't tell the chip we want it to do FIFO signalling if we actually
don't set up the address where the FIFO signal is supposed to be written
(oops).
2006-02-26 07:44:31 +00:00
Ian Dowse
78e3c96cc9 Save and restore the data toggle value when a pipe to an endpoint
is closed and then reopened. This appears to be necessary now that
we no longer clear endpoint stalls every time a pipe is opened.
Previously we could assume an initial toggle value of zero because
the clear-stall operation resets the device's toggle state.

Reported by:	Holger Kipp
MFC after:	3 days
2006-02-26 02:57:57 +00:00
Maksim Yevmenkin
65b70c1dfd Put a comment, explaining why kbdmux(4) had to be fixed.
While I'm here fix a couple of whitespaces.

Requested by:	netchild
MFC after:	1 day
2006-02-25 22:59:01 +00:00
Maksim Yevmenkin
fd4df69975 Fix hard lockup caused by kbdmux(4) when kbdmux(4), PS/2 keyboard
(atkbd(4)) and PS/2 mouse (psm(4)) are used together.

Turns out that atkbd(4) check_char() method may return "true" while
read_char() method returns NOKEY. When this happens kbdmux(4) was
simply stuck in the dead loop. Avoid dead loop in kbdmux(4) by breaking
out of the loop if read_char() method returns NOKEY.

It almost seems like a bug in atkkbd(4), atkbd_check_char() calls
kbdc_data_ready(), and, the later will return "true" if there are
pending data in either kbd or aux queue. However, because both aux
and kbd are on the same controller, I'm not sure if this is a bug
or feature.

Tested by:	markus
MFC after:	1 day
2006-02-25 21:59:29 +00:00
Ian Dowse
b184cddcc2 Add a missing ohci_waitintr() call that allows polled operation of
bulk transfers to have a chance of working.

PR:		usb/93720
Submitted by:	Nate Nielsen
MFC after:	1 week
2006-02-25 17:44:29 +00:00
Søren Schmidt
a62b100d96 Fix ata_reinit so it does things in the right order to prevent panic's.
Lock the channel so master/slave setups wont trash during reinit.
2006-02-25 17:27:33 +00:00
Scott Long
6ec6fb9bc6 Always print a newline char at the end of the line. 2006-02-25 16:20:22 +00:00
Matt Jacob
0b80d21bdf Role a microrev of the MPI Library in preparation for target mode work.
Make my portions of the license clearer.

Thank Chris Ellsworth for his support in getting a bunch of this done.
2006-02-25 07:45:54 +00:00