Uma Krishnan [Fri, 25 Aug 2017 22:18:12 +0000 (17:18 -0500)]
scsi: cxlflash: Fix vlun resize failure in the shrink path
The ioctl DK_CAPI_VLUN_RESIZE can fail if the allocated vlun size is
reduced from almost maximum capacity and then increased again.
The shrink_lxt() routine is currently using the SISL_ASTATUS_MASK to
mask the higher 48 bits of the lxt entry. This is unnecessary and
incorrect as it uses a mask designed for the asynchronous interrupt
status register. When the 4 port support was added to cxlflash, the
SISL_ASTATUS_MASK was updated to reflect the status bits for all 4
ports. This change indirectly affected the shrink_lxt() code path.
To extract the base, simply shift the bits without masking.
Fixes:
565180723294 ("scsi: cxlflash: SISlite updates to support 4 ports")
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Matthew R. Ochs [Fri, 25 Aug 2017 22:18:03 +0000 (17:18 -0500)]
scsi: cxlflash: Avoid double mutex unlock
The AFU recovery routine uses an interruptible mutex to control the flow
of in-flight recoveries. Upon receiving an interruptible signal the code
branches to a common exit path which wrongly assumes the mutex is
held. Add a local variable to track when the mutex should be unlocked.
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Matthew R. Ochs [Fri, 25 Aug 2017 22:17:53 +0000 (17:17 -0500)]
scsi: cxlflash: Remove unnecessary existence check
The AFU termination sequence has been refactored over time such that the
main tear down routine, term_afu(), can no longer can be invoked with a
NULL AFU pointer. Remove the unnecessary existence check from
term_afu().
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arvind Yadav [Thu, 17 Aug 2017 13:45:05 +0000 (19:15 +0530)]
scsi: ibmvfc: ibmvscsi: ibmvscsi_tgt: constify vio_device_id
vio_device_id are not supposed to change at runtime. All functions
working with vio_device_id provided by <asm/vio.h> work with const
vio_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jonathan Corbet [Thu, 24 Aug 2017 22:11:09 +0000 (16:11 -0600)]
scsi: Fix the kerneldoc for scsi_initialize_rq()
The kerneldoc comment for scsi_initialize_rq() neglected to document the
"rq" parameter, leading to this docs build warning:
./drivers/scsi/scsi_lib.c:1116: warning: No description found for parameter 'rq'
Document the parameter and make the build slightly quieter.
[mkp: used wording suggested by Bart]
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Calvin Owens [Thu, 24 Aug 2017 13:13:52 +0000 (15:13 +0200)]
scsi: ses: Fix racy cleanup of /sys in remove_dev()
Currently we free the resources backing the enclosure device before we
call device_unregister(). This is racy: during rmmod of low-level SCSI
drivers that hook into enclosure, we end up with a small window of time
during which writing to /sys can OOPS. Example trace with mpt3sas:
general protection fault: 0000 [#1] SMP KASAN
Modules linked in: mpt3sas(-) <...>
RIP: [<
ffffffffa0388a98>] ses_get_page2_descriptor.isra.6+0x38/0x220 [ses]
Call Trace:
[<
ffffffffa0389d14>] ses_set_fault+0xf4/0x400 [ses]
[<
ffffffffa0361069>] set_component_fault+0xa9/0xf0 [enclosure]
[<
ffffffff8205bffc>] dev_attr_store+0x3c/0x70
[<
ffffffff81677df5>] sysfs_kf_write+0x115/0x180
[<
ffffffff81675725>] kernfs_fop_write+0x275/0x3a0
[<
ffffffff8151f810>] __vfs_write+0xe0/0x3e0
[<
ffffffff8152281f>] vfs_write+0x13f/0x4a0
[<
ffffffff81526731>] SyS_write+0x111/0x230
[<
ffffffff828b401b>] entry_SYSCALL_64_fastpath+0x13/0x94
Fortunately the solution is extremely simple: call device_unregister()
before we free the resources, and the race no longer exists. The driver
core holds a reference over ->remove_dev(), so AFAICT this is safe.
Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Thu, 24 Aug 2017 12:52:43 +0000 (14:52 +0200)]
scsi: mptsas: Fixup device hotplug for VMWare ESXi
VMWare ESXi emulates an mptsas HBA, but exposes all drives as
direct-attached SAS drives. This it not how the driver originally
envisioned things; SAS drives were supposed to be connected via an
expander, and only SATA drives would be direct attached. As such, any
hotplug event for direct-attach SAS drives was silently ignored, and the
guest failed to detect new drives from within a VMWare ESXi environment.
[mkp: typos]
Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=
1030850
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bhumika Goyal [Sat, 19 Aug 2017 08:22:24 +0000 (13:52 +0530)]
scsi: make device_type const
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
weiping zhang [Fri, 18 Aug 2017 06:49:30 +0000 (14:49 +0800)]
scsi: sd: remove duplicated setting of gd->minors
gd->minors has been set when call alloc_disk() in sd_probe.
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:21 +0000 (13:57 +0200)]
scsi: eata: remove 'arg_done' from eata2x_eh_host_reset()
Just displaying some different information; drop it.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:20 +0000 (13:57 +0200)]
scsi: visorhba: sanitze private device data allocation
There's no need to keep the private data for a device in a separate
list; better to store it in ->hostdata and do away with the additional
list.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:19 +0000 (13:57 +0200)]
scsi: megaraid_mbox: drop duplicate bus reset and device reset function
megaraid_mbox only has one reset function, and that is a host reset. So
drop the duplicate bus reset and device reset functions.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:18 +0000 (13:57 +0200)]
scsi: bnx2fc: remove obsolete bnx2fc_eh_host_reset() definition
Never used anywhere.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:17 +0000 (13:57 +0200)]
scsi: 53c700: move bus reset to host reset
bus reset always returns SUCCESS, meaning host reset was never
tested. At the same time the only difference to the HBA is a missing
call to NCR_700_chip_reset(). So add the missing call to bus reset,
drop host reset, and move bus reset to host reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:16 +0000 (13:57 +0200)]
scsi: aha152x: drop host reset
The driver has both a bus and a host reset, where the host reset does a
bus reset followed by an attempt to reset the chip registers to a
default state. However, as the bus reset always returned SUCCESS the
host reset was never called, so the functionality of the register reset
function was never validated. Additionally, tha AIC-6260 chip has a
hard reset line, which actually should be preferred for a host
reset. But I haven't found a way how this can be triggered via software,
so take the safe approach and drop the host reset.
[mkp: typo]
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:15 +0000 (13:57 +0200)]
scsi: nsp32: drop bus reset
bus reset is a host reset without nsp32hw_init(), and will always return
SUCCESS, thus disabling the use of host reset. So drop bus reset in
favour of host reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:14 +0000 (13:57 +0200)]
scsi: qedf: drop bus reset handler
qedf has a host reset handler, but as the bus reset handler is a stub
always returning SUCCESS the host reset is never invoked. So drop the
bus reset handler.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Tested-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:13 +0000 (13:57 +0200)]
scsi: ppa: drop duplicate bus_reset handler
bus_reset and host_reset are the same functions, so drop bus_reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:12 +0000 (13:57 +0200)]
scsi: imm: drop duplicate bus_reset handler
host_reset and bus_reset is the same function, so drop bus reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:11 +0000 (13:57 +0200)]
scsi: qlogicfas: move bus_reset to host_reset
The bus reset handler is really a host reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:10 +0000 (13:57 +0200)]
scsi: NCR5380: Move bus reset to host reset
The bus reset handler really is a host reset, so move it to
eh_bus_reset_handler.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:09 +0000 (13:57 +0200)]
scsi: acornscsi: move bus reset to host reset
The bus reset function is really a host reset, so move it to
eh_host_reset_handler.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:08 +0000 (13:57 +0200)]
scsi: qlogicpti: move bus reset to host reset
The bus reset function really is a host reset, so move it to
eh_host_reset_handler().
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:07 +0000 (13:57 +0200)]
scsi: rtsx: drop bus reset function
Function is a stub, so can as well be dropped.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:06 +0000 (13:57 +0200)]
scsi: drop bus reset for wd33c93-compatible boards
The bus reset function is just a wrapper calling host reset under the
host lock. So move taking of the host lock into the host reset function
and drop bus reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:05 +0000 (13:57 +0200)]
scsi: fdomain: move bus reset to host reset
The bus reset function really is a host reset, so move it to
eh_host_reset_handler().
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:04 +0000 (13:57 +0200)]
scsi: hptiop: Simplify reset handling
The Highpoint driver only has one reset function, and that is a host
reset. So stop pretending we're doing anything else.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:03 +0000 (13:57 +0200)]
scsi: bfa: move bus reset to target reset
The bus reset handler is just calling target reset on all targets, which
is exactly what SCSI EH will be doing anyway. So move the bus reset
function to target reset and drop the loop.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:02 +0000 (13:57 +0200)]
scsi: libsas: move bus_reset_handler() to target_reset_handler()
The bus reset handler is calling I_T Nexus reset, which logically is a
target reset as it need to specify both the initiator and the target.
So move it to target reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:01 +0000 (13:57 +0200)]
scsi: uas: move eh_bus_reset_handler to eh_device_reset_handler
The bus_reset handler is really a device reset, so move it to
eh_device_reset_handler().
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:57:00 +0000 (13:57 +0200)]
scsi: fnic: do not call host reset from command abort
Command abort already returns FAILED, which will then be escalated to a
host reset. So no need to call host_reset directly.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:56:59 +0000 (13:56 +0200)]
scsi: fc_fcp: do not call fc_block_scsi_eh() from host reset
When calling host reset we're resetting all ports anyway, so there is no
point in waiting for the ports to become unblocked.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:56:58 +0000 (13:56 +0200)]
scsi: ibmvfc: Do not call fc_block_scsi_eh() on host reset
When we're resetting the host any remote port states will be reset
anyway, so it's pointless to wait for dev_loss_tmo during host reset.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:56:57 +0000 (13:56 +0200)]
scsi: mptfc: Do not call fc_block_scsi_eh() on host reset
When we're resetting the host any remote port states will be reset
anyway, so it's pointless to wait for dev_loss_tmo during host reset.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 25 Aug 2017 11:56:56 +0000 (13:56 +0200)]
scsi: fix comment in scsi_device_set_state()
The function returns '0' if successful; with the original comment
the function doesn't have a way to indicate success ...
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Bart van Assche <bvanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:43 +0000 (13:46 -0700)]
scsi: iscsi_tcp: Remove a set-but-not-used variable
This patch avoids that gcc reports the following warning when
building with W=1:
drivers/scsi/iscsi_tcp.c:166:24: warning: variable ?session? set but not used [-Wunused-but-set-variable]
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Lee Duncan <lduncan@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:42 +0000 (13:46 -0700)]
scsi: scsi_debug: Remove a set-but-not-used variable
This patch avoids that gcc reports the following warning when
building with W=1:
drivers/scsi/scsi_debug.c:2264:15: warning: variable ?pcontrol? set but not used [-Wunused-but-set-variable]
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:41 +0000 (13:46 -0700)]
scsi: scsi_transport_srp: Suppress a W=1 compiler warning
Avoid that the following compiler warning is reported when building
with W=1:
drivers/scsi/scsi_transport_srp.c:92:19: warning: comparison is always false due to limited range of data type [-Wtype-limits]
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:40 +0000 (13:46 -0700)]
scsi: scsi_transport_sas: Check kzalloc() return value
Check whether memory allocation succeeded before dereferencing
the pointer to the allocated memory.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:39 +0000 (13:46 -0700)]
scsi: libsas: Annotate fall-through in a switch statement
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:38 +0000 (13:46 -0700)]
scsi: libsas: Remove a set-but-not-used variable
This was detected by building with W=1.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:37 +0000 (13:46 -0700)]
scsi: libiscsi: Fix indentation
This patch avoids that smatch reports the following:
drivers/scsi/libiscsi.c:1081: iscsi_handle_reject() warn: inconsistent indenting
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:36 +0000 (13:46 -0700)]
scsi: sg: Fix type of last blk_trace_setup() argument
Avoid that sparse reports the following:
drivers/scsi/sg.c:1114:41: warning: incorrect type in argument 5 (different address spaces)
drivers/scsi/sg.c:1114:41: expected char [noderef] <asn:1>*arg
drivers/scsi/sg.c:1114:41: got char *<noident>
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:35 +0000 (13:46 -0700)]
scsi: sd: Remove a useless comparison
This patch avoids that gcc reports the following warning when
building with W=1:
drivers/scsi/sd.c:315:10: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if (val >= 0 && val <= T10_PI_TYPE3_PROTECTION)
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:34 +0000 (13:46 -0700)]
scsi: sd: Fix indentation
This patch avoids that smatch reports the following:
drivers/scsi/sd.c:3540: sd_suspend_common() warn: inconsistent indenting
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:33 +0000 (13:46 -0700)]
scsi: sd: sr: Convert two assignments into warning statements
Before scsi_prep_fn() calls the ULP .init_command() callback
function it stores the SCSI command pointer in request.special.
This means that the SCpnt = rq->special assignments in the sd
and sr drivers assign a pointer to itself. Hence convert these
two assignment statements into warning statements.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:32 +0000 (13:46 -0700)]
scsi: Use blk_mq_rq_to_pdu() to convert a request to a SCSI command pointer
Since commit
e9c787e65c0c ("scsi: allocate scsi_cmnd structures as
part of struct request") struct request and struct scsi_cmnd are
adjacent. This means that there is now an alternative to reading
req->special to convert a pointer to a prepared request into a
SCSI command pointer, namely by using blk_mq_rq_to_pdu(). Make
this change where appropriate. Although this patch does not
change any functionality, it slightly improves performance and
slightly improves readability.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:31 +0000 (13:46 -0700)]
scsi: Document which queue type a function is intended for
Rename several functions to make it easy to see which queue type a
function is intended for.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:30 +0000 (13:46 -0700)]
scsi: Convert a strncmp() call into a strcmp() call
This patch avoids that smatch reports the following warning:
drivers/scsi/scsi_sysfs.c:117: check_set() error: strncmp() '"-"' too small (2 vs 20)
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:29 +0000 (13:46 -0700)]
scsi: Suppress gcc 7 fall-through warnings reported with W=1
The conclusion of a recent discussion about the new warnings
reported by gcc 7 is that the new warnings reported when building
with W=1 should be suppressed. However, gcc 7 still warns about
fall-through in switch statements when building with W=1. Suppress
these warnings by annotating the SCSI core properly.
See also Linus Torvalds, Lots of new warnings with gcc-7.1.1, 11
July 2017 (https://www.mail-archive.com/linux-media@vger.kernel.org/msg115428.html).
References: commit
bd664f6b3e37 ("disable new gcc-7.1.1 warnings for now")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:28 +0000 (13:46 -0700)]
scsi: Avoid sign extension of scsi_device.type
This patch avoids that smatch reports the following:
drivers/scsi/scsi_sysfs.c:506 scsi_bus_uevent() warn: argument 3 to %02x specifier has type 'char'
drivers/scsi/scsi_sysfs.c:872 sdev_show_modalias() warn: argument 4 to %02x specifier has type 'char'
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Fri, 25 Aug 2017 20:46:27 +0000 (13:46 -0700)]
scsi: Remove an obsolete function declaration
Commit
e9c787e65c0c ("scsi: allocate scsi_cmnd structures as part of
struct request") removed the scsi_get_command() function. Hence also
remove the declaration of that function.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Zang Leigang [Thu, 24 Aug 2017 02:57:15 +0000 (10:57 +0800)]
scsi: ufs: reqs and tasks were put in the wrong order
Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:49 +0000 (16:55 -0700)]
scsi: lpfc: lpfc version bump 11.4.0.3
Update driver version to 11.4.0.3
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Maurizio Lombardi [Wed, 23 Aug 2017 23:55:48 +0000 (16:55 -0700)]
scsi: lpfc: fix "integer constant too large" error on 32bit archs
cc1: warnings being treated as errors
drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_get_wwpn':
drivers/scsi/lpfc/lpfc_init.c:3253: error: integer constant is too large for 'long' type
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
James Smart [Wed, 23 Aug 2017 23:55:47 +0000 (16:55 -0700)]
scsi: lpfc: Add Buffer to Buffer credit recovery support
Add Buffer to buffer credit recovery support to the driver. This is a
negotiated feature with the peer that allows for both sides to detect
dropped RRDY's and FC Frames and recover credit.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
James Smart [Wed, 23 Aug 2017 23:55:46 +0000 (16:55 -0700)]
scsi: lpfc: remove console log clutter
Change hw queue binding messages to info - not error.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:45 +0000 (16:55 -0700)]
scsi: lpfc: Fix bad sgl reposting after 2nd adapter reset
Port issue was fixed, the hbacmd reset would take more than 8 minutes to
complete.
There were conflicting NVME SGL posting/reposting responsibilities
between lpfc_online()/lpfc_sli4_hba_setup() and
lpfc_nvme_create_localport(). The lpfc_online() causes a REPOST on
existing NVME SGLs which is not released during the fc port reset.
However, lpfc_nvme_create_localport() wants to allocate new NVME buffers
and post them. Both cancelled out each other which had a side effect of
hosing the mailbox handling that was used to remove the sgl lists -
causing multiple 60s mbx timeouts.
Fix by preserving all SGL lists over the fc port reset.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:44 +0000 (16:55 -0700)]
scsi: lpfc: Fix nvme target failure after 2nd adapter reset
The nonrecovery occurred because the lpfc nvme initiator function did
not reestablish its localport creation with the nvme host transport in
lpfc_oneline. Because of that, an NVME rport binding could not take
place.
Corrected by recreating the localport in the adapter reset recovery
routine.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:43 +0000 (16:55 -0700)]
scsi: lpfc: Fix relative offset error on large nvmet target ios
If the nvmet_fc transport breaks an io into multiple sequences, the
driver will improperly set the relative offset on the 2nd through N
sequences.
Correct by properly formatting the hw cmd so the relative offset is
picked up from the hw cmd.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:42 +0000 (16:55 -0700)]
scsi: lpfc: Fix MRQ > 1 context list handling
Various oops including cpu LOCKUPs were seen.
For asynchronously received ius where the driver must assign exchange
resources, the resources were on a single get (free) list and put list
(finished, waiting to be put on get list). As all cpus are sharing the
lists, an interrupt for a receive frame may have to wait for all the
other cpus to place their done work onto the put list before it can
acquire the lock to pull from the list.
Fix by breaking the resource lists into per-cpu lists or at least more
than 1 list with cpu's sharing the lists). A cpu would allocate from the
free list for its own cpu, and put its done work on the its own put list
- avoiding the contention. As cpu load may vary, when empty, a cpu may
grab from another cpu, thereby changing resource distribution. But
searching for a resource only occurs on 1 or a few cpus until a single
resource can be allocated. if the condition reoccurs, it starts looking
at a different cpu.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:41 +0000 (16:55 -0700)]
scsi: lpfc: Limit amount of work processed in IRQ
Various oops being seen on being in the ISR too long and cpu lockups,
when under heavy load.
The amount of work being posted off of completion queues kept the ISR
running almost all the time
Correct the issue by limiting the amount of work per iteration.
[mkp: typo]
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:40 +0000 (16:55 -0700)]
scsi: lpfc: Correct issues with FAWWN and FDISCs
When using fabric-assigned WWNs, the switch doesn't like copy of the
FLOGI payload, which includes valid VVL bits, to be used as the FDISC
payload.
Rather than wait for corrected switch firmware, ensure the VVL bits are
marked invalid on FDISCs.
[mkp: typo]
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:39 +0000 (16:55 -0700)]
scsi: lpfc: Fix NVME PRLI handling during RSCN
A race condition was found whereby the initiator would receive the RSCN
for a new NVME device before it had a chance to register its FC4 support
with the fabric. Thus, when queried by the initiator, it would see that
the target supported FC-NVME.
Corrected by making the assumption that the target always supports
FC-NVME thus a PRLI is sent. It's ok for the target to reject it.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:38 +0000 (16:55 -0700)]
scsi: lpfc: Fix crash in lpfc nvmet when fc port is reset
In adapter reset tests, an oops was seen with a NULL pointer in
lpfc_free_rq_buffer+0x20/0x60
The driver is failing to properly repost the nvmet sgl list when
recovering from the reset. Thus the driver eventually trys to walk an
errant buffer list.
Corrected the sgl buffer recovery as well as strengthening the
initialization of the bufferlist.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:37 +0000 (16:55 -0700)]
scsi: lpfc: Fix duplicate NVME rport entries and namespaces.
After lip, the driver sometimes would have two rports for the same
device, allowing the namespaces to be duplicated by nvme.
In lpfc_plogi_confirm_nport() the driver was not swapping the nrport
maintained by the ndlp's undergoing address swapping. This allowed the
2nd rport to sneak in as it was considered a separate device.
This patch adds the fixes to Swap the nrport in each ndlp and take care
of the reference counts on the ndlps similar to FCP rports.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:36 +0000 (16:55 -0700)]
scsi: lpfc: Fix handling of FCP and NVME FC4 types in Pt2Pt topology
After link bounce in a NVME Pt2Pt config, the driver managed to map the
same nport twice, resulting in multiple device nodes for the same
namespace.
In Pt2Pt, the driver must send PRLI's for both (scsi) FCP and NVME
rather than using fabric aids. The driver was inconsistent on handling
various PRLI completions, especially rejects, which had reject codes
cross the different protocol PRLI completions.
Fixed to perform the following: if nvmet mode (fc port can only be a
nvme target) - rejects all unsolicitly FCP PRLI's. Never issues a FCP
PRLI.
The multiple protocol PRLI's are sent simultaneously. However, driver
will now only state transition after both PRLI's are complete. New flags
were added to aid tracking the responses from the different PRLI's.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:35 +0000 (16:55 -0700)]
scsi: lpfc: Correct return error codes to align with nvme_fc transport
Modify driver return error codes to align with host nvme transport.
Driver isn't returning Exxx error codes to properly reflect out of
resource or connectivity conditions (-EBUSY), yet there were hard error
conditions returning -EBUSY.
Ensure the following situations return the proper return code:
- Temporary failures or temporary resource availability: -EBUSY
- Connectivity issues: -ENODEV
All others are treated as hard errors and return an -Exxx value that
indicates the type of error.
Also, lpfc_sli4_issue_wqe() was modified to not translate error from
-Exxx to WQE state. This allows lpfc_nvme_fcp_io_submit() routine to
just return whatever -E value was returned from other routines.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:34 +0000 (16:55 -0700)]
scsi: lpfc: convert info messages to standard messages
Transitioned some informational discovery messages to now always be
displayed when log_verbose is set.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:33 +0000 (16:55 -0700)]
scsi: lpfc: Fix oops when NVME Target is discovered in a nonNVME environment
lpfc oops when it discovers a NVME target but is configured for SCSI
only operation. Oops is in lpfc_nvme_register_port+0x33/0x300.
The localport is not valid so it should not have been referenced.
Added validity check for localport
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:32 +0000 (16:55 -0700)]
scsi: lpfc: Fix rediscovery on switch blade pull
When the switch blade is pulled out then plugged back in, the driver
does not issue a PLOGI to the target
When the switch blade is pulled out, it does not reset the link. The
driver ends up issuing a LOGO to the target, and finally sees devloss.
Since the driver believes that a LOGO is outstanding, it does not issue
a PLOGI to the target upon link up
Correct by placing the ndlp in UNUSED state When devloss happens in
LOGO_ISSUE state.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:31 +0000 (16:55 -0700)]
scsi: lpfc: Fix loop mode target discovery
The driver does not discover targets when in loop mode.
The NLP type is correctly getting set when a fabric connection is
detected but, not for loop. The unknown NLP type means that the driver
does not issue a PRLI when in loop topology. Thus target discovery
fails.
Fix by checking the topology during discovery. If it is loop, set the
NLP FC4 type to FCP.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dick Kennedy [Wed, 23 Aug 2017 23:55:30 +0000 (16:55 -0700)]
scsi: lpfc: Fix plogi collision that causes illegal state transition
Message "0271 Illegal State Transition: node" seen in logs, all luns are
unuseable for that target.
A window exists in the rcv_plogi path where if the state is plogi issue
but the driver has not issued a plogi, then two reglogins will be sent
for the same RPI. The first one to complete will advance the state to
prli issue the second one will be detected as an illegal state, and
leave the node in an unusable state.
Correct the completion routine for the PLOGI ACC that detects the state
change when the driver starts discovery on the node again and drop the
REGLOGIN mailbox command.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
himanshu.madhani@cavium.com [Wed, 23 Aug 2017 22:05:25 +0000 (15:05 -0700)]
scsi: qla2xxx: Update driver version to 10.00.00.01-k
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sawan Chandak [Wed, 23 Aug 2017 22:05:24 +0000 (15:05 -0700)]
scsi: qla2xxx: Do not call abort handler function during chip reset
If there are IO's running and host reset or chip reset is triggered,
IO's can fail due to rport time out. During chip reset recovery process,
driver notifies the transport layer that remote port no longer exist, by
calling fc_remote_port_delete(). When this function is called, it
actually delays deletion by "blocking" it. It sets the remote port state
to "FC_PORTSTATE_BLOCKED" and sets FC_RPORT_DEVLOSS_PENDING. When
driver tries to abort the command by calling its abort handler function,
abort handler will wait until remote port state is blocked state or wait
for dev_loss_tmo time. Due to this blocking, rport times out and results
in an IO failure. This patch adds a check for any active reset process
before calling abort handler function.
[mkp: typo]
Signed-off-by: Sawan Chandak <sawan.chandak@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Giridhar Malavali [Wed, 23 Aug 2017 22:05:23 +0000 (15:05 -0700)]
scsi: qla2xxx: Ability to process multiple SGEs in Command SGL for CT passthrough commands.
Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:22 +0000 (15:05 -0700)]
scsi: qla2xxx: Skip zero queue count entry during FW dump capture
If queue count is zero while reading FW dump template, for entry
T263/T274, skip capturing those entries during FW dump capture.
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:21 +0000 (15:05 -0700)]
scsi: qla2xxx: Recheck session state after RSCN
When RSCN is delivered for specific remote port. Use ADISC to verify the
session is still valid or not.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Michael Hernandez [Wed, 23 Aug 2017 22:05:20 +0000 (15:05 -0700)]
scsi: qla2xxx: Increase ql2xmaxqdepth to 64
ql2xmaxqdepth is the module parameter that seeds the per target
queue depth in the Scsi midlayer (sdev->queue_depth). Performance
testing revealed that increasing this value would improve IOPS
numbers under certain workloads.
Signed-off-by: Michael Hernandez <michael.hernandez@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
himanshu.madhani@cavium.com [Wed, 23 Aug 2017 22:05:19 +0000 (15:05 -0700)]
scsi: qla2xxx: Enable Async TMF processing
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:18 +0000 (15:05 -0700)]
scsi: qla2xxx: Cleanup NPIV host in target mode during config teardown
When we tear down the NPIV host configuration in target mode, the
qla_tgt struct was left dangling on the global list. This patch cleans
up link list and frees memory.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:17 +0000 (15:05 -0700)]
scsi: qla2xxx: Add LR distance support from nvram bit
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sawan Chandak [Wed, 23 Aug 2017 22:05:16 +0000 (15:05 -0700)]
scsi: qla2xxx: Add support for minimum link speed
Signed-off-by: Sawan Chandak <sawan.chandak@cavium.com>
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:15 +0000 (15:05 -0700)]
scsi: qla2xxx: Remove potential macro parameter side-effect in ql_dump_regs()
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:14 +0000 (15:05 -0700)]
scsi: qla2xxx: Print correct mailbox registers in failed summary
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:13 +0000 (15:05 -0700)]
scsi: qla2xxx: Fix task mgmt handling for NPIV
Fix task management response for NPIV Target mode.
Current code uses the wrong vp index.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:12 +0000 (15:05 -0700)]
scsi: qla2xxx: Allow SNS fabric login to be retried
If SNS fabric login fails, set loop resync flag to retry via dpc.
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:11 +0000 (15:05 -0700)]
scsi: qla2xxx: Add timeout ability to wait_for_sess_deletion().
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:10 +0000 (15:05 -0700)]
scsi: qla2xxx: Move logging default mask to execute once only.
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:09 +0000 (15:05 -0700)]
scsi: qla2xxx: Use sp->free instead of hard coded call.
Calling sp->free() ensures the context-correct free routine is called.
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Joe Carnuccio [Wed, 23 Aug 2017 22:05:08 +0000 (15:05 -0700)]
scsi: qla2xxx: Prevent sp->free null/uninitialized pointer dereference.
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:07 +0000 (15:05 -0700)]
scsi: qla2xxx: Add ability to autodetect SFP type
SFP can come in 2 formats: short range/SR and long range/LR. For LR,
user the can increase the number of Buffer to Buffer credits between end
points via Cavium's command line tool. By default, FW uses a lower BB
Credit value optimized for SR. This patch will read the SFP for each
link up event and during chip reset sequence. If the SFP type and
setting are mismatch, then the chip is reset 1 time to use the
appropriate setting.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:06 +0000 (15:05 -0700)]
scsi: qla2xxx: Use fabric name for Get Port Speed command
The Get Port Speed switch command needs the fabric port name of the
remote device. Current code uses the registered WWPN.
Fixes:
726b85487067d ("qla2xxx: Add framework for async fabric discovery")
Cc: <stable@vger.kernel.org> # 4.10+
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:05 +0000 (15:05 -0700)]
scsi: qla2xxx: Change ha->wq max_active value to default
Update ha->wq max_active from 1 to default. MQ interrupts are queued up
via this work queue. This allows interrupts to be process in parrallel,
instead of serialized by the work queue.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:04 +0000 (15:05 -0700)]
scsi: qla2xxx: Remove extra register read
Remove extra register read for each interrupt for performance
improvement.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Wed, 23 Aug 2017 22:05:03 +0000 (15:05 -0700)]
scsi: qla2xxx: Fix NPIV host enable after chip reset
For NPIV ports, call configure_hba() so that NPIV ports can proceed to
loop initialization.
Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sawan Chandak [Wed, 23 Aug 2017 22:05:02 +0000 (15:05 -0700)]
scsi: qla2xxx: Use BIT_6 to acquire FAWWPN from switch
If FA-WWPN feature disabled on the switch side and enabled for the
adapter, then driver would update the port name with switch port name.
This patch fixes issue by checking correct BIT flag to validate.
Fixes:
41dc529a4602 ("qla2xxx: Improve RSCN handling in driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Sawan Chandak <sawan.chandak@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Duane Grigsby [Wed, 23 Aug 2017 22:05:01 +0000 (15:05 -0700)]
scsi: qla2xxx: Fix system panic due to pointer access problem
[ 1013.772926] BUG: unable to handle kernel paging request at
0000000300000020
[ 1013.772950] IP: qla24xx_els_ct_entry.isra.17+0x78/0x2a0 [qla2xxx]
[ 1013.772951] PGD 0
[ 1013.772952] P4D 0
[ 1013.772952]
[ 1013.772953] Oops: 0000 [#1] SMP
[ 1013.772955] Modules linked in: qla2xxx(+) scsi_transport_fc nvme_fc
nvme_fabrics nvme_core netconsole configfs af_packet iscsi_ibft
iscsi_boot_sysfs xfs intel_rapl sb_edac libcrc32c x86_pkg_temp_thermal
intel_powerclamp coretemp mgag200 kvm_intel ttm kvm drm_kms_helper
ipmi_ssif irqbypass tg3 drm fb_sys_fops crct10dif_pclmul syscopyarea
crc32_pclmul ghash_clmulni_intel ptp pcbc sysfillrect pps_core
aesni_intel joydev aes_x86_64 sysimgblt crypto_simd iTCO_wdt libphy
iTCO_vendor_support i2c_algo_bit glue_helper ipmi_si lpc_ich hpwdt
ioatdma cryptd ipmi_devintf pcspkr mfd_core pcc_cpufreq ipmi_msghandler
hpilo thermal dca button shpchp btrfs xor raid6_pq hid_generic usbhid
sr_mod cdrom sd_mod ata_generic crc32c_intel serio_raw ata_piix ahci
libahci uhci_hcd ehci_pci ehci_hcd libata usbcore hpsa scsi_transport_sas
[ 1013.772994] sg scsi_mod autofs4
[ 1013.772998] CPU: 0 PID: 374 Comm: systemd-journal Not tainted 4.13.0-rc1-2-default #2
[ 1013.772999] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 07/15/2012
[ 1013.773000] task:
ffff88082c188380 task.stack:
ffffc90004d7c000
[ 1013.773011] RIP: 0010:qla24xx_els_ct_entry.isra.17+0x78/0x2a0 [qla2xxx]
[ 1013.773012] RSP: 0000:
ffff88042f603d90 EFLAGS:
00010082
[ 1013.773013] RAX:
ffff88039f723ac8 RBX:
ffff88039f723ac8 RCX:
ffff8803a2e18010
[ 1013.773014] RDX:
ffff88039f723ac0 RSI:
ffff88042f603dc4 RDI:
ffff88041b6787c0
[ 1013.773015] RBP:
ffff88042f603e00 R08:
0000000000000002 R09:
000000000000000d
[ 1013.773016] R10:
0000000000000002 R11:
0000000000000000 R12:
ffff8803a2e80080
[ 1013.773016] R13:
ffff88041b6787c0 R14:
0000000300000000 R15:
0000000000000102
[ 1013.773018] FS:
00007fa2e0a73880(0000) GS:
ffff88042f600000(0000) knlGS:
0000000000000000
[ 1013.773019] CS: 0010 DS: 0000 ES: 0000 CR0:
0000000080050033
[ 1013.773020] CR2:
0000000300000020 CR3:
000000042cd7e000 CR4:
00000000000406f0
[ 1013.773021] Call Trace:
[ 1013.773022] <IRQ>
[ 1013.773026] ? consume_skb+0x34/0xa0
[ 1013.773040] qla24xx_process_response_queue+0x319/0x700 [qla2xxx]
[ 1013.773050] qla24xx_msix_rsp_q+0x7b/0xd0 [qla2xxx]
[ 1013.773054] __handle_irq_event_percpu+0x3c/0x1b0
[ 1013.773056] handle_irq_event_percpu+0x23/0x60
[ 1013.773057] handle_irq_event+0x42/0x70
[ 1013.773059] handle_edge_irq+0x8f/0x190
[ 1013.773062] handle_irq+0x1d/0x30
[ 1013.773065] do_IRQ+0x48/0xd0
[ 1013.773067] common_interrupt+0x93/0x93
[ 1013.773068] RIP: 0033:0xed622c6e42
[ 1013.773069] RSP: 002b:
00007ffee8b5c820 EFLAGS:
00000202 ORIG_RAX:
ffffffffffffff17
[ 1013.773071] RAX:
000000ed6316a3f0 RBX:
000000ed6316a840 RCX:
00000000000c4e33
[ 1013.773071] RDX:
000000ed6316a878 RSI:
000000ed6316a840 RDI:
000000ed631682d0
[ 1013.773072] RBP:
0000000000000001 R08:
0000000000000001 R09:
000000ed63179b70
[ 1013.773073] R10:
000000000005f6f8 R11:
0000000000000202 R12:
0000000000000001
[ 1013.773074] R13:
00007ffee8b5c85c R14:
000000ed6316a840 R15:
00007ffee8b5c850
[ 1013.773074] </IRQ>
[ 1013.773076] Code: a9 8a 9a e0 48 8d 75 c4 48 89 da 4c 89 e1 4c 89 ef
e8 54 6e fb ff 48 85 c0 48 89 c3 0f 84 0e 02 00 00 44 0f b7 48 36 4c 8b
70 58 <4d> 8b 7e 20 41 8d 41 fd 66 83 f8 0c 77 6c 0f b7 c0 ff 24 c5 88
[ 1013.773102] RIP: qla24xx_els_ct_entry.isra.17+0x78/0x2a0 [qla2xxx] RSP:
ffff88042f603d90
[ 1013.773102] CR2:
0000000300000020
[ 1013.773129] ---[ end trace
532363559924f426 ]---
[ 1013.773131] Kernel panic - not syncing: Fatal exception in interrupt
[ 1013.777719] Kernel Offset: disabled
[ 1013.827528] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
Signed-off-by: Duane Grigsby <Duane.Grigsby@cavium.com>
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sawan Chandak [Wed, 23 Aug 2017 22:05:00 +0000 (15:05 -0700)]
scsi: qla2xxx: Handle PCIe error for driver
Driver will perform following
- Set PFLG_DRIVER_REMOVING flag and do not disable PCIe error reporting
during adapter shutdown.
- If PCIe device count is already zero, return correct error type from
PCI error interface.
- When device is offline, return correct error type from PCIe error
path.
- If there is board disable thread active during shutdown and PCIe
device count is zero then cancel scheduling board disable thread
during shutdown and return.
Signed-off-by: Sawan Chandak <sawan.chandak@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Darren Trap [Wed, 23 Aug 2017 22:04:59 +0000 (15:04 -0700)]
scsi: qla2xxx: Fix WWPN/WWNN in debug message
Signed-off-by: Darren Trap <darren.trap@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>