aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-10scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HWXiang Chen1-2/+8
If we fail to notify the phy up event then undo the RPM resume, as the phy up notify event handling pairs with that RPM resume. Link: https://lore.kernel.org/r/[email protected] Reported-by: Yihang Li <[email protected]> Tested-by: Yihang Li <[email protected]> Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Update driver version to 8.0.0.69.0Sumit Saxena1-2/+2
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Add support for NVMe passthroughSumit Saxena3-3/+378
Add support for management applications to send an MPI3 Encapsulated NVMe passthru command to the NVMe devices attached to an Avenger controller. Since the NVMe drives are exposed as SCSI devices by the controller, the standard NVMe applications cannot be used to interact with the drives and the command sets supported are also limited by the controller firmware. Special handling is required for MPI3 Encapsulated NVMe passthru commands for PRP/SGL setup in the commands. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Expose adapter state to sysfsSumit Saxena3-1/+48
Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Add support for PEL commandsSumit Saxena4-1/+592
Implement driver support for management applications to enable persistent event log (PEL) notifications. Upon receipt of events, the driver will increment a sysfs variable named event_counter. The management application will poll for event_counter value changes and signal the application about events. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Add support for MPT commandsSumit Saxena4-3/+574
There are certain management commands which require firmware intervention. These commands are termed MPT commands. Add support for them. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Move data structures/definitions from MPI headers to uapi headerSumit Saxena5-100/+119
This patch moves the data structures/definitions which are used by userspace applications from MPI headers to uapi/scsi/scsi_bsg_mpi3mr.h Link: https://lore.kernel.org/r/[email protected] Reported by: Stephen Rothwell <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Add support for driver commandsSumit Saxena7-22/+887
There are certain bsg commands which need to be completed by the driver without involving firmware. These requests are termed driver commands. Add support for these. Link: https://lore.kernel.org/r/[email protected] Reported by: Stephen Rothwell <[email protected]> Reported-by: kernel test robot <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpi3mr: Add bsg device supportSumit Saxena5-0/+129
Create bsg device per controller for controller management purposes. bsg device nodes will be named /dev/bsg/mpi3mrctl0, /dev/bsg/mpi3mrctl1, etc. Link: https://lore.kernel.org/r/[email protected] Reported-by: kernel test robot <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: sr: Add memory allocation failure handling for get_capabilities()Enze Li1-6/+8
The function get_capabilities() has the possibility of failing to allocate the transfer buffer but it does not currently handle this. This may lead to exceptions when accessing the buffer. Add error handling when memory allocation fails. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Enze Li <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: target: tcmu: Fix possible data corruptionXiaoguang Wang1-3/+37
When tcmu_vma_fault() gets a page successfully, before the current context completes page fault procedure, find_free_blocks() may run and call unmap_mapping_range() to unmap the page. Assume that when find_free_blocks() initially completes and the previous page fault procedure starts to run again and completes, then one truncated page has been mapped to userspace. But note that tcmu_vma_fault() has gotten a refcount for the page so any other subsystem won't be able to use the page unless the userspace address is unmapped later. If another command subsequently runs and needs to extend dbi_thresh it may reuse the corresponding slot for the previous page in data_bitmap. Then though we'll allocate new page for this slot in data_area, no page fault will happen because we have a valid map and the real request's data will be lost. Filesystem implementations will also run into this issue but they usually lock the page when vm_operations_struct->fault gets a page and unlock the page after finish_fault() completes. For truncate filesystems lock pages in truncate_inode_pages() to protect against racing wrt. page faults. To fix this possible data corruption scenario we can apply a method similar to the filesystems. For pages that are to be freed, tcmu_blocks_release() locks and unlocks. Make tcmu_vma_fault() also lock found page under cmdr_lock. At the same time, since tcmu_vma_fault() gets an extra page refcount, tcmu_blocks_release() won't free pages if pages are in page fault procedure, which means it is safe to call tcmu_blocks_release() before unmap_mapping_range(). With these changes tcmu_blocks_release() will wait for all page faults to be completed before calling unmap_mapping_range(). And later, if unmap_mapping_range() is called, it will ensure stale mappings are removed. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bodo Stroesser <[email protected]> Signed-off-by: Xiaoguang Wang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: lpfc: Remove redundant lpfc_sli_prep_wqe() callJames Smart1-2/+0
Prior patch added a call to lpfc_sli_prep_wqe() prior to lpfc_sli_issue_iocb(). This call should not have been added as prep_wqe is called within the issue_iocb routine. So it's called twice now. Remove the redundant prep call. Link: https://lore.kernel.org/r/[email protected] Fixes: 31a59f75702f ("scsi: lpfc: SLI path split: Refactor Abort paths") Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: lpfc: Fix additional reference counting in lpfc_bsg_rport_els()James Smart1-6/+0
Code inspection has found an additional reference is taken in lpfc_bsg_rport_els(). Results in the ndlp not being freed thus is leaked. Fix by removing the redundant refcount taken before WQE submission. Link: https://lore.kernel.org/r/[email protected] Co-developed-by: Nigel Kirkland <[email protected]> Signed-off-by: Nigel Kirkland <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: sd: Reorganize DIF/DIX code to avoid calling revalidate twiceMartin K. Petersen2-34/+36
During device discovery we ended up calling revalidate twice and thus requested the same parameters multiple times. This was originally necessary due to the request_queue and gendisk needing to be instantiated to configure the block integrity profile. Since this dependency no longer exists, reorganize the integrity probing code so it can be run once at the end of discovery and drop the superfluous revalidate call. Postponing the registration step involves splitting sd_read_protection() into two functions, one to read the device protection type and one to configure the mode of operation. As part of this cleanup, make the printing code a bit less verbose. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: sd: Optimal I/O size should be a multiple of reported granularityMartin K. Petersen2-4/+42
Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of physical block size") validated the reported optimal I/O size against the physical block size to overcome problems with devices reporting nonsensical transfer sizes. However, some devices claim conformity to older SCSI versions that predate the physical block size being reported. Other devices do not report a physical block size at all. We need to be able to validate the optimal I/O size on those devices as well. Many devices report an OPTIMAL TRANSFER LENGTH GRANULARITY in the same VPD page as the OPTIMAL TRANSFER LENGTH. Use this value to validate the optimal I/O size. Also check that the reported granularity is a multiple of the physical block size, if supported. Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Reported-by: Bernhard Sulzer <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: sd: Switch to using scsi_device VPD pagesMartin K. Petersen1-40/+40
Use the VPD pages already provided by the SCSI midlayer. No need to request them individually in the SCSI disk driver. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: sd: Use cached ATA Information VPD pageMartin K. Petersen1-3/+5
Since the ATA Information VPD is now cached at device discovery time it is no longer necessary to request this page when we configure WRITE SAME. Instead use the cached information to determine if this disk sits behind a SCSI-ATA translation layer. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: core: Do not truncate INQUIRY data on modern devicesMartin K. Petersen1-1/+11
Low-level device drivers have had the ability to limit the size of an INQUIRY for many years. This made sense for a wide variety of legacy devices. However, we are unnecessarily truncating the INQUIRY response for many modern devices. This prevents us from consulting fields beyond the first 36 bytes. If a device reports that it supports a larger INQUIRY response, and the device also reports that it implements SPC-4 or newer, allow the larger INQUIRY to proceed. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: core: Cache VPD pages b0, b1, b2Martin K. Petersen3-0/+38
The SCSI disk driver consults VPD pages b0 (Block Limits), b1 (Block Device Characteristics), and b2 (Logical Block Provisioning). Instead of having sd.c request these pages every revalidate cycle, cache them along with the other commonly used VPDs. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: core: Pick suitable allocation length in scsi_report_opcode()Martin K. Petersen1-4/+13
Some devices hang when a buffer size larger than expected is passed in the ALLOCATION LENGTH field. For REPORT SUPPORTED OPERATION CODES we currently only request a single command descriptor at a time and therefore the actual size of the command is known ahead of time. Limit the ALLOCATION LENGTH to the header size plus the command length of the opcode we are asking about. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: core: Query VPD size before getting full pageMartin K. Petersen2-32/+62
We currently default to 255 bytes when fetching VPD pages during discovery. However, we have had a few devices that are known to wedge if the requested buffer exceeds a certain size. See commit af73623f5f10 ("[SCSI] sd: Reduce buffer size for vpd request") which works around one example of this problem in the SCSI disk driver. With commit d188b0675b21 ("scsi: core: Add sysfs attributes for VPD pages 0h and 89h") we now risk triggering the same issue in the generic midlayer code. The problem with the ATA VPD page in particular is that the SCSI portion of the page is trailed by 512 bytes of verbatim ATA Identify Device information. However, not all controllers actually provide the additional 512 bytes and will lock up if one asks for more than the 64 bytes containing the SCSI protocol fields. Instead of picking a new, somewhat arbitrary, number of bytes for the VPD buffer size, start fetching the 4-byte header for each page. The header contains the size of the page as far as the device is concerned. We can use the reported size to specify the correct allocation length when subsequently fetching the full page. The header validation is done by a new helper function scsi_get_vpd_size() and both scsi_get_vpd_page() and scsi_get_vpd_buf() now rely on this to query the page size. In addition, scsi_get_vpd_page() is simplified to mirror the logic in scsi_get_vpd_page(). This involves removing the Supported VPD Pages lookup prior to attempting to query a page. There does not appear any evidence, even in the oldest SCSI specs, that this step is required. We already rely on scsi_get_vpd_page() throughout the stack and this function never consulted the Supported VPD Pages. Since this has not caused any problems it should be safe to remove the precondition from scsi_get_vpd_page(). Instrumented runs also revealed that the Supported VPD Pages lookup had little effect since the device page index often was larger than the supplied buffer size. As a result, inquiries frequently bypassed the index check and went through the "If we ran off the end of the buffer, give us the benefit of the doubt" code path which assumed the page was present despite not being listed. The revised code takes both the page size reported by the device as well as the size of the buffer provided by the scsi_get_vpd_page() caller into account. Link: https://lore.kernel.org/r/[email protected] Fixes: d188b0675b21 ("scsi: core: Add sysfs attributes for VPD pages 0h and 89h") Reported-by: Maciej W. Rozycki <[email protected]> Tested-by: Maciej W. Rozycki <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-02scsi: mpt3sas: Use cached ATA Information VPD pageMartin K. Petersen1-10/+8
We now cache VPD page 0x89 (ATA Information) so there is no need to request it from the hardware. Make mpt3sas use the cached page. Link: https://lore.kernel.org/r/[email protected] Cc: Sreekanth Reddy <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: lpfc: Fix resource leak in lpfc_sli4_send_seq_to_ulp()James Smart1-2/+4
If no handler is found in lpfc_complete_unsol_iocb() to match the rctl of a received frame, the frame is dropped and resources are leaked. Fix by returning resources when discarding an unhandled frame type. Update lpfc_fc_frame_check() handling of NOP basic link service. Link: https://lore.kernel.org/r/[email protected] Co-developed-by: Justin Tee <[email protected]> Signed-off-by: Justin Tee <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: lpfc: Remove unnecessary null ndlp check in lpfc_sli_prep_wqe()James Smart1-1/+1
Smatch had the following warning: drivers/scsi/lpfc/lpfc_sli.c:22305 lpfc_sli_prep_wqe() error: we previously assumed 'ndlp' could be null (see line 22298) Remove the unnecessary null check. Link: https://lore.kernel.org/r/[email protected] Fixes: d51cf5bd926c ("scsi: lpfc: Fix field overload in lpfc_iocbq data structure") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: ufs: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()Minghao Chi1-4/+2
Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync() and pm_runtime_put_noidle(). This change is just to simplify the code, no actual functional changes. Link: https://lore.kernel.org/r/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: Minghao Chi <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: megaraid: Fix error check return value of register_chrdev()Lv Ruyi1-1/+1
If major equals 0, register_chrdev() returns an error code when it fails. This function dynamically allocates a major and returns its number on success, so we should use "< 0" to check it instead of "!". Link: https://lore.kernel.org/r/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: Lv Ruyi <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: qla2xxx: edif: Remove unneeded variableGuo Zhengkui1-2/+1
Fix the following coccicheck warning: drivers/scsi/qla2xxx/qla_edif.c:660:11-15: Unneeded variable: "rval". Return "0" on line 761. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guo Zhengkui <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: dc395x: Fix a missing check on list iteratorXiaomeng Tong1-3/+12
The bug is here: p->target_id, p->target_lun); The list iterator 'p' will point to a bogus position containing HEAD if the list is empty or no element is found. This case must be checked before any use of the iterator, otherwise it will lead to an invalid memory access. To fix this bug, add a check. Use a new variable 'iter' as the list iterator, and use the original variable 'p' as a dedicated pointer to point to the found element. Link: https://lore.kernel.org/r/[email protected] Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: [email protected] Signed-off-by: Xiaomeng Tong <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: qedf: Remove an unneeded NULL check on list iteratorXiaomeng Tong1-3/+3
The list iterator 'fcport' is always non-NULL so it doesn't need to be checked. Thus just remove the unnecessary NULL check. Also remove the unnecessary initializer because the list iterator is always initialized. And adjust the position of blank lines. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xiaomeng Tong <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: ufs: core: Remove duplicate include in ufshcdWan Jiabing1-1/+0
Fix following checkincludes warning: drivers/scsi/ufs/ufshcd.c: linux/nls.h is included more than once. The include is in line 14. Remove the duplicate. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Wan Jiabing <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: ufs: core: Exclude UECxx from SFR dump listKiwoong Kim1-1/+6
Some devices may return invalid or zeroed data during an UIC error condition. In addition, reading these SFRs will clear them. This means the subsequent error handling will not be able to see them and therefore no error handling will be scheduled. Skip reading these SFRs in ufshcd_dump_regs(). Link: https://lore.kernel.org/r/[email protected] Fixes: d67247566450 ("scsi: ufs: Use explicit access size in ufshcd_dump_regs") Signed-off-by: Kiwoong Kim <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-26scsi: core: Refine how we set tag_set NUMA nodeJohn Garry2-5/+5
For SCSI hosts which enable host_tagset the NUMA node returned from blk_mq_hw_queue_to_node() is NUMA_NO_NODE always. Then, since in scsi_mq_setup_tags() the default we choose for the tag_set NUMA node is NUMA_NO_NODE, we always evaluate the NUMA node as NUMA_NO_NODE in functions like blk_mq_alloc_rq_map(). The reason we get NUMA_NO_NODE from blk_mq_hw_queue_to_node() is that the hctx_idx passed is BLK_MQ_NO_HCTX_IDX - so we can't match against a (HW) queue mapping index. Improve this by defaulting the tag_set NUMA node to the same NUMA node of the SCSI host DMA dev. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: lpfc: Remove unneeded variableChangcheng Deng1-2/+1
Remove unneeded variable 'rc' used to store return value. Link: https://lore.kernel.org/r/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: Changcheng Deng <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: fnic: Remove unneeded flush_workqueue()ran jianping1-3/+1
All work currently pending will be done first by calling destroy_workqueue(). There is no need to flush it explicitly. Link: https://lore.kernel.org/r/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: ran jianping <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: qla2xxx: Remove unneeded flush_workqueue()ran jianping1-1/+0
All work currently pending will be done first by calling destroy_workqueue(). There is no need to flush it explicitly. Link: https://lore.kernel.org/r/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: ran jianping <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: bfa: Remove unneeded flush_workqueue()ran jianping1-1/+0
All work currently pending will be done first by calling destroy_workqueue(). There is no need to flush it explicitly. Link: https://lore.kernel.org/r/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: ran jianping <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: qedf: Remove unnecessary codeHaowen Bai1-2/+0
Buffer 'msg' is memset() but never actually used. Drop it. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haowen Bai <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: qla4xxx: Drop redundant memset()Haowen Bai1-1/+0
The region set by the call to memset() is immediately overwritten by the subsequent call to memcpy(). Drop redundant memset(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haowen Bai <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: ipr: Directly return instead of using local ret variableHaowen Bai1-2/+1
Fixes coccinelle warning: ./drivers/scsi/ipr.c:10095:13-15: Unneeded variable: "rc". Return "IRQ_HANDLED" on line 10104 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haowen Bai <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: elx: efct: Remove unnecessary memset() in efct_io()Wan Jiabing1-1/+0
io->sgl is allocated by kzalloc(). The memory is set to zero. It is unnecessary to call memset again. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wan Jiabing <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: message: fusion: Remove unused variable retvalAlexander Vorwerk1-3/+0
The following warning showed up when compiling with W=1. drivers/message/fusion/mptctl.c: In function ‘mptctl_hp_hostinfo’: drivers/message/fusion/mptctl.c:2337:8: warning: variable ‘retval’ set but not used [-Wunused-but-set-variable] int retval; Fixing by removing the variable. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexander Vorwerk <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: aha1542: Remove unneeded semicolonHaowen Bai1-10/+10
Fixes coccicheck warning: drivers/scsi/aha1542.c:553:2-3: Unneeded semicolon drivers/scsi/aha1542.c:582:2-3: Unneeded semicolon drivers/scsi/aha1542.c:605:2-3: Unneeded semicolon drivers/scsi/aha1542.c:306:2-3: Unneeded semicolon drivers/scsi/aha1542.c:348:3-4: Unneeded semicolon drivers/scsi/aha1542.c:412:2-3: Unneeded semicolon drivers/scsi/aha1542.c:640:2-3: Unneeded semicolon drivers/scsi/aha1542.c:658:2-3: Unneeded semicolon drivers/scsi/aha1542.c:677:2-3: Unneeded semicolon drivers/scsi/aha1542.c:538:2-3: Unneeded semicolon Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haowen Bai <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: bfa: Remove redundant NULL checkHaowen Bai1-2/+1
Fix the following warning reported by coccicheck: drivers/scsi/bfa/bfad_debugfs.c:375:2-7: WARNING: NULL check before some freeing functions is not needed. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haowen Bai <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: fnic: Remove redundant NULL checkHaowen Bai1-2/+1
Fix the following warning reported by coccicheck: drivers/scsi/fnic/fnic_debugfs.c:90:2-7: WARNING: NULL check before some freeing functions is not needed. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haowen Bai <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: mac53c94: Fix warning comparing pointer to 0Haowen Bai1-1/+1
Fix the following coccicheck warning: drivers/scsi/mac53c94.c:237:12-13: WARNING comparing pointer to 0 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Haowen Bai <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: aacraid: Fix undefined behavior due to shift overflowing the constantBorislav Petkov1-1/+1
Fix: drivers/scsi/aacraid/commsup.c: In function ‘aac_handle_sa_aif’: drivers/scsi/aacraid/commsup.c:1983:2: error: case label does not reduce to an integer constant case SA_AIF_BPCFG_CHANGE: ^~~~ See https://lore.kernel.org/r/YkwQ6%[email protected] for the gory details as to why it triggers with older gccs only. Link: https://lore.kernel.org/r/[email protected] Cc: Adaptec OEM Raid Solutions <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Cc: [email protected] Reviewed-by: Randy Dunlap <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: scsi_debug: Add gap zone supportDamien Le Moal1-25/+104
Add the 'zone_cap_mb' kernel module parameter. This parameter defines the zone capacity. The zone capacity must be less than or equal to the zone size. Report that sequential write zones and gap zones are paired in the Zoned Block Device Characteristics VPD page (page B6h). This patch has been tested as follows: modprobe scsi_debug delay=0 sector_size=512 dev_size_mb=128 zbc=host-managed zone_nr_conv=16 zone_size_mb=4 zone_cap_mb=3 modprobe brd rd_nr=1 rd_size=$((1<<20)) mkfs.f2fs -m /dev/ram0 -c /dev/${scsi_debug_dev} mount /dev/ram0 /mnt # Run a fio job that uses /mnt Link: https://lore.kernel.org/r/[email protected] Cc: Douglas Gilbert <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> [ bvanassche: Switched to reporting a constant zone starting LBA granularity ] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: scsi_debug: Rename zone type constantsDamien Le Moal1-9/+9
Rename the scsi_debug zone type constants to prevent a conflict with the ZBC_ZONE_TYPE_GAP constant from include/scsi/scsi_proto.h. Link: https://lore.kernel.org/r/[email protected] Cc: Douglas Gilbert <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> [ bvanassche: Extracted these changes from a larger patch ] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: scsi_debug: Fix a typoBart Van Assche1-1/+1
Change a single occurrence of "nad" into "and". Link: https://lore.kernel.org/r/[email protected] Cc: Douglas Gilbert <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-04-25scsi: sd: sd_zbc: Hide gap zonesDamien Le Moal3-14/+105
ZBC-2 allows host-managed disks to report gap zones. This allow zoned disks to report an offset between data zone starts that is a power of two even if the number of logical blocks with data per zone is not a power of two. Another new feature in ZBC-2 is support for constant zone starting LBA offsets. For zoned disks that report a constant zone starting LBA offset, hide the gap zones from the block layer. Report the offset between data zone starts as zone size and report the number of logical blocks with data per zone as the zone capacity. Link: https://lore.kernel.org/r/[email protected] Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> [ bvanassche: Reworked this patch ] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>