]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agomegaraid_sas: IO throttling support
Sumit Saxena [Thu, 28 Jan 2016 15:34:31 +0000 (21:04 +0530)]
megaraid_sas: IO throttling support

Orabug: 22620626

This patch will add capability in driver to tell firmware that it can
throttle IOs in case controller's queue depth is downgraded post OFU
(online firmware upgrade). This feature will ensure firmware can be
downgraded from higher queue depth to lower queue depth without needing
system reboot. Added throttling code in IO path of driver, in case OS
tries to send more IOs than post OFU firmware's queue depth.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 52b62ac7c66e1a11eb8b3e3b0212847749af3b2d)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Dual queue depth support
Sumit Saxena [Thu, 28 Jan 2016 15:34:30 +0000 (21:04 +0530)]
megaraid_sas: Dual queue depth support

Orabug: 22620626

1. For iMR controllers, firmware will report two queue depths:

   - Controller-wide queue depth
   - LDIO queue depth (240)

Controller-wide queue depth will be greater among the two. Using this
new feature, iMR can provide larger Queue depth(QD) for JBOD and limited
QD for Virtual Disk(VD).

2. megaraid_sas driver will throttle read/write LDIOs based on "LDIO
Queue Depth".

3. Dual queue depth can be enabled/disabled via module parameter. It is
enabled by default if the firmware supports it. Only specific firmware
builds will enable the feature.

4. Added sysfs parameter "ldio_outstanding" which permits querying the
number of outstanding LDIO requests at runtime.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 308ec459bc1975d9856cfeb3d1cd6461794a3976)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Code optimization build_and_issue_cmd return-type
Sumit Saxena [Thu, 28 Jan 2016 15:34:29 +0000 (21:04 +0530)]
megaraid_sas: Code optimization build_and_issue_cmd return-type

Orabug: 22620626

build_and_issue_cmd should return SCSI_MLQUEUE_HOST_BUSY for a few error
cases instead of returning 1.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit f9a9dee6a1fd8570884a0ab6f19c6b5cca05bd49)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Reply Descriptor Post Queue (RDPQ) support
Sumit Saxena [Thu, 28 Jan 2016 15:34:28 +0000 (21:04 +0530)]
megaraid_sas: Reply Descriptor Post Queue (RDPQ) support

Orabug: 22620626

This patch will create a reply queue pool for each MSI-X index and will
provide an array of base addresses instead of the single address of
legacy mode. Using this new interface the driver can support higher
queue depths through scattered DMA pools.

If array mode is not supported driver will fall back to the legacy
method of reply pool allocation. This limits controller queue depth to
1K max. To enable a queue depth of more than 1K driver requires firmware
to support array mode and scratch_pad3 will provide the new queue depth
value.

When RDPQ is used, downgrading to an older firmware release should not
be permitted. This may cause firmware fault and is not supported.

Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 179ac14291a0e1cf8c2b2dfedce7c5af66696cc9)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Fastpath region lock bypass
Sumit Saxena [Thu, 28 Jan 2016 15:34:27 +0000 (21:04 +0530)]
megaraid_sas: Fastpath region lock bypass

Orabug: 22620626

Firmware will fill out per-LD data to tell driver whether a particular
LD supports region lock bypass. If yes, then driver will send non-FP
LDIO to region lock bypass FIFO. With this change in driver, firmware
will optimize certain code to improve performance.

Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 8f05024cd3dbd3ec85923f3e8da05bf6db187d57)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Update device queue depth based on interface type
Sumit Saxena [Thu, 28 Jan 2016 15:34:26 +0000 (21:04 +0530)]
megaraid_sas: Update device queue depth based on interface type

Orabug: 22620626

This patch will update device Queue depth based on interface type(SAS,
SATA..) for sysPDs.  For Virtual disks(VDs), there will be no change in
queue depth (will remain 256).  To fetch interface type (SAS or SATA or
FC..) of syspD, driver will send DCMD MR_DCMD_PD_GET_INFO.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2216c30523b0a1835b6d522ffe73ca167f199f00)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Task management support
Sumit Saxena [Thu, 28 Jan 2016 15:34:25 +0000 (21:04 +0530)]
megaraid_sas: Task management support

Orabug: 22620626

This patch adds task management for SCSI commands. Added functions are
task abort and target reset.

1. Currently, megaraid_sas driver performs controller reset when any IO
times out.  With task management support added, task abort and target
reset will be tried to recover timed out IO. If task management fails,
then controller reset will be performaned. If the task management
request times out, fail the request and escalate to the next
level (controller reset).

2. mr_device_priv_data will be allocated for all generations of
controller, but is_tm_capable flag will never be set for
controllers (prior to Invader series) as firmware support is not
available for task management.

3. Task management capable firmware will set is_tm_capable flag in
firmware API.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 18365b138508bfbce0405f9904639fa3b7caf3c9)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Syncing request flags macro names with firmware
Sumit Saxena [Thu, 28 Jan 2016 15:34:24 +0000 (21:04 +0530)]
megaraid_sas: Syncing request flags macro names with firmware

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 2c048351c8e3e2b90b3c8b9dea3ee1b709853a9d)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: MFI IO timeout handling
Sumit Saxena [Thu, 28 Jan 2016 15:34:23 +0000 (21:04 +0530)]
megaraid_sas: MFI IO timeout handling

