]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agonvme: factor reset code into a common helper
Christoph Hellwig [Fri, 2 Oct 2015 16:49:23 +0000 (18:49 +0200)]
nvme: factor reset code into a common helper

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 90667892c5a78b47080359883a569a260e9e87ed)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: delete dev from dev_list in nvme_reset
Christoph Hellwig [Fri, 2 Oct 2015 16:48:36 +0000 (18:48 +0200)]
nvme: delete dev from dev_list in nvme_reset

Device resets need to delete the device from the device list before
kicking of the reset an re-probe, otherwise we get the device added
to the list twice.  nvme_reset is the only side missing this deletion
at the moment, and this patch adds it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 201cf1ecdfe5ea2774cbb21d4214c98ec8b418de)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Namespace removal simplifications
Keith Busch [Fri, 2 Oct 2015 16:37:28 +0000 (10:37 -0600)]
NVMe: Namespace removal simplifications

This liberates namespace removal from the device, allowing gendisk
references to be closed independent of the nvme controller reference
count.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 5105aa555c1c681ae281ea0d6108efd0a5d8a5e8)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: merge nvme_dev_reset into nvme_reset_failed_dev
Christoph Hellwig [Fri, 2 Oct 2015 15:41:18 +0000 (17:41 +0200)]
nvme: merge nvme_dev_reset into nvme_reset_failed_dev

And give the resulting function a more descriptive name.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 77b50d9e15e113fdb871218aa0f2e3bed12ee731)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme.h: add missing nvme_id_ctrl endianess annotations
Christoph Hellwig [Fri, 2 Oct 2015 13:27:16 +0000 (15:27 +0200)]
nvme.h: add missing nvme_id_ctrl endianess annotations

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 08c69640cfcbdcc7aaed31c05bbfaf03bb60611c)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: move hardware structures out of the uapi version of nvme.h
Christoph Hellwig [Fri, 2 Oct 2015 13:25:49 +0000 (15:25 +0200)]
nvme: move hardware structures out of the uapi version of nvme.h

Currently all NVMe command and completion structures are exposed to userspace
through the uapi version of nvme.h.  They are not an ABI between the kernel
and userspace, and will change in C-incompatible way for future versions of
the spec.  Move them to the kernel version of the file and rename the uapi
header to nvme_ioctl.h so that userspace can easily detect the presence of
the new clean header.  Nvme-cli already carries a local copy of the header,
so it won't be affected by this move.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 9d99a8dda154f38307d43d9c9aa504bd3703d596)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: add a local nvme.h header
Christoph Hellwig [Sat, 3 Oct 2015 13:46:41 +0000 (15:46 +0200)]
nvme: add a local nvme.h header

Add a new drivers/block/nvme.h which contains all the driver internal
interface.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit f11bb3e244c4b14e2d0a3b9d7e41895752997170)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Simplify device resume on io queue failure
Keith Busch [Fri, 2 Oct 2015 16:37:29 +0000 (10:37 -0600)]
NVMe: Simplify device resume on io queue failure

Releasing IO queues and disks was done in a work queue outside the
controller resume context to delete namespaces if the controller failed
after a resume from suspend. This is unnecessary since we can resume
a device asynchronously.

This patch makes resume use probe_work so it can directly remove
namespaces if the device is manageable but not IO capable. Since the
deleting disks was the only reason we had the convoluted "reset_workfn",
this patch removes that unnecessary indirection.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 0a7385ad69f0f210c5cfbfd334b42423a6e05e5a)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Reference count open namespaces
Keith Busch [Thu, 1 Oct 2015 23:14:10 +0000 (17:14 -0600)]
NVMe: Reference count open namespaces

Dynamic namespace attachment means the namespace may be removed at any
time, so the namespace reference count can not be tied to the device
reference count. This fixes a NULL dereference if an opened namespace
is detached from a controller.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 188c3568f814fea965947ed24739987ba9c5a87e)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Using PRACT bit to generate and verify PI by controller
Alok Pandey [Wed, 26 Aug 2015 14:56:14 +0000 (08:56 -0600)]
NVMe: Using PRACT bit to generate and verify PI by controller

This patch enables the PRCHK and reftag support when PRACT bit is set, and
block layer integrity is disabled.

