Commit Graph

115751 Commits

Author SHA1 Message Date
Alexander Motin
94792a2c25 Remove some locking not needed for modern CAM.
This driver is full of LORs.  This change allows to reduce deadlock chance
from 100% to level that allows some tests to be done.

MFC after:	2 weeks
2017-02-28 05:24:06 +00:00
Alexander Motin
0e672f795e Add safety check against too long CDB.
SBP-2 specification defined maximum CDB length as 12 bytes.  Newer SBP-3
specification allows CDB of any size, but this driver is too old.  Proper
solution would be to look on maximal ORB size supported by the target.

MFC after:	1 week
2017-02-28 05:17:50 +00:00
Gleb Smirnoff
efe3b0de14 Remove SVR4 (System V Release 4) binary compatibility support.
UNIX System V Release 4 is operating system released in 1988. It ceased
to exist in early 2000-s.
2017-02-28 05:14:42 +00:00
Enji Cooper
d61db6be37 Use "build" instead of "all" when building ports modules
"all" in ports currently means "stage the ports", which requires root today,
and brings to light other potential issues, like ENAMETOOLONG with staged
directories (bug 161481, etc).

This fixes buildkernel for me when run as a non-root user, assuming all
of the prerequisites have been installed beforehand and are up-to-date.

MFC after:	1 month
Discussed with:	swills (IRC)
Sponsored by:	Dell EMC Isilon
2017-02-28 04:48:30 +00:00
Justin Hibbits
15fc4ab7fc Make kernel breakpoints work for book-e
Add the necessary bits to enable kernel breakpoints for Book-E.  The entrypoint
for program exception is very trivial, so rather than expand it to be similar to
AIM, add it into the standard trap handler.

This wasn't blocked out as Book-E specific because it is only a minor redundancy
over AIM, which should have already called db_trap_glue() at this point.  If
it's going to panic with a fatal trap anywya, it doesn't matter if it goes
through this path again.
2017-02-28 04:31:28 +00:00
Justin Hibbits
b3ae819e0a Unbreak kernel breakpoints, broken for ~4 years now
When committing DTrace in 2012/2013 era I inadvertently broke breakpoints, by
setting EXC_DTRACE to the same value as BKPT_INST.  Change EXC_DTRACE to a
different, yet logically identical, trap (tw <all>,31,31).

MFC after:	2 weeks
2017-02-28 04:13:20 +00:00
Stephen Hurd
bad52b1658 bnxt: propagate RSS hash type to the network stack.
RSS hash type will be used to identify the CPU on to which, a receive packet
will be queued.  This patch extracts the "RSS hash type" from the receive
completion and sends it to the stack.

Submitted by:	Venkatkumar Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed by:	shurd
Approved by:	sbruno
MFC after:	1 week
Sponsored by:	Broadcom Limited
Differential Revision:	https://reviews.freebsd.org/D9685
2017-02-28 02:27:51 +00:00
David C Somayajulu
7a1297c821 1. state checks in bxe_tx_mq_start_locked() and bxe_tx_mq_start() to sync threads during interface down or detach.
2. add sysctl to set pause frame parameters
3. increase max segs for TSO packets to BXE_TSO_MAX_SEGMENTS (32)
4. add debug messages for PHY
5. HW LRO support restricted to FreeBSD versions 8.x and above.

Submitted by:Vaishali.Kulkarni@cavium.com
MFC after:5 days
2017-02-27 23:38:51 +00:00
Ruslan Bukin
c214a270f5 Allow setting access-width for UART registers.
This is required for FDT's standard "reg-io-width" property
(similar to "reg-shift" property) found in many DTS files.

This fixes operation on Altera Arria 10 SOC Development Kit,
where standard ns8250 uart allows 4-byte access only.

Reviewed by:	kan, marcel
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9785
2017-02-27 20:08:42 +00:00
Ruslan Bukin
2770885882 Revert r314212 as it break Allwinner boards.
Reported by:	manu
2017-02-27 19:46:27 +00:00
Mariusz Zaborski
01ad653a81 Add sysctl to control auto resize of the GEOM metadata.
Reviewed by:	AllanJude
Differential Revision:	https://reviews.freebsd.org/D9603
2017-02-27 17:54:01 +00:00
Alexander Motin
64e574c22d Announce that sbp_targ(4) does not support initiator mode.
MFC after:	1 week
2017-02-27 17:50:38 +00:00
Andriy Gapon
63509269e8 fix lvt_mode: edge-triggered interrupt mode is set by clearing APIC_LVT_TM
The fixed is used only to fix up buggy MPTable information and the
trigger mode is probably ignored for the relevant interrupt types
anyway.  Still, it's better to be standards compliant and have the code
do what it says it does.

