summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
Commit message (Collapse)AuthorAgeFilesLines
...
* hpsa: clean up abortsStephen Cameron2015-05-311-33/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not send aborts to logical devices that do not support aborts Instead of relying on what the Smart Array claims for supporting logical drives, simply try an abort and see how it responds at device discovery time. This way devices that do support aborts (e.g. MSA2000) can work and we do not waste time trying to send aborts to logical drives that do not support them (important for high IOPS devices.) While rescanning devices only test whether devices support aborts the first time we encounter a device rather than every time. Some Smart Arrays required aborts to be sent with tags in the wrong endian byte order. To avoid having to know about this, we would send two aborts with tags with each endian order. On high IOPS devices, this turns out to be not such a hot idea. So we now have a list of the devices that got the tag backwards, and we only send it one way. If all available commands are outstanding and the abort handler is invoked, the abort handler may not be able to allocate a command and may busy-wait excessivly. Reserve a small number of commands for the abort handler and limit the number of concurrent abort requests to the number of reserved commands. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@Suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* hpsa: rework controller command submissionWebb Scales2015-05-311-85/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow driver initiated commands to have a timeout. It does not yet try to do anything with timeouts on such commands. We are sending a reset in order to get rid of a command we want to abort. If we make it return on the same reply queue as the command we want to abort, the completion of the aborted command will not race with the completion of the reset command. Rename hpsa_scsi_do_simple_cmd_core() to hpsa_scsi_do_simple_cmd(), since this function is the interface for issuing commands to the controller and not the "core" of that implementation. Add a parameter to it which allows the caller to specify the reply queue to be used. Modify existing callers to specify the default reply queue. Rename __hpsa_scsi_do_simple_cmd_core() to hpsa_scsi_do_simple_cmd_core(), since this routine is the "core" implementation of the "do simple command" function and there is no longer any other function with a similar name. Modify the existing callers of this routine (other than hpsa_scsi_do_simple_cmd()) to instead call hpsa_scsi_do_simple_cmd(), since it will now accept the reply_queue paramenter, and it provides a controller lock-up check. (Also, tweak two related message strings to make them distinct from each other.) Submitting a command to a locked up controller always results in a timeout, so check for controller lock-up before submitting. This is to enable fixing a race between command completions and abort completions on different reply queues in a subsequent patch. We want to be able to specify which reply queue an abort completion should occur on so that it cannot race the completion of the command it is trying to abort. The following race was possible in theory: 1. Abort command is sent to hardware. 2. Command to be aborted simultaneously completes on another reply queue. 3. Hardware receives abort command, decides command has already completed and indicates this to the driver via another different reply queue. 4. driver processes abort completion finds that the hardware does not know about the command, concludes that therefore the command cannot complete, returns SUCCESS indicating to the mid-layer that the scsi_cmnd may be re-used. 5. Command from step 2 is processed and completed back to scsi mid layer (after we already promised that would never happen.) Fix by forcing aborts to complete on the same reply queue as the command they are aborting. Piggybacking device rescanning functionality onto the lockup detection thread is not a good idea because if the controller locks up during device rescanning, then the thread could get stuck, then the lockup isn't detected. Use separate work queues for device rescanning and lockup detection. Detect controller lockup in abort handler. After a lockup is detected, return DO_NO_CONNECT which results in immediate termination of commands rather than DID_ERR which results in retries. Modify detect_controller_lockup() to return the result, to remove the need for a separate check. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Signed-off-by: Webb Scales <webbnh@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* hpsa: clean up host, channel, target, lun printsWebb Scales2015-05-311-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a mix of formats used for specifying controller, bus, target, and lun address of devices. change to the format used by the scsi midlayer and upper layer (2:3:0:0) so you can easily follow the information from hpsa to scsi midlayer to sd upper layer. Also add this information: - product ID - vendor ID - RAID level - SSD Smath Path capable and enabled - exposure level (sg-only) Example: hpsa 0000:04:00.0: added scsi 2:0:0:0: Direct-Access HP LOGICAL VOLUME RAID-0 SSDSmartPathCap+ En+ Exp=4 scsi 2:0:0:0: Direct-Access HP LOGICAL VOLUME 10.0 PQ: 0 ANSI: 5 sd 2:0:0:0: [sdr] 12501713072 512-byte logical blocks: (6.40 TB/5.82 TiB) sd 2:0:0:0: [sdr] 4096-byte physical blocks sd 2:0:0:0: [sdr] Attached SCSI disk sd 2:0:0:0: Attached scsi generic sg20 type 0 Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@Suse.de> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* hpsa: add masked physical devices into h->dev[] arrayStephen Cameron2015-05-311-121/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cache the ioaccel handle so that when we need to abort commands sent down the ioaccel2 path, we can look up the LUN ID in h->dev[] instead of having to do I/O to the controller. Add a field to elements in h->dev[] to keep track of how the device is exposed to the SCSI mid layer: Not at all, without an upper level driver (no_uld_attach) or normally exposed. Since masked physical devices are now present in h->dev[] array it would be perfectly possible to do echo scsi add-single-device 2 2 0 0 > /proc/scsi/scsi and bring them online. This was previously not allowed for masked physical devices. Ensure that the mapping of physical disks to logical drives gets updated in a consistent way when a RAID migration occurs and is not touched until updates to it are complete. now instead of doing CISS_REPORT_PHYSICAL to get the LUNID for the physical disk in hpsa_get_pdisk_of_ioaccel2(), just get it out of h->dev[] where we already have it cached. do not touch phys_disk[] for ioaccel enabled logical drives during rescan Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@Suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* hpsa: dont meddle with hw which isn't ours (cciss)Tomas Henzl2015-05-311-10/+11
| | | | | | | | | The hpsa driver touches the hardware before checking the pci-id table. This way, especially in kdump, it may confuse the proper driver (cciss). Signed-off-by: Tomas Henzl <thenzl@redhat.com> Acked-by: Don Brace <Don.Brace@pmcs.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* Fix weird uses of num_online_cpus().Rusty Russell2015-03-101-4/+2
| | | | | | | | | | | | | | This may be OK in archs with contiguous CPU numbers and without hotplug CPUs, but it sets a terrible example. And open-coding it like drivers/scsi/hpsa.c is just weird. BTRFS has a weird comparison with num_online_cpus() too, but since BTRFS just screwed up my test machines' root partition, I'm not touching it :) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reported-by: Oleg Drokin <green@linuxhacker.ru>
* hpsa: correct compiler warnings introduced by hpsa-add-local-workqueue patchDon Brace2015-02-151-3/+1
| | | | | | | | | | | | Correct compiler warning introduced by hpsa-add-local-workqueue patch 6636e7f455b33b957c5ee016daa6de46148026ab hpsa: Use local workqueues instead of system workqueues Suggested-by: Kees Cook <keescook@chromium.org> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Webb Scales <webbnh@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* hpsa: Use local workqueues instead of system workqueuesDon Brace2015-02-021-14/+54
| | | | | | | | Suggested-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Webb Scales <webbnh@hp.com> Reviewed-by: Kevin Barnett <Kevin.Barnett@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: add in P840ar controller model nameDon Brace2015-02-021-1/+1
| | | | | | | | Add in P840ar model name for gen9 Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: add in gen9 controller model namesDon Brace2015-02-021-13/+13
| | | | | | | | Add in gen9 controller model names Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: detect and report failures changing controller transport modesRobert Elliott2015-02-021-11/+29
| | | | | | | | | | | | | | | | | | | Detect failues when attempting to change controller to use simple or performant transport modes (mode change ack) rather than just proceeding ahead after timeouts. Return values are added to: hpsa_put_ctlr_into_performant_mode hpsa_wait_for_mode_change_ack and all their callers check/propagate the result. More consistency in printing errors and whether dev_err is used. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: shorten the wait for the CISS doorbell mode change ackRobert Elliott2015-02-021-6/+9
| | | | | | | | | | | | | | | | Shorten the wait for the CISS configuration table doorbell mode change acknowledgment from 300-600 s to 20 s, which is the value specified in the CISS specification that should be honored by all controllers. Wait using interruptible msleep() rather than uninterruptible usleep_range(), which triggers rt_sched timeout errors if the wait is long. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: refactor duplicated scan completion code into a new routineWebb Scales2015-02-021-24/+16
| | | | | | | | | | | | | Hoist the conditional out of do_not_scan_if_controller_locked_up() and place it in the caller (this improves the code structure, making it more consistent with other uses and enabling tail-call optimization); rename the function to hpsa_scan_complete(), and use it at the end of hpsa_scan_start() as well. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Webb Scales <webbnh@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: move SG descriptor set-up out of hpsa_scatter_gather()Webb Scales2015-02-021-7/+14
| | | | | | | | | | | | | | Move the code which sets up the SG descriptor out of hpsa_scatter_gather() and into a subroutine where it can be reused (in the next patch). The Ext field is now assigned unconditionally: this makes the refactor much simpler, but more importantly it removes a conditional operation from inside the loop. The case for which the conditional formerly tested is now executed (unconditionally) after the loop is exited. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Webb Scales <webbnh@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: do not use function pointers in fast path command submissionStephen Cameron2015-02-021-3/+5
| | | | | | | | Performance tweak, avoid unnecessary function calls. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: print CDBs instead of kernel virtual addresses for uncommon errorsStephen Cameron2015-02-021-13/+16
| | | | | | | | | Printing the address of the command pointer is of little value, change to print the CDB. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: do not use a void pointer for scsi_cmd field of struct CommandListStephen Cameron2015-02-021-3/+3
| | | | | | | | There's no reason for it to be a void *, it should be a struct scsi_cmnd * Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: return failed from device reset/abort handlersDon Brace2015-02-021-0/+7
| | | | | | | | | | | | Returning failed from the device reset handler will get the device kicked offline, which is fine if the controller is locked up anyhow. Cannot abort a command from a failed controller. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: check for ctlr lockup after command allocation in main io pathStephen Cameron2015-02-021-1/+8
| | | | | | | | | | Command allocation is the thing that takes the longest in the main i/o path, so check for controller lockup immediately after this to prevent submitting commands to locked up controller as much as possible. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: guard against overflowing raid map arrayStephen Cameron2015-02-021-0/+3
| | | | | | | | | | | In the code that translates logical drive LBAs to physical drive LBAs if we overflow the raid map disk data array we will get the wrong answers. We do not expect that to happen, but best to be on the safe side and guard against it anyway. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: do not ack controller events on controllers that do not support itStephen Cameron2015-02-021-0/+3
| | | | | | | | | | Acking controller events on controllers that do not support it can cause such controllers to lock up. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: remove incorrect BUG_ONs checking for raid offload enableStephen Cameron2015-02-021-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | In set_encrypt_ioaccel2() and in hpsa_scsi_ioaccel_raid_map there were BUG_ONs that looked like this: BUG_ON(!(dev->offload_config && dev->offload_enabled)); But, In hpsa_ack_ctlr_events() we have this, /* Stop sending new RAID offload reqs via the IO accelerator */ scsi_block_requests(h->scsi_host); for (i = 0; i < h->ndevices; i++) h->dev[i]->offload_enabled = 0; hpsa_drain_accel_commands(h); So, we set offload_enabled = 0 for all drives, then do this drain_accel_commands, so that means accel commands could still be in flight, ie. perhaps having just been submitted into hpsa_scsi_ioaccel_raid_map concurrent with ->offload_enabled having just been set to zero. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: count passthru cmds with atomics, not a spin locked intDon Brace2015-02-021-34/+5
| | | | | | | | Performance enhancement. Remove spin_locks from the driver. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: optimize cmd_alloc function by remembering last allocationRobert Elliott2015-02-021-2/+5
| | | | | | | | | | | | Empirically, this improves performance slightly (~2% max IOPS) by allowing cmd_alloc to remember where it left off searching for free commands between calls instead of always starting its search at command 0. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: fix race between abort handler and main i/o pathWebb Scales2015-02-021-47/+62
| | | | | | | | | | | | | | | | | | | | | This means changing the allocator to reference count commands. The reference count is now the authoritative indicator of whether a command is allocated or not. The h->cmd_pool_bits bitmap is now only a heuristic hint to speed up the allocation process, it is no longer the authoritative record of allocated commands. Since we changed the command allocator to use reference counting as the authoritative indicator of whether a command is allocated, fail_all_outstanding_cmds needs to use the reference count not h->cmd_pool_bits for this purpose. Fix hpsa_drain_accel_commands to use the reference count as the authoritative indicator of whether a command is allocated instead of the h->cmd_pool_bits bitmap. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: honor queue depth of physical devicesDon Brace2015-02-021-68/+250
| | | | | | | | | | | | | | | | | | | | | | | When using the ioaccel submission methods, requests destined for RAID volumes are sometimes diverted to physical devices. The OS has no or limited knowledge of these physical devices, so it is up to the driver to avoid pushing the device too hard. It is better to honor the physical device queue limit rather than making the device spew zillions of TASK SET FULL responses. This is so that hpsa based devices support /sys/block/sdNN/device/queue_type of simple, which lets the SCSI midlayer automatically adjust the queue_depth based on TASK SET FULL and GOOD status. Adjust the queue depth for a new device after it is created based on the maximum queue depths of the physical devices that constitute the device. This drops the maximum queue depth from .can_queue of 1024 to something like 174 for single-drive RAID-0, 348 for two-drive RAID-1, etc. It also adjusts for the ratio of data to parity drives. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Webb Scales <webbnh@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: use workqueue to resubmit failed ioaccel commandsDon Brace2015-02-021-20/+52
| | | | | | | | | | | | | Instead of kicking the commands all the way back to the mid layer, use a work queue. This enables having a mechanism for the driver to be able to resubmit the commands down the "normal" raid path without turning off the ioaccel feature entirely whenever an error is encountered on the ioaccel path, and prevent excessive rescanning of devices. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: factor out hpsa_ciss_submit functionStephen Cameron2015-02-021-59/+67
| | | | | | | | | | | | | | | Factor out the bottom part of the queuecommand function which is the part that builds commands for submitting down the "normal' RAID stack path of a Smart Array. Need to factor this out to improve how commands that were initially sent down one of the "ioaccellerated" paths but which have some sort of error condition are retried down the "normal" path. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: do not request device rescan on every ioaccel path errorStephen Cameron2015-02-021-12/+2
| | | | | | | | | | | | | | | | The original reasoning behind doing this was faulty. An error of some sort would be encountered, accelerated i/o would be disabled for that logical drive, the command would be kicked back out to the SCSI midlayer for a retry, and since i/o accelerator mode was disabled, it would get retried down the RAID path. However, something needs to turn ioaccellerator mode back on, and this rescan request was what did that. However, it was racy, and extremely bad for performance to rescan all devices, so, don't do that. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: do not queue commands internally in driverDon Brace2015-02-021-271/+35
| | | | | | | | | | | | | | | | | | By not doing maintaining a list of queued commands, we can eliminate some spin locking in the main i/o path and gain significant improvement in IOPS. Remove the queuing code and the code that calls it; remove now-unused interrupt code; remove DIRECT_LOOKUP_BIT. Now that the passthru commands share the same command pool as the main i/o path, and the total size of the pool is less than or equal to the number of commands that will fit in the hardware fifo, there is no need to check to see if we are exceeding the hardware fifo's depth. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: get rid of cmd_special_alloc and cmd_special_freeStephen Cameron2015-02-021-76/+30
| | | | | | | | | | | | We have commands reserved for internal use. This is laying the groundwork for removing the internal queue of commands from the driver so that the locks that protect that queue may be removed. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: reserve some commands for use by driverStephen Cameron2015-02-021-2/+5
| | | | | | | | | | | | | | | We need to reserve some commands for device rescans, aborts, and the pass through ioctls, etc. so we cannot give them all to the scsi mid layer. This is in preparation for removing cmd_special_alloc and cmd_special_free so that we can stop queuing commands internally in the driver so that we can remove the locks thta protect the queue that we will no longer have. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: avoid unneccesary calls to resource freeing functionsRobert Elliott2015-02-021-2/+4
| | | | | | | | | | | | | | | | If hpsa_allocate_cmd_pool failed, we were calling two functions unnecessarily: hpsa_free_sg_chain_blocks(h); hpsa_free_cmd_pool(h); This didn't cause any problem, as those functions can tolerate being called when what they free hasn't been allocated (relevant pointers would be NULL) but it is potentially confusing. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: fix memory leak in hpsa_alloc_cmd_poolRobert Elliott2015-02-021-1/+5
| | | | | | | | | Partial allocation failure wasn't handled correctly Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: report allocation failures while allocating SG chain blocksRobert Elliott2015-02-021-2/+6
| | | | | | | Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: pass error from pci_set_consistent_dma_mask from hpsa_messageRobert Elliott2015-02-021-1/+1
| | | | | | | | | Return the actual error code instead of a generic error code. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: rename hpsa_request_irq to hpsa_request_irqsRobert Elliott2015-02-021-5/+6
| | | | | | | | | | Make the function name more descriptive. We use more than one interrupt. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: report failure to ioremap config tableRobert Elliott2015-02-021-1/+3
| | | | | | | | | Enhance error reporting. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: trivial message and comment clean upsStephen Cameron2015-02-021-11/+10
| | | | | | | | | | Cleanup comments to be more specific. Make messages more informational. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: refactor hpsa_find_board_params() to encapsulate legacy testWebb Scales2015-02-021-9/+21
| | | | | | | | | | Encapsulate the conditional predicate which tests for legacy controllers in a separate function and rework the code comments. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Webb Scales <webbnh@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: downgrade the Waiting for no-op print to dev_infoRobert Elliott2015-02-021-1/+1
| | | | | | | | | | There is nothing worrisome about the "Waiting for controller to respond to no-op" print, so use dev_info rather than dev_warn. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: propagate return value from board ID lookupRobert Elliott2015-02-021-3/+7
| | | | | | | | | | | | | | | | | | | | | | | If the board ID lookup function fails, return the return code rather than return -ENODEV. The only board ID failure reason right now is -ENODEV, so this just provides more informative prints in kdump and adapts to future changes. Tested with error injection while booting with reset_devices on the kernel command line: [ 62.804324] injecting error in inj_hpsa_lookup_board_id: 1 11 [ 62.804423] hpsa 0000:04:00.0: Board ID not found (the pci probe layer does not print an additional message if -ENODEV is the reason) Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: propagate hard_reset failures in reset_devices modeRobert Elliott2015-02-021-4/+1
| | | | | | | | | | Return the real reason for kdump_hard_reset failure rather than change them all to -ENODEV. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: remove 0x from queue depth print which is in decimalRobert Elliott2015-02-021-1/+1
| | | | | | | | | | The queue depth printed at startup is in decimal, so shouldn't have a 0x prefix. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: notice all request_irq errorsRobert Elliott2015-02-021-1/+18
| | | | | | | | | | | | | | | | | | | | | | | In MSI and MSI-X mode, where hpsa asks for more than one interrupt, hpsa_request_irqs forgets if the first request_irq call failed if later ones succeed. It needs to exit the loop on any failure rather than continue, freeing all irqs that were requested until that point. Also, it needs to clear out the q numbers up to MAX_REPLY_QUEUES. The same is true for the general hpsa_free_irqs function. Tested with error injection of -ENOSYS on the 4th call: [ 9.277691] injecting error in inj_request_irq: 1 4 [ 9.277780] hpsa 0000:02:00.0: failed to get irq 35 for hpsa1 [ 10.711623] scsi host1: Error handler scsi_eh_1 exiting [ 10.739170] hpsa: probe of 0000:02:00.0 failed with error -38 Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: Fix -Wunused-but-set-variable warningFabian Frederick2015-02-021-2/+2
| | | | | | | | | | Remove unused variable in hpsa_free_cmd_pool. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Fabian Frederick <fabf@skynet.be> Acked-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: rename free_irqs to hpsa_free_irqsRobert Elliott2015-02-021-21/+22
| | | | | | | | | Change the function names to have hpsa prefix. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: adjust RAID-1, RAID-1ADM, and RAID-6 namesRobert Elliott2015-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | HP now uses RAID-6 rather than RAID-ADG (Advanced Data Guarding) as the marketing name for our implementation of RAID-6. The driver considers RAID-1 and RAID-1+0 to be the same level, and considers RAID-1ADM and RAID-1+0ADM to be the same level. Parenthesis can be used to reflect the optional +0 portion of both those RAID levels. Rename: RAID-ADG to RAID-6 RAID-1(1+0) to RAID-1(+0) RAID-1(ADM) to RAID-1(+0)ADM Also, add another const after the pointer type as suggested by checkpatch.pl so the array is: static const char * const raid_label[] Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: correct change_queue_depthDon Brace2015-02-021-1/+15
| | | | | | | | | | We change drive queue depths to match drive reported queue depths. The name of the SML function was changed from scsi_adjust_queue_depth changed to scsi_change_queue_depth. Reviewed-by: Scott Teel <scott.teel@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* hpsa: change how SA controllers are resetDon Brace2015-02-021-18/+10
| | | | | | | | | | | | | Change how SA controllers are reset by changing PCI power levels. The hpsa driver was finding the PCI_PM_CTRL_STATE_MASK offset then reading/writing a bitmask to change the power state. There are kernel functions that do the same operations. Better to use the kernel functions. Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Webb Scales <webbnh@hp.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
OpenPOWER on IntegriCloud