Signed-off-by: Alok Pandey <pandey.alok@samsung.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e19b127f5b76ec03b9c52b64f117dc75bb39eda1)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: removed unused nn var from nvme_dev_add
Matias Bjørling [Tue, 18 Aug 2015 16:13:41 +0000 (10:13 -0600)]
NVMe: removed unused nn var from nvme_dev_add

The logic in nvme_dev_add to enumerate namespaces was moved to
nvme_dev_scan. When moved, the nn variable is no longer used. This patch
removes it.

Fixes: a5768aai ("NVMe: Automatic namespace rescan")
Signed-off-by: Matias Bjørling <m@bjorling.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit b2b1ec9b55ed0840956db15f823c4a73383c08be)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Set queue max segments
Keith Busch [Wed, 12 Aug 2015 22:17:54 +0000 (16:17 -0600)]
NVMe: Set queue max segments

This sets the queue's max segment size to match the device's
capabilities. The default of 128 is usable until a device's transfer
capability exceeds 512k, assuming a device page size of 4k. Many nvme
devices exceed that transfer limit, so this lets the block layer know what
kind of commands it to allow to form rather than unnecessarily split them.

One additional segment is added to account for a transfer that may start
in the middle of a page.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e824410ffcf4b245296b56c6fdf7b9797fce8c3e)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Add nvme subsystem reset IOCTL
Jon Derrick [Mon, 10 Aug 2015 21:20:41 +0000 (15:20 -0600)]
NVMe: Add nvme subsystem reset IOCTL

Controllers can perform optional subsystem resets as introduced in NVMe
1.1. This patch adds an IOCTL to trigger the subsystem reset by writing
"NVMe" to the NSSR register.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 81f03fedcce7ee7e83c37237ecaa2f68aad236fd)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Add nvme subsystem reset support
Keith Busch [Mon, 10 Aug 2015 21:20:40 +0000 (15:20 -0600)]
NVMe: Add nvme subsystem reset support

Controllers part of an NVMe subsystem may be reset by any other controller
in the subsystem. If the device is capable of subsystem resets, this
patch adds detection for such events and performs appropriate controller
initialization upon subsystem reset detection.

The register bit is a RW1C type, so the driver needs to write a 1 to the
status bit to clear the subsystem reset occured bit during initialization.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit dfbac8c7ac5f58448b2216fe42ff52aaf175421d)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe:Remove unreachable code in nvme_abort_req
Sunad Bhandary [Fri, 31 Jul 2015 13:26:58 +0000 (18:56 +0530)]
NVMe:Remove unreachable code in nvme_abort_req

Removing unreachable code from nvme_abort_req as nvme_submit_cmd has no
failure status to return.

Signed-off-by: Sunad Bhandary <sunad.s@samsung.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e3f879bf1ea3e03f433d292b0114807785f0754b)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: Fixes u64 division which breaks i386 builds
Jon Derrick [Tue, 21 Jul 2015 21:08:13 +0000 (15:08 -0600)]
nvme: Fixes u64 division which breaks i386 builds

Uses div_u64 for u64 division and round_down, a bitwise operation,
instead of rounddown, which uses a modulus.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit c45f5c9943ce0b16b299b543c2aae12408039027)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agoNVMe: Use CMB for the IO SQes if available
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>
9 years agoNVMe: Unify SQ entry writing and doorbell ringing
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>
9 years agoNVMe: Reread partitions on metadata formats
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>
9 years agoNVMe: Fix irq freeing when queue_request_irq fails
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>
9 years agoNVMe: Memory barrier before queue_count is incremented
Jon Derrick [Wed, 27 May 2015 18:26:23 +0000 (12:26 -0600)]
NVMe: Memory barrier before queue_count is incremented

Protects against reordering and/or preempting which would allow the
kthread to access the queue descriptor before it is set up

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 36a7e993eedb2c3f11de3b686b351f75e1edbbb5)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agodrivers/block/nvme-core.c: fix build with gcc-4.4.4
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>
9 years agoblock: nvme-scsi: Catch kcalloc failure
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.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 51ef72bda70841fddd595142ed0e7e0fc571c500)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: submit internal commands through the block layer
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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit d29ec8241c10eacf59c23b3828a88dbae06e7e3f)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Conflicts:
drivers/block/nvme-core.c

