aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
AgeCommit message (Collapse)AuthorFilesLines
2019-01-29scsi: hisi_sas: Fix losing directly attached disk when hot-plugXiaofei Tan4-9/+56
Hot-plugging SAS wire of direct hard disk backplane may cause disk lost. We have done this test with several types of SATA disk from different venders, and only two models from Seagate has this problem, ST4000NM0035-1V4107 and ST3000VM002-1ET166. The root cause is that the disk doesn't send D2H frame after OOB finished. SAS controller will issue phyup interrupt only when D2H frame is received, otherwise, will be waiting there all the time. When this issue happen, we can find the disk again with link reset. To fix this issue, we setup an timer after OOB finished. If the PHY is not up in 20s, do link reset. Notes: the 20s is an experience value. Signed-off-by: Xiaofei Tan <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: Reject setting programmed minimum linkrate > 1.5GLuo Jiaxing1-4/+8
The SAS controller cannot support a programmed minimum linkrate of > 1.5G (it will always negotiate to 1.5G at least), so just reject it. This solves a strange situation where the PHY negotiated linkrate may be less than the programmed minimum linkrate. Signed-off-by: Luo Jiaxing <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: Remove unused parameter of function hisi_sas_alloc()Xiang Chen3-4/+4
In function hisi_sas_alloc(), parameter shost is not used, so remove it. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()Xiang Chen3-16/+0
When issing a hardreset to a SATA device when running IO, it is possible that abnormal CQs of the device are returned. Then enter error handler, it doesn't enter function hisi_sas_abort_task() as there is no timeout IO, and it doesn't set device as HISI_SAS_DEV_EH. So when hardreset by libata later, it actually doesn't issue hardreset as there is a check to judge whether device is in error. For this situation, actually need to hardreset the device to recover. So remove the check of sas_dev status in hisi_sas_I_T_nexus_reset(). Before we add the check to avoid the endless loop of reset for directly-attached SATA device at probe time, actually we flutter it for it, so it is not necessary to add the check now. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: shutdown axi bus to avoid exception CQ returnedXiang Chen1-0/+12
When injecting 2 bit ECC error, it will cause fatal AXI interrupts. Before the recovery of SAS controller reset, the internal of SAS controller is in error. If CQ interrupts return at the time, actually it is exception CQ interrupt, and it may cause resource release in disorder. To avoid the exception situation, shutdown AXI bus after fatal AXI interrupt. In SAS controller reset, it will restart AXI bus. For later version of v3 hw, hardware will shutdown AXI bus for this situation, so just fix current ver of v3 hw. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: send primitive NOTIFY to SSP situation onlyXiang Chen5-8/+9
Send primitive NOTIFY to SSP situation only, or it causes underflow issue when sending IO. Also rename hisi_sas_hw.sl_notify() to hisi_sas_hw. sl_notify_ssp(). Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: Add debugfs ITCT file and add file operationsLuo Jiaxing1-0/+33
This patch creates debugfs file for ITCT and adds file operations. Signed-off-by: Luo Jiaxing <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: Fix type casting and missing static qualifier in debugfs codeJohn Garry2-12/+13
Sparse can detect some type casting issues in the debugfs code, so fix it up. Also a missing static qualifier is added to hisi_sas_debugfs_to_reg_name(). Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hisi_sas: No need to check return value of debugfs_create functionsJohn Garry2-37/+17
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: 53c700: pass correct "dev" to dma_alloc_attrs()Dan Carpenter1-1/+1
The "hostdata->dev" pointer is NULL here. We set "hostdata->dev = dev;" later in the function and we also use "hostdata->dev" when we call dma_free_attrs() in NCR_700_release(). This bug predates git version control. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: bnx2fc: Fix error handling in probe()Dan Carpenter1-2/+2
There are two issues here. First if cmgr->hba is not set early enough then it leads to a NULL dereference. Second if we don't completely initialize cmgr->io_bdt_pool[] then we end up dereferencing uninitialized pointers. Fixes: 853e2bd2103a ("[SCSI] bnx2fc: Broadcom FCoE offload driver") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: pcmcia: nsp_cs: Remove unnecessary parenthesesNathan Chancellor1-1/+2
Clang warns: drivers/scsi/pcmcia/nsp_cs.c:1137:27: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) { ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/pcmcia/nsp_cs.c:1137:27: note: remove extraneous parentheses around the comparison to silence this warning if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) { ~ ^ ~ drivers/scsi/pcmcia/nsp_cs.c:1137:27: note: use '=' to turn this equality comparison into an assignment if ((tmpSC->SCp.Message == MSG_COMMAND_COMPLETE)) { ^~ = 1 warning generated. Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: nsp32: Remove unnecessary self assignment in nsp32_set_sync_entryNathan Chancellor1-1/+0
Clang warns: drivers/scsi/nsp32.c:2444:14: warning: explicitly assigning value of variable of type 'unsigned char' to itself [-Wself-assign] offset = offset; ~~~~~~ ^ Signed-off-by: Nathan Chancellor <[email protected]> Acked-by: GOTO Masanori <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: scsi_debug: fix write_same with virtual_gb problemDouglas Gilbert1-20/+21
The WRITE SAME(10) and (16) implementations didn't take account of the buffer wrap required when the virtual_gb parameter is greater than 0. Fix that and rename the fake_store() function to lba2fake_store() to lessen confusion with the global fake_storep pointer. Bump version date. Signed-off-by: Douglas Gilbert <[email protected]> Reported-by: Bart Van Assche <[email protected]> Tested by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: prefix header search paths with $(srctree)/Masahiro Yamada2-2/+2
Currently, the Kbuild core manipulates header search paths in a crazy way [1]. To fix this mess, I want all Makefiles to add explicit $(srctree)/ to the search paths in the srctree. Some Makefiles are already written in that way, but not all. The goal of this work is to make the notation consistent, and finally get rid of the gross hacks. Having whitespaces after -I does not matter since commit 48f6e3cf5bc6 ("kbuild: do not drop -I without parameter"). [1]: https://patchwork.kernel.org/patch/9632347/ Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: remove unneeded header search pathsMasahiro Yamada3-4/+0
I was able to build without these extra header search paths. Especially, the header search path -I. in kernel Makefiles is always suspicious; it allows the compiler to search for headers in the top of $(srctree), where obviously no header file exists. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: libfc: free skb when receiving invalid flogi respMing Lu1-3/+3
The issue to be fixed in this commit is when libfc found it received a invalid FLOGI response from FC switch, it would return without freeing the fc frame, which is just the skb data. This would cause memory leak if FC switch keeps sending invalid FLOGI responses. This fix is just to make it execute `fc_frame_free(fp)` before returning from function `fc_lport_flogi_resp`. Signed-off-by: Ming Lu <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: fnic: Remove set but not used variable 'vdev'YueHaibing2-6/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/fnic/vnic_wq.c: In function 'vnic_wq_alloc_bufs': drivers/scsi/fnic/vnic_wq.c:50:19: warning: variable 'vdev' set but not used [-Wunused-but-set-variable] drivers/scsi/fnic/vnic_rq.c: In function 'vnic_rq_alloc_bufs': drivers/scsi/fnic/vnic_rq.c:30:19: warning: variable 'vdev' set but not used [-Wunused-but-set-variable] Never used since introduction. Signed-off-by: YueHaibing <[email protected]> Acked-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: sd: Protect against READ(6) or WRITE(6) with zero block transfer lengthBart Van Assche1-0/+4
Since the READ(6) and WRITE(6) commands interpret a zero in the transfer length field in the CDB as 256 logical blocks, avoid submitting such commands. Cc: Douglas Gilbert <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Christoph Hellwig <[email protected]> Reported-by: Douglas Gilbert <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Douglas Gilbert <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: libsas: Remove scsi_to_u32()Bart Van Assche1-4/+5
Since the function scsi_to_u32() is identical to get_unaligned_be32(), change all scsi_to_u32() calls into get_unaligned_be32() calls. Cc: Jian Luo <[email protected]> Cc: John Garry <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: hpsa: clean up two indentation issuesColin Ian King1-2/+2
There are two statements that are indented incorrectly. Fix these. Signed-off-by: Colin Ian King <[email protected]> Acked-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: qla2xxx: no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-42/+1
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: [email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: qedf: no need to check return value of debugfs_create functionsGreg Kroah-Hartman2-31/+4
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: [email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Manish Rangankar <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: lpfc: no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-170/+0
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: James Smart <[email protected]> Cc: Dick Kennedy <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: snic: no need to check return value of debugfs_create functionsGreg Kroah-Hartman5-133/+32
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Karan Tilak Kumar <[email protected]> Cc: Sesidhar Baddela <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: fnic: no need to check return value of debugfs_create functionsGreg Kroah-Hartman5-108/+10
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Satish Kharat <[email protected]> Cc: Sesidhar Baddela <[email protected]> Cc: Karan Tilak Kumar <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Satish Kharat <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: csiostor: no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-5/+1
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: Varun Prakash <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Johannes Thumshirn <[email protected]> Cc: Oza Pawandeep <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: bfa: no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-18/+0
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. [mkp: removed unused label] Cc: Anil Gurumurthy <[email protected]> Cc: Sudarsana Kalluru <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: fcoe: remove unneeded fcoe_ctlr_destroy_store exportGreg Kroah-Hartman1-1/+0
There's no need to export fcoe_ctlr_destroy_store as a symbol, so remove the EXPORT_SYMBOL() line for it. Cc: Johannes Thumshirn <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-29scsi: fcoe: convert to use BUS_ATTR_WOGreg Kroah-Hartman1-2/+13
We are trying to get rid of BUS_ATTR() and the usage of that in the fcoe driver can be trivially converted to use BUS_ATTR_WO(), so use that instead. Cc: Johannes Thumshirn <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-28Merge 5.0-rc4 into char-misc-nextGreg Kroah-Hartman54-286/+346
We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-01-26Merge tag 'scsi-fixes' of ↵Linus Torvalds8-22/+31
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Six fixes, all of which appear to have user visible consequences. The DMA one is a regression fix from the merge window and of the others, four are driver specific and one specific to the target code" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: Use explicit access size in ufshcd_dump_regs scsi: tcmu: fix use after free scsi: csiostor: fix NULL pointer dereference in csio_vport_set_state() scsi: lpfc: nvmet: avoid hang / use-after-free when destroying targetport scsi: lpfc: nvme: avoid hang / use-after-free when destroying localport scsi: communicate max segment size to the DMA mapping code
2019-01-22scsi: arcmsr: Update driver version to v1.40.00.10-20190116Ching Huang1-1/+1
From Ching Huang <[email protected]> Update driver version to v1.40.00.10-20190116. Signed-off-by: Ching Huang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: arcmsr: Fix suspend/resume of ACB_ADAPTER_TYPE_B part 2Ching Huang1-1/+5
From Ching Huang <[email protected]> For ACB_ADAPTER_TYPE_B controller, the read/write after hibernate and resume may sometimes result in 'isr get an illegal ccb command' in /var/log/messages. This patch fixes it. Signed-off-by: Ching Huang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: arcmsr: Use dma_alloc_coherent to replace dma_zalloc_coherentChing Huang1-3/+3
From Ching Huang <[email protected]> dma_zalloc_coherent will be phased out. Use dma_alloc_coherent instead. Signed-off-by: Ching Huang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: Update fnic driver version to 1.6.0.47Satish Kharat1-1/+1
Update fnic driver to version 1.6.0.47. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: Enable fnic devcmd2 interfaceSatish Kharat3-1/+29
This patch adds changes to check if fnic devcmd2 interface is exported by the firmware. If devcmd2 interfaces is exported, driver starts using it else falls back to fnic devcmd1 interface. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: Adding devcmd2 init and posting interfacesSatish Kharat1-4/+219
This patch adds fnic devcmd2 interfaces for initialization and posting commands to fw. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: Add devcmd2 initialization helpersSatish Kharat2-0/+74
This patch adds the devcmd2 wq initalization and devcmd2 ring allocation helper interfaces used by devcmd2 init. [mkp: typos] Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: fnic devcmd2 controller definitionsSatish Kharat1-2/+28
This patch adds the fnic devcmd2 controller definitions. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: fnic devcmd2 interface definitionsSatish Kharat2-2/+163
This patch adds the fnic devcmd2 command structre and the command result structure definitions. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: Impose upper limit on max. # of CQs processed per intrSatish Kharat3-4/+11
Impose an upper limit on the max number of CQ entries (corresponding to the copy wq) processed in an interrupt. Use module parameter to set the limit. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: RQ enable and then post descriptorsSatish Kharat2-3/+4
Do RQ enable before posting descriptor. This is needed for later hw revisions. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: delaying vnic dev enable till after req intrSatish Kharat1-2/+2
Doing vnic_device_enable before this could cause interrupts to happen before they are setup. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: Warn when calling done for IO not issued to fwSatish Kharat1-2/+8
The change is to print warning when scsi done is called for an IO that has not yet been issued to the fw. Also adding sc and tag to debug print when IO is cleaned up. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: fnic stats for max CQs processed and ISR timeSatish Kharat3-0/+28
This change is to add fnic stats for the max number of CQs (corresponding to copy WQ) processed in a given interrupt, max time taken by the ISR. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: Add port speed stat to fnic debug statsSatish Kharat3-0/+12
This patch adds the current fnic port speed stat to fnic debug stats. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: use fnic_lock to guard fnic->state_flagsSatish Kharat1-6/+5
Need to use fnic_lock as well as host lock in that order to set state flags. [mkp: typos] Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: vnic_rq_clean change BUG_ON to WARN_ONSatish Kharat1-1/+1
rq->ctrl not enabled when this is called is bad but not fatal and can continue. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2019-01-22scsi: fnic: change fnic queue depth to 256Satish Kharat1-1/+1
This patch changes the default lun queuedepth for fnic to 256. Signed-off-by: Satish Kharat <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>