rpaulo [Sun, 25 May 2008 14:37:33 +0000 (14:37 +0000)]
MFC r1.208:
devctl_process_running(): Check for devsoftc.inuse == 1 instead of
devsoftc.async_proc != NULL because the latter might not be true
sometimes.
This way /etc/rc.suspend gets executed.
Reviwed by: njl
Submitted by: Mitsuru IWASAKI <iwasaki at jp.FreeBSD.org>
Tested also by: Andreas Wetzel <mickey242 at gmx.net>
Summary:
In some situations we were not clearing pending link state attentions.
Because of this we were not getting further interrupts for link state
changes, thus never went into iface UP state and thus could not transmit.
The only way out of this was an incoming packet generating an rx interrupt
and making us call into bge_link_upd.
What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
so we will call bge_link_upd, clear the link state attention and get
further interrupts.
While the initial version was not expected to work with all chips
the later update in rev. 1.210 is.
PR: kern/111804
Tested by: phk, scottl (initial version)
Thanks for your help to: davidch, Broadcom
kib [Sat, 24 May 2008 03:36:19 +0000 (03:36 +0000)]
MFC rev. 1.120:
Kqueue_scan() may sleep when encountered the influx knotes. On the other
hand, it may cause other threads to sleep since kqueue_scan() may mark
some knotes as infux. This could lead to the deadlock.
Before kqueue_scan() sleeps, wakeup the threads that are waiting for the
influx knotes produced by this thread.
kib [Sat, 24 May 2008 03:35:13 +0000 (03:35 +0000)]
MFC rev. 1.119:
The kqueue_close() encountering the KN_INFLUX knotes on the kq being
closed is the legitimate situation. For instance, filedescriptor with
registered events may be closed in parallel with closing the kqueue.
Properly handle the case instead of asserting that this cannot happen.
jfv [Wed, 21 May 2008 21:34:05 +0000 (21:34 +0000)]
Primary a delta to pick up the missing UNLOCK in the watchdog
code, this can cause a panic due to a recusion on the TX Lock.
Also sync up other changes in HEAD, all trivial, added PCI ID
and #ifdef's to make the driver compile on 6.3.
dwmalone [Tue, 20 May 2008 11:32:03 +0000 (11:32 +0000)]
MFC:
Dummynet has a limit of 100 slots queue size (or 1MB, if you give
the limit in bytes) hard coded into both the kernel and userland.
Make both these limits a sysctl, so it is easy to change the limit.
dwmalone [Tue, 20 May 2008 11:17:51 +0000 (11:17 +0000)]
MFC:
If we are walking the IPv6 header chain and we hit an IPPROTO_NONE
header, then don't try to pullup anything, because there is no next
header if we hit IPPROTO_NONE. Set ulp to a non-NULL value so the
search for an upper layer header terinates.
philip [Tue, 20 May 2008 10:48:26 +0000 (10:48 +0000)]
MFC: moused.c rev 1.84
moused.8 rev 1.62
Improve the virtual scrolling mechanism to make middle clicking less
difficult. Add a -L option (yet another option, indeed!) which changes
the speed of scrolling and change -U to only affect the scroll threshold.
This should make middle-clicking a much more pleasant experience.
kib [Tue, 20 May 2008 09:38:44 +0000 (09:38 +0000)]
MFC
rev. 1.126 of libexec/rtld-elf/rtld.c
rev. 1.5 of libexec/rtld-elf/rtld_lock.c
rev. 1.3 of libexec/rtld-elf/rtld_lock.h
Fix the problem with the C++ exception handling for the multithreaded
programs.
From the PR description:
The gcc runtime's _Unwind_Find_FDE function, invoked during exception
handling's stack unwinding, is not safe to execute from within multiple
threads. FreeBSD' s dl_iterate_phdr() however permits multiple threads
to pass through it though. The result is surprisingly reliable infinite
looping of one or more threads if they just happen to be unwinding at
the same time.
Introduce the new lock that is write locked around the dl_iterate_pdr,
thus providing required exclusion for the stack unwinders.
PR: threads/123062
Submitted by: Andy Newman <an at atrn org>
Reviewed by: kan
On sparc64 machines with multiple host-PCI-bridges these bridges
have separate configuration spaces so by definition they implement
different PCI domains. Thus change psycho(4) to use PCI domains
instead of reenumerating all PCI busses so they have globally unique
bus numbers and drop support for reenumerating busses in the OFW PCI
code.
emax [Mon, 19 May 2008 16:46:42 +0000 (16:46 +0000)]
MFC:
Make -t <tty> optional in server mode. If not specified use stdin/stdout.
Document this. Do not require channel number in server mode. If not
specified - bind to ''wildcard'' channel zero. Real channel number will
be obtained automatically and registered with local sdpd(8). While I'm
here fix serial port service registration.
Submitted by: luigi
Tested by: Helge Oldach <freebsd-bluetooth at oldach dot net>
kib [Mon, 19 May 2008 11:43:36 +0000 (11:43 +0000)]
MFC
rev. 1.15 of lib/libc/gen/readdir.c
rev. 1.11 of lib/libc/gen/telldir.c
rev. 1.3 of lib/libc/gen/telldir.h
Do not read away the target directory entry when encountering deleted
files after a seekdir().
The seekdir shall set the position for the next readdir operation.
When the _readdir_unlocked() encounters deleted entry, dd_loc is
already advanced. Continuing the loop leads to premature read of
the target entry.
Submitted by: Marc Balmer <mbalmer at openbsd org>
Obtained from: OpenBSD
flz [Mon, 19 May 2008 09:21:24 +0000 (09:21 +0000)]
MFC: Don't require a configuration file. Ntpd will be perfectly happy if there's
none or if the file doesn't exist (there's no ntp.conf in the base install).
kib [Sun, 18 May 2008 05:05:33 +0000 (05:05 +0000)]
MFC rev. 1.724:
Only return 1 from sync_vnode() in cases where the vnode is still at the
head of the sync list. This prevents sched_sync() from re-queueing a
vnode which may have been freed already.
mav [Sat, 17 May 2008 08:43:50 +0000 (08:43 +0000)]
MFC rev. 1.158
Use separate UMA zone for data items allocation. It is a partial
rev. 1.149 rework.
It allows to save several percents of CPU time on SMP by using UMA's
internal per-CPU allocation limits instead of own global variable
each time updated with atomics.
Also it restores NG_WAITOK flag processing.
remko [Sat, 17 May 2008 01:29:44 +0000 (01:29 +0000)]
MFC rev 1.32 and rev 1.33 termios.4
The first of thirteen patches by Ed that resolves a documentation
issue in termios.4, ttydefaults.h does not exist in /usr/include
but in /usr/include/sys.
MFC after: 3 days
Submitted by: Ed Schouten (ed at 80386 dot nl)
attilio [Fri, 16 May 2008 19:44:50 +0000 (19:44 +0000)]
MFC ver. 1.20:
Currently, smb_co_init() uses the same lock name for the mutex interlock
and the lockmgr. Use different names in order to avoid WITNESS conflicts.
scf [Fri, 16 May 2008 02:07:57 +0000 (02:07 +0000)]
MFC:
Add four utility functions related to struct grp processing modeled in-part
after similar calls related to struct pwd in libutil/pw_util.c:
- gr_equal()
Perform a deep comparison of two struct grp's. It does a thorough, yet
unoptimized comparison of all the members regardless of order.
- gr_make()
Create a string (see group(5)) from a struct grp.
- gr_dup()
Duplicate a struct grp. Returns a value that is a single contiguous
block of memory.
- gr_scan()
Create a struct grp from a string (as produced by gr_make()).
marius [Thu, 15 May 2008 20:21:30 +0000 (20:21 +0000)]
MFC: 1.43
- Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
for UPA it should have fulfilled its purpose by now and Fireplane-
and JBus-based machines are way to messy in organization to implement
something equivalent.
- Fix a bunch of style(9) bugs.
brooks [Thu, 15 May 2008 01:53:46 +0000 (01:53 +0000)]
MFC: Add very limited support for the isc-dhclient. It will almostly certaintly
only work if there's just one interface doing dhcp. This version implements
the same logic as the version in the PR, but uses pgrep to be less verbose.
- Use the name returned by device_get_nameunit(9) for the name of the
counter-timer timecounter so the associated SYSCTL nodes don't clash on
machines having multiple U2P and U2S bridges as well as establishing a
clear mapping between these bridges and their timecounter device.
- Don't bother setting up a "nice" name for the IOMMU, just use the name
returned by device_get_nameunit(9), too.
- Fix some minor style(9) bugs.
- Use __FBSDID in counter.c
marius [Wed, 14 May 2008 21:07:25 +0000 (21:07 +0000)]
MFC: 1.208
- Use more appropriate maxsize, nsegments and maxsegsize parameters
when creating the parent bus DMA tag. While at it correct the style
and a nearby comment.
- Take advantage of m_collapse(9) for performance reasons.
gad [Tue, 13 May 2008 21:46:50 +0000 (21:46 +0000)]
MFC *: Add the '-u name' option to the env command, which will completely
unset the given variable name (removing it from the environment, instead
of just setting it to a null value).
mtm [Mon, 12 May 2008 07:37:40 +0000 (07:37 +0000)]
MFC:
o Change the warning dialog for the 'W' command in both the label
and partition editors to reflect the fact that this is a stand-alone
application, not sysinstall(8).
o Change an instance of sade(8) refering to itself as sysinstall(8) in
a confirmation dialog.
dfr [Sun, 11 May 2008 08:53:55 +0000 (08:53 +0000)]
MFC kern_lockf.c revision 1.64:
When blocking on an F_FLOCK style lock request which is upgrading a
shared lock to exclusive, drop the shared lock before deadlock
detection.
rwatson [Sat, 10 May 2008 18:43:11 +0000 (18:43 +0000)]
Merge MAkefile:1.2, ddb.8:1.5, ddb.c:1.4, ddb.h:1.2, ddb_capture.c:1.1
from HEAD to RELENG_7:
Add "ddb capture print" and "ddb capture status" commands do ddb(8),
alowing the DDB output capture buffer to be easily extracted from
user space. Both of these commands include -M/-N arguments, allowing
them to be used with kernel crash dumps (or /dev/mem).
This makes it easier to use DDB scripting and output capture with
minidumps or full dumps rather than with text dumps, allowing DDB
output (scripted or otherwise) to be easily extracted from a crash
dump.
rwatson [Sat, 10 May 2008 17:21:20 +0000 (17:21 +0000)]
Merge uipc_syscalls.c:1.271 from HEAD to RELENG_7:
When writing trailers in sendfile(2), don't call kern_writev()
while holding the socket buffer lock. These leads to an
immediate panic due to recursing the socket buffer lock. This
bug was introduced in uipc_syscalls.c:1.240, but masked by
another bug until that was fixed in uipc_syscalls.c:1.269.
Note that the current fix isn't perfect, but better than
panicking: normally we guarantee that simultaneous invocations
of a system call to write on a stream socket won't be
interlaced, which is ensured by use of the socket buffer sleep
lock. This is guaranteed for the sendfile headers, but not
trailers. In practice, this is likely not a problem, but
should be fixed.
kientzle [Sat, 10 May 2008 07:05:14 +0000 (07:05 +0000)]
MFC: Eliminate a bunch of unused fields from the read structure.
Most are write-specific values that are leftovers from when read and
write used a shared structure.
kientzle [Sat, 10 May 2008 06:57:04 +0000 (06:57 +0000)]
MFC: Set the archive format code and name in the generic portion
of the archive structure, not the write-specific portion.
(This is a bungle from back when the generic and write-specific portions
were first separated and the write-specific part accidentally ended
up with copies of some of the generic fields.) In particular,
archive_format() and archive_format_name() now work correctly
on write handles.
kientzle [Sat, 10 May 2008 06:49:13 +0000 (06:49 +0000)]
MFC: Stop using ARCHIVE_DEFAULT_BYTES_PER_BLOCK to set the default
block size. The default setting here is arbitrary and shouldn't be
published. Someday, we should be smarter about the default here.
kientzle [Sat, 10 May 2008 06:45:23 +0000 (06:45 +0000)]
MFC 1.25: Portability: on platforms that don't have timegm, don't have
tm_gmtoff and can't reset the timezone to force mktime to use UTC,
just give up and use unadorned mktime().
kientzle [Sat, 10 May 2008 06:42:59 +0000 (06:42 +0000)]
MFC 1.2: Minor portability improvement. Not every platform
has S_IXUSR, S_IXGRP, S_IXOTH defines, but the values never change,
so just hardcode the constants.
rwatson [Fri, 9 May 2008 20:39:48 +0000 (20:39 +0000)]
Merge if_loop.c:1.115,1.116 from HEAD to RELENG_7:
Coerce if_loop.c in the general direction of style(9):
- Use ANSI function declarations
- Remove use of 'register' keyword
- Prefer style(9) return parens, white space
- Trim trailing whitespace at ends of lines.
jhb [Fri, 9 May 2008 18:41:36 +0000 (18:41 +0000)]
MFC: Rework how kgdb manages kernel and vmcore files to be a bit more
gdb-ish. Specifically, you can now use the 'file' and 'core' commands.
Also, the kernel module stuff now works for remote targets.