9 years agonvme: fail SCSI read/write command with unsupported protection bit
Christoph Hellwig [Fri, 22 May 2015 09:12:45 +0000 (11:12 +0200)]
nvme: fail SCSI read/write command with unsupported protection bit

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 772ce43559e076730ddff5907fabcb3485545e38)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: report the DPOFUA in MODE_SENSE
Christoph Hellwig [Fri, 22 May 2015 09:12:44 +0000 (11:12 +0200)]
nvme: report the DPOFUA in MODE_SENSE

NVMe device always support the FUA bit, and the SCSI translations
accepts the DPO bit, which doesn't have much of a meaning for us.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 908517684807f3b3d93893da78c7906f5ff2c49b)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: simplify and cleanup the READ/WRITE SCSI CDB parsing code
Christoph Hellwig [Fri, 22 May 2015 09:12:43 +0000 (11:12 +0200)]
nvme: simplify and cleanup the READ/WRITE SCSI CDB parsing code

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit cbbb7a2ec6001a0c15297c85184c9cc7fae5f11e)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: first round at deobsfucating the SCSI translation code
Christoph Hellwig [Fri, 22 May 2015 09:12:42 +0000 (11:12 +0200)]
nvme: first round at deobsfucating the SCSI translation code

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 3726897efde1d7a43b6f966ab81b0c143a176556)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: fix scsi translation error handling
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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e61b0a86cac83c3bf501705c8d52a0a29cecf091)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: split nvme_trans_send_fw_cmd
Christoph Hellwig [Fri, 22 May 2015 09:12:40 +0000 (11:12 +0200)]
nvme: split nvme_trans_send_fw_cmd

This function handles two totally different opcodes, so split it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit b90c48d0c11efe373a42a60e66e2ac2a503c287b)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agonvme: store a struct device pointer in struct nvme_dev
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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e75ec752d725b7b612c0b2db1bca50a9e53c0879)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Conflicts:
drivers/block/nvme-core.c

9 years agonvme: consolidate synchronous command submission helpers
Christoph Hellwig [Fri, 22 May 2015 09:12:38 +0000 (11:12 +0200)]
nvme: consolidate synchronous command submission helpers

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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit f705f837c58ebe1ea69dfffff4dcc234e2fbc8dd)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Conflicts:
drivers/block/nvme-core.c

9 years agohpsa: correct check for disk and zbc devices
Petros Koutoupis [Fri, 6 May 2016 19:18:37 +0000 (12:18 -0700)]
hpsa: correct check for disk and zbc devices

The check added always skips over every device and the
ioaccel parameters are never set.

Reviewed-by: Justin Lindley <Justin.Lindley@microsemi.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agohpsa: update driver version
Don Brace [Fri, 6 May 2016 19:18:17 +0000 (12:18 -0700)]
hpsa: update driver version

Reviewed-by: Gerry Morong <gerry.morong@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>
9 years agohpsa: correct handling of HBA device removal
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>
9 years agohpsa: correct ioaccel2 error procecssing.
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>
9 years agohpsa: correct ioaccel state change operation
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>
9 years agohpsa: add timeouts for driver initiated commands
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>
9 years agohpsa: add sas_address to sysfs device attibute
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>
9 years agohpsa: correct initialization order issue
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>
9 years agohpsa: update copyright information
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>
9 years agohpsa: add support for tagged queuing
Don Brace [Thu, 12 May 2016 18:13:07 +0000 (14:13 -0400)]
hpsa: add support for tagged queuing

Signed-off-by: Don Brace <don.brace@pmcs.com>
Orabug: 23064595
Signed-off-by: Manjunath <manjunath.govindashetty@oracle.com>
9 years agohpsa: check for a null phys_disk pointer in ioaccel2
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>
9 years agohpsa: correct abort tmf for hba devices
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>
9 years agohpsa: correct lun data caching bitmap definition
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>
9 years agohpsa: add SMR drive support
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>
9 years agohpsa: do not get enclosure info for external devices
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>
9 years agohpsa: Add box and bay information for enclosure
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>
9 years agohpsa: Change SAS transport devices to bus 0.
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>
9 years agohpsa: fix path_info_show
Don Brace [Fri, 6 May 2016 19:12:53 +0000 (12:12 -0700)]
hpsa: fix path_info_show

