Commit Graph

29341 Commits

Author SHA1 Message Date
Warner Losh
123049cf36 Don't forget to check the vendor when probing. Also, there's no need
to double check for if the card has probed before. In fact, there's no
reason to single check either. Simplify the code as a result.
$FreeBSD$ added to lxutil.c in a non-standard way to help keep the
diffs with upstream to a minimum.

Differential Revision: https://reviews.freebsd.org/D3263
2015-08-02 16:26:41 +00:00
Hans Petter Selasky
577c341353 Free mbufs when busdma loading fails.
Reviewed by:	erj, sbruno
MFC after:	1 month
2015-08-01 20:40:37 +00:00
Hans Petter Selasky
56d6361d92 Limit the number of times we loop inside the DWC OTG poll handler to
avoid starving other fast interrupts. Fix a comment while at it.

MFC after:	1 week
Suggested by:	Svatopluk Kraus <onwahe@gmail.com>
2015-07-31 09:12:31 +00:00
Navdeep Parhar
3d3169c858 cxgbe(4): initialize debug_flags from the kernel environment.
MFC after:	3 days
2015-07-31 04:50:47 +00:00
Oleksandr Tymoshenko
40ebf1626f Add GPIO backlight driver compatible with Linux FDT bindings.
Brightness is controlled through sysctl dev.gpiobacklight.X.brightness:
  - any value greater than 0: backlight is on
  - any value less than or equal to  0: backlight is off

FDT bindings docs in Linux tree:
    Documentation/devicetree/bindings/video/backlight/gpio-backlight.txt
2015-07-30 19:04:14 +00:00
Colin Percival
aaebf69062 Add support for Xen blkif indirect segment I/Os. This makes it possible for
the blkfront driver to perform I/Os of up to 2 MB, subject to support from
the blkback to which it is connected and the initiation of such large I/Os
by the rest of the kernel.  In practice, the I/O size is increased from 40 kB
to 128 kB.

The changes to xen/interface/io/blkif.h consist merely of merging updates
from the upstream Xen repository.

In dev/xen/blkfront/block.h we add some convenience macros and structure
fields used for indirect-page I/Os: The device records its negotiated limit
on the number of indirect pages used, while each I/O command structure gains
permanently allocated page(s) for indirect page references and the Xen grant
references for those pages.

In dev/xen/blkfront/blkfront.c we now check in xbd_queue_cb whether a request
is small enough to handle without an indirection page, and either follow the
previous behaviour or use new code for issuing an indirect segment I/O.  In
xbd_connect we read the size of indirect segment I/Os supported by the backend
and select the maximum size we will use; then allocate the pages and Xen grant
references for each I/O command structure.  In xbd_free those grants and pages
are released.

A new loader tunable, hw.xbd.xbd_enable_indirect, can be set to 0 in order to
disable this functionality; it works by pretending that the backend does not
support this feature.  Some backends exhibit a loss of performance with large
I/Os, so users may wish to test with and without this functionality enabled.

Reviewed by:	royger
MFC after:	3 days
Relnotes:	yes
2015-07-30 03:50:01 +00:00
Jim Harris
0e1fd2dda3 nvme: do not notify a consumer about failures that occur during initialization
MFC after:	3 days
Sponsored by:	Intel
2015-07-29 21:29:50 +00:00
Sean Bruno
e0fe6b4835 Add support for BCM5466 PHY
Differential Revision:	D3232
Submitted by:	kevin.bowling@kev009.com
2015-07-29 20:50:48 +00:00
Andrey V. Elsukov
cc0a3c8ca4 Convert in_ifaddr_lock and in6_ifaddr_lock to rmlock.
Both are used to protect access to IP addresses lists and they can be
acquired for reading several times per packet. To reduce lock contention
it is better to use rmlock here.

Reviewed by:	gnn (previous version)
Obtained from:	Yandex LLC
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D3149
2015-07-29 08:12:05 +00:00
Jean-Sébastien Pédron
133362912c drm/i915: Sort functions in i915_gem.c to match Linux 3.8's ordering
While here, reduce the style diff with Linux.

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after:	2 months
2015-07-28 21:47:37 +00:00
David C Somayajulu
ab97207add - Avoid lock contention in the if_transmit callback by using trylock and
enqueueing the frames when it fails. This way there is some latency
 removed from the transmitting path.
- If IFF_DRV_OACTIVE is set (and also if IFF_DRV_RUNNING is not) just
 enqueue the desired frames and return successful transmit. This way we
 avoid to return errors on transmit side and resulting in
 possible out-of-order frames. Please note that IFF_DRV_OACTIVE is set
 everytime we get the threshold ring hit, so this can be happening quite
 often.

Submitted by:	Attilio.Rao@isilon.com
MFC after:5 days
2015-07-28 19:15:44 +00:00
Zbigniew Bodek
8b21d6ae5a Limit ofw_cpu_early_foreach() to CPUs only
On some platforms, the /cpus node contains cpu-to-cluster
map which deffinitely is not a CPU node. Its presence was
causing incrementing of "id" variable and reporting more
CPUs available than it should.
To make "id" valid, increment it only when an entry really
is a CPU device.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3216
2015-07-28 13:16:08 +00:00
Hans Petter Selasky
ed0ed9b424 Optimise the DWC OTG host mode driver's receive path:
Remove NAKing limit and pause IN and OUT transactions for 125us in
case of NAK response for BULK and CONTROL endpoints. This gets the
receive latency down and improves USB network throughput at the cost
of some CPU usage.

MFC after:	1 month
2015-07-28 07:30:07 +00:00
Marcel Moolenaar
f40c76d8de Check the sync operation. 2015-07-28 04:54:05 +00:00
Marius Strobl
43bc87c459 - Move the remainder of host controller capability registers reading from
xhci_start_controller() to xhci_init(). These values don't change at run-
  time so there's no point of acquiring them on every USB_HW_POWER_RESUME
  instead of only once during initialization. In r276717, reading the first
  couple of registers in question already had been moved as a prerequisite
  for the changes in that revision.
- Identify ASMedia ASM1042A controllers.
- Use NULL instead of 0 for pointers.

MFC after:	3 days
2015-07-27 15:26:50 +00:00
Marius Strobl
891c57d8a9 - Fix compilation after r285909 with USB_DEBUG defined.
- Regenerate usb.conf.
2015-07-27 14:43:14 +00:00
Marius Strobl
d75accb539 - Use __FBSDID().
- Const'ify cons_to_vga_colors.
- Fix line wrapping.

MFC after:	3 days
2015-07-27 14:34:32 +00:00
Marius Strobl
0309276c28 - Nuke dupe $FreeBSD$.
- Fix whitespace.

MFC after:	3 days
2015-07-27 14:03:34 +00:00
Marius Strobl
fecf9642ba - Probe UICLASS_CDC/UISUBCLASS_ABSTRACT_CONTROL_MODEL/0xff again. This
variant of Microsoft RNDIS, i. e. their unofficial version of CDC ACM,
  has been disabled in r261544 for resolving a conflict with umodem(4).
  Eventually, in r275790 that problem was dealt with in the right way.
  However, r275790 failed to put probing of RNDIS devices in question
  back.
- Initialize the device prior to querying it, as required by the RNDIS
  specification. Otherwise already determining the MAC address may fail
  rightfully.
- On detach, halt the device again.
- Use UCDC_SEND_ENCAPSULATED_{COMMAND,RESPONSE}. While these macros are
  resolving to the same values as UR_{CLEAR_FEATURE,GET_STATUS}, the
  former set is way more appropriate in this context.
- Report unknown - rather: unimplemented - events unconditionally and
  not just in debug mode. This ensures that we'll get some hint of what
  is going wrong instead of the driver silently failing.
