[SCSI] fnic: Kernel panic while running sh/nosh with max lun cfg
Kernel panics due to NULL lport while executing the log message because
of synchronization issues between libfc and scsi transport fc. Checking
for NULL pointers at the beginning of this routine would resolve the issue
from kernel panic point of view.
[SCSI] fnic: Hitting BUG_ON(io_req->abts_done) in fnic_rport_exch_reset
Hitting BUG_ON(io_req->abts_done) in fnic_rport_exch_reset in case of
timing issue and also to some extent locking issue where abts and terminate
is happening around same timing.
The code changes are intended to update CMD_STATE(sc) and
io_req->abts_done together.
Brian Uchino [Mon, 9 Sep 2013 20:31:47 +0000 (13:31 -0700)]
[SCSI] fnic: On system with >1.1TB RAM, VIC fails multipath after boot up
Issue was seen when SCSI buffer address is more than 40 bits in system
with more than 1.1TB RAM. When SCSI buffer is passed to VIC, it is failing
to map to correct buffer address, as DMA mask is set to 40 bits in driver
initialization. Corrected DMA_MASK from 40-bits to 64-bits to avoid masking
41-64 bits addresses.
Signed-off-by: Brian Uchino <buchino@cisco.com> Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] fnic: FC stat param seconds_since_last_reset not getting updated
Code to reset fc_host statistics.
echo 1 > /sys/class/fc_host/hostX/statistics/reset_statistics clears fc_host stats,
the code also issues command to fnic firmware to clear vnic stats.
Alan Stern [Fri, 6 Sep 2013 15:49:51 +0000 (11:49 -0400)]
[SCSI] sd: Fix potential out-of-bounds access
This patch fixes an out-of-bounds error in sd_read_cache_type(), found
by Google's AddressSanitizer tool. When the loop ends, we know that
"offset" lies beyond the end of the data in the buffer, so no Caching
mode page was found. In theory it may be present, but the buffer size
is limited to 512 bytes.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Dmitry Vyukov <dvyukov@google.com> CC: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] megaraid_sas: addded support for big endian architecture
This patch will add big endian architecture support to megaraid_sas
driver. The support added is for LSI MegaRAID all generation controllers-
(3Gb/s, 6Gb/s and 12 Gb/s controllers).
We have done basic sanity test @ppc64 arch and @x86_64. Additional
testing/observations are welcome.
[jejb: fix up rejections] 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>
Mike Miller [Wed, 4 Sep 2013 20:11:10 +0000 (15:11 -0500)]
[SCSI] hpsa: housekeeping patch for device_id and product arrays
This patch does a bit of housekeeping for hpsa. Change lowercase alpha hex
digits to uppercase for consistency within the driver. Also moves the P822se
in the tables to keep controllers of each family grouped together.
Signed-off-by: Mike Miller <mike.miller@hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Seungwon Jeon [Sat, 31 Aug 2013 16:10:24 +0000 (21:40 +0530)]
[SCSI] ufs: configure the attribute for power mode
UIC attributes can be set with using DME_SET command for
power mode change. For configuration the link capability
attributes are used, which is updated after successful
link startup.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Seungwon Jeon [Sat, 31 Aug 2013 16:10:22 +0000 (21:40 +0530)]
[SCSI] ufs: add operation for the uic power mode change
Setting PA_PWRMode using DME_SET triggers the power mode
change. And then the result will be given by the HCS.UPMCRS.
This operation should be done atomically.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Tested-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Seungwon Jeon [Sat, 31 Aug 2013 16:10:21 +0000 (21:40 +0530)]
[SCSI] ufs: add dme configuration primitives
Implements to support GET and SET operations of the DME.
These operations are used to configure the behavior of
the UNIPRO. Along with basic operation, {Peer/AttrSetType}
can be mixed.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Tested-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Seungwon Jeon [Sat, 31 Aug 2013 16:10:20 +0000 (21:40 +0530)]
[SCSI] ufs: fix the setting interrupt aggregation counter
IACTH(Interrupt aggregation counter threshold) value is allowed
up to 0x1F and current setting value is the maximum.
This value is related with NUTRS(max:0x20) of HCI's capability.
Considering HCI controller doesn't support the maximum, IACTH
setting should be adjusted with possible value.
For that, existing 'ufshcd_config_int_aggr' is split into two part
[reset, configure].
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Tested-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Seungwon Jeon [Sat, 31 Aug 2013 16:10:19 +0000 (21:40 +0530)]
[SCSI] ufs: find out sense data over scsi status values
Unlike 'GOOD' and 'CHECK CONDITION', other status values in
Response UPIU may or may not contain sense data. That is returning
sense data isn't obvious. So, in this case the Data Segment Length
field should be checked. If a non-zero value, it means that UPIU
has Sense Data in the Data Segment area.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Tested-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[SCSI] Allow MPT Fusion SAS 3.0 driver to be built into the kernel
Right now the Makefile for the mpt3sas driver does not even allow the
driver to be built into the kernel. So fix that up, as there doesn't
seem to be any obvious reason why this shouldn't be done.
Brian King [Tue, 20 Aug 2013 16:08:42 +0000 (11:08 -0500)]
[SCSI] ibmvfc: Fix for offlining devices during error recovery
This fixes an issue seen with devices getting marked offline
in a scenario where a VIOS was getting rebooted while a
client VFC adapter is in SCSI EH and prevents unnecessary
EH escalation in some scenarios.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Bradley Grove [Thu, 5 Sep 2013 17:08:00 +0000 (13:08 -0400)]
[SCSI] esas2r: Remove null test for stack allocated fw_coredump_buffer
Reported-by: Dave Jones <davej@redhat.com> Signed-off-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Bradley Grove [Thu, 29 Aug 2013 19:55:43 +0000 (15:55 -0400)]
[SCSI] esas2r: smatch - Remove test for impossible condition (uint8 > 255)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Bradley Grove [Thu, 29 Aug 2013 19:55:42 +0000 (15:55 -0400)]
[SCSI] esas2r: smatch - Fix overrun due to sprintf appending NULL
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Bradley Grove [Thu, 29 Aug 2013 19:55:40 +0000 (15:55 -0400)]
[SCSI] esas2r: smatch - Fix dereference that occurs prior to check
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Bradley Grove [Thu, 29 Aug 2013 19:55:39 +0000 (15:55 -0400)]
[SCSI] esas2r: smatch - Use biwise rather than logical AND for checking if any bit set
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vaughan Cao [Thu, 29 Aug 2013 02:00:39 +0000 (10:00 +0800)]
[SCSI] sg: push file descriptor list locking down to per-device locking
Push file descriptor list locking down to per-device locking. Let sg_index_lock
only protect device lookup.
sdp->detached is also set and checked with this lock held.
Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vaughan Cao [Thu, 29 Aug 2013 02:00:38 +0000 (10:00 +0800)]
[SCSI] sg: checking sdp->detached isn't protected when open
@detached is set under the protection of sg_index_lock. Without getting the
lock, new sfp will be added during sg removal and there is no chance for it
to be picked out. So check with sg_index_lock held in sg_add_sfp().
Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vaughan Cao [Thu, 29 Aug 2013 02:00:37 +0000 (10:00 +0800)]
[SCSI] sg: no need sg_open_exclusive_lock
Open exclusive check is protected by o_sem, no need sg_open_exclusive_lock.
@exclude is used to record which type of rwsem we are holding.
Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vaughan Cao [Thu, 29 Aug 2013 02:00:36 +0000 (10:00 +0800)]
[SCSI] sg: use rwsem to solve race during exclusive open
A race condition may happen if two threads are both trying to open the same sg
with O_EXCL simultaneously. It's possible that they both find fsds list is
empty and get_exclude(sdp) returns 0, then they both call set_exclude() and
break out from wait_event_interruptible and resume open.
Now use rwsem to protect this process. Exclusive open gets write lock and
others get read lock. The lock will be held until file descriptor is closed.
This also leads 'exclude' only a status rather than a check mark.
Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Akinobu Mita [Mon, 26 Aug 2013 13:08:41 +0000 (22:08 +0900)]
[SCSI] scsi_debug: fix logical block provisioning support when unmap_alignment != 0
Commit b90ebc3d5c41c9164ae04efd2e4f8204c2a186f1 ("[SCSI] scsi_debug:
fix logical block provisioning support") fixed several issues with
logical block provisioning support, but it still doesn't properly fix
the cases when unmap_alignment > 0.
For example, load scsi_debug module with the following module parameters
and make all blocks mapped by filling the storage with zero.
The problem is in map_index_to_lba(), which should return the first
LBA which is corresponding to a given index of provisioning map
(map_storep).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: "Martin K. Petersen" <martin.petersen@oracle.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Akinobu Mita [Mon, 26 Aug 2013 13:08:40 +0000 (22:08 +0900)]
[SCSI] scsi_debug: fix endianness bug in sdebug_build_parts()
With module parameter num_parts > 0, partition table is built on the
ramdisk storage when loading the driver. Unfortunately, there is an
endianness bug in sdebug_build_parts(). So the partition table is not
correctly initialized on big-endian systems.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Tested-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Sawan Chandak [Tue, 27 Aug 2013 05:37:51 +0000 (01:37 -0400)]
[SCSI] qla2xxx: Add a new interface to update versions.
On any Adapter when we flash through FC/FCoE without card reset option it still
shows the Running FW version in Flashed FW version. This new interface will be
used by API to instruct the driver to update its cache versions.
Chad Dupuis [Tue, 27 Aug 2013 05:37:50 +0000 (01:37 -0400)]
[SCSI] qla2xxx: Move queue depth ramp down message to i/o debug level.
Unless there is a need to observe them, the queue depth ramp up/down messages
are a nuisance and may cause the system to become unresponsive so move it a
non-default logging level.
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>
Earlier IDC-TIME-EXTEND aen was a nop and ignored by driver.
We now have to handle the aen so that other protocol drivers can use time
extension during some loopback operations.
[SCSI] qla2xxx: Print some variables to hexadecimal string via %*phN format
The patch changes a specifier used to output some variables. Instead of using
stack for each byte the '%*ph[CN]' allows to take a one pointer and prints
entire buffer as a hexadecimal string with the separator ':' or ''.
Steffen Maier [Thu, 22 Aug 2013 15:49:34 +0000 (17:49 +0200)]
[SCSI] zfcp: enable FCP hardware data router by default
Enabling the data router support by default
can increase performance in certain situations.
It is safe to do so and tolerated in LPAR and under z/VM
in case there is no data router support in that environment.
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com> Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Martin Peschke [Thu, 22 Aug 2013 15:49:33 +0000 (17:49 +0200)]
[SCSI] zfcp: dead code removal
Get rid of unused function zfcp_fsf_get_req and corresponding
prototype definition.
Commit a54ca0f62f953898b05549391ac2a8a4dad6482b in v2.6.28
"[SCSI] zfcp: Redesign of the debug tracing for HBA records."
accidentally introduced this code which was dead in the first place.
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Sreekanth Reddy [Wed, 14 Aug 2013 12:53:20 +0000 (18:23 +0530)]
[SCSI] mpt3sas: Added a driver module parameter max_msix_vectors
Added a driver module parameter max_msix_vectors. Using this module parameter
the maximum number of MSI-X vectors could be set.
The number of MSI-X vectors used would be the minimum of MSI-X vectors
supported by the HBA, the number of CPU cores and the value set to
max_msix_vectors module parameter.
The default value of this module parameter is set to 8. The default value of
this parameter is set to 8 inorder to reduce the amount of memory required for
Reply Descriptor Post queue. This is because with the higher MSI-X vectors,
some times kernel is not able to allocate the requested amount of memory and
crash is observed. To overcome this problem, the default value is set to 8.
Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Nilesh Javali [Fri, 16 Aug 2013 11:03:03 +0000 (07:03 -0400)]
[SCSI] qla4xxx: Implementation of ACB configuration during Loopback for ISP8042
While loopback diagnostic is in progress, disable the ACB which resets
all the active connections to target. Disable ACB would filter out all
the DHCP multicast and broadcast packets which otherwise cause the
diagnostic test to take longer time to complete or failures in some
other cases.