Left off some changes from Rasmus Villemoes where he changed snprintf to
scnprintf.

Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
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: Rasmus Villemoes <linux@rasmusvillemoes.dk>
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>
9 years agohpsa: logical vs bitwise AND typo
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>
9 years agoscsi: use host wide tags by default
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>
9 years agohpsa: bump the driver version
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>
9 years agohpsa: add in sas transport class
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>
9 years agohpsa: fix multiple issues in path_info_show
Rasmus Villemoes [Fri, 6 May 2016 19:11:09 +0000 (12:11 -0700)]
hpsa: fix multiple issues in path_info_show

path_info_show() seems to be broken in multiple ways.

First, there's

  817 return snprintf(buf, output_len+1, "%s%s%s%s%s%s%s%s",
  818       path[0], path[1], path[2], path[3],
  819       path[4], path[5], path[6], path[7]);

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

  767      output_len = snprintf(path[i],
  768                       PATH_STRING_LEN, "[%d:%d:%d:%d] %20.20s ",
  769                       h->scsi_host->host_no,
  770                       hdev->bus, hdev->target, hdev->lun,
  771                       scsi_device_type(hdev->devtype));

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:

  802                  output_len += snprintf(path[i] + output_len,
  803                          PATH_STRING_LEN,
  804                          "BOX: %hhu BAY: %hhu %s\n",
  805                          box, bay, active);

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>
9 years agohpsa: enhance device messages
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>
9 years agohpsa: disable report lun data caching
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>
9 years agohpsa: add discovery polling for PT RAID devices.
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>
9 years agohpsa: eliminate fake lun0 enclosures
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>
9 years agohpsa: generalize external arrays
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>
9 years agohpsa: move scsi_add_device and scsi_remove_device
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>
9 years agohpsa: refactor hpsa_figure_bus_target_lun
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>
9 years agohpsa: enhance hpsa_get_device_id
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>
9 years agohpsa: add function is_logical_device
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>
9 years agohpsa: simplify update scsi devices
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>
9 years agohpsa: simplify check for device exposure
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>
9 years agohpsa: correct ioaccel2 sg chain len
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>
9 years agohpsa: correct check for non-disk devices
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>
9 years agohpsa: fix physical target reset
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>
9 years agohpsa: fix hpsa_adjust_hpsa_scsi_table
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>
9 years agohpsa: correct transfer length for 6 byte read/write
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>
9 years agohpsa: abandon rescans on memory alloaction failures.
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>
9 years agohpsa: allow driver requested rescans
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>
9 years agohpsa: fix null device issues
Don Brace [Fri, 6 May 2016 19:04:35 +0000 (12:04 -0700)]
hpsa: fix null device issues

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Manoj Kumar <manoj@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>
9 years agohpsa: check for null arguments to dev_printk
Don Brace [Fri, 6 May 2016 19:04:15 +0000 (12:04 -0700)]
hpsa: check for null arguments to dev_printk

Check for NULLs.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Manoj Kumar <manoj@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>
9 years agohpsa: change devtype to unsigned
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>
9 years agohpsa: remove unused hpsa_tag_discard_error_bits
Don Brace [Fri, 6 May 2016 19:03:35 +0000 (12:03 -0700)]
hpsa: remove unused hpsa_tag_discard_error_bits

This function is no longer used.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Reviewed-by: Manoj Kumar <manoj@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>
9 years agohpsa: stop zeroing reset_cmds_out and
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>
9 years agohpsa: remove unused parameter hostno
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>
9 years agohpsa: add in new offline mode
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>
9 years agoChange how controllers in mixed mode are handled.
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>
9 years agohpsa: update controller names
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>
9 years agohpsa: fix an sprintf() overflow in the reset handler
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>
9 years agohpsa: correct white spaces
Don Brace [Fri, 6 May 2016 19:01:13 +0000 (12:01 -0700)]
hpsa: correct white spaces

helps eliminate a diff between kernel.org and uek driver

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 23064595
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Fix VLANs null-pointer for 57710, 57711
Yuval Mintz [Sun, 15 Nov 2015 13:02:16 +0000 (15:02 +0200)]
bnx2x: Fix VLANs null-pointer for 57710, 57711

Orabug: 23092424

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>
9 years agofnic: Leftshift returned scsi_cmnd error code 16 bits
Jason Luo [Thu, 17 Mar 2016 04:06:07 +0000 (12:06 +0800)]
fnic: Leftshift returned scsi_cmnd error code 16 bits