- Deal with the Microsoft ActiveSync requirement of using an input buffer
  the size of the expected reply or larger - except for variably sized
  replies - when querying a device.
- Fix some pointless NULL checks, style bugs etc.

This changes allow urndis(4) to communicate with a Microsoft-certified
USB RNDIS test token.

MFC after:	3 days
Sponsored by:	genua mbh
2015-07-27 12:14:14 +00:00
Marcel Moolenaar
b2ce196ca1 o make sure the boundary is a power of 2, when not zero.
o   don't convert 0 to ~0 just so that we can use MIN. ~0 is not a
    valid boundary. Introduce BNDRY_MIN that deals with 0 values
    that mean no boundary.
2015-07-26 16:39:37 +00:00
Michael Gmelin
ca2e4ecd73 isl(4), driver for Intersil I2C ISL29018 Digital Ambient Light Sensor
Differential Revision:	https://reviews.freebsd.org/D2811
Reviewed by:	adrian, wblock
Approved by:	adrian, wblock
Relnotes:	yes
2015-07-25 20:17:19 +00:00
Sean Bruno
a82cd51680 Remove unused txd_saved.
Intialize txd_upper, txd_lower and txd_used at declaration.

Differential Revision:	D3174
Reviewed by:	erj hiren
MFC after:	2 weeks
Sponsored by:	Limelight Networks
2015-07-25 19:24:33 +00:00
Michael Gmelin
46f07718f7 cyapa(4), driver for the Cypress APA I2C trackpad
Differential Revision:	https://reviews.freebsd.org/D3068
Reviewed by:	kib, wblock
Approved by:	kib
Relnotes:	yes
2015-07-25 18:14:35 +00:00
Oleksandr Tymoshenko
7339f7821b OF_getencprop_alloc shouldn't be used to get string value. If string
length + 1 is not divisible by 4 this function returns NULL property
value. Otherwise - string with each 4 letters inverted
2015-07-25 00:58:50 +00:00
Marius Strobl
86fb540033 - Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
uart_bus_attach() during its test that 20 iterations weren't sufficient
  for clearing all pending interrupts, assuming this means that hardware
  is broken and doesn't deassert interrupts. However, under pressure, 20
  iterations also can be insufficient for clearing all pending interrupts,
  leading to a panic as intr_event_handle() tries to schedule an interrupt
  handler not registered. Solve this by introducing a flag that is set in
  test mode and otherwise restores pre-r253161 behavior of uart_intr(). The
  approach of additionally registering uart_intr() as handler as suggested
  in PR 194979 is not taken as that in turn would abuse special pccard and
  pccbb handling code of intr_event_handle(). [1]
- Const'ify uart_driver_name.
- Fix some minor style bugs.

PR:		194979 [1]
Reviewed by:	marcel (earlier version)
MFC after:	3 days
2015-07-24 17:01:16 +00:00
Marius Strobl
e18e2adaae - In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing
raw data to the doorbell offset in order to clarify the intent and for
  avoiding unnecessarily converting the endianess back and forth.
  Unfortunately, the same can't be done in mpt_recv_handshake_reply() as
  16-bit data needs to be read using 32-bit bus accessors.
- In mpt_recv_handshake_reply(), get rid of a redundant variable.

MFC after:	1 fortnight
2015-07-24 16:00:35 +00:00
Warner Losh
d2e3ed5af6 Panic when a device is trying to recursively acquire rather than hang
indefinitely. Improve error messages from other panics.
2015-07-24 04:56:46 +00:00
Jeff Roberson
fade8dd714 Refactor unmapped buffer address handling.
- Use pointer assignment rather than a combination of pointers and
   flags to switch buffers between unmapped and mapped.  This eliminates
   multiple flags and generally simplifies the logic.
 - Eliminate b_saveaddr since it is only used with pager bufs which have
   their b_data re-initialized on each allocation.
 - Gather up some convenience routines in the buffer cache for
   manipulating buf space and buf malloc space.
 - Add an inline, buf_mapped(), to standardize checks around unmapped
   buffers.

