Commit Graph

58110 Commits

Author SHA1 Message Date
Paul Saab
45d48bdad5 Fix bug in malloc_uninit():
Releasing items from the mt_zone can not be done by a simple
uma_zfree() call since mt_zone is allocated with the UMA_ZONE_MALLOC
flag. Use uma_zfree_arg instead and supply the slab.

This bug caused panics in low memory situations on unloading kernel
modules containing MALLOC_DEFINE(..) statements.

Submitted by:	ups
2006-03-03 22:36:52 +00:00
Yaroslav Tykhiy
375ce6798f Take the functionality contained in the former "options TDFX_LINUX"
into a separate module.  Accordingly, convert the option into a device
named similarly.

Note for MFC: Perhaps the option should stay in RELENG_6 for POLA reasons.

Suggested by:	scottl
Reviewed by:	cokane
MFC after:	5 days
2006-03-03 21:37:38 +00:00
Maxime Henrion
1bf308c1ea Cast the pointer to void * before casting it back to struct type * in
STAILQ_LAST.  This quiets a warning from GCC about increased required
alignment for the cast.

Idea from:      cognet
2006-03-03 18:54:33 +00:00
Alexander Leidinger
fb0a379774 - use a more common style to print memory sizes
- add some more cache sizes (2nd and 3rd level) [1]

Submitted by:	HATANOU Tomomi <hatanou@infolab.ne.jp> [1]
PR:		91328 [1]
2006-03-03 18:54:05 +00:00
Yaroslav Tykhiy
9d5eafc196 Fix the decaying MODULES_WITH_WORLD again by adding a missing opt_*.h to SRCS. 2006-03-03 18:42:09 +00:00
Warner Losh
8dfbd03d30 Move XBOX option to options. While it is only valid on i386,
syscons_isa is shared with other machines.
2006-03-03 18:09:37 +00:00
Christian S.J. Peron
de572b371b Unbreak byte counters when network interfaces are in monitor mode by
re-organizing the monitor return logic. We perform interface monitoring
checks after we have determined if the CRC is still on the packet, if
it is, m_adj() is called which will adjust the packet length. This
ensures that we are not including CRC lengths in the byte counters for
each packet.

Discussed with:	andre, glebius
2006-03-03 17:21:08 +00:00
Rink Springer
5fa7c51ff6 Committed the xbox syscons(8)-able console driver.
Reviewed by:    arch@ (no comments)
Approved by:    imp (mentor)
2006-03-03 14:52:57 +00:00
Gleb Smirnoff
f051cb85e8 Correctly switch IFCAP_VLAN_HWTAGGING on and off.
Reported & tested by:	Peter Blok <pblok bsd4all.org>
2006-03-03 12:32:51 +00:00
Gleb Smirnoff
e2779391fa - Do not leak read lock in IP_FW_TABLE_GETSIZE case of ipfw_ctl().
- Acquire read (not write) lock in case of IP_FW_TABLE_LIST.

In collaboration with:	ru
2006-03-03 12:10:59 +00:00
Andrew Thompson
158a726c96 Since we are using random ethernet addresses for the bridge, it is possible
that we might have address collisions, so make sure that this hardware address
isn't already in use on another bridge.

Submitted by:	csjp
MFC after:	1 month
2006-03-03 09:12:21 +00:00
Paul Saab
6815739e00 Don't truncate f_mntfromname & f_mntonname to 16 characters when
translating statfs into ostatfs.  This allows 4.x binaries making
statfs calls to work on 6.x.
2006-03-03 07:20:54 +00:00
Matt Jacob
c1504bc00d micro fix from justin 2006-03-03 07:04:43 +00:00
Christian S.J. Peron
6f75ef188b Slightly re-worked bpf(4) code associated with bridging: if we have a
destination interface as a member of our bridge or this is a unicast packet,
push it through the bpf(4) machinery.

For broadcast or multicast packets, don't bother with the bpf(4) because it will
be re-injected into ether_input. We do this before we pass the packets through
the pfil(9) framework, as it is possible that pfil(9) will drop the packet or
possibly modify it, making it very difficult to debug firewall issues on the
bridge.

Further, implemented IFF_MONITOR for bridge interfaces. This does much the same
thing that it does for regular network interfaces: it pushes the packet to any
bpf(4) peers and then returns. This bypasses all of the bridge machinery,
saving mutex acquisitions, list traversals, and other operations performed by
the bridging code.

This change to the bridging code is useful in situations where individuals use a
bridge to multiplex RX/TX signals from two interfaces, as is required by some
network taps for de-multiplexing links and transmitting the RX/TX signals
out through two separate interfaces. This behaviour is quite common for network
taps monitoring links, especially for certain manufacturers.

Reviewed by:	thompsa
MFC after:	1 month
Sponsored by:	Seccuris Labs
2006-03-03 05:58:18 +00:00
Scott Long
a7f12baaca iir works on PAE now. 2006-03-03 04:30:18 +00:00
Marcus Alves Grando
b4130b8ae0 - Print message about cpufreq and timecounter TSC
Approved by:	njl
MFC after:	1 day
2006-03-03 02:06:04 +00:00
Maksim Yevmenkin
af0618e9d4 Fix endian bugs accessing ioctl arguments that are passed by value.
Pointed out by:	marius
MFC after:	1 day
2006-03-03 00:46:28 +00:00
Tor Egge
3b582b4e72 Eliminate a deadlock when creating snapshots. Blocking vn_start_write() must
be called without any vnode locks held.  Remove calls to vn_start_write() and
vn_finished_write() in vnode_pager_putpages() and add these calls before the
vnode lock is obtained to most of the callers that don't already have them.
2006-03-02 22:13:28 +00:00
Tor Egge
6b085058e4 Hold extra reference to vm object while cleaning pages. 2006-03-02 21:38:38 +00:00
Tor Egge
b983aac762 Don't try to show marker nodes. 2006-03-02 21:31:15 +00:00
Andrew Thompson
cceffdee0c The altq(4) code already handles SMP so clarify what ALTQ_NOPCC is needed for. 2006-03-02 19:45:59 +00:00
David Xu
3dfcaad667 Add signal set sq_kill to sigqueue structure, the member saves all
signals sent by kill() syscall, without this, a signal sent by
sigqueue() can cause a signal sent by kill() to be lost.
2006-03-02 14:06:40 +00:00
Olivier Houchard
5adfa73930 Use BUS_DMA_COHERENT. 2006-03-02 14:06:38 +00:00
Jeff Roberson
b9b12498fd - Acquire lk in softdep_slowdown so that it's owned when we call
softdep_speedup().
 - Assert that lk is held in softdep_speedup() rather than acquiring it.
   This avoids a potential lock recursion.
