]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
10 years ago[SCSI] hpsa: update driver version to 3.4.4-1
Stephen M. Cameron [Thu, 13 Mar 2014 22:13:06 +0000 (17:13 -0500)]
[SCSI] hpsa: update driver version to 3.4.4-1

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: fix bad endif placement in RAID 5 mapper code
Stephen M. Cameron [Thu, 13 Mar 2014 22:12:50 +0000 (17:12 -0500)]
[SCSI] hpsa: fix bad endif placement in RAID 5 mapper code

It caused the i/o request to always be counted as ineligible for
the accelerated i/o path on 32 bit systems and negatively affected
performance.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla2xxx: Fix build errors related to invalid print fields on some architectures.
Chad Dupuis [Thu, 13 Mar 2014 18:16:40 +0000 (14:16 -0400)]
[SCSI] qla2xxx: Fix build errors related to invalid print fields on some architectures.

Fixes some build warnings such as:
drivers/scsi/qla2xxx/qla_attr.c:162:6: warning: format '%lx' expects argument of
type 'long unsigned int', but argument 6 has type 'size_t'"
and
drivers/scsi/qla2xxx/qla_init.c:5198:7: warning: format '%lx' expects argument
of type 'long unsigned int', but argument 5 has type 'uint32_t' [-Wformat]

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] bfa: Replace large udelay() with mdelay()
Ben Hutchings [Sun, 9 Mar 2014 04:04:18 +0000 (04:04 +0000)]
[SCSI] bfa: Replace large udelay() with mdelay()

udelay() does not work on some architectures for values above
2000, in particular on ARM:

ERROR: "__bad_udelay" [drivers/scsi/bfa/bfa.ko] undefined!

Reported-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] vmw_pvscsi: Some improvements in pvscsi driver.
Arvind Kumar [Sat, 8 Mar 2014 21:04:45 +0000 (13:04 -0800)]
[SCSI] vmw_pvscsi: Some improvements in pvscsi driver.

This change is about the following:
(1) If the number of targets is 16+ then default ring_pages to 32.
(2) Change default queue depth (per device) to 254.
(3) Implement change_queue_depth function so that queue_depth per device can
    be changed at run time. Honors the request only if coming from sysfs.
(4) Clean up the info returned by modinfo.

Signed-off-by: Arvind Kumar <arvindkumar@vmware.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] vmw_pvscsi: Add support for I/O requests coalescing.
Rishi Mehta [Tue, 11 Mar 2014 20:51:33 +0000 (13:51 -0700)]
[SCSI] vmw_pvscsi: Add support for I/O requests coalescing.

This change allows pvscsi driver to coalesce I/O requests
before issuing them. The number of I/O's coalesced can be
dynamically configured based on the workload.

Signed-off-by: Rishi Mehta <rmehta@vmware.com>
Signed-off-by: Arvind Kumar <arvindkumar@vmware.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] vmw_pvscsi: Fix pvscsi_abort() function.
Arvind Kumar [Sat, 8 Mar 2014 20:51:12 +0000 (12:51 -0800)]
[SCSI] vmw_pvscsi: Fix pvscsi_abort() function.

This change ensures that pvscsi_abort() function returns SUCCESS
only when the command in question was actually completed, otherwise
returns FAILURE. The code before change, was causing a bug where
driver tries to complete a command to the mid-layer while the mid-layer
has already requested the driver to abort that command, in response
to which the driver has responded with SUCCESS causing mid-layer
to free the command struct.

Signed-off-by: Arvind Kumar <arvindkumar@vmware.com>
Tested-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] remove deprecated IRQF_DISABLED from SCSI
Michael Opdenacker [Wed, 5 Mar 2014 05:09:41 +0000 (06:09 +0100)]
[SCSI] remove deprecated IRQF_DISABLED from SCSI

It's a NOOP since 2.6.35 and it will be removed one day.

[jejb: remove from missed arm scsi drivers]
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] bfa: Updating Maintainers email ids
Anil Gurumurthy [Wed, 26 Feb 2014 11:08:42 +0000 (06:08 -0500)]
[SCSI] bfa: Updating Maintainers email ids

Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] ipr: Add new CCIN definition for Grand Canyon support
Wendy Xiong [Wed, 12 Mar 2014 21:08:52 +0000 (16:08 -0500)]
[SCSI] ipr: Add new CCIN definition for Grand Canyon support

Add the appropriate definition and table entry for new hardware support.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] ipr: Format HCAM overlay ID 0x21
Wendy Xiong [Wed, 12 Mar 2014 21:08:51 +0000 (16:08 -0500)]
[SCSI] ipr: Format HCAM overlay ID 0x21

This patch adds formatting error overlay 0x21 to improve debug capabilities.

[jejb: checkpatch fixes]
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] ipr: Use pci_enable_msi_range() and pci_enable_msix_range()
Alexander Gordeev [Wed, 12 Mar 2014 21:08:50 +0000 (16:08 -0500)]
[SCSI] ipr: Use pci_enable_msi_range() and pci_enable_msix_range()

As result deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range() and pci_enable_msix_range()
interfaces.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] ipr: Get rid of superfluous call to pci_disbale_msi/msix()
Alexander Gordeev [Wed, 12 Mar 2014 21:08:49 +0000 (16:08 -0500)]
[SCSI] ipr: Get rid of superfluous call to pci_disbale_msi/msix()

There is no need to call pci_disable_msi() or pci_disable_msix()
in case the call to pci_enable_msi() or pci_enable_msix() failed.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] ipr: Handle early EEH
Brian King [Tue, 21 Jan 2014 18:16:41 +0000 (12:16 -0600)]
[SCSI] ipr: Handle early EEH

If, when the ipr driver loads, the adapter is in an EEH error state,
it will currently oops and not be able to recover, as it attempts
to access memory that has not yet been allocated. We've seen this
occur in some kexec scenarios. The following patch fixes the oops
and also allows the driver to recover from these probe time EEH errors.