Orabug: 22620626

This patch will do proper error handling for DCMD timeout failure cases
for Fusion adapters:

1. For MFI adapters, in case of DCMD timeout (DCMD which must return
SUCCESS) driver will call kill adapter.

2. What action needs to be taken in case of DCMD timeout is decided by
function dcmd_timeout_ocr_possible().  DCMD timeout causing OCR is
applicable to the following commands:

MR_DCMD_PD_LIST_QUERY
MR_DCMD_LD_GET_LIST
MR_DCMD_LD_LIST_QUERY
MR_DCMD_CTRL_SET_CRASH_DUMP_PARAMS
MR_DCMD_SYSTEM_PD_MAP_GET_INFO
MR_DCMD_LD_MAP_GET_INFO

3. If DCMD fails from driver init path there are certain DCMDs which
must return SUCCESS. If those DCMDs fail, driver bails out. For optional
DCMDs like pd_info etc., driver continues without executing certain
functionality.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 6d40afbc7d13359b30a5cd783e3db6ebefa5f40a)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Do not allow PCI access during OCR
Sumit Saxena [Thu, 28 Jan 2016 15:34:22 +0000 (21:04 +0530)]
megaraid_sas: Do not allow PCI access during OCR

Orabug: 22620626

This patch will do synhronization between OCR function and AEN function
using "reset_mutex" lock.  reset_mutex will be acquired only in the
first half of the AEN function which issues a DCMD. Second half of the
function which calls SCSI API (scsi_add_device/scsi_remove_device)
should be out of reset_mutex to avoid deadlock between scsi_eh thread
and driver.

During chip reset (inside OCR function), there should not be any PCI
access and AEN function (which is called in delayed context) may be
firing DCMDs (doing PCI writes) when chip reset is happening in parallel
which will cause FW fault. This patch will solve the problem by making
AEN thread and OCR thread mutually exclusive.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 11c71cb4ab7cd901b9d6f0ff267c102778c1c8ef)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid: Fix possible NULL pointer deference in mraid_mm_ioctl
Nicholas Krause [Tue, 5 Jan 2016 19:32:54 +0000 (14:32 -0500)]
megaraid: Fix possible NULL pointer deference in mraid_mm_ioctl

Orabug: 22620626

This adds the needed check after the call to the function
mraid_mm_alloc_kioc in order to make sure that this function has not
returned NULL and therefore makes sure we do not deference a NULL
pointer if one is returned by mraid_mm_alloc_kioc.  Further more add
needed comments explaining that this function call can return NULL if
the list head is empty for the pointer passed in order to allow furture
users to understand this required pointer check.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7296f62f0322d808362b21064deb34f20799c20d)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Fix sparse warning
Sumit Saxena [Thu, 5 Nov 2015 15:47:38 +0000 (21:17 +0530)]
megaraid_sas: Fix sparse warning

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 9fb74c4e66daab5c3fb3b949d37c15684d7ee82a)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Make tape drives visible on PERC5 controllers
Sumit Saxena [Thu, 5 Nov 2015 15:47:37 +0000 (21:17 +0530)]
megaraid_sas: Make tape drives visible on PERC5 controllers

Orabug: 22620626

The DELL PERC5 controller firmware does not list tape drives in response
to MR_DCMD_PD_LIST_QUERY. This causes tape drives not be exposed to the
OS when connected to a PERC5 controller.

This patch permits detection of tape drives connected to a PERC5
controller by exposing non-TYPE_DISK devices unconditionally.

Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit aed335eecf8f09c28588b01c7f7e24ee78156e28)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas : Remove debug print from function megasas_update_span_set
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:11:14 +0000 (13:41 +0530)]
megaraid_sas : Remove debug print from function megasas_update_span_set

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c8051156d1d3dd99d02e0bf5b127fc8d32f30f69)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas : Driver version upgrade
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:11:04 +0000 (13:41 +0530)]
megaraid_sas : Driver version upgrade

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit afb2b5ddac9f3727983030bc4450e9e3b5956b2a)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas : SMAP restriction--do not access user memory from IOCTL code
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:54 +0000 (13:40 +0530)]
megaraid_sas : SMAP restriction--do not access user memory from IOCTL code

Orabug: 22620626

This is an issue on SMAP enabled CPUs and 32 bit apps running on 64 bit
OS. Do not access user memory from kernel code. The SMAP bit restricts
accessing user memory from kernel code.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 323c4a02c631d00851d8edc4213c4d184ef83647)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Make PI enabled VD 8 byte DMA aligned
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:44 +0000 (13:40 +0530)]
megaraid_sas: Make PI enabled VD 8 byte DMA aligned

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0b48d12d0365a628d2257a4560b3b06c825fe1cd)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Initialize tasklet before setting up IRQs
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:34 +0000 (13:40 +0530)]
megaraid_sas: Initialize tasklet before setting up IRQs

