aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-04-05scsi: smartpqi: Add support for RAID5 and RAID6 writesDon Brace2-6/+268
Add in new IU definition and implement support for RAID5 and RAID6 writes. Link: https://lore.kernel.org/r/161549372734.25025.963261942897080281.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Refactor scatterlist codeDon Brace1-59/+42
Factor out code common to all scatter-gather list building to prepare for new AIO functionality. AIO (Accelerated I/O) requests go directly to disk No functional changes. Link: https://lore.kernel.org/r/161549372147.25025.9706613054649682229.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Refactor aio submission codeDon Brace2-246/+360
Refactor aio submission code: 1. Break up function pqi_raid_bypass_submit_scsi_cmd() into smaller functions. 2. Add common block (rmd - raid_map_data) to carry around into newly added functions. 3. Prepare for new AIO functionality. No functional changes. Link: https://lore.kernel.org/r/161549371553.25025.8840958689316611074.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Reviewed-by: Martin Wilck <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Add support for new product idsKevin Barnett4-1/+23
Add support for newer hardware by adding in a product identifier. This identifier can then be used to check for the hardware generation. Link: https://lore.kernel.org/r/161549370966.25025.2968242206975557607.stgit@brunhilda Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Martin Wilck <[email protected]> Signed-off-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Correct request leakage during reset operationsMurthy Bhat1-0/+4
While failing queued I/Os in TMF path, there was a request leak and hence stale entries in request pool with ref count being non-zero. In shutdown path we have a BUG_ON to catch stuck I/O either in firmware or in the driver. The stale requests caused a system crash. The I/O request pool leakage also lead to a significant performance drop. Link: https://lore.kernel.org/r/161549370379.25025.12793264112620796062.stgit@brunhilda Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Murthy Bhat <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05scsi: smartpqi: Use host-wide tag spaceDon Brace1-0/+1
Correct SCSI midlayer sending more requests than exposed host queue depth causing firmware ASSERT and lockup issues by enabling host-wide tags. Note: This also results in better performance. Link: https://lore.kernel.org/r/161549369787.25025.8975999483518581619.stgit@brunhilda Suggested-by: Ming Lei <[email protected]> Suggested-by: John Garry <[email protected]> Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-05Merge branch '5.12/scsi-fixes' into 5.13/scsi-stagingMartin K. Petersen20-103/+168
Pull 5.12/scsi-fixes into the 5.13 SCSI tree to provide a baseline for some UFS changes that would otherwise cause conflicts during the merge. Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: message: mptlan: Replace one-element array with flexible-array memberGustavo A. R. Silva2-8/+5
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members"[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Refactor the code according to the use of a flexible-array member in struct _SGE_TRANSACTION32 instead of one-element array. Also, this helps with the ongoing efforts to enable -Warray-bounds by fixing the following warning: CC [M] drivers/message/fusion/mptlan.o drivers/message/fusion/mptlan.c: In function ‘mpt_lan_sdu_send’: drivers/message/fusion/mptlan.c:759:28: warning: array subscript 1 is above array bounds of ‘U32[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds] 759 | pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) | | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/20210324233344.GA99059@embeddedor Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: message: fusion: Replace one-element array with flexible-array memberGustavo A. R. Silva1-1/+1
There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members"[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. Also, this helps with the ongoing efforts to enable -Warray-bounds by fixing the following warning: drivers/message/fusion/mptbase.c: In function ‘mptbase_reply’: drivers/message/fusion/mptbase.c:7747:62: warning: array subscript 1 is above array bounds of ‘U32[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds] 7747 | ioc->events[idx].data[ii] = le32_to_cpu(pEventReply->Data[ii]); ./include/uapi/linux/byteorder/little_endian.h:34:51: note: in definition of macro ‘__le32_to_cpu’ 34 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ drivers/message/fusion/mptbase.c:7747:33: note: in expansion of macro ‘le32_to_cpu’ 7747 | ioc->events[idx].data[ii] = le32_to_cpu(pEventReply->Data[ii]); | [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/109 Link: https://lore.kernel.org/r/20210324230036.GA67851@embeddedor Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: fcoe: Fix mismatched fcoe_wwn_from_mac declarationArnd Bergmann1-1/+1
An old cleanup changed the array size from MAX_ADDR_LEN to unspecified in the declaration, but now gcc-11 warns about this: drivers/scsi/fcoe/fcoe_ctlr.c:1972:37: error: argument 1 of type ‘unsigned char[32]’ with mismatched bound [-Werror=array-parameter=] 1972 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ In file included from /git/arm-soc/drivers/scsi/fcoe/fcoe_ctlr.c:33: include/scsi/libfcoe.h:252:37: note: previously declared as ‘unsigned char[]’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); | ~~~~~~~~~~~~~~^~~~~ Change the type back to what the function definition uses. Link: https://lore.kernel.org/r/[email protected] Fixes: fdd78027fd47 ("[SCSI] fcoe: cleans up libfcoe.h and adds fcoe.h for fcoe module") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: lpfc: Fix gcc -Wstringop-overread warningArnd Bergmann1-4/+2
gcc-11 warns about an strnlen with a length larger than the size of the passed buffer: drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_nvme_info_show': drivers/scsi/lpfc/lpfc_attr.c:518:25: error: 'strnlen' specified bound 4095 exceeds source size 24 [-Werror=stringop-overread] 518 | strnlen(LPFC_NVME_INFO_MORE_STR, PAGE_SIZE - 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In this case, the code is entirely valid, as the string is properly terminated, and the size argument is only there out of extra caution in case it exceeds a page. This cannot really happen here, so just simplify it to a sizeof(). Link: https://lore.kernel.org/r/[email protected] Fixes: afff0d2321ea ("scsi: lpfc: Add Buffer overflow check, when nvme_info larger than PAGE_SIZE") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: mvsas: Avoid -Wempty-body warningArnd Bergmann1-1/+1
Building with 'make W=1' shows a few harmless -Wempty-body warning for the mvsas driver: drivers/scsi/mvsas/mv_94xx.c: In function 'mvs_94xx_phy_reset': drivers/scsi/mvsas/mv_94xx.c:278:63: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 278 | mv_dprintk("phy hard reset failed.\n"); | ^ drivers/scsi/mvsas/mv_sas.c: In function 'mvs_task_prep': drivers/scsi/mvsas/mv_sas.c:723:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 723 | SAS_ADDR(dev->sas_addr)); | ^ Change the empty dprintk() macros to no_printk(), which avoids this warning and adds format string checking. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: message: fusion: Avoid -Wempty-body warningsArnd Bergmann1-3/+4
There are a couple of warnings in this driver when building with W=1: drivers/message/fusion/mptbase.c: In function 'PrimeIocFifos': drivers/message/fusion/mptbase.c:4608:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 4608 | "restoring 64 bit addressing\n", ioc->name)); | ^ drivers/message/fusion/mptbase.c:4633:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 4633 | "restoring 64 bit addressing\n", ioc->name)); The macros are slightly suboptimal since are not proper statements. Change both versions to the usual "do { ... } while (0)" style to make them more robust and avoid the warning. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-04-01scsi: aic94xx: Avoid -Wempty-body warningArnd Bergmann1-1/+1
Building with 'make W=1' shows a harmless -Wempty-body warning: drivers/scsi/aic94xx/aic94xx_init.c: In function 'asd_free_queues': drivers/scsi/aic94xx/aic94xx_init.c:858:62: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 858 | ASD_DPRINTK("Uh-oh! Pending is not empty!\n"); Change the empty ASD_DPRINTK() macro to no_printk(), which avoids this warning and adds format string checking. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: myrs: Make symbols DAC960_{GEM/BA/LP}_privdata staticShixin Liu1-3/+3
This symbol is not used outside of myrs.c, so we can mark it static. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Shixin Liu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: myrb: Make symbols DAC960_{LA/PG/PD/P}_privdata staticShixin Liu1-4/+4
This symbol is not used outside of myrb.c, so we can mark it static. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Shixin Liu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: advansys: Fix spelling of 'is'ganjisheng1-1/+1
s/isi/is/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: ganjisheng <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: a100u2w: Remove unused variable biosaddrColin Ian King1-3/+0
The variable biosaddr is being assigned a value that is never read, the variable is redundant and can be safely removed. Link: https://lore.kernel.org/r/[email protected] Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: core: scsi_host_cmd_pool is declared twiceWan Jiabing1-1/+0
struct scsi_host_cmd_pool has already been declared. Remove the duplicate. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wan Jiabing <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qedi: Remove redundant assignment to variable errColin Ian King1-3/+1
Variable err is assigned -ENOMEM followed by an error return path via label err_udev that does not access the variable and returns with the -ENOMEM error return code. The assignment to err is redundant and can be removed. Link: https://lore.kernel.org/r/[email protected] Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: core: Remove duplicate declarationsWan Jiabing1-2/+0
struct request and struct request_queue are declared twice. Remove the duplicate declarations. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wan Jiabing <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: core: Fix comment typodudengke1-1/+1
s/remoed/removed/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: dudengke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: fnic: Remove bogus ratelimit messagesLee Duncan1-6/+8
Commit b43abcbbd5b1 ("scsi: fnic: Ratelimit printks to avoid flooding when vlan is not set by the switch.i") added printk_ratelimit() in front of a couple of debug-mode messages to reduce logging overrun when debugging the driver. The code: > if (printk_ratelimit()) > FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, > "Start VLAN Discovery\n"); ends up calling printk_ratelimit() quite often, triggering many kernel messages about callbacks being supressed. The fix is to decompose FNIC_FCS_DBG(), then change the order of checks so that printk_ratelimit() is only called if driver debugging is enabled. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Laurence Oberman <[email protected]> Signed-off-by: Lee Duncan <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Update version to 10.02.00.106-kNilesh Javali1-2/+2
Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Do logout even if fabric scan retries got exhaustedQuinn Tran1-0/+4
Perform logout of all remote ports so that all I/Os with driver are requeued with midlayer for retry. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Saurav Kashyap <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Update default AER debug maskQuinn Tran1-1/+1
Use PCIe AER debug mask as default. Link: https://lore.kernel.org/r/[email protected] Tested-by: Laurence Oberman <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Fix mailbox recovery during PCIe errorQuinn Tran1-9/+30
For the mailbox thread that encounters a PCIe error, pause that thread until PCIe link reset/recovery has completed to prevent the thread from possibly unmapping any type of DMA resource that might be in progress. Link: https://lore.kernel.org/r/[email protected] Tested-by: Laurence Oberman <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Fix crash in PCIe error handlingQuinn Tran10-105/+265
BUG: unable to handle kernel NULL pointer dereference at (null) IP: qla2x00_abort_isp+0x21/0x6b0 [qla2xxx] PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 0 PID: 1715 Comm: kworker/0:2 Tainted: GOE 4.12.14-122.37-default #1 SLE12-SP5 Hardware name: HPE Superdome Flex/Superdome Flex, BIOS Bundle:3.30.100 SFW:IP147.007.004.017.000.2009211957 09/21/2020 Workqueue: events aer_recover_work_func task: ffff9e399c14ca80 task.stack: ffffc1c58e4ac000 RIP: 0010:qla2x00_abort_isp+0x21/0x6b0 [qla2xxx] RSP: 0018:ffffc1c58e4afd50 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff9e419cdef480 RCX: 0000000000000000 RDX: ffff9e399c14ca80 RSI: 0000000000000246 RDI: ffff9e419bbc27b8 RBP: ffff9e419bbc27b8 R08: 0000000000000004 R09: 00000000a0440000 R10: 0000000000000000 R11: ffff9e399416d1a0 R12: ffff9e419cdef000 R13: ffff9e3a7cfae800 R14: ffff9e3a7cfae800 R15: 00000000000000c0 FS: 0000000000000000(0000) GS:ffff9e39a0000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000006cd00a005 CR4: 00000000007606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: qla2xxx_pci_slot_reset+0x141/0x160 [qla2xxx] report_slot_reset+0x41/0x80 ? merge_result.part.4+0x30/0x30 pci_walk_bus+0x70/0x90 pcie_do_recovery+0x1db/0x2e0 aer_recover_work_func+0xc2/0xf0 process_one_work+0x14c/0x390 Disable board_disable logic where driver resources are freed while OS is in the process of recovering the adapter. Link: https://lore.kernel.org/r/[email protected] Tested-by: Laurence Oberman <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Fix RISC RESET completion pollingQuinn Tran1-6/+59
After RISC RESET, the poll time for completion is too short. Fix the completion polling time. Link: https://lore.kernel.org/r/[email protected] Tested-by: Laurence Oberman <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Fix crash in qla2xxx_mqueuecommand()Arun Easi1-7/+0
RIP: 0010:kmem_cache_free+0xfa/0x1b0 Call Trace: qla2xxx_mqueuecommand+0x2b5/0x2c0 [qla2xxx] scsi_queue_rq+0x5e2/0xa40 __blk_mq_try_issue_directly+0x128/0x1d0 blk_mq_request_issue_directly+0x4e/0xb0 Fix incorrect call to free srb in qla2xxx_mqueuecommand(), as srb is now allocated by upper layers. This fixes smatch warning of srb unintended free. Link: https://lore.kernel.org/r/[email protected] Fixes: af2a0c51b120 ("scsi: qla2xxx: Fix SRB leak on switch command timeout") Cc: [email protected] # 5.5 Reported-by: Laurence Oberman <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Arun Easi <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Fix use after free in bsgQuinn Tran1-1/+2
On bsg command completion, bsg_job_done() was called while qla driver continued to access the bsg_job buffer. bsg_job_done() would free up resources that ended up being reused by other task while the driver continued to access the buffers. As a result, driver was reading garbage data. localhost kernel: BUG: KASAN: use-after-free in sg_next+0x64/0x80 localhost kernel: Read of size 8 at addr ffff8883228a3330 by task swapper/26/0 localhost kernel: localhost kernel: CPU: 26 PID: 0 Comm: swapper/26 Kdump: loaded Tainted: G OE --------- - - 4.18.0-193.el8.x86_64+debug #1 localhost kernel: Hardware name: HP ProLiant DL360 Gen9/ProLiant DL360 Gen9, BIOS P89 08/12/2016 localhost kernel: Call Trace: localhost kernel: <IRQ> localhost kernel: dump_stack+0x9a/0xf0 localhost kernel: print_address_description.cold.3+0x9/0x23b localhost kernel: kasan_report.cold.4+0x65/0x95 localhost kernel: debug_dma_unmap_sg.part.12+0x10d/0x2d0 localhost kernel: qla2x00_bsg_sp_free+0xaf6/0x1010 [qla2xxx] Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Saurav Kashyap <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Consolidate zio threshold setting for both FCP & NVMeQuinn Tran2-21/+14
Consolidate zio threshold setting for both FCP & NVMe to prevent one protocol from clobbering the setting of the other protocol. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Fix stuck sessionQuinn Tran2-1/+7
Session was stuck due to explicit logout to target timing out. The target was in an unresponsive state. This timeout induced an error to the GNL command from moving forward. Link: https://lore.kernel.org/r/[email protected] Tested-by: Laurence Oberman <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Add H:C:T info in the log message for fc portsArun Easi1-4/+5
The host:channel:scsi_target_id information is helpful in matching an FC port with a SCSI device, so add it. For initiator FC ports, a -1 would be displayed for "target" part. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Arun Easi <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: qla2xxx: Fix IOPS drop seen in some adaptersArun Easi1-0/+19
Removing the response queue processing in the send path is showing IOPS drop. Add back the process_response_queue() call in the send path. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Arun Easi <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-29scsi: iscsi: Fix race condition between login and sync threadGulam Mohamed2-1/+14
A kernel panic was observed due to a timing issue between the sync thread and the initiator processing a login response from the target. The session reopen can be invoked both from the session sync thread when iscsid restarts and from iscsid through the error handler. Before the initiator receives the response to a login, another reopen request can be sent from the error handler/sync session. When the initial login response is subsequently processed, the connection has been closed and the socket has been released. To fix this a new connection state, ISCSI_CONN_BOUND, is added: - Set the connection state value to ISCSI_CONN_DOWN upon iscsi_if_ep_disconnect() and iscsi_if_stop_conn() - Set the connection state to the newly created value ISCSI_CONN_BOUND after bind connection (transport->bind_conn()) - In iscsi_set_param(), return -ENOTCONN if the connection state is not either ISCSI_CONN_BOUND or ISCSI_CONN_UP Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Gulam Mohamed <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> index 91074fd97f64..f4bf62b007a0 100644
2021-03-24scsi: target: pscsi: Clean up after failure in pscsi_map_sg()Martin Wilck1-0/+8
If pscsi_map_sg() fails, make sure to drop references to already allocated bios. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Lee Duncan <[email protected]> Signed-off-by: Martin Wilck <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: target: pscsi: Avoid OOM in pscsi_map_sg()Martin Wilck1-1/+0
pscsi_map_sg() uses the variable nr_pages as a hint for bio_kmalloc() how many vector elements to allocate. If nr_pages is < BIO_MAX_PAGES, it will be reset to 0 after successful allocation of the bio. If bio_add_pc_page() fails later for whatever reason, pscsi_map_sg() tries to allocate another bio, passing nr_vecs = 0. This causes bio_add_pc_page() to fail immediately in the next call. pci_map_sg() continues to allocate zero-length bios until memory is exhausted and the kernel crashes with OOM. This can be easily observed by exporting a SATA DVD drive via pscsi. The target crashes as soon as the client tries to access the DVD LUN. In the case I analyzed, bio_add_pc_page() would fail because the DVD device's max_sectors_kb (128) was exceeded. Avoid this by simply not resetting nr_pages to 0 after allocating the bio. This way, the client receives an I/O error when it tries to send requests exceeding the devices max_sectors_kb, and eventually gets it right. The client must still limit max_sectors_kb e.g. by an udev rule if (like in my case) the driver doesn't report valid block limits, otherwise it encounters I/O errors. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Lee Duncan <[email protected]> Signed-off-by: Martin Wilck <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: pm8001: Avoid -Wrestrict warningArnd Bergmann1-1/+5
On some configurations, gcc warns about overlapping source and destination arguments to snprintf: drivers/scsi/pm8001/pm8001_init.c: In function 'pm8001_request_msix': drivers/scsi/pm8001/pm8001_init.c:977:3: error: 'snprintf' argument 4 may overlap destination object 'pm8001_ha' [-Werror=restrict] 977 | snprintf(drvname, len, "%s-%d", pm8001_ha->name, i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/pm8001/pm8001_init.c:962:56: note: destination object referenced by 'restrict'-qualified argument 1 was declared here 962 | static u32 pm8001_request_msix(struct pm8001_hba_info *pm8001_ha) | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ I first assumed this was a gcc bug, as that should not happen, but a reduced test case makes it clear that this happens when the loop counter is not bounded by the array size. Help the compiler out by adding an explicit limit here to make the code slightly more robust and avoid the warning. Link: https://godbolt.org/z/6T1qPM Link: https://lore.kernel.org/r/[email protected] Acked-by: Jack Wang <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: lpfc: Fix a typoBhaskar Chowdhury1-1/+1
s/conditons/conditions/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bhaskar Chowdhury <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: esp_scsi: Trivial typo fixesBhaskar Chowdhury1-2/+2
s/conditon/condition/ s/pecularity/peculiarity/ Link: https://lore.kernel.org/r/[email protected] Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Bhaskar Chowdhury <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: bfa: Fix a typo in two placesBhaskar Chowdhury1-2/+2
s/defintions/definitions/ ....two different places. Link: https://lore.kernel.org/r/[email protected] Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Bhaskar Chowdhury <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: lpfc: Fix a typowengjianfeng1-3/+3
Change 'lenth' to 'length'. Link: https://lore.kernel.org/r/[email protected] Acked-by: Randy Dunlap <[email protected]> Signed-off-by: wengjianfeng <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: scsi_dh: Fix a typoBhaskar Chowdhury2-2/+2
s/infrastruture/infrastructure/ [mkp: combined .c and .h patches] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bhaskar Chowdhury <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> frog
2021-03-24scsi: bnx2fc: Fix a typoBhaskar Chowdhury1-1/+1
s/struture/structure/ Link: https://lore.kernel.org/r/[email protected] Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Bhaskar Chowdhury <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: mpt3sas: Fix a typoBhaskar Chowdhury1-1/+1
s/encloure/enclosure/ Link: https://lore.kernel.org/r/[email protected] Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Bhaskar Chowdhury <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: csiostor: Fix a typoBhaskar Chowdhury1-1/+1
s/boudaries/boundaries/ Link: https://lore.kernel.org/r/[email protected] Acked-by: Randy Dunlap <[email protected]> Signed-off-by: Bhaskar Chowdhury <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: ufs: Remove unnecessary NULL checks in ↵Yue Hu1-3/+3
ufshcd_find_max_sup_active_icc_level() vcc/vccq/vccq2 have already been NULL checked at this point in ufshcd_find_max_sup_active_icc_level(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Yue Hu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: bfa: Fix warning comparing pointer to 0Jiapeng Chong1-1/+1
Fix the following coccicheck warning: ./drivers/scsi/bfa/bfad_bsg.c:3412:29-30: WARNING comparing pointer to 0. Link: https://lore.kernel.org/r/1615880930-120780-1-git-send-email-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot <[email protected]> Signed-off-by: Jiapeng Chong <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2021-03-24scsi: qla1280: Fix warning comparing pointer to 0Jiapeng Chong1-1/+1
Fix the following coccicheck warning: ./drivers/scsi/qla1280.c:3057:37-38: WARNING comparing pointer to 0. Link: https://lore.kernel.org/r/1615780159-94708-1-git-send-email-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot <[email protected]> Signed-off-by: Jiapeng Chong <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>