aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-03-15[SCSI] hpsa: update source file copyrightsScott Teel1-1/+1
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: rescan devices on ioaccel2 errorScott Teel1-0/+1
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 Teel1-0/+1
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: get ioaccel mode 2 i/o workingScott Teel1-0/+20
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. Cameron1-0/+1
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: do ioaccel mode 2 resource allocationsStephen M. Cameron1-0/+3
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: add ioaccel mode 2 structure definitionsMike Miller1-0/+8
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: poll controller to detect device change eventStephen M. Cameron1-0/+1
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: add ioaccell mode 1 RAID offload support.Stephen M. Cameron1-5/+21
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: add support for 'fastpath' i/oMatt Gates1-0/+51
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>
2013-12-19[SCSI] hpsa: use workqueue instead of kernel thread for lockup detectionStephen M. Cameron1-1/+2
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: prevent stalled i/oStephen M. Cameron1-0/+1
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. Cameron1-0/+5
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-08-26[SCSI] hpsa: remove unneeded variableTomas Henzl1-2/+0
Signed-off-by: Tomas Henzl <thenzl@redhat.com> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] hpsa: dial down lockup detection during firmware flashStephen M. Cameron1-0/+2
Dial back the aggressiveness of the controller lockup detection thread. Currently it will declare the controller to be locked up if it goes for 10 seconds with no interrupts and no change in the heartbeat register. Dial back this to 30 seconds with no heartbeat change, and also snoop the ioctl path and if a firmware flash command is detected, dial it back further to 4 minutes until the firmware flash command completes. The reason for this is that during the firmware flash operation, the controller apparently doesn't update the heartbeat register as frequently as it is supposed to, and we can get a false positive. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] hpsa: removed unused member maxQsinceinitStephen M. Cameron1-1/+0
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] hpsa: refine interrupt handler locking for greater concurrencyMatt Gates1-5/+8
Use spinlocks with finer granularity in the submission and completion paths to allow concurrent execution for multiple reply queues. In particular, do not hold a spin lock while submitting a request to the device, nor during most of the interrupt handler. 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>
2012-05-10[SCSI] hpsa: use multiple reply queuesMatt Gates1-15/+25
Smart Arrays can support multiple reply queues onto which command completions may be deposited. It can help performance quite a bit to arrange for command completions to be processed on the same CPU from which they were submitted to increase the likelihood of cache hits. 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>
2012-05-10[SCSI] hpsa: add abort error handler functionStephen M. Cameron1-0/+21
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-05-10[SCSI] hpsa: do not read from controller unnecessarily in completion codeStephen M. Cameron1-4/+4
MSI/MSI-X interrupts can't race the DMA completion they are communicating so no need to read from controller to flush the DMA to the host if MSI or MSI-X interrupts are being used. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-02-19[SCSI] hpsa: factor out driver nameStephen M. Cameron1-1/+1
Sometimes, for testing purposes (e.g. testing rmmod on a system that normally boots using hpsa) it's nice to rename the driver and split it into two drivers and restrict it to certain controllers. This makes that easier. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-02-19[SCSI] hpsa: removed unneeded structure member max_sg_entries and fix badly named constant MAXSGENTRIESStephen M. Cameron1-1/+0
We had both h->max_sg_entries and h->maxsgentries in the per controller structure which is terribly confusing. max_sg_entries was really just a constant, 32, which defines how big the "block fetch table" is, which is as large as the max number of SG elements embedded within a command (excluding SG elements in chain blocks). MAXSGENTRIES was the constant used to denote the max number of SG elements embedded within a command, also a poor name. So renamed MAXSGENTREIS to SG_ENTRIES_IN_CMD, and removed h->max_sg_entries and replaced it with SG_ENTRIES_IN_CMD. h->maxsgentries is unchanged, and is the maximum number of sg elements the controller will support in a command, including those in chain blocks, minus 1 for the chain block pointer.. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-30[SCSI] hpsa: detect controller lockupStephen M. Cameron1-0/+5
When controller lockup condition is detected, we should fail all outstanding commands and disable the controller. This will enable multipath solutions to recover gracefully. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-30[SCSI] hpsa: fix potential array overflow in hpsa_update_scsi_devicesScott Teel1-1/+0
The currentsd[] array in hpsa_update_scsi_devices had room for 256 devices. The code was iterating over however many physical and logical devices plus an additional number of possible external MSA2XXX controllers, which together could potentially exceed 256. We increased the size of the currentsd array to 1024 + 1024 + 32 + 1 elements to reflect a reasonable maximum possible number of devices which might be encountered. We also don't just walk off the end of the array if the array controller reports more devices than we are prepared to handle, we just ignore the excessive devices. 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>
2011-10-30[SCSI] hpsa: rename HPSA_MAX_SCSI_DEVS_PER_HBAScott Teel1-2/+2
Rename HPSA_MAX_SCSI_DEVS_PER_HBA to HPSA_MAX_DEVICES 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>
2011-10-30[SCSI] hpsa: remove unused busy_initializing and busy_scanningStephen M. Cameron1-2/+0
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27[SCSI] hpsa: do not attempt to read from a write-only registerStephen M. Cameron1-1/+1
Most smartarrays tolerate it, but a few new ones don't. Without this change some newer Smart Arrays will lock up and i/o will grind to a halt. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-05-17[SCSI] hpsa: do soft reset if hard reset is brokenStephen M. Cameron1-2/+4
on driver load, if reset_devices is set, and the hard reset attempts fail, try to bring up the controller to the point that a command can be sent, and send it a soft reset command, then after the reset undo whatever driver initialization was done to get it to the point to take a command, and re-do it after the reset. This is to get kdump to work on all the "non-resettable" controllers (except 64xx controllers which can't be reset due to the potentially shared cache module.) Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <jbottomley@parallels.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17[SCSI] hpsa: increase time to wait for board resetStephen M. Cameron1-1/+1
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <jbottomley@parallels.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17[SCSI] hpsa: wait longer for no-op to complete after resetting controllerStephen M. Cameron1-1/+1
This is to avoid the usual two or three messages about the command timing out. We're obviously not waiting long enough. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <jbottomley@parallels.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17[SCSI] hpsa: add readl after writel in interrupt mask setting codeStephen M. Cameron1-0/+4
This is to ensure the board interrupts are really off when these functions return. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <jbottomley@parallels.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17[SCSI] hpsa: do readl after writel in main i/o path to ensure commands don't get lost.Stephen M. Cameron1-0/+1
Apparently we've been doin it rong for a decade, but only lately do we run into problems. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <jbottomley@parallels.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18[SCSI] hpsa: make hpsa.hpsa_simple_mode=1 module parameter actually workStephen M. Cameron1-0/+1
It's not enough to simple avoid putting the board into performant mode, as we have to set up the interrupts differently, etc. When I originally tested this module parameter, I tested it incorrectly without realizing it, and the driver was running in performant mode the whole time unbeknownst to me. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18[SCSI] hpsa: do not re-order commands in internal queuesStephen M. Cameron1-2/+2
Driver's internal queues should be FIFO, not LIFO. This is a port of an almost identical patch from cciss by Jens Axboe. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24[SCSI] hpsa: fix board status waiting codeStephen M. Cameron1-0/+4
After a reset, we should first wait for the board to become "not ready", and then wait for it to become "ready", instead of immediately waiting for it to become "ready", and do this waiting *after* restoring PCI config space registers. Also, only wait 10 secs for board to become "not ready" after a reset (it should quickly become not ready.) Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21[SCSI] hpsa: do not consider firmware revision when looking for device changes.Stephen M. Cameron1-1/+0
The firmware may have been updated, in which case, it's the same device, and in that case, we do not want to remove and add the device, we want to let it continue as is. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27[SCSI] hpsa: remove unused firm_ver member of the per-hba structureStephen M. Cameron1-1/+0
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03[SCSI] hpsa: Increase the number of scatter gather elements supported.Stephen M. Cameron1-0/+4
This uses the scatter-gather chaining feature of Smart Array controllers. 32 scatter-gather elements are embedded in the "command list", and the last element in the list may be marked as a "chain pointer", and point to an additional block of scatter gather elements. The precise number of scatter gather elements supported is dependent on the particular kind of Smart Array, and is determined at runtime by querying the hardware. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03[SCSI] hpsa: remove scan threadMike Miller1-3/+0
The intent of the scan thread was to allow a UNIT ATTENTION/LUN DATA CHANGED condition encountered in the interrupt handler to trigger a rescan of devices, which can't be done in interrupt context. However, we weren't able to get this to work, due to multiple such UNIT ATTENTION conditions arriving during the rescan, during updating of the SCSI mid layer, etc. There's no way to tell the devices, "stand still while I scan you!" Since it doesn't work, there's no point in having the thread, as the rescan triggered via ioctl or sysfs can be done without such a thread. Signed-off-by: Mike Miller <mikem@beardog.cce.hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17[SCSI] hpsa: use scan_start and scan_finished entry points for scanningStephen M. Cameron1-0/+3
use scan_start and scan_finished entry points for scanning and route the CCISS_REGNEWD ioctl and sysfs triggering of same functionality through hpsa_scan_start. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17[SCSI] hpsa: Fix p1210m LUN assignment.Stephen M. Cameron1-0/+1
The p1210m responsds to SCSI report LUNs, unlike traditional Smart Array controllers. This means that the bus, target, and lun assignments done by the driver cannot be arbitrary, but must match what SCSI REPORT LUNS returns. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17[SCSI] hpsa: Allow multiple command completions per interrupt.Don Brace1-6/+100
This is done by adding support for the so-called "performant mode" (that's really what they called it). Smart Array controllers have a mode which enables multiple command completions to be delivered with a single interrupt, "performant" mode. We want to use that mode, as some newer controllers will be requiring this mode. Signed-off-by: Don Brace <brace@beardog.cce.hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Mike Miller <mikem@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17[SCSI] hpsa: interrupt pending function should return bool not unsigned longStephen M. Cameron1-5/+3
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17[SCSI] hpsa: fix some debug printks to use dev_dbg insteadStephen M. Cameron1-9/+4
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17[SCSI] hpsa: make tag macros into functionsStephen M. Cameron1-3/+0
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17[SCSI] hpsa: Use kernel integer types, not userland onesStephen M. Cameron1-2/+2
That is, use u64, u32, u16 and u8 rather than __u64, __u32, __u16 and __u8. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-10[SCSI] hpsa: add driver for HP Smart Array controllers.Stephen M. Cameron1-0/+273
This driver supports a subset of HP Smart Array Controllers. It is a SCSI alternative to the cciss driver. [akpm@linux-foundation.org: avoid helpful cleanup patches] [achiang@hp.com: make device attrs static] [akpm@linux-foundation.org: msleep() does set_current_state() itself] Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Mike Miller <mikem@beardog.cce.hp.com> Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>