In collaboration with: mlaier
Reviewed by:	kib
Tested by:	pho (many small revisions ago)
Sponsored by:	EMC / Isilon Storage Division
2015-07-23 19:13:41 +00:00
Jim Harris
cbdec09c1c nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable
PR:		200458
MFC after:	3 days
Sponsored by:	Intel
2015-07-23 15:50:39 +00:00
Jim Harris
de9a58f4ee nvme: properly handle case where pci_alloc_msix does not alloc all vectors
Reported by: Sean Kelly <smkelly@smkelly.org>
MFC after:	3 days
Sponsored by:	Intel
2015-07-23 15:35:08 +00:00
Conrad Meyer
6b8c5d92a4 vt: cpu logos: Correct reversed 0/1 beastie descriptions
Differential Revision:	https://reviews.freebsd.org/D3158
Approved by:	markj (mentor)
Obtained from:	Pavel Timofeev
MFC after:	1 week
2015-07-22 23:30:54 +00:00
Conrad Meyer
f39130e75d vt: Change default CPU logo to Orb
Differential Revision:	https://reviews.freebsd.org/D3156
Approved by:	markj (mentor)
MFC after:	1 week
2015-07-22 23:23:12 +00:00
Conrad Meyer
6d2b01fc54 vt: Default to cpu logos off
Apologies, this was how it was supposed to land. Mea culpa.

Differential Revision:	https://reviews.freebsd.org/D3157
Reviewed by:	gnn, hiren
Approved by:	markj (mentor)
MFC after:	1 week
2015-07-22 23:19:53 +00:00
Conrad Meyer
8ef2f53c59 vt_core.c: Use do/while to highlight missed semi-colon errors
Also, fix some nearby #define whitespace while here.

(Style cleanup for r285794.)

Suggested by:	jmg

Differential Revision:	https://reviews.freebsd.org/D3154
Approved by:	markj (mentor)
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-07-22 18:50:47 +00:00
Jung-uk Kim
0594dadeb8 Catch up with ACPICA 20150717. 2015-07-22 16:26:17 +00:00
Andrew Rybchenko
e31b688a57 sfxge: added fallbacks for pre 4.2.1 firmware support
Driver must be able to start against older firmware that is missing
recently added MCDI calls, otherwise firmware upgrade will not be
possible.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D3145
2015-07-22 16:25:18 +00:00
Conrad Meyer
5f7d6682c5 vt: Unbreak build on no-splash configurations
PR:		201751
Differential Revision:	https://reviews.freebsd.org/D3151
Tested by:	Andrey Fesenko
Approved by:	markj (mentor)
MFC after:	1 week
2015-07-22 15:30:10 +00:00
Zbigniew Bodek
0af6011a92 Introduce support for MSI-X interrupts in AHCI
- Allocate resources for MSI-X table and PBA if necessary
- Add function ahci_free_mem() to free all resources

Reviewed by:   jhb, mav
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3009
2015-07-22 09:46:22 +00:00
Wei Hu
5f302628d0 Do not enable UDP checksum offloading when running on the Hyper-V on
Windows Server 2012 and earlier hosts.

Submitted by: whu
Reviewed by: royger
Approved by: royger
MFC after: 3 days
Relnotes: No
Sponsored by: Microsoft OSTC
Differential Revision:  https://reviews.freebsd.org/D3086
2015-07-22 05:05:01 +00:00
Luiz Otavio O Souza
315dbfb053 Cosmetic change. When printing the child's mapped pins, use the plural
only when necessary.

Reported by:	Daniel O'Connor <darius@dons.net.au>,
		Sulev-Madis Silber (ketas)
2015-07-22 04:18:33 +00:00
Eric Joyner
39020fdfa0 Fix for a customer issue with ixl(4):
- Add required MAC/VLAN filter when adding an LAA
- Fix bug where code did not check for I40E_SUCCESS from a successful
  i40e_validate_mac_address() call in ixl_init_locked(), when setting
  an LAA.

