hselasky [Fri, 24 Jun 2011 02:30:02 +0000 (02:30 +0000)]
- Move all USB device ID arrays into so-called sections,
sorted according to the mode which they support:
host, device or dual mode
- Add generic tool to extract these data:
tools/bus_autoconf
Discussed with: imp
Suggested by: Robert Millan <rmh@debian.org>
PR: misc/157903
MFC after: 14 days
nwhitehorn [Thu, 23 Jun 2011 22:21:28 +0000 (22:21 +0000)]
Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64)
instead of a PCPU field for curthread. This averts a race on SMP systems
with a high interrupt rate where the thread looking up the value of
curthread could be preempted and migrated between obtaining the PCPU
pointer and reading the value of pc_curthread, resulting in curthread being
observed to be the current thread on the thread's original CPU. This played
merry havoc with the system, in particular with mutexes. Many thanks to
jhb for helping me work this one out.
Note that Book-E is in principle susceptible to the same problem, but has
not been modified yet due to lack of Book-E hardware.
nwhitehorn [Thu, 23 Jun 2011 16:34:41 +0000 (16:34 +0000)]
Clear any outstanding atomic reservations when traps are taken. This fixes
some interesting bugs (mostly on SMP systems) with atomic operations
silently failing in interrupt heavy situations, especially when using
overflow pages.
marcel [Thu, 23 Jun 2011 16:21:43 +0000 (16:21 +0000)]
Unblock the outgoing thread after we performed pmap_switch() to
switch the region registers. pmap_switch() returns the pmap for
which the region register are currently programmed, which needs
to be re-programmed on the CPU the ougoing thread gets switched
in. This change does not noticibly change anything or fix known
bugs, but does give me a warm fuzzy feeling by being more
correct.
jhb [Thu, 23 Jun 2011 15:53:17 +0000 (15:53 +0000)]
The recent change to increase the zfsboot size to 64k made a few BIOSes
unhappy (probably they don't handle crossing the 64k boundary, etc.).
Fix this by changing zfsldr to use a loop reading from the disk one
sector at a time. To avoid trashing the saved copy of the MBR which is
used for disk I/O, read zfsboot2 at address 0x9000. This has the
advantage that BTX no longer needs to be relocated as it is read into
the correct location. However, the loop to relocate zfsboot2.bin can
now cross a 64k boundary, so change it to use relative segments instead.
(This will need further work if zfsboot2.bin ever exceeds 64k.)
While here, stop storing a relocated copy of zfsldr at 0x700. This was
only used by the xread hack which has recently been removed (and even
that use was dubious). Also, include the BIOS error code as hex when
reporting read errors to aid in debugging.
Much thanks to Henri Hennebert for patiently testing various iterations
of the patch as well as fixing the zfsboot2.bin relocation to use
relative segments.
hselasky [Thu, 23 Jun 2011 07:54:03 +0000 (07:54 +0000)]
- Add more USB templates for various USB device classes
- Add basic template support for USB 3.0
- Export definition of template sysctl numbers through usb_ioctl.h
adrian [Thu, 23 Jun 2011 06:55:29 +0000 (06:55 +0000)]
Re-introduce a global ath_hal_debug again for now, whilst I figure out what
to do about the few cases where the HAL state isn't available (regdomain)
or isn't yet setup (probe/attach.)
The global ath_hal_debug now affects all instances of the HAL.
This also restores the ability for probe/attach debugging to work; as
the sysctl tree may not be attached at that point. Users can just set
the global "hw.ath.hal.debug" to a suitable value to enable probe/attach
related debugging.
alc [Thu, 23 Jun 2011 05:23:59 +0000 (05:23 +0000)]
Revert to using the page queues lock in vm_page_clear_dirty_mask() on
MIPS. (At present, although atomic_clear_char() is defined by atomic.h
on MIPS, it is not actually implemented by support.S.)
nwhitehorn [Thu, 23 Jun 2011 04:35:45 +0000 (04:35 +0000)]
Use atomic operations to mask and unmask IRQs. This prevents a problem
(obvious in retrospect) in which interrupts on one CPU that are temporarily
masked can end up permanently masked when a handler on another CPU clobbers
the interrupt mask register with an old copy.
adrian [Thu, 23 Jun 2011 02:38:36 +0000 (02:38 +0000)]
Break out most of the HAL related tweaks into a per-HAL instance,
rather than global variables.
This specifically allows for debugging to be enabled per-NIC, rather
than globally.
Since the ath driver doesn't know about AH_DEBUG, and to keep the ABI
consistent regardless of whether AH_DEBUG is enabled or not, enable the
debug parameter always but only conditionally compile in the debug
methods if needed.
The ALQ support is currently still global pending some brainstorming.
will [Wed, 22 Jun 2011 21:43:10 +0000 (21:43 +0000)]
Plumb support for the device advanced information CCB in the ATA XPT.
This was previously done only for SCSI XPT in r223081, on which the change
in r223089 depended in order to respond to serial number requests. As a
result of r223089, da(4) and ada(4) devices register a d_getattr for geom to
use to obtain the information.
rmacklem [Wed, 22 Jun 2011 21:10:12 +0000 (21:10 +0000)]
Plug an mbuf leak in the new NFS client that occurred when a
server replied NFS3ERR_JUKEBOX/NFS4ERR_DELAY to an rpc.
This affected both NFSv3 and NFSv4. Found during testing
at the recent NFSv4 interoperability Bakeathon.
jhb [Wed, 22 Jun 2011 21:04:13 +0000 (21:04 +0000)]
Move {amd64,i386}/pci/pci_bus.c and {amd64,i386}/include/pci_cfgreg.h to
the x86 tree. The $PIR code is still only enabled on i386 and not amd64.
While here, make the qpi(4) driver on conditional on 'device pci'.
ae [Wed, 22 Jun 2011 20:00:27 +0000 (20:00 +0000)]
Export AddLink() function from libalias. It can be used when custom
alias address needs to be specified.
Add inbound handler to the alias_ftp module. It helps handle active
FTP transfer mode for the case with external clients and FTP server behind
NAT. Fix passive FTP transfer case for server behind NAT using redirect with
external IP address different from NAT ip address.
PR: kern/157957
Submitted by: Alexander V. Chernikov
rmacklem [Wed, 22 Jun 2011 19:47:45 +0000 (19:47 +0000)]
Fix the new NFSv4 client so that it uses the same uid as
was used for doing a mount when performing system operations
on AUTH_SYS mounts. This resolved an issue when mounting
a Linux server. Found during testing at the recent
NFSv4 interoperability Bakeathon.
jkim [Wed, 22 Jun 2011 16:40:45 +0000 (16:40 +0000)]
Set negative quality to TSC timecounter when C3 state is enabled for Intel
processors unless the invariant TSC bit of CPUID is set. Intel processors
may stop incrementing TSC when DPSLP# pin is asserted, according to Intel
processor manuals, i. e., TSC timecounter is useless if the processor can
enter deep sleep state (C3/C4). This problem was accidentally uncovered by
r222869, which increased timecounter quality of P-state invariant TSC, e.g.,
for Core2 Duo T5870 (Family 6, Model f) and Atom N270 (Family 6, Model 1c).
Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de)
Ian FREISLICH (ianf at clue dot co dot za)
Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de)
- Core2 Duo T5870 (C3 state available/enabled)
jkim - Xeon X5150 (C3 state unavailable)
jhb [Wed, 22 Jun 2011 16:15:15 +0000 (16:15 +0000)]
Add a helper routine to conditionally modify the start address of a
resource allocation from an x86 Host-PCI bridge driver so that it can be
reused by the ACPI Host-PCI bridge driver (and eventually the MPTable
Host-PCI bridge driver) instead of duplicating the same logic. Note that
this means that hw.acpi.host_mem_start is now replaced with the
hw.pci.host_mem_start tunable that was already used in the non-ACPI case.
This also removes hw.acpi.host_mem_start on ia64 where it was not
applicable (the implementation was very x86-specific).
While here, adjust the logic to apply the new start address on any
"wildcard" allocation even if that allocation comes from a subset of
the allowable address range.
yongari [Wed, 22 Jun 2011 02:18:45 +0000 (02:18 +0000)]
Remove link state change callback handler. There is no need to
register both status change and link state change callbacks.
Implement checking valid link in state change callback and poll
active link state in vr_tick(). This allows immediate detection of
lost link as well as protecting driver from frequent link flips during
link renegotiation. taskq implementation was removed because driver
now needs to poll link state in vr_tick().
While I'm here do not report current link state if interface is not
running.
imp [Tue, 21 Jun 2011 22:45:31 +0000 (22:45 +0000)]
Minor cleanup:
o Consider No CIS a normal event and stop whining about it so much
(too many cards are like this, espeically usb/firewire cards).
o Add comments to the cis reading code.
o Made the read from config space a smidge easier to read and eliminate
a loop that can be done mathematically.
rmacklem [Tue, 21 Jun 2011 21:07:33 +0000 (21:07 +0000)]
Change the NFSv4 nfsuserd(8) daemon so that it doesn't preload the
uid<->username mapping cache with an entry when another entry
for that uid is already loaded. This fixes a case where the
mapping of "toor" would replace "root" when the daemon was started,
resulting in no mapping for "root" until the cache entry for "toor"
timed out.
The algorithm is inefficient, but since it is only done once when
the daemon is started up, I don't think that's an issue.
imp [Tue, 21 Jun 2011 20:52:55 +0000 (20:52 +0000)]
Supress command completion failure warning when the card isn't
present. Only call the bus to check if we actually do timeout so we
don't affect the normal case (since this case needn't be optimized and
this guards against all races).
marius [Tue, 21 Jun 2011 20:48:14 +0000 (20:48 +0000)]
On machines where we don't need to lock the kernel TSB into the dTLB and
thus may basically use the entire 64-bit kernel address space reduce
VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory.
marius [Tue, 21 Jun 2011 20:47:03 +0000 (20:47 +0000)]
On machines where we don't need to lock the kernel TSB into the dTLB and
thus may basically use the entire 64-bit kernel address space increase
the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX.
rmacklem [Tue, 21 Jun 2011 19:58:29 +0000 (19:58 +0000)]
Fix the new NFSv4 server so that it checks for VREAD_ACL when
a client does a Getattr for an ACL and not VREAD_ATTRIBUTES.
This was found during the recent NFSv4 interoperability Bakeathon.
jhb [Tue, 21 Jun 2011 19:29:27 +0000 (19:29 +0000)]
Use AcpiWalkResources() to parse the resource list from _CRS rather than
using a home-rolled loop. While here, add support for 64-bit address
range resources.
ae [Tue, 21 Jun 2011 10:35:20 +0000 (10:35 +0000)]
When user specifies the bootcode with size smaller than VTOC_BOOTCODE,
gpart_write_partcode_vtoc8 does access out of range of allocated memory.
Check size of bootcode before writing it.
imp [Tue, 21 Jun 2011 03:07:59 +0000 (03:07 +0000)]
When we see an interrupt status of 0xffffffff, check to see if the
child is still present. If not, return 'handled' and don't print
anything (this is expected behavior). We expect an interrupt on eject,
power-down and/or shutdown.
imp [Tue, 21 Jun 2011 03:05:17 +0000 (03:05 +0000)]
Mark the card as bad on shutdown. This means that bus_child_present
will return false on shutdown and massive spewage from usb disappears
for usb cardbus adapters.
jfv [Mon, 20 Jun 2011 22:59:29 +0000 (22:59 +0000)]
Eliminate some global tuneables in favor of adapter-specific,
particular flow control and dma coalesce. Also improve the
sysctl operation on those too.
Add IPv6 detection in the ioctl code, this was done for
ixgbe first, carrying that over.
Add resource ability to disable particular adapter.
Add HW TSO capability so vlans can make use of TSO
rmacklem [Mon, 20 Jun 2011 22:02:01 +0000 (22:02 +0000)]
Fix the new NFSv4 server so that it only allows Lookup of
directories and symbolic links when traversing non-exported
file systems. Found during the recent NFSv4 interoperability
Bakeathon.
rmacklem [Mon, 20 Jun 2011 21:57:26 +0000 (21:57 +0000)]
Fix the new NFSv4 server so that it allows Access and Readlink
operations while traversing non-exported file systems. This is
required for some non-FreeBSD clients to do NFSv4 mounts. Found during
the recent NFSv4 interoperability Bakeathon.
ae [Mon, 20 Jun 2011 12:22:30 +0000 (12:22 +0000)]
Change the way how we update bootcode for BSD scheme.
Since the only parameter that we check is size of bootcode, then
allow only two sizes: size of boot1 and size of /boot/boot.
This partially protects users from losing ability to boot if incorrect
bootcode is specified.
adrian [Mon, 20 Jun 2011 11:46:03 +0000 (11:46 +0000)]
Add a callback for ADDBA response timeouts.
TX for the given TID needs to be paused during ADDBA requests (and unpaused
once the session is established.) Since net80211 currently doesn't implement
software aggregation, if this pause/unpause is done in the driver (as it
is in my development branch) then it will need to be unpaused both on
ADDBA response and on ADDBA timeout.
This callback allows the driver to unpause TX for the relevant TID.
bz [Mon, 20 Jun 2011 07:07:18 +0000 (07:07 +0000)]
Fix a KASSERT from r212803 to check the correct length also in case of
IPsec being compiled in and used. Improve reporting by adding the length
fields to the panic message, so that we would have some immediate debugging
hints.
jeff [Mon, 20 Jun 2011 03:25:09 +0000 (03:25 +0000)]
- Fix directory count rollbacks by passing the mode to the journal dep
earlier.
- Add rollback/forward code for frag and cluster accounting.
- Handle the FREEDEP case in softdep_sync_buf(). (submitted by pho)
nwhitehorn [Mon, 20 Jun 2011 00:46:07 +0000 (00:46 +0000)]
Add an OHCI driver to complement the EHCI one. The infrastructure to attach
both to the parent ps3bus was in r223313. This driver itself comes from the
ps3 project branch.
nwhitehorn [Mon, 20 Jun 2011 00:17:44 +0000 (00:17 +0000)]
Driver for PS3's internal hard disk. Hopefully this can be CAM-ified in
the future, but presents a set of simple block devices for now. With
(forthcoming) boot loader support or vfs.root.mountfrom, allows booting
PS3s from disk.
rmacklem [Sun, 19 Jun 2011 23:54:01 +0000 (23:54 +0000)]
Fix a number of places where the new NFS server did not
lock the mutex when manipulating rc_flag in the DRC cache.
This is believed to fix a hung server that was reported
to the freebsd-fs@ list on June 9 under the subject heading
"New NFS server stress test hang", where all the threads
were waiting for the RC_LOCKED flag to clear.
Tested by: jwd at slowblink.com
MFC after: 2 weeks