28288 Commits

Author SHA1 Message Date
ian
a24130faeb MFC r277655, r277989: Reimplement fdt_clock_register_provider() correctly. 2015-02-13 23:37:11 +00:00
ian
56013bbc63 MFC r277454, r277460, r277465, r277466, r277467, r277469, r277470, r277471,
r277472, r277473, r277474, r277475, r277476, r277477, r277478, r277479,
    r277480, r277512, r277516:

  Add inline implementations of arm bus_space_read/write_N().

  Revise the arm bus_space implementation to avoid dereferencing the tag on
  every operation to retrieve the bs_cookie value almost nothing actually uses.

  Use the explicit member initializer style to init the bus_space struct.

  Use arm/bus_space-v6.c for all armv6 systems

  Consolidate many identical implementations of bus_space to a single
  common tag and implementation shared by armv4 and armv6.

  Micro-optimize the new arm inline bus_space implementation by grouping all
  the data the inline functions access together at the start of the bus_space
  struct so that they all fit in a single cache line.
2015-02-13 22:32:02 +00:00
ian
b137f825dc MFC r272103: Move s3c2xx0 into the samsung directory. 2015-02-13 22:08:19 +00:00
ian
0d83b78040 MFC r277306, r277307, r277346:
Add defines for SDHCI 3.0 controllers.

  Add a new SDHCI quirk, SDHCI_QUIRK_DONT_SET_HISPD_BIT.

  Save the command-and-flags value into shadow register when it is written.
2015-02-13 20:38:39 +00:00
ian
3e6b663e1f MFC r277027:
Handle the possibility that SDHCI_PLATFORM_START_TRANSFER() can fail.
2015-02-13 18:13:42 +00:00
ian
432a94e7fe MFC r277026: Rate-limit error logging to 5 lines per second. 2015-02-13 18:12:30 +00:00
hselasky
baa2d40228 MFC r278503:
Revert r274918 and make a better solution. Poll the synchronisation
endpoint less frequently to make the sample rate adjustment more
accurate. This should resolve problems with the DN32-USB module for
Midas audio systems and possibly other similar products from Klark
Teknik.
2015-02-13 07:51:15 +00:00
hselasky
5bf9aa9b6f MFC r278477:
Fix DMA address casts.
2015-02-13 07:48:54 +00:00
jhb
39fe100d12 MFC 277710:
Pass a valid Dx state variable to PCIB_POWER_FOR_SLEEP() in pcib_resume()
instead of NULL.
2015-02-12 17:58:02 +00:00
dim
22fe1f6542 MFC r278004:
Constify a number of accesses in drm2's radeon drivers to avoid
-Wcast-qual warnings.  No functional change.

Reviewed by:	dumbbell
Differential Revision: https://reviews.freebsd.org/D1727

MFC r278438:

After r278004 was committed, Bruce Evans noted that the casts were
actually completely unnecessary, here:

https://lists.freebsd.org/pipermail/svn-src-all/2015-February/098478.html

Remove the casts, and just assign &xxx_io_mc_regs[0][0] directly.

Reviewed by:	dumbbell
Differential Revision: https://reviews.freebsd.org/D1748
2015-02-12 07:21:22 +00:00
ian
4b6f93ca03 MFC r276162: Don't assume required FDT properties are present. 2015-02-12 00:35:58 +00:00
ian
4830d3556d MFC r275779, r275963, r276101, r276161, r276297:
Move ofw_cpu.c to sys/dev/ofw so that it can be used by other
  architectures.

  Add driver for CPU frequency/voltage control on the Raspberry Pi.

  On initialization, do not use bcm_mbox_intr() to read the pending messages.
  This fixes the hang that happens on boot while initializing the cpufreq on
  Raspberry Pi.
2015-02-12 00:25:33 +00:00
marius
38c1f41175 MFC: r276469
- Switching the mode of Ricoh R5CE823 to SD2.0 causes their PCI device ID
  to change to 0xe822, which may be persistent across reboots and, thus,
  confuse other OSes. Therefore, restore the original mode and frequency
  setting on detach and shutdown.
