Commit Graph

93971 Commits

Author SHA1 Message Date
John Baldwin
c825d4dc50 Properly handle I/O windows in bridges with the ISA enable bit set. These
beasts still exist unfortunately.  More details can be found in other
references, but the short version is that bridges with this bit set ignore
I/O port ranges that alias to valid ISA I/O port ranges.  In the driver
this requires not allocating these alias regions from the parent device
(so they are free to be acquired by ISA devices), and ensuring no child
devices use resources from these alias regions.
- Change the pcib_window structure to allow for an array of backing
  resources rather than a single resource and update the existing code
  to cope with this.  Some of the coping requires using the saved
  base and limit values in pcib_window instead of using rman operations
  on the backing resource.
- Add special handling for allocating and adjusting the I/O port window
  of an ISA-enabled bridge to only allocate the non-alias ranges and
  add those to the associated resource manager.
- Reject I/O port allocations for a fixed request that conflicts with an
  ISA alias range.
- Remove the "no prefected decode" verbose printf during boot.  The absence
  of a "prefetched decode" line is sufficient.
- Replace the "subtractively decoded bridge" verbose printf with a single
  printf that lists all the "special" decoding modes of a bridge: ISA,
  subtractive, and VGA.
- Add a custom bus_release_resource() method to the PCI bus driver so that
  it can properly free resources for I/O windows of PCI-PCI bridges.
  (These resources are not stored in the bridge device's resource list.)

PR:		misc/179033
MFC after:	2 weeks
2013-07-18 15:17:11 +00:00
John Baldwin
c232b2aebb Rework the previous fix for the IB vs Ethernet sysctl handler to be more
generic and apply to all sysfs attributes:
- Use sysctl_handle_string() instead of reimplementing it.
- Remove trailing newline from the current value before passing it to
  userland and append a newline to the new string value before passing it
  to the attribute's store function.
- Don't leak the temporary buffer if the first error check triggers.
- Revert earlier change to mlx4 port mode handler.

PR:		kern/174213
Submitted by:	Garrett Cooper
Reviewed by:	Shakar Klein @ Mellanox
MFC after:	1 week
2013-07-18 14:06:01 +00:00
Xin LI
c92bc5e996 Manually merge part of vendor import r238583 from Illumos.
Illumos changeset: 13680:2bd022a765e2
Illumos ZFS issue:

    2671 zpool import should not fail if vdev ashift has increased

MFC after:	3 days
2013-07-18 00:22:42 +00:00
Jung-uk Kim
ba53f0d5ca Reload font when syscons(4) is resuming without switching mode.
Reported by:	adrian (more than a year ago)
Prodded by:	adrian (less than a month ago)
2013-07-17 23:29:56 +00:00
Jim Harris
8e0ac13f5a Use pause() instead of DELAY() when polling for completion of admin
commands during controller initialization.

DELAY() does not work here during config_intrhook context - we need to
explicitly relinquish the CPU for the admin command completion to
get processed.

Sponsored by:	Intel
Reported by:	Adam Brooks <adam.j.brooks@intel.com>
Reviewed by:	carl
MFC after:	3 days
2013-07-17 23:26:56 +00:00
Jim Harris
e8f25c6266 Define constants for the lengths of the serial number, model number
and firmware revision in the controller's identify structure.

Also modify consumers of these fields to ensure they only use the
specified number of bytes for their respective fields.

Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
2013-07-17 23:23:38 +00:00
John Baldwin
d356583dbc Remove check forbidding requests that would result in one port being set
to Ethernet and the subsequent port being set to IB.

Submitted by:	Shakar Klein @ Mellanox
Tested by:	Morgan Robertson <morganrobertson@gmail.com>
MFC after:	1 week
2013-07-17 13:41:54 +00:00
Konstantin Belousov
a8b0523ae7 Clear the vnode knotes before destroying vpollinfo.
Reported and tested by:	Patrick Lamaiziere <patfbsd@davenulle.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2013-07-17 10:56:21 +00:00
Pyun YongHyeon
29b44b096f Implement workaround for BCM5719/BCM5720 TX hang.
The read DMA request logic operation is based on having sufficient
available space in the transmit data buffer (TXMBUF) before a read
DMA can be requested.  There are four read DMA channels that use
the TXMBUF, and the logic checks if the available free space in the
TXMBUF is large enough for all the data in the four Send Buffers
for which buffer descriptors have been fetched.  The Enable_Request
signal is asserted only if the free TXMBUF space is larger than the
sum of the four DMA length registers.  The power-up default value
of BGE_RDMA_LSO_CRPTEN_CTRL register bit 25 (bit 21 on BCM5720) is
zero, which selects the DMA length registers to connect to the
input of the adder block.  The DMA length registers are
asynchronously reset following BCM5719/BCM5720 power-up, and due to
the lack of synchronous deassertion of the length registers reset
signal these resisters may contain uninitialized values following
the reset deassertion.
In the case of the failure the uninitialized DMA length register
values added up to more than the TXMBUF size, which prevented the
assertion of the Enable_Request signal and any subsequent read DMA
to start.  This lockup condition is the root cause of failing to
generate any transmit traffic.

To workaround the issue, select alternate output of multiplexers
and transmit the first four Ethernet frames. This overwrites the
DMA length registers with valid values.

Reported by:	Geans Pin <geanspin@broadcom.com>
Reviewed by:	Geans Pin <geanspin@broadcom.com>
2013-07-17 04:53:53 +00:00
Navdeep Parhar
92ad6ac7d4 Specify a timeout for the PL block.
MFC after:	3 days
2013-07-17 02:37:40 +00:00
Pyun YongHyeon
fcb1bf4153 Avoid magic constant.
No functional change.
2013-07-17 01:34:25 +00:00
Pyun YongHyeon
b9a17c6ce4 o TxD ring requires 8 bytes alignment to work so change alignment
constraint to 8. Previously it may have triggered watchdog
   timeouts.
 o Check whether interrupt is ours or not.
 o Enable interrupts before attemping to transmit queued packets.
   This will slightly improve TX performance.
 o No need to clear IFF_DRV_OACTIVE in a loop. AE_FLAG_TXAVAIL is
   used to know whether there are enough available TxD ring space.
 o Added missing bus_dmamap_sync(9) in ae_rx_intr() and rearranged
   code to avoid unncessary register access.
 o Make sure to clear TxD, TxS, RxD rings in driver initialization.
   Otherwise some data in these rings could be interpreted as
   'updated' which in turn will advance internally maintained
   pointers and can trigger watchdog timeouts.

PR:	kern/180382
2013-07-17 01:24:23 +00:00
Andrew Turner
5655a322c0 Fix vfp:
- We should check is_d32 to see howmany registers we have
 - In vfp_restore mark vfpscr as an output register

Without the second part it appears we can return the incorrect value from
vfp_bounce if the VFP condition flags are set as it may override the
register holding the return value.
2013-07-16 23:19:05 +00:00
Konstantin Belousov
31b67ab26e Add a tunable to force disable MSI use for xhci(4).
Requested and tested by:	delphij
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2013-07-16 20:14:23 +00:00
Andrew Turner
46e95f646c 2 years, 10 months, 22 days after the projects/arm_eabi branch was created
make the ARM EABI the default ABI on arm, armeb, armv6 and armv6eb.

This is intended to be the default ABI from now on with the old ABI to be
retired. Because of this all users are strongly suggested to upgrade to the
ARM EABI.

As the two ABIs are incompatible it is unlikely upgrading in place will
work. Users should perform a full backup and either use an external machine
to upgrade, or install to an alternative location on their media. They
should also reinstall all ports or packages when these are available.

The only known issues are:
 - pkg incorrectly detects the ABI. This is fixed upstream, and will a
   patch will be made to the port.
 - GDB can have issues with executables built with clang.

__FreeBSD_version has been bumped.
2013-07-16 19:15:19 +00:00
Andre Oppermann
ccd040ab18 Free the non-fatal "timestamp missing" debug string manually as it is
not covered by the catch-all free for the error cases.

Found by:	Coverity
2013-07-16 16:37:08 +00:00
John Baldwin
9a7bf07ccd Workaround some broken BIOSes that specify edge-sensitive but active-low
settings for ACPI-enumerated serial ports by forcing any IRQs that use
an ISA IRQ value with these settings to active-high instead of active-low.

This is known to occur with the BIOS on an Intel D2500CCE motherboard.

Tested by:	Robert Ames <robertames@hotmail.com>, lev
Submitted by:	Juergen Weiss weiss at uni-mainz.de (original patch)
2013-07-16 14:42:16 +00:00
Rui Paulo
6b06211196 Add urtwnfw. 2013-07-16 06:43:37 +00:00
Alexander Motin
e5736ac88c Make some improvements to r253322 to really rescan target, not a bus.
Add there and in two more places checks for NULL on xpt_alloc_ccb_nowait().
2013-07-15 18:17:31 +00:00
Kenneth D. Merry
d993ba1291 Fix an argument reversal in calls to scsi_read_element_status().
Reported by:	Ulrich Spoerlein <uqs@FreeBSD.org>
MFC after:	3 days
2013-07-15 16:38:48 +00:00
Andrey V. Elsukov
dbd4437b06 Include sys/systm.h after sys/param.h.
Suggested by:	pluknet
2013-07-15 15:40:57 +00:00
Gleb Smirnoff
59b9c4f289 Nuke mbstat. It wasn't used for mbuf statistics since FreeBSD 5.
Now that r253351 moved sendfile() stats to a separate struct, the
last field used in mbstat is m_mcfail, which is updated, but never
read or obtained from userland.
2013-07-15 12:18:36 +00:00
Rui Paulo
9c9a49c494 Move the Raspberry Pi low level options out of the kernel config and into
std.rpi + std.bcm2835.

Reviewed by:	imp
2013-07-15 07:01:30 +00:00
Konstantin Belousov
0f6bcda4cd MFi386: add ddb "show sysregs" command.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-07-15 06:30:57 +00:00
Andrey V. Elsukov
05d1f5bce0 Introduce new structure sfstat for collecting sendfile's statistics
and remove corresponding fields from struct mbstat. Use PCPU counters
and SFSTAT_INC() macro for update these statistics.

Discussed with:	glebius
2013-07-15 06:16:57 +00:00
Craig Rodrigues
67272c5a55 PR: kern/168520
Revert GRN 253255.  It is not needed now that GRN 253346 is committed.
2013-07-15 01:41:34 +00:00
Craig Rodrigues
719fb72517 PR: 168520 170096
Submitted by: adrian, zec

Fix multiple kernel panics when VIMAGE is enabled in the kernel.
These fixes are based on patches submitted by Adrian Chadd and Marko Zec.

(1)  Set curthread->td_vnet to vnet0 in device_probe_and_attach() just before calling
     device_attach().  This fixes multiple VIMAGE related kernel panics
     when trying to attach Bluetooth or USB Ethernet devices because
     curthread->td_vnet is NULL.

(2)  Set curthread->td_vnet in if_detach().  This fixes kernel panics when detaching networking
     interfaces, especially USB Ethernet devices.

(3)  Use VNET_DOMAIN_SET() in ng_btsocket.c

(4)  In ng_unref_node() set curthread->td_vnet.  This fixes kernel panics
     when detaching Netgraph nodes.
2013-07-15 01:32:55 +00:00
Pedro F. Giffuni
c230e70881 Update fuse_kernel header.
Bring in the changes from the FUSE kernel interface 7.10
(available under a BSD license).

After 7.10 the linux FUSE developers added support for a
controversial CUSE driver and some linux especific
features that are unlikely to find its way into FreeBSD.

We currently don't implement any of the new features so we
are *not* bumping the FUSE_KERNEL_MINOR_VERSION. The header
should, nevertheless, serve  as a template to add the new
features in a compatible manner.

While here adopt some minor cleanups from the upstream version
like removing FUSE_MAJOR and FUSE_MINOR which were never
used. Also add multiple inclusion header guards,
2013-07-15 00:05:27 +00:00
Kirk McKusick
fdd9a6f478 Update to comments describing block allocation policy.
Submitted by: Bruce Evans
2013-07-14 18:44:33 +00:00
Rui Paulo
fc4153c26f Revert r252725 as it breaks WPA.
We need to fix wpa_supplicant because it checks whether the card has
ic_cryptocaps set. Since net80211 can do software encryption this check in
wpa_supplicant is wrong.
2013-07-14 18:26:47 +00:00
Hans Petter Selasky
a40a377cc7 Add some missing LIBUSB IOCTL conversion codes. 2013-07-14 10:13:01 +00:00
Hans Petter Selasky
0ccd2fb09e Allow regular off-the-shelf keyboards to be overclocked like so-called
"Gamers Keyboards" by adding a tunable, "hw.usb.ukbd.pollrate", which
can fix the polling rate of the attached USB keyboards in the range
1..1000Hz. A similar feature already exists in the USB mouse
driver. Use with care! Might leave you without keyboard input. This
feature is only available when the USB_DEBUG option is set in the
kernel configuration file.

Correct "unit" type to "int" while at it.
2013-07-13 22:39:56 +00:00
Pedro F. Giffuni
da7d8f2a65 Add creation timestamp (birthtime) support for fuse.
I was keeping this #ifdef'd for reference with the MacFUSE change[1]
but on second thought, this is a FreeBSD-only header so the SVN
history should be enough.

Add missing padding while here.

Reference [1]:
http://code.google.com/p/macfuse/source/detail?spec=svn1686&r=1360
2013-07-13 22:06:41 +00:00
Matt Jacob
22629d2996 When fiddling with options of which registers to copy out for
a mailbox command and which registers to copy back in when
the command completes, the bits being set need to not only
specify what bits you want to add from the default from the
table but also what bits you want *subtract* (mask) from the
default from the table.

A failing ISP2200 command pointed this out.

Much appreciation to: marius, who persisted and narrowed down what
the failure delta was, and shamed me into actually fixing it.
MFC after:	1 week
2013-07-13 21:24:25 +00:00
Konstantin Belousov
3c901a9040 Create a proper stack frame for i386 version of bcopy(), despite the
function is leaf.  The frame allows ddb to not loose the direct caller
of bcopy() in backtrace.

Other functions from support.s would benefit from the same change as
well, but for now bcopy() is the most frequent offender.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-07-13 19:42:52 +00:00
Konstantin Belousov
982d771242 Assert that runningbufspace does not underflow.
Sponsored by:	The FreeBSD Foundation
2013-07-13 19:36:18 +00:00
Konstantin Belousov
da4ca6c8ab There is no need to count waiters for the runningbufspace.
Sponsored by:	The FreeBSD Foundation
2013-07-13 19:34:34 +00:00
Konstantin Belousov
c7c536c7f5 Allow to call clock_gettime() on the clock id for zombie process.
Reported by:	Petr Salinger <Petr.Salinger@seznam.cz>
PR:	threads/180496
Sponsored by:	The FreeBSD Foundation
2013-07-13 19:32:50 +00:00
Alexander Motin
3cbe36aed2 When printing opcode description, map T_NODEVICE to Direct Access Device to
handle REPORT LUNS, etc.
2013-07-13 15:34:37 +00:00
Alexander Motin
0181d54b6b Improve handling of 0x3F/0x0E "Reported LUNs data has changed" and 0x25/0x00
"Logical unit not supported" errors.  First initiates specific target rescan,
second -- destroys specific LUN.  That allows to automatically detect changes
in list of device LUNs.  This mechanism doesn't work when target is completely
idle, but probably that is all what can be done without active polling.

Reviewed by:	ken
Sponsored by:	iXsystems, Inc.
2013-07-13 13:35:09 +00:00
Rui Paulo
ae230e21f9 Fix the urtwnfw definitions. We can now use urtwnfw in kernel config files. 2013-07-13 07:17:18 +00:00
Justin Hibbits
8e2ad3d7e8 Clean up the modules list for PowerPC. powerpc64 has MACHINE_CPUARCH of
powerpc.  While here, sort the list.
2013-07-13 07:16:45 +00:00
Adrian Chadd
31402c27b8 Bring over some link aggregation / LACP protocol improvements and debugging
additions.

* Add some new tracing events to aid in debugging.
* Add in a debugging mode to drop transmit and received frames, specifically
  to test whether seeing or hearing heartbeats correctly cause LACP to
  drop the port.
* Add in (and make default) a strict LACP mode, which requires the
  heartbeat on a port to be heard before it's used.  Sometimes vendor ports
  will hang but the link layer stays up, resulting in hung traffic.
* Add logging the number of link status flaps, again to aid in debugging
  badly behaving switch ports.
* Calculate the lagg interface port speed as the multiple of the
  configured ports, rather than the largest.

Obtained from:	Netflix
MFC after:	2 weeks
2013-07-13 04:25:03 +00:00
Rui Paulo
8945bee0c7 Indent the "scp=... rlv=..." to make it easier to read the backtrace. 2013-07-13 00:39:07 +00:00
Scott Long
8e448c38b1 Const-ify the new da_delete_functions.
Remove a redundant sanity check

Submitted by:	Steven Hartland
Obtained from:	Netflix
MFC after:	3 days
2013-07-12 23:20:11 +00:00
Jack F Vogel
a1db87ec73 Change the E1000 driver option header handling to match the
ixgbe driver. As it was, when building them as a module INET
and INET6 are not defined. In these drivers it does not cause
a panic, however it does result in different behavior in the
ioctl routine when you are using a module vs static, and I
think the behavior should be the same.

MFC after: 3 days
2013-07-12 22:36:26 +00:00
Xin LI
76505954aa Merge from hpt27xx, r249468 (mav):
MFprojects/camlock r248982:
Stop abusing xpt_periph in random plases that really have no periph related
to CCB, for example, bus scanning.  NULL value is fine in such cases and it
is correctly logged in debug messages as "noperiph".  If at some point we
need some real XPT periphs (alike to pmpX now), quite likely they will be
per-bus, and not a single global instance as xpt_periph now.
2013-07-12 21:36:29 +00:00
Jack F Vogel
bae4b87e8a Opps, need to change the VF code as well.
MFC after:	ASAP
2013-07-12 21:21:15 +00:00
Jack F Vogel
ee738eea01 Remove the conditional define around the option headers,
when building the driver as a module the result of the present
system results in INET and INET6 being undefined, and will cause
the panic in ixgbe_tso_setup(). The Makefile in the module directory
now renders the conditional in the source unnecessary and wrong.

MFC after: ASAP - the panic as a module must not get into 9.2
2013-07-12 21:14:42 +00:00
Mikolaj Golub
f122b319eb A complete duplication of binding should be allowed if on both new and
duplicated sockets a multicast address is bound and either
SO_REUSEPORT or SO_REUSEADDR is set.

But actually it works for the following combinations:

  * SO_REUSEPORT is set for the fist socket and SO_REUSEPORT for the new;
  * SO_REUSEADDR is set for the fist socket and SO_REUSEADDR for the new;
  * SO_REUSEPORT is set for the fist socket and SO_REUSEADDR for the new;

and fails for this:

  * SO_REUSEADDR is set for the fist socket and SO_REUSEPORT for the new.

Fix the last case.

PR:		179901
MFC after:	1 month
2013-07-12 19:08:33 +00:00