rwatson [Sun, 13 Jan 2013 16:43:59 +0000 (16:43 +0000)]
Merge Perforce changeset 219940 to head:
Rework altera_avgen(4) to cleanly(ish) separate nexus bus
attachment from the driver itself. This should allow us to
plug in an fdt attachment more easily.
rwatson [Sun, 13 Jan 2013 16:41:25 +0000 (16:41 +0000)]
Merge Perforce changeset 219939 to head:
Start restructuring of altera_avgen(4) so that it can have an FDT
attachment -- this requires first properly breaking out the current
nexus attachment from the driver implementation.
rwatson [Sun, 13 Jan 2013 16:27:56 +0000 (16:27 +0000)]
Partially merge Perforce changeset 219938 to head:
Write FDT attachment for the Terasic MTL (multitouch LCD) driver.
Exploit the fact that FDT allows multiple memory ranges to be
assigned to a device, giving us a cleaner description than
device.hints does.
Portions of this changeset that remove mtl from BERI device.hints and
add to DTS will be merged separately.
mav [Sun, 13 Jan 2013 14:30:37 +0000 (14:30 +0000)]
Improve support for disabled disks. If disabled disk disconnected and then
reconnected back, leave it as disconnected. If new disk inserted instead of
disabled, rebuild it and leave as enabled.
mav [Sat, 12 Jan 2013 21:51:49 +0000 (21:51 +0000)]
Windows handles INIT and VERIFY as array-wide and it doesn't specify which
disks should be rebuilt. Our rebuild code is same time disk-centric. To
handle this situation properly check all disks for RBLD flags, and if no
disk specified try rebuild/resync all of them except newly inserted.
mav [Sat, 12 Jan 2013 18:25:48 +0000 (18:25 +0000)]
Implement migration from single disk to RAID1/IRRT for Intel metadata.
Windows driver uses such migration when it creates new arrays. While GEOM
RAID has no mechanism to implement migration in general case, this specifc
case still can be handled easily via degraded RAID1 creation followed by
regular rebuild.
alc [Sat, 12 Jan 2013 18:06:21 +0000 (18:06 +0000)]
Define VM_KMEM_SIZE_MAX as a fraction of the kernel address space size
rather than a constant so that VM_KMEM_SIZE_MAX will scale automatically
with the kernel address space size. This is particularly important for
MIPS because the same definition is used by both 32- and 64-bit kernels.
nwhitehorn [Sat, 12 Jan 2013 16:23:16 +0000 (16:23 +0000)]
The new sade(8) is installed and works on all architectures, courtesy of
gpart having better portability than libdisk. Don't mark sade(8) as obsolete
on non-x86 systems.
rwatson [Sat, 12 Jan 2013 16:09:33 +0000 (16:09 +0000)]
Merge Perforce changeset 219933 and portions of 219962 (omits changes to
unmerged BERI DTS files) to head:
Use the OFW compatible string "mips,mips4k" rather than
"mips4k,cp0" for interrupt control using MIPS4k CP0.
Suggested by: thompsa
Implement a MIPS FDT PIC decode routine to use when no PIC has been
configured, which assumes a cascade back to the nexus bus (e.g.,
the on-board CP0 interrupt management parts on the MIPS). If the
soc bus in a MIPS DTS file is declared as "mips4k,cp0"-compatible,
then this will be enabled. This is sufficient to allow IRQs to be
configured on BERI.
rwatson [Sat, 12 Jan 2013 15:58:20 +0000 (15:58 +0000)]
Merge Perforce changeset 219925 to head:
Provided a bus_space implementation for FDT, modelled on
bus_space_generic, but with a local version of the map address
routine that does a P->V translation, as is the case with NLM's
similar routine for XLP. It's not clear to me that this is the
right solution -- possibly this belongs in simplebus -- however,
it is sufficient to get the DE4 LED driver working.
rwatson [Sat, 12 Jan 2013 15:53:45 +0000 (15:53 +0000)]
Merge Perforce chance 219924 to head:
In a sign of weakness, replicate the MIPS bus_space_generic.c to
produce a new FDT version, which will perform necessary address
space translation for bus_space -- the solution used in NLM's MIPS
FDT support, but possibly not quite the right thing. This is
inconsistent with regular I/O via the nexus and the generic
bus_space, which instead perform translation via pmap_mapdev()
when a resource is activated. However, it will work while I
attempt to identify what the right way to reconcile possible
approaches.
(Another approach might be to make simplebus use Nexus's activate
routine instead of a generic one?)
rwatson [Sat, 12 Jan 2013 13:20:21 +0000 (13:20 +0000)]
Merge Perforce change @219948 to head:
Add code so that the BERI boot process can ask the kernel linker for
DTB blobs that may have been left for it by the boot loader, as done
on PowerPC and ARM. This will require both a more mature boot
loader, and more mature boot loader argument passing mechanism,
than currently supported on BERI.
rwatson [Sat, 12 Jan 2013 12:34:59 +0000 (12:34 +0000)]
Merge Perforce change @219935 to head:
Initialise Openfirmware/FDT code earlier in the FreeBSD/beri boot,
so that the results will be available for configuring the console
UART (eventually).
mav [Sat, 12 Jan 2013 09:35:44 +0000 (09:35 +0000)]
Add basic support for Intel Rapid Recover Technology (Intel RRT).
It is alike to RAID1, but with dedicating master and recovery disks and
providing manual control over synchronization. It allows to use recovery
disk as snapshot of the master disk from the time of the last sync.
This implementation is not functionaly complete comparing to Windows,
but it is better then silent conversion to RAID1 on first boot.
imp [Fri, 11 Jan 2013 21:42:23 +0000 (21:42 +0000)]
Pass the device_t into atkbd_{probe,attach}_unit and get the
controller unit and keyboard unit from there. It will be needed
for other things in the future as well...
brooks [Fri, 11 Jan 2013 20:53:28 +0000 (20:53 +0000)]
Implement the -N <dbdir> option which allows an alternate passwd and
group file to be used. This is useful for installing on systems where
a user or group does not currently exist.
mav [Fri, 11 Jan 2013 16:10:11 +0000 (16:10 +0000)]
Do not schedule periph for payload/TUR requests if reprobe is in progress
to avoid sending extra READ CAPACITY requests by dastart(). Schedule periph
again on reprobe completion, or otherwise it may stuck indefinitely long.
This should fix USB explore thread hanging on device unplug, waiting for
periph destruction.
brooks [Fri, 11 Jan 2013 15:50:01 +0000 (15:50 +0000)]
In r244401 I accidently moved strunvis and strunvisx from version 1.0 to
1.3 breaking the libc ABI. Revert that change (breaking the ABI again
for users who updated after December 18th).
np [Fri, 11 Jan 2013 00:07:01 +0000 (00:07 +0000)]
Overhaul the stid allocator so that it can be used for IPv6 servers
too. The entry for an IPv6 server in the TCAM takes up the equivalent
of two ordinary stids and must be properly aligned too.
np [Thu, 10 Jan 2013 23:56:50 +0000 (23:56 +0000)]
cxgbe(4): Add functions to help synchronize "slow" operations (those not
on the fast data path) and use them instead of frobbing the adapter lock
and busy flag directly.
Other changes made while reworking all slow operations:
- Wait for the reply to a filter request (add/delete). This guarantees
that the operation is complete by the time the ioctl returns.
- Tidy up the tid_info structure.
- Do not allow the tx queue size to be set to something that's not a
power of 2.
dim [Thu, 10 Jan 2013 23:36:02 +0000 (23:36 +0000)]
Add an ugly hack to libgcc's unwind code, to make it behave properly at
runtime on amd64, when it is compiled by clang. Some versions of clang
don't save and restore all callee registers, if a __builtin_eh_return()
intrinsic is used in a function. This is particularly bad on amd64.
Until the problem gets fixed by upstream, use an asm statement to force
clang to assume the registers in question are clobbered, when invoking
__builtin_eh_return(), so it will emit code to save and restore them.
This should fix the crashes reported on -current with some C++ programs,
particularly those that throw exceptions over multiple function
boundaries.
mav [Thu, 10 Jan 2013 21:38:31 +0000 (21:38 +0000)]
Remove not very useful printf, that can be too chatty.
ASUS P8Z77-V board reports _AC2, _AC3 and _AC4 setpoints as 0C. With active
cooling already automatically set to _AC2, that still caused driver to print
two useless lines about temperature above _AC3 and _AC4 every ten seconds.
Three setponts of 0C is probably a board bug, but the same spam could happen
also in correct case if system is runnign not with the lowest cooling level.
brooks [Thu, 10 Jan 2013 19:46:08 +0000 (19:46 +0000)]
Rather than using zic to both compile and install zoneinfo files,
generate the files during the build and install them with install(1).
This was the one place in installworld where files (vs links) were
installed by a tool other than install.
delphij [Thu, 10 Jan 2013 19:26:56 +0000 (19:26 +0000)]
The current ZFS code expects ddt_zap_count to always succeed by asserting
the underlying zap_count() to return no errors. However, it is possible
that the pool reaches to such a state where zap_count would return error,
leading to panics when a pool is imported.
This commit changes the ddt_zap_count to return error returned from
zap_count and handle the error appropriately. With this change, it's now
possible to let zpool rollback damaged transaction groups and import the
pool.
imp [Thu, 10 Jan 2013 18:51:35 +0000 (18:51 +0000)]
Clang complains about the comparision of fak < 0 always being
false. It is right. Delete it because on the next line we catch all
'negative' cases with the test > 2, since 'negative' numbers are just
really big unsigned numbers and we do an identical action.
kib [Thu, 10 Jan 2013 18:24:48 +0000 (18:24 +0000)]
When nullfs mount is forcibly unmounted and nullfs vnode is reclaimed,
get back the leased write reference from the lower vnode. There is no
other path which can correct v_writecount on the lowervp.
Reported by: flo
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
smh [Thu, 10 Jan 2013 12:25:00 +0000 (12:25 +0000)]
Changed scsi_da device requests to use the sysctl tunable value for retry_count
and da_default_timeout where their current hardcoded values matched the current
default value for said tunables.
smh [Thu, 10 Jan 2013 11:57:46 +0000 (11:57 +0000)]
Updates delete_method sysctl changes to always maintain disk d_flags
DISKFLAG_CANDELETE. While this change makes this layer consistent
other layers such as UFS and ZFS BIO_DELETE support may not notice
any change made manually via these device sysctls until the device
is reopened via a mount.
hselasky [Thu, 10 Jan 2013 07:45:46 +0000 (07:45 +0000)]
Fix detection of Razer Copperhead as a USB mouse.
Factor out USB mouse and keyboard detection logic.
Reject USB keyboards which have mouse alike HID items
in their HID descriptors.
ae [Thu, 10 Jan 2013 00:10:24 +0000 (00:10 +0000)]
Simplify in6_setscope() function to get better performance.
Currently we use interface indeces as zone IDs for link-local and
interface-local scopes, and since we don't have any tool to configure
zone IDs, there is no need to acquire the afdata lock several times per
packet only to read if_index value.
So, now in6_setscope reads zone IDs for interface-local, link-local and
global scopes without a lock.
cxgbe(4): updates to the configuration file that controls how hardware
resources are partitioned.
- Reduce the number of virtual interfaces reserved for PF4. This leaves
spare room in the source MAC table and allows the driver to setup
filters that rewrite the source MAC address.
- Reduce the number of filters and use the freed up space for the CLIP
(Compressed Local IPv6 addresses) table. This is a prerequisite for
IPv6 TOE support which will follow separately in a series of commits.
jhb [Wed, 9 Jan 2013 20:27:06 +0000 (20:27 +0000)]
Don't drop options from the third retransmitted SYN by default. If the
SYNs (or SYN/ACK replies) are dropped due to network congestion, then the
remote end of the connection may act as if options such as window scaling
are enabled but the local end will think they are not. This can result in
very slow data transfers in the case of window scaling disagreements.
The old behavior can be obtained by setting the
net.inet.tcp.rexmit_drop_options sysctl to a non-zero value.
ume [Wed, 9 Jan 2013 18:18:08 +0000 (18:18 +0000)]
Add no_prefer_iface option.
It stops treating the address on the interface as special by source
address selection rule even when the interface is outgoing interface.
This is desired in some situation.
ken [Wed, 9 Jan 2013 17:02:08 +0000 (17:02 +0000)]
Make CTL work a little better with loading and unloading drivers.
Previously CTL would leave individual LUNs enabled in the target
driver, whether or not the port as a whole was enabled. It would
also leave the wildcard LUN enabled indefinitely.
This change means that CTL will enable and disable any active LUNs,
as well as the wildcard LUN, when enabling and disabling a port.
Also, fix a bug that could crop up due to an uninitialized CCB
type.
ctl.c: Before calling ctl_frontend_online(), run through
the LUN list and enable all active LUNs.
After calling ctl_frontend_offline(), run through
the LUN list and disble all active LUNs.
scsi_ctl.c: Before bringing a port online, allocate the
wildcard peripheral for that bus. And after taking
a port offline, invalidate the wildcard peripheral
for that bus.
Make sure that we hold the SIM lock around all
calls to xpt_action() and other transport layer
interfaces that require it.
Use CAM_SIM_{LOCK|UNLOCK} consistently to acquire
and release the SIM lock.
Update a number of outdated comments. Some of
these should have been fixed long ago.
Actually do LUN disbables now. The newer drivers
in the tree work correctly for this as far as I
know.
Initialize the CCB type to CTLFE_CCB_DEFAULT to
avoid a panic due to uninitialized memory.
ken [Wed, 9 Jan 2013 16:48:38 +0000 (16:48 +0000)]
Fix a bug in the device pager code that can trigger an assertion
in devfs if a particular race condition is hit in the device pager
code.
This was a side effect of change 227530 which changed the device
pager interface to call a new destructor routine for the cdev.
That destructor routine, old_dev_pager_dtor(), takes a VM object
handle.
The object handle is cast to a struct cdev *, and passed into
dev_rel().
That works in most cases, except the case in cdev_pager_allocate()
where there is a race condition between two threads allocating an
object backed by the same device. The loser of the race
deallocates its object at the end of the function.
The problem is that before inserting the object into the
dev_pager_object_list, the object's handle is changed from the
struct cdev pointer to the object's own address. This is to avoid
conflicts with the winner of the race, which already inserted an
object in the list with a handle that is a pointer to the same cdev
structure.
The object is then passed to vm_object_deallocate(), and eventually
makes its way down to old_dev_pager_dtor(). That function passes
the handle pointer (which is actually a VM object, not a struct
cdev as usual) into dev_rel(). dev_rel() decrements the reference
count in the assumed struct cdev (which happens to be 0), and
that triggers the assertion in dev_rel() that the reference count
is greater than or equal to 0.
The fix is to add a cdev pointer to the VM object, and use that
pointer when calling the cdev_pg_dtor() routine.
vm_object.h: Add a struct cdev pointer to the VM object
structure.
device_pager.c: In cdev_pager_allocate(), populate the new cdev
pointer.
In dev_pager_dealloc(), use the new cdev pointer
when calling the object's cdev_pg_dtor() routine.
The in6_setscope() function determines the scope zone id of an address
and embeds it into address. Inside the kernel we keep addresses with
embedded zone id only for two scopes: link-local and interface-local.
For other scopes this function is nop in most cases. To reduce an
overhead of locking, first check that address is capable for embedding.
Also, handle the loopback address before acquire the lock.