2006-03-02 08:52:53 +00:00
Poul-Henning Kamp
301af28a06 Suffer a little bit of math every 16 second and tighten calibration of
cpu_ticks to the low side of PPM.
2006-03-02 08:09:46 +00:00
Jeff Roberson
eb2ea10590 - Move softdep from using a global worklist to per-mount worklists. This
has many positive effects including improved smp locking, reducing
   interdependencies between mounts that can lead to deadlocks, etc.
 - Add the softdep worklist and various counters to the ufsmnt structure.
 - Add a mount pointer to the workitem and remove mount pointers from the
   various structures derived from the workitem as they are now redundant.
 - Remove the poor-man's semaphore protecting softdep_process_worklist and
   softdep_flushworklist.  Several threads may now process the list
   simultaneously.
 - Add softdep_waitidle() to block the thread until all pending
   dependencies being operated on by other threads have been flushed.
 - Use softdep_waitidle() in unmount and snapshots to block either
   operation until the fs is stable.
 - Remove softdep worklist processing from the syncer and move it into the
   softdep_flush() thread.  This thread processes all softdep mounts
   once each second and when it is called via the new softdep_speedup()
   when there is a resource shortage.  This removes the softdep hook
   from the kernel and various hacks in header files to support it.

Reviewed by/Discussed with:	tegge, truckman, mckusick
Tested by:	kris
2006-03-02 05:50:23 +00:00
Jeff Roberson
420239c773 - Lock Giant if needed around the call to vnode_create_vobject(). This is
only important if devfs is not mpsafe.

Sponsored by:	Isilon Systems, Inc.
Found by:	kris
2006-03-02 05:37:44 +00:00
Andrew Thompson
95d4af215e Do not use the TSC where its known to be broken, this will cause the queue
speeds to perform below the desired bitrate and throughput will be erratic.

This makes queueing work on the Geode SC1100, K5 model 0 and IDT WinChip C6
processors.

MFC after:	3 days
2006-03-02 00:51:39 +00:00
Olivier Houchard
db45b073f7 Use 8 * sizeof(int) instead of hardcoding 32, for the unlikely case this
code ever get used on a plateform where sizeof(int) != 4.

Suggested by:	jmg
2006-03-02 00:37:40 +00:00
Olivier Houchard
2456c0ea88 Try to honor BUS_DMA_COHERENT : if the flag is set, normally allocate memory
with malloc() or contigmalloc() as usual, but try to re-map the allocated
memory into a VA outside the KVA, non-cached, thus making the calls to
bus_dmamap_sync() for these buffers useless.
2006-03-01 23:04:25 +00:00
Olivier Houchard
4cb8778630 Use a better panic message than lol. 2006-03-01 20:43:51 +00:00
Olivier Houchard
12ce8511ba Make sure we decrement p_lock before leaving prefetch_abort_handler() 2006-03-01 20:42:47 +00:00
Pawel Jakub Dawidek
92ee312dd4 Assert proper use of bio_caller1, bio_caller2, bio_cflags, bio_driver1,
bio_driver2 and bio_pflags fields.

Reviewed by:	phk
2006-03-01 19:01:58 +00:00
Maksim Yevmenkin
b569776d07 Provide ability to disable kbdmux(4) with the hint.kbdmux.0.disabled="1" hint.
Document hint in the kbdmux(4) man page.

Requested by:	scottl
MFC after:	1 day
2006-03-01 18:34:48 +00:00
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
Sam Leffler
667dad55fc consolidate calculation of capabilities ie
Reviewed by:	avatar
MFC after:	2 weeks
2006-02-25 05:36:43 +00:00
Colin Percival
69084095dc Add frequency-voltage tables for Intel 778, 758, 773, 753, and 733J
processors.

Obtained from:	Intel Datasheet 302189-008
2006-02-25 04:55:38 +00:00
Sam Leffler
8fe92b6cf6 fix a race whereby a tx descriptor might get reused before the hardware
is finished with it; this may only occur when the tx queue is setup as
dba-gated but since the fix is cheap apply it to all queues

while here make the queue depth signed for use in assertions

Reviewed by:	apatti
MFC after:	2 weeks
2006-02-24 23:10:08 +00:00
Yaroslav Tykhiy
33499e2ae5 Don't to forget to unlock the rwlock on trunk before destroying it.
This should fix panic on "kldunload if_vlan" while vlanX are still there.

Reviewed by:	glebius
2006-02-24 17:25:16 +00:00
Yaroslav Tykhiy
56c559ca66 Move the hard-coded ETHER_* options to where they belong --
inside !if defined(KERNBUILDDIR).

Utilize the fact the module will support all frames by default --
it needs no ETHER_* options unless some frames need to be disabled.