- Report Ricoh R5CE822 as such.
- According to Linux, Ricoh R5CE822 also need SDHCI_QUIRK_LOWER_FREQUENCY.
- Nuke an unused softc member.
2015-02-10 21:44:28 +00:00
marius
ce996f8275 MFC: r273050
class, subclass and progif were never used, so don't bother setting
them.
2015-02-10 21:40:31 +00:00
hselasky
cae60585e2 MFC r278105:
Separate out detection of prevent and allow medium removal quirk.

PR:		185747
2015-02-10 13:45:55 +00:00
hselasky
ae29368fe4 MFC r278074:
Optimise allocation of USB DMA structures. By default don't double map
allocations if only one element should be allocated per page
cache. Make one allocation per element compile time configurable. Fix
a comment while at it.
2015-02-10 13:25:29 +00:00
hselasky
811636d364 MFC r278071:
Section 3.2.9 in the XHCI specification about control transfers says
that we should use a normal-TRB if there are more TRBs extending the
data-stage TRB. Add a dedicated state bit to the internal USB transfer
flags to handle this case.
2015-02-10 13:16:53 +00:00
mav
e82104dd18 MFC r278098, r278099: Add some fields and constants from RFC7144. 2015-02-09 09:08:55 +00:00
marius
bded83f835 MFC: r275871
Update the use of bus space macros to be more correct.
2015-02-08 22:29:57 +00:00
marius
d13c2ab3c3 MFC: r275870
Use the correct macro for listing the maximum bus space size.
2015-02-08 22:27:17 +00:00
marius
ff1f47aebc MFC: r266744, r267712, r276351, r277043
- Add PCI ID for AMT based serial interface found on the Lenovo T61.
- add support for MosChip MCS9922...  This is found on an ExpressCard.. [1]
- Add PCI ID for the Oxford Semiconductor OXPCIe952 device.

PR:	186891 [1]
2015-02-08 21:41:18 +00:00
marius
182ebd1941 MFC: r276344
- Const'ify the ahci_ids table.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
2015-02-08 21:31:40 +00:00
marius
78c1d9653a MFC: r276313
Const'ify a firmware image missed in r251142.
2015-02-08 21:12:48 +00:00
marius
6fdf43daea MFC: r276299
- Make PCI_QUIRK_MSI_INTX_BUG work by using the ID of the actual PCI device
  for the lookup.
- For devices affected by PCI_QUIRK_MSI_INTX_BUG, ensure PCIM_CMD_INTxDIS
  is cleared when using MSI/MSI-X.
- Employ PCI_QUIRK_MSI_INTX_BUG for BCM5714(S)/BCM5715(S)/BCM5780(S) rather
  than clearing PCIM_CMD_INTxDIS unconditionally for all devices in bge(4).
2015-02-08 20:44:44 +00:00
jhb
865011c5e6 MFC 276065:
Explicitly treat timeouts when waiting for IBF or OBF to change state as an
error.  This fixes occasional hangs in the IPMI kcs thread when using
ipmitool locally.
2015-02-06 18:41:57 +00:00
jhb
b2ec547430 MFC 275808:
Check for SS_NBIO in so->so_state instead of sb->sb_flags in
soreceive_stream().
2015-02-06 15:53:13 +00:00
hselasky
88f22084bd MFC r277136:
Resolve a special case deadlock: When two or more threads are
simultaneously detaching kernel drivers on the same USB device we can
get stuck in the "usb_wait_pending_ref_locked()" function because the
conditions needed for allowing detach are not met.