Orabug: 22620626

It may happen (kdump), that an interrupt is invoked just after the
setup_irqs function was called but before the tasklet was initialised.
At this phase the hw ints should have been disabled, but for unknown
reason this mechanism seems to not work properly.

From: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 91626c2701acad605c434b5e8245cbeea6671382)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Indicate online firmware upgrade support for Secure JBOD feature
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:24 +0000 (13:40 +0530)]
megaraid_sas: Indicate online firmware upgrade support for Secure JBOD feature

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3222251dbbe9f155e7b8c910b770d6ff922fb47e)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Update OCR capability on controller properties change
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:14 +0000 (13:40 +0530)]
megaraid_sas: Update OCR capability on controller properties change

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c4bd265415d5b06d7e3615c53036f589f300076e)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Do not use PAGE_SIZE for max_sectors
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:10:04 +0000 (13:40 +0530)]
megaraid_sas: Do not use PAGE_SIZE for max_sectors

Orabug: 22620626

Do not use PAGE_SIZE marco to calculate max_sectors per I/O
request. Driver code assumes PAGE_SIZE will be always 4096 which can
lead to wrongly calculated value if PAGE_SIZE is not 4096. This issue
was reported in Ubuntu Bugzilla Bug #1475166.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 357ae967ad66e357f78b5cfb5ab6ca07fb4a7758)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Support for Cutlass (12 Gbps) controller
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:54 +0000 (13:39 +0530)]
megaraid_sas: Support for Cutlass (12 Gbps) controller

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7364d34b878d78c4df90d0e6a5e06f8ad0c283e4)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Support for Intruder (12 Gbps) controller
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:44 +0000 (13:39 +0530)]
megaraid_sas: Support for Intruder (12 Gbps) controller

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 90c204bc59a313bf03a0641caee3e2b5945629b5)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Remove PCI id checks
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:34 +0000 (13:39 +0530)]
megaraid_sas: Remove PCI id checks

Orabug: 22620626

Remove PCI id based checks and use instance->ctrl_context to decide
whether controller is MFI-based or a Fusion adapter. Additionally,
Fusion adapters are divided into two categories: Thunderbolt and
Invader.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5a8cb85b569b2349493aadb81a747e077766907d)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Expose TAPE drives unconditionally
sumit.saxena@avagotech.com [Thu, 15 Oct 2015 08:09:24 +0000 (13:39 +0530)]
megaraid_sas: Expose TAPE drives unconditionally

Orabug: 22620626

Expose non-disk (TAPE drive, CD-ROM) unconditionally.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0d5b47a724bab0ebaaa933d6ff5e584957aaa188)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Version update
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:54:21 +0000 (17:24 +0530)]
megaraid_sas: Version update

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 609fb07b2bdebe5d2c6a9da7e9d8e05155086418)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Code refactor for use of requestorId
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:54:11 +0000 (17:24 +0530)]
megaraid_sas: Code refactor for use of requestorId

Orabug: 22620626

Some of these code changes were proposed by David Binderman.

Removed redudant check of requestorId. Redundant condition:
instance.requestorId. Check for plasma firmware 1.11 are now
restructured to support only specific device id.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 92bb6505785b632a1b0f735b21c4b34326ec048f)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Fix validHandles check in I/O path
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:54:01 +0000 (17:24 +0530)]
megaraid_sas: Fix validHandles check in I/O path

Orabug: 22620626

Syncro firmware supports round robin I/O switching on dual path. Driver
uses validHandles to check for dual path. However, it is supposed to
check for values > 1 (not > 2).

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 75b96061eb95c9b9f8a1da6995f1c314526f3572)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Print critical firmware event messages
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:51 +0000 (17:23 +0530)]
megaraid_sas: Print critical firmware event messages

Orabug: 22620626

Print firmware events in human-readable form. This will help users track
any critical firmware events without special application support.

Sample syslogd output:

megaraid_sas 0000:02:00.0: 8619 (491648347s/0x0020/WARN) - Controller temperature threshold exceeded. This may indicate inadequate system cooling. Switching to low performance mode.

The format of logged events is:

"<pci_dev_id>: <sequence_number> (<timestamp>/<locale>/<class>) - <description>"

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 714f517745729e060ef716d16026e26e5fce591f)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Chip reset if driver fails to get IOC ready
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:41 +0000 (17:23 +0530)]
megaraid_sas: Chip reset if driver fails to get IOC ready

Orabug: 22620626

Fix the issue reported at:

http://marc.info/?l=linux-scsi&m=143694494104544&w=2

Try to do chip reset at driver load time. If firmware fails to reach
ready state, try chip reset using adp_reset() callback. For Fusion
adapters the call back was previously void. Provide a suitable reset
function.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 79b82c2c560025afbb88ba7ad5cddb9c2203cf2e)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Support for max_io_size 1MB
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:31 +0000 (17:23 +0530)]
megaraid_sas: Support for max_io_size 1MB

Orabug: 22620626