Fix the comment respectively.

Don't forget to create fake opt_ef.h if no ETHER_* are set.

MFC after:	3 days
2006-02-24 12:27:09 +00:00
Ariff Abdullah
df010ca869 Trim unnecessary pointer alignment. 2006-02-24 09:29:32 +00:00
Marcel Moolenaar
ea54941449 Replace our local UART_SIGMASK_* with the global SER_MASK_*. 2006-02-24 05:40:17 +00:00
Marcel Moolenaar
0bb90c9d57 When we probe a SAB82532, return BUS_PROBE_GENERIC. This allows puc(4)
or scc(4) to grab the device by default. In fact, we probably shouldn't
even claim the device at all...
2006-02-24 05:36:44 +00:00
Marcel Moolenaar
2d5118050a MFp4:
Stop using our local UART_IPEND_* and instead use the global SER_INT_*
as defined in <sys/serial.h>.
2006-02-24 02:42:26 +00:00
Marcel Moolenaar
6fcbf91d09 MFp4:
o  Add defines for the 5 interrupt sources typical for serial devices.
   These defines can be used for more finegrained interrupt handling
   between drivers that cooperatively handle multiple serial ports.
o  Add defines for the various bitmasks applicable when all information
   is passed between drivers as a single integral.
2006-02-24 02:24:10 +00:00
Marcel Moolenaar
061ba7bb43 MFp4:
style(9): <tab> after #define
2006-02-24 02:16:09 +00:00
Marcel Moolenaar
c9ccf50a36 MFp4:
Return BUS_PROBE_LOW_PRIORITY for a successful probe. This is in
preparation of the introduction of scc(4), which is going to handle
SCCs in the near future.
2006-02-24 02:06:57 +00:00
Marcel Moolenaar
1ba1685b25 MFp4:
Add CHAN_A & CHAN_B for channel register offsets.
While here, fix a comment.
2006-02-24 02:03:35 +00:00
Marcel Moolenaar
9465d7f13a Remove dev/uart/uart_if.m from the default MFILES (in kmod.mk) and
instead define MFILES appropriately for the uart(4) module build.
2006-02-24 01:49:36 +00:00
Qing Li
4b8e98d632 This patch fixes the problem where the current TCP code can not handle
simultaneous open. Both the bug and the patch were verified using the
ANVL test suite.