[jejb: checkpatch fix]
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] ipr: Add new CCIN definition for new hardware support
Wendy Xiong [Tue, 21 Jan 2014 18:16:40 +0000 (12:16 -0600)]
[SCSI] ipr: Add new CCIN definition for new hardware support

Add the appropriate definition and table entry for new hardware support.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] ipr: Remove extended delay bit on GSCSI reads/writes ops
Wendy Xiong [Tue, 21 Jan 2014 18:16:39 +0000 (12:16 -0600)]
[SCSI] ipr: Remove extended delay bit on GSCSI reads/writes ops

This patch removes extended delay bit on GSCSI reads/writes ops, the
performance will be significanly better.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] scsi_debug: add ability to enable clustering
Akinobu Mita [Wed, 26 Feb 2014 13:57:04 +0000 (22:57 +0900)]
[SCSI] scsi_debug: add ability to enable clustering

This adds a module parameter to enable clustering.

Without enabling clustering support, the transfer length for read and
write scsi commands is limited upto 8MB when page size is 4KB and
sg_tablesize is 2048 (= SCSI_MAX_SG_CHAIN_SEGMENTS).  I would like to
test commands with more than that transfer length.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] scsi_debug: protect device access with atomic_rw lock
Akinobu Mita [Wed, 26 Feb 2014 13:57:03 +0000 (22:57 +0900)]
[SCSI] scsi_debug: protect device access with atomic_rw lock

This change ensures that concurrent device access including ramdisk
storage, protection info, and provisioning map by read, write, and
unmap commands are protected with atomic_rw spinlock.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] scsi_debug: prepare to enable clustering
Akinobu Mita [Wed, 26 Feb 2014 13:57:02 +0000 (22:57 +0900)]
[SCSI] scsi_debug: prepare to enable clustering

Currently, clustering support for scsi_debug is disabled.  This is
because there are for_each_sg() loops which assume that each sg list
element is consisted with a single page.  But enabling clustering
support, each sg list element for scsi commands can be consisted with
multiple pages.

This replaces these for_each_sg() loops with sg mapping iterator which
is capable of handling each sg list element is consisted with multiple
pages.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] scsi_debug: fix resp_xdwriteread() return value when running out of memory
Akinobu Mita [Wed, 26 Feb 2014 13:57:01 +0000 (22:57 +0900)]
[SCSI] scsi_debug: fix resp_xdwriteread() return value when running out of memory

When resp_xdwriteread() can't allocate temporary buffer, it returns -1.
But the return value is used as scsi status code and -1 is not
interpreted as correct code.

target_core_mod has similar xdwriteread emulation code. So this mimics
what target_core_mod does for xdwriteread when running out of memory.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] scsi_debug: fix duplicate dif_errors increment
Akinobu Mita [Wed, 26 Feb 2014 13:57:00 +0000 (22:57 +0900)]
[SCSI] scsi_debug: fix duplicate dif_errors increment

It is unnecessary to increase dif_errors in dif_verify(), because the
caller will increment it when dif_verify() detects failure.

This bug was introduced by commit beb40ea42bd6 ("[SCSI] scsi_debug:
reduce duplication between prot_verify_read and prot_verify_write")

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] scsi_debug: make pseudo_primary static
Akinobu Mita [Wed, 26 Feb 2014 13:56:59 +0000 (22:56 +0900)]
[SCSI] scsi_debug: make pseudo_primary static

As pseudo_primary is only used in scsi_debug.c, it should be static.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] scsi_debug: fix false positive logical block reference tag check fail
Akinobu Mita [Wed, 26 Feb 2014 13:56:58 +0000 (22:56 +0900)]
[SCSI] scsi_debug: fix false positive logical block reference tag check fail

Reading partially unwritten sectors generates a false positive logical
block reference tag check failure when DIF is enabled.

This bug is caused by missing ei_lba increment in loop of dif_verify()
when unwritten sector is skipped.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] remove a useless get/put_device pair in scsi_requeue_command
Christoph Hellwig [Thu, 20 Feb 2014 22:20:58 +0000 (14:20 -0800)]
[SCSI] remove a useless get/put_device pair in scsi_requeue_command

Avoid a spurious device get/put pair by cleaning up scsi_requeue_command
and folding scsi_unprep_request into it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] remove a useless get/put_device pair in scsi_next_command
Bart Van Assche [Thu, 20 Feb 2014 22:20:57 +0000 (14:20 -0800)]
[SCSI] remove a useless get/put_device pair in scsi_next_command

Eliminate a get_device() / put_device() pair from scsi_next_command().
Both are atomic operations hence removing these slightly improves
performance.

[hch: slight changes due to different context]
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] remove a useless get/put_device pair in scsi_request_fn
Bart Van Assche [Thu, 20 Feb 2014 22:20:56 +0000 (14:20 -0800)]
[SCSI] remove a useless get/put_device pair in scsi_request_fn

SCSI devices may only be removed by calling scsi_remove_device().
That function must invoke blk_cleanup_queue() before the final put
of sdev->sdev_gendev. Since blk_cleanup_queue() waits for the
block queue to drain and then tears it down, scsi_request_fn cannot
be active anymore after blk_cleanup_queue() has returned and hence
the get_device()/put_device() pair in scsi_request_fn is unnecessary.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] do not manipulate device reference counts in scsi_get/put_command
Christoph Hellwig [Thu, 20 Feb 2014 22:20:55 +0000 (14:20 -0800)]
[SCSI] do not manipulate device reference counts in scsi_get/put_command

Many callers won't need this and we can optimize them away.  In addition
the handling in the __-prefixed variants was inconsistant to start with.

Based on an earlier patch from Bart Van Assche.