Driver will expose max sge = 256 (earlier it was 64) if firmware
supports extended IO size (1M).

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit bd5f9484262a13397a0725f4a43f7baaa3341125)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Code cleanup-use local variable drv_ops inside megasas_ioc_init_fusion
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:21 +0000 (17:23 +0530)]
megaraid_sas: Code cleanup-use local variable drv_ops inside megasas_ioc_init_fusion

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 4dbbe3cec443f0c6867e7ef549704966fbd6f48b)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: JBOD sequence number support
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:11 +0000 (17:23 +0530)]
megaraid_sas: JBOD sequence number support

Orabug: 22620626

Implemented JBOD map which will provide quick access for JBOD path and
also provide sequence number.  This will help hardware to fail command
to the FW in case of any sequence mismatch.

Fast Path I/O for JBOD will refer JBOD map (which has sequence number
per JBOD device) instead of RAID map.  Previously, the driver used RAID
map to get device handle for fast path I/O and this not have sequence
number information. Now, driver will use JBOD map instead.  As part of
error handling, if JBOD map is failed/not supported by firmware, driver
will continue using legacy behavior.

Now there will be three IO paths for JBOD (syspd):

 - JBOD map with sequence number (Fast Path)
 - RAID map without sequence number (Fast Path)
 - FW path via h/w exception queue deliberately setup devhandle
   0xFFFF (FW path).

Relevant data structures:

 - Driver send new DCMD MR_DCMD_SYSTEM_PD_MAP_GET_INFO for this purpose.
 - struct MR_PD_CFG_SEQ- This structure represent map of single physical
   device.
 - struct MR_PD_CFG_SEQ_NUM_SYNC- This structure represent whole JBOD
   map in general(size, count of sysPDs configured, struct MR_PD_CFG_SEQ
   of syspD with 0 index).
 - JBOD sequence map size is: sizeof(struct MR_PD_CFG_SEQ_NUM_SYNC)
   + (sizeof(struct MR_PD_CFG_SEQ) * (MAX_PHYSICAL_DEVICES - 1)) which
   is allocated while setting up JBOD map at driver load time.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 3761cb4cf65ec78846b4b8cba9c0578bb10f92d5)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Increase timeout to 60 secs for abort frames during shutdown
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:53:01 +0000 (17:23 +0530)]
megaraid_sas: Increase timeout to 60 secs for abort frames during shutdown

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit e0bd0874f2de21613e572669b2de1e4b0c3a97de)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: Synchronize driver headers with firmware APIs
sumit.saxena@avagotech.com [Mon, 31 Aug 2015 11:52:51 +0000 (17:22 +0530)]
megaraid_sas: Synchronize driver headers with firmware APIs

Orabug: 22620626

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 0be3f4c9e6b8f12c8c0d7b156b995b30134c7448)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: fix whitespace errors
Bjorn Helgaas [Tue, 7 Jul 2015 20:52:45 +0000 (15:52 -0500)]
megaraid_sas: fix whitespace errors

Orabug: 22620626

Fix whitespace and indentation errors.  No code change.

[jejb: checkpatch fixes]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit da0dc9fb4e6b0ad5a947c27a3c48985f6a2377eb)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: use dev_printk when possible
Bjorn Helgaas [Tue, 7 Jul 2015 20:52:34 +0000 (15:52 -0500)]
megaraid_sas: use dev_printk when possible

Orabug: 22620626

Use dev_printk() when possible to make messages more useful.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 1be1825453f6d75ea9c9ea0c8549ca481d94a7ab)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: fix TRUE and FALSE re-define build error
Suthikulpanit, Suravee [Wed, 10 Jun 2015 16:08:57 +0000 (11:08 -0500)]
megaraid_sas: fix TRUE and FALSE re-define build error

Orabug: 22620626

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: Kashyap Desai <kashyap.desai@avagotech.com>
Cc: Sumit Saxena <sumit.saxena@avagotech.com>
Cc: Uday Lingala <uday.lingala@avagotech.com>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit ad466c6c1edd3deac6deda3885f12d0b05efac11)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid: fix irq setup process regression
Tomas Henzl [Tue, 2 Jun 2015 10:39:46 +0000 (16:09 +0530)]
megaraid: fix irq setup process regression

Orabug: 22620626

This fixes a regression caused by commit
d3557fc8be11d25f316884581f487684f8e7dad3 megaraid_sas : Add separate function
for setting up IRQs This makes boot end with 'root does not exist' message on
certain adapters.

The bug is that the driver does not setup ints for cards without msi-x
support.  This patch fixes it, in addition to that it moves tasklet
initialisation before enable_intr, otherwise a kernel panic may occur, when an
interrupt arrives before the tasklet is ready.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
(cherry picked from commit 258c3af2b9309412d82e74b2ea87e8c140fe2072)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agoqla2xxx: Update driver version to 8.07.00.33.40.0-k.
Sawan Chandak [Wed, 2 Mar 2016 06:15:20 +0000 (11:45 +0530)]
qla2xxx: Update driver version to 8.07.00.33.40.0-k.

Orabug: 22863553

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Set relogin flag when we fail to queue login requests.
Chad Dupuis [Wed, 27 Jan 2016 17:03:37 +0000 (12:03 -0500)]
qla2xxx: Set relogin flag when we fail to queue login requests.