While at it ensure that "flag_iserror" is only written when "priv_mtx"
is locked, which is protecting it.
2015-02-05 21:18:44 +00:00
jhb
1b3da1fcae MFC 274402:
Add device ID for the T502-BT (dual-port 1G) adapter.
2015-02-05 20:59:03 +00:00
hselasky
181bf69d80 MFC r266969 and r276717:
Add 64-bit DMA support in the XHCI controller driver.
- Fix some comments and whitespaces while at it.
- Add support for PAE.
2015-02-05 20:03:02 +00:00
scottl
87b6a908d9 MFC 277717:
Fix the ioctl interface to properly support fetching the header of regular
and extended config pages.

Obtained from:	Netflix, Inc.
2015-02-05 09:29:57 +00:00
ken
75c5e5b66c MFC isp(4) driver changes:
r276839, r276842, r277513, r277514, r277515

  ------------------------------------------------------------------------
  r276839 | ken | 2015-01-08 10:41:28 -0700 (Thu, 08 Jan 2015) | 49 lines

  Fix Fibre Channel Command Reference Number handling in the isp(4) driver.

  The Command Reference Number is used for precise delivery of
  commands, and is part of the FC-Tape functionality set.  (This is
  only enabled for devices that support precise delivery of commands.)
  It is an 8-bit unsigned number that increments from 1 to 255.  The
  commands sent by the initiator must be processed by the target in
  CRN order if the CRN is non-zero.

  There are certain scenarios where the Command Reference Number
  sequence needs to be reset.  When the target is power cycled, for
  instance, the initiator needs to reset the CRN to 1.  The initiator
  will know this because it will see a LIP (when directly connected)
  or get a logout/login event (when connected to a switch).

  The isp(4) driver was not resetting the CRN when a target
  went away and came back.  When it saw the target again after a
  power cycle, it would continue the CRN sequence where it left off.
  The target would ignore the command because the CRN sequence is
  supposed to be reset to 1 after a power cycle or other similar
  event.

  The symptom that the user would see is that there would be lots of
  aborted INQUIRY commands after a tape library was power cycled, and
  the library would fail to probe.  The INQUIRY commands were being
  ignored by the tape drive due to the CRN issue mentioned above.

  isp_freebsd.c:
  	Add a new function, isp_fcp_reset_crn().  This will reset
  	all of the CRNs for a given port, or the CRNs for all LUNs
  	on a target.

  	Reset the CRNs for all targets on a port when we get a LIP,
  	loop reset, or loop down event.

  	Reset the CRN for a particular target when it arrives, is changed
  	or departs.  This is less precise behavior than the
  	clearing behavior specified in the FCP-4 spec (which says
  	that it should be reset for PRLI, PRLO, PLOGI and LOGO),
  	but this is the level of information we have here.  If this
  	is insufficient, then we will need to add more precise
  	notification from the lower level isp(4) code.

  isp_freebsd.h:
  	Add a prototype for isp_fcp_reset_crn().

  Sponsored by:	Spectra Logic
  MFC after:	1 week

  ------------------------------------------------------------------------
  r276842 | ken | 2015-01-08 10:51:12 -0700 (Thu, 08 Jan 2015) | 44 lines

  Close a race in the isp(4) driver that caused devices to disappear
  and not automatically come back if they were gone for a short
  period of time.

  The isp(4) driver has a 30 second gone device timer that gets
  activated whenever a device goes away.  If the device comes back
  before the timer expires, we don't send a notification to CAM that
  it has gone away.  If, however, there is a command sent to the
  device while it is gone and before it comes back, the isp(4) driver
  sends the command back with CAM_SEL_TIMEOUT status.

  CAM responds to the CAM_SEL_TIMEOUT status by removing the device.
  In the case where a device comes back within the 30 second gone
  device timer window, though, we weren't telling CAM the device
  came back.

  So, fix this by tracking whether we have told CAM the device is
  gone, and if we have, send a rescan if it comes back within the 30
  second window.

  ispvar.h:
  	In the fcportdb_t structure, add a new bitfield,
  	reported_gone.  This gets set whenever we return a command
  	with CAM_SEL_TIMEOUT status on a Fibre Channel device.

  isp_freebsd.c:
  	In isp_done(), if we're sending CAM_SEL_TIMEOUT for for a
  	command sent to a FC device, set the reported_gone bit.

  	In isp_async(), in the ISPASYNC_DEV_STAYED case, rescan the
  	device in question if it is mapped to a target ID and has
  	been reported gone.

  	In isp_make_here(), take a port database entry argument,
  	and clear the reported_gone bit when we send a rescan to
  	CAM.

  	In isp_make_gone(), take a port database entry as an
  	argument, and set the reported_gone bit when we send an
  	async event telling CAM consumers that the device is gone.

  Sponsored by:	Spectra Logic
  MFC after:	1 week

  ------------------------------------------------------------------------
  r277514 | will | 2015-01-21 13:27:11 -0700 (Wed, 21 Jan 2015) | 18 lines

  Force commit to record the correct log for r277513.

  If the user sends an XPT_RESET_DEV CCB, make sure to reset the
  Fibre Channel Command Reference Number if we're running on a FC
  controller.

  We send a SCSI Target Reset when we get this CCB, and as a result
  need to reset the CRN to 1 on the next command.

  isp_freebsd.c:
  	In the XPT_RESET_DEV implementation in isp_action(), reset
  	the CRN if we're on a FC controller.

  Submitted by:	ken
  MFC after:	1 week
  Sponsored by:	Spectra Logic
  MFSpectraBSD:	1112787 on 2015/01/15

  ------------------------------------------------------------------------
  r277515 | will | 2015-01-21 13:32:36 -0700 (Wed, 21 Jan 2015) | 25 lines

  Fix SCSI status byte reporting on 4Gb and 8Gb Qlogic boards.

  The newer boards don't have the response field that indicates
  whether the SCSI status byte is present.  You have to just look to
  see whether it is non-zero.

  The code was looking to see whether the sense length was valid
  before propagating the SCSI status byte (and sense information) up
  the stack.  With a status like Reservation Conflict, there is no
  sense information, only the SCSI status byte.  So it wasn't getting
  correctly returned.

  isp.c:
  	In isp_intr(), if we are on a 2400 or 2500 type board and
  	get a response, look at the actual contents of the
  	SCSI status value and set the RQSF_GOT_STATUS flag
  	accordingly so that return any SCSI status value we get.  The
  	RQSF_GOT_SENSE flag will get set later on if there is
  	actual sense information returned.

  Submitted by:	ken
  MFC after:	1 week
  Sponsored by:	Spectra Logic
  MFSpectraBSD:	1112791 on 2015/01/15

  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic
