aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mpr
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix possible use of invalid pointer.Stephen McConnell2016-05-091-1/+4
| | | | | | | | | | | | | | It was possible to use an invalid pointer to get the target ID value. To fix this, initialize a local Target ID variable to an invalid value and change that variable to a valid value only if the pointer to the Target ID is not NULL. Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6100 Notes: svn path=/head/; revision=299269
* 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-093-14/+22
| | | | | | | | | | | | | 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-095-11/+69
| | | | | | | | | | | 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-0911-136/+115
| | | | | | | | | | 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
* Update MPI headers to version 42.Stephen McConnell2016-05-0912-113/+578
| | | | | | | | | | Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6096 Notes: svn path=/head/; revision=299263
* mpr(4) and mps(4) shouldn't indefinitely retry for "terminated ioc" errorsAlan Somers2016-05-051-4/+13
| | | | | | | | | | | Submitted by: ken Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6210 Notes: svn path=/head/; revision=299121
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-035-5/+5
| | | | | | | 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
* Don't retry SAS commands in response to protocol errorsAlan Somers2015-12-141-3/+11
| | | | | | | | | | | | | | | | | | | | sys/dev/mpr/mpr_sas_lsi.c sys/dev/mps/mps_sas_lsi.c When mp[rs]sas_get_sata_identify returns MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR, don't bother retrying. Protocol errors aren't likely to be fixed by sleeping. Without this change, a system that generated may protocol errors due to signal integrity issues was taking more than an hour to boot, due to all the retries. Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4553 Notes: svn path=/head/; revision=292218
* Remove _FreeBSD_version check for something that was only an issue withScott Long2015-10-162-8/+1
| | | | | | | | | | 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-2823-474/+768
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-2823-768/+474
| | | | | | | | | | | 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-2723-474/+768
| | | | | | | | Approved by: ken MFC after: 1 week Notes: svn path=/head/; revision=283632
* Add FreeBSD stable/10 version checks for the availability of theKenneth D. Merry2015-02-261-1/+2
| | | | | | | | | | | | | | | | CDAI_FLAG_NONE advanced information CCB flag. Support for the flag was merged to stable/10 in r279329, and the __FreeBSD_version in stable/10 was bumped to 1001510. Check for that version in the mps(4) and mpr(4) drivers when determining whether to use the flag. Sponsored by: Spectra Logic MFC after: 3 days Notes: svn path=/head/; revision=279336
* Make sure that the flags for the XPT_DEV_ADVINFO CCB are initializedKenneth D. Merry2015-02-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | properly. If there is garbage in the flags field, it can sometimes include a set CDAI_FLAG_STORE flag, which may cause either an error or perhaps result in overwriting the field that was intended to be read. sys/cam/cam_ccb.h: Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE, that callers can use to set the flags field when no store is desired. sys/cam/scsi/scsi_enc_ses.c: In ses_setphyspath_callback(), explicitly set the XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the physical path information. Instead of ORing in the CDAI_FLAG_STORE flag when storing the physical path, set the flags field to CDAI_FLAG_STORE. sys/cam/scsi/scsi_sa.c: Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when fetching extended inquiry information. sys/cam/scsi/scsi_da.c: When storing extended READ CAPACITY information, set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of ORing it into a field that isn't initialized. sys/dev/mpr/mpr_sas.c, sys/dev/mps/mps_sas.c: When fetching extended READ CAPACITY information, set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of setting it to 0. sbin/camcontrol/camcontrol.c: When fetching a device ID, set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of 0. sys/sys/param.h: Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO CCB flag, CDAI_FLAG_NONE. Sponsored by: Spectra Logic MFC after: 1 week Notes: svn path=/head/; revision=278964
* Prevent overflow issues in timeout processingSteven Hartland2014-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected. Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this. Also correct isci to correctly resolve ccb timeout. This was based on the original work done by Eygene Ryabinkin <rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid the overlow. Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay Notes: svn path=/head/; revision=274819
* 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
* Properly report 12Gbps connection rate.Alexander Motin2014-10-082-0/+4
| | | | | | | | Reviewed by: kadesai, slm MFC after: 1 week Notes: svn path=/head/; revision=272756
* Increase taskqueue thread priority from idle to PRIBIO.Alexander Motin2014-05-241-3/+1
| | | | | | | | | Idle priority is not even time-share, so if system is busy in any way, those events may never be executed. Since in some cases system waits for events processed by that thread, that may cause deadlocks. Notes: svn path=/head/; revision=266615
* Add #ifdefs in the mpr(4) driver so that versions of stable/9 thatKenneth D. Merry2014-05-082-5/+10
| | | | | | | | | | | | | | have implemented the PIM_NOSCAN rescan functionality will have it enabled. This is a no-op for head. Reviewed by: slm Sponsored by: Spectra Logic Corporation MFC after: 3 days Notes: svn path=/head/; revision=265712
* Fix TLR (Transport Layer Retry) support in the mps(4) and mpr(4) drivers.Kenneth D. Merry2014-05-081-2/+4
| | | | | | | | | | | | | | | | | | TLR is necessary for reliable communication with SAS tape drives. This was broken by change 246713 in the mps(4) driver. It changed the cm_data field for SCSI I/O requests to point to the CCB instead of the data buffer. So, instead, look at the CCB's data pointer to determine whether or not we're talking to a tape drive. Also, take the residual into account to make sure that we don't go off the end of the request. MFC after: 3 days Sponsored by: Spectra Logic Corporation Notes: svn path=/head/; revision=265709
* Hold the SIM lock when calling xpt_create_path() and xpt_action() inKenneth D. Merry2014-05-071-0/+6
| | | | | | | | | | | | | mprsas_SSU_to_SATA_devices(). This fixes an assertion on shutdown with INVARIANTS enabled with SATA drives present on an IR firmware controller. Reviewed by: Steve McConnell <stephen.mcconnell@avagotech.com>. MFC after: 3 days Notes: svn path=/head/; revision=265485
* 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
* Change the device name for mpr(4) from /dev/mpr_N to /dev/mprN.Kenneth D. Merry2014-05-061-1/+1
| | | | | | | | | | This is more consistent with the existing mps(4) behavior. Reviewed by: Steve McConnell <stephen.mcconnell@avagotech.com> MFC after: 3 days Notes: svn path=/head/; revision=265473
* Fix a problem with async notifications in the mpr(4) driver.Kenneth D. Merry2014-05-061-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This problem only occurs on versions of FreeBSD prior to the recent CAM locking changes. (i.e. stable/9 and older versions of stable/10) This change should be a no-op for head and stable/10. If a path isn't specified, xpt_register_async() will create a fully wildcarded path and acquire a lock (the XPT lock in older versions, and via xpt_path_lock() in newer versions) to call xpt_action() for the XPT_SASYNC_CB CCB. It will then drop the lock and if the requested event includes AC_FOUND_DEVICE or AC_PATH_REGISTERED, it will get the caller up to date with any device arrivals or path registrations. The issue is that before the locking changes, each SIM lock would get acquired in turn during the EDT tree traversal process. If a path is specified for xpt_register_async(), it won't acquire and drop its own lock, but instead expects the caller to hold its own SIM lock. That works for the first part of xpt_register_async(), but causes a recursive lock acquisition once the EDT traversal happens and it comes to the SIM in question. And it isn't possible to call xpt_action() without holding a SIM lock. The locking changes fix this by using the XPT topology lock for EDT traversal, so it is no longer an issue to hold the SIM lock while calling xpt_register_async(). The solution for FreeBSD versions before the locking changes is to request notification of all device arrivals (so we pass a NULL path into xpt_register_async()) and then filter out the arrivals that are not ours. MFC After: 3 days Sponsored by: Spectra Logic Corporation Notes: svn path=/head/; revision=265424
* Adjust #if statements inside mprsas_send_smpcmd() to more accuratelyKenneth D. Merry2014-05-051-5/+6
| | | | | | | | | | | | | | | | | | | reflect when unmapped I/O support was added. For FreeBSD 10, it arrived just prior to __FreeBSD_version 1000028. For FreeBSD 9, it arrived just prior to __FreeBSD_version 902001. Also, fix compiler warnings in mprsas_send_smpcmd() that happen in the i386 PAE build for non-unmapped I/O builds. These were fixed in mps(4) in revision 241145, but didn't make it into the mpr(4) driver. This change should only affect FreeBSD versions outside the above revisions, and thus doesn't affect head. MFC after: 3 days Sponsored by: Spectra Logic Corporation Notes: svn path=/head/; revision=265386
* Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers.Kenneth D. Merry2014-05-0225-0/+25568
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