PR:		kern/74935
Submitted by:	qingli (before I became committer)
Reviewed by:	andre
MFC after:	5 days
2006-02-23 21:14:34 +00:00
Søren Schmidt
28baad63bd Keep the parent device (in this case the channel) around in ata_request,
so we dont panic device removal or failure.
Clean up ata_fail_requests to prevent the queue munging to fail.
2006-02-23 20:15:22 +00:00
John Baldwin
de49f3252c Remove some dead code.
Coverity ID:	822
Found by:	Coverity Prevent
Reviewed by:	ariff
MFC after:	1 week
2006-02-23 19:23:55 +00:00
John Baldwin
b36f458861 Use the recently added msleep_spin() function to simplify the
callout_drain() logic.  We no longer need a separate non-spin mutex to
do sleep/wakeup with, instead we can now just use the one spin mutex to
manage all the callout functionality.
2006-02-23 19:13:12 +00:00
John Baldwin
9fc9d84b9b - Use callout_init_mtx() to initialize toffhandle callout using the fdc's
mutex.
- Don't use callout_drain() to stop the toffhandle callout while holding the
  fdc mutex (this could deadlock) in functions called from softclock
  (callouts aren't allowed to do voluntary sleeps).  Instead, use
  callout_stop().  Note that since we hold the associated mutex and are now
  using callout_init_mtx(), callout_stop() is just as effective as
  callout_drain().  (Though callout_drain() is still needed in detach to
  make sure softclock isn't contesting on our mutex before we destroy the
  mutex.)
- Remove unused callout 'tohandle' from softc.

MFC after:	1 week
2006-02-23 19:11:16 +00:00
Søren Schmidt
c94b3e542e In ata_cmd_allocate() only call ata_pci_allocate once.
found by:	jhb@
2006-02-23 18:52:15 +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
Andrew Gallatin
784daffb89 Unhook myri10ge from build in preparation for rename 2006-02-23 12:30:39 +00:00
David Xu
7e0221a251 1. Refine kern_sigtimedwait() to remove redundant code.
2. Fix a bug, if thread got a SIGKILL signal, call sigexit() to kill
   its process.

MFC after: 3 days
2006-02-23 09:24:19 +00:00
David Xu
7c9a98f15b Code cleanup, simply compare with curproc. 2006-02-23 05:50:55 +00:00
Jeff Roberson
8febcfb92f - Use vfs_ref/rel to protect a mountpoint from going away while VFS_STATFS
is being called.  Be sure to grab the ref before we unlock the vnode to
   prevent the mount from disappearing.

Tested by:	kris
2006-02-23 05:18:07 +00:00
Jeff Roberson
a1db11fc40 - Release the mount ref once the vnode has been recycled rather than once
the last reference is dropped.  I forgot that vnodes can stick around
   for a very long time until processes discover that they are dead.  This
   means that a vnode reference is not sufficient to keep the mount
   referenced and even more code will be required to ref mount points.

Discovered by:	kris
2006-02-23 05:15:37 +00:00
David Xu
dc94f5e383 Move comments to more accurate place. 2006-02-23 03:42:17 +00:00
David Xu
c008d51784 Fix a sleep queue race for KSE thread.
Reviewed by: jhb
2006-02-23 00:13:58 +00:00
John Baldwin
93d74675d6 G/C unused variable. 2006-02-22 21:47:04 +00:00
Sam Leffler
3f676959ae guard function decls with _KERNEL so user code can include this file
MFC after:	1 week
2006-02-22 21:38:33 +00:00
John Baldwin
daad1cd74d Fixup some comments. Mutexes's are locked, not entered for several years
now and msleep blocks threads rather than processes.
2006-02-22 20:46:10 +00:00
John Baldwin
06ad42b2f7 Close some races between procfs/ptrace and exit(2):
- Reorder the events in exit(2) slightly so that we trigger the S_EXIT
  stop event earlier.  After we have signalled that, we set P_WEXIT and
  then wait for any processes with a hold on the vmspace via PHOLD to
  release it.  PHOLD now KASSERT()'s that P_WEXIT is clear when it is
  invoked, and PRELE now does a wakeup if P_WEXIT is set and p_lock drops
  to zero.
- Change proc_rwmem() to require that the processing read from has its
  vmspace held via PHOLD by the caller and get rid of all the junk to
  screw around with the vmspace reference count as we no longer need it.
- In ptrace() and pseudofs(), treat a process with P_WEXIT set as if it
  doesn't exist.
- Only do one PHOLD in kern_ptrace() now, and do it earlier so it covers
  FIX_SSTEP() (since on alpha at least this can end up calling proc_rwmem()
  to clear an earlier single-step simualted via a breakpoint).  We only
  do one to avoid races.  Also, by making the EINVAL error for unknown
  requests be part of the default: case in the switch, the various
  switch cases can now just break out to return which removes a _lot_ of
  duplicated PRELE and proc unlocks, etc.  Also, it fixes at least one bug
  where a LWP ptrace command could return EINVAL with the proc lock still
  held.
- Changed the locking for ptrace_single_step(), ptrace_set_pc(), and
  ptrace_clear_single_step() to always be called with the proc lock
  held (it was a mixed bag previously).  Alpha and arm have to drop
  the lock while the mess around with breakpoints, but other archs
  avoid extra lock release/acquires in ptrace().  I did have to fix a
  couple of other consumers in kern_kse and a few other places to
  hold the proc lock and PHOLD.

Tested by:	ps (1 mostly, but some bits of 2-4 as well)
MFC after:	1 week
2006-02-22 18:57:50 +00:00
John Baldwin
57fb5e6097 - Use bus_setup_intr() and bus_teardown_intr() to register device driver
interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR().
  Uses of the BUS_*() versions in the implementation of foo_intr methods
  in bus drivers were not changed.  Mostly this just means that some
  drivers might start printing diagnostic messages like [FAST] when
  appropriate as well as honoring mpsafenet=0.
- Fix two more of the ppbus drivers' identify routines to function
  correctly in the mythical case of a machine with more than one ppbus.
2006-02-22 18:16:26 +00:00
John Baldwin
f8e3eeb519 Change pfs_visible() to optionally return a pointer to the process
associated with the passed in pfs_node.  If it does return a pointer, it
keeps the process locked.  This allows a lot of places that were calling
pfind() again right after pfs_visible() to not have to do that and avoids
races since we don't drop the proc lock just to turn around and lock it
again.  This will become more important with future changes to fix races
between procfs/ptrace and exit(2).  Also, removed a duplicate pfs_visible()
call in pfs_getextattr().

Reviewed by:	des
MFC after:	1 week
2006-02-22 17:24:54 +00:00
John Baldwin
54690b5679 Don't do a PHOLD() in kthread_create() w/o a matching PRELE() in
kthread_exit().  Rather than add the missing PRELE() I chose to just
axe the PHOLD() since it was redundant with the P_SYSTEM flag.

MFC after:	1 week
2006-02-22 17:21:45 +00:00
John Baldwin
7a61c1a3cb Hold the proc lock while calling proc_sstep() since the function asserts
it and remove a PRELE() that didn't have a matching PHOLD().  The calling
code already has a PHOLD anyway.

MFC after:	1 week
2006-02-22 17:20:37 +00:00
John Baldwin
3df4e47b1e Use bus_setup_intr() rather than invoking BUS_SETUP_INTR() directly so that
puc still prints out [FAST] on Peter's box.
2006-02-22 17:19:10 +00:00
John Baldwin
8f95fc2481 Various style and comment fixes.
Submitted by:	bde
2006-02-22 16:58:48 +00:00
Wayne Salamon
bc5504b942 Add pathname and/or vnode argument auditing for the following system calls:
quotactl, statfs, fstatfs, fchdir, chdir, chroot, open, mknod, mkfifo,
link, symlink, undelete, unlink, access, eaccess, stat, lstat, pathconf,
readlink, chflags, lchflags, fchflags, chmod, lchmod, fchmod, chown,
lchown, fchown, utimes, lutimes, futimes, truncate, ftruncate, fsync,
rename, mkdir, rmdir, getdirentries, revoke, lgetfh, getfh, extattrctl,
extattr_set_file, extattr_set_link, extattr_get_file, extattr_get_link,
extattr_delete_file, extattr_delete_link, extattr_list_file, extattr_list_link.

In many cases the pathname and vnode auditing is done within namei lookup
instead of directly in the system call.

Audit the remaining arguments to these system calls:
fstatfs, fchdir, open, mknod, chflags, lchflags, fchflags, chmod, lchmod,
fchmod, chown, lchown, fchown, futimes, ftruncate, fsync, mkdir,
getdirentries.
2006-02-22 16:04:20 +00:00
Gleb Smirnoff
9cc9484cb5 Back out 1.112,1.113. I don't have enough resources to fix breakages
introduced by this change.
2006-02-22 14:11:16 +00:00
Pawel Jakub Dawidek
290c616103 Do not use bio structure after g_io_deliver(), it may not longer by valid.
Found and fixed by:	Vsevolod Lobko <seva@ip.net.ua>
MFC after:		3 days
2006-02-22 10:21:05 +00:00
Jeff Roberson
c5dcb84008 - Revert r1.406 until a solution can be found that doesn't break nfs. The
statfs handler in nfs will lock vnodes which may lead to deadlock or
   recursion.

Found by:	kris
Pointy hat to:	me
2006-02-22 09:52:25 +00:00
Jeff Roberson
f50b03bfd6 - We must hold a reference to a vnode before calling vgone() otherwise
it may not be removed from the freelist.

MFC After:	1 week
Found by:	kris
2006-02-22 09:05:40 +00:00
Jeff Roberson
a4aeaefe5a - We can not hold a vnode lock while we do a lookup. Search for and load
modules prior to looking up the directory which we will cover to avoid
   this problem in mount.
 - We must hold the coveredvp locked before we can busy the mountpoint to
   prevent a lock order reversal with the vfs_busy() in lookup which holds
   the directory lock prior to doing a vfs_busy().  The directory lock is
   required to safely clear the v_mountedhere field on the directory.

MFC After:	1 week
2006-02-22 06:29:55 +00:00
Jeff Roberson
8a7cd2fdfb - Grab a mnt ref in vfs_busy() before dropping the interlock. This will
prevent the mount point from going away while we're waiting on the lock.
   The ref does not need to persist once we have the lock because the
   lock prevents the mount point from being unmounted.

MFC After:	1 week
2006-02-22 06:20:12 +00:00
Jeff Roberson
05b6a20a66 - Hold the vnode used in the statfs related functions until we're done with
the VFS_STATFS call to prevent the mount from disappearing while we're
   stating.
 - Convert these routines to use MPSAFE namei semantics.

MFC After:	1 week
2006-02-22 06:19:08 +00:00
Jeff Roberson
f5cacb3964 - spell VOP_LOCK(vp, LK_RELEASE... VOP_UNLOCK(vp,... so that asserts in
vop_lock_post do not trigger.
 - Rearrange null_inactive to null_hashrem earlier so there is no chance
   of finding the null node on the hash list after the locks have been
   switched.
 - We should never have a NULL lowervp in null_reclaim() so there is
   no need to handle this situation.  panic instead.

MFC After:	1 week
2006-02-22 06:17:31 +00:00
Jeff Roberson
9c12e63100 - Assert that the lowervp is locked in null_hashget().
- Simplify the logic dealing with recycled vnodes in null_hashget() and
   null_hashins().  Since we hold the lower node locked in both cases
   the null node can not be undergoing recycling unless reclaim somehow
   called null_nodeget().  The logic that was in place was not safe and
   was essentially dead code.

MFC After:	1 week
2006-02-22 06:15:12 +00:00
Jeff Roberson
f5a4db791d - Using LK_NOWAIT in qsync() can get us into infinite loop situations that
lead to deadlocks.  Remove it.

MFC After:	1 week
2006-02-22 06:12:53 +00:00
Jeff Roberson
578abc8e54 - Deadfs should not use the std GETWRITEMOUNT routine. Add one that always
returns NULL.

MFC After:	1 week
2006-02-22 06:11:59 +00:00
Matt Jacob
696e0ce44d Remove commented out qualifier to dumping a message. 2006-02-22 05:19:50 +00:00
David Xu
ba0360b135 Abstract function mqfs_create_node() to create a mqueue node. 2006-02-22 02:38:25 +00:00
David Xu
ad8de0f243 If block size is zero, use normal file operations to do I/O,
this eliminates a divided-by-zero fault.

Recommended by: phk
2006-02-22 00:05:12 +00:00
Sam Leffler
386d84f60e honor user-specified key index for global key slots
Submitted by:	Joe Love
Reviewed by:	avatar
MFC after:	1 week
2006-02-21 23:51:19 +00:00
John Baldwin
ca95b5146a Lock the vm_object while checking its type to see if it is a vnode-backed
object that requires Giant in vm_object_deallocate().  This is somewhat
hairy in that if we can't obtain Giant directly, we have to drop the
object lock, then lock Giant, then relock the object lock and verify that
we still need Giant.  If we don't (because the object changed to OBJT_DEAD
for example), then we drop Giant before continuing.

Reviewed by:	alc
Tested by:	kris
2006-02-21 22:09:54 +00:00
John Baldwin
bd106be404 Move the ruadd() in kern_exit() to save our final stats in our child
stats even further down in exit1() so that it includes the runtime and
tick counts from the final time slice for the dying thread.

Reviewed by:	phk
2006-02-21 21:48:42 +00:00
John Baldwin
6fc6433ecd Split calcru() back into a calcru1() function shared with calccru() and
a calcru() wrapper that passes a local rusage_ext on the stack that is
a snapshot to do the calculations on.  Now we can pass p->p_crux to
calcru1() in calccru() again which fixes the issues with runtime going
backwards messages when dead processes are harvested by init.

Reviewed by:	phk
Tested by:	Stefan Ehmann shoesoft at gmx dot net
2006-02-21 21:47:46 +00:00
Marius Strobl
0c05ab41ab - In the interrupt handler clear the interrupt source flags before
processing the interrupt events. If we clear them afterwards we
  can completely miss some events as the NIC can change the source
  flags while we're in the handler. In order to not get another
  interrupt while we're in ifp->if_input() with the driver lock
  dropped we now turn off NIC interrupts while in the interrupt
  handler. Previously this was meant to be achieved by clearing the
  interrupt source flags after processing the interrupt events but
  didn't really work as clearing these flags doesn't actually
  acknowledge and re-enable the events.
  This fixes the device timeouts seen with the VMware LANCE.
- Relax the watchdog timer somewhat; don't enable it until the last
  packet is enqueued and if there is a TX interrupt but there are
  still outstanding ones reload the timer.

Reported and tested by:	Morten Rodal <morten@rodal.no>
MFC after:		3 days
2006-02-21 20:20:43 +00:00
Ruslan Ermilov
aa00bc830f Clear csum_flags after reading data from socket buffer. Otherwise,
if ksocket is connected to an interface-type node somewhere later
in the graph (e.g., ng_eiface or ng_iface), the csum_data may be
applied to a wrong packet (if we encapsulate Ethernet or IP).

MFC after:	3 days
2006-02-21 13:04:39 +00:00
Yoshihiro Takahashi
c15ff0bc7b Initialize the port_bst and port_bsh variables.
The ed driver on pc98 was broken by if_edvar.h rev1.31.

Reported by:	Kaho Toshikazu (kaho at elam kais kyoto-u ac jp)
Tested by:	Eiji Kato (ekato at a1 mbn or jp)
MFC after:	3 days
2006-02-21 12:01:39 +00:00
Nate Lawson
ce1a23d397 Remove unused variable.
Coverity ID:	558
Found by:	Coverity Prevent
2006-02-21 03:19:24 +00:00
Nate Lawson
987b1ad6d5 Remove unused variable.
Coverity ID:	548
Found by:	Coverity Prevent
2006-02-21 03:16:58 +00:00
Nate Lawson
6dd47e5b2a Remove unused variable.
Coverity ID:	546
Found by:	Coverity Prevent
2006-02-21 03:15:26 +00:00
Sam Leffler
b197bba53b correct check for whether wpa is enabled
MFC after:	3 days
2006-02-20 20:49:56 +00:00
Sam Leffler
d3b3a464a5 treat setting the optional ie to a zero-length datum to mean "delete
the ie"; this helps drivers that (wrongly) check ic_opt_ie against NULL
when making decisions

Reviewed by:	luigi, avatar
MFC after:	3 days
2006-02-20 17:17:00 +00:00
Hajimu UMEMOTO
9bf40914d2 Obey opt_inet6.h in kernel build directory.
Reported by:	Peter Losher <plosher-keyword-freebsd.a36e57__at__plosh.net>
MFC after:	3 days
2006-02-20 12:30:32 +00:00
Yoshihiro Takahashi
58d89e5cef Disable the myri10ge driver on pc98. 2006-02-20 12:05:52 +00:00
Bernd Walter
4d3d7085f6 Copy MAC address to fix alignment problems.
Tested on alpha (AS600) with RTL8169S
Suggested by: jhb
2006-02-20 10:29:40 +00:00
Andrew Gallatin
2790e25d62 Hook the myri10ge driver to the i386 and amd64 module builds.
Sponsored by: Myricom Inc.
Reviewed by: scottl
2006-02-20 02:50:09 +00:00
Max Laier
009b3d3d4b ${.CURDIR} != pwd and since we use the shell version of if now we don't even
need to prepend it.

Found-by:	gallatin
2006-02-20 01:08:33 +00:00
Andrew Gallatin
b2fc195e1b 10GbE mode driver and binary firmware for Myricom's PCI-express NICs.
More info regarding these nics can be found at http://www.myri.com.

Please note that the files
sys/dev/myri10ge/{mcp_gen_header.h,myri10ge_mcp.h} are internally
shared between all our drivers (solaris, macosx, windows, linux, etc).
I'd like to keep these files unchanged, so I can just import newer
versions of them when the firmware API/ABI changes.  This means I'm
stuck with some of the crazy-long #define names, and possibly
non-style(9) characteristics of these files.

Many thanks to mlaier for doing firmware(9) just as I
needed it, and to scottl for his helpful review.

Reviewed by: scottl, glebius
Sponsored by: Myricom Inc.
2006-02-19 22:39:19 +00:00
Ian Dowse
199a2380fe Add a UQ_OPEN_CLEARSTALL quirk for devices that need a clear-stall
operation when a pipe is opened, and add an entry for the ST Micro
biometric CPU.

Submitted by:	Fredrik Lindberg
MFC after:	1 week
2006-02-19 14:48:02 +00:00
Marius Strobl
9789208431 - Don't bother traversing trap frames in stack_save(). This fixes panics
when option DEBUG_LOCKS is used. Trap frames are determined by checking
  whether the caller was one of the tl0_*() or tl1_*() asm functions via
  a newly added pair of dummy symbols in exception.S which mark the begin
  and end of these functions. The tl_trap_* pair marks those in the special
  .trap section and the tl_text_* in the regular .text section. Because
  of their performance penalty db_search_symbol()/db_symbol_values() and
  linker_ddb_search_symbol()/linker_ddb_symbol_values() aren't used here
  for determining the caller, with db_search_symbol()/db_symbol_values()
  additionally not being reentrant.
- For consistency, change db_backtrace() to also use the new markers for
  determining the tl0_*() and tl1_*() asm functions instead of bcmp()'ing
  the symbol name.
- Use FBSDID in db_trace.c.

PR:			93226
Based on a patch by:	Antoine Brodin <antoine.brodin@laposte.net>
Ok'ed by:		jhb
2006-02-19 11:54:46 +00:00
Yaroslav Tykhiy
c0d157d85f For the coda5 module, CODA_COMPAT_5 is mandatory, not optional.
Without CODA_COMPAT_5, it would be equivalent to the plain coda
module.  Therefore just add -DCODA_COMPAT_5 to CFLAGS instead of
fiddling with opt_coda.h.  This is particularly important when
the module is built along with the kernel and CODA_COMPAT_5 isn't
in the kernel conf file (and so not in opt_coda.h either).

MFC after:	3 days
2006-02-19 02:43:42 +00:00
Yaroslav Tykhiy
9be0cda615 Style: Remove blank lines before EOF.
Tested by:	cvs diff -B
2006-02-18 23:49:28 +00:00
Yaroslav Tykhiy
7ad7a38277 Work around the fact that nfsclient SRCS must include
nfs_diskless.c if NFS_ROOT is in effect, e.g., present
in the kernel config file.  Otherwise the built module
won't load due to an undefined reference to nfs_setup_diskless.

MFC after:	3 days
2006-02-18 23:31:49 +00:00
Andre Oppermann
80444f8803 The sysctls kern.ipc.[max_linkhdr|max_protohdr|max_hdr|max_datalen]
can't be changed from userland.  Make them read-only and provide
descriptions.

kern.ipc.max_datalen must never be less than one byte.  Enforce this
with a panic in net_init_domain().

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-18 17:16:18 +00:00
Andre Oppermann
8e8aab7aec Remove unneeded includes and provide more accurate description
to others.

Submitted by:	garys
PR:		kern/86437
2006-02-18 17:05:00 +00:00
Andre Oppermann
da3482e0f6 Add missing TH_PUSH to the TH_FLAGS enumeration.
Submitted by:	Andre Albsmeier <Andre.Albsmeier-at-siemens.com>
PR:		kern/85203
2006-02-18 16:50:08 +00:00
Robert Watson
d8ff22ea7f Add system call auditing support for sparc64.
Submitted by:	brueffer
Obtained from:	TrustedBSD Project
2006-02-18 16:36:56 +00:00
Pawel Jakub Dawidek
3d48264f02 Inform when label disappears.
MFC after:	3 days
2006-02-18 11:24:00 +00:00
Pawel Jakub Dawidek
bdf2e45a5c Allow to use g_slice_orphan() from outside.
MFC after:	3 days
2006-02-18 11:21:17 +00:00
Pawel Jakub Dawidek
c058f51257 - Do not depend on fact that file system covers entire provider.
It won't work for file systems created with -s option.
  Use better file system verfication.
- Add myself to the copyright.

MFC after:	3 days
2006-02-18 10:59:47 +00:00
Ariff Abdullah
050519958c - Fix severe crackling after long running and abusive module load / unload by
forcing DMA alignment to default buffer size.
- Make sure DMA pointer properly aligned to avoid being truncated by caller
  which causing severe underruns and random popping (especially in 32bit
  playback / recording).
- Add AC97 inverted external amplifier quirk for Maxselect x710s
  - http://maxselect.ru/

MFC after:	1 week
2006-02-18 10:24:48 +00:00
Ariff Abdullah
fba6b23875 Fix random popping while playing in 32bit by increasing default buffer size
from 4096 to 8192.

MFC after:	1 week
2006-02-18 10:23:37 +00:00
Pawel Jakub Dawidek
17fb8ae78f This function returns nothing. 2006-02-18 03:04:26 +00:00
Pawel Jakub Dawidek
33361bb5db If provider's sector size prevents reading SBLOCKSIZE bytes return
immediatelly.
2006-02-18 03:00:49 +00:00
Max Laier
ff8e7669d6 Use shell's version of if to check if the firmware really exists in the
current directory to allow user rules to create the firmware (e.g. from a
uuencoded blob).  make's version of if is evaluated too early to catch this.

Found-by:	gallatin
2006-02-18 01:38:44 +00:00
Sam Leffler
08d7a88599 use s/w bmiss facility
MFC after:	1 week
2006-02-18 01:04:08 +00:00
Sam Leffler
e3f629dff9 stop device so we don't panic on card eject
MFC after:	1 week
2006-02-18 01:03:09 +00:00
Warner Losh
2f415ac34d These files apply to all the atmel parts that freebsd is going to run on,
so name them more generically.  If we do support the MMU-less ARM7 parts,
then we'll need to, at that time, expand the files we have.
2006-02-17 22:33:13 +00:00
Warner Losh
77017e63bb This file was obsolete when committed. Catchup and delete it. 2006-02-17 22:23:36 +00:00
Tor Egge
625e6c0af4 Expand scope of marker to reduce the number of page queue scan restarts. 2006-02-17 21:02:39 +00:00
Doug Ambrisko
c094bde40d Re-work the bus attachment somewhat. Make the rids unique for
the SMI/TCO address space.  Switch the bus space I/O to the
one specific for either the SMI or TCO space.  Re-calibrate
the tick.  Add some more device id's, 82801FBR submitted by des.
This makes it work on the platforms I've tested with.

Go ahead by:	des
2006-02-17 18:46:18 +00:00
Tor Egge
db27dcc0f0 Check return value from nonblocking call to vn_start_write(). 2006-02-17 18:22:19 +00:00
Oleg Bulyzhin
1493e8838e 1) Ignore link events for MII/GMII cards if MI auto-polling disabled. This
should fix strange link state behaviour reported for bcm5721 & bcm5704c
2) Clear bge_link flag in bge_stop()
3) Force link state check after bge_ifmedia_upd(). Otherwise we can miss link
   event if PHY changes it's state fast enough.

