102583 Commits

Author SHA1 Message Date
jhb
4a069f68d7 MFC 283281,283282,283562,283647,283836,284000,286158:
Various fixes to orphan handling which also fix issues with following
forks.

283281:
Always set p_oppid when attaching to an existing process via procfs
tracing.  This matches the behavior of ptrace(PT_ATTACH).  Also,
the procfs detach request assumes p_oppid is always set.

283282:
Only reparent a traced process to its old parent if the tracing process is
not the old parent. Otherwise, proc_reap() will leave the zombie in place
resulting in the process' status being returned twice to its parent.

Add test cases for PT_TRACE_ME and PT_ATTACH which are fixed by
this change.

283562:
Do not allow a process to reap an orphan (a child currently being
traced by another process such as a debugger). The parent process does
need to check for matching orphan pids to avoid returning ECHILD if an
orphan has exited, but it should not return the exited status for the
child until after the debugger has detached from the orphan process
either explicitly or implicitly via wait().

Add two tests for for this case: one where the debugger is the direct
child (thus the parent has a non-empty children list) and one where
the debugger is not a direct child (so the only "child" of the parent
is the orphan).

283647:
Tweak the description of when waitpid() doesn't return any status for a
non-blocking wait to avoid the word "empty".

283836:
Consistently only use one end of the pipe in the parent and debugger
processes and do not rely on EOF due to a close() in the debugger.

284000:
Add a CHILD_REQUIRE macro similar to ATF_REQUIRE for use in child processes
of the main test process.

286158:
Clear P_TRACED before reparenting a detached process back to its
original parent. Otherwise the debugee will be set as an orphan of
the debugger.

Add tests for tracing forks via PT_FOLLOW_FORK.
2015-09-09 23:39:30 +00:00
bdrewery
a7e2ef65e3 MFC r287151,r287152,r287153,r287155:
r287151:
    Move common locking for filemon_inuse and struct filemon* to
    filemon_pid_check().
  r287152:
    Remove unneeded inuse list locking in filemon_comment().
  r287153:
    Avoid taking proctree_lock and searching parents in wrappers if not needed.
  r287155:
    Fix filemon locking races.

 Relnotes:	yes (race fixes)
 Sponsored by:	EMC / Isilon Storage Division
2015-09-09 17:15:13 +00:00
hrs
72c1e2950c MFC r272889 and r287402:
- Virtualize if_epair(4).  An if_xname check for both "a" and "b" interfaces
  is added to return EEXIST when only "b" interface exists---this can happen
  when epair<N>b is moved to a vnet jail and then "ifconfig epair<N> create"
  is invoked there.

- Fix a panic which was reproducible by an infinite loop of
  "ifconfig epair0 create && ifconfig epair0a destroy".
  This was caused by an uninitialized function pointer in
  softc->media.
2015-09-09 08:52:39 +00:00
imp
bd8403067b MFC: r287405:
Make out of memory behavior less pathological.
2015-09-08 18:37:16 +00:00
sbruno
98a2a2e18e MFC r287437
r249170 was just plain wrong.  The effect of the change is to always
delete a logic volume on status change which is NOT what we want here.

The original code is correct in that when the volume changes status
the driver will only delete the volume if the status is one of the
fatal errors.  A drive failure in a mirrored volume is NOT a situtation
where the volume should dissapear.

Reported on freebsd-scsi@:
https://lists.freebsd.org/pipermail/freebsd-scsi/2015-September/006800.html
2015-09-08 17:20:12 +00:00
kib
85e9470674 MFC r287310:
Use P1B_PRIO_MAX to designate max posix priority for the RR/FIFO
scheduler types.
2015-09-06 17:36:09 +00:00
kib
72b37e4159 MFC r287309:
Remove single-use macros obfuscating malloc(9) and free(9) calls.
Style.
2015-09-06 17:32:33 +00:00
mav
280f5aeea6 MFC r287432: Fix copy-paste bug introduced in r275458. 2015-09-06 09:41:08 +00:00
sbruno
c3f28072a7 MFC r276834
Update Features2 to display SDBG capability of processor.  This is
showing up on Haswell-class CPUs

From the Intel SDM, "Table 3-20. Feature Information Returned in the
ECX Register"