[jejb: fix kerneldoc probelm picked up by Fengguang Wu]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] avoid taking host_lock in scsi_run_queue unless nessecary
Christoph Hellwig [Thu, 20 Feb 2014 22:20:54 +0000 (14:20 -0800)]
[SCSI] avoid taking host_lock in scsi_run_queue unless nessecary

If we don't have starved devices we don't need to take the host lock
to iterate over them.  Also split the function up to be more clear.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] avoid useless free_list lock roundtrips
Christoph Hellwig [Thu, 20 Feb 2014 22:20:53 +0000 (14:20 -0800)]
[SCSI] avoid useless free_list lock roundtrips

Avoid hitting the host-wide free_list lock unless we need to put a command
back onto the freelist.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: Do not zero fields of ioaccel2 command structure twice
Stephen M. Cameron [Fri, 21 Feb 2014 22:25:21 +0000 (16:25 -0600)]
[SCSI] hpsa: Do not zero fields of ioaccel2 command structure twice

Structure was already memset to zero at the top
of hpsa_scsi_ioaccel2_queue_command

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: Add hba mode to the hpsa driver
Stephen M. Cameron [Fri, 21 Feb 2014 22:25:15 +0000 (16:25 -0600)]
[SCSI] hpsa: Add hba mode to the hpsa driver

This allows exposing physical disks behind Smart
Array controllers to the OS (if the controller
has the right firmware and is in "hba" mode)

Signed-off-by: Joe Handzik <joseph.t.handzik@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: remove unused struct request from CommandList
Stephen M. Cameron [Fri, 21 Feb 2014 22:25:10 +0000 (16:25 -0600)]
[SCSI] hpsa: remove unused struct request from CommandList

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: increase the probability of a reported success after a device reset
Tomas Henzl [Fri, 21 Feb 2014 22:25:05 +0000 (16:25 -0600)]
[SCSI] hpsa: increase the probability of a reported success after a device reset

rc is set in the loop, and it isn't set back to zero anywhere
this patch fixes it

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: bring format-in-progress drives online when ready
Stephen M. Cameron [Fri, 21 Feb 2014 22:25:00 +0000 (16:25 -0600)]
[SCSI] hpsa: bring format-in-progress drives online when ready

Do not expose drives that are undergoing a format immediately
to the OS, instead wait until they are ready before bringing
them online.  This is so that logical drives created with
"rapid parity initialization" do not get immediately kicked
off the system for being unresponsive.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: remove unused kthread.h header
Stephen M. Cameron [Fri, 21 Feb 2014 22:24:54 +0000 (16:24 -0600)]
[SCSI] hpsa: remove unused kthread.h header

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE
Alan Stern [Wed, 15 Jan 2014 20:37:04 +0000 (15:37 -0500)]
[SCSI] sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE

Evidently some wacky USB-ATA bridges don't recognize the SYNCHRONIZE
CACHE command, as shown in this email thread:

http://marc.info/?t=138978356200002&r=1&w=2

The fact that we can't tell them to drain their caches shouldn't
prevent the system from going into suspend.  Therefore sd_sync_cache()
shouldn't return an error if the device replies with an Invalid
Command ASC.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Sven Neumann <s.neumann@raumfeld.com>
Tested-by: Daniel Mack <zonque@gmail.com>
CC: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] pm80xx: fix problem of pm8001_work_fn reseting incorrect phy device
XinHong Zhu [Fri, 14 Feb 2014 08:01:28 +0000 (16:01 +0800)]
[SCSI] pm80xx: fix problem of pm8001_work_fn reseting incorrect phy device

If a phy device is removed, the device can get error of I/O and HBA maybe
receieve IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS of event which causes pm8001_work_fn
to reset the phy device but in pm8001_task_exec we don't assign a value for
the device field of the ccb and in other case a ccb used have device field
set, when ccb is freed the field device of the ccb don't be set NULL.So there
is possibility of getting another device reset in function mpi_ssp_completion.

Signed-off-by: zhuxh <zxh3737@163.com>
Acked-by: Lindar Liu <lindar_liu@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] pm80xx: no need for tag allocation when issuing the command of unregistering...
XinHong Zhu [Thu, 13 Feb 2014 03:59:38 +0000 (11:59 +0800)]
[SCSI] pm80xx: no need for tag allocation when issuing the command of unregistering device

In function pm8001_dev_gone_notify we consume a tag from bitmap resource and
later don't free that tag resource, so the tag resource will never be
freed. In the function we don't need to use any tag to issue command for
unregistering the device .

Signed-off-by: XinHong Zhu <zxh3737@163.com>
Acked-by: Lindar Liu <lindar_liu@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] st: fix corruption of the st_modedef structures in st_set_options()
Maurizio Lombardi [Tue, 11 Feb 2014 21:22:47 +0000 (22:22 +0100)]
[SCSI] st: fix corruption of the st_modedef structures in st_set_options()

When copying the st_modedef structures the devs pointers must be preserved
in the same way as with the cdevs pointers.

This fixes bug 70271: https://bugzilla.kernel.org/show_bug.cgi?id=70271