2015-02-03 22:49:12 +00:00
delphij
00fdf5663a MFC r277806:
Use unsigned int for index value.

Without this change a local attacker could trigger a panic by
tricking the kernel into accessing undefined kernel memory.

We would like to acknowledge Francisco Falcon from CORE Security
Technologies who discovered the issue and reported to the
FreeBSD Security Team.

More information can be found at CORE Security's advisory at:
http://www.coresecurity.com/content/freebsd-kernel-multiple-vulnerabilities

This is an errata candidate for releng/10.1 and releng/9.3.  Earlier
releases are not affected.

Reported by:  Francisco Falcon from CORE Security Technologies
Security:     CVE-2014-0998
Reviewed by:  dumbbell
2015-02-02 18:48:49 +00:00
hselasky
0392db24d4 MFC r277246:
Add more USB device IDs.

PR:		196362
2015-01-28 20:01:21 +00:00
hselasky
8f49a6a1cb MFC r277417:
Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular
the value returned in the "udp_port_level" field.
2015-01-28 19:41:31 +00:00
jkim
8459b965f7 MFC: r277594
Simplify retry loops.
2015-01-26 19:27:30 +00:00
jkim
2c7d513fe4 MFC: r277579
Revert r216942.  This commit was premature and caused too many complaints.
2015-01-26 19:25:35 +00:00
cperciva
65e2f94603 MFC r277318:
When disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't
  accidentally enable non-existent states.

  This bug was triggered if ACPI advertises the presence of a C2 state
  which we fail to parse via acpi_PkgGas due to our lack of support for
  FFixedHW resources, and causes an immediate panic when an attempt is
  made to enter the (NULL) state.

  One affected platform is the EC2 c4.8xlarge VM instance type; there
  may be others.
