jhb [Fri, 28 Jan 2011 20:06:39 +0000 (20:06 +0000)]
MFC 217416:
Add two more features to cpuset(1):
- Add a new -C flag to create a new cpuset and move an existing pid into
that set.
- Allow 'all' to be specified for a cpu list (e.g. cpuset -s 1 -l all)
which maps to the list of all CPUs in the system.
jpaetzel [Fri, 28 Jan 2011 18:25:51 +0000 (18:25 +0000)]
MFC: r217755 r217822
This script parses output of userland tools. In the case of a faulted
zpool the output causes the script to bail out with syntax errors.
Since a scrub of a faulted zpool is pointless, just skip over any
pools marked as such.
marcel [Fri, 28 Jan 2011 00:22:03 +0000 (00:22 +0000)]
In uart_tty_outwakeup(), check CTS/RTS flow control settings and
prevent sending data when CTS is de-asserted.
In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal
changed, knowing that uart_tty_outwakeup() will do the right
thing for flow control. This avoids redundant conditionals.
PR: kern/148644
Submitted by: John Wehle <john@feith.com>
gavin [Thu, 27 Jan 2011 23:16:41 +0000 (23:16 +0000)]
Merge r217200 from head:
Sync the list of devices supported by uslcom(4) with Linux, bringing in
all new devices added between our r211022 and their git revision 93ad03d60b5b18897030038234aa2ebae8234748
gavin [Thu, 27 Jan 2011 23:07:03 +0000 (23:07 +0000)]
Merge r217264 from head:
Remove a bullet point that appears to have been accidentally inserted twice.
It has also been included within the feature lists to which it is relevant.
jhb [Thu, 27 Jan 2011 21:16:23 +0000 (21:16 +0000)]
MFC 217078,217079: Various priority fixes for creating new threads:
- Move sched_fork() later in fork() after the various sections of the new
thread and proc have been copied and zeroed from the old thread and
proc. Otherwise attempts to modify thread or process data in sched_fork()
could be undone.
- Don't copy td_{base,}_user_pri from the old thread to the new thread in
sched_fork_thread() in ULE. This is already done courtesy the bcopy()
of the thread copy region.
- Always initialize the real priority (td_priority) of new threads to the
new thread's base priority (td_base_pri) to avoid bogusly inheriting a
borrowed priority from the parent thread.
- Properly initialize the base priority (td_base_pri) of thread0 to PVM
to match the desired priority in td_priority. Otherwise the first time
thread0 used a borrowed priority it would drop down to PUSER instead of
PVM.
- Explicitly initialize the starting priority of new kprocs to PVM to
avoid inheriting some random priority from thread0.
jhb [Thu, 27 Jan 2011 20:12:18 +0000 (20:12 +0000)]
MFC 217077:
Only change the priority of timeshare threads to PRI_MAX_TIMESHARE
when yield() is called. Specifically, leave the priority of real time
and idle threads unchanged.
jhb [Thu, 27 Jan 2011 20:09:20 +0000 (20:09 +0000)]
MFC 217076:
- Restore dropping the priority of syncer down to PPAUSE when it is idle.
This was lost when it was converted to using a condition variable instead
of lbolt.
- Drop the priority of flowtable down to PPAUSE when it is idle as well
since it is a similar background task.
yongari [Thu, 27 Jan 2011 19:02:28 +0000 (19:02 +0000)]
MFC r216551:
Add support for JMicron JMC251/JMC261 Gigabit/Fast ethernet
controller with Card Read Host Controller. These controllers are
multi-function devices and have the same ethernet core of
JMC250/JMC260. Starting from REVFM 5(chip full mask revision)
controllers have the following features.
o eFuse support
o PCD(Packet Completion Deferring)
o More advanced PHY power saving
Because these controllers started to use eFuse, station address
modified by driver is permanent as if it was written to EEPROM. If
you have to change station address please save your controller
default address to safe place before reprogramming it. There is no
way to restore factory default station address.
Many thanks to JMicron for continuing to support FreeBSD.
mav [Thu, 27 Jan 2011 13:53:21 +0000 (13:53 +0000)]
MFC r217509:
Fix 32bit bit fields handling. This fixes card serial number fetching.
It was just a cosmetic issue, because that number is only reported in logs.
mav [Thu, 27 Jan 2011 13:37:45 +0000 (13:37 +0000)]
MFC r215449:
Some VIA SATA controllers provide access to non-standard SATA registers via
PCI config space. Use them to implement hot-plug and link speed reporting.
Tested on ASRock PV530 board with VX900 chipset.
kib [Thu, 27 Jan 2011 09:52:31 +0000 (09:52 +0000)]
MFC r217633:
In tmpfs_readdir(), normalize handling of the directory entries that
either overflow the supplied buffer, or cause uiomove fail.
Do not advance cached de when directory entry was not copied out.
Do not return EOF when no entries could be copied due to first entry
too large for supplied buffer, signal EINVAL instead.
jhb [Wed, 26 Jan 2011 20:14:03 +0000 (20:14 +0000)]
MFC 216334:
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().
bschmidt [Wed, 26 Jan 2011 16:59:07 +0000 (16:59 +0000)]
MFC r217590:
Jump to the next element and not to an arbitrary point. frm[1] contains
the element's data length, frm[2] is the first byte of the element's data.
Submitted by: Monthadar Al Jaberi <monthadar at gmail.com>
scf [Tue, 25 Jan 2011 23:25:23 +0000 (23:25 +0000)]
Merge from head to stable/8:
r216813:
Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after the
information is set to FreeBSD. It had been falling through to the end
of linux_ioctl_sound() and returning ENOIOCTL. Noticed when running the
Linux ALSA amixer tool.
Add a LINUX_SOUND_MIXER_READ_CAPS ioctl which is used by the Skype
v2.1.0.81 binary.
jilles [Tue, 25 Jan 2011 23:02:25 +0000 (23:02 +0000)]
MFC r217133: sed: Try hard links to make -i target available continually.
When creating a backup file, sed renamed the original before renaming the
changed copy into place, leading to a short time when no file with the
original name was present (usually only visible on SMP systems). Try
creating the backup file using a hard link instead, avoiding this problem.
If creating the hard link fails for any reason, fall back to the old rename
method.
When not creating a backup file, sed already renamed the changed copy onto
the original. This remains unchanged.
PR: bin/153261
Submitted by: Pedro F. Giffuni
Reviewed by: dds (older version)
Obtained from: Illumos
jhb [Tue, 25 Jan 2011 20:48:48 +0000 (20:48 +0000)]
MFC 215540:
Set various POSIX capability sysctls to the version of the API that is
supported rather than 1. They are supposed to return a suitable value
for sysconf(3). While here, make the fsync sysctl match <unistd.h>.
jhb [Tue, 25 Jan 2011 20:44:11 +0000 (20:44 +0000)]
MFC 204329,210723,210933,214778,215526:
Sync mfiutil(8) with HEAD:
- Handle malloc() failures more gracefully by error'ing out rather than
segfaulting.
- Fixed dependencies (make checkdpadd).
- Fix typos and spelling mistakes.
jhb [Tue, 25 Jan 2011 20:33:12 +0000 (20:33 +0000)]
MFC 211514,214158:
- There isn't really a need to hold the ktrace mutex just to read the
value of p_traceflag that is stored in the kinfo_proc structure.
- When disabling ktracing on a process, free any pending requests that
may be left. This fixes a memory leak that can occur when tracing is
disabled on a process via disabling tracing of a specific file (or if
an I/O error occurs with the tracefile) if the process's next system
call is exit(). The trace disabling code clears p_traceflag, so exit1()
doesn't do any KTRACE-related cleanup leading to the leak. I chose to
make the free'ing of pending records synchronous rather than patching
exit1().
- Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into
kern_ktrace.c instead. Make ktrace_mtx private to kern_ktrace.c as a
result.
jhb [Tue, 25 Jan 2011 19:44:42 +0000 (19:44 +0000)]
MFC 214144:
- Make 'vm_refcnt' volatile so that compilers won't be tempted to treat
its value as a loop invariant. Currently this is a no-op because
'atomic_cmpset_int()' clobbers all memory on current architectures.
- Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop
a reference in vmspace_free().
kib [Tue, 25 Jan 2011 10:14:12 +0000 (10:14 +0000)]
MFC r217561:
For architectures not using direct map , and requiring real KVA page for
sf buf allocation, use wakeup() instead of wakeup_one() to notify sf
buffer waiters about free buffer.
sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given,
and for simultaneous wakeup and signal delivery, msleep() returns
EINTR/ERESTART despite the thread was selected for wakeup_one(). As
result, we loose a wakeup, and some other waiter will not be woken up.
yongari [Sun, 23 Jan 2011 02:15:50 +0000 (02:15 +0000)]
MFC r217649:
Correct wrong definition of PM timer mask and adjust L1/PM timer
value. While I'm here enable all clocks before initializing
controller. This change should fix lockup issue seen on AR8152
v1.1 PCIe Fast Ethernet controller.
rmacklem [Fri, 21 Jan 2011 01:12:22 +0000 (01:12 +0000)]
MFC: r217432
Modify the experimental NFSv4 server so that it posts a SIGUSR2
signal to the master nfsd daemon whenever the stable restart
file has been modified. This will allow the master nfsd daemon
to maintain an up to date backup copy of the file. This is
enabled via the nfssvc() syscall, so that older nfsd daemons
will not be signaled.
marius [Fri, 21 Jan 2011 00:53:32 +0000 (00:53 +0000)]
MFC: r217417
- Even after masking the media with IFM_GMASK the result may have bits
besides the duplex ones set so just comparing it with IFM_FDX may lead
to false negatives.
- Just let the default case handle all unsupported media types.
- In pnphy_status() don't unnecessarily read a register twice.
- Remove unnused macros.
marius [Fri, 21 Jan 2011 00:48:04 +0000 (00:48 +0000)]
MFC: r217413
- Even after masking the media with IFM_GMASK the result may have bits
besides the duplex ones set so just comparing it with IFM_FDX may lead
to false negatives.
- Simplify ciphy_service() to only set the manual configuration bits
once after we have figured them all out. This also means we no longer
unnecessarily update the hardware along the road.
marius [Fri, 21 Jan 2011 00:40:25 +0000 (00:40 +0000)]
MFC: r217412
- Masking IFM_GMASK when also masking IFM_FDX is redundant and just
complicates the code.
- Don't let atphy_setmedia() announce PAUSE support for half-duplex when
MIIF_FORCEPAUSE is set.
- Simplify e1000phy_service() and ip1000phy_service() to only set the
manual configuration bits once after we have figured them all out. For
ip1000phy_service() this also means we no longer unnecessarily update
the hardware along the road.
yongari [Fri, 21 Jan 2011 00:33:10 +0000 (00:33 +0000)]
MFC r217548:
Rework RX filter programming by providing separate handler for
DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no
longer reinitializes controller if ALLMULTI/PROMISC was changed.
However, RX filter handling code assumed some bits of the RX filter
is programmed by driver initialization. This caused ALLMULTI/PROMISC
configuration is ignored under certain conditions.
Fix that issue by reprogramming all bits of RX filter register.
While I'm here follow recommended RX filter programming steps
recommended by National DP8381[56] data sheet(RX filter should be
is disabled before programming).
bschmidt [Thu, 20 Jan 2011 18:41:46 +0000 (18:41 +0000)]
MFC r217511:
Pull ieee80211_ratectl_node_init() calls from drivers into net80211.
This fixes hostap mode for at least ral(4) and run(4), because there is
no sufficient call into drivers which could be used initialize the node
related ratectl variables.
keramida [Wed, 19 Jan 2011 21:49:21 +0000 (21:49 +0000)]
MFC r217481 and r217606 from /head
r217481...
Fix the mount example of xfs(5) filesystems by including the read-only
option. We only support ro mounts for xfs, so it’s nice if the examples
we show in the manpage are easy to copy/paste.
keramida [Wed, 19 Jan 2011 21:34:42 +0000 (21:34 +0000)]
MFC r199985 from /head
Describe what setpgid(2) does when pgid=0. The text has been
copied from NetBSD’s manpage, and it also matches the behavior
described by the Open Group’s online copy of setpgid.2 at
http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html
keramida [Wed, 19 Jan 2011 21:09:39 +0000 (21:09 +0000)]
MFC r217064 - sort & fix includes, remove -include from CFLAGS of acct tests
- Sort the includes of pack.c, moving sys/*.h files near the top.
- Add a couple of missing #include lines, and remove the need for
custom -include options in the CFLAGS of the test Makefile.
- Remove the ad-hoc ’all’ target, but keep its ’regress’ bits for
testing.
- Convert the ad-hoc ’clean’ target to proper CLEANFILES stuff,
so that the normal bsd.prog.mk machinery can clean up.
- Use ‘make -V .OBJDIR’ to detect the place where ’pack’ lives,
so that regress.t works both with and without ’make obj’.
ae [Wed, 19 Jan 2011 05:13:40 +0000 (05:13 +0000)]
MFC r217305:
Sector size can not be greater than MAXPHYS. Since GRAID3 calculates
sector size from user-specified block size, report to user about
big blocksize.
rmacklem [Wed, 19 Jan 2011 01:26:49 +0000 (01:26 +0000)]
MFC: r217176
Modify readdirplus in the experimental NFS server in a
manner analogous to r216633 for the regular server. This
change busies the file system so that VFS_VGET() is
guaranteed to be using the correct mount point even
during a forced dismount attempt. Since nfsd_fhtovp() is
not called immediately before readdirplus, the patch is
actually a clone of pjd@'s nfs_serv.c.4.patch instead of
the one committed in r216633.
marius [Tue, 18 Jan 2011 11:51:48 +0000 (11:51 +0000)]
MFC: r217464, r217468, r217475
Add a manual page for rgephy(4) and reference it as appropriate. The
motivation for having rgephy.4 is to document the special media option
added in r217415 (MFC'ed to stable/8 in r217502).
rmacklem [Tue, 18 Jan 2011 01:20:15 +0000 (01:20 +0000)]
MFC: r217242
Fix a bug in the client side krpc where it was, sometimes
erroneously, assumed that 4 bytes of data were in the first
mbuf of a list by replacing the bcopy() with m_copydata().
Also, replace the uses of m_pullup(), which can fail for
reasons other than not enough data, with m_copydata().
For the cases where it isn't known that there is enough
data in the mbuf list, check first via m_len and m_length().
This is believed to fix a problem reported by dpd at dpdtech.com
and george+freebsd at m5p.com.
rmacklem [Tue, 18 Jan 2011 01:07:09 +0000 (01:07 +0000)]
MFC: r217066
Delete the NFS_STARTWRITE() and NFS_ENDWRITE() macros that
obscured vn_start_write() and vn_finished_write() for the
old OpenBSD port, since most uses have been replaced by the
correct calls.
rmacklem [Tue, 18 Jan 2011 00:53:55 +0000 (00:53 +0000)]
MFC: r217063
Since the VFS_LOCK_GIANT() code in the experimental NFS
server is broken and the major file systems are now all
mpsafe, modify the server so that it will only export
mpsafe file systems. This was discussed on freebsd-fs@
and removes a fair bit of crufty code.
bschmidt [Mon, 17 Jan 2011 20:22:03 +0000 (20:22 +0000)]
MFC r216835:
The mwl's HAL manages an array of MWL_MBSS_MAX VAPs where the first 8 are
supposed to be APs and the later 24 are pre-configured as STAs. A wrong
condition during initialization is responsible for not configuring the last
8 array members. This is results in being able to create more than 8,
possible uninitialized, AP-VAPs.
Submitted by: Erik Fonnesbeck <efonnes at gmail.com>
mav [Mon, 17 Jan 2011 17:23:59 +0000 (17:23 +0000)]
MFC r217245:
Add IDs for HighPoint RocketRAID 64x controllers.
These controllers consist of two Marvell 88SE9128 6Gbps SATA chips and
PLX PCIe bridge. As result, they seem to be agree to work with ahci(4)
as usual HBAs. The only noticed issue is that RAID BIOS disables all
drive caches during boot, though `camcontrol cmd ...` is able to fix that.
Those who wants RAID functionality can still use closed proprietary driver
from HighPoint site.
marius [Mon, 17 Jan 2011 15:12:29 +0000 (15:12 +0000)]
MFC: r217415
- Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual
configuration, which is used to work around issues with certain setups
(see r161237) by default, should not be triggered as it may in turn
cause harm in some edge cases.
- Even after masking the media with IFM_GMASK the result may have bits
besides the duplex ones set so just comparing it with IFM_FDX may lead
to false negatives.
- Announce PAUSE support also for manually selected 1000BASE-T, but for
all manually selected media types only in full-duplex mode. Announce
asymmetric PAUSE support only for manually selected 1000BASE-T.
- Simplify setting the manual configuration bits to only once after we
have figured them all out. This also means we no longer unnecessarily
update the hardware along the road.
- Remove a stale comment.
rmacklem [Mon, 17 Jan 2011 01:49:47 +0000 (01:49 +0000)]
MFC: r217023
Modify the experimental NFS server so that it calls
vn_start_write() with a non-NULL vp. That way it will
find the correct mount point mp and use that mp for the
subsequent vn_finished_write() call. Also, it should fail
without crashing if the mount point is being forced dismounted
because vn_start_write() will set the mp NULL via VOP_GETWRITEMOUNT().