Discussed with:	jhb
MFC after:	5 days
2017-02-27 17:36:31 +00:00
Emmanuel Vadot
25d9f6e859 allwinner: Correct some clocks name for H3 CCU. 2017-02-27 17:12:17 +00:00
Bruce M Simpson
5df8285d33 Add ID for NEC uPD720202 xHCI controller.
MFC after:	1 month
2017-02-27 17:04:35 +00:00
Dmitry Chagin
281afc595f Return EINVAL when an invalid file descriptor specified.
MFC after:	1 month
2017-02-27 16:55:09 +00:00
Dmitry Chagin
ed211c40f4 Unify eventfd ioctl method and use it for other similar interfaces.
MFC after:	1 month
2017-02-27 16:53:52 +00:00
Roger Pau Monné
b8aa60db3d xen/gntdev: prevent unsynchronized accesses to the map entry
vm_map_lookup_done should only be called when the gntdev has finished poking at
the entry.

Reported by:	alc
Reviewed by:	alc
MFC after:	1 week
Sponsored by:	Citrix Systems R&D
2017-02-27 15:31:15 +00:00
Alexander Motin
9ff948d05f Polish handling of different reset flavours.
The biggest change is that ctl_remove_initiator() now generates I_T NEXUS
LOSS event, cleaning part of LUs state related to the initiator.

MFC after:	2 weeks
2017-02-27 14:59:00 +00:00
Hans Petter Selasky
3cfeca84b4 Implement more bit operation functions in the LinuxKPI.
Some minor whitespace nits while at it.

Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-27 14:38:17 +00:00
Hans Petter Selasky
522f4b2c75 Define __sum16 type in the LinuxKPI.
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-27 13:59:02 +00:00
Emmanuel Vadot
a5ae21c50d allwinner: Order clocks by offset rather than by type for H3 ccu.
Also add a few more supported gates and add comments for which clocks
are missing.
2017-02-27 11:10:36 +00:00
Emmanuel Vadot
d7e3f295fa allwinner: Add support for lock and fractional mode on NM clock
Some PLL have a fractional mode and a lock bit.
Add support for it on the NM clock and export the clocks in the clkdom.
2017-02-27 08:58:27 +00:00
Hans Petter Selasky
a26871e7ff Fix startup race initialising ACPI CM battery structures on MacBookPro.
During acpi_cmbat_attach() the acpi_cmbat_init_battery() notification
handler is registered. It has been observed this notification handler
can be called instantly, before the attach routine has returned. In
the notification handler there is a call to device_is_attached() which
returns false. Because the softc is set we know an attach is in
progress and the fix is simply to wait and try again in this case.

Reviewed by:		avg @
MFC after:		1 week
2017-02-27 08:36:51 +00:00
Alexander Motin
3f072d6948 Send TERMINATE to firmware when aborting active ATIO.
MFC after:	2 weeks
2017-02-27 08:20:28 +00:00
Jayachandran C.
43ad57d358 Enable pl011 UART FIFOs
The pl011 UART has a 16 entry Tx FIFO and a 16 entry Rx FIFO that
have not been used so far. Update the driver to enable the FIFOs
and use them in transmit and receive.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D8819
2017-02-26 22:05:22 +00:00
Warner Losh
55157631f1 Include pcib_private.h for prototypes.
Noticed by: rpokala@
Sponsored by: Netflix
2017-02-26 21:33:18 +00:00
Andriy Voskoboinyk
f631357540 net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parameters
directly from the node.

- Use ni_txparms directly instead of calculating them manually every time
- Move M_EAPOL flag check upper; otherwise it may be skipped due to
'ucastrate' / 'mcastrate' check
- Use 'mgtrate' for control frames too (see ifconfig(8), mgtrate parameter)
- Add few more M_EAPOL checks where it was missing (zyd(4), ural(4),
urtw(4))
- Few unrelated cleanups

Tested with:
 - Intel 6205 (iwn(4)), STA mode;
 - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D9811
2017-02-26 20:49:35 +00:00
Dmitry Chagin
2fa6d2fe84 Return EINVAL in case when an invalid size of signal mask specified.
MFC after:	1 month
2017-02-26 20:01:58 +00:00
Dmitry Chagin
af68739567 Regen for r314312 (Linux epoll_pwait).
MFC after:	1 month
2017-02-26 19:59:28 +00:00
Dmitry Chagin
f8ae1bb64d Change Linux epoll_pwait syscall definition to match Linux actual one.
MFC after:	1 month
2017-02-26 19:57:18 +00:00
Dmitry Chagin
80c7315d17 Restore signal mask in epoll_pwait.
MFC after:	1 month
2017-02-26 19:54:17 +00:00
Alan Cox
0314966858 Refine the fix from r312954. Specifically, add a new PDE-only flag,
PG_PROMOTED, that indicates whether lingering 4KB page mappings might
need to be flushed on a PDE change that restricts or destroys a 2MB
page mapping.  This flag allows the pmap to avoid range invalidations
that are both unnecessary and costly.

Reviewed by:	kib, markj
MFC after:	6 weeks
Differential Revision:	https://reviews.freebsd.org/D9665
2017-02-26 19:54:02 +00:00
Dmitry Chagin
e0a254f6df Return EINVAL when an invalid file descriptor is specified.
MFC after:	1 month
2017-02-26 19:51:44 +00:00
Alexander Motin
92e10562d4 Fix LUN enabling on wildcard target, as done by CTL.
MFC after:	2 weeks
2017-02-26 19:25:33 +00:00
Alexander Motin
b371466e29 Add support for SIMs without autosense.
If we asked to send sense data by setting CAM_SEND_SENSE, but SIM didn't
confirm transmission by setting CAM_SENT_SENSE, assume it was not sent.
Queue the I/O back to CTL for later REQUEST SENSE with ctl_queue_sense().
This is needed for error reporting on SPI HBAs like ahc(4)/ahd(4).