2015-01-25 08:16:51 +00:00
delphij
771ee7d0d8 MFC r276795:
Fix sos@'s name.
2015-01-23 18:55:24 +00:00
hselasky
a20136a303 MFC r276892:
Add support for USB device side mode to the USB modem driver.
2015-01-20 05:12:30 +00:00
bryanv
d8207c1298 MFC r276491:
Add softc flag for when the indirect descriptor feature was negotiated
2015-01-19 17:02:30 +00:00
bryanv
17a9a10342 MFC r276489:
Use the appropriate IPv4 or IPv6 TSO HW assist flag
2015-01-19 17:00:53 +00:00
hselasky
544eb7ca08 MFC r276798:
Fix handling of an error case when the MUSB driver is operating in USB
device side mode.
2015-01-19 07:18:59 +00:00
hselasky
5f3d7c27fb MFC r277044:
Increase the maximum number of dynamic USB quirks. USB memory stick
devices which don't support the synchronize cache SCSI command are
likely to also not support the prevent-allow medium removal SCSI
command.

PR:		185747
2015-01-19 07:06:15 +00:00
np
4c190cd51e MFC r276959:
cxgb: replace r273280 with a more comprehensive fix.

Poll for link state when the link is down, even for interrupt capable
PHYs.

Allow PHYs to report a dubious "partial" link.  If this state is seen 3
consecutive times (each check is ~1s apart) then reset the PHY.  This is
a workaround for a situation where repeatedly toggling the link from the
peer gets the AEL2005 PHY into a state where it never establishes a PCS
block lock even when everything is in order.
2015-01-18 20:38:38 +00:00
smh
f596acca20 MFC r276012:
Add a constant AHCI_MAX_IRQS removing magic number

MFC r276013:
Clamp ahci max irq's to AHCI_MAX_IRQS

MFC r276016:
Return the error from ahci_setup_interrupt in ahci_attach

MFC r276019:
style (9) nits

Sponsored by:	Multiplay
2015-01-12 10:25:07 +00:00
hselasky
66c12db3df MFC r276611:
Make sure an error case exits unlocked.
2015-01-11 13:59:25 +00:00
hselasky
dd1bd8c591 MFC r276534:
The "vt_suspend_flush_timer()" function is sometimes called locked
which prevents us from doing a "callout_drain()" call. The callout in
question has a lock associated with it and we are not freeing the
callout. That means we can use the "callout_stop()" function to
atomically stop the callback iff the "callout_stop()" function is
called locked. This patch applies proper locking to "callout_stop()"
and replaces a "callout_drain()" with a "callout_stop()".
2015-01-11 12:25:10 +00:00
hselasky
3a6d6794aa MFC r271156 and r273376:
- Add IDs for Intel Patsburg USB 2.0 controller.
- Add the Intel BayTrail USB device which needs port routing for USB 3.0.
2015-01-11 12:08:17 +00:00
hselasky
0ee44a5ce1 MFC r276321, r276404, r276407 and r276799:
Various XHCI fixes and improvements:
- Improve and fix MSI interrupt allocation, setup and release.
- Add missed flushing of data which can happen when "xhci_configure_mask()"
  is called from "xhci_configure_reset_endpoint()". Ensure the 3-strikes
  error feature is always enabled except for ISOCHRONOUS transfers.
- Allow systems having a page size greater than 4K to use fewer
  scatter-gather XHCI TRB entries for its payload data. The XHCI
  controller can handle at least 65536 bytes per scatter-gather list
  entry.
2015-01-11 11:28:03 +00:00
loos
669637a75a MFC r276589:
puc(4): Add an entry for the Feasso PCI FPP-02 2S1P card.
2015-01-09 03:35:19 +00:00