summaryrefslogtreecommitdiff
path: root/drivers/scsi/hpsa.c
AgeCommit message (Collapse)Author
2014-03-19[SCSI] hpsa: update driver version to 3.4.4-1Stephen M. Cameron
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-19[SCSI] hpsa: fix bad endif placement in RAID 5 mapper codeStephen M. Cameron
It caused the i/o request to always be counted as ineligible for the accelerated i/o path on 32 bit systems and negatively affected performance. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: Do not zero fields of ioaccel2 command structure twiceStephen M. Cameron
Structure was already memset to zero at the top of hpsa_scsi_ioaccel2_queue_command Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: Add hba mode to the hpsa driverStephen M. Cameron
This allows exposing physical disks behind Smart Array controllers to the OS (if the controller has the right firmware and is in "hba" mode) Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: increase the probability of a reported success after a device resetTomas Henzl
rc is set in the loop, and it isn't set back to zero anywhere this patch fixes it Signed-off-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: bring format-in-progress drives online when readyStephen M. Cameron
Do not expose drives that are undergoing a format immediately to the OS, instead wait until they are ready before bringing them online. This is so that logical drives created with "rapid parity initialization" do not get immediately kicked off the system for being unresponsive. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: remove unused kthread.h headerStephen M. Cameron
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: Add support for a few HP Storage controllersStephen M. Cameron
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa add sysfs debug switch for raid map debugging messagesStephen M. Cameron
Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: improve error messages for driver initiated commandsStephen M. Cameron
On encountering unexpected error conditions from driver initiated commands, print something useful like CDB and sense data rather than something useless like the kernel virtual address of the command buffer. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: only do device rescan for certain eventsStephen M. Cameron
Do no rescan on every events -- way too many rescans are triggered if we don't filter the events. Limit rescans to be triggered by the following set of events: * controller state change * enclosure hot plug * physical drive state change * logical drive state change * redundant controller state change * accelerated io enabled/disabled * accelerated io configuration change Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: when switching out of accel mode await only accel command ↵Stephen M. Cameron
completions Don't wait for *all* commands to complete, only for accelerated mode commands. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: add controller base data-at-rest encryption compatibility ioaccel2Scott Teel
Add controller-based data-at-rest encryption compatibility to ioaccel2 path (HP SSD Smart Path). Encryption feature requires driver to supply additional fields for encryption enable, tweak index, and data encryption key index in the ioaccel2 request structure. Encryption enable flag and data encryption key index come from raid_map data structure from raid offload command. During ioaccel2 submission, check device structure's raid map to see if encryption is enabled for the device. If so, call new function below. Add function set_encrypt_ioaccel2 to set encryption flag, data encryption key index, and calculate tweak value from request's logical block address. Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: update source file copyrightsScott Teel
Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: retry certain ioaccel error cases on the RAID pathScott Teel
Change the handling of HP SSD Smart Path errors with status: 0x02 CHECK CONDITION 0x08 BUSY 0x18 RESERVATION CONFLICT 0x40 TASK ABORTED So that they get retried on the RAID Path. Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: do not inquire for unsupported ioaccel status vpd pageStephen M. Cameron
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: allow VPD page zero to be queriedStephen M. Cameron
Code was confused and assumed that page zero was not VPD page and all non-zero pages were VPD pages. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: rescan devices on ioaccel2 errorScott Teel
Allow driver to schedule a rescan whenever a request fails on the ioaccel2 path. This eliminates the possibility of driver getting stuck in non-ioaccel mode. IOaccel mode (HP SSD Smart Path) is disabled by driver upon error detection. Driver relied on idea that request would be retried through normal path, and a subsequent error would occur on that path, and be processed by controller firmware. As part of that process, controller disables ioaccel mode and later reinstates it, signalling driver to change modes. In some error cases, the error will not duplicate on the standard path, so the driver could get stuck in non-ioaccel mode. To avoid that, we allow driver to request a rescan during the next run of the rescan thread. Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: allow user to disable accelerated i/o pathScott Teel
Allow SSD Smart Path for a controller to be disabled by the user, regardless of settings in controller firmware or array configuration. To disable: echo 0 > /sys/class/scsi_host/host<id>/acciopath_status To re-enable: echo 1 > /sys/class/scsi_host/host<id>/acciopath_status To check state: cat /sys/class/scsi_host/host<id>/acciopath_status Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: complete the ioaccel raidmap codeScott Teel
Load balance across members of a N-way mirror set, and handle the meta-RAID levels: R10, R50, R60. Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: make device update copy the raid map alsoStephen M. Cameron
Otherwise we could wind up using incorrect raid map data, and then very bad things would likely happen. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: add task management for ioaccel mode 2Scott Teel
Underlying firmware cannot handle task abort on accelerated path (SSD Smart Path). Change abort requests for accelerated path commands to physical target reset. Send reset request on normal IO path. Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Mike Miller <michael.miller@canonical.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: teach hpsa_device_reset to do either target or lun resetScott Teel
Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: get ioaccel mode 2 i/o workingScott Teel
Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Joe Handzik <Joseph.T.Handzik@hp.com> Signed-off-by: Mike Miller <michael.miller@canonical.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: initialize controller to perform io accelerator mode 2Stephen M. Cameron
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: get physical device handles for io accel mode 2 as well as mode 1Mike MIller
Signed-off-by: Mike MIller <michael.miller@canonical.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: do ioaccel mode 2 resource allocationsStephen M. Cameron
Signed-off-by: Mike Miller <michael.miller@canonical.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: Acknowledge controller events in ioaccell mode 2 as well as mode 1Stephen M. Cameron
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: add ioaccel mode 2 structure definitionsMike Miller
Signed-off-by: Mike Miller <michael.miller@canonical.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: complain if physical or logical aborts are not supportedScott Teel
Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: add hp_ssd_smart_path_enabled sysfs attributeScott Teel
Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: do not rescan controllers known to be locked upStephen M. Cameron
* Do not check event bits on locked up controllers to see if they need to be rescanned. * Do not initiate any device rescans on controllers which are known to be locked up. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: poll controller to detect device change eventStephen M. Cameron
For shared SAS configurations, hosts need to poll Smart Arrays periodically in order to be able to detect configuration changes such as logical drives being added or removed from remote hosts. A register on the controller indicates when such events have occurred, and the driver polls the register via a workqueue and kicks off a rescan of devices if such an event is detected. Additionally, changes to logical drive raid offload eligibility are autodetected in this way. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: update raid offload status on device rescanStephen M. Cameron
When rescanning for logical drives, store information about whather raid offload is enabled for each logical drive, and update the driver's internal record of this. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: add ioaccell mode 1 RAID offload support.Stephen M. Cameron
This enables sending i/o's destined for RAID logical drives which can be serviced by a single physical disk down a different, faster i/o path directly to physical drives for certain logical volumes on SSDs bypassing the Smart Array RAID stack for a performance improvement. Signed-off-by: Matt Gates <matthew.gates@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Mike Miller <michael.miller@canonical.com> Signed-off-by: Don Brace <brace@beardog.cce.hp.com> Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: fix task management for mode-1 ioaccell pathScott Teel
For "mode 1" io accelerated commands, the command tag is in a different location than for commands that go down the normal RAID path, so the abort handler needs to take this into account. Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Mike Miller <michael.miller@canonical.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: only allow REQ_TYPE_FS to use fast pathStephen M. Cameron
When commands sent down the "fast path" fail, they must be re-tried down the normal RAID path. We do this by kicking i/o's back to the scsi mid layer with a DID_SOFT_ERROR status, which causes them to be retried. This won't work for SG_IO's and other non REQ_TYPE_FS i/o's which could get kicked all the way back to the application, which may have no idea that the command needs resubmitting and likely no way to resubmit it in such a way the that driver can recognize it as a resubmit and send it down the normal RAID path. So we just always send non REQ_TYPE_FS i/o's down the normal RAID path, never down the "fast path". Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: add support for 'fastpath' i/oMatt Gates
For certain i/o's to certain devices (unmasked physical disks) we can bypass the RAID stack firmware and do the i/o to the device directly and it will be faster. Signed-off-by: Matt Gates <matthew.gates@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: mark last scatter gather element as the lastMatt Gates
This is normally optional, but for SSD Smart Path support (in subsequent patches) it is required. Signed-off-by: Matt Gates <matthew.gates@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: use extended report luns command for HP SSD SmartPathMatt Gates
There is an extended report luns command which contains additional information about physical devices. In particular we need to get the physical device handle so we can use an alternate i/o path for fast physical devices like SSDs so we can speed up certain i/o's by bypassing the RAID stack code in the controller firmware. Signed-off-by: Matt Gates <matthew.gates@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] hpsa: fixup MSI-X registrationHannes Reinecke
Commit 254f796b9f22b1944c64caabc356a56caaa2facd updated the driver to use 16 MSI-X vectors, despite the fact that older controllers would provide only 4. This was causing MSI-X registration to drop down to INTx mode. But as the controller support performant mode, the initialisation will become confused and cause the machine to stall during boot. This patch fixes up the MSI-X registration to re-issue the pci_enable_msix() call with the correct number of MSI-X vectors. With that the hpsa driver continues to works on older controllers like the P200. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: allow SCSI mid layer to handle unit attentionMatt Gates
We were clobbering the SCSI status and setting cmd->result = DID_SOFT_ERROR << 16; to get a retry, but better to let the mid layer handle the unit attention. Signed-off-by: Matt Gates <matthew.gates@hp.com> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: do not require board "not ready" status after hard resetStephen M. Cameron
Immediately following a hard board reset, There are some mandatory delays during which we must not access the board and during which we might miss the "not ready" status, therefore it is a mistake to look for and expect to see the "not ready" status. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: enable unit attention reportingStephen M. Cameron
This used to be the default, but at some point the firmware guys changed the default and I failed to notice. Now to get unit attention notifications, you must twiddle a bit indicating you want them. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: rename scsi prefetch fieldStephen M. Cameron
The field contains more bits than just the one to indicate whether scsi prefetch should be turned on. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: use workqueue instead of kernel thread for lockup detectionStephen M. Cameron
Much simpler and avoids races starting/stopping the thread. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: remove P822se PCI IDMike Miller
Remove PCI ID for the never shipped P822se. Signed-off-by: Mike Miller <mike.miller@hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: prevent stalled i/oStephen M. Cameron
If a fifo full condition is encountered, i/o requests will stack up in the h->reqQ queue. The only thing which empties this queue is start_io, which only gets called when new i/o requests come in. If none are forthcoming, i/o in h->reqQ will be stalled. To fix this, whenever fifo full condition is encountered, this is recorded, and the interrupt handler examines this to see if a fifo full condition was recently encountered when a command completes and will call start_io to prevent i/o's in h->reqQ from getting stuck. I've only ever seen this problem occur when running specialized test programs that pound on the the CCISS_PASSTHRU ioctl. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-19[SCSI] hpsa: cap CCISS_PASSTHRU at 20 concurrent commands.Stephen M. Cameron
Cap CCISS_BIG_PASSTHRU as well. If an attempt is made to exceed this, ioctl() will return -1 with errno == EAGAIN. This is to prevent a userland program from exhausting all of pci_alloc_consistent memory. I've only seen this problem when running a special test program designed to provoke it. 20 concurrent commands via the passthru ioctls (not counting SG_IO) should be more than enough. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-12-16[SCSI] hpsa: add MSA 2040 to list of external target devicesStephen M. Cameron
Signed-off-by: Scott Teel <scott.teel@hp.com> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>