summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
Commit message (Collapse)AuthorAgeFilesLines
...
* scsi: qla2xxx: Move the <linux/io-64-nonatomic-lo-hi.h> include directiveBart Van Assche2019-04-152-1/+2
| | | | | | | | | | | | | The <linux/io-64-nonatomic-lo-hi.h> header file is included because of the readq() macro. Since that macro is only used in qla_nx.c, move that include statement into qla_nx.c. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: qla2xxx: Declare qla24xx_build_scsi_crc_2_iocbs() staticBart Van Assche2019-04-152-3/+1
| | | | | | | | | | | | Since qla24xx_build_scsi_crc_2_iocbs() is only used inside a single source file, declare this function static. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: qla2xxx: Move the port_state_str[] definition from a .h to a .c fileBart Van Assche2019-04-152-7/+9
| | | | | | | | | | | | Reduce the size of the qla2xxx kernel module by moving an array definition from a .h into a .c file. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: qla2xxx: Insert spaces where requiredBart Van Assche2019-04-159-23/+23
| | | | | | | | | | | | | Improve source code readability by inserting spaces where these are required according to the coding standard. This patch only inserts whitespace and does not make any other changes. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: qla2xxx: Fix formatting of pointer typesBart Van Assche2019-04-155-6/+6
| | | | | | | | | | | | Improve source code readability by following the Linux kernel coding style for pointer types. This patch only changes whitespace. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: qla2xxx: Leave a blank line after declarationsBart Van Assche2019-04-1514-2/+69
| | | | | | | | | | | This patch improves readability of the qla2xxx source code. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: qla2xxx: Use tabs to indent codeBart Van Assche2019-04-152-21/+21
| | | | | | | | | | | | | | Most but not all code in the qla2xxx driver uses tabs for indentation. Make the qla2xxx code easier to read by using tabs consistently for indentation. This patch improves conformance with the Linux kernel coding style. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* Merge branch '5.1/scsi-fixes' into 5.2/mergeMartin K. Petersen2019-04-122-1/+8
|\ | | | | | | | | | | | | We have a few submissions for 5.2 that depend on fixes merged post 5.1-rc1. Merge the fixes branch into queue. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Fix NULL pointer crash due to stale CPUIDHimanshu Madhani2019-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes crash due to NULL pointer derefrence because CPU pointer is not set and used by driver. Instead, driver is passes CPU as tag via ha->isp_ops->{lun_reset|target_reset} [ 30.160780] qla2xxx [0000:a0:00.1]-8038:9: Cable is unplugged... [ 69.984045] qla2xxx [0000:a0:00.0]-8009:8: DEVICE RESET ISSUED nexus=8:0:0 cmd=00000000b0d62f46. [ 69.992849] BUG: unable to handle kernel NULL pointer dereference at 0000000000000040 [ 70.000680] PGD 0 P4D 0 [ 70.003232] Oops: 0000 [#1] SMP PTI [ 70.006727] CPU: 2 PID: 6714 Comm: sg_reset Kdump: loaded Not tainted 4.18.0-67.el8.x86_64 #1 [ 70.015258] Hardware name: NEC Express5800/T110j [N8100-2758Y]/MX32-PH0-NJ, BIOS F11 02/13/2019 [ 70.024016] RIP: 0010:blk_mq_rq_cpu+0x9/0x10 [ 70.028315] Code: 01 58 01 00 00 48 83 c0 28 48 3d 80 02 00 00 75 ab c3 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8b 47 08 <8b> 40 40 c3 0f 1f 00 0f 1f 44 00 00 48 83 ec 10 48 c7 c6 20 6e 7c [ 70.047087] RSP: 0018:ffff99a481487d58 EFLAGS: 00010246 [ 70.052322] RAX: 0000000000000000 RBX: ffffffffc041b08b RCX: 0000000000000000 [ 70.059466] RDX: 0000000000000000 RSI: ffff8d10b6b16898 RDI: ffff8d10b341e400 [ 70.066615] RBP: ffffffffc03a6bd0 R08: 0000000000000415 R09: 0000000000aaaaaa [ 70.073765] R10: 0000000000000001 R11: 0000000000000001 R12: ffff8d10b341e528 [ 70.080914] R13: ffff8d10aadefc00 R14: ffff8d0f64efa998 R15: ffff8d0f64efa000 [ 70.088083] FS: 00007f90a201e540(0000) GS:ffff8d10b6b00000(0000) knlGS:0000000000000000 [ 70.096188] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 70.101959] CR2: 0000000000000040 CR3: 0000000268886005 CR4: 00000000003606e0 [ 70.109127] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 70.116277] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 70.123425] Call Trace: [ 70.125896] __qla2xxx_eh_generic_reset+0xb1/0x220 [qla2xxx] [ 70.131572] scsi_ioctl_reset+0x1f5/0x2a0 [ 70.135600] scsi_ioctl+0x18e/0x397 [ 70.139099] ? sd_ioctl+0x7c/0x100 [sd_mod] [ 70.143287] blkdev_ioctl+0x32b/0x9f0 [ 70.146954] ? __check_object_size+0xa3/0x181 [ 70.151323] block_ioctl+0x39/0x40 [ 70.154735] do_vfs_ioctl+0xa4/0x630 [ 70.158322] ? syscall_trace_enter+0x1d3/0x2c0 [ 70.162769] ksys_ioctl+0x60/0x90 [ 70.166104] __x64_sys_ioctl+0x16/0x20 [ 70.169859] do_syscall_64+0x5b/0x1b0 [ 70.173532] entry_SYSCALL_64_after_hwframe+0x65/0xca [ 70.178587] RIP: 0033:0x7f90a1b3445b [ 70.182183] Code: 0f 1e fa 48 8b 05 2d aa 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d fd a9 2c 00 f7 d8 64 89 01 48 [ 70.200956] RSP: 002b:00007fffdca88b68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 70.208535] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f90a1b3445b [ 70.215684] RDX: 00007fffdca88b84 RSI: 0000000000002284 RDI: 0000000000000003 [ 70.222833] RBP: 00007fffdca88ca8 R08: 00007fffdca88b84 R09: 0000000000000000 [ 70.229981] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fffdca88b84 [ 70.237131] R13: 0000000000000000 R14: 000055ab09b0bd28 R15: 0000000000000000 [ 70.244284] Modules linked in: nft_chain_route_ipv4 xt_CHECKSUM nft_chain_nat_ipv4 ipt_MASQUERADE nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack libcrc32c ipt_REJECT nf_reject_ipv4 nft_counter nft_compat tun bridge stp llc nf_tables nfnetli nk devlink sunrpc vfat fat intel_rapl intel_pmc_core x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm wmi_bmof iTCO_wdt iTCO_ vendor_support irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel ipmi_ssif intel_cstate intel_uncore intel_rapl_perf ipmi_si jo ydev pcspkr ipmi_devintf sg wmi ipmi_msghandler video acpi_power_meter acpi_pad mei_me i2c_i801 mei ip_tables ext4 mbcache jbd2 sr_mod cd rom sd_mod qla2xxx ast i2c_algo_bit drm_kms_helper nvme_fc syscopyarea sysfillrect uas sysimgblt fb_sys_fops nvme_fabrics ttm [ 70.314805] usb_storage nvme_core crc32c_intel scsi_transport_fc ahci drm libahci tg3 libata megaraid_sas pinctrl_cannonlake pinctrl_ intel [ 70.327335] CR2: 0000000000000040 Fixes: 9cf2bab630765 ("block: kill request ->cpu member") Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: qla2xxx: Fix FC-AL connection target discoveryQuinn Tran2019-03-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7f147f9bfd44 ("scsi: qla2xxx: Fix N2N target discovery with Local loop") fixed N2N target discovery for local loop. However, same code is used for FC-AL discovery as well. Added check to make sure we are bypassing area and domain check only in N2N topology for target discovery. Fixes: 7f147f9bfd44 ("scsi: qla2xxx: Fix N2N target discovery with Local loop") Cc: stable@vger.kernel.org # 5.0+ Signed-off-by: Quinn Tran <qtran@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: scsi_transport_fc: nvme: display FC-NVMe port rolesHannes Reinecke2019-04-123-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the FC-NVMe driver is leverating the SCSI FC transport class to access the remote ports. Which means that all FC-NVMe remote ports will be visible to the fc transport layer, but due to missing definitions the port roles will always be 'unknown'. This patch adds the missing definitions to the fc transport class to that the port roles are correctly displayed. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: James Smart <james.smart@broadcom.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Reviewed-by: Giridhar Malavali <gmalavali@marvell.com> Reviewed-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: tcm_qla2xxx: Minimize #include directivesBart Van Assche2019-04-091-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Only include those header files that are needed by the code in this source file. [mkp: include build fix from Bart for SPARC] Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Unregister resources in the opposite order of the ↵Bart Van Assche2019-04-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | registration order Make sure that resources are only unregistered after the users of these resources have been unregistered. Only unregister the character device if registration of it succeeded. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Unregister chrdev if module initialization failsBart Van Assche2019-04-081-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | If module initialization fails after the character device has been registered, unregister the character device. Additionally, avoid duplicating error path code. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <giridhar.malavali@qlogic.com> Fixes: 6a03b4cd78f3 ("[SCSI] qla2xxx: Add char device to increase driver use count") # v2.6.35. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Use get/put_unaligned where appropriateBart Van Assche2019-04-083-15/+12
| | | | | | | | | | | | | | | | | | | | This patch makes the code easier to read but does not change any functionality. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Make qla2x00_process_response_queue() easier to readBart Van Assche2019-04-081-38/+47
| | | | | | | | | | | | | | | | | | | | | | Make qla2x00_process_response_queue() easier to read by splitting this function. This patch does not change any functionality. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Reduce the number of forward declarationsBart Van Assche2019-04-081-46/+31
| | | | | | | | | | | | | | | | | | | | | | | | Move the SCSI host template definition after the definition of the functions that it references. Remove the forward declarations that became unnecessary by that change. This patch does not change any functionality. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Declare local symbols staticBart Van Assche2019-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | This patch avoids that sparse complains that a declaration is missing. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Use ARRAY_SIZE() in the definition of QLA_LAST_SPEEDBart Van Assche2019-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | Make the code easier to read by avoiding to use a hard-coded constant. This patch does not change any functionality. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Remove a comment that refers to the SCSI host lockBart Van Assche2019-04-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | Since qla2xxx_queuecommand() no longer takes the SCSI host lock, remove a comment that refers to the host lock. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Change a stack variable into a static const variableBart Van Assche2019-04-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Make qla2x00_get_host_fabric_name() slightly faster by changing a stack array into a static array. Declare that array const now that the wwn_to_u64() argument pointer has been declared const. Cc: Himanshu Madhani <hmadhani@marvell.com> Cc: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: fix spelling mistake "alredy" -> "already"Colin Ian King2019-04-081-1/+1
| | | | | | | | | | | | | | | | There is a spelling mistake in a ql_log message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Remove useless set memory to zero use memset()YueHaibing2019-04-031-1/+0
| | | | | | | | | | | | | | | | The memory return by kzalloc() has already be set to zero, so remove useless memset(0). Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Update driver version to 10.01.00.16-kHimanshu Madhani2019-04-031-1/+1
| | | | | | | | | | Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Change abort wait_loop from msleep to wait_event_timeoutGiridhar Malavali2019-04-032-39/+46
| | | | | | | | | | | | | | | | | | This patch converts driver wait time from using msleep to wair_event_timeout to prevent race condition. Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Fix driver unload when FC-NVMe LUNs are connectedGiridhar Malavali2019-04-032-8/+27
| | | | | | | | | | | | | | | | | | This patch allows driver to unload using "modprobe -r" when FC-NVMe LUNs are connected. Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Cleanup redundant qla2x00_abort_all_cmds during unloadAnil Gurumurthy2019-04-031-2/+0
| | | | | | | | | | | | | | | | This patch removes redundant qla2x00_abort_all_cmds() during driver unload. Signed-off-by: Anil Gurumurthy <agurumurthy@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Set remote port devloss timeout to 0Giridhar Malavali2019-04-031-12/+7
| | | | | | | | | | | | | | | | | | | | | | This patch sets remote_port_devloss value to 0. This indicates to FC-NVMe transport that driver is unloading and transport should not retry. Fixes: e476fe8af5ff ("scsi: qla2xxx: Fix unload when NVMe devices are configured") Cc: stable@vger.kernel.org Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Cleanup fcport memory to prevent leakQuinn Tran2019-04-032-5/+4
| | | | | | | | | | | | | | | | Clean up fcport list and loopid in one place and iterate through for loop. Signed-off-by: Quinn Tran <qtran@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Use mutex protection during qla2x00_sysfs_read_fw_dump()Quinn Tran2019-04-032-12/+19
| | | | | | | | | | | | | | | | | | | | | | Add mutex protection to prevent driver from freeing the FW dump buffer while the extraction is in progress. [mkp: commit desc] Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Fix fw dump corruptionQuinn Tran2019-04-032-32/+53
| | | | | | | | | | | | | | | | | | If fw dump buffer size changes and there is an existing fw dump, then save the old dump in the newly allocated buffer. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Further limit FLASH region write access from SysFSAndrew Vasquez2019-04-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | Recent ISPs have larger and more complex flash-write semantics (secure-access and signing). The BSG interfaces support these semantics for all ISPs and is exclusively used by QLogic user-space tools. Limit flash-write operations to ISPs <= 25xx. Signed-off-by: Andrew Vasquez <andrewv@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Fix incorrect region-size setting in optrom SYSFS routinesAndrew Vasquez2019-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit e6f77540c067 ("scsi: qla2xxx: Fix an integer overflow in sysfs code") incorrectly set 'optrom_region_size' to 'start+size', which can overflow option-rom boundaries when 'start' is non-zero. Continue setting optrom_region_size to the proper adjusted value of 'size'. Fixes: e6f77540c067 ("scsi: qla2xxx: Fix an integer overflow in sysfs code") Cc: stable@vger.kernel.org Signed-off-by: Andrew Vasquez <andrewv@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Disable T10-DIF feature with FC-NVMe during probeGiridhar Malavali2019-04-031-0/+4
| | | | | | | | | | | | | | | | | | With FC-NVMe enabled, driver does not support T10 DIF/DIX. This patch disables T10-PI information when ql2xnvmeenable is set. Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Increase the max_sgl_segments to 1024Giridhar Malavali2019-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch increases max_sgl_segments value from 128 to the maximum supported which is 1024. Increasing max_sgl_segments will allow the driver to support larger I/O sizes [mkp: commit desc tweak] Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Reset the FCF_ASYNC_{SENT|ACTIVE} flagsGiridhar Malavali2019-04-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Driver maintains state machine for processing and completing switch commands. This patch resets FCF_ASYNC_{SENT|ACTIVE} flag to indicate if the previous command is active or sent, in order for next GPSC command to advance the state machine. [mkp: commit desc typo] Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Set the qpair in SRB to NULL when SRB is releasedGiridhar Malavali2019-04-031-0/+1
| | | | | | | | | | | | | | | | | | This patch sets QPair pointer to NULL to prevent abort command racing ahead of normal command completion handling during scsi_done call. Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Set the SCSI command result before calling the command doneGiridhar Malavali2019-04-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch tries to address race condition between abort handler and completion handler. When scsi command result is set by both abort and completion handler, scsi_done() is only called after refcount on SRB structure goes to zero. The abort handler sets this result prematurely even when the refcount is non-zero value. Fix this by setting SCSI cmd->result before scsi_done() is called. Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Simplify conditional check againNathan Chancellor2019-03-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang warns when it sees a logical not on the left side of a conditional statement because it thinks the logical not should be applied to the whole statement, not just the left side: drivers/scsi/qla2xxx/qla_nx.c:3703:7: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] This particular instance was already fixed by commit 0bfe7d3cae58 ("scsi: qla2xxx: Simplify conditional check") upstream but it was reintroduced by commit 3695310e37b4 ("scsi: qla2xxx: Update flash read/write routine") in the 5.2/scsi-queue. Fixes: 3695310e37b4 ("scsi: qla2xxx: Update flash read/write routine") Link: https://github.com/ClangBuiltLinux/linux/issues/80 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Fix a small typo in qla_bsg.cMilan P. Gandhi2019-03-191-1/+1
| | | | | | | | | | | | | | Fixed a typo for 'iiDMA' cmd in qla_bsg.c. Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Fix comment alignment in qla_bsg.cMilan P. Gandhi2019-03-191-1/+1
| | | | | | | | | | | | | | Fixed a minor formatting issue with comment section in qla_bsg.c Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Use HCTX_TYPE_DEFAULT for blk_mq_tag_set->mapDongli Zhang2019-03-191-1/+1
| | | | | | | | | | | | | | Use HCTX_TYPE_DEFAULT instead of 0 to avoid hardcoding. Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Update driver version to 10.01.00.15-kHimanshu Madhani2019-03-191-2/+2
| | | | | | | | | | | | | | This version includes support for ISP28XX. Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Secure flash update support for ISP28XXMichael Hernandez2019-03-199-49/+616
| | | | | | | | | | | | | | | | This patch adds support for Secure flash update with ISP28xx. Signed-off-by: Michael Hernandez <mhernandez@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanismJoe Carnuccio2019-03-198-97/+470
| | | | | | | | | | | | | | | | | | | | | | | | | | Includes the following: - correction to 27xx image status struct; - factoring of 27xx image status validating routines to make common; - image status generation compare that works across zero wrap; - bsg interface to report current active images (as loaded by driver). Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Mike Hernandez <mhernandez@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Simplification of register address used in qla_tmpl.cJoe Carnuccio2019-03-191-44/+27
| | | | | | | | | | | | | | | | Reduce stack space on each fwdt routine by eliminating local variable reg. Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Correction and improvement to fwdt processingJoe Carnuccio2019-03-192-20/+25
| | | | | | | | | | | | | | | | | | This patch cleans up and fixes firmware dump template processing. These changes are added to support newer features for ISP27XX/ISP28XX. Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Update flash read/write routineJoe Carnuccio2019-03-197-312/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes following changes to flash access routines: - update return type for read_optrom - use void instead of uint32_t * for buffer parameter in read and write optrom routines - fix flash/nvram addressing Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Add support for multiple fwdump templates/segmentsJoe Carnuccio2019-03-197-223/+304
| | | | | | | | | | | | | | | | | | This patch adds multipe firmware dump template and segments support for ISP27XX/28XX. Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Cleanups for NVRAM/Flash read/write pathJoe Carnuccio2019-03-1915-274/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does following: - Clean up NVRAM code. - Optimizes reading of primary/secondary flash image validation. - Remove 0xff mask and make correct width in FLT structure. - Use endian macros to assign static fields in fwdump header. - Correct fdwt checksum calculation. - Simplify ql_dump_buffer() interface usage. - Add endianizers to 27xx firmware image validator. - fixes compiler warnings for big endian architecture. Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>