[  135.037052] BUG: unable to handle kernel NULL pointer dereference at 0000000000000098
[  135.045048] IP: [<ffffffff812af6a1>] kernfs_find_ns+0x21/0x150
[  135.050999] PGD 220623067 PUD 222171067 PMD 0
[  135.055593] Oops: 0000 [#1] SMP
[  135.058938] Modules linked in: bnx2fc cnic uio fcoe libfcoe libfc 8021q mrp scsi_transport_fc garp scsi_tgt stp llc binfmt_misc dm_round_robin dm_multipath uinput iTCO_wdt iTCO_vendor_support microcode sg pcspkr serio_raw osst st(-) i2c_i801 lpc_ich mfd_core e1000e ptp pps_core ipmi_si ipmi_msghandler video tpm_infineon ext4(F) jbd2(F) mbcache(F) sd_mod(F) crc_t10dif(F) crct10dif_common(F) sr_mod(F) cdrom(F) pata_acpi(F) ata_generic(F) ata_piix(F) libata(F) mpt2sas(F) scsi_transport_sas(F) raid_class(F) ast(F) ttm(F) drm_kms_helper(F) drm(F) i2c_algo_bit(F) sysimgblt(F) sysfillrect(F) i2c_core(F) syscopyarea(F) dm_mirror(F) dm_region_hash(F) dm_log(F) dm_mod(F)
[  135.119686] CPU: 2 PID: 2028 Comm: rmmod Tainted: GF            3.14.0-rc1-linux-mainline+ #14
[  135.128453] Hardware name: wortmann To be filled by O.E.M./P8B-M Series, BIOS 6103 12/06/2012
[  135.137127] task: ffff880001de29d0 ti: ffff8802206e4000 task.ti: ffff8802206e4000
[  135.144742] RIP: 0010:[<ffffffff812af6a1>]  [<ffffffff812af6a1>] kernfs_find_ns+0x21/0x150
[  135.153148] RSP: 0018:ffff8802206e5c98  EFLAGS: 00010282
[  135.158562] RAX: ffff880001de29d0 RBX: 0000000000000000 RCX: 0000000000000006
[  135.165814] RDX: 0000000000000000 RSI: ffffffff817627e0 RDI: 0000000000000000
[  135.173040] RBP: ffff8802206e5cc8 R08: 0000000000000000 R09: 0000000000000001
[  135.180303] R10: 0000000000000000 R11: 0000000000000001 R12: ffffffff817627e0
[  135.187554] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000001
[  135.194774] FS:  00007f817c720700(0000) GS:ffff880227200000(0000) knlGS:0000000000000000
[  135.202995] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  135.208878] CR2: 0000000000000098 CR3: 00000002219b0000 CR4: 00000000000407e0
[  135.216139] Stack:
[  135.218185]  ffffffff81af63a0 0000000000000000 ffffffff817627e0 0000000000000000
[  135.225783]  0000000000000000 0000000000000001 ffff8802206e5cf8 ffffffff812af8de
[  135.233347]  ffff880226801900 ffffffff81b43320 0000000000000000 ffff880221a7c1c0
[  135.240972] Call Trace:
[  135.243463]  [<ffffffff812af8de>] kernfs_find_and_get_ns+0x3e/0x70
[  135.249743]  [<ffffffff812ae27d>] sysfs_unmerge_group+0x1d/0x60
[  135.255716]  [<ffffffff81464da9>] pm_qos_sysfs_remove_latency+0x19/0x20
[  135.262430]  [<ffffffff81466a91>] dev_pm_qos_constraints_destroy+0x31/0x1e0
[  135.269500]  [<ffffffff81464de6>] dpm_sysfs_remove+0x16/0x50
[  135.275263]  [<ffffffff8145c077>] device_del+0x47/0x1e0
[  135.280554]  [<ffffffff8145c232>] device_unregister+0x22/0x60
[  135.286406]  [<ffffffffa02e23bd>] remove_cdevs+0x4d/0x90 [st]
[  135.292247]  [<ffffffffa02e78ff>] st_remove+0x3f/0xb0 [st]
[  135.297851]  [<ffffffff8145f39f>] __device_release_driver+0x7f/0xf0
[  135.304237]  [<ffffffff8145f4e8>] driver_detach+0xd8/0xe0
[  135.309722]  [<ffffffff8145e0fc>] bus_remove_driver+0x5c/0xd0
[  135.315553]  [<ffffffff81460170>] driver_unregister+0x30/0x70
[  135.321366]  [<ffffffffa02e97f4>] exit_st+0x5c/0x868 [st]
[  135.326861]  [<ffffffff8111b31a>] SyS_delete_module+0x19a/0x1f0
[  135.332891]  [<ffffffff810e336d>] ? trace_hardirqs_on+0xd/0x10
[  135.338811]  [<ffffffff81141974>] ? __audit_syscall_entry+0x94/0x100
[  135.345282]  [<ffffffff8135b1fe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[  135.351806]  [<ffffffff816e8de9>] system_call_fastpath+0x16/0x1b
[  135.357859] Code: ff eb e3 0f 1f 80 00 00 00 00 55 48 89 e5 48 83 ec 30 48 89 5d d8 4c 89 65 e0 4c 89 6d e8 4c 89 75 f0 4c 89 7d f8 66 66 66 66 90 <44> 0f b7 bf 98 00 00 00 8b 05 71 6d 87 00 48 89 fb 49 89 f4 49
[  135.378282] RIP  [<ffffffff812af6a1>] kernfs_find_ns+0x21/0x150
[  135.384355]  RSP <ffff8802206e5c98>
[  135.387881] CR2: 0000000000000098
[  135.391298] ---[ end trace 1968409221ddb3c8 ]---

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Version and Changelog update
adam radford [Mon, 10 Mar 2014 09:52:03 +0000 (02:52 -0700)]
[SCSI] megaraid_sas: Version and Changelog update

The following patch for megaraid_sas updates the driver version to
v06.803.01.00-rc1, and updates Documentation/scsi/ChangeLog.megaraid_sas.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Add Dell PowerEdge VRTX SR-IOV VF support
adam radford [Mon, 10 Mar 2014 09:51:56 +0000 (02:51 -0700)]
[SCSI] megaraid_sas: Add Dell PowerEdge VRTX SR-IOV VF support

The following patch for megaraid_sas adds Dell PowerEdge VRTS SR-IOV VF
support (Device ID 0x002f).

This patch has some > 80 column lines that need to be left in place
for code readability purposes.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Return leaked MPT frames to MPT frame pool
adam radford [Mon, 10 Mar 2014 09:51:45 +0000 (02:51 -0700)]
[SCSI] megaraid_sas: Return leaked MPT frames to MPT frame pool

The following patch for megaraid_sas will return leaked MPT frames from any
polled DCMD's that timeout to the MPT frame pool.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Fix megasas_ioc_init_fusion
adam radford [Mon, 10 Mar 2014 09:51:36 +0000 (02:51 -0700)]
[SCSI] megaraid_sas: Fix megasas_ioc_init_fusion

The following patch for megaraid_sas fixes the megasas_ioc_init_fusion
function to use a local stack variable for the IOCinit frame physical address
instead of clobbering the first request descriptor.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Load correct raid context timeout
adam radford [Mon, 10 Mar 2014 09:51:28 +0000 (02:51 -0700)]
[SCSI] megaraid_sas: Load correct raid context timeout

The following patch for megaraid_sas loads the correct raid context timeout
value for multpathing and clustering.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Performance boost fixes
Sumit.Saxena@lsi.com [Sat, 1 Mar 2014 23:58:11 +0000 (05:28 +0530)]
[SCSI] megaraid_sas: Performance boost fixes

Host lock is added back around queuecommand. Host lock removal can create race
conditon between ISR path(when RAID map update interrupt is raised) and IO
build path of driver, since IO build path is making use of RAID map, and in
case of RAID map update interrupt, old RAID map copy is memset to zero, which
some IOs may be referencing in build IO path.  Changes done for performance
boost- 1) Added code to set SMP IRQ affinity per CPU.  2) Pass MSI-x index,
while issuing sysPD IO.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Set 32-bit DMA mask
Sumit.Saxena@lsi.com [Wed, 12 Feb 2014 18:08:44 +0000 (23:38 +0530)]
[SCSI] megaraid_sas: Set 32-bit DMA mask