11 | SDBG | A value of 1 indicates the processor supports
IA32_DEBUG_INTERFACE MSR for silicon debug.

Submitted by:	jiashiun@gmail.com
2015-09-04 15:40:19 +00:00
sbruno
7179ae751d MFC r286238
A misplaced #endif in ixgbe_ioctl() causes interface MTU to become
zero when INET and INET6 are undefined.

PR:		162028
Submitted by:	hoomanfazaeli@gmail.com pluknet
2015-09-04 15:34:27 +00:00
imp
4c2ee2f23d MFC: r287183, r287264, r287265
Export kern.features.invariants when kernel is compiled with invariants.
2015-09-03 18:14:31 +00:00
jhb
0f92293fc3 MFC 281941:
Watchdog drivers need to support rearming the watchdog in contexts which
are not permitted to sleep.  Only use the IPMI watchdog with backends
which poll driver-initiated requests to meet this requirement.

In practice this means that watchdogs will no longer be used on systems
that use the SSIF backend.
2015-09-03 16:43:35 +00:00
avatar
49c820db70 MFC r286887: Using the error return code documented in the comment.
Though there is no direct midi_uninit() caller amongst existing drivers
at this moment, a quick experiment indicates that EBUSY gives users more
precise error message once drivers start to honour this result.  For example,
emu_midi_detach() should check the result of mpu401_uninit() and block
module unloading if there is any MIDI I/O in progress.
2015-09-01 22:35:53 +00:00
delphij
11ccde2814 MFC r286894:
Set curvnet context inside the RPC code in more places.

Reviewed by:	melifaro
2015-09-01 01:01:35 +00:00
delphij
fb04ebcd37 MFC r286836:
so_vnet is constant after creation and no locking is necessary,
document this fact.
2015-08-31 18:58:53 +00:00
avatar
fa56ab039e MFC r286888: Using consistent coding style to deal with error inside the loop. 2015-08-29 11:15:54 +00:00
mav
25e0f05092 MFC r287025: Remove some code duplication by using biofinish(). 2015-08-29 10:53:53 +00:00
mav
73d1933c36 MFC r286814, r286816: Remove UMA allocation of ATA requests.
After CAM replaced old ATA stack, this driver processes no more then one
request at a time per channel.  Using UMA after that is overkill, so
replace it with simple preallocation of one request per channel.
2015-08-29 10:52:16 +00:00
hselasky
73eba52d26 MFC r286773:
Improve the realtime properties of USB transfers for embedded systems
like RPI-B and RPI-2.
2015-08-29 06:23:40 +00:00
hselasky
6323991c32 MFC r286799:
Fix race in USB PF which can happen if we stop tracing exactly when
the kernel is tapping an USB transfer. This leads to a NULL pointer
access. The solution is to only trace while the USB bus lock is
locked.
2015-08-29 06:11:50 +00:00
hselasky
10823346a0 MFC r283067, r286118, r285638, r285935, r286778, r286780 and r286802:
- Make the FIFO configuration a bit more flexible for the DWC OTG in
device side mode.
- 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.
- Optimise the DWC OTG host mode driver's transmit path
- Optimise the DWC OTG host mode driver's receive path
- Minor code refactor to avoid duplicating code.
- Handle NYET high speed tokens and predict NAK'ing is up next.
- Fixes for HIGH speed ISOCHRONOUS traffic.
2015-08-29 06:07:55 +00:00
rmacklem
b90ab2596f MFC: r286790
For the case where an NFSv4.1 ExchangeID operation has the client identifier
that already has a confirmed ClientID, the nfsrv_setclient() function would
not fill in the clientidp being returned. As such, the value of ClientID
returned would be whatever garbage was on the stack.
This patch fixes the problem by filling in these fields.
2015-08-28 22:42:37 +00:00
ae
655a5b9a16 MFC r286720:
Use g_conf_printf_escaped() to escape illegal symbols in file name.

  PR:		202289
