]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoRemove the advertising clause from UCB copyrighted files in usr.sbin. This
joel [Sat, 11 Dec 2010 09:38:12 +0000 (09:38 +0000)]
Remove the advertising clause from UCB copyrighted files in usr.sbin.  This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

13 years agoFix race in devfs by using LIST_FIRST() instead of
hselasky [Sat, 11 Dec 2010 08:44:10 +0000 (08:44 +0000)]
Fix race in devfs by using LIST_FIRST() instead of
LIST_FOREACH_SAFE() when freeing the devfs private
data entries.

Reviewed by: kib
MFC after: 3 days
Approved by: thompsa (mentor)

13 years agoRemove the advertising clause from UCB copyrighted files in usr.bin. This
joel [Sat, 11 Dec 2010 08:32:16 +0000 (08:32 +0000)]
Remove the advertising clause from UCB copyrighted files in usr.bin.  This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson

13 years agoThe use of snprintf() to append to a buffer is not valid according to C99
kevlo [Sat, 11 Dec 2010 08:07:21 +0000 (08:07 +0000)]
The use of snprintf() to append to a buffer is not valid according to C99

13 years agoFix setting LUN numbers in the mps(4) driver.
ken [Sat, 11 Dec 2010 00:36:35 +0000 (00:36 +0000)]
Fix setting LUN numbers in the mps(4) driver.

Prior to this change, the addressing method wasn't getting set, and
so the LUN field could be set incorrectly in some instances.