If consistent DMA mask is set to 64 bit, fall back to 32bit DMA mask and 32bit consistent DMA mask.
64bit consistent DMA mask may be set on some 64bit DMA slot, which causes DMA offset "10000000000000" and
MFI_INIT and IOCTL frames will have high memory addresses, leads to firmware FAULT.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Big endian code related fixes
Sumit.Saxena@lsi.com [Wed, 12 Feb 2014 18:07:46 +0000 (23:37 +0530)]
[SCSI] megaraid_sas: Big endian code related fixes

Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: Don't wait forever for non-IOCTL DCMDs
Sumit.Saxena@lsi.com [Wed, 12 Feb 2014 18:06:15 +0000 (23:36 +0530)]
[SCSI] megaraid_sas: Don't wait forever for non-IOCTL DCMDs

Don't wait forever for firmware response for internal DCMDs sent from driver
firmware. Such DCMDs will be posted to firmware with timeout. Timeout is also
introduced for DCMD sent to abort the commands. DCMD sent via IOCTL path will
still be always blocking to keep the IOCTL design intact.

Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] arcmsr: upper 32 of dma address lost
Dan Carpenter [Tue, 11 Feb 2014 16:06:33 +0000 (19:06 +0300)]
[SCSI] arcmsr: upper 32 of dma address lost

The original code always set the upper 32 bits to zero because it was
doing a shift of the wrong variable.

Fixes: 1a4f550a09f8 ('[SCSI] arcmsr: 1.20.00.15: add SATA RAID plus other fixes')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] Add timeout to avoid infinite command retry
Eiichi Tsukata [Tue, 11 Feb 2014 05:29:52 +0000 (14:29 +0900)]
[SCSI] Add timeout to avoid infinite command retry

Currently, scsi error handling in scsi_io_completion() tries to
unconditionally requeue scsi command when device keeps some error state.
For example, UNIT_ATTENTION causes infinite retry with
action == ACTION_RETRY.
This is because retryable errors are thought to be temporary and the scsi
device will soon recover from those errors. Normally, such retry policy is
appropriate because the device will soon recover from temporary error state.

But there is no guarantee that device is able to recover from error state
immediately. Some hardware error can prevent device from recovering.

This patch adds timeout in scsi_io_completion() to avoid infinite command
retry in scsi_io_completion(). Once scsi command retry time is longer than
this timeout, the command is treated as failure.

Signed-off-by: Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] iscsi_tcp: check for valid session before accessing
Mike Christie [Fri, 7 Feb 2014 06:41:42 +0000 (00:41 -0600)]
[SCSI] iscsi_tcp: check for valid session before accessing

Check that the session is setup before accessing its
connection. This fixes a oops where userspace tries
to get the ip address before the session is bound to
a host.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] iscsi_boot_sysfs: Fix a memory leak in iscsi_boot_destroy_kset()
Ethan Zhao [Fri, 7 Feb 2014 06:41:41 +0000 (00:41 -0600)]
[SCSI] iscsi_boot_sysfs: Fix a memory leak in iscsi_boot_destroy_kset()

Load and unload iscsi_ibft module will cause kernel memory leak, fix it
in scsi/iscsi_boot_sysfs.c iscsi_boot_destroy_kset().

Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] libiscsi: remove unneeded queue work when max_cmdsn is increased
Mike Christie [Fri, 7 Feb 2014 06:41:39 +0000 (00:41 -0600)]
[SCSI] libiscsi: remove unneeded queue work when max_cmdsn is increased

iscsi_queuecommand will only take in commands that can fit in the
current window. So, if a command is on the cmdqueue then it can
fit in the current window. If a command is on the mgmtqueue, then
we are setting the immediate bit so they will also fit in the
window. As a result, we never need to to do a iscsi_conn_queue_work
when the maxCmdSn is increased.

What should happen is that a command will complete the window will
be increased, then the scsi layer will send us more commands by
running the scsi_device queues.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] libiscsi: Reduce locking contention in fast path
Shlomo Pongratz [Fri, 7 Feb 2014 06:41:38 +0000 (00:41 -0600)]
[SCSI] libiscsi: Reduce locking contention in fast path

Replace the session lock with two locks, a forward lock and
a backwards lock named frwd_lock and back_lock respectively.

