yongari [Mon, 26 Mar 2012 04:49:57 +0000 (04:49 +0000)]
MFC r232849-232850:
r232849:
Show PCI bus speed and width as well as running mode of PCI-X
device in device attach. This would help to narrow down issue to a
specific controller and operating mode of the controller.
While I'm here rename BGE_MISCCFG_BOARD_ID with
BGE_MISCCFG_BOARD_ID_MASK.
r232850:
Make if_ierrors updated whenever any of the following counters are
updated.
o Number of times NIC ran out of RX buffer descriptors
o Number of inbound packet errors
o Number of inbound packets that were chosen to be discarded
Previously only the discarded packet counter was used to update
if_ierrors. This change fixes wrong if_ierrors counter on
BCM570[0-4] controllers. For BCM5705 and later controllers bge(4)
already correctly counted it.
yongari [Mon, 26 Mar 2012 04:37:42 +0000 (04:37 +0000)]
MFC r232848:
Add workaround for PCI-X BCM5704 controller that live behind
AMD-8131 PCI-X bridge. The bridge seems to reorder write access to
mailbox registers such that it caused watchdog timeouts by
out-of-order TX completions.
Tested by: Michael L. Squires <mikes <> siralan dot org >
yongari [Mon, 26 Mar 2012 04:29:06 +0000 (04:29 +0000)]
MFC r232246:
Prefer RL_GMEDIASTAT register to RGEPHY_MII_SSR register to
extract a link status of PHY when parent driver is re(4).
RGEPHY_MII_SSR register does not seem to report correct PHY status
on some integrated PHYs used with re(4).
Unfortunately, RealTek PHYs have no additional information to
differentiate integrated PHYs from external ones so relying on PHY
model number is not enough to know that. However, it seems
RGEPHY_MII_SSR register exists for external RealTek PHYs so
checking parent driver would be good indication to know which PHY
was used. In other words, for non-re(4) controllers, the PHY is
external one and its revision number is greater than or equal to 2.
This change fixes intermittent link UP/DOWN messages reported on
RTL8169 controller.
Also, mii_attach(9) is tried after setting interface name since
rgephy(4) have to know parent driver name.
yongari [Mon, 26 Mar 2012 03:55:45 +0000 (03:55 +0000)]
MFC r232145:
Use correct Config registers for RTL8139 family. Unlike RTL8168 and
RTL810x family , RTL8139 has different register map for Config
registers.
While here, follow the lead of re(4) in WOL configuration.
- Disable WOL_UCAST and WOL_MCAST capabilities by default.
- Config5 register write does not need to unlock EEPROM access
on RTL8139 family but unlocking EEPROM access does not affect
its operation and make it consistent with re(4).
Reported by: Matt Renzelmann mjr <> cs dot wisc dot edu
yongari [Mon, 26 Mar 2012 03:48:21 +0000 (03:48 +0000)]
MFC r232019,232021,232025,232027,232029,232040:
r232019:
Give hardware chance to drain active DMA cycles.
r232021:
If there are not enough RX buffers, release partially allocated RX
buffers.
r232025:
Introduce sf_ifmedia_upd_locked() and have driver reset PHY before
switching to selected media. While here, set if_drv_flags before
switching to selected media.
r232027:
No need to reprogram hardware RX filter when driver is not running.
r232029:
Remove taskqueue based MII stat change handler.
Driver does not need deferred link state change processing.
While I'm here, do not report current link status if interface is
not UP.
r232040:
Add check for IFF_DRV_RUNNING flag after serving an interrupt and
don't give RX path more priority than TX path.
Also remove infinite loop in interrupt handler and limit number of
iteration to 32. This change addresses system load fluctuations
under high network load.
jilles [Sun, 25 Mar 2012 20:09:02 +0000 (20:09 +0000)]
MFC r233132: fts(3): Mention that FTS_NOCHDIR imposes {PATH_MAX} limits on
the returned pathnames.
With the current API (no *at functions), FTS_NOCHDIR requires that the
fts_accpath start with the original path passed to fts_open(); therefore,
the depth that can be reached is limited by the {PATH_MAX} constraint on
this pathname.
edwin [Sun, 25 Mar 2012 02:19:02 +0000 (02:19 +0000)]
MFC of r233445, tzdata2012a
- Updates to various locations in Antarctica.
- Armenia will abolish DST this year.
- Not only Samoa has moved to UTC+14, also Fakaofo did.
- There will be a leap second in 30 June 2012.
- Historical updates of 1918 to Canada, Winn, Regina, Edm, Vanc, Creston.
- Chili stays on DST until 28 April 2012
- The Falkland islands will stay on DST this year.
jhb [Fri, 23 Mar 2012 20:58:27 +0000 (20:58 +0000)]
MFC 232362,232363,232463,232553,232569,232571:
- Sort function prototypes.
- Update the documentation on pci_get/set_powerstate(). These methods are
not ACPI-specific at all, but deal with PCI power states. Also,
pci_set_powerstate() fails with EOPNOTSUPP if a request is made that the
underlying device does not support rather than falling back to somehow
setting D0.
- Document the following routines: pci_alloc_msi(), pci_alloc_msix(),
pci_find_cap(), pci_get_max_read_req(), pci_get_vpd_ident(),
pci_get_vpd_readonly(), pci_msi_count(), pci_msix_count(),
pci_pending_msix(), pci_release_msi(), pci_remap_msix(), and
pci_set_max_read_req().
- Group the functions into five sub-sections: raw configuration access,
locating devices, device information, device configuration, and
message signaled interrupts.
- Discourage use of pci_disable_io() and pci_enable_io() in device drivers.
The PCI bus driver handles this automatically as resources are activated.
jhb [Fri, 23 Mar 2012 20:47:49 +0000 (20:47 +0000)]
MFC 232403,232667:
- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
The tag enforces a single restriction that all DMA transactions must not
cross a 4GB boundary. Note that while this restriction technically only
applies to PCI-express, this change applies it to all PCI devices as it
is simpler to implement that way and errs on the side of caution.
- Add a softc structure for PCI bus devices to hold the bus_dma tag and
a new pci_attach_common() routine that performs actions common to the
attach phase of all PCI bus drivers. Right now this only consists of
a bootverbose printf and the allocate of a bus_dma tag if necessary.
- Adjust all PCI bus drivers to allocate a PCI bus softc and to call
pci_attach_common() from their attach routines.
jhb [Fri, 23 Mar 2012 18:29:28 +0000 (18:29 +0000)]
MFC 232401:
Similar to the fixes in 226967 and 226987, purge any name cache entries
associated with the previous vnode (if any) associated with the target of
a rename(). Otherwise, a lookup of the target pathname concurrent with a
rename() could re-add a name cache entry after the namei(RENAME) lookup
in kern_renameat() had purged the target pathname.
jhb [Fri, 23 Mar 2012 18:03:38 +0000 (18:03 +0000)]
MFC 232360:
Add pci_save_state() and pci_restore_state() wrappers around
pci_cfg_save() and pci_cfg_restore() for device drivers to use when
saving and restoring state (e.g. to handle device-specific resets).
jhb [Fri, 23 Mar 2012 17:24:52 +0000 (17:24 +0000)]
MFC 232570,232754:
Fix boot2 to handle boot config files that only contain a custom path to
a loader or kernel. Specifically, kname cannot be pointed at cmd[] since
it's value is change to be an empty string after the initial call to
parse, and cmd[]'s value can be changed (thus losing a prior setting for
kname) due to user input at the boot prompt. While here, ensure that that
initial boot config file text is nul-terminated, that ops is initialized
to zero, and that kname is always initialized to a valid string.
In addition, include other changes to ensure boot2 still builds with
Clang.
jimharris [Fri, 23 Mar 2012 17:11:36 +0000 (17:11 +0000)]
MFC r233371:
Call xpt_bus_register during attach context, then freeze and do not release
until domain discovery is complete. This fixes an isci(4) bug on FreeBSD 7.x
where devices weren't always appearing after boot without an explicit rescan.
Sponsored by: Intel
Reported and tested by: <rpokala at panasas dot com>
Reviewed by: scottl
Approved by: scottl
mav [Fri, 23 Mar 2012 16:19:14 +0000 (16:19 +0000)]
MFC r232793:
Revert r175376 and tune cpufreq(4) frequency comparison logic instead.
Instead of using 25MHz equality threshold, look for the nearest value when
handling dev.cpu.0.freq sysctl and for exact match when it is expected.
ACPI may report extra level with frequency 1MHz above the nominal to
control Intel Turbo Boost operation. It is not a bug, but feature:
dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ...
In this case value 2933 means 2.93GHz, but 2934 means 3.2-3.6GHz.
I've found that my Core i7 based systems have Intel Turbo Boost not used
by default and without this change it was absolutely invisible and hard
to control.
kib [Fri, 23 Mar 2012 15:37:41 +0000 (15:37 +0000)]
MFC r223889:
Add a facility to disable processing page faults. When activated,
uiomove generates EFAULT if any accessed address is not mapped, as
opposed to handling the fault.
jhb [Fri, 23 Mar 2012 12:06:32 +0000 (12:06 +0000)]
MFC 232218:
Clear the a device's description string anytime it's driver changes.
Descriptions are specific to drivers and we don't change drivers on attached
devices. This fixes a few places where we were not clearing the description
when detaching a driver (e.g. if device_attach() failed). While here, fix
a few other nits:
- Remove spurious call to remove a device's driver from
devclass_driver_deleted(). device_detach() removes it already.
- Fix a typo.
jhb [Thu, 22 Mar 2012 21:08:14 +0000 (21:08 +0000)]
MFC 230547:
Add a timeout on positive name cache entries in the NFS client. That is,
we will only trust a positive name cache entry for a specified amount of
time before falling back to a LOOKUP RPC, even if the ctime for the file
handle matches the cached copy in the name cache entry. The timeout is
configured via a new 'nametimeo' mount option and defaults to 60 seconds.
It may be set to zero to disable positive name caching entirely.
jhb [Thu, 22 Mar 2012 20:52:00 +0000 (20:52 +0000)]
MFC 232116:
Adjust the nfs_skip_wcc_data_onerr setting so that it does not block
post-op attributes for ENOENT errors now that the name caching logic
depends on working post-op attributes.
jhb [Wed, 21 Mar 2012 20:50:47 +0000 (20:50 +0000)]
MFC 230394,230441,230489,230552,232420:
Close a race in NFS lookup processing that could result in stale name cache
entries on one client when a directory was renamed on another client. The
root cause for the stale entry being trusted is that each per-vnode nfsnode
structure has a single 'n_ctime' timestamp used to validate positive name
cache entries. However, if there are multiple entries for a single vnode,
they all share a single timestamp. To fix this, extend the name cache
to allow filesystems to optionally store a timestamp value in each name
cache entry. The NFS clients now fetch the timestamp associated with
each name cache entry and use that to validate cache hits instead of the
timestamps previously stored in the nfsnode. Another part of the fix is
that the NFS clients now use timestamps from the post-op attributes of
RPCs when adding name cache entries rather than pulling the timestamps out
of the file's attribute cache. The latter is subject to races with other
lookups updating the attribute cache concurrently.
tuexen [Tue, 20 Mar 2012 19:42:40 +0000 (19:42 +0000)]
MFC r232866:
This fixes PR 165210. Basically we just
add in the netgraph interface to the list of
acceptable interfaces. A todo at the next
IETF code blitz, though is we need to review
why we screen interfaces, there was a reason ;-).
From rrs@.
kensmith [Mon, 19 Mar 2012 22:20:47 +0000 (22:20 +0000)]
We seem to be having issues with a bug in the loader that causes it to
estimate the program header size for the kernel wrong. It can result
in the kernel build failing with the message:
ld: kernel.debug: Not enough room for program headers (allocated 5, need 6)
ld: final link failed: Bad value
Tinderbox builds were failing with this message a short time ago, and
I encountered it while preparing the i386 build machine for the 8.3-RC2
builds.
Konstantin has looked at it and believes the issue was fixed in recent
versions of binutils. It is a bit too late in the release process to
be messing around with the loader and/or binutils. This workaround
seems to take care of the problem for now.
jhb [Mon, 19 Mar 2012 20:15:18 +0000 (20:15 +0000)]
MFC 225096:
Fix if_addr_mtx recursion in mld6.
mld_set_version() is called only from mld_v1_input_query() and
mld_v2_input_query() both holding the if_addr_mtx lock, and then calling
into mld_v2_cancel_link_timers() acquires it the second time, which results
in mtx recursion. To avoid that, delay if_addr_mtx acquisition until after
mld_set_version() is called; while here, further reduce locking scope
to protect only the needed pieces: if_multiaddrs, in6m_lookup_locked().
eadler [Mon, 19 Mar 2012 01:51:53 +0000 (01:51 +0000)]
MFC r231306:
Fix NULL ptr dereference in setusercontext if pwd is null,
LOGIN_SETPRIORITY is set, and setting the priority (rtprio or
setpriority) fails.
hrs [Sun, 18 Mar 2012 10:45:36 +0000 (10:45 +0000)]
MFC r216650:
Add IFT_L2VLAN to the list that is capable of supplying the ingredients
of the EUI64 part of an IPv6 address. Otherwise vlans will all use the
MAC address of the first ethernet interface of the system.
sbruno [Fri, 16 Mar 2012 23:58:35 +0000 (23:58 +0000)]
MFC r226702
Author: obrien
Date: Mon Oct 24 20:52:41 2011 UTC (4 months, 3 weeks ago)
Changed paths: 3
Log Message:
* Don't give the impression that this compiler is GPLv3.
(It is "well known" that GCC 4.2.2 is GPLv3.)
* Don't give the impression that this compiler isn't "trustable".
* Fix dependency nit.
jhb [Fri, 16 Mar 2012 21:28:29 +0000 (21:28 +0000)]
MFC 226340,226340:
Use queue(3) macros instead of home-rolled versions in several places in
the INET6 code. This includes retiring the 'ndpr_next' and 'pfr_next'
macros.
mav [Wed, 14 Mar 2012 14:14:16 +0000 (14:14 +0000)]
Dummy-initizlize variables to fix build breakage after r232942, because of
gcc falsely reporting variables as uninitialized. Code committed at that
revision don't even touch half of mentioned variables.
This is direct commit to 8-STABLE, as HEAD and 9-STABLE have no problem.
marius [Wed, 14 Mar 2012 10:02:42 +0000 (10:02 +0000)]
MFC: r232822
Fix a bug introduced in r223938 (MFC'ed to stable/8 in r224411); on
big-endian machines coping a 32-bit quantum bytewise to the address of
a 64-bit variable results in writing to the "wrong" 32-bit half so adjust
the address accordingly. This fix is implemented in a hackish way for
two reasons:
o in order to be able to get it into 8.3 with zero impact on the little-
endian architectures where this bug has no effect and
o to avoid blowing the x86 boot2 out of the water again when compiling
it with clang, which all sane versions of this fix tested do.
This change fixes booting from UFS1 file systems on big-endian machines.
mav [Tue, 13 Mar 2012 20:37:08 +0000 (20:37 +0000)]
MFC r229288:
Remove unneeded checks for CAM_DEV_QFRZN after cam_periph_runccb() call.
cam_periph_runccb() since the beginning checks it and releases device queue.
After r203108 it even clears CAM_DEV_QFRZN flag after that to avoid double
release, so removed code is unreachable now.
mav [Tue, 13 Mar 2012 20:34:33 +0000 (20:34 +0000)]
MFc r228846:
Use READ CAPACITY(16) to get information about device physical sectors.
As soon as not all devices support READ CAPACITY(16), automatically fall
back to READ CAPACITY(10) if CAM_REQ_INVALID or SSD_KEY_ILLEGAL_REQUEST
status returned.
It also provides first bits of information about Logical Block Provisioning
(aka UNMAP/TRIM) support by the device.
bz [Mon, 12 Mar 2012 22:13:17 +0000 (22:13 +0000)]
MFC r232515:
Rather than printing the output from route add for all FIBs just print them
for the default FIB followed by a statement with a list of FIB numbers for
all the other FIBs we install the routes for.
tuexen [Mon, 12 Mar 2012 21:52:31 +0000 (21:52 +0000)]
MFC r232723,r232726:
Fix a bug reported by Peter Holm which results in a crash:
Verify in sctp_peeloff() that the socket is a one-to-many
style SCTP socket.
rstone [Sat, 10 Mar 2012 02:27:04 +0000 (02:27 +0000)]
MFC r230984:
Whenever a new kernel thread is spawned, explicitly clear any CPU affinity
set on the new thread. This prevents the thread from inadvertently
inheriting affinity from a random sibling.
kib [Wed, 7 Mar 2012 18:33:11 +0000 (18:33 +0000)]
Synchronize nullfs with HEAD, mostly merge all locking changes.
Tested by: pho
MFC r229428:
Document the state of the lowervp vnode for null_nodeget().
MFC r229431:
Do the vput() for the lowervp in the null_nodeget() for error case too.
Several callers of null_nodeget() did the cleanup itself, but several
missed it, most prominent being null_bypass(). Remove the cleanup from
the callers, now null_nodeget() handles lowervp free itself.
MFC r229600 (by dim):
In sys/fs/nullfs/null_subr.c, in a KASSERT, output the correct vnode
pointer 'lowervp' instead of 'vp', which is uninitialized at that point.
MFC r230304 (by rea):
Use hashdestroy() instead of naive free().
MFC r232299:
Move the code to destroy half-contructed nullfs vnode into helper
function null_destroy_proto() from null_insmntque_dtr(). Also
apply null_destroy_proto() in null_nodeget() when we raced and a vnode
is found in the hash, so the currently allocated protonode shall be
destroyed.
Lock the vnode interlock around reassigning the v_vnlock.
MFC r232301:
Always request exclusive lock for the lower vnode in nullfs_vget().
The null_nodeget() requires exclusive lock on lowervp to be able to
insmntque() new vnode.
MFC r232303:
In null_reclaim(), assert that reclaimed vnode is fully constructed,
instead of accepting half-constructed vnode. Previous code cannot decide
what to do with such vnode anyway, and although processing it for hash
removal, paniced later when getting rid of nullfs reference on lowervp.
While there, remove initializations from the declaration block.
MFC r232304:
Document that null_nodeget() cannot take shared-locked lowervp due to
insmntque() requirements.
MFC r232305:
Allow shared locks for reads when lower filesystem accept shared locking.
MFC r232383:
Do not expose unlocked unconstructed nullfs vnode on mount list.
Lock the native nullfs vnode lock before switching the locks.
kib [Tue, 6 Mar 2012 11:16:14 +0000 (11:16 +0000)]
MFC r232239:
Fix a race in top non-interactive mode. Use plain sleep(3) call instead
of arming timer and then pausing. If SIGALRM is delivered before pause(3)
is entered, top hangs.