Orabug: 22863553

If we fail to queue an srb for an async login we should set the
relogin flag so it will be retried as the reason for the queuing
failure was most likely transient.  Failure to do this can lead to
failed paths as login is never retried if the relogin flag is not
set.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Enable T10-DIF for ISP27XX
Himanshu Madhani [Wed, 27 Jan 2016 17:03:36 +0000 (12:03 -0500)]
qla2xxx: Enable T10-DIF for ISP27XX

Orabug: 22863553

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Provide mbx info in BBCR data after mbx failure
Harish Zunjarrao [Wed, 27 Jan 2016 17:03:35 +0000 (12:03 -0500)]
qla2xxx: Provide mbx info in BBCR data after mbx failure

Orabug: 22863553

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Avoid side effects when using endianizer macros.
Joe Carnuccio [Wed, 27 Jan 2016 17:03:34 +0000 (12:03 -0500)]
qla2xxx: Avoid side effects when using endianizer macros.

Orabug: 22863553

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Add support for Private link statistics counters.
Harish Zunjarrao [Fri, 26 Feb 2016 11:15:06 +0000 (16:45 +0530)]
qla2xxx: Add support for Private link statistics counters.

Orabug: 22863553

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Add support for buffer to buffer credit value for ISP27XX.
Sawan Chandak [Fri, 26 Feb 2016 11:00:57 +0000 (16:30 +0530)]
qla2xxx: Add support for buffer to buffer credit value for ISP27XX.

Orabug: 22863553

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Add support for online flash update for ISP27XX.
Sawan Chandak [Fri, 26 Feb 2016 10:50:32 +0000 (16:20 +0530)]
qla2xxx: Add support for online flash update for ISP27XX.

Orabug: 22863553

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Allow fw to hold status before sending ABTS response.
Himanshu Madhani [Fri, 26 Feb 2016 10:44:44 +0000 (16:14 +0530)]
qla2xxx: Allow fw to hold status before sending ABTS response.

Orabug: 22863553

Set bit 12 of additional firmware options 3 to let firmware
hold status IOCB until ABTS response is received from Target.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Seed init-cb login timeout from nvram exclusively.
Joe Carnuccio [Wed, 27 Jan 2016 17:03:29 +0000 (12:03 -0500)]
qla2xxx: Seed init-cb login timeout from nvram exclusively.

Orabug: 22863553

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agoqla2xxx: Remove unneeded link offline message.
Chad Dupuis [Fri, 26 Feb 2016 10:33:49 +0000 (16:03 +0530)]
qla2xxx: Remove unneeded link offline message.

Orabug: 22863553

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agofirmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6
Andrea Arcangeli [Fri, 8 Jan 2016 08:00:54 +0000 (09:00 +0100)]
firmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6

The dmi_ver wasn't updated correctly before the dmi_decode method run
to save the uuid.

That resulted in "dmidecode -s system-uuid" and
/sys/class/dmi/id/product_uuid disagreeing. The latter was buggy and
this fixes it.

Reported-by: Federico Simoncelli <fsimonce@redhat.com>
Fixes: 9f9c9cbb6057 ("drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists")
Fixes: 79bae42d51a5 ("dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()")
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Orabug: 22694972
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agoxhci: Workaround to get Intel xHCI reset working more reliably
Rajmohan Mani [Wed, 18 Nov 2015 08:48:20 +0000 (10:48 +0200)]
xhci: Workaround to get Intel xHCI reset working more reliably

Orabug: 22805913

Existing Intel xHCI controllers require a delay of 1 mS,
after setting the CMD_RESET bit in command register, before
accessing any HC registers. This allows the HC to complete
the reset operation and be ready for HC register access.
Without this delay, the subsequent HC register access,
may result in a system hang, very rarely.

Verified CherryView / Braswell platforms go through over
5000 warm reboot cycles (which was not possible without
this patch), without any xHCI reset hang.

Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com>
Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a5964396190d0c40dd549c23848c282fffa5d1f2)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
9 years agohpsa: fix rmmod issues
Don Brace [Fri, 6 Nov 2015 14:04:55 +0000 (06:04 -0800)]
hpsa: fix rmmod issues

The driver is calling hpsa_shutdown before calling scsi_remove_host.
hpsa_shutdown is disabling interrupts.

scsi_remove_host can trigger I/O operations, such as
SYNCHRONIZE CACHE when multipath is enabled which hang the system.

Call scsi_remove_host before calling hpsa_shutdown.

Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: fix issues with multilun devices
shane.seymour [Fri, 6 Nov 2015 14:04:55 +0000 (06:04 -0800)]
hpsa: fix issues with multilun devices

A regression was introduced into the hpsa driver a while back so
non-zero LUNs of multi-LUN devices may no longer be presented via
a SAS based Smart Array. I have not done a bisection to discover
the change that caused it.