Tested by:	phk (bcm5704c)
Approved by:	glebius (mentor)
MFC after:	1 week
2006-02-17 14:33:35 +00:00
Andre Oppermann
ec63cb90a3 Replace the 4k fixed sized jumbo mbuf clusters with PAGE_SIZE sized
jumbo mbuf clusters.  To make the variable size clear they are named
MJUMPAGESIZE.

Having jumbo clusters with the native PAGE_SIZE is more useful than
a fixed 4k size according the device driver writers using this API.

The 9k and 16k jumbo mbuf clusters remain unchanged.

Requested by:	glebius, gallatin
Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-17 14:14:15 +00:00
Søren Schmidt
608e65bb2a Add r/w support for JMicron ATA RAID metadata.
Acknowledgement should definitly go to JMicron Technology for providing full
docs on the metadata format as the only vendor so far, big thanks from here.
2006-02-17 13:02:10 +00:00
Ruslan Ermilov
525312f7c0 Fix standalone module build.
Reported by:	Boris Samorodov
2006-02-17 10:52:59 +00:00
Gleb Smirnoff
ffbea430b8 Remove unused now field. 2006-02-17 09:42:49 +00:00
David E. O'Brien
40244cc2ca When linking make sure it succeeds. 2006-02-17 04:59:23 +00:00
Eric Anholt
14b4fdc4d6 Add support for the Intel E7205 chipset.
PR:		kern/91315
Submitted by:	Joerg Pulz <Joerg.Pulz@frm2.tum.de>
2006-02-17 01:40:46 +00:00
Tor Egge
6bd7e81d83 Rounding addr upwards to next 4M or 2M boundary in pmap_growkernel() could
cause addr to become 0, resulting in an early return without populating
the last PDE.