The forward lock protects resources that change while sending a
request to the target, such as cmdsn, queued_cmdsn, and allocating
task from the commands' pool with kfifo_out.

The backward lock protects resources that change while processing
a response or in error path, such as cmdsn_exp, cmdsn_max, and
returning tasks to the commands' pool with kfifo_in.

Under a steady state fast-path situation, that is when one
or more processes/threads submit IO to an iscsi device and
a single kernel upcall (e.g softirq) is dealing with processing
of responses without errors, this patch eliminates the contention
between the queuecommand()/request response/scsi_done() flows
associated with iscsi sessions.

Between the forward and the backward locks exists a strict locking
hierarchy. The mutual exclusion zone protected by the forward lock can
enclose the mutual exclusion zone protected by the backward lock but not
vice versa.

For example, in iscsi_conn_teardown or in iscsi_xmit_data when there is
a failure and __iscsi_put_task is called, the backward lock is taken while
the forward lock is still taken. On the other hand, if in the RX path a nop
is to be sent, for example in iscsi_handle_reject or __iscsi_complete_pdu
than the forward lock is released and the backward lock is taken for the
duration of iscsi_send_nopout, later the backward lock is released and the
forward lock is retaken.

libiscsi_tcp uses two kernel fifos the r2t pool and the r2t queue.

The insertion and deletion from these queues didn't corespond to the
assumption taken by the new forward/backwards session locking paradigm.

That is, in iscsi_tcp_clenup_task which belongs to the RX (backwards)
path, r2t is taken out from r2t queue and inserted to the r2t pool.
In iscsi_tcp_get_curr_r2t which belong to the TX (forward) path, r2t
is also inserted to the r2t pool and another r2t is pulled from r2t
queue.

Only in iscsi_tcp_r2t_rsp which is called in the RX path but can requeue
to the TX path, r2t is taken from the r2t pool and inserted to the r2t
queue.

In order to cope with this situation, two spin locks were added,
pool2queue and queue2pool. The former protects extracting from the
r2t pool and inserting to the r2t queue, and the later protects the
extracing from the r2t queue and inserting to the r2t pool.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
[minor fix up to apply cleanly and compile fix]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] libiscsi: Restructure iscsi_tcp r2t response logic
Shlomo Pongratz [Fri, 7 Feb 2014 06:41:37 +0000 (00:41 -0600)]
[SCSI] libiscsi: Restructure iscsi_tcp r2t response logic

Restructure the iscsi_tcp_r2t_rsp routine in order to avoid allocating
r2t from r2tpool.queue and returning it back in case the parameters
rhdr->data_length and or rhdr->data_offset prohibit the requing.

Since the values of these parameters are known prior to the allocation,
we can pre-check and thus avoid futile allocations.

[jejb: checkpatch fixes]
Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] cxgb4i: Use cxgb4_select_ntuple to correctly calculate ntuple fields
Karen Xie [Wed, 29 Jan 2014 01:01:37 +0000 (17:01 -0800)]
[SCSI] cxgb4i: Use cxgb4_select_ntuple to correctly calculate ntuple fields

Fixed calculates wrong tuple values on T5 adapter: switch to use the exported
API cxgb4_select_ntuple() from cxgb4 base driver.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas: check return value for megasas_get_pd_list()
Hannes Reinecke [Thu, 16 Jan 2014 10:25:36 +0000 (11:25 +0100)]
[SCSI] megaraid_sas: check return value for megasas_get_pd_list()

When megasas_get_pd_list() fails we cannot detect any drives,
so we should be checking the return value accordingly.

[jejb: checkpatch fix]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas_fusion: Return correct error value in megasas_get_ld_map_info()
Hannes Reinecke [Thu, 16 Jan 2014 10:25:35 +0000 (11:25 +0100)]
[SCSI] megaraid_sas_fusion: Return correct error value in megasas_get_ld_map_info()

When no HBA is found we should be returning '-ENXIO' to be consistent
with the other return values.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] megaraid_sas_fusion: correctly pass queue info pointer
Hannes Reinecke [Thu, 16 Jan 2014 10:25:33 +0000 (11:25 +0100)]
[SCSI] megaraid_sas_fusion: correctly pass queue info pointer

The pointer to the queue info structure is potentially
a 64-bit value, so we should be using the correct macros
to set the values in the init frame.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] isci: update version to 1.2
Lukasz Dorau [Thu, 23 Jan 2014 09:52:01 +0000 (10:52 +0100)]
[SCSI] isci: update version to 1.2

The version of isci driver has not been updated for 2 years.
It was 83 isci commits ago. Suspend/resume support has been implemented
and many bugs have been fixed since 1.1. Now update the version to 1.2.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] bfa: set correct command return code
Hannes Reinecke [Tue, 14 Jan 2014 09:26:25 +0000 (10:26 +0100)]
[SCSI] bfa: set correct command return code

For various error conditions the bfa driver just returns
'DID_ERROR', which carries no information at all about the
actual source of error.
This patch updates the error handling to return a correct
error code, depending on the type of error occurred.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Update driver version to 5.04.00-k4
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:54 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Update driver version to 5.04.00-k4

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Fix sparse warnings
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:53 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix sparse warnings

