aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mpr/mpr.c
Commit message (Collapse)AuthorAgeFilesLines
...
* More code refactoring in preparation for enabling multiqueue.Scott Long2017-09-101-44/+54
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=323383
* Start separating the LSI drivers into per-queue structures. NoScott Long2017-09-091-1/+22
| | | | | | | | | functional change. Sponsored by: Netflix Notes: svn path=/head/; revision=323369
* Start overhauling debug printing in the MPS and MPR drivers. The focus of thisScott Long2017-08-271-89/+133
| | | | | | | | | | | commit it to make initiazation less chatty in the normal case, and more useful and informative when real debugging is turned on. Reviewed by: ken (earlier version) Sponsored by: Netflix Notes: svn path=/head/; revision=322943
* Changes to make mps(4) and mpr(4) handle reinit with reallocation.Kenneth D. Merry2017-08-101-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the mps(4) and mpr(4) drivers need to reinitialize the firmware, they sometimes need to reallocate all of the memory allocated by the driver. The reallocation happens whenever the IOC Facts change. That should only happen after a firmware upgrade. If the reinitialization happens as a result of a timed out command sent to the card, the command that timed out and triggered the reinit may have been freed if iocfacts_allocate() reallocated all memory. If the caller attempts to access the command after that, the kernel will panic because the caller will be dereferencing freed memory. The solution is to set a flag in the softc when we reallocate, and avoid dereferencing the command strucure if we've reallocated. The changes are largely the same in both drivers, since mpr(4) is a derivative of mps(4). o In iocfacts_allocate(), if the IOC Facts have changed and we need to reallocate, set the REALLOCATED flag in the softc. o Change wait_command() to take a struct mps_command ** instead of a struct mps_command *. This allows us to NULL out the caller's command pointer if we have to reinit the controller and the data structures get reallocated. (The REALLOCATED flag will be set in the softc if that has happened.) o In every place that calls wait_command(), make sure we handle the case where the command is NULL after the call. o The mpr(4) driver has mpr_request_polled() which can also reinitialize the card. Also check for reallocation there. Reviewed by: scottl, slm MFC after: 1 week Sponsored by: Spectra Logic Notes: svn path=/head/; revision=322364
* Change from using underbar function names to normal function names forScott Long2017-07-301-4/+4
| | | | | | | | | the informational print functions. Collapse the debug API a bit to be more generic and not require as much code duplication. While here, fix a bug in MPS that was already fixed in MPR. Notes: svn path=/head/; revision=321733
* Split the interrupt setup code into two parts: allocation and configuration.Scott Long2017-07-301-3/+1
| | | | | | | | | | | | | | | | | Do the allocation before requesting the IOCFacts message. This triggers the LSI firmware to recognize the multiqueue should be enabled if available. Multiqueue isn't used by the driver yet, but this also fixes a problem with the cached IOCFacts not matching latter checks, leading to potential problems with error recovery. As a side-effect, fetch the driver tunables as early as possible. Reviewed by: slm Obtained from: Netflix Differential Revision: D9243 Notes: svn path=/head/; revision=321714
* Fix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.Kenneth D. Merry2017-07-191-4/+15
| | | | | | | | | | | | | | | | | mps_wait_command() and mpr_wait_command() were using getmicrotime() to determine elapsed time when checking for a timeout in polled mode. getmicrotime() isn't guaranteed to monotonically increase, and that caused spurious timeouts occasionally. Switch to using getmicrouptime(), which does increase monotonically. This fixes the spurious timeouts in my test case. Reviewed by: slm, scottl MFC after: 3 days Sponsored by: Spectra Logic Notes: svn path=/head/; revision=321207
* Fix several problems with mapping code.Stephen McConnell2017-05-251-1/+4
| | | | | | | | | | Reviewed by: ken, scottl, asomers, ambrisko, mav Approved by: ken, mav MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10861 Notes: svn path=/head/; revision=318896
* Add tri-mode support (SAS/SATA/PCIe).Stephen McConnell2017-05-171-19/+671
| | | | | | | | | | | | | | | | | | | | This includes NVMe device support and adds support for the following adapters: SAS 3408 SAS 3416 SAS 3508 SAS 3516 SAS 3616 SAS 3708 SAS 3716 Reviewed by: ken, scottl, asomers, mav Approved by: ken, scottl, mav MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D10095 Notes: svn path=/head/; revision=318427
* Add a fallback to the device mapper logic. We've seen systems in the fieldScott Long2016-11-021-0/+10
| | | | | | | | | | | | | | | that are apparently misconfigured by the manufacturer and cause the mapping logic to fail. The fallback allows drive numbers to be assigned based on the PHY number that they're attached to. Add sysctls and tunables to overrid this new behavior, but they should be considered only necessary for debugging. Reviewed by: imp, smh Obtained from: Netflix MFC after: 3 days Sponsored by: D8403 Notes: svn path=/head/; revision=308217
* Use real values to calculate Max I/O size instead of guessing.Stephen McConnell2016-07-121-0/+11
| | | | | | | | | | Reviewed by: ken, scottl Approved by: ken, scottl, ambrisko (mentors) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7043 Notes: svn path=/head/; revision=302673
* Change logging level for a debug string to use MPR_LOG instead of MPR_INFO.Stephen McConnell2016-05-091-1/+1
| | | | | | | | Approved by: ken, scottl, ambrisko MFC after: 1 week Notes: svn path=/head/; revision=299268
* No log bit in IOCStatus and endian-safe changes.Stephen McConnell2016-05-091-2/+3
| | | | | | | | | | | | | Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and make a few more things endian-safe. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6097 Notes: svn path=/head/; revision=299267
* Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's.Stephen McConnell2016-05-091-11/+32
| | | | | | | | | | | Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D6098 Notes: svn path=/head/; revision=299266
* Several style changes and add copyrights for 2016.Stephen McConnell2016-05-091-22/+17
| | | | | | | | | | Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6103 Notes: svn path=/head/; revision=299265
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* sys: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni2016-04-211-2/+2
| | | | | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted. Notes: svn path=/head/; revision=298433
* Remove _FreeBSD_version check for something that was only an issue withScott Long2015-10-161-2/+0
| | | | | | | | | | 9-CURRENT. Obtained from: Netlfix, Inc MFC after: 3 days Notes: svn path=/head/; revision=289426
* The wrong commit message was given with r283632. This is the correct message.Stephen McConnell2015-05-281-41/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Updated all files with 2015 Avago copyright, and updated LSI's copyright dates. - Changed all of the PCI device strings from LSI to Avago Technologies (LSI). - Added a sysctl variable to control how StartStopUnit behavior works. User can select to spin down disks based on if disk is SSD or HDD. - Inquiry data is required to tell if a disk will support SSU at shutdown or not. Due to the addition of mpssas_async, which gets Advanced Info but not Inquiry data, the setting of supports_SSU was moved to the mpssas_scsiio_complete function, which snoops for any Inquiry commands. And, since disks are shutdown as a target and not a LUN, this process was simplified by basing it on targets and not LUNs. - Added a sysctl variable that sets the amount of time to retry after sending a failed SATA ID command. This helps with some bad disks and large disks that require a lot of time to spin up. Part of this change was to add a callout to handle timeouts with the SATA ID command. The callout function is called mpssas_ata_id_timeout(). (Fixes PR 191348) - Changed the way resets work by allowing I/O to continue to devices that are not currently under a reset condition. This uses devq's instead of simq's and makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a function called mpssas_prepare_tm(). - Some changes were made to reduce code duplication when getting a SAS address for a SATA disk. - Fixed some formatting and whitespace. - Bump version of mps driver to 9.255.01.00-fbsd PR: 191348 Reviewed by: ken, scottl Approved by: ken, scottl MFC after: 1 week Notes: svn path=/head/; revision=283661
* The wrong commit message was given with r283632. To get the correct commitStephen McConnell2015-05-281-49/+41
| | | | | | | | | | | message synced to the changes in r283632, those changes are now backed out. Another commit will be done that is exactly the same as r283632 except it will have to correct commit message. Approved by: ken, scottl, asomers, gibbs Notes: svn path=/head/; revision=283660
* This setting of stop_at_shutdown should have been removed with r279253Stephen McConnell2015-05-271-41/+49
| | | | | | | | Approved by: ken MFC after: 1 week Notes: svn path=/head/; revision=283632
* Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky2014-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273377
* Remove some debugging code.Kenneth D. Merry2014-05-071-2/+0
| | | | | | | | Submitted by: Steve McConnell <stephen.mcconnell@avagotech.com> MFC after: 3 days Notes: svn path=/head/; revision=265484
* Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers.Kenneth D. Merry2014-05-021-0/+2797
This is derived from the mps(4) driver, but it supports only the 12Gb IT and IR hardware including the SAS 3004, SAS 3008 and SAS 3108. Some notes about this driver: o The 12Gb hardware can do "FastPath" I/O, and that capability is included in this driver. o WarpDrive functionality has been removed, since it isn't supported in the 12Gb driver interface. o The Scatter/Gather list handling code is significantly different between the 6Gb and 12Gb hardware. The 12Gb boards support IEEE Scatter/Gather lists. Thanks to LSI for developing and testing this driver for FreeBSD. share/man/man4/mpr.4: mpr(4) man page. sys/dev/mpr/*: mpr(4) driver files. sys/modules/Makefile, sys/modules/mpr/Makefile: Add a module Makefile for the mpr(4) driver. sys/conf/files: Add the mpr(4) driver. sys/amd64/conf/GENERIC, sys/i386/conf/GENERIC, sys/mips/conf/OCTEON1, sys/sparc64/conf/GENERIC: Add the mpr(4) driver to all config files that currently have the mps(4) driver. sys/ia64/conf/GENERIC: Add the mps(4) and mpr(4) drivers to the ia64 GENERIC config file. sys/i386/conf/XEN: Exclude the mpr module from building here. Submitted by: Steve McConnell <Stephen.McConnell@lsi.com> MFC after: 3 days Tested by: Chris Reeves <chrisr@spectralogic.com> Sponsored by: LSI, Spectra Logic Relnotes: LSI 12Gb SAS driver mpr(4) added Notes: svn path=/head/; revision=265236