Reviewed by:	alc
2006-02-16 22:10:57 +00:00
Andre Oppermann
eaf80179e2 Have TCP Inflight disable itself if the RTT is below a certain
threshold.  Inflight doesn't make sense on a LAN as it has
trouble figuring out the maximal bandwidth because of the coarse
tick granularity.

The sysctl net.inet.tcp.inflight.rttthresh specifies the threshold
in milliseconds below which inflight will disengage.  It defaults
to 10ms.

Tested by:	Joao Barros <joao.barros-at-gmail.com>,
		Rich Murphey <rich-at-whiteoaklabs.com>
Sponsored by:	TCP/IP Optimization Fundraise 2005
2006-02-16 19:38:07 +00:00
Søren Schmidt
e3989d3ebf Add support for the JMicron JMB363 dual SATA + single PATA controller.
Documentation and HW kindly provided by JMicron.
2006-02-16 17:09:24 +00:00
Andre Oppermann
cf744713e8 In in_pcbconnect_setup() reduce code duplication and use ip_rtaddr()
to find the outgoing interface for this connection.

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	2 weeks
2006-02-16 15:45:28 +00:00
Andre Oppermann
a4684d742d Make sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS) generally available instead
of being private to tcp_timer.c.

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 days
2006-02-16 15:40:36 +00:00
David Xu
94f0972bec Fix a long standing race between sleep queue and thread
suspension code. When a thread A is going to sleep, it calls
sleepq_catch_signals() to detect any pending signals or thread
suspension request, if nothing happens, it returns without
holding process lock or scheduler lock, this opens a race
window which allows thread B to come in and do process
suspension work, however since A is still at running state,
thread B can do nothing to A, thread A continues, and puts
itself into actually sleeping state, but B has never seen it,
and it sits there forever until B is woken up by other threads
sometimes later(this can be very long delay or never
happen). Fix this bug by forcing sleepq_catch_signals to
return with scheduler lock held.
Fix sleepq_abort() by passing it an interrupted code, previously,
it worked as wakeup_one(), and the interruption can not be
identified correctly by sleep queue code when the sleeping
thread is resumed.
Let thread_suspend_check() returns EINTR or ERESTART, so sleep
queue no longer has to use SIGSTOP as a hack to build a return
value.