Fix following sparse warnings:-
 drivers/scsi/qla4xxx/ql4_os.c:2109:33: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)
 drivers/scsi/qla4xxx/ql4_os.c:2306:33: warning: cast truncates bits from constant value (ffff7fff becomes 7fff)

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Handle IPv6 AEN notifications
Nilesh Javali [Mon, 16 Dec 2013 11:49:52 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Handle IPv6 AEN notifications

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Update print statements in func qla4xxx_do_dpc()
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:51 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Update print statements in func qla4xxx_do_dpc()

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Update print statements in func qla4xxx_eh_abort()
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:50 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Update print statements in func qla4xxx_eh_abort()

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Update print statements in qla4xxx_mailbox_command()
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:49 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Update print statements in qla4xxx_mailbox_command()

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Updated print for device login, logout path
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:48 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Updated print for device login, logout path

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Remove unused code from qla4xxx_set_ifcb()
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:47 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Remove unused code from qla4xxx_set_ifcb()

Removing unused code as FW does not need any value in mbox-5.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Fix failure of mbox 0x31
Vikas Chaudhary [Fri, 17 Jan 2014 09:43:28 +0000 (04:43 -0500)]
[SCSI] qla4xxx: Fix failure of mbox 0x31

Issue:
While unloading driver MBOX 0x31 fail as DDB logout (MBOX 0x56)
operation is not completed.

Fix:
Wait for DDB Logout completion before MBOX 0x31

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Reduce rom-lock contention during reset recovery.
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:45 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Reduce rom-lock contention during reset recovery.

Issue:
Driver holds rom-lock for too long during reset recovery.

During adapter reset testing, it was found that the driver
holds the rom-lock for too long, because of which other
drivers fail to acquire the rom-lock, leading to reset
failures.
The primary cause is, in the bootstrap code, while
holding the rom-lock, the driver checks if the peg is
halted, causing a 2 second contention.

Fix:
When a reset recovery starts, the driver deduces the cause, and
sets appropriate flags in watchdog & recover_adapter routines.
This flag should be used to determine if bootstrap is invoked
from probe or reset context, reducing the rom-lock footprint of
the drivers.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Driver not able to collect minidump for ISP84xx
Tej Parkash [Mon, 16 Dec 2013 11:49:44 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Driver not able to collect minidump for ISP84xx

Issue:
minidump data collection fails as driver reports data mismatch

Fix:
When the driver encounters a new entry type that it cannot process,
it should just skip the entry and adjust the total buffer size by
subtracting the skipped bytes from it. This is to ensure that there
is no data mismatch because of the new entries.

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Fix pending IO completion in reset path before initiating chip reset
Tej Parkash [Mon, 16 Dec 2013 11:49:43 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix pending IO completion in reset path before initiating chip reset

Issue:
Pending IO wait does not complete after triggering Graceful reset,
causing ack timeout and call traces.

Fix:
1. Reducing the IO command wait timeout before triggering reset,
   as logically also timeout should be less than reset timeout (10sec).
2. Moving the abort IO after chip reset, because only after
   chip reset, driver owns the IO otherwise it is with firmware and can
   still revert back with response.

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Fix processing response queue during probe
Tej Parkash [Mon, 16 Dec 2013 11:49:42 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix processing response queue during probe

Issue:
While booting with kdump kernel, driver receive IOCB interrupts
for which it is not ready which results in processing them
before init_firmware during driver probe

Fix:
Two steps solution
1. Make driver ready to process the interrupt before interupts
   handlers is registered.
2. Stop driver processing iocb interrupts if not generated as per
   firmware protocol i.e R2H bit set

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Fix failure of IDC Time Extend mailbox command
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:41 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix failure of IDC Time Extend mailbox command

Issue:
Mailbox command 0x102 (IDC Time Extend) failure seen while applying
changes to iface using iscsiadm

Fix:
Added fix to extend IDC timeout only for ISP84xx when IDC ACK
needs to be posted and disable ACB mailbox command completion
is in intermediate state.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Clear DDB index map upon connection close failure
Nilesh Javali [Mon, 16 Dec 2013 11:49:40 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Clear DDB index map upon connection close failure

Issue:
qla4xxx Unable to clear DDB indices when logout fails due to
failure of connection close mbox command.

Root cause:
If login to session fail, iscsiadm make call to destroy_session.
qla4xxx driver does not free ddb index map before free_ddb()

Fix:
Clear DDB Index map before free_ddb in "destroy_session"
in case of connection close mailbox command failure with 4005h.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Return correct error status from func qla4xxx_request_irqs()
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:39 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Return correct error status from func qla4xxx_request_irqs()

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Fixed AER reset sequence for ISP83xx/ISP84xx
Tej Parkash [Mon, 16 Dec 2013 11:49:38 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fixed AER reset sequence for ISP83xx/ISP84xx

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Correctly handle msleep_interruptible
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:37 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Correctly handle msleep_interruptible

If waiting for signals was interrupted then the device was put to
FAILED state. Use msleep instead of msleep_interruptible to handle
this correctly.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Rename ACB_STATE macros with IP_ADDRSTATE macros
Nilesh Javali [Mon, 16 Dec 2013 11:49:36 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Rename ACB_STATE macros with IP_ADDRSTATE macros

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Improve loopback failure messages
Nilesh Javali [Mon, 16 Dec 2013 11:49:35 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Improve loopback failure messages

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Use IDC_CTRL bit1 directly instead of AF_83XX_NO_FWDUMP flag.
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:34 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Use IDC_CTRL bit1 directly instead of AF_83XX_NO_FWDUMP flag.

Removed AF_83XX_NO_FWDUMP flag and directly checking IDC_CTRL bit1
while taking minidump, to check for graceful reset.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Fix comments in code
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:33 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Fix comments in code

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: Print WARN_ONCE() if iSCSI function presence bit removed
Vikas Chaudhary [Mon, 16 Dec 2013 11:49:32 +0000 (06:49 -0500)]
[SCSI] qla4xxx: Print WARN_ONCE() if iSCSI function presence bit removed

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] qla4xxx: ISP8xxx: Correct retry of adapter initialization
Nilesh Javali [Mon, 16 Dec 2013 11:49:31 +0000 (06:49 -0500)]
[SCSI] qla4xxx: ISP8xxx: Correct retry of adapter initialization

Issue:

For ISP8xxx, adapter initialization is not retried if
qla4xxx_initialize_adapter fails.

Fix:

If qla4xxx_initialize_adapter fails, first check if failure is due to IRQs not
attached in order to skip retrial, then free the IRQs and then retry
initializing the adapter.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] be2iscsi : Bump the driver version
Jayamohan Kallickal [Wed, 29 Jan 2014 07:16:46 +0000 (02:16 -0500)]
[SCSI] be2iscsi : Bump the driver version

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] be2iscsi : Fix DMA Out of SW-IOMMU space error
Jayamohan Kallickal [Wed, 29 Jan 2014 07:16:45 +0000 (02:16 -0500)]
[SCSI] be2iscsi : Fix DMA Out of SW-IOMMU space error

Setting DMA bit mask 64 and roll back to 32 if not supported.

Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] be2iscsi: Fix scsi_cmnd leakage in driver.
Jayamohan Kallickal [Wed, 29 Jan 2014 07:16:44 +0000 (02:16 -0500)]
[SCSI] be2iscsi: Fix scsi_cmnd leakage in driver.

scsi_cmnd n io_task was not NULL when
 - Link goes down while IO was happening and session is closed.
 - Task for which TMF was sent.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] be2iscsi: Fix the session cleanup when reboot/shutdown happens
Jayamohan Kallickal [Wed, 29 Jan 2014 07:16:43 +0000 (02:16 -0500)]
[SCSI] be2iscsi: Fix the session cleanup when reboot/shutdown happens

In iSCSI Boot scenario, when machine is reboot/shutdown phase
the active sessions are not closed. Driver queue cleanup is
done as part of unload and device is disabled.

Sessions are still active, iSCSI commands are issued from
session which comes to driver, as driver cleanup and device
disabled there is kernel stack dump with errors.

Fix is invoking iscsi_session_failure with ISCSI_ERR_INVALID_HOST
on all the active sessions when shutdown routine is called.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec.
Jayamohan Kallickal [Wed, 29 Jan 2014 07:16:42 +0000 (02:16 -0500)]
[SCSI] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec.

The doorbel format has been updated to support additonal functionalities
of SKH-R adapter. These changes are made such that older FW also works fine.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] be2iscsi: Fix port speed typo in driver.
Jayamohan Kallickal [Wed, 29 Jan 2014 07:16:40 +0000 (02:16 -0500)]
[SCSI] be2iscsi: Fix port speed typo in driver.

The 100Mbps port speed macro used was not proper.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] be2iscsi: Fix handling timed out MBX completion from FW
Jayamohan Kallickal [Wed, 29 Jan 2014 07:16:39 +0000 (02:16 -0500)]
[SCSI] be2iscsi: Fix handling timed out MBX completion from FW

When an MBX command timeout happens,the resources associated with
the MBX command were freed. If FW were to give the response to
host after the timeout value set by driver then driver crashes as the MBX Cmd
resources were already freed.

This patch fixes this issue by maintaing a state flag for each of
the MBX command posted/timedout/completed.

Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: Add support for a few HP Storage controllers
Stephen M. Cameron [Tue, 18 Feb 2014 19:58:02 +0000 (13:58 -0600)]
[SCSI] hpsa: Add support for a few HP Storage controllers

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: add HP/3PAR vendor id to pci_ids.h
Stephen M. Cameron [Tue, 18 Feb 2014 19:57:57 +0000 (13:57 -0600)]
[SCSI] hpsa: add HP/3PAR vendor id to pci_ids.h

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa add sysfs debug switch for raid map debugging messages
Stephen M. Cameron [Tue, 18 Feb 2014 19:57:52 +0000 (13:57 -0600)]
[SCSI] hpsa add sysfs debug switch for raid map debugging messages

Signed-off-by: Scott Teel <scott.teel@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: improve error messages for driver initiated commands
Stephen M. Cameron [Tue, 18 Feb 2014 19:57:47 +0000 (13:57 -0600)]
[SCSI] hpsa: improve error messages for driver initiated commands

On encountering unexpected error conditions from driver initiated
commands, print something useful like CDB and sense data rather than
something useless like the kernel virtual address of the command buffer.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: only do device rescan for certain events
Stephen M. Cameron [Tue, 18 Feb 2014 19:57:42 +0000 (13:57 -0600)]
[SCSI] hpsa: only do device rescan for certain events

Do no rescan on every events -- way too many rescans are
triggered if we don't filter the events.  Limit rescans
to be triggered by the following set of events:

 * controller state change
 * enclosure hot plug
 * physical drive state change
 * logical drive state change
 * redundant controller state change
 * accelerated io enabled/disabled
 * accelerated io configuration change

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: when switching out of accel mode await only accel command completions
Stephen M. Cameron [Tue, 18 Feb 2014 19:57:37 +0000 (13:57 -0600)]
[SCSI] hpsa: when switching out of accel mode await only accel command completions

Don't wait for *all* commands to complete, only for accelerated mode
commands.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: add controller base data-at-rest encryption compatibility ioaccel2
Scott Teel [Tue, 18 Feb 2014 19:57:31 +0000 (13:57 -0600)]
[SCSI] hpsa: add controller base data-at-rest encryption compatibility ioaccel2

Add controller-based data-at-rest encryption compatibility
to ioaccel2 path (HP SSD Smart Path).

Encryption feature requires driver to supply additional fields
for encryption enable, tweak index, and data encryption key index
in the ioaccel2 request structure.

Encryption enable flag and data encryption key index come from
raid_map data structure from raid offload command.

During ioaccel2 submission, check device structure's raid map to see if
encryption is enabled for the device. If so, call new function below.

Add function set_encrypt_ioaccel2 to set encryption flag, data encryption key
index, and calculate tweak value from request's logical block address.

Signed-off-by: Scott Teel <scott.teel@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
10 years ago[SCSI] hpsa: update source file copyrights
Scott Teel [Tue, 18 Feb 2014 19:57:26 +0000 (13:57 -0600)]
[SCSI] hpsa: update source file copyrights

Signed-off-by: Scott Teel <scott.teel@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>