2015-08-28 11:56:20 +00:00
markj
fd2c0954e1 MFC r285252:
Fix an incorrect assertion in witness.
2015-08-28 00:06:31 +00:00
markj
fecd3bf641 MFC r286167:
Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context.
2015-08-27 23:55:46 +00:00
markj
a8dcf1a4e5 MFC r286418:
ipv4_is_zeronet() and ipv4_is_loopback() expect an address in network
order, but IN_ZERONET and IN_LOOPBACK expect it in host order.
2015-08-27 23:52:53 +00:00
loos
731978cbcf MFC r287119:
Reapply r196551 which was accidentally reverted by r223637 (update to
  OpenBSD pf 4.5).

  Fix argument ordering to memcpy as well as the size of the copy in the
  (theoretical) case that pfi_buffer_cnt should be greater than ~_max.

  This fix the failure when you hit the self table size and force it to be
  resized.

  Sponsored by: Rubicon Communications (Netgate)
2015-08-27 14:07:28 +00:00
ken
0e7643b351 MFC, r286965:
------------------------------------------------------------------------
  r286965 | ken | 2015-08-20 10:07:51 -0600 (Thu, 20 Aug 2015) | 297 lines

  Revamp camcontrol(8) fwdownload support and add the opcodes subcommand.

  The significant changes and bugs fixed here are:

  1. Fixed a bug in the progress display code:

     When the user's filename is too big, or his terminal width is too
     small, the progress code could wind up using a negative number for
     the length of the "stars" that it uses to indicate progress.

     This negative value was assigned to an unsigned variable, resulting
     in a very large positive value.

     The result is that we wound up writing garbage from memory to the
     user's terminal.

     With an 80 column terminal, a file name length of more than 35
     characters would generate this problem.

     To address this, we now set a minimum progress bar length, and
     truncate the user's file name as needed.

     This has been tested with large filenames and small terminals, and
     at least produces reasonable results.  If the terminal is too
     narrow, the progress display takes up an additional line with each
     update, but this is more user friendly than writing garbage to the
     tty.

  2. SATA drives connected via a SATA controller didn't have SCSI Inquiry
     data populated in struct cam_device.  This meant that the code in
     fw_get_vendor() in fwdownload.c would try to match a zero-length
     vendor ID, and so return the first entry in the vendor table.  (Which
     used to be HITACHI.)  Fixed by grabbing identify data, passing the
     identify buffer into fw_get_vendor(), and matching against the model
     name.

  3. SATA drives connected via a SAS controller do have Inquiry data
     populated.  The table included a couple of entries -- "ATA ST" and
     "ATA HDS", intended to handle Seagate and Hitachi SATA drives attached
     via a SAS controller.  SCSI to ATA translation layers use a vendor
     ID of "ATA" (which is standard), and then the model name from the ATA
     identify data as the SCSI product name when they are returning data on
     SATA disks.  The cam_strmatch code will match the first part of the
     string (because the length it is given is the length of the vendor,
     "ATA"), and return 0 (i.e. a match).  So all SATA drives attached to
     a SAS controller would be programmed using the Seagate method
     (WRITE BUFFER mode 7) of SCSI firmware downloading.

  4. Issue #2 above covered up a bug in fw_download_img() -- if the
     maximum packet size in the vendor table was 0, it tried to default
     to a packet size of 32K.  But then it didn't actually succeed in
     doing that, because it set the packet size to the value that was
     in the vendor table (0).  Now that we actually have ATA attached
     drives fall use the VENDOR_ATA case, we need a reasonable default
     packet size.  So this is fixed to properly set the default packet size.

  5. Add support for downloading firmware to IBM LTO drives, and add a
     firmware file validation method to make sure that the firmware
     file matches the drive type.  IBM tape drives include a Load ID and
     RU name in their vendor-specific VPD page 0x3.  Those should match
     the IDs in the header of the firmware file to insure that the
     proper firmware file is loaded.

  6. This also adds a new -q option to the camcontrol fwdownload
     subcommand to suppress informational output.  When -q is used in
     combination with -y, the firmware upgrade will happen without
     prompting and without output except if an error condition occurs.

  7. Re-add support for printing out SCSI inquiry information when
     asking the user to confirm that they want to download firmware, and
     add printing of ATA Identify data if it is a SATA disk.  This was
     removed in r237281 when support for flashing ATA disks was added.

  8. Add a new camcontrol(8) "opcodes" subcommand, and use the
     underlying code to get recommended timeout values for drive
     firmware downloads.

     Many SCSI devices support the REPORT SUPPORTED OPERATION CODES
     command, and some support the optional timeout descriptor that
     specifies nominal and recommended timeouts for the commands
     supported by the device.

     The new camcontrol opcodes subcommand allows displaying all
     opcodes supported by a drive, information about which fields
     in a SCSI CDB are actually used by a given SCSI device, and the
     nominal and recommended timeout values for each command.

     Since firmware downloads can take a long time in some devices, and
     the time varies greatly between different types of devices, take
     advantage of the infrastructure used by the camcontrol opcodes
     subcommand to determine the best timeout to use for the WRITE
     BUFFER command in SCSI device firmware downloads.

     If the device recommends a timeout, it is likely to be more
     accurate than the default 50 second timeout used by the firmware
     download code.  If the user specifies a timeout, it will override
     the default or device recommended timeout.  If the device doesn't
     support timeout descriptors, we fall back to the default.

  9. Instead of downloading firmware to SATA drives behind a SAS controller
     using WRITE BUFFER, use the SCSI ATA PASS-THROUGH command to compose
     an ATA DOWNLOAD MICROCODE command and it to the drive.  The previous
     version of this code attempted to send a SCSI WRITE BUFFER command to
     SATA drives behind a SAS controller.  Although that is part of the
     SAT-3 spec, it doesn't work with the parameters used with LSI
     controllers at least.

  10.Add a new mechanism for making common ATA passthrough and
     ATA-behind-SCSI passthrough commands.

     The existing camcontrol(8) ATA command mechanism checks the device
     type on every command executed.  That works fine for individual
     commands, but is cumbersome for things like a firmware download
     that send a number of commands.

     The fwdownload code detects the device type up front, and then
     sends the appropriate commands.

  11.In simulation mode (-s), if the user specifies the -v flag, print out
     the SCSI CDB or ATA registers that would be sent to the drive.  This will
     aid in debugging any firmware download issues.

  sbin/camcontrol/fwdownload.c:
  	Add a device type to the fw_vendor structure, so that we can
  	specify different download methods for different devices from the
  	same vendor.  In this case, IBM hard drives (from when they
  	still made hard drives) and tape drives.

  	Add a tur_status field to the fw_vendor structure so that we can
  	specify whether the drive to be upgraded should be ready, not
  	ready, or whether it doesn't matter.  Add the corresponding
  	capability in fw_download_img().

  	Add comments describing each of the vendor table fields.

  	Add HGST and SmrtStor to the supported SCSI vendors list.

  	In fw_get_vendor(), look at ATA identify data if we have a SATA
  	device to try to identify what the drive vendor is.

  	Add IBM firmware file validation.  This gets VPD page 0x3, and
  	compares the Load ID and RU name in the page to the values
  	included in the header.  The validation code will refuse to load
  	a firmware file if the values don't match.  This does allow the
  	user to attempt a downgrade; whether or not it succeeds will
  	likely depend on the drive settings.

  	Add a -q option, and disable all informative output
  	(progress bars, etc.) when this is enabled.

  	Re-add the inquiry in the confirmation dialog so the user has
  	a better idea of which device he is talking to.  Add support for
  	displaying ATA identify data.

  	Don't automatically disable confirmation in simulation (-s) mode.
  	This allows the user to see the inquiry or identify data in the
  	dialog, and see exactly what they would see when the command
  	actually runs.  Also, in simulation mode, if the user specifies
  	the -v flag, print out the SCSI CDB or ATA registers that would
  	be sent to the drive.  This will aid in debugging any firmware
  	download issues.

  	Add a timeout field and timeout type to the firmware download
  	vendor table.  This allows specifying a default timeout and allows
  	specifying whether we should attempt to probe for a recommended
  	timeout from the drive.

  	Add a new fuction, fw_get_timeout(), that will determine
  	which timeout to use for the WRITE BUFFER command.  If the
  	user specifies a timeout, we always use that.  Otherwise,
  	we will use the drive recommended timeout, if available,
  	and fall back to the default when a drive recommended
  	timeout isn't available.

  	When we prompt the user, tell him what timeout we're going
  	to use, and the source of the timeout.

  	Revamp the way SATA devices are handled.

  	In fwdownload(), use the new get_device_type() function to
  	determine what kind of device we're talking to.

  	Allow firmware downloads to any SATA device, but restrict
  	SCSI downloads to known devices.  (The latter is not a
  	change in behavior.)

  	Break out the "ready" check from fw_download_img() into a
  	new subfunction, fw_check_device_ready().  This sends the
  	appropriate command to the device in question -- a TEST
  	UNIT READY or an IDENTIFY.  The IDENTIFY for SATA devices
   	a SAT layer is done using the SCSI ATA PASS-THROUGH
  	command.

  	Use the new build_ata_cmd() function to build either a SCSI or
  	ATA I/O CCB to issue the DOWNLOAD MICROCODE command to SATA
  	devices.  build_ata_cmd() figures looks at the devtype argument
  	and fills in the correct CCB type and CDB or ATA registers.

  	Revamp the vendor table to remove the previous
  	vendor-specific ATA entries and use a generic ATA vendor
  	placeholder.  We currently use the same method for all ATA
  	drives, although we may have to add vendor-specific
  	behavior once we test this with more drives.

  sbin/camcontrol/progress.c:
  	In progress_draw(), make barlength a signed value so that
  	we can easily detect a negative value.

  	If barlength (the length of the progress bar) would wind up
  	negative due to a small TTY width or a large filename,
  	set the bar length to the new minimum (10 stars) and
  	truncate the user's filename.  We will truncate it down to
  	0 characters if necessary.

  	Calculate a new prefix_len variable (user's filename length)
  	and use it as the precision when printing the filename.

  sbin/camcontrol/camcontrol.c:
  	Implement a new camcontrol(8) subcommand, "opcodes".  The
  	opcodes subcommand allows displaying the entire list of
  	SCSI commands supported by a device, or details on an
  	individual command.  In either case, it can display
  	nominal and recommended timeout values.

  	Add the scsiopcodes() function, which calls the new
  	scsigetopcodes() function to fetch opcode data from a
  	drive.

  	Add two new functions, scsiprintoneopcode() and
  	scsiprintopcodes(), which print information about one
  	opcode or all opcodes, respectively.

  	Remove the get_disk_type() function.  It is no longer used.

  	Add a new function, dev_has_vpd_page(), that fetches the
  	supported INQUIRY VPD list from a device and tells the
  	caller whether the requested VPD page is available.

  	Add a new function, get_device_type(), that returns a more
  	precise device type than the old get_disk_type() function.
  	The get_disk_type() function only distinguished between
  	SCSI and ATA devices, and SATA devices behind a SCSI to ATA
  	translation layer were considered to be "SCSI".

  	get_device_type() offers a third type, CC_DT_ATA_BEHIND_SCSI.
  	We need to know this to know whether to attempt to send ATA
  	passthrough commands.  If the device has the ATA
  	Information VPD page (0x89), then it is an ATA device
  	behind a SCSI to ATA translation layer.

  	Remove the type argument from the fwdownload() subcommand.

  	Add a new function, build_ata_cmd(), that will take one set
  	of common arguments and build either a SCSI or ATA I/O CCB,
  	depending on the device type passed in.

  sbin/camcontrol/camcontrol.h:
  	Add a prototype for scsigetopcodes().

  	Add a new enumeration, camcontrol_devtype.

  	Add prototypes for dev_has_vpd_page(), get_device_type()
  	and build_ata_cmd().

  	Remove the type argument from the fwdownload() subcommand.

  sbin/camcontrol/camcontrol.8
  	Explain that the fwdownload subcommand will use the drive
  	recommended timeout if available, and that the user can
  	override the timeout.

  	Document the new opcodes subcommand.

  	Explain that we will attempt to download firmware to any
  	SATA device.

  	Document supported SCSI vendors, and models tested if known.

  	Explain the commands used to download firmware for the
  	three different drive and controller combinations.

  	Document that the -v flag in simulation mode for the fwdownload
  	subcommand will print out the SCSI CDBs or ATA registers that would
  	be used.

  sys/cam/scsi/scsi_all.h:
  	Add new bit definitions for the one opcode descriptor for
  	the REPORT SUPPORTED OPCODES command.

  	Add a function prototype for scsi_report_supported_opcodes().

  sys/cam/scsi/scsi_all.c:
  	Add a new CDB building function, scsi_report_supported_opcodes().

Sponsored by:	Spectra Logic
2015-08-27 13:17:05 +00:00
kib
5c44ad556b MFC r286975:
Remove the wrong asserts.
2015-08-27 09:06:14 +00:00
avatar
8ec6c5900c MFC r286886: Fixing typo as well as improving readability of a few comments. 2015-08-26 22:59:58 +00:00
np
e3e10fb92a MFC r286926:
cxgbe(4):  Save the flags for the last adapter-wide synchronized
operation that was initiated successfully.  (The caller and thread are
already recorded).
2015-08-26 01:41:55 +00:00
jkim
83154d3b5d MFC: r286265, r286293, r286328
Always define __va_list for amd64 and restore pre-r232261 behavior for i386.
2015-08-25 19:18:38 +00:00
marcel
966727ca3b MFC r286808, r286809, r286867, r286868
-   Improve support for Macs that have a stride not equal to the
    horizonal resolution (width).
-   Support frame buffers that are larger than the default screen
    size.
-   Support large frame buffers: add 24 more page table pages we
    allocate on boot-up.

PR:		193745
2015-08-25 15:14:50 +00:00
marcel
87b09c366d MFC r286667 & r286723
Better support memory mapped console devices, such as VGA and EFI
frame buffers and memory mapped UARTs.

PR:		191564, 194952, 202276
2015-08-25 14:39:40 +00:00
julian
370bb5e04c MFH: r273762
MFH: r276304

Allow loading of dtraceall without nfscl if what you really want is nfsclient

Obtained from:	Panzura tree and Rick Maclem
2015-08-24 03:41:14 +00:00
ian
e7eeb94654 MFC r283547:
Ensure that all arm kernel configs contain ALT_BREAK_TO_DEBUGGER and not
  BREAK_TO_DEBUGGER if they have a serial console (most do).  A burst of
  serial line noise (such as unplugging a usb serial adapter) can look like
  a break and drop a working system into the debugger.  The alt break sequence
  (<CR>~^B) works fine on both serial and non-serial consoles.
2015-08-23 20:50:22 +00:00
ian
d958a69ae3 MFC r286942, r286943, r286944: imx watchdog fixes...
Add compatible strings for all the hardware this driver works with.

  Also, move the READ/WRITE bus space access macros from the header into the
  source file, and rename them to RD2/WR2 to make it clear they're 16-bit
  accessors.  (READ/WRITE just don't seem like good names to be in a public
  header file.)

  Make the imx watchdog actually work, by setting WDOG_CR_WDE (enable bit).
  Also, follow the rules from watchdog(9) about what values to return in
  various situations (especially, don't touch *error when asked to set a
  non-zero timeout that isn't achievable on the hardware).

  Enable the watchdog driver on imx6, now that it works.
2015-08-23 20:16:13 +00:00
ian
8cf9fedbf6 MFC r286701:
If a specific timecounter has been chosen via sysctl, and a new
  timecounter with higher quality registers (presumably in a module that has
  just been loaded), do not undo the user's choice by switching to the new
  timecounter.

  Document that behavior, and also the fact that there is no way to
  unregister a timecounter (and thus no way to unload a module containing
  one).
2015-08-23 18:03:43 +00:00
ian
9fbd70f079 Always compile in PPS capture. Use the same device name used in 11-current.
This is a direct commit to 10-stable because the corresponding changes in 11
are bound up with all the device-tree rework for beaglebone.  This somewhat
aligns the features between the two branches, from a user's perspective.
2015-08-23 17:54:48 +00:00
ian
f1738f73c5 MFC r286469, r286591, r286595, r286596, r286613:
Provide the tty-layer mutex when initializing the pps api.  This allows
  time_pps_fetch() to be used in blocking mode.

  Allow the choice of PPS signal captured by uart(4) to be runtime-configured,
  eliminating the need to build a custom kernel to use the CTS signal.

  Correct the polarity of the PPS assert and clear events with respect to the
  electrical signals on the serial port.

  Document the change in polarity of the uart(4) PPS capture.

  Style fix -- do the braces for switches correctly.

Relnotes:	yes
2015-08-23 17:07:23 +00:00
ian
50ce2fd7fc MFC r286423, r286429:
RFC 2783 requires a status of ETIMEDOUT, not EWOULDBLOCK, on a timeout.

  Only process the PPS event types currently enabled in pps_params.mode.
2015-08-23 16:22:21 +00:00
ian
341404d849 MFC r264394, r286382, r286385, r286389:
Add support to the uftdi driver for reading and writing the serial eeprom
  that can be attached to the chips, via ioctl() calls.

  Return the current ftdi bitbang mode with the UFTDIIOC_GET_BITMODE ioctl.

  Document the recently added get-bitmode and eeprom read/write functionality.
2015-08-23 16:17:00 +00:00
mav
fe9da6f90c MFC r285020: Disable port multiplier support on Marvell 88SE61xx chips.
According to report, some recent unrelated changes in the driver triggered
timeouts when testing for absent port multiplier.  Cause of this behavior
channge is unclear, but since these chips are old, rare and buggy, it is
easier to just disable port multiplier support, same as done in Linux.
2015-08-22 15:36:20 +00:00
mav
cb281b0cae MFC r286448: Disable 32-bit PIO for 6Gbit/s Intel SATA controllers.
For some reason 32-bit PIO writes are not working on 6Gbit/s Intel SATA
ports, while 16/32-bit PIO reads and 16-bit PIO writes are working fine.
3Gbit/s ports on the same controllers have no this problem.

Workaround this by disabling 32-bit PIO for all Intel controllers that may
have 6Gbit/s ports.  It halves PIO performance from 6MB/s to 3MB/s, but
who bother about speed of such rare and slow mode, which is also highly
discouraged by SATA specifications?
2015-08-22 07:45:49 +00:00
mav
0651b2a368 MFC r280451:
Remove from legacy ata(4) driver support for hardware, supported by newer
and more functional drivers ahci(4), siis(4) and mvs(4).

This removes about 3400 lines of code, unused since FreeBSD 9.0 release.
2015-08-22 07:32:47 +00:00
loos
33f4807b1f MFC r286862:
Fix the copy of addresses passed from userland in table replace command.

  The size2 is the maximum userland buffer size (used when the addresses are
  copied back to userland).

  Obtained from:	pfSense
  Sponsored by:	Rubicon Communications (Netgate)
2015-08-20 14:03:03 +00:00
mav
699edef127 MFC r286353: Pass SYNCHRONIZE CACHE command parameters to backends.
At this point IMMED flag is translated to MNT_NOWAIT flag of VOP_FSYNC(),
hoping that file system implements that (ZFS seems doesn't).
2015-08-19 17:47:47 +00:00
mav
30b552e57c MFC r286345: Relax serialization of SYNCHRONIZE CACHE commands.
Before this change SYNCHRONIZE CACHE commands were executed exclusively,
as if they had ORDERED tag.  But looking through SCSI specs I've found
no any reason to be so strict.  For reads this ordering seems pointless.
For writes it looks less obvious, so I left ordering against preceeding
write commands, while following ones are no longer required to wait.
2015-08-19 17:43:36 +00:00
mav
374a9ddfc6 MFC r286320: Issue all reads of single XCOPY segment simultaneously.
During vMotion and Clone VMware by default runs multiple sequential 4MB
XCOPY requests same time.  If CTL issues reads sequentially in 1MB chunks
for each XCOPY command, reads from different commands are not detected
as sequential by serseq option code and allowed to execute simultaneously.
Such read pattern confused ZFS prefetcher, causing suboptimal disk access.
Issuing all reads same time make serseq code work properly, serializing
reads both within each XCOPY command and between them.

My tests with ZFS pool of 14 disks in RAID10 shows prefetcher efficiency
improved from 37% to 99.7%, copying speed improved by 10-60%, average
read latency reduced twice on HDD layer and by five times on zvol layer.
2015-08-19 17:41:49 +00:00
np
0f68d26edd MFC r271490:
cxgbe(4): add support for the SIOCGI2C ioctl.
2015-08-18 19:15:20 +00:00