PR: 201240
Differential Revision: https://reviews.freebsd.org/D3111
Submitted by: Gregory Rose <gregory.v.rose@intel.com>
Reviewed by: gnn, rstone
Approved by: gnn
MFC after: 2 weeks
2015-07-21 21:07:18 +00:00
Jim Harris
70fb74bd12 nvd: set d_delmaxsize to full capacity of NVMe namespace
The NVMe specification has no ability to specify a maximum delete size
that is less than the full capacity of the namespace - so just using the
namespace size is the correct value here.

This fixes reported issues where ZFS trim on init looked like it was
hanging the system - previously the default I/O max size (128KB on
Intel NVMe controllers) was used for delete operations which worked out
to only about 8MB/s.  With this patch I can add an 800GB DC P3700
drive to a ZFS pool in about 15-20 seconds.

Reported by: Dylan Just <dylan@techtangents.com>
MFC after:	3 days
Sponsored by:	Intel
2015-07-21 20:53:21 +00:00
Conrad Meyer
75ac3a7359 vt: Draw logos per CPU core
This feature is inspired by another Unix-alike OS commonly found on
airplane headrests.

A number of beasties[0] are drawn at top of framebuffer during boot,
based on the number of active SMP CPUs[1]. Console buffer output
continues to scroll in the screen area below beastie(s)[2].

After some time[3] has passed, the beasties are erased leaving the
entire terminal for use.

Includes two 80x80 vga16 beastie graphics and an 80x80 vga16 orb
graphic. (The graphics are RLE compressed to save some space -- 3x 3200
bytes uncompressed, or 4208 compressed.)

[0]: The user may select the style of beastie with

    kern.vt.splash_cpu_style=(0|1|2)

[1]: Or the number may be overridden with tunable kern.vt.splash_ncpu.
[2]: https://www.youtube.com/watch?v=UP2jizfr3_o
[3]: Configurable with kern.vt.splash_cpu_duration (seconds, def. 10).

Differential Revision:	https://reviews.freebsd.org/D2181
Reviewed by:	dumbbell, emaste
Approved by:	markj (mentor)
MFC after:	2 weeks
2015-07-21 20:33:36 +00:00
Conrad Meyer
bcfb2e3dd2 vt: De-static VT_SYSCTL_INT-defined objects
Explicitly mark existing VT_SYSCTL_INTs static. This is in preparation for
D2181.

Reviewed by:	dumbbell, emaste
Approved by:	markj (mentor)
MFC after:	1 week
2015-07-21 20:30:06 +00:00
Zbigniew Bodek
1fe6a1a25a Add support for vendor specific function for PCI devid acquisition in ITS
It is possible that some HW will use different PCI devids,
hence allow to replace the default domain🚌slot:func schema
by implementing and registering custom function.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3118
2015-07-21 14:47:23 +00:00
Hiren Panchasara
4d5e6ef665 Remove a couple of TUNABLE_INT() calls which are unnecessary after r267961.
r267961 did remove them but they "reappeared" when ixgbe(4) rewrite happened in
r280182.

Sponsored by:		Limelight Networks
2015-07-21 06:48:36 +00:00
Alexander Motin
d575325b81 Increase output amp on ASUS UX31A by +5dB.
While there, implement couple helper functions.
2015-07-20 17:48:00 +00:00
Marcel Moolenaar
be00e09818 Check the hw.proto.attach environment variable for devices that
proto(4) should attach to instead of the normal driver.

Document the variable.
2015-07-19 23:37:45 +00:00
Mark Murray
eda4aaeb3f Fix some untidy logic. I committed the wrong local fix; please pass the pointy hat.
Approved by:        so (/dev/random blanket)
2015-07-19 18:07:35 +00:00
Luigi Rizzo
847adfb7b3 add a use count so the netmap module cannot be unloaded while in use. 2015-07-19 18:07:25 +00:00