This fix should allow for LUN numbers up to 16777215 (and return an error
for anything larger, which wouldn't fit into the flat addressing model).

Submitted by: scottl (in part)

13 years agoDerive the XENHVM kernel from GENERIC, adding only the options required
rwatson [Fri, 10 Dec 2010 22:22:01 +0000 (22:22 +0000)]
Derive the XENHVM kernel from GENERIC, adding only the options required
to support PV drivers (such as xenpci), and non-adptive locking (along
with a comment about why).

This change eliminates the synchronisation problem between GENERIC and
XENHVM, which had become severely rotted in HEAD, and in 8-STABLE
included non-production kernel debugging features such as WITNESS.

However, it comes at the cost of enabling devices and options that may
not be present under Xen (such as random ethernet cards).  For now, opt
for a simpler kernel configuration file rather than using nooptions/
nodevice to enumerate and eliminate them.  This leads to a somewhat
larger XENHVM kernel.

This is an MFC candidate for 8-STABLE before 8.2, in order to provide
a production-worthy XENHVM kernel configuration for amd64.

Discussed with: gibbs, cperciva
Reported by: Piete Brooks <Piete.Brooks at cl.cam.ac.uk>
Sponsored by: DARPA, AFRL
MFC after: 3 days

13 years agoImplement more of __ibsta: END and SRQI status bits (taken out of the
joerg [Fri, 10 Dec 2010 22:20:11 +0000 (22:20 +0000)]
Implement more of __ibsta: END and SRQI status bits (taken out of the
uPD7210 IRQ status).

MFC after: 1 week

13 years agoFix an event handling bug with the mps(4) driver.
ken [Fri, 10 Dec 2010 21:45:10 +0000 (21:45 +0000)]
Fix an event handling bug with the mps(4) driver.

This bug manifested itself after repeated device arrivals and
departures.  The root of the problem was that the last entry in the
reply array wasn't initialized/allocated.  So every time we got
around to that event, we had a bogus address.

There were a couple more problems with the code that are also fixed:

 - The reply mechanism was being treated as sequential (indexed by
   sc->replycurindex) even though the spec says that the driver
   should use the ReplyFrameAddress field of the post queue
   descriptor to figure out where the reply is.  There is no
   guarantee that the reply descriptors will be used in sequential
   order.

 - The second word of the reply post queue descriptor wasn't being
   checked in mps_intr_locked() to make sure that it wasn't
   0xffffffff.  So the driver could potentially come across a
   partially DMAed descriptor.

 - The number of replies allocated was one less than the actual
   size of the queue.  Instead, it was the size of the number of
   replies that can be used at one time.  (Which is one less than
   the size of the queue.)

mps.c: When initializing the entries in the reply free
queue, make sure we initialize the full number that
we tell the chip we have (sc->fqdepth), not the
number that can be used at any one time (sc->num_replies).

When allocating replies, make sure we allocate the
number of replies that we've told the chip exist,
not just the number that can be used simultaneously.

Use the ReplyFrameAddress field of the post queue
descriptor to figure out which reply is being
referenced.  This is what the spec says to do, and
the spec doesn't guarantee that the replies will be
used in order.

Put a check in to verify that the reply address passed
back from the card is valid.  (Panic if it isn't, we'll
panic when we try to deference the reply pointer in any
case.)

In mps_intr_locked(), verify that the second word of the
post queue descriptor is not 0xffffffff in addition to
verifying that the unused flag is not set, so we can
make sure we didn't get a partially DMAed descriptor.

Remove references to sc->replycurindex, it isn't needed
now.

mpsvar.h: Remove replycurindex from the softc, it isn't needed now.

Reviewed by: scottl

13 years agoRemove unecessary and clearly wrong usage of atomic(9).
yongari [Fri, 10 Dec 2010 21:43:20 +0000 (21:43 +0000)]
Remove unecessary and clearly wrong usage of atomic(9).

Reported by: avg, jhb, attilio

13 years agoFix a few issues related to the XPT_GDEV_ADVINFO CCB.
ken [Fri, 10 Dec 2010 21:38:51 +0000 (21:38 +0000)]
Fix a few issues related to the XPT_GDEV_ADVINFO CCB.

camcontrol.c: In buildbusdevlist(), don't attempt to get call
getdevid() for an unconfigured device, even when the
verbose flag is set.  The cam_open_btl() call will almost
certainly fail.

Probe for the buffer size when issuing the XPT_GDEV_ADVINFO
CCB.  Probing for the buffer size first helps us avoid
allocating the maximum buffer size when it really may not
be necessary.  This also helps avoid errors from
cam_periph_mapmem() if we attempt to map more than MAXPHYS.

cam_periph.c: In cam_periph_mapmem(), if the XPT_GDEV_ADVINFO CCB
shows a bufsiz of 0, we don't have anything to map,
so just return.

Also, set the maximum mapping size to MAXPHYS
instead of DFLTPHYS for XPT_GDEV_ADVINFO CCBs,
since they don't actually go down to the hardware.

scsi_pass.c: Don't bother mapping the buffer in XPT_GDEV_ADVINFO
CCBs if bufsiz is 0.

13 years agoOn the Xserve G5 we find the LM75 instead of the DS1775. The core
andreast [Fri, 10 Dec 2010 20:27:50 +0000 (20:27 +0000)]
On the Xserve G5 we find the LM75 instead of the DS1775. The core
functionality is the same, a difference is that the DS1775 has a better
precision than the LM75. But we do not use it in our setup. Make the
LM75 work the same as the DS1775.

Fix a typo in device_set_desc.

Tested by: Paul Mather <paul at gromit dlib vt edu>

Approved by: nwhitehorn (mentor)

13 years agoUse SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io.
tijl [Fri, 10 Dec 2010 15:05:49 +0000 (15:05 +0000)]
Use SYS_RES_IOPORT instead of PCIM_CMD_PORTEN when calling pci_enable_io.

Approved by: kib (mentor)

13 years agoFix __retval vs. retval confusion: retval is meant to store the (userland)
joerg [Fri, 10 Dec 2010 14:04:41 +0000 (14:04 +0000)]
Fix __retval vs. retval confusion: retval is meant to store the (userland)
pointer where data is to be returned by ibask() (currently unimplemented),
while __retval holds the value returned by the libgpib ibfoo() functions.

The confusion resulted in the ibfoo() functions returning an uninitialized
value except in situations where the GPIB activity has been terminated
abnormally.

MFC after: 3 days

13 years agoAdd a .note.ABI-tag section to ia64 startup files by linking crtbrand.c
tijl [Fri, 10 Dec 2010 08:53:06 +0000 (08:53 +0000)]
Add a .note.ABI-tag section to ia64 startup files by linking crtbrand.c
in crt1.o. On other architectures crtbrand.c is included from crt1.c,
but that's not a C source code file on ia64. Instead it is compiled
separately and included in crt1.o using incremental linking.

Tested by: dim (previous version)
Approved by: kib (mentor)

13 years agoRefactor fork1() to make it easier to follow. No functional changes.
trasz [Fri, 10 Dec 2010 08:33:56 +0000 (08:33 +0000)]
Refactor fork1() to make it easier to follow.  No functional changes.

Reviewed by: kib (earlier version)
Tested by: pho

13 years agoDocument this driver supports the converter I just bought.
ru [Fri, 10 Dec 2010 07:55:38 +0000 (07:55 +0000)]
Document this driver supports the converter I just bought.

13 years agoBring in the change from OpenBSD's 1.14:
dougb [Thu, 9 Dec 2010 23:57:23 +0000 (23:57 +0000)]
Bring in the change from OpenBSD's 1.14:

"synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually
exclusive; while here, slightly improve spacing in the source code
so it fits on a 80-column display again.

diff greatly improved by martynas@"

Obtained from: sobrado@OpenBSD.org

13 years agoDon't tie ct_debug to bootverbose. Provide a sysctl to turn it on or off.
bz [Thu, 9 Dec 2010 22:02:48 +0000 (22:02 +0000)]
Don't tie ct_debug to bootverbose.  Provide a sysctl to turn it on or off.
Switch the default to always off.

Reviewed by: kib

13 years agoLet all .c and .S files under lib/csu consistently use the __FBSDID()
dim [Thu, 9 Dec 2010 21:31:21 +0000 (21:31 +0000)]
Let all .c and .S files under lib/csu consistently use the __FBSDID()
macro for identification, instead of several different hand-rolled
variants (plain .ident, .ascii, etc).

13 years agoRemove AMD Family 0Fh, Model 6Bh, Stepping 2 from the list of P-state
jkim [Thu, 9 Dec 2010 21:29:36 +0000 (21:29 +0000)]
Remove AMD Family 0Fh, Model 6Bh, Stepping 2 from the list of P-state
invariant CPUs.  I do not believe this model is P-state invariant any more.
Maybe cpufreq(4) was broken at the time of commit. :-(

13 years agoFix a long standing (from the original 4.4BSD lite sources) race between
mlaier [Thu, 9 Dec 2010 21:02:22 +0000 (21:02 +0000)]
Fix a long standing (from the original 4.4BSD lite sources) race between
vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page
missing" panics.  While faulting in pages for a map entry that is being
wired down, mark the containing map as busy.  In vmspace_fork wait until the
map is unbusy, before we try to copy the entries.

Reviewed by: kib
MFC after: 5 days
Sponsored by: Isilon Systems, Inc.

13 years agoWhen reopening a stream backed by an open file descriptor, do not close
jhb [Thu, 9 Dec 2010 20:28:30 +0000 (20:28 +0000)]
When reopening a stream backed by an open file descriptor, do not close
the existing file descriptor.  Instead, let dup2() atomically close the
old file descriptor when assigning the newly opened file to the same
descriptor.  This closes a race in a multithreaded application where a
concurrent open() could allocate the existing file descriptor in between
the calls to close() and dup2().

PR: threads/79887
Submitted by: Dmitrij Tejblum  tejblum of yandex-team.ru
Reviewed by: davidxu
MFC after: 1 week

13 years agoWhen r207410 eliminated the acquisition and release of the page queues
alc [Thu, 9 Dec 2010 20:16:00 +0000 (20:16 +0000)]
When r207410 eliminated the acquisition and release of the page queues
lock from pmap_extract_and_hold(), it didn't take into account that
pmap_pte_quick() sometimes requires the page queues lock to be held.
This change reimplements pmap_extract_and_hold() such that it no
longer uses pmap_pte_quick(), and thus never requires the page queues
lock.

For consistency, adopt the same idiom as used by the new
implementation of pmap_extract_and_hold() in pmap_extract() and
pmap_mincore().  It also happens to make these functions shorter.

Fix a style error in pmap_pte().

Reviewed by: kib@

13 years agoDisable attempts to establish a callback connection from the
rmacklem [Thu, 9 Dec 2010 19:02:23 +0000 (19:02 +0000)]
Disable attempts to establish a callback connection from the
experimental NFSv4 server to a NFSv4 client when delegations are not
being issued, even if the client advertises a callback path.
This avoids a problem where a Linux client advertises a
callback path that doesn't work, due to a firewall, and then
times out an Open attempt before the FreeBSD server gives up
its callback connection attempt. (Suggested by
drb at karlov.mff.cuni.cz to fix the Linux client problem that
he reported on the fs-stable mailing list.)
The server should probably have
a 1sec timeout on callback connection attempts when there are
no delegations issued to the client, but that patch will require
changes to the krpc and this serves as a work around until then.

Tested by: drb at karlov.mff.cuni.cz
MFC after: 5 days

13 years agoFix compilation when DEBUG option is enabled.
jchandra [Thu, 9 Dec 2010 12:30:13 +0000 (12:30 +0000)]
Fix compilation when DEBUG option is enabled.

- remove unused code in mips/rmi/xlr_pci.c
- remove unused variable in mips/rmi/dev/nlge/if_nlge.c
- fix reference to old function in mips/mips/pmap.c

Reported by: Prabhath Raman (prabhath at netlogicmicro com)

13 years agoUnbreak "make installworld" w/ DESTDIR specified
syrinx [Thu, 9 Dec 2010 12:25:45 +0000 (12:25 +0000)]
Unbreak "make installworld" w/ DESTDIR specified

PR : kern/152939

13 years agoBuild sade on amd64 as well as i386 and sparc64.
brucec [Thu, 9 Dec 2010 11:37:40 +0000 (11:37 +0000)]
Build sade on amd64 as well as i386 and sparc64.

13 years agoClosing fd when it's done
kevlo [Thu, 9 Dec 2010 08:36:23 +0000 (08:36 +0000)]
Closing fd when it's done

Reviewed by: sbruno

13 years ago- dump_avail layout should be sequence of [start, end)
gonzo [Thu, 9 Dec 2010 07:47:40 +0000 (07:47 +0000)]
- dump_avail layout should be sequence of [start, end)
    pairs, not <start, size>.

Spotted by: alc@

13 years agoRevert the vm/vm_page.c change in r216317.
jchandra [Thu, 9 Dec 2010 07:39:06 +0000 (07:39 +0000)]
Revert the vm/vm_page.c change in r216317.

This adds back changes in r216141, which was reverted by the above
check in.

13 years ago- Populate dump_avail with proper values from phys_avail
gonzo [Thu, 9 Dec 2010 07:01:03 +0000 (07:01 +0000)]
- Populate dump_avail with proper values from phys_avail

13 years agoswi_vm() for mips.
jchandra [Thu, 9 Dec 2010 06:54:06 +0000 (06:54 +0000)]
swi_vm() for mips.

13 years agoReplace i386/i386/busdma_machdep.c and amd64/amd64/busdma_machdep.c
cperciva [Thu, 9 Dec 2010 06:41:50 +0000 (06:41 +0000)]
Replace i386/i386/busdma_machdep.c and amd64/amd64/busdma_machdep.c
(which are identical) with a single x86/x86/busdma_machdep.c.

13 years agoUMA_MD_SMALL_ALLOC for mips.
jchandra [Thu, 9 Dec 2010 06:34:28 +0000 (06:34 +0000)]
UMA_MD_SMALL_ALLOC for mips.

Implement uma_small_alloc() and uma_small_free() for mips that allocates
pages from direct mapped memory. Uses the same mechanism as the page table
page allocator, so that we allocate from KSEG0 in 32 bit, and from XKPHYS
on 64 bit.

Reviewed by: alc, jmallett

13 years agoMFp4:
davidxu [Thu, 9 Dec 2010 05:16:20 +0000 (05:16 +0000)]
MFp4:
The unit number allocator reuses ID too fast, this may hide bugs in
other code, add a ring buffer to delay freeing a thread ID.

13 years agoMFp4:
davidxu [Thu, 9 Dec 2010 02:42:02 +0000 (02:42 +0000)]
MFp4:
It is possible a lower priority thread lending priority to higher priority
thread, in old code, it is ignored, however the lending should always be
recorded, add field td_lend_user_pri to fix the problem, if a thread does
not have borrowed priority, its value is PRI_MAX.

MFC after: 1 week

13 years agoDo not subtract 0.5% from estimated frequency if DELAY(9) is driven by TSC.
jkim [Wed, 8 Dec 2010 23:40:41 +0000 (23:40 +0000)]
Do not subtract 0.5% from estimated frequency if DELAY(9) is driven by TSC.
Remove a confusing comment about converting to MHz as we never did.

13 years agoprintf: Test that the "--" option terminator works.
jilles [Wed, 8 Dec 2010 22:54:18 +0000 (22:54 +0000)]
printf: Test that the "--" option terminator works.

13 years agoprintf: Remove support for building as a csh builtin.
jilles [Wed, 8 Dec 2010 22:13:27 +0000 (22:13 +0000)]
printf: Remove support for building as a csh builtin.

The #define BUILTIN was for building as a csh (not tcsh) builtin.
Given that csh was replaced by tcsh years ago there is no point in keeping
this.

The #define SHELL is for building as an sh builtin and is in active use.

This commit does not change the /bin/sh and /usr/bin/printf binaries.

13 years agoAdd IDs of HighPoint RocketRAID 62x cards (Marvell 88SE9128 chips).
mav [Wed, 8 Dec 2010 20:35:20 +0000 (20:35 +0000)]
Add IDs of HighPoint RocketRAID 62x cards (Marvell 88SE9128 chips).

PR: kern/152926
Submitted by: Mike Tancsa <mike@sentex.net>
MFC after: 1 week

13 years agoOn amd64, we have (since r1.72, in December 2005) MAX_BPAGES=8192,
cperciva [Wed, 8 Dec 2010 20:20:10 +0000 (20:20 +0000)]
On amd64, we have (since r1.72, in December 2005) MAX_BPAGES=8192,
while on i386 we have MAX_BPAGES=512.  Implement this difference via
'#ifdef __i386__'.

With this commit, the i386 and amd64 busdma_machdep.c files become
identical; they will soon be replaced by a single file under sys/x86.

13 years agoMFi386 r1.94: If XEN, make pmap_kextract = pmap_kextract_ma. This is a
cperciva [Wed, 8 Dec 2010 19:52:04 +0000 (19:52 +0000)]
MFi386 r1.94: If XEN, make pmap_kextract = pmap_kextract_ma.  This is a
no-op currently, since FreeBSD/amd64 doesn't have (paravirtualized) Xen
support, but if/when that support is ever added we'll want this, and
until then it's harmless.

13 years agoMFi386 r1.81, r1.82, r1.84: Reorganize code to reduce cache pressure and
cperciva [Wed, 8 Dec 2010 19:42:21 +0000 (19:42 +0000)]
MFi386 r1.81, r1.82, r1.84: Reorganize code to reduce cache pressure and
branch mispredictions.

No objections from: scottl

13 years agoFix typos.
syrinx [Wed, 8 Dec 2010 17:34:07 +0000 (17:34 +0000)]
Fix typos.

13 years agoAdd (disabled) sample configurations needed to enable the snmp_usm and
syrinx [Wed, 8 Dec 2010 17:27:59 +0000 (17:27 +0000)]
Add (disabled) sample configurations needed to enable the snmp_usm and
snmp_vacm modules and minimal user/view configurations needed to for
the modules to work properly.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    philip@ (mostly)
Approved by:    philip@

13 years agoAdd a forgotten file from r216294 and unbreak the build.
syrinx [Wed, 8 Dec 2010 15:52:06 +0000 (15:52 +0000)]
Add a forgotten file from r216294 and unbreak the build.

Sponsored by: The FreeBSD Foundation
Reviewed by: philip@ (mostly)
Approved by: philip@

13 years agoUse convenience macro for minimum and maximum value capping when
attilio [Wed, 8 Dec 2010 15:32:54 +0000 (15:32 +0000)]
Use convenience macro for minimum and maximum value capping when
re-arming the watchdog timeout.

Sponsored by: Sandvine Incorporated
Submitted by: Mark Johnston <mjohnston at sandvine dot com>
Reviewed by: des
MFC after: 10 days

13 years ago- Fix array bounds checking. [1]
glebius [Wed, 8 Dec 2010 15:12:37 +0000 (15:12 +0000)]
- Fix array bounds checking. [1]
- Add message length checking.

PR: 151664 [1]
Submitted by: Alexey Illarionov <littlesavage rambler.ru> [1]
Reviewed by: yar

13 years agoAdd RTM_IEEE80211 to array of route message descriptions.
glebius [Wed, 8 Dec 2010 15:10:27 +0000 (15:10 +0000)]
Add RTM_IEEE80211 to array of route message descriptions.

PR: 151664
Submitted by: Alexey Illarionov <littlesavage rambler.ru>

13 years agoAdd bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system.
syrinx [Wed, 8 Dec 2010 14:30:25 +0000 (14:30 +0000)]
Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system.

Sponsored by:   The FreeBSD Foundation (the SNMPv3 bits), Google Summer of Code 2005
Reviewed by:    philip@ (mostly), bz@ (earlier version based on p4 ch124545)
Approved by:    philip@

13 years agoIn bsnmpd(1) add support for SNMPv3 message processing model, including message authe...
syrinx [Wed, 8 Dec 2010 13:51:38 +0000 (13:51 +0000)]
In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415).

Sponsored by: The FreeBSD Foundation
Reviewed by: philip@ (mostly)
Approved by: philip@

13 years agoPrint message with information about updating the boot code if a new
mm [Wed, 8 Dec 2010 13:51:25 +0000 (13:51 +0000)]
Print message with information about updating the boot code if a new
vdev is attached to a root pool (e.g. when creating a mirrored boot pool).

Reviewed by: pav
Approved by: delphij (mentor)
MFC after: 3 days

13 years agoClose fd in initattr() and showattr().
kevlo [Wed, 8 Dec 2010 10:27:07 +0000 (10:27 +0000)]
Close fd in initattr() and showattr().

Reviewed by: rwatson

13 years agoDo not print OpenSolaris hint to use (non-existing) installgrub(1) command
mm [Wed, 8 Dec 2010 08:57:37 +0000 (08:57 +0000)]
Do not print OpenSolaris hint to use (non-existing) installgrub(1) command
if creating a mirror by attaching a new vdev to a root pool.

Reported by: James R. Van Artsdalen (on freebsd-fs@freebsd.org)
Approved by: delphij (mentor)
MFC after: 3 days

13 years agoFix a typo.
hrs [Wed, 8 Dec 2010 07:10:25 +0000 (07:10 +0000)]
Fix a typo.

Submitted by: Garrett Cooper

13 years agoClosing file descriptors when it's done
kevlo [Wed, 8 Dec 2010 01:35:19 +0000 (01:35 +0000)]
Closing file descriptors when it's done

Reviewed by: np

13 years agor184610 changed the way how TX frames are handled on AX88178 and
yongari [Wed, 8 Dec 2010 01:24:05 +0000 (01:24 +0000)]
r184610 changed the way how TX frames are handled on AX88178 and
AX88772 controllers. ASIX added a new feature for AX88178/AX88772
controllers which allows combining multiple TX frames into a single
big frame. This was to overcome one of USB limitation where it
can't generate more than 8k interrupts/sec which in turn means USB
ethernet controllers can not send more than 8k packets per second.
Using ASIX's feature greatly enhanced TX performance(more than 3~4
times) compared to 7.x driver. However it seems r184610 removed
boundary checking for buffered frames which in turn caused
instability issues under certain conditions. In addition, using
ASIX's feature triggered another issue which made USB controller
hang under certain conditions. Restarting ethernet controller
didn't help under this hang condition and unplugging and replugging
the controller was the only solution. I believe there is a silicon
bug in TX frame combining feature on AX88178/AX88772 controllers.

To address these issues, reintroduce the boundary checking for both
AX88178 and AX88772 after copying a frame to USB buffer and do not
use ASIX's multiple frame combining feature. Instead, use USB
controller's multi-frame transmit capability to enhance TX
performance as suggested by Hans[1].
This should fix a long standing axe(4) instability issues reported
on AX88772 and AX88178 controllers. While I'm here remove
unnecessary TX frame length check since upper stack always
guarantee the size of a frame to be less than MCLBYTES.

Special thanks to Derrick Brashear who tried numerous patches
during last 4 months and waited real fix with patience. Without
this enthusiastic support, patience and H/W donation I couldn't fix
it since I was not able to trigger the issue on my box.

Suggested by: hselasky [1]
Tested by: Derrick Brashear (shadow <> gmail dot com>
H/W donated by: Derrick Brashear (shadow <> gmail dot com>
PR: usb/140883

13 years agoMerge sys/amd64/amd64/tsc.c and sys/i386/i386/tsc.c and move to sys/x86/x86.
jkim [Wed, 8 Dec 2010 00:09:24 +0000 (00:09 +0000)]
Merge sys/amd64/amd64/tsc.c and sys/i386/i386/tsc.c and move to sys/x86/x86.

Discussed with: avg

13 years agoAdd myself to calendar.freebsd and committers-ports.dot
flo [Tue, 7 Dec 2010 23:56:51 +0000 (23:56 +0000)]
Add myself to calendar.freebsd and committers-ports.dot

Approved by: fjoe (mentor)

13 years agoPostpone the unmasking of event channels (aka. interrupts) until after
cperciva [Tue, 7 Dec 2010 23:33:20 +0000 (23:33 +0000)]
Postpone the unmasking of event channels (aka. interrupts) until after
the interrupt handlers have been registered.  NULL isn't a very good
interrupt handler.

13 years agoUse int for 'tsc_present' instead of u_int. It is just a boolean.
jkim [Tue, 7 Dec 2010 23:19:49 +0000 (23:19 +0000)]
Use int for 'tsc_present' instead of u_int.  It is just a boolean.

13 years agoLoosen the locking in nd6-free() again after r216022 to avoid
bz [Tue, 7 Dec 2010 22:43:29 +0000 (22:43 +0000)]
Loosen the locking in nd6-free() again after r216022 to avoid
a LOR and a recursed lock.

Reported by: delphij
Tested by: delphij
PR: kern/148857
MFC After: 3 days

13 years agoRemove stale comments about P-state invariant TSC and fix style(9) nits.
jkim [Tue, 7 Dec 2010 22:43:25 +0000 (22:43 +0000)]
Remove stale comments about P-state invariant TSC and fix style(9) nits.

13 years agoDo not register a event handler for CPU freqency changes when it is found
jkim [Tue, 7 Dec 2010 22:34:51 +0000 (22:34 +0000)]
Do not register a event handler for CPU freqency changes when it is found
P-state invariant.  This is continuation of r216274.

13 years agoNow the P-state invariant TSC is probed early enough, do not register event
jkim [Tue, 7 Dec 2010 22:23:26 +0000 (22:23 +0000)]
Now the P-state invariant TSC is probed early enough, do not register event
handlers for CPU freqency changes when it is found P-state invariant.
Adjust a comment about non-existent tsc_freq_max() while I am here.

13 years agoProbe P-state invariant TSC from rightful place.
jkim [Tue, 7 Dec 2010 22:12:02 +0000 (22:12 +0000)]
Probe P-state invariant TSC from rightful place.

13 years agoDon't warn if a partition appears not to be aligned on a track boundary.
brucec [Tue, 7 Dec 2010 20:46:11 +0000 (20:46 +0000)]
Don't warn if a partition appears not to be aligned on a track boundary.
Modern disks use LBA and create a fake CHS geometry that doesn't have any
relation to the on-disk layout of data.

13 years agoAdds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen through
weongyo [Tue, 7 Dec 2010 20:31:04 +0000 (20:31 +0000)]
Adds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen through
ioctl(2).

13 years agoIntroduces IFF_CANTCONFIG interface flag to point that the interface
weongyo [Tue, 7 Dec 2010 20:23:47 +0000 (20:23 +0000)]
Introduces IFF_CANTCONFIG interface flag to point that the interface
isn't configurable in a meaningful way.  This is for ifconfig(8) or
other tools not to change code whenever IFT_USB-like interfaces are
registered at the interface list.

Reviewed by: brooks
No objections: gavin, jkim

13 years agoAdd a comment to clarify that some BIOSes may clear the hw watchdog
emaste [Tue, 7 Dec 2010 19:18:00 +0000 (19:18 +0000)]
Add a comment to clarify that some BIOSes may clear the hw watchdog
indicator bit, preventing us from reporting in that case.

X-MFC-with: r215868

13 years agoUse proper resource ID's for HPET IRQ resources. This mostly consists of
jhb [Tue, 7 Dec 2010 18:49:11 +0000 (18:49 +0000)]
Use proper resource ID's for HPET IRQ resources.  This mostly consists of
looking to see if there is an existing IRQ resource for a given IRQ
provided by the BIOS and using that RID if so.  Otherwise, allocate a new
RID for the new IRQ.

Reviewed by: mav (a while ago)

13 years agoDon't write data into an empty "file."
kientzle [Tue, 7 Dec 2010 16:48:01 +0000 (16:48 +0000)]
Don't write data into an empty "file."

In particular, this check avoids a warning when
extracting directory entries from certain GNU tar
archives that store directory contents.

MFC after: 3 days

13 years agoUse a "push" strategy to get data through libz, rather than a "pull" strategy.
phk [Tue, 7 Dec 2010 16:30:52 +0000 (16:30 +0000)]
Use a "push" strategy to get data through libz, rather than a "pull" strategy.

13 years agoUndo r216230: the interaction between saved ashift in metadata and
ivoras [Tue, 7 Dec 2010 15:24:08 +0000 (15:24 +0000)]
Undo r216230: the interaction between saved ashift in metadata and
detected ashift does not support this. With this change, pools
created while stripesize=512 could not be imported when stripesize
becomes larger (on the same drive).

Noticed by: pjd

13 years agoUpdate some comments related to use of amd64 full context switch.
kib [Tue, 7 Dec 2010 12:44:33 +0000 (12:44 +0000)]
Update some comments related to use of amd64 full context switch.
In exec_linux_setregs(), use locally cached pointer to pcb to set
pcb_full_iret.
In set_regs(), note that full return is needed when code that sets
segment registers is enabled.

MFC after: 1 week

13 years agoopensolaris cyclic: fix deadlock and make a little bit closer to upstream
avg [Tue, 7 Dec 2010 12:25:26 +0000 (12:25 +0000)]
opensolaris cyclic: fix deadlock and make a little bit closer to upstream

The dealock was caused in the following way:
- thread T1 on CPU C1 holds a spin mutex, IPIs CPU C2 and waits for the
  IPI to be handled
- C2 executes timer interrupt filter, thus has interrupts disabled, and
  gets blocked on the spin mutex held by T1
The problem seems to have been introduced by simplifications made to
OpenSolaris code during porting.
The problem is fixed by reorganizing the code to more closely resemble
the upstream version.  Interrupt filter (cyclic_fire) now doesn't
acquire any locks, all per-CPU data accesses are performed on a
target CPU with preemption and interrupts disabled thus precluding
concurrent access to the data.
cyp_mtx spin mutex is used to disable preemtion and interrupts; it's not
used for classical mutual exclusion, because xcall already serializes
calls to a CPU.  It's an emulation of OpenSolaris
cyb_set_level(CY_HIGH_LEVEL) call, the spin mutexes could probably be
reduced to just a spinlock_enter()/_exit() pair.

Diff with upstream version is now reduced by ~500 lines, however it still
remains quite large - many things that are not needed (at the moment) or
are irrelevant on FreeBSD were simply ripped out during porting.
Examples of such things:
- support for CPU onlining/offlining
- support for suspend/resume
- support for running callouts at soft interrupt levels
- support for callout rebinding from CPU to CPU
- support for CPU partitions

Tested by: Artem Belevich <fbsdlist@src.cx>
MFC after: 3 weeks
X-MFC with: r216252

13 years agoRetire write-only PCB_FULLCTX pcb flag on amd64.
kib [Tue, 7 Dec 2010 12:17:43 +0000 (12:17 +0000)]
Retire write-only PCB_FULLCTX pcb flag on amd64.

Reminded by: Petr Salinger <Petr.Salinger seznam cz>
Tested by: pho
MFC after: 1 week

13 years agoopensolaris cyclic xcall: no need for special handling of curcpu
avg [Tue, 7 Dec 2010 12:04:06 +0000 (12:04 +0000)]
opensolaris cyclic xcall: no need for special handling of curcpu

smp_rendezvous_cpus already properly handles current CPU case
and non-SMP case.

MFC after: 3 weeks

13 years agodtrace_xcall: no need for special handling of curcpu
avg [Tue, 7 Dec 2010 09:19:47 +0000 (09:19 +0000)]
dtrace_xcall: no need for special handling of curcpu

smp_rendezvous_cpus alreadt does the right thing in a very similar
fashion, so the code was kind of duplicating that.

MFC after: 3 weeks

13 years agodtrace_gethrtime_init: pin to master while examining other CPUs
avg [Tue, 7 Dec 2010 09:03:17 +0000 (09:03 +0000)]
dtrace_gethrtime_init: pin to master while examining other CPUs

Also use pc_cpumask to be future-friendly.

Reviewed by: jhb
MFC after: 2 weeks

13 years agoRe-add a status check which sneaked out during r214804.
hselasky [Tue, 7 Dec 2010 08:20:20 +0000 (08:20 +0000)]
Re-add a status check which sneaked out during r214804.
This change can fix some USB error messages showing up
during bootup.

MFC after: 3 days
Approved by: thompsa (mentor)

13 years agoAnother minor nit: Make sure the constant here is a float so the compiler
das [Tue, 7 Dec 2010 03:29:36 +0000 (03:29 +0000)]
Another minor nit: Make sure the constant here is a float so the compiler
doesn't promote the entire expression to double.

13 years agoFix various nits in style and comments that were pointed out by bde.
das [Tue, 7 Dec 2010 02:19:15 +0000 (02:19 +0000)]
Fix various nits in style and comments that were pointed out by bde.
Code changes verified with md5.

13 years agosh: Improve internal-representation-to-text code to avoid binary output.
jilles [Mon, 6 Dec 2010 23:49:27 +0000 (23:49 +0000)]
sh: Improve internal-representation-to-text code to avoid binary output.

The code to translate the internal representation to text did not know about
various additions to the internal representation since the original ash and
therefore wrote binary stuff to the terminal.

The code is used in the jobs command and similar output.

Note that the output is far from complete and mostly serves for recognition
purposes.

13 years agoIgnore any failures with the "local" distribution since it's not present
brucec [Mon, 6 Dec 2010 20:55:14 +0000 (20:55 +0000)]
Ignore any failures with the "local" distribution since it's not present
on release CDs and so will normally fail.
installCommit() returns a DITEM_ value, not a Boolean.
distExtractAll() returns a Boolean, not a DITEM_ value.

Reported by: kensmith
MFC after: 3 days

13 years agoImplement NdisGetRoutineAddress and MmGetSystemRoutineAddress used in
bschmidt [Mon, 6 Dec 2010 20:54:53 +0000 (20:54 +0000)]
Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used in
newer Ralink drivers.

Submitted by: Paul B Mahol <onemda at gmail.com>

13 years agoSet correct maximum I/O length. We can only handle I/O of up to
cperciva [Mon, 6 Dec 2010 20:40:15 +0000 (20:40 +0000)]
Set correct maximum I/O length.  We can only handle I/O of up to
max_request_segments * PAGE_SIZE if the I/O is page-aligned; the
largest I/O we can guarantee will work is PAGE_SIZE less than that.
This unbreaks 'diskinfo -t'.

13 years agoAdd a KASSERT to make it obvious when fork_norfproc() is to be called,
trasz [Mon, 6 Dec 2010 19:15:38 +0000 (19:15 +0000)]
Add a KASSERT to make it obvious when fork_norfproc() is to be called,
and set *procp to NULL in all cases.  Previously, it was not being set
in the ERESTART case.  This is effectively no-op, since its value is
ignored by callers in the error case.

Reviewed by: kib@

13 years agoDrop advertising clause in manpages. It was done a long time ago
uqs [Mon, 6 Dec 2010 19:12:51 +0000 (19:12 +0000)]
Drop advertising clause in manpages. It was done a long time ago
for the source code.

Discussed with: core

13 years agoFix scanning after loosing a connection. The firmware assumes that as long
bschmidt [Mon, 6 Dec 2010 19:05:44 +0000 (19:05 +0000)]
Fix scanning after loosing a connection. The firmware assumes that as long
as an association ID is set any scan is supposed to be a background scan.
This implies that the firmware will switch back to the associated channel
after a certain threshold, though, we are not notified about that. We
currently catch this case by a timer which will reset the firmware after
a 'scan timeout', though, upper layers are not notified about that and
will simply hang until manual intervention. Fix this by resetting the
firmware's knowledge about any association on RUN -> ASSOC and
!INIT -> SCAN transitions.

Tested by: Zhihao Yuan <lichray at gmail.com>
MFC after: 1 week

13 years agoFixes for monitor mode:
bschmidt [Mon, 6 Dec 2010 18:28:39 +0000 (18:28 +0000)]
Fixes for monitor mode:
- Do not call iwn_calib_reset() for monitor mode. We do not want to query
  information and do runtime calibration while in monitor mode. Poking the
  firmware with adjustments for calibration results in firmware asserts.
  This could happened on RUN -> RUN transition only.
- Adjust blink rate for monitor mode. It's supposed to not freak out and
  turn off after a while.
- While here, remove one useless assignment of calib.state, it gets
  overwritten later in the function.

Submitted by: Brandon Gooch <jamesbrandongooch at gmail.com>
MFC after: 1 week

13 years agoWhen masking direct and processor devices during an inquiry, properly
jhb [Mon, 6 Dec 2010 17:06:21 +0000 (17:06 +0000)]
When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.

Reviewed by: scottl
MFC after: 1 week

13 years agoWhen masking direct and processor devices during an inquiry, properly
jhb [Mon, 6 Dec 2010 17:02:56 +0000 (17:02 +0000)]
When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.

While here, shorten a few nearby lines.

PR: kern/152768
Reported by: Sascha Wildner  saw of online.de
Reviewed by: scottl
MFC after: 1 week

13 years agoFix style bug introduced by previous commit.
trasz [Mon, 6 Dec 2010 16:45:36 +0000 (16:45 +0000)]
Fix style bug introduced by previous commit.

13 years agoImprove readability by factoring out the !RFPROC case. While here,
trasz [Mon, 6 Dec 2010 16:39:18 +0000 (16:39 +0000)]
Improve readability by factoring out the !RFPROC case.  While here,
turn K&R function definitions into ANSI.  No functional changes.

Reviewed by: kib@

13 years agoAdd a manpage for SYSINIT() and SYSUNINIT().
jhb [Mon, 6 Dec 2010 15:19:03 +0000 (15:19 +0000)]
Add a manpage for SYSINIT() and SYSUNINIT().

PR: docs/132884
Submitted by: pluknet, hmp

13 years agoDo not leak %rdx value in the previous image to the new image after
kib [Mon, 6 Dec 2010 15:15:27 +0000 (15:15 +0000)]
Do not leak %rdx value in the previous image to the new image after
execve(2). Note that ia32 binaries already handle this properly,
since ia32_setregs() resets td_retval[1], but not exec_setregs().

We still do not conform to the amd64 ABI specification, since %rsp
on the image startup is not aligned to 16 bytes.

PR: amd64/124134
Discussed with: Petr Salinger <Petr.Salinger seznam cz>
(who convinced me that there is indeed several bugs)
MFC after: 1 week

13 years agoUse GEOM stripesize field when calculating ashift. This will enable correct
ivoras [Mon, 6 Dec 2010 12:18:02 +0000 (12:18 +0000)]
Use GEOM stripesize field when calculating ashift. This will enable correct
alignment on drives with large sector sizes (e.g. 4 KiB) but the
implementation might need to be revisited if devices with large stripesizes
appear (e.g. if RAID controllers or flash drives start using the field),
probably by introducing a physsectorsize field in GEOM providers.

Discussed with: mav, mostly silence on freebsd-geom@ and freebsd-fs@

13 years agoRevert r209469: it causes the rest of the function to be bypassed.
brucec [Mon, 6 Dec 2010 11:37:24 +0000 (11:37 +0000)]
Revert r209469: it causes the rest of the function to be bypassed.

Reported by: ae

13 years agoFix double ;;
kevlo [Mon, 6 Dec 2010 10:24:06 +0000 (10:24 +0000)]
Fix double ;;