Jon Derrick [Mon, 20 Jul 2015 16:14:09 +0000 (10:14 -0600)]
NVMe: Use CMB for the IO SQes if available
Some controllers have a controller-side memory buffer available for use
for submissions, completions, lists, or data.
If a CMB is available, the entire CMB will be ioremapped and it will
attempt to map the IO SQes onto the CMB. The queues will be shrunk as
needed. The CMB will not be used if the queue depth is shrunk below some
threshold where it may have reduced performance over a larger queue
in system memory.
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 8ffaadf7429270914b8f146ec13cf305e01df20d)
Orabug: 22620486 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Jon Derrick [Mon, 20 Jul 2015 16:14:08 +0000 (10:14 -0600)]
NVMe: Unify SQ entry writing and doorbell ringing
This patch changes sq_cmd writers to instead create their command on
the stack. __nvme_submit_cmd copies the sq entry to the queue and writes
the doorbell.
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 498c43949c7b8f57e0afb8195019cf5a7ba72de0)
Orabug: 22620486 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Keith Busch [Tue, 14 Jul 2015 17:57:48 +0000 (11:57 -0600)]
NVMe: Reread partitions on metadata formats
This patch has the driver automatically reread partitions if a namespace
has a separate metadata format. Previously revalidating a disk was
sufficient to get the correct capacity set on such formatted drives,
but partitions that may exist would not have been surfaced.
Reported-by: Paul Grabinar <paul.grabinar@ranbarg.com> Signed-off-by: Keith Busch <keith.busch@intel.com> Cc: Matthew Wilcox <willy@linux.intel.com> Tested-by: Paul Grabinar <paul.grabinar@ranbarg.com> Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 7bee607472aa2e5a36dfe143e5a625be06125f53)
Orabug: 22620486 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Jon Derrick [Tue, 30 Jun 2015 17:22:52 +0000 (11:22 -0600)]
NVMe: Fix irq freeing when queue_request_irq fails
Fixes an issue when queue_reuest_irq fails in nvme_setup_io_queues. This
patch initializes all vectors to -1 and resets the vector to -1 in the
case of a failure in queue_request_irq. This avoids the free_irq in
nvme_suspend_queue if the queue did not get an irq.
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 758dd7fdffd60507624edce34fff122a63163b3f)
Orabug: 22620486 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Andrew Morton [Sat, 27 Jun 2015 18:20:34 +0000 (12:20 -0600)]
drivers/block/nvme-core.c: fix build with gcc-4.4.4
gcc-4.4.4 (and possibly other versions) fail the compile when initializers
are used with anonymous unions. Work around this.
drivers/block/nvme-core.c: In function 'nvme_identify_ctrl':
drivers/block/nvme-core.c:1163: error: unknown field 'identify' specified in initializer
drivers/block/nvme-core.c:1163: warning: missing braces around initializer
drivers/block/nvme-core.c:1163: warning: (near initialization for 'c.<anonymous>')
drivers/block/nvme-core.c:1164: error: unknown field 'identify' specified in initializer
drivers/block/nvme-core.c:1164: warning: excess elements in struct initializer
drivers/block/nvme-core.c:1164: warning: (near initialization for 'c')
...
This patch has no effect on text size with gcc-4.8.2.
Fixes: d29ec8241c10eac ("nvme: submit internal commands through the block layer") Cc: Christoph Hellwig <hch@lst.de> Cc: Jens Axboe <axboe@fb.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e44ac588cd61c960226d61c379e2873a95544a51)
Orabug: 22620486 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Axel Lin [Sat, 20 Jun 2015 08:29:14 +0000 (16:29 +0800)]
block: nvme-scsi: Catch kcalloc failure
res variable was initialized to -ENOMEM, but it's override by
nvme_trans_copy_from_user(). So current code returns 0 if kcalloc fails.
Fix it to return proper error code.
Christoph Hellwig [Fri, 22 May 2015 09:12:46 +0000 (11:12 +0200)]
nvme: submit internal commands through the block layer
Use block layer queues with an internal cmd_type to submit internally
generated NVMe commands. This both simplifies the code a lot and allow
for a better structure. For example now the LighNVM code can construct
commands without knowing the details of the underlying I/O descriptors.
Or a future NVMe over network target could inject commands, as well as
could the SCSI translation and ioctl code be reused for such a beast.
Christoph Hellwig [Fri, 22 May 2015 09:12:41 +0000 (11:12 +0200)]
nvme: fix scsi translation error handling
Erorr handling for the scsi translation was completely broken, as there
were two different positive error number spaces overlapping. Fix this
up by removing one of them, and centralizing the generation of the other
positive values in a single place. Also fix up a few places that didn't
handle the NVMe error codes properly.
Christoph Hellwig [Fri, 22 May 2015 09:12:39 +0000 (11:12 +0200)]
nvme: store a struct device pointer in struct nvme_dev
Most users want the generic device, so store that in struct nvme_dev
instead of the pci_dev. This also happens to be a nice step towards
making some code reusable for non-PCI transports.
Note that we keep the unused timeout argument, but allow callers to
pass 0 instead of a timeout if they want the default. This will allow
adding a timeout to the pass through path later on.
Don Brace [Fri, 6 May 2016 19:17:57 +0000 (12:17 -0700)]
hpsa: correct handling of HBA device removal
Need to report HBA device removal faster than the
event handler polling interval.
Stop I/O to the removed disk and wait for all
I/O operations to flush before removing the device.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:17:36 +0000 (12:17 -0700)]
hpsa: correct ioaccel2 error procecssing.
set offload_to_be_enabled to 0 when an ioaccel2 error is processed.
Before, an ioaccel completion error would turn of ioaccel but a rescan
would turn it back on again.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:17:16 +0000 (12:17 -0700)]
hpsa: correct ioaccel state change operation
offload_to_be_enabled also needs to be set to 0 during a state
change.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:16:56 +0000 (12:16 -0700)]
hpsa: add timeouts for driver initiated commands
faulty drives can cause the driver to hang during a
scan operation.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Joseph T Handzik [Fri, 6 May 2016 19:16:35 +0000 (12:16 -0700)]
hpsa: add sas_address to sysfs device attibute
There have been companies requesting a sysfs entry
to obtain the sas address of device.
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:16:15 +0000 (12:16 -0700)]
hpsa: correct initialization order issue
The driver was calling scsi_scan_host before enabling interrupts.
This has gone unnoticed except for customers running in intx mode.
Calling scsi_scan_host before interrupts are enabled causes
"irq XX: nobody cared" messages and the driver to hang.
This patch enables interrupts before the call to scsi_scan_host.
Reported-by: Piotr Karbowski <piotr.karbowski@gmail.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:15:55 +0000 (12:15 -0700)]
hpsa: update copyright information
Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:15:14 +0000 (12:15 -0700)]
hpsa: check for a null phys_disk pointer in ioaccel2
path
An oops can occur when submitting ioaccel2 commands when the phys_disk
pointer is NULL in hpsa_scsi_ioaccel_raid_map. Happens when there are
configuration changes during I/O operations.
If the phys_disk pointer is NULL, send the command down the RAID path.
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:14:54 +0000 (12:14 -0700)]
hpsa: correct abort tmf for hba devices
Aborts were not being sent down to HBA devices
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:14:34 +0000 (12:14 -0700)]
hpsa: correct lun data caching bitmap definition
The bitmap was changed after this definition was added to the
driver. Correcting the bitmap definition.
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:14:14 +0000 (12:14 -0700)]
hpsa: add SMR drive support
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:13:53 +0000 (12:13 -0700)]
hpsa: do not get enclosure info for external devices
Stop annoying "Error, could not get enclosure information"
messages.
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:13:33 +0000 (12:13 -0700)]
hpsa: Add box and bay information for enclosure
devices
Adding a new method to display enclosure device information.
Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:13:13 +0000 (12:13 -0700)]
hpsa: Change SAS transport devices to bus 0.
SAS transport places devices on bus 0 but driver was setting the bus to
3.
Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Dan Carpenter [Fri, 6 May 2016 19:12:32 +0000 (12:12 -0700)]
hpsa: logical vs bitwise AND typo
HPSA_DIAG_OPTS_DISABLE_RLD_CACHING is a mask and bitwise AND was
intended here instead of logical &&. This bug is essentially harmless,
it means that sometimes we don't print a warning message which we wanted
to print.
Fixes: c2adae44e916 ('hpsa: disable report lun data caching') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Christoph Hellwig [Fri, 6 May 2016 19:12:12 +0000 (12:12 -0700)]
scsi: use host wide tags by default
This patch changes the !blk-mq path to the same defaults as the blk-mq
I/O path by always enabling block tagging, and always using host wide
tags. We've had blk-mq available for a few releases so bugs with
this mode should have been ironed out, and this ensures we get better
coverage of over tagging setup over different configs.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:11:52 +0000 (12:11 -0700)]
hpsa: bump the driver version
Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Gerry Morong <gerry.morong.pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Kevin Barnett [Fri, 6 May 2016 19:11:32 +0000 (12:11 -0700)]
hpsa: add in sas transport class
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
so hopefully output_len contains the combined length of the eight
strings. Otherwise, snprintf will stop copying to the output
buffer, but still end up reporting that combined length - which
in turn would result in user-space getting a bunch of useless nul
bytes (thankfully the upper sysfs layer seems to clear the output
buffer before passing it to the various ->show routines). But we have
so output_len at best contains the length of the last string printed.
Inside the loop, we then otherwise add to output_len. By magic,
we still have PATH_STRING_LEN available every time... This
wouldn't really be a problem if the bean-counting has been done
properly and each line actually does fit in 50 bytes, and maybe
it does, but I don't immediately see why. Suppose we end up
taking this branch:
An optimistic estimate says this uses strlen("BOX: 1 BAY: 2
Active\n") which is 21. Now add the 20 bytes guaranteed by the
%20.20s and then some for the rest of that format string, and
we're easily over 50 bytes. I don't think we can get over 100
bytes even being pessimistic, so this just means we'll scribble
into the next path[i+1] and maybe get that overwritten later,
leading to some garbled output (in fact, since we'd overwrite the
previous string's 0-terminator, we could end up with one very
long string and then print various suffixes of that, leading to
much more than 400 bytes of output). Except of course when we're
filling path[7], where overrunning it means writing random stuff
to the kernel stack, which is usually a lot of fun.
We can fix all of that and get rid of the 400 byte stack buffer by
simply writing directly to the given output buffer, which the upper
layer guarantees is at least PAGE_SIZE. s[c]nprintf doesn't care where
it is writing to, so this doesn't make the spin lock hold time any
longer. Using scnprintf ensures that output_len always represents the
number of bytes actually written to the buffer, so we'll report the
proper amount to the upper layer.
Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:10:47 +0000 (12:10 -0700)]
hpsa: enhance device messages
Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Scott Teel [Fri, 6 May 2016 19:10:20 +0000 (12:10 -0700)]
hpsa: disable report lun data caching
When external target arrays are present, disable the firmware's
normal behavior of returning a cached copy of the report lun data,
and force it to collect new data each time we request a report luns.
This is necessary for external arrays, since there may be no
reliable signal from the external array to the smart array when
lun configuration changes, and thus when driver requests
report luns, it may be stale data.
Use diag options to turn off RPL data caching.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Scott Teel [Fri, 6 May 2016 19:09:59 +0000 (12:09 -0700)]
hpsa: add discovery polling for PT RAID devices.
There are problems with getting configuration change notification
in pass-through RAID environments. So, activate flag
h->discovery_polling when one of these devices is detected in
update_scsi_devices.
After discovery_polling is set, execute a report luns from
rescan_controller_worker (every 30 seconds).
If the data from report_luns is different than last
time (binary compare), execute a full rescan via update_scsi_devices.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Scott Teel [Fri, 6 May 2016 19:09:39 +0000 (12:09 -0700)]
hpsa: eliminate fake lun0 enclosures
We don't need to create fake enclosure devices at Lun0
in external target array configurations anymore.
This was done to support Pre-SCSI rev 5 controllers
that didn't suppoprt report luns commands, so the
SCSI layer had to scan targets. If there was no
LUN at LUN 0, then the target scan would stop, and
move to the next target. Lun0 enclosure device
was added to prevent sparsely-numbered LUNs from
being missed.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Scott Teel [Fri, 6 May 2016 19:09:19 +0000 (12:09 -0700)]
hpsa: generalize external arrays
External array LUNs must use target and lun numbers assigned by the
external array. So the driver must treat these differently from
local LUNs when assigning lun/target.
LUN's 'model' field has been used to detect Lun types that need
special treatment, but the desire is to eliminate the need to reference
specific array models, and support any external array.
Pass-through RAID (PTRAID) luns are not luns of the local controller,
so they are not reported in LUN count of command 'ID controller'.
However, they ARE reported in "Report logical Luns" command.
Local luns are listed first, then PTRAID LUNs.
The number of luns from "Report LUNs" in excess of those reported by
'ID controller' are therefore the PTRAID LUNS.
We can now remove function is_ext_target, and the 'white list'
array of supported model names.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Kevin Barnett [Fri, 6 May 2016 19:08:59 +0000 (12:08 -0700)]
hpsa: move scsi_add_device and scsi_remove_device
calls to new function
preparation for adding the sas transport class
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Kevin Barnett [Fri, 6 May 2016 19:08:38 +0000 (12:08 -0700)]
hpsa: refactor hpsa_figure_bus_target_lun
setup for sas transport. Need to set the
bus and target accordingly.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:08:18 +0000 (12:08 -0700)]
hpsa: enhance hpsa_get_device_id
use an index into vpd data for SAS/SATA drives
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Kevin Barnett [Fri, 6 May 2016 19:07:58 +0000 (12:07 -0700)]
hpsa: add function is_logical_device
simplify checking for logical/physical devices
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Kevin Barnett [Fri, 6 May 2016 19:07:38 +0000 (12:07 -0700)]
hpsa: simplify update scsi devices
remove repeated calculation that checks for physical
or logical devices.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Kevin Barnett [Fri, 6 May 2016 19:07:17 +0000 (12:07 -0700)]
hpsa: simplify check for device exposure
remove macros and cleanup device exposure checking
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:06:57 +0000 (12:06 -0700)]
hpsa: correct ioaccel2 sg chain len
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:06:37 +0000 (12:06 -0700)]
hpsa: correct check for non-disk devices
The driver is using two MACROs which seemingly are looking in
the wrong location for the device_flags returned from
CISS_REPORT_PHYS. Both MACROs, NON_DISK_PHYS_DEV and
PHYS_IOACCEL, are using the pointer returned from figure_lunaddrbytes
which is the address of the LUN.lunid element in
the extended CISS_REPORT_PHYS. But the MACROS are using offsets
beyond the range of the element (offset 17 of an 8 byte element).
These MACROs actually are looking at the correct location but
they fail static checker analysis. It also will not work
if any new elements are added to the extended LUN structure.
Change the code to use the structure elements directly
since this MACRO is only used in one location.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Scott Teel [Fri, 6 May 2016 19:06:17 +0000 (12:06 -0700)]
hpsa: fix physical target reset
Set reset type in device_reset_handler to do either
logical unit reset for logical devices, or physical
target reset, for physical devices.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:05:56 +0000 (12:05 -0700)]
hpsa: fix hpsa_adjust_hpsa_scsi_table
Fix a NULL pointer issue in the driver when devices are removed
during a reset.
Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:05:36 +0000 (12:05 -0700)]
hpsa: correct transfer length for 6 byte read/write
commands
handle block counts of 0. Cleanup block and block count calculations.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:05:16 +0000 (12:05 -0700)]
hpsa: abandon rescans on memory alloaction failures.
Abandon and reschedule rescan process only if device inquiries
fail due to mem alloc failures, which are likely to occur for
all devices.
Otherwise, skip device if inquiry fails for other reasons,
and continue rescanning process for other devices.
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:04:56 +0000 (12:04 -0700)]
hpsa: allow driver requested rescans
Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by; Hannes Reinecke <hare@suse.de> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:03:55 +0000 (12:03 -0700)]
hpsa: change devtype to unsigned
This member is used in calls to scsi_device_type.
It should be unsigned since the kernel checks for upper bounds
and it should never be negative.
Suggested-by: Tomas Henzl <thenzl@redhat.com> Suggested-by: Hannes Reinecke <hare@suse.de> Suggested-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:03:14 +0000 (12:03 -0700)]
hpsa: stop zeroing reset_cmds_out and
ioaccel_cmds_out during rescan
pulling the rug out from under the reset handler
likewise for ioaccel_cmds_out
Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:02:54 +0000 (12:02 -0700)]
hpsa: remove unused parameter hostno
This parameter was once used before scan_start was defined
but now it is no longer used.
Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Scott Benesh [Fri, 6 May 2016 19:02:34 +0000 (12:02 -0700)]
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> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Kevin Barnett [Fri, 6 May 2016 19:02:14 +0000 (12:02 -0700)]
Change how controllers in mixed mode are handled.
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com> Reviewed-by: Scott Teel <scott.teel@pmcs.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Don Brace [Fri, 6 May 2016 19:01:53 +0000 (12:01 -0700)]
hpsa: update controller names
replace PM8068/69 with actual names
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> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Dan Carpenter [Fri, 6 May 2016 19:01:33 +0000 (12:01 -0700)]
hpsa: fix an sprintf() overflow in the reset handler
The string "cmd %d RESET FAILED, new lockup detected" is not quite
large enough so the sprintf() will overflow. I have increased the size
of the buffer and also changed the sprintf calls to snprintf.
Fixes: 73153fe533bc ('hpsa: use block layer tag for command allocation') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Don Brace <don.brace@pmcs.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 23064595 Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
Commit 05cc5a39ddb7 "bnx2x: add vlan filtering offload" introduced
a regression in regard for vlans for 57710, 57711 adapters -
Loading 8021q module on a machine with such an adapter would cause
a null pointer dereference, as the driver mistakenly publishes it
has capabilities for vlan CTAG filtering.
Reported-by: Otto Sabart <osabart@redhat.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ab6d7846cf80affc43b9d412fed5e25dfcf4f35d) Signed-off-by: Brian Maly <brian.maly@oracle.com>
Jason Luo [Thu, 17 Mar 2016 03:29:50 +0000 (11:29 +0800)]
fnic: Using rport-_dd_data to check rport online instead of rport_lookup
From: Satish Kharat <satishkh@cisco.com>
When issuing I/O we check if rport is online through libfc
rport_lookup() function which needs to be protected by mutex lock
that cannot acquired in I/O context. The change is to use midlayer
remote port’s dd_data which is preserved until its devloss timeout
and no protection is required.
Fnic driver version changed from 1.6.0.20 to 1.6.0.21
Signed-off-by: Satish Kharat <satishkh@cisco.com>
Orabug: 22918200 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Jason Luo [Thu, 17 Mar 2016 03:14:24 +0000 (11:14 +0800)]
fnic: Cleanup the I_O that has timed out and is used to issue LUN reset
From: Satish Kharat <satishkh@cisco.com>
In case of LUN reset, the device reset command is issued with one of
the I/Os that has timed out on that LUN. The change is to also return
this I/O with error status set to DID_RESET.
Fnic driver version changed from 1.6.0.19 to 1.6.0.20
Signed-off-by: Satish Kharat <satishkh@cisco.com>
Orabug: 22918200 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Jason Luo [Thu, 17 Mar 2016 02:59:23 +0000 (10:59 +0800)]
fnic: Fix to cleanup aborted IO to avoid device being offlined by mid-layer
From: Satish Kharat <satishkh@cisco.com>
If an I/O times out and an abort issued by host, if the abort is
successful we need to set scsi status as DID_ABORT. Or else the
mid-layer error handler which looks for this error code, will
offline the device. Also if the original I/O is not found in fnic
firmware, we will consider the abort as successful.
Fnic driver version changed from 1.6.0.17a to 1.6.0.19,
version 1.6.0.18 has been skipped
Signed-off-by: Satish Kharat <satishkh@cisco.com>
Orabug: 22918200 Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Signed-off-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Mainline v4.4 commit fb53c439d84387621c53808a3957ffd9876e5094 Signed-off-by: Guru Anbalagane <guru.anbalagane@oracle.com>
Inside compat IOCTL hook of driver, driver was using wrong address of
ioc->frame.raw which leads sense_ioc_ptr to be calculated wrongly and
failing IOCTL.
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 ea1c928bb6051ec4ccf24826898aa2361eaa71e5) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Driver assumes that VFs always have peers present whenever they have
same LD IDs. But this is not the case. This patch handles the above
mentioned by explicitly checking for a peer before making HA/non-HA path
decision.
Signed-off-by: Uday Lingala <uday.lingala@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 8f67c8c518f324874e8caf93d1f4468d25754333) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
The pd_seq_sync pointer can't be NULL, we have to check its entries
instead.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Acked-by: Sumit Saxena <sumit.saxena@broadcom.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 546e559c79b1a8d27c23262907a00fc209e392a0) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit d92ca9d3de862cb123d7ef0fd42dc1e9867dd590) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This patch fixes online controller resets on SRIOV-enabled series of
Avago controllers.
1) Remove late detection heartbeat.
2) Change in the behavior if the FW found in READY/OPERATIONAL state.
Signed-off-by: Uday Lingala <uday.lingala@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 3885c26b773750bf2e7e071a5b0b72f079196d60) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This patch will introduce module-parameter for SCSI command timeout
value and fix setting of resetwaittime beyond a value.
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 e3d178ca773ff997c6c94989d0b14a2c0eae761c) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
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 ccc7507de27a639c9e1327d6e56ef1f357962b09) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Make instance->adprecovery variable atomic and removes hba_lock spinlock
while accessing instance->adprecovery.
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 8a01a41d864771fbc3cfc80a9629e06189479cce) Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
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>
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>
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>
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>
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>
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>
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>
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>
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:
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>
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>
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>
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>
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>
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>
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>