From: Satish Kharat <satishkh@cisco.com>

The the scsi_cmnd error code is expected to be in the left 16 bits
of the result field. Change is to correct this.

Signed-off-by: Satish Kharat <satishkh@cisco.com>
Orabug: 22918200
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agofnic: Setting scsi host template to indicate that fnic does not support multiqueue
Jason Luo [Thu, 17 Mar 2016 04:00:56 +0000 (12:00 +0800)]
fnic: Setting scsi host template to indicate that fnic does not support multiqueue

From: Satish Kharat <satishkh@cisco.com>

Fnic does not support mutiqueue. Setting the scsi_host_template in
fnic_host_template to indicate that.

Changing fnic_version from 1.6.0.21 to 1.6.0.22

Signed-off-by: Satish Kharat <satishkh@cisco.com>
Orabug: 22918200
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
9 years agofnic: Using rport-_dd_data to check rport online instead of rport_lookup
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>
9 years agofnic: Cleanup the I_O that has timed out and is used to issue LUN reset
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>
9 years agofnic: Fix to cleanup aborted IO to avoid device being offlined by mid-layer
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>
9 years agohpsa: move lockup_detected attribute to host attr
Tomas Henzl [Fri, 6 Nov 2015 15:24:09 +0000 (16:24 +0100)]
hpsa: move lockup_detected attribute to host attr

This patch fixes a 'general protection fault' issue by
moving the attribute to where it was likely meant.

Orabug: 22930824

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>
9 years agomegaraid_sas: Add an i/o barrier
Tomas Henzl [Mon, 1 Feb 2016 14:12:04 +0000 (15:12 +0100)]
megaraid_sas: Add an i/o barrier

Orabug: 22620626

A barrier should be added to ensure proper ordering of memory mapped
writes.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Kashyap Desai <kashyap.desai@broadcom.com>
Acked-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit b99dbe56d511eb07de33bfa1b99ac5a6ff76ae08)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Orabug : 22620626
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agomegaraid_sas: Fix SMAP issue
Sumit Saxena [Thu, 28 Jan 2016 15:44:26 +0000 (21:14 +0530)]
megaraid_sas: Fix SMAP issue

Orabug: 22620626

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>
9 years agomegaraid_sas: Fix for IO failing post OCR in SRIOV environment
Sumit Saxena [Thu, 28 Jan 2016 15:44:25 +0000 (21:14 +0530)]
megaraid_sas: Fix for IO failing post OCR in SRIOV environment

Orabug: 22620626

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>
9 years agomegaraid: fix null pointer check in megasas_detach_one().
Maurizio Lombardi [Fri, 22 Jan 2016 12:41:42 +0000 (13:41 +0100)]
megaraid: fix null pointer check in megasas_detach_one().

Orabug: 22620626

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>
9 years agomegaraid_sas: driver version upgrade
Sumit Saxena [Thu, 28 Jan 2016 15:34:36 +0000 (21:04 +0530)]
megaraid_sas: driver version upgrade

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 d92ca9d3de862cb123d7ef0fd42dc1e9867dd590)
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
9 years agomegaraid_sas: SPERC OCR changes
Sumit Saxena [Thu, 28 Jan 2016 15:34:35 +0000 (21:04 +0530)]
megaraid_sas: SPERC OCR changes

Orabug: 22620626

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>
9 years agomegaraid_sas: Introduce module parameter for SCSI command timeout
Sumit Saxena [Thu, 28 Jan 2016 15:34:34 +0000 (21:04 +0530)]
megaraid_sas: Introduce module parameter for SCSI command timeout

Orabug: 22620626

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>
9 years agomegaraid_sas: MFI adapter OCR changes
Sumit Saxena [Thu, 28 Jan 2016 15:34:33 +0000 (21:04 +0530)]
megaraid_sas: MFI adapter OCR changes

Orabug: 22620626

Optimized MFI adapters' OCR path, particularly
megasas_wait_for_outstanding() function.

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>
9 years agomegaraid_sas: Make adprecovery variable atomic
Sumit Saxena [Thu, 28 Jan 2016 15:34:32 +0000 (21:04 +0530)]
megaraid_sas: Make adprecovery variable atomic

Orabug: 22620626

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>