The CISS firmware specification (available on sourceforge)
defines an 8 byte lunid that describes devices that the Smart
Array can see/present to the system. The current code in the hpsa
driver attempts to find matches for non-zero LUNs with LUN 0 for
a bus/target by zeroing out byte 4 of the lunid and find a match.

This method is sufficient for SCSI based Smart Arrays because
byte 5 is always 0. For SAS based Smart arrays byte 5 of the
lunid contains the path number for a multipath device and
either one or two bits (the documentation does not define how
many bits are used but it appears it may be one only) that
indicate if the given path number in byte 5 must always be
used to access that device. Byte 5 may not always be zero.

The following are lunids (spaces added for clarity) for a
MSL2024 single drive library connected via a H241 Smart Array:

00 00 00 00 01 00 00 01 (changer)
00 00 00 00 00 80 00 01 (tape)

In the 4th byte (counting from 0) you can see that the tape
is LUN 0 and the changer is LUN 1. The 0x80 set in the 5th byte
for the tape drive means the driver should force access to
path 0 (the library in this case was connected to one path only
anyway).

After the changes we can see the following in the dmesg output:

scsi 0:3:0:0: RAID              HP       H241             1.18 \
PQ: 0 ANSI: 5
scsi 0:2:0:0: Sequential-Access HP       Ultrium 6-SCSI   354W \
PQ: 0 ANSI: 6
scsi 0:2:0:1: Medium Changer    HP       MSL G3 Series    8.70 \
PQ: 0 ANSI: 5

Showing that the changer is correctly identified as LUN 1 of
bus 2 target 0. Before the change the changer device is not seen.