MFC after:	2 weeks
2017-02-26 19:23:03 +00:00
Emmanuel Vadot
f5d1d20574 Add clkng driver for Allwinner SoC
Since Linux 4.9-4.10 DTS doesn't have clocks under /clocks but only a ccu node.
Currently only H3 is supported with almost the same state as HEAD.
(video pll aren't supported for now but we don't support video).
This driver and clocks will also be used for other SoC (A64, A31, H5, H2 etc ...)

Reviewed by:	jmcneill
Differential Revision:	https://reviews.freebsd.org/D9517
2017-02-26 16:00:20 +00:00
Alexander Motin
2d4a5bcccb Return better error code in case of too long CDB.
Its more important for SPI HBAs, as they don't support CDBs above 12 bytes.
The new error code makes CAM to fall back to alternative commands.

MFC after:	2 weeks
2017-02-26 14:29:09 +00:00
Yoshihiro Takahashi
645b154260 Fix the acpi idle support on i386 which was broken by r312910.
The ifdefs were '#if !defined(__i386__) || !defined(PC98)' previously,
so cpu_idle_acpi was enabled both i386 and amd64 except PC98.

I was obfuscated by '#if !defined(__i386__)' condition.

Submitted by:	bde
Reported by:	bde
2017-02-26 13:25:56 +00:00
Alexander Motin
15b2cdedca Use resid field of CTIO to detect under/overruns.
MFC after:	2 weeks
2017-02-26 12:54:27 +00:00
Alexander Motin
a6036a44fd Fix residual length reporting in target mode.
This allows to properly handle cases when target wants to receive or send
more data then initiator wants to send or receive.  Previously in such
cases isp(4) returned CAM_DATA_RUN_ERR, while now it returns resid > 0.

MFC after:	2 weeks
2017-02-26 12:52:44 +00:00
Dmitry Chagin
dd93b628e9 Implement timerfd family syscalls.
MFC after:	1 month
2017-02-26 09:48:18 +00:00
Dmitry Chagin
01d4a346c2 Nostly style(9) changes, replace unused eventfd_truncate()
by default invfo_truncate() method.

MFC after:	1 month
2017-02-26 09:42:34 +00:00
Dmitry Chagin
0670e972e3 Return EOVERFLOW error in case then the size of tv_sec field of struct timespec
in COMPAT_LINUX32 Linuxulator's not equal to the size of native tv_sec.

MFC after:	1 month
2017-02-26 09:40:42 +00:00
Dmitry Chagin
354aa2dd56 Regen after r314291 (timerfd definition).
MFC after:	1 month
2017-02-26 09:37:25 +00:00
Dmitry Chagin
1064d53fde Change Linuxulator timerfd syscalls definition to match actual Linux one.
MFC after:	1 month
2017-02-26 09:35:44 +00:00
Alexander Motin
789f39c3dc Implement use of multiple transfers per I/O.
This change removes limitation of single S/G list entry and limitation on
maximal I/O size, using multiple data transfers per I/O if needed.  Also
it removes code duplication between send and receive paths, which are now
completely equal.
2017-02-26 06:25:55 +00:00
Andriy Voskoboinyk
c7a9c7f627 iwn: stop all watchdogs on device shutdown.
Tested with Intel 6205, STA mode.

MFC after:	5 days
2017-02-26 01:05:27 +00:00
Jonathan T. Looney
e80039007a Do some minimal work to better conform to the 802.3ad (LACP) standard.
In particular, don't set the synchronized bit for the peer unless it truly
appears to be synchronized to us. Also, don't set our own synchronized bit
unless we have actually seen a remote system.

Prior to this change, we were seeing some strange behavior, such as:

1. We send an advertisement with the Activity, Aggregation, and Default
flags, followed by an advertisement with the Activity, Aggregation,
Synchronization, and Default flags. However, we hadn't seen an
advertisement from another peer and were still advertising the default
(NULL) peer. A closer examination of the in-kernel data structures (using
kgdb) showed that the system had added the default (NULL) peer as a valid
aggregator for the segment.
2. We were receiving an advertisement from a peer that included the
default (NULL) peer instead of including our system information. However,
we responded with an advertisement that included the Synchronization flag
for both our system and the peer. (Since the peer's advertisement did not
include our system information, we shouldn't add the synchronization bit
for the peer.)

This patch corrects those two items.

Reviewed by:	smh
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D9485
2017-02-26 00:19:02 +00:00
Warner Losh
2379d1d6ed Move inclusion of opt_printf.h around so that we can compile all the
SCSI modules outside of a sub-build from the kernel.

Differential Revision: https://reviews.freebsd.org/D9653
Sponsored by: Netflix
2017-02-25 22:11:10 +00:00