Reviewed by:	jhb
MFC after:	1 week
2006-02-15 23:52:01 +00:00
Stephan Uphoff
224409590d When the VM needs to allocated physical memory pages (for non interrupt use)
and it has not plenty of free pages it tries to free pages in the cache queue.
Unfortunately freeing a cached page requires the locking of the object that
owns the page. However in the context of allocating pages we may not be able
to lock the object and thus can only TRY to lock the object. If the locking try
fails the cache page can not be freed and is activated to move it out of the way
so that we may try to free other cache pages.

If all pages in the cache belong to objects that are currently locked the
cache queue can be emptied without freeing a single page. This scenario caused
two problems:

    1)  vm_page_alloc always failed allocation when it tried freeing pages from
        the cache queue and failed to do so. However if there are more than
        cnt.v_interrupt_free_min pages on the free list it should return pages
        when requested with priority VM_ALLOC_SYSTEM. Failure to do so can cause
        resource exhaustion deadlocks.

    2)  Threads than need to allocate pages spend a lot of time cleaning up the
        page queue without really getting anything done while the pagedaemon
         needs to work overtime to refill the cache.

This change fixes the first problem. (1)

Reviewed by:	tegge@
2006-02-15 22:29:53 +00:00
Sam Leffler
1d89d44f74 drop softc lock around copyin/copyout
MFC after:	2 weeks
2006-02-15 18:36:52 +00:00
Sam Leffler
d2f6ed153d fix build w/o AR_DEBUG
MFC after:	2 weeks
2006-02-15 18:35:09 +00:00
Sam Leffler
7a4c5ed92c improve tx/rx buf printing routines
MFC after:	2 weeks
2006-02-15 18:31:04 +00:00
Sam Leffler
9760f8aeb9 add missing bit from 1.130 2006-02-15 18:24:22 +00:00
Sam Leffler
16c8acaab5 o handle fatal errors directly instead of via the task queue
o temporarily dump some h/w state for diagnosis; this will be
  removed once some issues are resolved

MFC after:	2 weeks
2006-02-15 18:23:03 +00:00
Sam Leffler
e2815d6951 use ath_hal_gettxintrtxqs so we only process h/w tx
queues that have an interrupt pending

MFC after:	2 weeks
2006-02-15 18:17:53 +00:00
Sam Leffler
c66c48cba2 fixup comments 2006-02-15 18:15:49 +00:00