aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_base.h
Commit message (Collapse)AuthorAgeFilesLines
* mpt2sas: fix non-x86 crash on shutdownNagalakshmi Nandigama2012-01-061-4/+0
| | | | | | | | | | | | | | Upstrem commit: 911ae9434f83e7355d343f6c2be3ef5b00ea7aed There's a bug in the MSIX backup and restore routines that cause a crash on non-x86 (direct access to PCI space not via read/write). These routines are unnecessary and were removed by the above commit, so also remove them from stable to fix the crash. Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* mpt2sas: Adding support for customer specific brandingKashyap, Desai2011-10-031-0/+3
| | | | | | | | | commit ab3e5f60d1fc8fe725d02510ff820ff207a8dbef upstream. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* mpt2sas: Fixed Big Indian Issues on 32 bit PPCKashyap, Desai2011-08-151-3/+50
| | | | | | | | | | | | | commit c97951ec46d4b076c2236b77db34eeed6dddb8eb upstream. This patch addresses many endian issues solved by runing sparse with the option __CHECK_ENDIAN__ turned on. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Cc: David Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [SCSI] mpt2sas: Driver version upgrade 08.100.00.02Kashyap, Desai2011-05-241-2/+2
| | | | | Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
* [SCSI] mpt2sas : WarpDrive New product SSS6200 support addedKashyap, Desai2011-05-011-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has Support for the new solid state device product SSS6200 from LSI and relavent features w.r.t SSS6200. The major feature added in this driver is supporting Direct-I/O to the SSS6200 storage.There are some additional changes done to avoid exposing the RAID member disks to the OS and hiding/exposing drives based on the OEM Specific Flag in Manufacturing Page10 (this is required to handle specific changes in the SSS6200 firmware). Each and every changes are listed below. 1. Hiding IR related messages. For SSS6200, the driver is modified not to print IR related events. Even if the debugging is enabled the IR related messages will not be displayed. In some places if there is a need to display a message related to IR the string "IR" is replaced with string "DD" and the string "volume" is replaced with "direct drive". But the function names are not changed hence there are some places where the reference to volume can be seen if debug level is set. 2. Removed RAID transport support In Linux the user can retrieve RAID volume information from the sysfs directory. This support is removed for SSS6200. 3. Direct I/O support. The driver tries to enable direct I/O when a volume is reported to the driver by the firmware through IRCC events and the driver does this just before reporting to the OS, hence all the OS issued I/O can go through direct path if they can, The first validation is to see whether the manufacturing page10 flag is set to expose all drives always. If that is set, the driver will not enable direct I/O and displays the message "DDIO" is disabled globally as drives are exposed. The driver checks whether there is more than one volume in the controller, if so the direct I/O will be disabled globally for all volumes in the controller and the message displayed will be "DDIO is disabled globally as number of drives > 1. If retrieving number of PD is failed the driver will not enable direct I/O and displays the message Failure in computing number of drives DDIO disabled. If memory allocation for RAIDVolumePage0 is failed, the driver will not enable direct I/O and displays the message Memory allocation failure for RVPG0 DDIO disabled. If retrieving RAIDVolumePage0 is failed the driver will not enable direct I/O and displays the message Failure in retrieving RVPG0 DDIO disabled If the number of PD in a volume is greater than 8, then the direct I/O will be disabled. If any of individual drives handle retrieval is failed then the DD-IO will be disabled. If the volume is not RAID0 or if the block size is not 512 then the DD-IO will be disabled. If the volume size is greater than 2TB then the DD-IO will be disabled. If the driver is not able to find a valid stripe exponent using the configured stripe size then the DD-IO will be disabled When the DD-IO is enabled the driver will check every I/O request issued to the storage and checks whether the request is either READ6/WRITE6/READ10/WRITE10, if it is and if the complete I/O transfer is within a stripe size then the I/O is redirected to the drive directly instead of the volume. On completion of every I/O, if the completion is failure means if the reply is address reply with a reply frame associated with it, then the type of I/O will be checked, if the I/O is direct then the I/O will be retried to the volume once. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Reviewed-by: Sathya Prakash <sathya.prakash@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas : Added customer specific display supportKashyap, Desai2011-03-231-0/+20
| | | | | | | Added Vendor specific branding message support. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Bump version 08.100.00.00Kashyap, Desai2011-01-241-2/+2
| | | | | | | Upgrade driver version from 7.100.00.00 to 8.100.00.00 Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Basic Code Cleanup in mpt2sas_baseKashyap, Desai2011-01-241-4/+18
| | | | | | | | | | | | | | | | | Basic Code Cleanup: (1) _base_get_cb_idx and mpt2sas_base_free_smid were reorganized in similar fashion so the order of obtaining the cbx and smid are scsiio, hi_priority, and internal. (2) The hi_priority and internal request queue struct was made smaller by removing the scmd and chain_tracker, thus saving memory allocation. (3) For scsiio request, a new structure was created having the same elements from the former request tracker struct. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Add support for Customer specific branding messagesKashyap, Desai2011-01-241-0/+14
| | | | | | | | Add support for Customer specific branding messages when device driver loads, based on specific customer subsystem vendor and device Ids Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Bump version 07.100.00.00Kashyap, Desai2010-12-211-2/+2
| | | | | Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Modify code to support Expander switchKashyap, Desai2010-12-211-0/+2
| | | | | | | | | | | | | | | | | | | | | Issue : Switch swap doesn't work when device missing delay is enabled. (1) add support to individually add and remove phys to and from existing ports. This replaces the routine _transport_delete_duplicate_port. (2) _scsih_sas_host_refresh - was modified to change the link rate from zero to 1.5 GB rate when the firmware reports there is an attached device with zero link. (3) add new function mpt2sas_device_remove, this is wrapper function deletes some redundant code through out driver by combining into one subrountine (4) two subroutines were modified so the sas_device, raid_device, and port lists are traversed once when objects are deleted from the list. Previously it was looping back each time an object was deleted from the list. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Create a pool of chain buffer instead of dedicated per IOsKashyap, Desai2010-12-211-2/+17
| | | | | | | | | | | | | | Create a pool of chain buffers, instead of dedicated per IO: This enahancment is to address memory allocation failure when asking for more than 2300 IOs per host. There is just not enough contiquious DMA physical memory to make one single allocation to hold both message frames and chain buffers when asking for more than 2300 request. In order to address this problem we will have to allocate memory for each chain buffer in a seperate individual memory allocation, placing each chain element of 128 bytes onto a pool of available chains, which can be shared amoung all request. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Added sanity check for cb_idx and smid access.Kashyap, Desai2010-12-211-0/+2
| | | | | | | | | | | | | | | | | | | | Sometime it is seen that controller firmware returns an invalid system message id (smid). the oops is occurring becuase mpt_callbacks pointer is referenced to either null or invalid virtual address. this is due to cb_idx set incorrectly from routine _base_get_cb_idx. the cb_idx was set incorrectly becuase there is no check to make sure smid is less than maxiumum anticapted smid. to fix this issue, we add a check in _base_get_cb_idx to make sure smid is not greater than ioc->hba_queue_depth. in addition, a similar check was added to make sure the reply address was less than the largest anticapated address. Newer firmware has sovled this issue, however it good to have this sanity check. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* Merge branch 'for-next' of ↵Linus Torvalds2010-08-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits) Documentation: update broken web addresses. fix comment typo "choosed" -> "chosen" hostap:hostap_hw.c Fix typo in comment Fix spelling contorller -> controller in comments Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault fs/Kconfig: Fix typo Userpace -> Userspace Removing dead MACH_U300_BS26 drivers/infiniband: Remove unnecessary casts of private_data fs/ocfs2: Remove unnecessary casts of private_data libfc: use ARRAY_SIZE scsi: bfa: use ARRAY_SIZE drm: i915: use ARRAY_SIZE drm: drm_edid: use ARRAY_SIZE synclink: use ARRAY_SIZE block: cciss: use ARRAY_SIZE comment typo fixes: charater => character fix comment typos concerning "challenge" arm: plat-spear: fix typo in kerneldoc reiserfs: typo comment fix update email address ...
| * fix typos concerning "management"Uwe Kleine-König2010-06-161-1/+1
| | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | [SCSI] mpt2sas: driver fails to recover from injected PCIe bus errorsEric Moore2010-07-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes surrounding PCIe enhanced error handling: (1) We need to reject all request generated internaly inside the driver as well as request arriving from the scsi mid layer when PCIe EEH is active. The fix is to add a per adapter flag called pci_error_recovery which is checked thru out the driver when request are generated. (2) We don't need to call the pci_driver->remove directly from the PCIe callbacks becuase its already called from the PCIe EEH code. In its place we are shutting down the watchdog timer, and flushing back all pending IO. (3) We need to save and restore the pci state across PCIe EEH handling. Signed-off-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: Bump version 06.100.00.00Kashyap, Desai2010-07-271-3/+3
| | | | | | | | | | | | | | Version upgrade patch Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: Copy sense buffer instead of working on direct memory locationKashyap, Desai2010-07-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | (1) driver was not setting the sense data size prior to sending SCSI_IO, resulting in the 0x31190000 loginfo (2) The driver needs to copy the sense data to local buffer prior to releasing the request message frame. If not, the sense buffer gets overwritten by the next SCSI_IO request. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: Redesign Raid devices event handling using pd_handles per HBAKashyap, Desai2010-07-271-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actual problem : Driver may receiving the top level expander removal event prior to all the individual PD removal events, hence the driver is breaking down all the PDs in advanced to the actaul PD UNHIDE event. Driver sends multiple Target Resets to the same volume handle for each individual PD removal. FIX DESCRIPTION: To fix this issue, the entire PD device handshake protocal has to be moved to interrupt context so the breakdown occurs immediately after the actual UNHIDE event arrives. The driver will only issue one Target Reset to the volume handle, occurring after the FAILED or MISSING volume status event arrives from interrupt context. For the PD UNHIDE event, the driver will issue target resets to the PD handles, followed by OP_REMOVE. The driver will set the "deteleted" flag during interrupt context. A "pd_handle" bitmask was introduced so the driver has a list of known pds during entire life of the PD; this replaces the "hidden_raid_component" flag handle in the sas_device object. Each bit in the bitmask represents a device handle. The bit in the bitmask would be toggled ON/OFF when the HIDE/UNHIDE events arrive; also this pd_handle bitmask would bould be refreshed across host resets. Here we kept older behavior of sending target reset to volume when there is a single drive pull, wait for the reply, then send target resets to the PDs. We kept this behavior so the driver will behave the same for older versions of firmware. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: Tie a log info message to a specific PHY.Kashyap, Desai2010-07-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support to display additional debug info for SCSI_IO and RAID_SCSI_IO_PASSTHROUGH sent from the normal entry queued entry point, as well as internal generated commands, and IOCTLS. The additional debug info included the phy number, as well as the sas address, enclosure logical id, and slot number. This debug info has to be enabled thru the logging_level command line option, by default this will not be displayed. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: print level KERN_DEBUG is replaced by KERN_INFOKashyap, Desai2010-07-271-1/+0
| | | | | | | | | | | | | | Converting print level from MPT2SAS_DEBUG_FMT to MPT2SAS_INFO_FMT. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: Added sysfs support for trace bufferKashyap, Desai2010-07-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support so the diag ring buffer can be pulled via sysfs Added three new shost attributes: host_trace_buffer, host_trace_buffer_enable, and host_trace_buffer_size. The host_trace_buffer_enable attribute is used to either post or release the trace buffers. The host_trace_buffer_size attribute contains the size of the trace buffer. The host_trace_buffer atttribute contains a maximum 4KB window of the buffer. In order to read the entire host buffer, you will need to write the offset to host_trace_buffer prior to reading it. release the host buffer, then write the entire host buffer contents to a file. In addition to this enhancement, we moved the automatic posting of host buffers at driver load time to be called prior to port_enable, instead of after. That way discovery is available in the host buffer. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: Added sysfs counter for ioc resetKashyap, Desai2010-07-271-0/+1
| | | | | | | | | | | | | | | | Added a new sysfs shost attribute called ioc_reset_count. This will keep count of host resets (both diagnostic and message unit). Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: Hold Controller reset when another reset is in progressKashyap, Desai2010-07-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Driver should not allow multiple host reset when already host reset is in progress. It is possible that host reset was sent by scsi mid layer while there was already an host reset active, either issued via IOCTL interface or internaly, like a config page timeout. Since there was a host reset active, the driver would return a FAILED response to the scsi mid layer. The solution is make sure pending host resets will wait for the active host reset to complete before returning control back up the call stack. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | [SCSI] mpt2sas: DIF Type 2 Protection SupportEric Moore2010-07-271-2/+2
|/ | | | | | | | | Adding DIF Type 2 protection support, as well as turning on 32 byte cdb's, and setting the cdb length for > 16 byte in the SCSI_IO->control parameter. Signed-off-by: Martin Petersen <martin.petersen@oracle.com> Signed-off-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Bump version 05.100.00.02Kashyap, Desai2010-04-111-2/+2
| | | | | | | Upgrade version to 05.100.00.02 Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Upgrade version 05.100.00.01Kashyap, Desai2010-04-111-2/+2
| | | | | | | Upgraded version string. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: sanity added to remove duplicate port from topologyKashyap, Desai2010-04-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | There are few special cases which needs to be handled deleting old port. CASE1: In topology you need cascaded expanders. Through sysfs just make sure topology is up. Erase the manufacturing image of the cascaded expander and reset the board. In some cases Adapter will receive Exapnder Add event before expander delete. In such a case, driver needs to delete duplicate port before adding new port. CASE2: Enable Device Missing delay of HBA through lsiutils. If expander or end device is hotswapped with different device before DMD timer expires, driver will get device add for new device first and then device deletion event for the original devices will arrive later at DMD timer expires. In this case also driver need to delete duplicate port before adding port for new device. Added new function which will make sure when new port is added, that its not claiming the same phy resources already in use by another port. If it does, then it will delete the other port before adding the new port. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Bump version 05.100.00.00Kashyap, Desai2010-04-111-4/+4
| | | | | | | Upgraded version string. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Copyright 2010.Kashyap, Desai2010-04-111-1/+1
| | | | | | | Copyright changes for year 2010. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: removed use of tm_cmds.mutex in IOCTL branch.Kashyap, Desai2010-04-111-2/+3
| | | | | | | | | | | | | | Removed all the mutex's for ioc->tm_cmds.mutex, then created one single mutex inside the function mpt2sas_scsih_issue_tm. This is the single function used when sending task management. Also the sanity checks required for scsi mid layer escalation were moved to inside the same function because these checks need to be done while the mutex is held. The ioc->tm_cmds.mutex inside the IOCTL branch is really not required since there is another mutex in this code called for ctl_cmds handling this sync. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Use of get_free_pages for huge memorary allocation.Kashyap, Desai2010-04-111-2/+3
| | | | | | | | | | use the get_free_pages API for larger contigious physical memory chunk. Also, the ioc->chain_depth need to be changed from a 16bit to 32bit variable because the number of chains will exceed 64k when the queue depth is large. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas : Device removal algorithm in interrupt context onlyKashyap, Desai2010-04-111-11/+0
| | | | | | | | | | | | | | | | | external host not connecting after controller reboot: The problem is : devices are not coming back after having the cable disconnected then reconnected. The problem is because the driver/firmware device removal handshake is failing. Due to this failure, the controller firmware is not sending out device add events when the target is reconnected. This is root caused to a race in the driver/firmware device removal algorithm. There is duplicate code in both interrupt and user context; where target reset is being issue from user context path while sas_iounit_control(OP_REMOVE) is being sent from interrupt context. An active target_reset will fail the OP_REMOVE. To fix this problem, the duplicate code has been removed from user context path. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Upgrading version to 04.100.01.02Kashyap, Desai2010-04-111-2/+2
| | | | | | | | Upgraded version string. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: RESCAN Barrier work is added in case of HBA reset.Kashyap, Desai2010-04-111-2/+1
| | | | | | | | | | | | | | | | | | Add the cancel_pending_work flag from the fw_event_work structure, and then to set the flag during host reset, check the flag later from work threads context and if cancel_pending_work_flag is set ingore those events. Now Rescan after host reset is changed. Added special task MPT2SAS_RESCAN_AFTER_HOST_RESET. This task will be queued at the time of HBA reset. this task is treated as barrier. All work after MPT2SAS_RESCAN_AFTER_HOST_RESET will be treated as new work and will be server by callback handle. If host_recovery is going on while running RESCAN task, it will wait for shos_recovery_done completion which will be called from HBA reset DONE context. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Bump version 04.100.01.00Kashyap, Desai2010-02-081-3/+3
| | | | | | | | Version upgraded to 04.100.01.00. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Added phy_enable and set_phy_speed sysfs callback support.Kashyap, Desai2010-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new callbacks phy_enable and set_phy_speed in the mpt2sas_transport_functions template. This will allow end user to enable/disable phys and change links rates using the SysFS interface. Current implementation only supports direct attached phys, but we could in the future add support for expander based phys. A new subroutine mpt2sas_config_set_sas_iounit_pg1 was added; this wrapper function used to send request to controller firmware to modify the phys and link rates. A new subroutine _transport_find_local_phy was added; a function for easly obtaining the local phy object for direct attached. Example to disable a phy echo 0 > /sys/class/phy3:0/enable Example to enable the same phy echo 1 > /sys/class/phy3:0/enable Example to change the link rate to 1.5 #echo "1.5 Gbit" > /sys/class/phy3:0/maximum_linkrate #cat /sys/class/phy3:0/negotiated_linkrate 1.5 Gbit Example to change the link rate to 3.0 #echo "3.0 Gbit" > /sys/class/phy3:0/maximum_linkrate #cat /sys/class/phy3:0/negotiated_linkrate 3.0 Gbit Example to change the link rate to 6.0 #echo "6.0 Gbit" > /sys/class/phy3:0/maximum_linkrate #cat /sys/class/phy3:0/negotiated_linkrate 6.0 Gbit Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Added raid transport supportKashyap, Desai2010-02-081-0/+2
| | | | | | | | | | | Adding support for raid transport layer. This will provide sysfs attributes containing raid level, state, and resync rate. MPT2SAS module will select RAID_ATTRS. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: User resource_size_t instead of unsigned longKashyap, Desai2010-02-081-3/+1
| | | | | | | | | | | | | Use resource_size_t to define the type resource for the system interface register set. The existing implementation was using "unsigned long" which would be 32 bit in 32 bit OS. If 32 bit OS is using 64 bit physical address space for the system interface register set, we need to shift to using resource_size_t which takes care of physical address space. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Bump version 03.100.03.00Kashyap, Desai2009-10-291-2/+2
| | | | | | | | Bump version to 03.100.03.00 Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas : Add support for RAID Action System Shutdown Initiated at OS ↵Kashyap, Desai2009-10-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | shutdown (1) Added new function _scsih_ir_shutdown. This function will issue the MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED request via MPI2_FUNCTION_RAID_ACTION. The function will wait 10 seconds for reply message frame, then print out the ioc status and loginfo. This function is only called when there are raid volumes present. (2) Add shutdown callback in the struct pci_driver object scsih_driver. This will be called only when the system is shutting down. From this function, we will call _scsih_ir_shutdown mentioned above. (3) Add support in _scsih_remove to call _scsih_ir_shutdown. The function _scsih_remove will be called when the driver is unloaded (and system is still running). scsih internal command contex is added to send internal message frames from mpt2sas_scsih.c. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: mpt2sas_base_get_sense_buffer_dma should be returning little ↵Kashyap, Desai2009-10-291-1/+1
| | | | | | | | | | | | | endian cpu_to_le64 when calculating the physical dma address. This will properly handle endianess on big endian systems. The return value of this function was changed from dma_addr_t to __le64. Remove the typecasting of u32 when setting the SenseBufferLowAddress, since its already in __le32 format. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Added command line option diag_buffer_enable.Kashyap, Desai2009-10-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Added command line option diag_buffer_enable. When the command line option is set, the driver will automatically post diag buffers at driver load time. The command line option diag_buffer_enable is bitwise, so it's possible to enable both and/or snapshot + trace buffers. For trace, the driver will allocate 1MB buffer, whereas for snapshot its 2MB. The purpose for this is so the enduser doesn't have to manually use an application to setup diag buffers for debugging firmware related issues. Here is some examples trace: # insmod mpt2sas.ko diag_buffer_enable=1 snapshot: # insmod mpt2sas.ko diag_buffer_enable=2 both trace and snapshot: # insmod mpt2sas.ko diag_buffer_enable=3 Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Support for stopping driver when Firmware encountersKashyap, Desai2009-10-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Added command line option and shost sysfs attribute called mpt2sas_fwfault_debug. When enduser writes a "1" to this parameter, this will enable support in the driver for debugging firmware timeout related issues. This handling was added in three areas (a) scsi error handling callback called task_abort, (b) IOCTL interface, and (c) other timeouts that result in diag resets, such as manufacturing config pages. When this support is enabled, the driver will provide dump_stack to console, halt controller firmware, and panic driver. The end user probably would want to setup serial console redirection so the dump stack can be seen. Here are the three methods for enable this support: (a) # insmod mpt2sas.ko mpt2sas_fwfault_debug=1 (b) # echo 1 > /sys/module/mpt2sas/parameters/mpt2sas_fwfault_debug (c) # echo 1 > /sys/class/scsi_host/host#/fwfault_debug (where # is the host number) Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Driver will use sas address instead of handle as a lookupKashyap, Desai2009-10-291-12/+8
| | | | | | | | | | | | | | | | | The device driver was not handling updating device handles in all cases across diag resets. To fix this issue, the driver is converted to using sas address instead of handle as a lookup reference to the parent expander or sas_host. Also, for both expanders and sas host, the phy handle will be one unique handle. In the sas host case, the phy handle can be different for every phy, so the change is to set the handle to the handle of the first phy; every phy will be one single sas address(phy 0) instead of a different sas address for every phy(previous implementation). So making one consistent sas address for all the direct attachedports to the sas host, will make it better user experience when using udev /dev/disk/by-path dev nodes Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Bump version 02.100.03.00Kashyap, Desai2009-10-021-3/+3
| | | | | | | Bump version to 02.100.03.00 Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Target Reset will be issued from Interrupt context.Kashyap, Desai2009-10-021-11/+30
| | | | | | | | | | | | | | | | | | (1) Added three new functions to handle sending target resest and OP_REMOVE from interrupt time, they are _scsih_tm_tr_send, _scsih_tm_tr_complete, and _scsih_sas_control_complete. This code will create a link list of pending target resets if there is no more available request in the hipriority request queue. The list is stored in ioc->delayed_tr_list. (2) All callback handler return type is changed from void to u8. Now _base_interrupt will check for return type of callback handlers to take decision of message frame is already freed or not. In genral, Return 1 meaning mf should be freed from _base_interrupt 0 means the mf is freed from function. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Added SCSIIO, Internal and high priority memory pools to ↵Kashyap, Desai2009-10-021-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | support multiple TM 1) create a pool of high priority message frames in the region of memory between message frames and chains. The modifications are in _base_allocate_memory_pools. Also create a seperate pool of memory for internal commands located near the same region of memory. The pool of high priority message frames is restriced by the facts->HighPriorityCredit. 2) Create additional API for accessing request message frames. New function mpt2sas_base_get_smid_hpr is for highpriority request. New function mpt2sas_base_get_smid_scsiio for SCSI_IO, passing in the scsi command pointer. The mpt2sas_base_get_smid function is for requesting internal commands. 3) Added new function _base_get_cb_idx to obtain the callback index from one of the three pools of request message frames. 4) Removed wrapper functions _scsih_scsi_lookup_set and _scsih_scsi_lookup_getclear. These were removed because this handling was moved into mpt2sas_base_get_smid_scsiio and mpt2sas_base_free_smid. 5) The function mpt2sas_base_free_smid is modified so the request message frames are put back on one of the three pools of request message frames. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Copyright change to 2009.Kashyap, Desai2009-10-021-1/+1
| | | | | | | Update the copyright year to 2009 through out the code. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] mpt2sas: Update driver to MPI2 REV K headers.Kashyap, Desai2009-10-021-12/+18
| | | | | | | | | Drivers header are updated to the MPI2 REV K headers. Renamed VF_ID to msix_index in all call back handlers. VF_ID is removed from all request descriptor. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>