Suggested-by: shane.seymour <shane.seymour@hp.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add in new offline mode
Scott Benesh [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add in new offline mode

prevent adding volumes that are not available.

Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add in new controllers
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add in new controllers

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: cleanup update scsi devices
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: cleanup update scsi devices

showing that tables have been updated unnecessarily.

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add sysfs entry path_info to show box and bay information
Joe Handzik [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add sysfs entry path_info to show box and bay information

host no, bus, target, lun, scsi_device_type
for hba mode add: box and bay information

report if the path is active/inactive

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add PMC-Sierra to copyright
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: add PMC-Sierra to copyright

need to add PMC to copyright notice and update the Hewlett-Packard
copyright notification.

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: correct static checker warnings on driver init cleanup
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: correct static checker warnings on driver init cleanup

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: correct decode sense data
Don Brace [Fri, 6 Nov 2015 14:04:54 +0000 (06:04 -0800)]
hpsa: correct decode sense data

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: Correct double unlock of mutex
Don Brace [Fri, 6 Nov 2015 14:04:53 +0000 (06:04 -0800)]
hpsa: Correct double unlock of mutex

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: change driver version
Don Brace [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: change driver version

update driver version

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add in new controller id
Don Brace [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: add in new controller id

add in support for latest PMC controller

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: dont meddle with hw which isn't ours
Don Brace [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: dont meddle with hw which isn't ours

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: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: cleanup reset
Webb Scales [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: cleanup reset

Synchronize completion the reset with completion of outstanding commands

Extending the newly-added synchronous abort functionality,
now also synchronize resets with the completion of outstanding commands.
Rename the wait queue to reflect the fact that it's being used for both
types of waits.  Also, don't complete commands which are terminated
due to a reset operation.

fix for controller lockup during reset

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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: propagate the error code in hpsa_kdump_soft_reset
Robert Elliott [Fri, 6 Nov 2015 13:47:45 +0000 (05:47 -0800)]
hpsa: propagate the error code in hpsa_kdump_soft_reset

If hpsa_wait_for_board_state fails, hpsa_kdump_soft_reset
should propagate its return value (e.g., -ENODEV) rather
than just returning -1.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use scsi host_no as hpsa controller number
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: use scsi host_no as hpsa controller number

Rather than numbering the hpsa controllers with an
incrementing 0..n value (e.g., that shows up in
/proc/interrupts), use the scsi midlayer
host_no (e.g. matching /sys/class/scsi_host/hostNN).

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use block layer tag for command allocation
Webb Scales [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: use block layer tag for command allocation

Rework slave allocation:
  - separate the tagging support setup from the hostdata setup
  - make the hostdata setup act consistently when the lookup fails
  - make the hostdata setup act consistently when the device is not added
  - set up the queue depth consistently across these scenarios
  - if the block layer mq support is not available, explicitly enable and
    activate the SCSI layer tcq support (and do this at allocation-time so
    that the tags will be available for INQUIRY commands)

Tweak slave configuration so that devices which are masked are also
not attached.

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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add interrupt number to /proc/interrupts interrupt name
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: add interrupt number to /proc/interrupts interrupt name

Add the interrupt number to the interrupt names that
appear in /proc/interrupts, so they are unique

Also, delete the IRQ and DAC prints.  Other parts of the kernel
already print the IRQ assignments, and dual-address-cycle support
has not been interesting since the parallel PCI bus went from
32 to 64 bits wide.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: create workqueue after the driver is ready for use
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: create workqueue after the driver is ready for use

Don't create the resubmit workqueue in hpsa_init_one until everything else
is ready to use, so everything can be freed in reverse order of when they
were allocated without risking freeing things while workqueue items are
still active.

Destroy the workqueue in the right order in
hpsa_undo_allocations_after_kdump_soft_reset too.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: fix try_soft_reset error handling
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: fix try_soft_reset error handling

If registering the special interrupt handlers in hpsa_init_one
before a soft reset fails, the error exit needs to deallocate
everything that was allocated before.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: cleanup for init_one step 2 in kdump
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: cleanup for init_one step 2 in kdump

In hpsa_undo_allocations_after_kdump_soft_reset,
the things allocated in hpsa_init_one step 2 -
h->resubmit_wq and h->lockup_detected  need to
be freed, in the right order.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: skip free_irq calls if irqs are not allocated
Robert Elliott [Fri, 6 Nov 2015 13:47:44 +0000 (05:47 -0800)]
hpsa: skip free_irq calls if irqs are not allocated

If try_soft_reset fails to re-allocate irqs, the error exit
starts with free_irq calls, which generate kernel WARN
messages since they were already freed a few lines earlier.

Jump to the next exit label to skip the free_irq calls.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: call pci_release_regions after pci_disable_device
Robert Elliott [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: call pci_release_regions after pci_disable_device

Despite the fact that PCI devices are enabled in this order:
    1. pci_enable_device
    2. pci_request_regions

    Documentation/PCI/pci.txt specifies that they be undone
    in this order
    1. pci_disable_device
    2. pci_release_regions

    Tested by injecting error in the call to pci_enable_device
    in hpsa_init_one -> hpsa_pci_init:
    [    9.095001] hpsa 0000:04:00.0: failed to enable PCI device
    [    9.095005] hpsa: probe of 0000:04:00.0 failed with error -22
    (-22 is -EINVAL)
    and then in the call pci_request_regions:
    [    9.178623] hpsa 0000:04:00.0: failed to obtain PCI resources
    [    9.178671] hpsa: probe of 0000:04:00.0 failed with error -16
    (-16 is -EBUSY)

    and then by adding
        reset_devices
    to the kernel command line and inject errors into the two
    calls to pci_enable_device and the call to pci_request_regions
    in hpsa_init_one -> hpsa_init_reset_devices.

    (inject on 6th call, 1st to hpsa2)
    [   62.413750] hpsa 0000:04:00.0: Failed to enable PCI device

    (inject on 7th call, 2nd to hpsa2)
    [   62.807571] hpsa 0000:04:00.0: failed to enable device.

    (inject on 8th call, 3rd to hpsa2)
    [   62.697198] hpsa 0000:04:00.0: failed to obtain PCI resources
    [   62.697234] hpsa: probe of 0000:04:00.0 failed with error -16

    The reset_devices path calls return -ENODEV on failure
    rather than passing the result, which apparently doesn't
    cause the pci driver to print anything.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace < don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: performance tweak for hpsa_scatter_gather()
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: performance tweak for hpsa_scatter_gather()

Divide the loop in hpsa_scatter_gather() into two, one for the initial SG list
and a second one for the chained list, if any.  This allows the conditional
check which resets the indicies for the chained list to be performed outside
the loop instead of being done on every iteration inside the loop.

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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: refactor and rework support for sending TEST_UNIT_READY
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: refactor and rework support for sending TEST_UNIT_READY

Factor out the code which sends the TEST_UNIT_READY from
wait_for_device_to_become_ready() into its own function.

Move the code which waits for the TEST_UNIT_READY from
wait_for_device_to_become_ready() into its own function.

If a logical drive has failed, resetting it will ensure
outstanding commands are completed, but polling it with
TURs after the reset will not work because the TURs will
never report good status.  So successful TUR should not
be a condition of success for the device reset error
handler.

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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: don't return abort request until target is complete
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: don't return abort request until target is complete

Don't return from the abort request until the target command is complete.
Mark outstanding commands which have a pending abort, and do not send them
to the host if we can avoid it.

If the current command has been aborted, do not call the SCSI command
completion routine from the I/O path: when the abort returns successfully,
the SCSI mid-layer will handle the completion implicitly.

The following race was possible in theory.

1. LLD is requested to abort a scsi command
2. scsi command completes
3. The struct CommandList associated with 2 is made available.
4. new io request to LLD to another LUN re-uses struct CommandList
5. abort handler follows scsi_cmnd->host_scribble and
   finds struct CommandList and tries to aborts it.

Now we have aborted the wrong command.

Fix by resetting the scsi_cmd field of struct CommandList
upon completion and making the abort handler check that
the scsi_cmd pointer in the CommadList struct matches the
scsi_cmnd that it has been asked to abort.

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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use helper routines for finishing commands
Webb Scales [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: use helper routines for finishing commands

cleanup command completions

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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add support sending aborts to physical devices via the ioaccel2 path
Stephen Cameron [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: add support sending aborts to physical devices via the ioaccel2 path

add support for tmf when in ioaccel2 mode

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: do not print ioaccel2 warning messages about unusual completions.
Robert Elliott [Fri, 6 Nov 2015 13:47:43 +0000 (05:47 -0800)]
hpsa: do not print ioaccel2 warning messages about unusual completions.

The SCSI midlayer already prints more detail about completions,
and has logging level options to filter them if not wanted.
These just slow down the system if a lot of errors occur,
stressing error handling even more.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up some error reporting output in abort handler
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: clean up some error reporting output in abort handler

report more useful information on aborts

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up driver init
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: clean up driver init

Improve initialization error handling in hpsa_init_one
Clean up style and indent issues
Rename functions for consistency
Improve error messaging on allocations
Fix return status from hpsa_put_ctlr_into_performant_mode
Correct free order in hpsa_init_one using new function
   hpsa_free_performant_mode
Prevent inadvertent use of null pointers by nulling out the parent structures
   and zeroing out associated size variables.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: correct return values from driver functions.
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: correct return values from driver functions.

correct return codes for error conditions

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: do not check cmd_alloc return value - it cannnot return NULL
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: do not check cmd_alloc return value - it cannnot return NULL

cmd_alloc can no longer return NULL, so don't check for NULL any more
(which is unreachable code).

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add more ioaccel2 error handling, including underrun statuses.
Joe Handzik [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: add more ioaccel2 error handling, including underrun statuses.

improve ioaccel2 error handling, including better handling of
underrun statuses

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: add ioaccel sg chaining for the ioaccel2 path
Webb Scales [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: add ioaccel sg chaining for the ioaccel2 path

Increase the request size for ioaccel2 path.

The error, if any, returned by hpsa_allocate_ioaccel2_sg_chain_blocks
to hpsa_alloc_ioaccel2_cmd_and_bft should be returned upstream rather
than assumed to be -ENOMEM.

This differs slightly from hpsa_alloc_ioaccel1_cmd_and_bft,
which does not call another hpsa_allocate function and only
has -ENOMEM to return from some kmalloc calls.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: refactor freeing of resources into more logical functions
Robert Elliott [Fri, 6 Nov 2015 13:47:42 +0000 (05:47 -0800)]
hpsa: refactor freeing of resources into more logical functions

refactor freeing of resources into more logical functions

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: clean up error handling
Robert Elliott [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: clean up error handling

refactor error cleanup and shutdown
disable interrupts and pci_disable_device on critical failures
add hpsa_free_cfgtables function

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: break hpsa_free_irqs_and_disable_msix into two functions
Robert Elliott [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: break hpsa_free_irqs_and_disable_msix into two functions

replace calls to hpsa_free_irqs_and_disable_msix with
hpsa_free_irqs and hpsa_disable_interrupt_mode

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: Get queue depth from identify physical bmic for physical disks.
Joe Handzik [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: Get queue depth from identify physical bmic for physical disks.

get drive queue depth to help avoid task set full conditions.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: use ioaccel2 path to submit IOs to physical drives in HBA mode.
Joe Handzik [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: use ioaccel2 path to submit IOs to physical drives in HBA mode.

use ioaccel2 path to submit I/O to physical drives in HBA mode

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: print accurate SSD Smart Path Enabled status
Robert Elliott [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: print accurate SSD Smart Path Enabled status

offload_enabled changes are deferred until after the
added/updated prints occur, so the values are incorrect.

defer printing SSD Smart Path Enabled status information until the
information is correct

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: factor out hpsa_ioaccel_submit function
Webb Scales [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: factor out hpsa_ioaccel_submit function

clean up command submission

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>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: try resubmitting down raid path on task set full
Stephen Cameron [Fri, 6 Nov 2015 13:47:41 +0000 (05:47 -0800)]
hpsa: try resubmitting down raid path on task set full

allow the controller firmware to queue up commands when the ioaccel device
queue is full.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: do not ignore return value of hpsa_register_scsi
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: do not ignore return value of hpsa_register_scsi

add error handling for failure when registering with SCSI subsystem.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: factor out hpsa_init_cmd function
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: factor out hpsa_init_cmd function

Factor out hpsa_cmd_init from cmd_alloc().  We also need
this for resubmitting commands down the default RAID path
when they have returned from the ioaccel paths with errors.

In particular, reinitialize the cmd_type and busaddr fields as these
will not be correct for submitting down the RAID stack path
after ioaccel command completion.

This saves time when submitting commands.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: make function names consistent
Robert Elliott [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: make function names consistent

make function names more consistent and meaningful

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: allow lockup detected to be viewed via sysfs
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: allow lockup detected to be viewed via sysfs

expose a detected lockup via sysfs

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>
9 years agohpsa: hpsa decode sense data for io and tmf
Stephen Cameron [Fri, 6 Nov 2015 13:47:40 +0000 (05:47 -0800)]
hpsa: hpsa decode sense data for io and tmf

In hba mode, we could get sense data in descriptor format so
we need to handle that.

It's possible for CommandStatus to have value 0x0D
"TMF Function Status", which we should handle.  We will get
this from a P1224 when aborting a non-existent tag, for
example.  The "ScsiStatus" field of the errinfo field
will contain the TMF function status value.

Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 22075051
Acked-by: Chuck Anderson <chuck.anderson@oracle.com>