commit 8697934682f1873b7b1cb9cc61b81edf042c9272 Author: Arun Easi Date: Fri Jan 10 01:19:56 2025 -0800 scsi: fnic: Propagate SCSI error code from fnic_scsi_drv_init() Propagate scsi_add_host() error instead of returning -1. Suggested-by: Dan Carpenter Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Signed-off-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250110091956.17749-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 54428671aac88dd11074c47cb7e7726e41d40f4a Author: Karan Tilak Kumar Date: Fri Jan 10 01:19:24 2025 -0800 scsi: fnic: Test for memory allocation failure and return error code Fix kernel test robot warning. Test for memory allocation failure, and free memory for queues allocated in a multiqueue and non-multiqueue scenario. Return appropriate error code. Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202412312347.FE4ZgEoM-lkp@intel.com/ Reported-by: Julia Lawall Closes: https://lore.kernel.org/r/202412312347.FE4ZgEoM-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250110091924.17729-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 3986001ca11ec630d631467d788aac513c61cb52 Author: Karan Tilak Kumar Date: Fri Jan 10 01:18:42 2025 -0800 scsi: fnic: Return appropriate error code from failure of scsi drv init Return appropriate error code from fnic_probe caused by failure of fnic_scsi_drv_init. Fix bug report. Suggested-by: Dan Carpenter Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250110091842.17711-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 7dbe3aa2f3f83949174b64860dadfaeec3454cff Author: Karan Tilak Kumar Date: Fri Jan 10 01:17:46 2025 -0800 scsi: fnic: Return appropriate error code for mem alloc failure Return appropriate error code from fnic_probe when memory create slab pool fails. Fix bug report. Suggested-by: Dan Carpenter Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250110091746.17671-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 0620efe789a73586b5b3ed38b27d1b69b2150958 Author: Arun Easi Date: Fri Jan 10 01:16:55 2025 -0800 scsi: fnic: Remove always-true IS_FNIC_FCP_INITIATOR macro IS_FNIC_FCP_INITIATOR macro is not applicable at this time. Delete the macro. Suggested-by: Dan Carpenter Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Signed-off-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250110091655.17643-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 8ccc5947f5d1608f7217cdbee532c7fc2431f7c9 Author: Dheeraj Reddy Jonnalagadda Date: Wed Jan 8 10:39:16 2025 +0530 scsi: fnic: Fix use of uninitialized value in debug message The oxid variable in fdls_process_abts_req() was only being initialized inside the if (tport) block, but was being used in a debug print statement after that block. If tport was NULL, oxid would remain uninitialized. Move the oxid initialization to happen at declaration using FNIC_STD_GET_OX_ID(fchdr). Fixes: f828af44b8dd ("scsi: fnic: Add support for unsolicited requests and responses") Closes: https://scan7.scan.coverity.com/#/project-view/52337/11354?selectedIssue=1602772 Signed-off-by: Dheeraj Reddy Jonnalagadda Link: https://lore.kernel.org/r/20250108050916.52721-1-dheeraj.linuxdev@gmail.com Reviewed-by: Karan Tilak Kumar Signed-off-by: Martin K. Petersen commit 17789f8a5b81356fc83cf20de899fc351679574e Author: Dan Carpenter Date: Tue Jan 7 16:35:19 2025 +0300 scsi: fnic: Delete incorrect debugfs error handling Debugfs functions are not supposed to require error checking and, in fact, adding checks would normally lead to the driver refusing to load when CONFIG_DEBUGFS is disabled. What saves us here is that this code checks for NULL instead of error pointers so the error checking is all dead code. Delete it. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/a5c237cd-449b-4f9d-bcff-6285fb7c28d1@stanley.mountain Reviewed-by: Karan Tilak Kumar Signed-off-by: Martin K. Petersen commit bab8551e33f7f5e8743ccb49be41fe3228178e8a Author: Karan Tilak Kumar Date: Mon Jan 6 14:44:51 2025 -0800 scsi: fnic: Remove unnecessary else to fix warning in FDLS FIP Implement review comments from Martin: Remove unnecessary else from fip.c to fix a warning. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250106224451.3597-3-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 6cfba11510d6f4d0e863fc0fa939c7a983cf13bd Author: Karan Tilak Kumar Date: Mon Jan 6 14:44:50 2025 -0800 scsi: fnic: Remove extern definition from .c files Implement review comments from Martin: Remove extern definition of fnic_fip_queue from .c files Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250106224451.3597-2-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 5b6179d4b661e3c22ffa5f3fe2523bad4cd01983 Author: Karan Tilak Kumar Date: Mon Jan 6 14:44:49 2025 -0800 scsi: fnic: Remove unnecessary else and unnecessary break in FDLS Incorporate review comments from Martin: Remove unnecessary else and unnecessary break to fix warnings in the FDLS code. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20250106224451.3597-1-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 295006f6e8c17212d3098811166e29627d19e05c Author: Guixin Liu Date: Tue Jan 7 10:20:32 2025 +0800 scsi: mpi3mr: Fix possible crash when setting up bsg fails If bsg_setup_queue() fails, the bsg_queue is assigned a non-NULL value. Consequently, in mpi3mr_bsg_exit(), the condition "if(!mrioc->bsg_queue)" will not be satisfied, preventing execution from entering bsg_remove_queue(), which could lead to the following crash: BUG: kernel NULL pointer dereference, address: 000000000000041c Call Trace: mpi3mr_bsg_exit+0x1f/0x50 [mpi3mr] mpi3mr_remove+0x6f/0x340 [mpi3mr] pci_device_remove+0x3f/0xb0 device_release_driver_internal+0x19d/0x220 unbind_store+0xa4/0xb0 kernfs_fop_write_iter+0x11f/0x200 vfs_write+0x1fc/0x3e0 ksys_write+0x67/0xe0 do_syscall_64+0x38/0x80 entry_SYSCALL_64_after_hwframe+0x78/0xe2 Fixes: 4268fa751365 ("scsi: mpi3mr: Add bsg device support") Signed-off-by: Guixin Liu Link: https://lore.kernel.org/r/20250107022032.24006-1-kanie@linux.alibaba.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1e95c798d8a7f70965f0f88d4657b682ff0ec75f Author: Guixin Liu Date: Wed Dec 18 09:42:14 2024 +0800 scsi: ufs: bsg: Set bsg_queue to NULL after removal Currently, this does not cause any issues, but I believe it is necessary to set bsg_queue to NULL after removing it to prevent potential use-after-free (UAF) access. Signed-off-by: Guixin Liu Link: https://lore.kernel.org/r/20241218014214.64533-3-kanie@linux.alibaba.com Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit fcf247deb3c3e1c6be5774e3fa03bbd018eff1a9 Author: Guixin Liu Date: Wed Dec 18 09:42:13 2024 +0800 scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails We should remove the bsg device when bsg_setup_queue() fails to release the resources. Fixes: df032bf27a41 ("scsi: ufs: Add a bsg endpoint that supports UPIUs") Signed-off-by: Guixin Liu Link: https://lore.kernel.org/r/20241218014214.64533-2-kanie@linux.alibaba.com Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit 98b37881b7492ae9048ad48260cc8a6ee9eb39fd Author: Kai Mäkisara Date: Mon Dec 16 13:37:55 2024 +0200 scsi: st: Don't set pos_unknown just after device recognition Commit 9604eea5bd3a ("scsi: st: Add third party poweron reset handling") in v6.6 added new code to handle the Power On/Reset Unit Attention (POR UA) sense data. This was in addition to the existing method. When this Unit Attention is received, the driver blocks attempts to read, write and some other operations because the reset may have rewinded the tape. Because of the added code, also the initial POR UA resulted in blocking operations, including those that are used to set the driver options after the device is recognized. Also, reading and writing are refused, whereas they succeeded before this commit. Add code to not set pos_unknown to block operations if the POR UA is received from the first test_ready() call after the st device has been created. This restores the behavior before v6.6. Signed-off-by: Kai Mäkisara Link: https://lore.kernel.org/r/20241216113755.30415-1-Kai.Makisara@kolumbus.fi Fixes: 9604eea5bd3a ("scsi: st: Add third party poweron reset handling") CC: stable@vger.kernel.org Closes: https://lore.kernel.org/linux-scsi/2201CF73-4795-4D3B-9A79-6EE5215CF58D@kolumbus.fi/ Signed-off-by: Martin K. Petersen commit 77a4157ac75c67d1793c972f172dae215ccc75ad Author: wangdicheng Date: Fri Dec 6 15:19:26 2024 +0800 scsi: aic7xxx: Fix build 'aicasm' warning When building with CONFIG_AIC7XXX_BUILD_FIRMWARE=y or CONFIG_AIC79XX_BUILD_FIRMWARE=y, the warning messages are as follows: aicasm_gram.tab.c:1722:16: warning: implicit declaration of function ‘yylex’ [-Wimplicit-function-declaration] aicasm_macro_gram.c:68:25: warning: implicit declaration of function ‘mmlex’ [-Wimplicit-function-declaration] aicasm_scan.l:417:6: warning: implicit declaration of function ‘mm_switch_to_buffer’ aicasm_scan.l:418:6: warning: implicit declaration of function ‘mmparse’ aicasm_scan.l:421:6: warning: implicit declaration of function ‘mm_delete_buffer’ The solution is to add the corresponding function declaration to the corresponding file. Signed-off-by: wangdicheng Signed-off-by: huanglei Link: https://lore.kernel.org/r/20241206071926.63832-1-wangdich9700@163.com Signed-off-by: Martin K. Petersen commit 815940bb7db7b37d058d76a575827287eebe39ce Author: Avri Altman Date: Fri Jan 3 10:02:04 2025 +0200 scsi: Revert "scsi: ufs: core: Probe for EXT_IID support" This reverts commit 6e1d850acff9477ae4c18a73c19ef52841ac2010. Although added a while ago, to date no one make use of ext_iid, specifically incorporates it in the upiu header. Therefore, remove it as it is currently unused and not serving any purpose. Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20250103080204.63951-1-avri.altman@wdc.com Cc: Can Guo Cc: Asutosh Das Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d2138eab8cde61e0e6f62d0713e45202e8457d6d Author: Easwar Hariharan Date: Tue Jan 7 17:28:40 2025 +0000 scsi: storvsc: Ratelimit warning logs to prevent VM denial of service If there's a persistent error in the hypervisor, the SCSI warning for failed I/O can flood the kernel log and max out CPU utilization, preventing troubleshooting from the VM side. Ratelimit the warning so it doesn't DoS the VM. Closes: https://github.com/microsoft/WSL/issues/9173 Signed-off-by: Easwar Hariharan Link: https://lore.kernel.org/r/20250107-eahariha-ratelimit-storvsc-v1-1-7fc193d1f2b0@linux.microsoft.com Reviewed-by: Michael Kelley Signed-off-by: Martin K. Petersen commit 37d061e1ace17a376eda34b10dde28b144296534 Author: John Garry Date: Tue Jan 7 15:33:25 2025 +0000 scsi: scsi_debug: Constify sdebug_driver_template It's better to have sdebug_driver_template as const, so update the probe path to set the shost members directly after allocation and make that change. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20250107153325.1689432-1-john.g.garry@oracle.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d102c6d589c29c220fd11808381df11a4501647f Author: Randy Dunlap Date: Sat Dec 21 13:25:39 2024 -0800 scsi: documentation: Corrections for struct updates Update scsi_mid_low_api.rst for changes to struct scsi_host and struct scsi_cmnd. struct scsi_host: - no_async_abort is gone - drop sh_list w/ no replacement - change my_devices to __devices struct scsi_cmnd: - removed 'done' (now in struct scsi_driver); use scsi_done() or scsi_done_direct() callbacks - change previous request_bufflen to scsi_bufflen() - change previous use_sg field to scsi_dma_map() or scsi_sg_count() - change previous request_buffer field to reference to 'usg_sg' text [mkp: removed more obsolete stuff] Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241221212539.1314560-1-rdunlap@infradead.org Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Martin K. Petersen commit defb7541dac0e0da862421297685425ab9ee89b2 Author: Randy Dunlap Date: Tue Dec 17 16:07:48 2024 -0800 scsi: driver-api: documentation: Change what is added to docbook For scsi_devinfo.c, use :export: so that exported symbols are put into the docbook. Drop :internal: -- they aren't needed in the docbook. For scsi_proc.c, drop :internal:. This will cause all documented private (as is already done) and exported symbols to be added to the docbook. For scsi_scan.c, switch from :internal: to :export: so that exported symbols are put into the generated docbook. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241218000748.932850-1-rdunlap@infradead.org Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Martin K. Petersen commit d4842e578771bc907511c424492513aa5c224082 Author: Randy Dunlap Date: Thu Dec 12 12:52:17 2024 -0800 scsi: transport: sas: spi: Fix kernel-doc for exported functions Fix kernel-doc for sas_port_alloc(), sas_port_alloc_num(), and spi_dv_device(). This allows them to be part of the SCSI driver-api docbook. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241212205217.597844-6-rdunlap@infradead.org CC: James E.J. Bottomley CC: Martin K. Petersen Signed-off-by: Martin K. Petersen commit d2f4084c5273bf2f1486fa2e055a7da8efb20de8 Author: Randy Dunlap Date: Thu Dec 12 12:52:16 2024 -0800 scsi: scsi_scan: Add kernel-doc for exported function Add kernel-doc for scsi_add_device() since it is exported. This allows it to be part of the SCSI driver-api docbook. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241212205217.597844-5-rdunlap@infradead.org CC: James E.J. Bottomley CC: Martin K. Petersen Signed-off-by: Martin K. Petersen commit 39d2112ab7c8050642fdc2830a0a3edc5337827f Author: Randy Dunlap Date: Thu Dec 12 12:52:15 2024 -0800 scsi: scsi_lib: Add kernel-doc for exported functions Add kernel-doc for scsi_failures_reset_retries() and scsi_alloc_request() since these are exported. This allows them to be part of the SCSI driver-api docbook. Fix kernel-doc comments for scsi_vpd_tpg_id() [add kernel-doc for one parameter and fix a typo]. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241212205217.597844-4-rdunlap@infradead.org CC: James E.J. Bottomley CC: Martin K. Petersen Signed-off-by: Martin K. Petersen commit f52a04fcf8b088a4761d0dbf33188cd0fd36749a Author: Randy Dunlap Date: Thu Dec 12 12:52:14 2024 -0800 scsi: scsi_ioctl: Add kernel-doc for exported functions Add kernel-doc for scsi_set_medium_removal(), scsi_cmd_allowed(), and scsi_ioctl_block_when_processing_errors() since these are exported. This allows them to be part of the SCSI driver-api docbook. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241212205217.597844-3-rdunlap@infradead.org CC: James E.J. Bottomley CC: Martin K. Petersen Signed-off-by: Martin K. Petersen commit 20b98768c2e743df7648476521818600ac4a86ef Author: Randy Dunlap Date: Thu Dec 12 12:52:13 2024 -0800 scsi: scsi_error: Add kernel-doc for exported functions Convert scsi_report_bus_reset() and scsi_report_device_reset() to kernel-doc since they are exported. This allows them to be part of the driver-api/scsi.rst docbook. Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241212205217.597844-2-rdunlap@infradead.org CC: James E.J. Bottomley CC: Martin K. Petersen Signed-off-by: Martin K. Petersen commit 8f22f904b25b71c9e3e613e70944d818b203d6dc Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:12 2024 -0800 scsi: fnic: Increment driver version Increment driver version to 1.8.0.0 Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Tested-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-16-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 8d26bfcf1d2e829d37ef7f2b506b95e46f25f993 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:11 2024 -0800 scsi: fnic: Add support to handle port channel RSCN Add support to handle port channel RSCN. Port channel RSCN is a Cisco vendor specific RSCN event. It is applicable only to Cisco UCS fabrics. If there's a change in the port channel configuration, an RCSN is sent to fnic. This is used to serially reset the scsi initiator fnics so that there's no all paths down scenario. The affected fnics are added to a list that are reset with a small time gap between them. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-15-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 7e6886b705fd8b338dbd4b7492bd45f0259cc55f Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:10 2024 -0800 scsi: fnic: Code cleanup Replace existing host structure with fnic host. Add headers from scsi to support new functionality. Remove unused code and declarations. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-14-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit a8650a5eaaf123572a7b2d6b1fe9f6b000b6b6a6 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:09 2024 -0800 scsi: fnic: Add stats and related functionality Add statistics and related functionality for FDLS. Add supporting functions to display stats. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-13-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 9243626c211e4d6f5add84c5a7b141e94a2e7222 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:08 2024 -0800 scsi: fnic: Modify fnic interfaces to use FDLS Modify fnic driver interfaces to use FDLS and supporting functions. Refactor code in fnic_probe and fnic_remove. Get fnic from shost_priv. Add error handling in stats processing functions. Modify some print statements. Add support to do module unload cleanup. Use placeholder functions/modify function declarations to not break compilation. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-12-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 6335be1c5009f888367db095a0442cdb256980f8 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:07 2024 -0800 scsi: fnic: Modify IO path to use FDLS Modify IO path to use FDLS. Add helper functions to process IOs. Remove unused template functions. Clean up obsolete code. Refactor old function definitions. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202410210147.fQp7tYeb-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Arun Easi Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-11-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 9cf9fe2f3ec5dad8b459267a9e977c0b7811b3f8 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:06 2024 -0800 scsi: fnic: Add functionality in fnic to support FDLS Add interfaces in fnic to use FDLS services. Modify link up and link down functionality to use FDLS. Replace existing interfaces to handle new functionality provided by FDLS. Modify data types of some data members to handle new functionality. Add processing of tports and handling of tports. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202409292037.ZYWZwIK6-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-10-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 098585aa8acab3fcd46ce908af84ef168f5ccab6 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:05 2024 -0800 scsi: fnic: Add and integrate support for FIP Add and integrate support for FCoE Initialization (protocol) FIP. This protocol will be exercised on Cisco UCS rack servers. Add support to specifically print FIP related debug messages. Replace existing definitions to handle new data structures. Clean up old and obsolete definitions. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202409291955.FcMZfNSt-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202412081904.pXwdx15J-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-9-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 09c1e6ab4ab2a107d96f119950dc330e446dc2b0 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:04 2024 -0800 scsi: fnic: Add and integrate support for FDMI Add support for Fabric-Device Management Interface (FDMI) by introducing PCI device IDs for Cisco Hardware. Introduce a module parameter to enable/disable FDMI support. Integrate support for FDMI. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406110734.p2v8dq9v-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-8-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 2c77081969ee00ec31abda0cf6a26bc269f12ab2 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:03 2024 -0800 scsi: fnic: Add Cisco hardware model names Add model IDs for Cisco VIC. Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-7-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit f828af44b8ddef3500fda70ef1f6daffe97db36b Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:02 2024 -0800 scsi: fnic: Add support for unsolicited requests and responses Add support for unsolicited requests and responses. Add support to accept and reject frames. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202409291705.MugERX98-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-6-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit b5a57f153bdf772ed41ef286826cef7a1c52f433 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:01 2024 -0800 scsi: fnic: Add support for target based solicited requests and responses Add support for target based solicited requests and responses. Add support for tport definitions and processing. Add support for restarting the IT nexus. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406120146.xchlZbqX-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202412081427.SlsFIJY4-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-5-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit a63e78eb2b0f654b138abfc323f6bd7573e26145 Author: Karan Tilak Kumar Date: Wed Dec 11 18:03:00 2024 -0800 scsi: fnic: Add support for fabric based solicited requests and responses Add fdls_disc.c to support fabric based solicited requests and responses. Clean up obsolete code but keep the function template so as to not break compilation. Remove duplicate definitions from header files. Modify definitions of data members. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406112309.8GiDUvIM-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202406120201.VakI9Dly-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202412080837.2JU0r2Ny-lkp@intel.com/ Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-4-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit d859d05ceb3dbb5b7c294b7073fef64507681901 Author: Karan Tilak Kumar Date: Wed Dec 11 18:02:59 2024 -0800 scsi: fnic: Add headers and definitions for FDLS Add headers and definitions for FDLS (Fabric Discovery and Login Services). Reviewed-by: Sesidhar Baddela Co-developed-by: Gian Carlo Boffa Signed-off-by: Gian Carlo Boffa Co-developed-by: Arulprabhu Ponnusamy Signed-off-by: Arulprabhu Ponnusamy Co-developed-by: Arun Easi Signed-off-by: Arun Easi Co-developed-by: Karan Tilak Kumar Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-3-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit e2813fc27d274747fa6e204e135e3c89cc6426a3 Author: Karan Tilak Kumar Date: Wed Dec 11 18:02:58 2024 -0800 scsi: fnic: Replace shost_printk() with dev_info()/dev_err() Sending host information to shost_printk() prior to host initialization in fnic is unnecessary. Replace shost_printk() and a printk() prior to this initialization with dev_info() and dev_err() accordingly. Reviewed-by: Sesidhar Baddela Reviewed-by: Arulprabhu Ponnusamy Reviewed-by: Gian Carlo Boffa Reviewed-by: Hannes Reinecke Signed-off-by: Karan Tilak Kumar Link: https://lore.kernel.org/r/20241212020312.4786-2-kartilak@cisco.com Signed-off-by: Martin K. Petersen commit 29081c21a7064cdbf29295d07f0e44776280918e Author: Bart Van Assche Date: Mon Dec 16 10:48:52 2024 -0800 scsi: scsi_debug: Skip host/bus reset settle delay Skip the reset settle delay during error handling since the scsi_debug driver doesn't need this delay. Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20241216184852.2626339-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit ea4f2219dd40c14fa8dbb5a3288482830a0bc03e Author: Thomas Weißschuh Date: Mon Dec 16 12:29:18 2024 +0100 scsi: qla4xxx: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-11-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit 06a9ceb95f860bd4dc931ed7b9e6cf9333564e3c Author: Thomas Weißschuh Date: Mon Dec 16 12:29:17 2024 +0100 scsi: qla2xxx: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-10-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit f9d0a8450ee3a945c6ba14624ff4034d155351f1 Author: Thomas Weißschuh Date: Mon Dec 16 12:29:16 2024 +0100 scsi: qedi: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-9-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit a8116aa2898b01fb17df346cce9e477ab8538c4c Author: Thomas Weißschuh Date: Mon Dec 16 12:29:15 2024 +0100 scsi: qedf: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-8-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit f6af41ff6671d354e2909351d97f4071d7e321ac Author: Thomas Weißschuh Date: Mon Dec 16 12:29:14 2024 +0100 scsi: ipr: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-7-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit 4594a1f827d4a8e2a96f114d7f2afa2171561e09 Author: Thomas Weißschuh Date: Mon Dec 16 12:29:13 2024 +0100 scsi: lpfc: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-6-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit af58c759836b7272236e8ef4773e0926d686a135 Author: Thomas Weißschuh Date: Mon Dec 16 12:29:12 2024 +0100 scsi: ibmvfc: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-5-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit 61e2d41cafc68ba73dc7d403528d6a9fcc25c39e Author: Thomas Weißschuh Date: Mon Dec 16 12:29:11 2024 +0100 scsi: esas2r: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-4-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit 3e72fc051d4cf2f0b5d3bb67f6586e1fad713b5b Author: Thomas Weißschuh Date: Mon Dec 16 12:29:10 2024 +0100 scsi: arcmsr: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-3-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit 1cf448bd2e6ab15ab89a36f304c4fbddad0f76b9 Author: Thomas Weißschuh Date: Mon Dec 16 12:29:09 2024 +0100 scsi: 3w-sas: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-2-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit e4dab5d1ded3a9315951a3d662af4b0238b780c3 Author: Thomas Weißschuh Date: Mon Dec 16 12:29:08 2024 +0100 scsi: core: Constify 'struct bin_attribute' The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20241216-sysfs-const-bin_attr-scsi-v1-1-f0a5e54b3437@weissschuh.net Signed-off-by: Martin K. Petersen commit 62297838de618785b670d49a18de82f638d13200 Author: Justin Tee Date: Thu Dec 12 15:33:09 2024 -0800 scsi: lpfc: Copyright updates for 14.4.0.7 patches Update copyrights to 2024 for files modified in the 14.4.0.7 patch set. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-11-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit eb20870852438de23a38195c5e890ad57156f00a Author: Justin Tee Date: Thu Dec 12 15:33:08 2024 -0800 scsi: lpfc: Update lpfc version to 14.4.0.7 Update lpfc version to 14.4.0.7 Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-10-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 3103af831c8fb8177ffe766971aa74e0fcec1fe1 Author: Justin Tee Date: Thu Dec 12 15:33:07 2024 -0800 scsi: lpfc: Add support for large fw object application layer reads Current lpfc bsg implementation allows a maximum fw read object size of 30KB. Implementation and support for read object mailbox commands for fw objects larger than 30KB are now required for proprietary applications. Thus, update the lpfc_sli_config_emb0_subsys structure and its associated submission and completion paths to accommodate for an alternative form of read object command that supports large fw objects. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 91b91309db02c44cd244a1c86f928b4e49422eff Author: Justin Tee Date: Thu Dec 12 15:33:06 2024 -0800 scsi: lpfc: Update definition of firmware configuration mbox cmds There are unused fields in mailbox commands that query for firmware configuration information. As such, update the struct definitions by correcting the name of certain fields and removing the unused fields. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 3f8f9f16f844a1124da2f3ce674deaf08921fb3a Author: Justin Tee Date: Thu Dec 12 15:33:05 2024 -0800 scsi: lpfc: Change lpfc_nodelist save_flags member into a bitmask In attempt to reduce the amount of unnecessary ndlp->lock acquisitions in the lpfc driver, change save_flags into an unsigned long bitmask and use clear_bit/test_bit bitwise atomic APIs instead of reliance on ndlp->lock for synchronization. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 06dbe31e8950b1effb2e0ff98d1162416c406e95 Author: Justin Tee Date: Thu Dec 12 15:33:04 2024 -0800 scsi: lpfc: Add handling for LS_RJT reason explanation authentication required When a LS_RJT is received with reason explanation authentication required, current driver logic is to retry the PLOGI up to 48 times. In the worse case scenario, 48 retries can take longer than dev_loss_tmo and if there is an RSCN received indicating an authentication requirement change, the driver may miss processing it. Fix by adding logic to specifically handle reason explanation authentication required and set the max retry count to 8 times. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit ee80d8c2d4ccebed1015f6c9ba6a07c85e149785 Author: Justin Tee Date: Thu Dec 12 15:33:03 2024 -0800 scsi: lpfc: Modify handling of ADISC based on ndlp state and RPI registration In lpfc_check_adisc, remove the requirement that the ndlp object must have been RPI registered. Whether or not the ndlp is RPI registered is unrelated to verifying that the received ADISC is intended for that ndlp rport object. After ADISC receipt, there's no need to put the ndlp state into NPR. Let the cmpl routines from the actions taken earlier in ADISC handling set the proper ndlp state. Also, refactor when a RESUME_RPI mailbox command should be sent. It should only be sent if the RPI registered flag is set. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit bb33b07ac6e3fede9b54cd8bf83a66dbdc6afe89 Author: Justin Tee Date: Thu Dec 12 15:33:02 2024 -0800 scsi: lpfc: Delete NLP_TARGET_REMOVE flag due to obsolete usage Remove the NLP_TARGET_REMOVE flag as its usage is obsolete. The current framework is to rely on the lpfc_dev_loss_tmo_callbk from upper layer to notify final ndlp kref release. There's no need to specifically set NLP_EVT_DEVICE_RM when a LOGO completes. The dev_loss_tmo_callbk is responsible for the final kref put. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 17cb5e986e7aec3f4f599636e0775a4133690b4d Author: Justin Tee Date: Thu Dec 12 15:33:01 2024 -0800 scsi: lpfc: Restrict the REG_FCFI MAM field to FCoE adapters only Qualify setting the REG_FCFI MAM field to FCoE adapters only by keying off HBA_FCOE_MODE phba->hba_flag. The field is not applicable to FC adapters. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 1ff0f95ade41d1f56ecad091e35baec6f479241c Author: Justin Tee Date: Thu Dec 12 15:33:00 2024 -0800 scsi: lpfc: Redefine incorrect type in lpfc_create_device_data() Fix smatch warning by redefining local variable memory_flags from int to gfp_t. lpfc_scsi.c: warning: incorrect type in argument 2 (different base types) lpfc_scsi.c: expected restricted gfp_t [usertype] gfp_mask lpfc_scsi.c: got int memory_flags Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20241212233309.71356-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 850f814b01a54cf844225c6c45016a29fccceab4 Author: Ariel Otilibili Date: Fri Dec 13 23:57:29 2024 +0100 scsi: myrb: Remove dead code * reported by Coverity ID 1602240 * ldev_info is always true, therefore the branch statement is never called. Fixes: 081ff398c56c ("scsi: myrb: Add Mylex RAID controller (block interface)") Cc: Hannes Reinecke Cc: James E.J. Bottomley Cc: Martin K. Petersen Signed-off-by: Ariel Otilibili Link: https://lore.kernel.org/r/20241213225852.62741-2-ariel.otilibili-anieli@eurecom.fr Signed-off-by: Martin K. Petersen commit ad7c3c0cb8f61d6d5a48b83e62ca4a9fd2f26153 Author: Paul Menzel Date: Thu Dec 12 23:18:12 2024 +0100 scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1 Currently, the code does: if (x == 0) { x &= ~0x3; x |= 0x1; } Zeroing bits 0 and 1 of a variable that is 0 is not necessary. So directly set the variable to 1. Cc: Sreekanth Reddy Fixes: f92363d12359 ("[SCSI] mpt3sas: add new driver supporting 12GB SAS") Signed-off-by: Paul Menzel Link: https://lore.kernel.org/r/20241212221817.78940-2-pmenzel@molgen.mpg.de Signed-off-by: Martin K. Petersen commit 09ecc187ebde77ebbfc444b2c08192024e2dc6a4 Author: Paul Menzel Date: Thu Dec 12 23:18:11 2024 +0100 scsi: mpt3sas: Add details to EEDPTagMode error message Linux 5.15 logs the error below mpt3sas_cm0: overriding NVDATA EEDPTagMode setting on a Dell PowerEdge T440 with the card below. 5e:00.0 Serial Attached SCSI controller [0107]: Broadcom / LSI SAS3008 PCI-Express Fusion-MPT SAS-3 [1000:0097] (rev 02) It’s not clear to a user what this error is about. As a first step to improve this, add the values to the error message. Signed-off-by: Paul Menzel Link: https://lore.kernel.org/r/20241212221817.78940-1-pmenzel@molgen.mpg.de Signed-off-by: Martin K. Petersen commit c13b10a754bc49d92dd562e78e2d950546f5bc40 Author: Siddharth Menon Date: Tue Dec 10 09:32:02 2024 +0530 scsi: esp: Fix variable typo Renamed ESP_CONGIG4_TEST to ESP_CONFIG4_TEST Signed-off-by: Siddharth Menon Link: https://lore.kernel.org/r/20241210040202.11112-1-simeddon@gmail.com Signed-off-by: Martin K. Petersen commit 409f21010d92a9a5c3b66bacd3b853f4d71ca26c Author: Eric Biggers Date: Thu Dec 12 20:19:47 2024 -0800 scsi: ufs: crypto: Remove ufs_hba_variant_ops::program_key There are no longer any implementations of ufs_hba_variant_ops::program_key, so remove it. As a result, ufshcd_program_key() no longer can return an error, so also clean it up to return void. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20241213041958.202565-5-ebiggers@kernel.org Signed-off-by: Martin K. Petersen commit 30b32c647cf309d8fc70ba068a2918033e3a1bc4 Author: Eric Biggers Date: Thu Dec 12 20:19:46 2024 -0800 scsi: ufs: qcom: Convert to use UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE By default the UFS core is responsible for initializing the blk_crypto_profile, but Qualcomm platforms have their own way of programming and evicting crypto keys. So currently ufs_hba_variant_ops::program_key is used to redirect control flow from ufshcd_program_key(). This has worked until now, but it's a bit of a hack, given that the key (and algorithm ID etc.) ends up being converted from blk_crypto_key => ufs_crypto_cfg_entry => SCM call parameters, where the intermediate ufs_crypto_cfg_entry step is unnecessary. Taking a similar approach with the upcoming wrapped key support, the implementation of which is similarly platform-specific, would require adding four new methods to ufs_hba_variant_ops, changing program_key to take the struct blk_crypto_key, and adding a new UFSHCD_CAP_* flag to indicate support for wrapped keys. This patch takes a different approach. It changes ufs-qcom to use the existing UFSHCD_QUIRK_CUSTOM_CRYPTO_PROFILE which was recently added for ufs-exynos. This allows it to override the full blk_crypto_profile, eliminating the need for the existing ufs_hba_variant_ops::program_key and the hooks that would have been needed for wrapped key support. It does require a bit of duplicated code to read the crypto capability registers, but it's worth the simplification in design with ufs-qcom and ufs-exynos now using the same method to customize the crypto profile, and it makes it much easier to add wrapped key support. Tested-by: Bartosz Golaszewski # sm8650 Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20241213041958.202565-4-ebiggers@kernel.org Signed-off-by: Martin K. Petersen commit 75d0c649eca47af21533d9636723574116fe6987 Author: Eric Biggers Date: Thu Dec 12 20:19:45 2024 -0800 scsi: ufs: crypto: Add ufs_hba_from_crypto_profile() Add a helper function that encapsulates a container_of expression. For now there are two users but soon there will be more. Tested-by: Bartosz Golaszewski # sm8650 Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20241213041958.202565-3-ebiggers@kernel.org Signed-off-by: Martin K. Petersen commit 7a0905caf5665be41094a6ceb5e9d2524de4627a Author: Eric Biggers Date: Mon Dec 9 19:08:39 2024 -0800 scsi: ufs: qcom: Fix crypto key eviction Commit 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API") introduced an incorrect check of the algorithm ID into the key eviction path, and thus qcom_ice_evict_key() is no longer ever called. Fix it. Fixes: 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API") Cc: stable@vger.kernel.org Cc: Abel Vesa Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20241210030839.1118805-1-ebiggers@kernel.org Signed-off-by: Martin K. Petersen commit 5d10344ab65271eab7607a2cef0ddbfc4720d133 Author: Dr. David Alan Gilbert Date: Mon Dec 23 18:02:18 2024 +0000 scsi: isci: Remove unused isci_remote_device_reset_complete() isci_remote_device_reset_complete() last use was removed in 2012 by commit 14aaa9f0a318 ("isci: Redesign device suspension, abort, cleanup.") Remove it. It was the last user of sci_remote_device_reset_complete(). Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20241223180218.50426-1-linux@treblig.org Signed-off-by: Martin K. Petersen commit 6e67b32087e34965bbcd421251ba42a8e5667669 Author: Dr. David Alan Gilbert Date: Mon Dec 23 18:01:10 2024 +0000 scsi: iscsi: Remove unused iscsi_create_session() iscsi_create_session() last use was removed in 2008 by commit 756135215ec7 ("[SCSI] iscsi: remove session and host binding in libiscsi") Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20241223180110.50266-1-linux@treblig.org Signed-off-by: Martin K. Petersen commit 4d43d350a4b0ec987fe1d2f106f409a125a1a466 Author: Dr. David Alan Gilbert Date: Sun Dec 22 21:35:24 2024 +0000 scsi: target: Remove unused functions The functions: iscsit_check_unsolicited_dataout() iscsit_fail_session() iscsit_create_conn_recovery_datain_values() iscsit_create_conn_recovery_dataout_values() iscsit_tpg_dump_params() iscsit_print_session_params() were all added in 2011 by commit e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1") but have remained unused. Remove them. Having deleted them, the functions: iscsi_print_params() iscsi_dump_conn_ops() iscsi_dump_sess_ops() are also unused. Remove them. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20241222213524.270735-1-linux@treblig.org Signed-off-by: Martin K. Petersen commit a9dcee18a2200ee6c273ef9e0915b83179cc2ff3 Author: Randy Dunlap Date: Thu Dec 19 13:49:28 2024 -0800 scsi: documentation: scsi_eh: updates for EH changes SCSI_SOFTIRQ and scsi_softirq() are no longer used. Change to block layer equivalents. scsi_setup_cmd_retry() has been deleted. Remove references to it. SCSI_EH_CANCEL_CMD has been deleted. Remove references to it. scsi_eh_abort_cmds() has been deleted. Remove references to it. [mkp: fixed START STOP UNIT] Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241219214928.1170302-1-rdunlap@infradead.org Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: James E.J. Bottomley Cc: Martin K. Petersen Signed-off-by: Martin K. Petersen commit 3b2f56860b05bf0cea86af786fd9b7faa8fe3ef3 Author: Manivannan Sadhasivam Date: Thu Dec 19 22:20:44 2024 +0530 scsi: ufs: qcom: Power down the controller/device during system suspend for SM8550/SM8650 SoCs SM8550 and SM8650 SoCs doesn't support UFS PHY retention. So once these SoCs reaches the low power state (CX power collapse) during system suspend, all the PHY hardware state gets lost. This leads to the UFS resume failure: ufshcd-qcom 1d84000.ufs: ufshcd_uic_hibern8_exit: hibern8 exit failed. ret = 5 ufshcd-qcom 1d84000.ufs: __ufshcd_wl_resume: hibern8 exit failed 5 ufs_device_wlun 0:0:0:49488: ufshcd_wl_resume failed: 5 ufs_device_wlun 0:0:0:49488: PM: dpm_run_callback(): scsi_bus_resume+0x0/0x84 returns 5 ufs_device_wlun 0:0:0:49488: PM: failed to resume async: error 5 With the default system suspend level of UFS_PM_LVL_3, the power domain for UFS PHY needs to be kept always ON to retain the state. But this would prevent these SoCs from reaching the CX power collapse state, leading to poor power saving during system suspend. So to fix this issue without affecting the power saving, set 'ufs_qcom_drvdata::no_phy_retention' to true which sets 'hba->spm_lvl' to UFS_PM_LVL_5 to allow both the controller and device (in turn the PHY) to be powered down during system suspend for these SoCs by default. Cc: stable@vger.kernel.org # 6.3 Fixes: 35cf1aaab169 ("arm64: dts: qcom: sm8550: Add UFS host controller and phy nodes") Fixes: 10e024671295 ("arm64: dts: qcom: sm8650: add interconnect dependent device nodes") Reported-by: Neil Armstrong Tested-by: Amit Pundir # on SM8550-HDK Reviewed-by: Bart Van Assche Tested-by: Neil Armstrong # on SM8550-QRD Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241219-ufs-qcom-suspend-fix-v3-4-63c4b95a70b9@linaro.org Signed-off-by: Martin K. Petersen commit 4f78a56af4c472834681759d4365fb93921da77d Author: Manivannan Sadhasivam Date: Thu Dec 19 22:20:43 2024 +0530 scsi: ufs: qcom: Allow passing platform specific OF data In order to allow platform specific flags and configurations, introduce the platform specific OF data and move the existing quirk UFSHCD_QUIRK_BROKEN_LSDBS_CAP for SM8550 and SM8650 SoCs. Reviewed-by: Avri Altman Reviewed-by: Neil Armstrong Tested-by: Amit Pundir # on SM8550-HDK Reviewed-by: Bart Van Assche Tested-by: Neil Armstrong # on SM8550-QRD Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241219-ufs-qcom-suspend-fix-v3-3-63c4b95a70b9@linaro.org Signed-off-by: Martin K. Petersen commit bb9850704c043e48c86cc9df90ee102e8a338229 Author: Manivannan Sadhasivam Date: Thu Dec 19 22:20:42 2024 +0530 scsi: ufs: core: Honor runtime/system PM levels if set by host controller drivers Otherwise, the default levels will override the levels set by the host controller drivers. Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241219-ufs-qcom-suspend-fix-v3-2-63c4b95a70b9@linaro.org Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7bac65687510038390a0a54cbe14fba08d037e46 Author: Manivannan Sadhasivam Date: Thu Dec 19 22:20:41 2024 +0530 scsi: ufs: qcom: Power off the PHY if it was already powered on in ufs_qcom_power_up_sequence() PHY might already be powered on during ufs_qcom_power_up_sequence() in a couple of cases: 1. During UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH quirk 2. Resuming from spm_lvl = 5 suspend In those cases, it is necessary to call phy_power_off() and phy_exit() in ufs_qcom_power_up_sequence() function to power off the PHY before calling phy_init() and phy_power_on(). Case (1) is doing it via ufs_qcom_reinit_notify() callback, but case (2) is not handled. So to satisfy both cases, call phy_power_off() and phy_exit() if the phy_count is non-zero. And with this change, the reinit_notify() callback is no longer needed. This fixes the below UFS resume failure with spm_lvl = 5: ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5 ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5 ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5 ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5 ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: Enabling the controller failed ufshcd-qcom 1d84000.ufshc: ufshcd_host_reset_and_restore: Host init failed -5 ufs_device_wlun 0:0:0:49488: ufshcd_wl_resume failed: -5 ufs_device_wlun 0:0:0:49488: PM: dpm_run_callback(): scsi_bus_resume returns -5 ufs_device_wlun 0:0:0:49488: PM: failed to resume async: error -5 Cc: stable@vger.kernel.org # 6.3 Fixes: baf5ddac90dc ("scsi: ufs: ufs-qcom: Add support for reinitializing the UFS device") Reported-by: Ram Kumar Dwivedi Tested-by: Amit Pundir # on SM8550-HDK Reviewed-by: Bart Van Assche Tested-by: Neil Armstrong # on SM8550-QRD Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241219-ufs-qcom-suspend-fix-v3-1-63c4b95a70b9@linaro.org Signed-off-by: Martin K. Petersen commit faaf18d3f353963a9d9b4c59fabb67b6f86f7946 Author: Frederic Weisbecker Date: Wed Dec 11 16:40:18 2024 +0100 scsi: qedi: Use kthread_create_on_cpu() Use the proper API instead of open coding it. However it looks like qedi_percpu_io_thread() kthread could be replaced by the use of a high prio workqueue instead. Signed-off-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20241211154035.75565-6-frederic@kernel.org Signed-off-by: Martin K. Petersen commit f33f1a88cf0f379c5b8bf180a72f0217efa0422f Author: Frederic Weisbecker Date: Wed Dec 11 16:40:17 2024 +0100 scsi: bnx2i: Use kthread_create_on_cpu() Use the proper API instead of open coding it. However it looks like bnx2i_percpu_io_thread() kthread could be replaced by the use of a high prio workqueue instead. Signed-off-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20241211154035.75565-5-frederic@kernel.org Signed-off-by: Martin K. Petersen commit 0d19b96cf159ca9b0a96275cad9e41adb2726889 Author: Frederic Weisbecker Date: Wed Dec 11 16:40:16 2024 +0100 scsi: bnx2fc: Use kthread_create_on_cpu() Use the proper API instead of open coding it. However it looks like bnx2fc_percpu_io_thread() kthread could be replaced by the use of a high prio workqueue instead. Signed-off-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20241211154035.75565-4-frederic@kernel.org Signed-off-by: Martin K. Petersen commit 40417789bad6222404d50a35266ed7726954378b Author: Artur Paszkiewicz Date: Tue Dec 10 12:30:28 2024 +0100 scsi: MAINTAINERS: Remove myself as isci driver maintainer I'm leaving Intel and I could not find a new maintainer for this so mark it as orphan. Signed-off-by: Artur Paszkiewicz Link: https://lore.kernel.org/r/20241210113028.13810-1-artur.paszkiewicz@intel.com Signed-off-by: Martin K. Petersen commit c9a71ca13f71bf0d32664a1e7d1f00378811d59c Author: Christophe JAILLET Date: Sat Dec 7 17:48:28 2024 +0100 scsi: Constify struct pci_device_id 'struct pci_device_id' is not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 70237 9137 320 79694 1374e drivers/scsi/3w-9xxx.o After: ===== text data bss dec hex filename 70461 8913 320 79694 1374e drivers/scsi/3w-9xxx.o Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/fc61b1946488c1ea8f7a17a06cf40fbd05dcc6de.1733590049.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen commit 6cb7063feb2eff2e52dc9624b2193a1f4cad69bf Author: Michael Kelley Date: Wed Oct 2 20:53:32 2024 -0700 scsi: storvsc: Don't assume cpu_possible_mask is dense Current code allocates the stor_chns array with size num_possible_cpus(). This code assumes cpu_possible_mask is dense, which is not true in the general case per [1]. If cpu_possible_mask is sparse, the array might be indexed by a value beyond the size of the array. However, the configurations that Hyper-V provides to guest VMs on x86 and ARM64 hardware, in combination with how architecture specific code assigns Linux CPU numbers, *does* always produce a dense cpu_possible_mask. So the dense assumption is not currently causing failures. But for robustness against future changes in how cpu_possible_mask is populated, update the code to no longer assume dense. The correct approach is to allocate and initialize the array using size "nr_cpu_ids". While this leaves unused array entries corresponding to holes in cpu_possible_mask, the holes are assumed to be minimal and hence the amount of memory wasted by unused entries is minimal. [1] https://lore.kernel.org/lkml/SN6PR02MB4157210CC36B2593F8572E5ED4692@SN6PR02MB4157.namprd02.prod.outlook.com/ Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/20241003035333.49261-5-mhklinux@outlook.com Acked-by: Peter Zijlstra (Intel) Signed-off-by: Martin K. Petersen commit bd55f56188caf170d6dbdc04638159bd91d8401b Author: Steffen Maier Date: Thu Dec 5 15:19:32 2024 +0100 scsi: MAINTAINERS: Update zfcp entry Nihar takes over the zfcp maintainer work. Update the MAINTAINERS entry accordingly. Signed-off-by: Steffen Maier Acked-by: Steffen Maier Acked-by: Benjamin Block Acked-by: Nihar Panda Signed-off-by: Nihar Panda Link: https://lore.kernel.org/r/20241205141932.1227039-4-niharp@linux.ibm.com Signed-off-by: Martin K. Petersen commit 32574fe6e19d3018a27e8003b1a75be2af584dae Author: Steffen Maier Date: Thu Dec 5 15:19:31 2024 +0100 scsi: zfcp: Clarify zfcp_port refcount ownership during "link" test Reviewed-by: Benjamin Block Signed-off-by: Steffen Maier Signed-off-by: Nihar Panda Link: https://lore.kernel.org/r/20241205141932.1227039-3-niharp@linux.ibm.com Signed-off-by: Martin K. Petersen commit 9fe5b6130baf6dd15d46b41f8edf0abdb3541f4f Author: Fedor Loshakov Date: Thu Dec 5 15:19:30 2024 +0100 scsi: zfcp: Correct kdoc parameter description for sending ELS and CT Since commit 7c7dc196814b ("[SCSI] zfcp: Simplify handling of ct and els requests") there are no more such structures as zfcp_send_els and zfcp_send_ct. Instead there is now one common fsf structure to hold zfcp data for ct and els requests. Fix parameter description for zfcp_fsf_send_ct() and zfcp_fsf_send_els() accordingly. Signed-off-by: Fedor Loshakov Reviewed-by: Steffen Maier Reviewed-by: Benjamin Block Signed-off-by: Nihar Panda Link: https://lore.kernel.org/r/20241205141932.1227039-2-niharp@linux.ibm.com Signed-off-by: Martin K. Petersen commit c17618cf664ddf54b264ea74df9e8ab3e3ceda3b Author: Randy Dunlap Date: Wed Dec 4 20:18:39 2024 -0800 scsi: Eliminate scsi_register() and scsi_unregister() usage & docs scsi_mid_low_api.rst refers to scsi_register() and scsi_unregister() but these functions don't exist. They have been replaced by more meaningful names. Update one driver (megaraid_mbox.c) that uses "scsi_unregister" in a warning message. Update scsi_mid_low_api.rst to eliminate references to scsi_register() and scsi_unregister(). Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241205041839.164404-1-rdunlap@infradead.org Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: Bart Van Assche Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Kashyap Desai Cc: Sumit Saxena Cc: Shivasharan S Cc: Chandrakanth patil Cc: megaraidlinux.pdl@broadcom.com Signed-off-by: Martin K. Petersen commit 8d14bfb539522fff4cc0f90cd3c402d5aeef3c6a Author: Randy Dunlap Date: Wed Dec 4 19:13:07 2024 -0800 scsi: docs: Remove init_this_scsi_driver() Finish removing mention of init_this_scsi_driver() that was removed ages ago. Fixes: 83c9f08e6c6a ("scsi: remove the old scsi_module.c initialization model") Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20241205031307.130441-1-rdunlap@infradead.org Cc: Christoph Hellwig Cc: Martin K. Petersen Cc: James E.J. Bottomley Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Martin K. Petersen commit f103396ae31851d00b561ff9f8a32a441953ff8b Author: liuderong Date: Fri Dec 6 15:29:42 2024 +0800 scsi: ufs: core: Update compl_time_stamp_local_clock after completing a cqe lrbp->compl_time_stamp_local_clock is set to zero after sending a sqe but it is not updated after completing a cqe. Thus the printed information in ufshcd_print_tr() will always be zero. Update lrbp->cmpl_time_stamp_local_clock after completing a cqe. Log sample: ufshcd-qcom 1d84000.ufshc: UPIU[8] - issue time 8750227249 us ufshcd-qcom 1d84000.ufshc: UPIU[8] - complete time 0 us Fixes: c30d8d010b5e ("scsi: ufs: core: Prepare for completion in MCQ") Reviewed-by: Bean Huo Reviewed-by: Peter Wang Signed-off-by: liuderong Link: https://lore.kernel.org/r/1733470182-220841-1-git-send-email-liuderong@oppo.com Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit 9db7a472423d3470fb4bd114d74d0bc0027995ae Author: Avri Altman Date: Thu Nov 28 09:25:42 2024 +0200 scsi: ufs: core: Do not hold any lock in ufshcd_hba_stop() This change is motivated by Bart's suggestion in [1], which enables to further reduce the SCSI host lock usage in the UFS driver. The reason why it makes sense, because although the legacy interrupt is disabled by some but not all ufshcd_hba_stop() callers, it is safe to nest disable_irq() calls as it checks the irq depth. [1] https://lore.kernel.org/linux-scsi/c58e4fce-0a74-4469-ad16-f1edbd670728@acm.org/ Suggested-by: Bart Van Assche Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20241128072542.219170-1-avri.altman@wdc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b0d3b8514abd2f49b479dc775a03725c25b2f11c Author: Bart Van Assche Date: Tue Oct 22 11:07:57 2024 -0700 scsi: core: Update API documentation Since the .slave_alloc(), .slave_destroy() and .slave_configure() methods have been renamed in struct scsi_host_template, also rename these in the API documentation. Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20241022180839.2712439-6-bvanassche@acm.org Reviewed-by: Damien Le Maol Signed-off-by: Martin K. Petersen commit 0f98212d96a2af52e4091a199ef1d35d478d0c60 Author: Bart Van Assche Date: Tue Oct 22 11:07:56 2024 -0700 scsi: core: Remove the .slave_configure() method Now that all SCSI drivers have been converted from .slave_configure() to .sdev_configure(), remove support for .slave_configure() from the SCSI core. Reviewed-by: Damien Le Moal Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20241022180839.2712439-5-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 49515b7fe50ce4348b3dd5116b6d7d4308546da6 Author: Bart Van Assche Date: Tue Oct 22 11:07:55 2024 -0700 scsi: Convert SCSI drivers to .sdev_configure() The only difference between the .sdev_configure() and .slave_configure() methods is that the former accepts an additional 'limits' argument. Convert all SCSI drivers that define a .slave_configure() method to .sdev_configure(). This patch prepares for removing the .slave_configure() method. No functionality has been changed. Acked-by: Geoff Levand # for ps3rom Acked-by: Khalid Aziz # for the BusLogic driver Reviewed-by: Damien Le Moal Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20241022180839.2712439-4-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 47c2e30afcec52968e50db01f92dda7d373042cb Author: Bart Van Assche Date: Tue Oct 22 11:07:54 2024 -0700 scsi: Rename .device_configure() into .sdev_configure() Improve naming consistency with the .sdev_prep() and .sdev_destroy() methods by renaming .device_configure() into .sdev_configure(). Cc: Christoph Hellwig Acked-by: Damien Le Moal Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20241022180839.2712439-3-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit ed638918f4df39daa458435f0825b487c1f192c8 Author: Bart Van Assche Date: Tue Oct 22 11:07:53 2024 -0700 scsi: Rename .slave_alloc() and .slave_destroy() Rename .slave_alloc() into .sdev_init() and .slave_destroy() into .sdev_destroy(). The new names make it clear that these are actions on SCSI devices. Make this change in the SCSI core, SCSI drivers and also in the ATA drivers. No functionality has been changed. This patch has been created as follows: * Change the text "slave_alloc" into "sdev_init" in all source files except those in drivers/net/ and Documentation/. * Change the text "slave_destroy" into "sdev_destroy" in all source files except those in drivers/net/ and Documentation/. * Rename lpfc_no_slave() into lpfc_no_sdev(). * Manually adjust whitespace where necessary to restore vertical alignment (dc395x driver and include/linux/libata.h). Acked-by: Damien Le Moal Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20241022180839.2712439-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 5efff64c6be9a236200e026ce8f401b2c62afe32 Author: Vishakha Channapattan Date: Tue Nov 26 22:55:46 2024 +0000 scsi: pm80xx: Improve debugging for aborted commands Improves the debugging capabilities of the driver by adding more context to debug messages: 1. Introduce a new function to show pending commands. 2. Include the tag number in NCQ EH path debug messages. 3. Add logging for ata_tag along with pm80xx tag to map I/Os aborted with ATA logs. Signed-off-by: Vishakha Channapattan Signed-off-by: Salomon Dushimirimana Link: https://lore.kernel.org/r/20241126225546.975441-1-salomondush@google.com Signed-off-by: Martin K. Petersen commit b64004dbcd239d5eeac0b41c167a306291510d55 Author: Igor Pylypiv Date: Tue Nov 26 22:49:23 2024 +0000 scsi: pm80xx: Increase reserved tags from 8 to 128 Increase the number of reserved tags to prevent command processing failures when the driver is under stress. 8 reserved tags are quickly getting all used up leading to errors when command completions are delayed. The driver needs ~512 ccbs/tags for maximum I/O utilization: 16 (max disks) * 32 (max SATA queue depth) = ~512 ccbs/tags. By reserving 128 tags the driver will still have plenty of tags/ccbs left: 1024 (max ccbs) - 128 (reserved slot) = 896 tags/ccbs left. Signed-off-by: Igor Pylypiv Signed-off-by: Salomon Dushimirimana Link: https://lore.kernel.org/r/20241126224923.973528-1-salomondush@google.com Signed-off-by: Martin K. Petersen commit 4c567a9d0e009c998125d549dc53ab0d21724a55 Author: Jolly Shah Date: Mon Nov 25 13:33:43 2024 -0800 scsi: pm80xx: Use dynamic tag numbers for PHY start and stop Other commands were not aware if tag 0x01 was in use or not which meant multiple commands could share the same tag number. Prevent tag 0x01 from being used by multiple commands at the same time. Signed-off-by: Jolly Shah Signed-off-by: Terrence Adams Link: https://lore.kernel.org/r/20241125213343.3272478-1-tadamsjr@google.com Signed-off-by: Martin K. Petersen commit 0f630c58e31afb3dc2373bc1126b555f4b480bb2 Author: Igor Pylypiv Date: Thu Nov 21 11:49:15 2024 -0800 scsi: pm80xx: Do not use libsas port ID libsas port IDs can differ from the controller's port IDs. Using libsas port ID to index pm8001_ha->port array is a bug. Remove sas_find_local_port_id(). We can use pm8001_ha->phy[phy_id].port to get the port ID. Signed-off-by: Igor Pylypiv Signed-off-by: Terrence Adams Link: https://lore.kernel.org/r/20241121194915.3039073-1-tadamsjr@google.com Signed-off-by: Martin K. Petersen commit 6918141d815acef056a0d10e966a027d869a922d Author: John Garry Date: Mon Dec 2 13:00:45 2024 +0000 scsi: scsi_debug: Fix hrtimer support for ndelay Since commit 771f712ba5b0 ("scsi: scsi_debug: Fix cmd duration calculation"), ns_from_boot value is only evaluated in schedule_resp() for polled requests. However, ns_from_boot is also required for hrtimer support for when ndelay is less than INCLUSIVE_TIMING_MAX_NS, so fix up the logic to decide when to evaluate ns_from_boot. Fixes: 771f712ba5b0 ("scsi: scsi_debug: Fix cmd duration calculation") Signed-off-by: John Garry Link: https://lore.kernel.org/r/20241202130045.2335194-1-john.g.garry@oracle.com Signed-off-by: Martin K. Petersen commit b1aee7f034615b6824d2c70ddb37ef9fc23493b7 Author: Cathy Avery Date: Wed Nov 27 13:13:24 2024 -0500 scsi: storvsc: Do not flag MAINTENANCE_IN return of SRB_STATUS_DATA_OVERRUN as an error This partially reverts commit 812fe6420a6e ("scsi: storvsc: Handle additional SRB status values"). HyperV does not support MAINTENANCE_IN resulting in FC passthrough returning the SRB_STATUS_DATA_OVERRUN value. Now that SRB_STATUS_DATA_OVERRUN is treated as an error, multipath ALUA paths go into a faulty state as multipath ALUA submits RTPG commands via MAINTENANCE_IN. [ 3.215560] hv_storvsc 1d69d403-9692-4460-89f9-a8cbcc0f94f3: tag#230 cmd 0xa3 status: scsi 0x0 srb 0x12 hv 0xc0000001 [ 3.215572] scsi 1:0:0:32: alua: rtpg failed, result 458752 Make MAINTENANCE_IN return success to avoid the error path as is currently done with INQUIRY and MODE_SENSE. Suggested-by: Michael Kelley Signed-off-by: Cathy Avery Link: https://lore.kernel.org/r/20241127181324.3318443-1-cavery@redhat.com Reviewed-by: Michael Kelley Reviewed-by: Ewan D. Milne Signed-off-by: Martin K. Petersen commit 7f45ed5f0cd5ccbbec79adc6c48a67d6a85fba56 Author: Peter Wang Date: Fri Nov 22 10:49:43 2024 +0800 scsi: ufs: core: Add missing post notify for power mode change When the power mode change is successful but the power mode hasn't actually changed, the post notification was missed. Similar to the approach with hibernate/clock scale/hce enable, having pre/post notifications in the same function will make it easier to maintain. Additionally, supplement the description of power parameters for the pwr_change_notify callback. Fixes: 7eb584db73be ("ufs: refactor configuring power mode") Cc: stable@vger.kernel.org #6.11.x Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20241122024943.30589-1-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit f10593ad9bc36921f623361c9e3dd96bd52d85ee Author: Suraj Sonawane Date: Wed Nov 20 18:29:44 2024 +0530 scsi: sg: Fix slab-use-after-free read in sg_release() Fix a use-after-free bug in sg_release(), detected by syzbot with KASAN: BUG: KASAN: slab-use-after-free in lock_release+0x151/0xa30 kernel/locking/lockdep.c:5838 __mutex_unlock_slowpath+0xe2/0x750 kernel/locking/mutex.c:912 sg_release+0x1f4/0x2e0 drivers/scsi/sg.c:407 In sg_release(), the function kref_put(&sfp->f_ref, sg_remove_sfp) is called before releasing the open_rel_lock mutex. The kref_put() call may decrement the reference count of sfp to zero, triggering its cleanup through sg_remove_sfp(). This cleanup includes scheduling deferred work via sg_remove_sfp_usercontext(), which ultimately frees sfp. After kref_put(), sg_release() continues to unlock open_rel_lock and may reference sfp or sdp. If sfp has already been freed, this results in a slab-use-after-free error. Move the kref_put(&sfp->f_ref, sg_remove_sfp) call after unlocking the open_rel_lock mutex. This ensures: - No references to sfp or sdp occur after the reference count is decremented. - Cleanup functions such as sg_remove_sfp() and sg_remove_sfp_usercontext() can safely execute without impacting the mutex handling in sg_release(). The fix has been tested and validated by syzbot. This patch closes the bug reported at the following syzkaller link and ensures proper sequencing of resource cleanup and mutex operations, eliminating the risk of use-after-free errors in sg_release(). Reported-by: syzbot+7efb5850a17ba6ce098b@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=7efb5850a17ba6ce098b Tested-by: syzbot+7efb5850a17ba6ce098b@syzkaller.appspotmail.com Fixes: cc833acbee9d ("sg: O_EXCL and other lock handling") Signed-off-by: Suraj Sonawane Link: https://lore.kernel.org/r/20241120125944.88095-1-surajsonawane0215@gmail.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit eb48e9fc0028bed94a40a9352d065909f19e333c Author: Gwendal Grignou Date: Tue Nov 19 22:25:22 2024 -0800 scsi: ufs: core: sysfs: Prevent div by zero Prevent a division by 0 when monitoring is not enabled. Fixes: 1d8613a23f3c ("scsi: ufs: core: Introduce HBA performance monitor sysfs nodes") Cc: stable@vger.kernel.org Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20241120062522.917157-1-gwendal@chromium.org Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit 35002a8ec557f679e414dae9dec9d08c66f2791a Author: Nilesh Javali Date: Fri Nov 15 18:33:13 2024 +0530 scsi: qla2xxx: Update version to 10.02.09.400-k Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20241115130313.46826-8-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit e4e268f898c8a08f0a1188677e15eadbc06e98f6 Author: Anil Gurumurthy Date: Fri Nov 15 18:33:12 2024 +0530 scsi: qla2xxx: Supported speed displayed incorrectly for VPorts The fc_function_template for vports was missing the .show_host_supported_speeds. The base port had the same. Add .show_host_supported_speeds to the vport template as well. Cc: stable@vger.kernel.org Fixes: 2c3dfe3f6ad8 ("[SCSI] qla2xxx: add support for NPIV") Signed-off-by: Anil Gurumurthy Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20241115130313.46826-7-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 4812b7796c144f63a1094f79a5eb8fbdad8d7ebc Author: Quinn Tran Date: Fri Nov 15 18:33:11 2024 +0530 scsi: qla2xxx: Fix NVMe and NPIV connect issue NVMe controller fails to send connect command due to failure to locate hw context buffer for NVMe queue 0 (blk_mq_hw_ctx, hctx_idx=0). The cause of the issue is NPIV host did not initialize the vha->irq_offset field. This field is given to blk-mq (blk_mq_pci_map_queues) to help locate the beginning of IO Queues which in turn help locate NVMe queue 0. Initialize this field to allow NVMe to work properly with NPIV host. kernel: nvme nvme5: Connect command failed, errno: -18 kernel: nvme nvme5: qid 0: secure concatenation is not supported kernel: nvme nvme5: NVME-FC{5}: create_assoc failed, assoc_id 2e9100 ret 401 kernel: nvme nvme5: NVME-FC{5}: reset: Reconnect attempt failed (401) kernel: nvme nvme5: NVME-FC{5}: Reconnect attempt in 2 seconds Cc: stable@vger.kernel.org Fixes: f0783d43dde4 ("scsi: qla2xxx: Use correct number of vectors for online CPUs") Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20241115130313.46826-6-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 833c70e212fc40d3e98da941796f4c7bcaecdf58 Author: Saurav Kashyap Date: Fri Nov 15 18:33:10 2024 +0530 scsi: qla2xxx: Remove check req_sg_cnt should be equal to rsp_sg_cnt Firmware supports multiple sg_cnt for request and response for CT commands, so remove the redundant check. A check is there where sg_cnt for request and response should be same. This is not required as driver and FW have code to handle multiple and different sg_cnt on request and response. Cc: stable@vger.kernel.org Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20241115130313.46826-5-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 841df27d619ee1f5ca6473e15227b39d6136562d Author: Quinn Tran Date: Fri Nov 15 18:33:09 2024 +0530 scsi: qla2xxx: Move FCE Trace buffer allocation to user control Currently FCE Tracing is enabled to log additional ELS events. Instead, user will enable or disable this feature through debugfs. Modify existing DFS knob to allow user to enable or disable this feature. echo [1 | 0] > /sys/kernel/debug/qla2xxx/qla2xxx_??/fce cat /sys/kernel/debug/qla2xxx/qla2xxx_??/fce Cc: stable@vger.kernel.org Fixes: df613b96077c ("[SCSI] qla2xxx: Add Fibre Channel Event (FCE) tracing support.") Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20241115130313.46826-4-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit a9a099575d4f24323ae3351b21fe556d37d9e932 Author: Prateek Singh Rathore Date: Sat Nov 23 03:30:38 2024 -0800 scsi: csiostor: Fix typo doesnt->doesn't Signed-off-by: Prateek Singh Rathore Link: https://lore.kernel.org/r/20241123113038.11188-1-prateek.singh.rathore@gmail.com Signed-off-by: Martin K. Petersen commit be769e5cf53b8a45eedcc7354bacf939ae16f72c Author: Avri Altman Date: Sun Nov 24 09:08:08 2024 +0200 scsi: ufs: core: Introduce a new clock_scaling lock Introduce a new clock scaling lock to serialize access to some of the clock scaling members instead of the host_lock. here also, simplify the code with the guard() macro and co. Reviewed-by: Bart Van Assche Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20241124070808.194860-5-avri.altman@wdc.com Signed-off-by: Martin K. Petersen commit 209f4e43b8068c24cde227f464111030430153fa Author: Avri Altman Date: Sun Nov 24 09:08:07 2024 +0200 scsi: ufs: core: Introduce a new clock_gating lock Introduce a new clock gating lock to serialize access to some of the clock gating members instead of the host_lock. While at it, simplify the code with the guard() macro and co for automatic cleanup of the new lock. There are some explicit spin_lock_irqsave()/spin_unlock_irqrestore() snaking instances I left behind because I couldn't make heads or tails of it. Additionally, move the trace_ufshcd_clk_gating() call from inside the region protected by the lock as it doesn't needs protection. Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20241124070808.194860-4-avri.altman@wdc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7869c6521f5715688b3d1f1c897374a68544eef0 Author: Avri Altman Date: Sun Nov 24 09:08:06 2024 +0200 scsi: ufs: core: Prepare to introduce a new clock_gating lock Remove hba->clk_gating.active_reqs check from ufshcd_is_ufs_dev_busy() function to separate clock gating logic from general device busy checks. Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20241124070808.194860-3-avri.altman@wdc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e738ba458e7539be1757dcdf85835a5c7b11fad4 Author: Avri Altman Date: Sun Nov 24 09:08:05 2024 +0200 scsi: ufs: core: Introduce ufshcd_has_pending_tasks() Prepare to remove hba->clk_gating.active_reqs check from ufshcd_is_ufs_dev_busy(). Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20241124070808.194860-2-avri.altman@wdc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit cdb03e598750e7ebc222571aa96653e9b5a59dbe Author: Thorsten Blum Date: Sun Nov 10 23:33:24 2024 +0100 scsi: bsg: Replace zero-length array with flexible array member Replace the deprecated zero-length array with a modern flexible array member in the struct iscsi_bsg_host_vendor_reply. Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Thorsten Blum Link: https://lore.kernel.org/r/20241110223323.42772-2-thorsten.blum@linux.dev Signed-off-by: Martin K. Petersen commit 5f8822c4a4209b186ba655841993e5797c31e19e Author: Thorsten Blum Date: Thu Nov 7 11:42:59 2024 +0100 scsi: fnic: Use vcalloc() instead of vmalloc() and memset(0) Use vcalloc() instead of vmalloc() followed by memset(0) to simplify the functions fnic_trace_buf_init() and fnic_fc_trace_init(). Compile-tested only. Reviewed-by: Johannes Thumshirn Signed-off-by: Thorsten Blum Link: https://lore.kernel.org/r/20241107104300.1252-1-thorsten.blum@linux.dev Signed-off-by: Martin K. Petersen commit 07c903db0a2ff84b68efa1a74a4de353ea591eb0 Author: Quinn Tran Date: Fri Nov 15 18:33:08 2024 +0530 scsi: qla2xxx: Fix use after free on unload System crash is observed with stack trace warning of use after free. There are 2 signals to tell dpc_thread to terminate (UNLOADING flag and kthread_stop). On setting the UNLOADING flag when dpc_thread happens to run at the time and sees the flag, this causes dpc_thread to exit and clean up itself. When kthread_stop is called for final cleanup, this causes use after free. Remove UNLOADING signal to terminate dpc_thread. Use the kthread_stop as the main signal to exit dpc_thread. [596663.812935] kernel BUG at mm/slub.c:294! [596663.812950] invalid opcode: 0000 [#1] SMP PTI [596663.812957] CPU: 13 PID: 1475935 Comm: rmmod Kdump: loaded Tainted: G IOE --------- - - 4.18.0-240.el8.x86_64 #1 [596663.812960] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 08/20/2012 [596663.812974] RIP: 0010:__slab_free+0x17d/0x360 ... [596663.813008] Call Trace: [596663.813022] ? __dentry_kill+0x121/0x170 [596663.813030] ? _cond_resched+0x15/0x30 [596663.813034] ? _cond_resched+0x15/0x30 [596663.813039] ? wait_for_completion+0x35/0x190 [596663.813048] ? try_to_wake_up+0x63/0x540 [596663.813055] free_task+0x5a/0x60 [596663.813061] kthread_stop+0xf3/0x100 [596663.813103] qla2x00_remove_one+0x284/0x440 [qla2xxx] Cc: stable@vger.kernel.org Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20241115130313.46826-3-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit c423263082ee8ccfad59ab33e3d5da5dc004c21e Author: Quinn Tran Date: Fri Nov 15 18:33:07 2024 +0530 scsi: qla2xxx: Fix abort in bsg timeout Current abort of bsg on timeout prematurely clears the outstanding_cmds[]. Abort does not allow FW to return the IOCB/SRB. In addition, bsg_job_done() is not called to return the BSG (i.e. leak). Abort the outstanding bsg/SRB and wait for the completion. The completion IOCB will wake up the bsg_timeout thread. If abort is not successful, then driver will forcibly call bsg_job_done() and free the srb. Err Inject: - qaucli -z - assign CT Passthru IOCB's NportHandle with another initiator nport handle to trigger timeout. Remote port will drop CT request. - bsg_job_done is properly called as part of cleanup kernel: qla2xxx [0000:21:00.1]-7012:7: qla2x00_process_ct : 286 : Error Inject. kernel: qla2xxx [0000:21:00.1]-7016:7: bsg rqst type: FC_BSG_HST_CT else type: 101 - loop-id=1 portid=fffffa. kernel: qla2xxx [0000:21:00.1]-70bb:7: qla24xx_bsg_timeout CMD timeout. bsg ptr ffff9971a42f0838 msgcode 80000004 vendor cmd fa010000 kernel: qla2xxx [0000:21:00.1]-507c:7: Abort command issued - hdl=4b, type=5 kernel: qla2xxx [0000:21:00.1]-5040:7: ELS-CT pass-through-ct pass-through error hdl=4b comp_status-status=0x5 error subcode 1=0x0 error subcode 2=0xaf882e80. kernel: qla2xxx [0000:21:00.1]-7009:7: qla2x00_bsg_job_done: sp hdl 4b, result=70000 bsg ptr ffff9971a42f0838 kernel: qla2xxx [0000:21:00.1]-802c:7: Aborting bsg ffff9971a42f0838 sp=ffff99760b87ba80 handle=4b rval=0 kernel: qla2xxx [0000:21:00.1]-708a:7: bsg abort success. bsg ffff9971a42f0838 sp=ffff99760b87ba80 handle=0x4b kernel: qla2xxx [0000:21:00.1]-7012:7: qla2x00_process_ct : 286 : Error Inject. kernel: qla2xxx [0000:21:00.1]-7016:7: bsg rqst type: FC_BSG_HST_CT else type: 101 - loop-id=1 portid=fffffa. kernel: qla2xxx [0000:21:00.1]-70bb:7: qla24xx_bsg_timeout CMD timeout. bsg ptr ffff9971a42f43b8 msgcode 80000004 vendor cmd fa010000 kernel: qla2xxx [0000:21:00.1]-7012:7: qla_bsg_found : 2206 : Error Inject 2. kernel: qla2xxx [0000:21:00.1]-802c:7: Aborting bsg ffff9971a42f43b8 sp=ffff99762c304440 handle=5e rval=5 kernel: qla2xxx [0000:21:00.1]-704f:7: bsg abort fail. bsg=ffff9971a42f43b8 sp=ffff99762c304440 rval=5. kernel: qla2xxx [0000:21:00.1]-7051:7: qla_bsg_found bsg_job_done : bsg ffff9971a42f43b8 result 0xfffffffa sp ffff99762c304440. Cc: stable@vger.kernel.org Fixes: c449b4198701 ("scsi: qla2xxx: Use QP lock to search for bsg") Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20241115130313.46826-2-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 0deb37c2f42a54610dd3569b01413378f430bfea Author: Ranjan Kumar Date: Mon Nov 11 01:14:05 2024 +0530 scsi: mpi3mr: Update driver version to 8.12.0.3.50 Update driver version to 8.12.0.3.50. Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20241110194405.10108-6-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit fb6eb98f3965e2ee92cbcb466051d2f2acf552d1 Author: Ranjan Kumar Date: Mon Nov 11 01:14:04 2024 +0530 scsi: mpi3mr: Handling of fault code for insufficient power Before retrying initialization, check and abort if the fault code indicates insufficient power. Also mark the controller as unrecoverable instead of issuing reset in the watch dog timer if the fault code indicates insufficient power. Signed-off-by: Prayas Patel Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20241110194405.10108-5-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 0d32014f1e3e7a7adf1583c45387f26b9bb3a49d Author: Ranjan Kumar Date: Mon Nov 11 01:14:03 2024 +0530 scsi: mpi3mr: Start controller indexing from 0 Instead of displaying the controller index starting from '1' make the driver display the controller index starting from '0'. Signed-off-by: Sumit Saxena Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20241110194405.10108-4-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 711201a8b8334a397440ac0b859df0054e174bc9 Author: Ranjan Kumar Date: Mon Nov 11 01:14:02 2024 +0530 scsi: mpi3mr: Fix corrupt config pages PHY state is switched in sysfs The driver, through the SAS transport, exposes a sysfs interface to enable/disable PHYs in a controller/expander setup. When multiple PHYs are disabled and enabled in rapid succession, the persistent and current config pages related to SAS IO unit/SAS Expander pages could get corrupted. Use separate memory for each config request. Signed-off-by: Prayas Patel Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20241110194405.10108-3-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 367ac16e5ff2dcd6b7f00a8f94e6ba98875cb397 Author: Ranjan Kumar Date: Mon Nov 11 01:14:01 2024 +0530 scsi: mpi3mr: Synchronize access to ioctl data buffer The driver serializes ioctls through a mutex lock but access to the ioctl data buffer is not guarded by the mutex. This results in multiple user threads being able to write to the driver's ioctl buffer simultaneously. Protect the ioctl buffer with the ioctl mutex. Signed-off-by: Sumit Saxena Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20241110194405.10108-2-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 6050471545eecec214ca9ceb38a63e98e9003338 Author: Ranjan Kumar Date: Sun Nov 10 23:03:41 2024 +0530 scsi: mpt3sas: Update driver version to 51.100.00.00 Update driver version to 51.100.00.00. Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20241110173341.11595-3-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 3f5eb062e8aa335643181c480e6c590c6cedfd22 Author: Ranjan Kumar Date: Sun Nov 10 23:03:40 2024 +0530 scsi: mpt3sas: Diag-Reset when Doorbell-In-Use bit is set during driver load time Issue a Diag-Reset when the "Doorbell-In-Use" bit is set during the driver load/initialization. Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20241110173341.11595-2-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 897df60c16d54ad515a3d0887edab5c63da06d1f Author: Manivannan Sadhasivam Date: Mon Nov 11 23:18:34 2024 +0530 scsi: ufs: pltfrm: Dellocate HBA during ufshcd_pltfrm_remove() This will ensure that the scsi host is cleaned up properly using scsi_host_dev_release(). Otherwise, it may lead to memory leaks. Cc: stable@vger.kernel.org # 4.4 Fixes: 03b1781aa978 ("[SCSI] ufs: Add Platform glue driver for ufshcd") Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-5-45ad8b62f02e@linaro.org Reviewed-by: Peter Wang Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1745dcdb7227102e16248a324c600b9121c8f6df Author: Manivannan Sadhasivam Date: Mon Nov 11 23:18:33 2024 +0530 scsi: ufs: pltfrm: Drop PM runtime reference count after ufshcd_remove() During the remove stage of glue drivers, some of them are incrementing the reference count using pm_runtime_get_sync(), before removing the ufshcd using ufshcd_remove(). But they are not dropping that reference count after ufshcd_remove() to balance the refcount. So drop the reference count by calling pm_runtime_put_noidle() after ufshcd_remove(). Since the behavior is applicable to all glue drivers, move the PM handling to ufshcd_pltfrm_remove(). Cc: stable@vger.kernel.org # 3.12 Fixes: 62694735ca95 ("[SCSI] ufs: Add runtime PM support for UFS host controller driver") Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-4-45ad8b62f02e@linaro.org Reviewed-by: Peter Wang Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d3326e6a3f9bf1e075be2201fb704c2fdf19e2b7 Author: Manivannan Sadhasivam Date: Mon Nov 11 23:18:32 2024 +0530 scsi: ufs: pltfrm: Disable runtime PM during removal of glue drivers When the UFSHCD platform glue drivers are removed, runtime PM should be disabled using pm_runtime_disable() to balance the enablement done in ufshcd_pltfrm_init(). This is also reported by PM core when the glue driver is removed and inserted again: ufshcd-qcom 1d84000.ufshc: Unbalanced pm_runtime_enable! So disable runtime PM using a new helper API ufshcd_pltfrm_remove(), that also takes care of removing ufshcd. This helper should be called during the remove() stage of glue drivers. Cc: stable@vger.kernel.org # 3.12 Fixes: 62694735ca95 ("[SCSI] ufs: Add runtime PM support for UFS host controller driver") Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-3-45ad8b62f02e@linaro.org Reviewed-by: Peter Wang Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 64506b3d23a337e98a74b18dcb10c8619365f2bd Author: Manivannan Sadhasivam Date: Mon Nov 11 23:18:31 2024 +0530 scsi: ufs: qcom: Only free platform MSIs when ESI is enabled Otherwise, it will result in a NULL pointer dereference as below: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Call trace: mutex_lock+0xc/0x54 platform_device_msi_free_irqs_all+0x14/0x20 ufs_qcom_remove+0x34/0x48 [ufs_qcom] platform_remove+0x28/0x44 device_remove+0x4c/0x80 device_release_driver_internal+0xd8/0x178 driver_detach+0x50/0x9c bus_remove_driver+0x6c/0xbc driver_unregister+0x30/0x60 platform_driver_unregister+0x14/0x20 ufs_qcom_pltform_exit+0x18/0xb94 [ufs_qcom] __arm64_sys_delete_module+0x180/0x260 invoke_syscall+0x44/0x100 el0_svc_common.constprop.0+0xc0/0xe0 do_el0_svc+0x1c/0x28 el0_svc+0x34/0xdc el0t_64_sync_handler+0xc0/0xc4 el0t_64_sync+0x190/0x194 Cc: stable@vger.kernel.org # 6.3 Fixes: 519b6274a777 ("scsi: ufs: qcom: Add MCQ ESI config vendor specific ops") Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-2-45ad8b62f02e@linaro.org Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1695c4361d35b7bdadd7b34f99c9c07741e181e5 Author: Manivannan Sadhasivam Date: Mon Nov 11 23:18:30 2024 +0530 scsi: ufs: core: Cancel RTC work during ufshcd_remove() Currently, RTC work is only cancelled during __ufshcd_wl_suspend(). When ufshcd is removed in ufshcd_remove(), RTC work is not cancelled. Due to this, any further trigger of the RTC work after ufshcd_remove() would result in a NULL pointer dereference as below: Unable to handle kernel NULL pointer dereference at virtual address 00000000000002a4 Workqueue: events ufshcd_rtc_work Call trace: _raw_spin_lock_irqsave+0x34/0x8c pm_runtime_get_if_active+0x24/0xb4 ufshcd_rtc_work+0x124/0x19c process_scheduled_works+0x18c/0x2d8 worker_thread+0x144/0x280 kthread+0x11c/0x128 ret_from_fork+0x10/0x20 Since RTC work accesses the ufshcd internal structures, it should be cancelled when ufshcd is removed. So do that in ufshcd_remove(), as per the order in ufshcd_init(). Cc: stable@vger.kernel.org # 6.8 Fixes: 6bf999e0eb41 ("scsi: ufs: core: Add UFS RTC support") Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-1-45ad8b62f02e@linaro.org Reviewed-by: Peter Wang Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 60b4dd1460f6d65739acb0f28d12bd9abaeb34b4 Author: Ziqi Chen Date: Tue Nov 19 17:56:04 2024 +0800 scsi: ufs: core: Add ufshcd_send_bsg_uic_cmd() for UFS BSG User layer applications can send UIC GET/SET commands via the BSG framework, and if the user layer application sends a UIC SET command to the PA_PWRMODE attribute, a power mode change shall be initiated in UniPro and two interrupts shall be triggered if the power mode is successfully changed, i.e., UIC Command Completion interrupt and UIC Power Mode interrupt. The current UFS BSG code calls ufshcd_send_uic_cmd() directly, with which the second interrupt, i.e., UIC Power Mode interrupt, shall be treated as unhandled interrupt. In addition, after the UIC command is completed, user layer application has to poll UniPro and/or M-PHY state machine to confirm the power mode change is finished. Add a new wrapper function ufshcd_send_bsg_uic_cmd() and call it from ufs_bsg_request() so that if a UIC SET command is targeting the PA_PWRMODE attribute it can be redirected to ufshcd_uic_pwr_ctrl(). Fixes: e77044c5a842 ("scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request()") Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Ziqi Chen Link: https://lore.kernel.org/r/20241119095613.121385-1-quic_ziqichen@quicinc.com Reviewed-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Peter Wang Signed-off-by: Martin K. Petersen commit 5cd3167a5ebbbe49516f29e5dd16317ab6ff479a Author: Christophe JAILLET Date: Mon Nov 11 14:10:56 2024 +0100 scsi: target: tcmu: Constify some structures 'struct nla_policy' and 'struct match_table_t' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increase overall security, especially when the structure holds some function pointers, which is the case of struct nla_policy. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 93188 6933 338 100459 1886b drivers/target/target_core_user.o After: ===== text data bss dec hex filename 93508 6581 338 100427 1884b drivers/target/target_core_user.o Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f83cd8469cc17391178e1181e8c26c4c1fb6028f.1731330634.git.christophe.jaillet@wanadoo.fr Reviewed-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit 50740f4dc78b41dec7c8e39772619d5ba841ddd7 Author: Tomas Henzl Date: Mon Sep 23 19:48:33 2024 +0200 scsi: megaraid_sas: Fix for a potential deadlock This fixes a 'possible circular locking dependency detected' warning CPU0 CPU1 ---- ---- lock(&instance->reset_mutex); lock(&shost->scan_mutex); lock(&instance->reset_mutex); lock(&shost->scan_mutex); Fix this by temporarily releasing the reset_mutex. Signed-off-by: Tomas Henzl Link: https://lore.kernel.org/r/20240923174833.45345-1-thenzl@redhat.com Acked-by: Chandrakanth Patil Signed-off-by: Martin K. Petersen commit 2c354d12307e58a748ade2802b4d26fd0d8c34a9 Author: liujing Date: Fri Nov 8 15:09:35 2024 +0800 scsi: lpfc: Fix spelling errors 'asynchronously' Signed-off-by: liujing Link: https://lore.kernel.org/r/20241108070935.10427-1-liujing@cmss.chinamobile.com Signed-off-by: Martin K. Petersen commit 5fe4e16fdbb8ca7dd6daea0031a0a84e6eb1e18d Author: Uwe Kleine-König Date: Tue Nov 19 19:28:56 2024 +0100 scsi: ufs: Switch back to struct platform_driver::remove() After commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void") .remove() is (again) the right callback to implement for platform drivers. Convert all platform drivers below drivers/ufs to use .remove(), with the eventual goal to drop struct platform_driver::remove_new(). As .remove() and .remove_new() have the same prototypes, conversion is done by just changing the structure member name in the driver initializer. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20241119182856.55743-2-u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen commit 575143abcbbc7e291e5ef5c4fc031d94f8501918 Author: Dr. David Alan Gilbert Date: Sun Nov 17 13:52:15 2024 +0000 scsi: bfa: Remove unused parsers bfa has a set of structure parsers, of which quite a few are unused. Remove the unused set. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20241117135215.38771-3-linux@treblig.org Signed-off-by: Martin K. Petersen commit 52172a352c97d39ee2658f6503b065b9896d48ad Author: Dr. David Alan Gilbert Date: Sun Nov 17 13:52:14 2024 +0000 scsi: bfa: Remove unused structure builders bfa has a large set of structure builders, of which only about 60% are used; remove the rest. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20241117135215.38771-2-linux@treblig.org Signed-off-by: Martin K. Petersen commit e953835c1d41bbb660d7069dc9e61ea6bd7874f3 Author: Christophe JAILLET Date: Fri Nov 15 22:12:42 2024 +0100 scsi: message: fusion: Constify struct pci_device_id 'struct pci_device_id' is not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 36999 2451 88 39538 9a72 drivers/message/fusion/mptfc.o After: ===== text data bss dec hex filename 37415 2043 88 39546 9a7a drivers/message/fusion/mptfc.o Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/fe8f17a999b6def2649b2ef52ea5c9ee61e28bd0.1731705152.git.christophe.jaillet@wanadoo.fr Signed-off-by: Martin K. Petersen commit c064de86d2a3909222d5996c5047f64c7a8f791b Author: Magnus Lindholm Date: Wed Nov 13 23:51:49 2024 +0100 scsi: qla1280: Fix hw revision numbering for ISP1020/1040 Fix the hardware revision numbering for Qlogic ISP1020/1040 boards. HWMASK suggests that the revision number only needs four bits, this is consistent with how NetBSD does things in their ISP driver. Verified on a IPS1040B which is seen as rev 5 not as BIT_4. Signed-off-by: Magnus Lindholm Link: https://lore.kernel.org/r/20241113225636.2276-1-linmag7@gmail.com Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen