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>
[SCSI] hpsa: bring format-in-progress drives online when ready
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>
The fact that we can't tell them to drain their caches shouldn't
prevent the system from going into suspend. Therefore sd_sync_cache()
shouldn't return an error if the device replies with an Invalid
Command ASC.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Sven Neumann <s.neumann@raumfeld.com> Tested-by: Daniel Mack <zonque@gmail.com> CC: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
XinHong Zhu [Fri, 14 Feb 2014 08:01:28 +0000 (16:01 +0800)]
[SCSI] pm80xx: fix problem of pm8001_work_fn reseting incorrect phy device
If a phy device is removed, the device can get error of I/O and HBA maybe
receieve IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS of event which causes pm8001_work_fn
to reset the phy device but in pm8001_task_exec we don't assign a value for
the device field of the ccb and in other case a ccb used have device field
set, when ccb is freed the field device of the ccb don't be set NULL.So there
is possibility of getting another device reset in function mpi_ssp_completion.
Signed-off-by: zhuxh <zxh3737@163.com> Acked-by: Lindar Liu <lindar_liu@usish.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
XinHong Zhu [Thu, 13 Feb 2014 03:59:38 +0000 (11:59 +0800)]
[SCSI] pm80xx: no need for tag allocation when issuing the command of unregistering device
In function pm8001_dev_gone_notify we consume a tag from bitmap resource and
later don't free that tag resource, so the tag resource will never be
freed. In the function we don't need to use any tag to issue command for
unregistering the device .
Signed-off-by: XinHong Zhu <zxh3737@163.com> Acked-by: Lindar Liu <lindar_liu@usish.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
adam radford [Mon, 10 Mar 2014 09:51:36 +0000 (02:51 -0700)]
[SCSI] megaraid_sas: Fix megasas_ioc_init_fusion
The following patch for megaraid_sas fixes the megasas_ioc_init_fusion
function to use a local stack variable for the IOCinit frame physical address
instead of clobbering the first request descriptor.
Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Host lock is added back around queuecommand. Host lock removal can create race
conditon between ISR path(when RAID map update interrupt is raised) and IO
build path of driver, since IO build path is making use of RAID map, and in
case of RAID map update interrupt, old RAID map copy is memset to zero, which
some IOs may be referencing in build IO path. Changes done for performance
boost- 1) Added code to set SMP IRQ affinity per CPU. 2) Pass MSI-x index,
while issuing sysPD IO.
If consistent DMA mask is set to 64 bit, fall back to 32bit DMA mask and 32bit consistent DMA mask.
64bit consistent DMA mask may be set on some 64bit DMA slot, which causes DMA offset "10000000000000" and
MFI_INIT and IOCTL frames will have high memory addresses, leads to firmware FAULT.
[SCSI] megaraid_sas: Don't wait forever for non-IOCTL DCMDs
Don't wait forever for firmware response for internal DCMDs sent from driver
firmware. Such DCMDs will be posted to firmware with timeout. Timeout is also
introduced for DCMD sent to abort the commands. DCMD sent via IOCTL path will
still be always blocking to keep the IOCTL design intact.
Dan Carpenter [Tue, 11 Feb 2014 16:06:33 +0000 (19:06 +0300)]
[SCSI] arcmsr: upper 32 of dma address lost
The original code always set the upper 32 bits to zero because it was
doing a shift of the wrong variable.
Fixes: 1a4f550a09f8 ('[SCSI] arcmsr: 1.20.00.15: add SATA RAID plus other fixes') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Eiichi Tsukata [Tue, 11 Feb 2014 05:29:52 +0000 (14:29 +0900)]
[SCSI] Add timeout to avoid infinite command retry
Currently, scsi error handling in scsi_io_completion() tries to
unconditionally requeue scsi command when device keeps some error state.
For example, UNIT_ATTENTION causes infinite retry with
action == ACTION_RETRY.
This is because retryable errors are thought to be temporary and the scsi
device will soon recover from those errors. Normally, such retry policy is
appropriate because the device will soon recover from temporary error state.
But there is no guarantee that device is able to recover from error state
immediately. Some hardware error can prevent device from recovering.
This patch adds timeout in scsi_io_completion() to avoid infinite command
retry in scsi_io_completion(). Once scsi command retry time is longer than
this timeout, the command is treated as failure.
Signed-off-by: Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Mike Christie [Fri, 7 Feb 2014 06:41:42 +0000 (00:41 -0600)]
[SCSI] iscsi_tcp: check for valid session before accessing
Check that the session is setup before accessing its
connection. This fixes a oops where userspace tries
to get the ip address before the session is bound to
a host.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Mike Christie [Fri, 7 Feb 2014 06:41:39 +0000 (00:41 -0600)]
[SCSI] libiscsi: remove unneeded queue work when max_cmdsn is increased
iscsi_queuecommand will only take in commands that can fit in the
current window. So, if a command is on the cmdqueue then it can
fit in the current window. If a command is on the mgmtqueue, then
we are setting the immediate bit so they will also fit in the
window. As a result, we never need to to do a iscsi_conn_queue_work
when the maxCmdSn is increased.
What should happen is that a command will complete the window will
be increased, then the scsi layer will send us more commands by
running the scsi_device queues.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Shlomo Pongratz [Fri, 7 Feb 2014 06:41:38 +0000 (00:41 -0600)]
[SCSI] libiscsi: Reduce locking contention in fast path
Replace the session lock with two locks, a forward lock and
a backwards lock named frwd_lock and back_lock respectively.
The forward lock protects resources that change while sending a
request to the target, such as cmdsn, queued_cmdsn, and allocating
task from the commands' pool with kfifo_out.
The backward lock protects resources that change while processing
a response or in error path, such as cmdsn_exp, cmdsn_max, and
returning tasks to the commands' pool with kfifo_in.
Under a steady state fast-path situation, that is when one
or more processes/threads submit IO to an iscsi device and
a single kernel upcall (e.g softirq) is dealing with processing
of responses without errors, this patch eliminates the contention
between the queuecommand()/request response/scsi_done() flows
associated with iscsi sessions.
Between the forward and the backward locks exists a strict locking
hierarchy. The mutual exclusion zone protected by the forward lock can
enclose the mutual exclusion zone protected by the backward lock but not
vice versa.
For example, in iscsi_conn_teardown or in iscsi_xmit_data when there is
a failure and __iscsi_put_task is called, the backward lock is taken while
the forward lock is still taken. On the other hand, if in the RX path a nop
is to be sent, for example in iscsi_handle_reject or __iscsi_complete_pdu
than the forward lock is released and the backward lock is taken for the
duration of iscsi_send_nopout, later the backward lock is released and the
forward lock is retaken.
libiscsi_tcp uses two kernel fifos the r2t pool and the r2t queue.
The insertion and deletion from these queues didn't corespond to the
assumption taken by the new forward/backwards session locking paradigm.
That is, in iscsi_tcp_clenup_task which belongs to the RX (backwards)
path, r2t is taken out from r2t queue and inserted to the r2t pool.
In iscsi_tcp_get_curr_r2t which belong to the TX (forward) path, r2t
is also inserted to the r2t pool and another r2t is pulled from r2t
queue.
Only in iscsi_tcp_r2t_rsp which is called in the RX path but can requeue
to the TX path, r2t is taken from the r2t pool and inserted to the r2t
queue.
In order to cope with this situation, two spin locks were added,
pool2queue and queue2pool. The former protects extracting from the
r2t pool and inserting to the r2t queue, and the later protects the
extracing from the r2t queue and inserting to the r2t pool.
Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
[minor fix up to apply cleanly and compile fix] Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Restructure the iscsi_tcp_r2t_rsp routine in order to avoid allocating
r2t from r2tpool.queue and returning it back in case the parameters
rhdr->data_length and or rhdr->data_offset prohibit the requing.
Since the values of these parameters are known prior to the allocation,
we can pre-check and thus avoid futile allocations.
[jejb: checkpatch fixes] Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Lukasz Dorau [Thu, 23 Jan 2014 09:52:01 +0000 (10:52 +0100)]
[SCSI] isci: update version to 1.2
The version of isci driver has not been updated for 2 years.
It was 83 isci commits ago. Suspend/resume support has been implemented
and many bugs have been fixed since 1.1. Now update the version to 1.2.
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Hannes Reinecke [Tue, 14 Jan 2014 09:26:25 +0000 (10:26 +0100)]
[SCSI] bfa: set correct command return code
For various error conditions the bfa driver just returns
'DID_ERROR', which carries no information at all about the
actual source of error.
This patch updates the error handling to return a correct
error code, depending on the type of error occurred.
Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:45 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Reduce rom-lock contention during reset recovery.
Issue:
Driver holds rom-lock for too long during reset recovery.
During adapter reset testing, it was found that the driver
holds the rom-lock for too long, because of which other
drivers fail to acquire the rom-lock, leading to reset
failures.
The primary cause is, in the bootstrap code, while
holding the rom-lock, the driver checks if the peg is
halted, causing a 2 second contention.
Fix:
When a reset recovery starts, the driver deduces the cause, and
sets appropriate flags in watchdog & recover_adapter routines.
This flag should be used to determine if bootstrap is invoked
from probe or reset context, reducing the rom-lock footprint of
the drivers.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Tej Parkash [Mon, 16 Dec 2013 11:49:44 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Driver not able to collect minidump for ISP84xx
Issue:
minidump data collection fails as driver reports data mismatch
Fix:
When the driver encounters a new entry type that it cannot process,
it should just skip the entry and adjust the total buffer size by
subtracting the skipped bytes from it. This is to ensure that there
is no data mismatch because of the new entries.
Signed-off-by: Tej Parkash <tej.parkash@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Tej Parkash [Mon, 16 Dec 2013 11:49:43 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix pending IO completion in reset path before initiating chip reset
Issue:
Pending IO wait does not complete after triggering Graceful reset,
causing ack timeout and call traces.
Fix:
1. Reducing the IO command wait timeout before triggering reset,
as logically also timeout should be less than reset timeout (10sec).
2. Moving the abort IO after chip reset, because only after
chip reset, driver owns the IO otherwise it is with firmware and can
still revert back with response.
Signed-off-by: Tej Parkash <tej.parkash@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Tej Parkash [Mon, 16 Dec 2013 11:49:42 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix processing response queue during probe
Issue:
While booting with kdump kernel, driver receive IOCB interrupts
for which it is not ready which results in processing them
before init_firmware during driver probe
Fix:
Two steps solution
1. Make driver ready to process the interrupt before interupts
handlers is registered.
2. Stop driver processing iocb interrupts if not generated as per
firmware protocol i.e R2H bit set
Signed-off-by: Tej Parkash <tej.parkash@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:41 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix failure of IDC Time Extend mailbox command
Issue:
Mailbox command 0x102 (IDC Time Extend) failure seen while applying
changes to iface using iscsiadm
Fix:
Added fix to extend IDC timeout only for ISP84xx when IDC ACK
needs to be posted and disable ACB mailbox command completion
is in intermediate state.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Nilesh Javali [Mon, 16 Dec 2013 11:49:31 +0000 (06:49 -0500)]
[SCSI] qla4xxx: ISP8xxx: Correct retry of adapter initialization
Issue:
For ISP8xxx, adapter initialization is not retried if
qla4xxx_initialize_adapter fails.
Fix:
If qla4xxx_initialize_adapter fails, first check if failure is due to IRQs not
attached in order to skip retrial, then free the IRQs and then retry
initializing the adapter.
Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
scsi_cmnd n io_task was not NULL when
- Link goes down while IO was happening and session is closed.
- Task for which TMF was sent.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix the session cleanup when reboot/shutdown happens
In iSCSI Boot scenario, when machine is reboot/shutdown phase
the active sessions are not closed. Driver queue cleanup is
done as part of unload and device is disabled.
Sessions are still active, iSCSI commands are issued from
session which comes to driver, as driver cleanup and device
disabled there is kernel stack dump with errors.
Fix is invoking iscsi_session_failure with ISCSI_ERR_INVALID_HOST
on all the active sessions when shutdown routine is called.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec.
The doorbel format has been updated to support additonal functionalities
of SKH-R adapter. These changes are made such that older FW also works fine.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] be2iscsi: Fix handling timed out MBX completion from FW
When an MBX command timeout happens,the resources associated with
the MBX command were freed. If FW were to give the response to
host after the timeout value set by driver then driver crashes as the MBX Cmd
resources were already freed.
This patch fixes this issue by maintaing a state flag for each of
the MBX command posted/timedout/completed.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
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>
[SCSI] hpsa: improve error messages for driver initiated commands
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>
[SCSI] hpsa: only do device rescan for certain events
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>
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>
Scott Teel [Tue, 18 Feb 2014 19:57:26 +0000 (13:57 -0600)]
[SCSI] hpsa: update source file copyrights
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>
Scott Teel [Tue, 18 Feb 2014 19:57:21 +0000 (13:57 -0600)]
[SCSI] hpsa: retry certain ioaccel error cases on the RAID path
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>
Scott Teel [Tue, 18 Feb 2014 19:57:05 +0000 (13:57 -0600)]
[SCSI] hpsa: rescan devices on ioaccel2 error
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>
Scott Teel [Tue, 18 Feb 2014 19:57:00 +0000 (13:57 -0600)]
[SCSI] hpsa: allow user to disable accelerated i/o path
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>
Scott Teel [Tue, 18 Feb 2014 19:56:55 +0000 (13:56 -0600)]
[SCSI] hpsa: complete the ioaccel raidmap code
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>
Scott Teel [Tue, 18 Feb 2014 19:56:45 +0000 (13:56 -0600)]
[SCSI] hpsa: add task management for ioaccel mode 2
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>
Scott Teel [Tue, 18 Feb 2014 19:56:39 +0000 (13:56 -0600)]
[SCSI] hpsa: teach hpsa_device_reset to do either target or lun reset
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>
Scott Teel [Tue, 18 Feb 2014 19:56:34 +0000 (13:56 -0600)]
[SCSI] hpsa: get ioaccel mode 2 i/o working
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>
[SCSI] hpsa: initialize controller to perform io accelerator mode 2
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>
Mike MIller [Tue, 18 Feb 2014 19:56:20 +0000 (13:56 -0600)]
[SCSI] hpsa: get physical device handles for io accel mode 2 as well as mode 1
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>
[SCSI] hpsa: do ioaccel mode 2 resource allocations
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>
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>
Scott Teel [Tue, 18 Feb 2014 19:55:59 +0000 (13:55 -0600)]
[SCSI] hpsa: complain if physical or logical aborts are not supported
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>
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>
[SCSI] hpsa: do not rescan controllers known to be locked up
* 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>
[SCSI] hpsa: poll controller to detect device change event
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>
[SCSI] hpsa: update raid offload status on device rescan
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>
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>
Scott Teel [Tue, 18 Feb 2014 19:55:28 +0000 (13:55 -0600)]
[SCSI] hpsa: fix task management for mode-1 ioaccell path
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>
[SCSI] hpsa: only allow REQ_TYPE_FS to use fast path
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>
Matt Gates [Tue, 18 Feb 2014 19:55:17 +0000 (13:55 -0600)]
[SCSI] hpsa: add support for 'fastpath' i/o
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>
Matt Gates [Tue, 18 Feb 2014 19:55:12 +0000 (13:55 -0600)]
[SCSI] hpsa: mark last scatter gather element as the last
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>
Matt Gates [Tue, 18 Feb 2014 19:55:07 +0000 (13:55 -0600)]
[SCSI] hpsa: use extended report luns command for HP SSD SmartPath
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>
spin_lock_irqsave for the HBA lock is called in one function where flag
is local to that function. Another function is called from the first
function where lock has to be released using spin_unlock_irqrestore for
calling task_done of libsas. In the second function also flag is declared
and used. For calling task_done there is no need to enable the irq. So
instead of using spin_lock_irqsave and spin_unlock_irqrestore, spin_lock
and spin_unlock is used now. This also avoids passing the flags across all
the functions where HBA lock is being used. Also removed redundant code.
Reported-by: Jason Seba <jason.seba42@gmail.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Suresh Thiagarajan <Suresh.Thiagarajan@pmcs.com> Signed-off-by: Viswas G <viswas.g@pmcs.com> Acked-by: Jack Wang <xjtuwjp@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Hannes Reinecke [Wed, 15 Jan 2014 12:30:53 +0000 (13:30 +0100)]
[SCSI] hpsa: fixup MSI-X registration
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>