commit cf82b9e866b644d5eca38b55403e1efa8f1cc8da Author: Sumit Saxena Date: Thu Jun 27 15:47:35 2024 +0530 scsi: mpi3mr: Driver version update Signed-off-by: Sumit Saxena Link: https://lore.kernel.org/r/20240627101735.18286-4-sumit.saxena@broadcom.com Signed-off-by: Martin K. Petersen commit 1c342b0548e3f53a4478f8d7bcb5af34b361787f Author: Sumit Saxena Date: Thu Jun 27 15:47:34 2024 +0530 scsi: mpi3mr: Prevent PCI writes from driver during PCI error recovery Prevent interaction with the hardware while the error recovery in progress. Co-developed-by: Sathya Prakash Signed-off-by: Sathya Prakash Co-developed-by: Ranjan Kumar Signed-off-by: Ranjan Kumar Signed-off-by: Sumit Saxena Link: https://lore.kernel.org/r/20240627101735.18286-3-sumit.saxena@broadcom.com Signed-off-by: Martin K. Petersen commit 30bafe1774f0aa17d3247466a2d51ce1351c3331 Author: Sumit Saxena Date: Thu Jun 27 15:47:33 2024 +0530 scsi: mpi3mr: Support PCI Error Recovery callback handlers PCI Error recovery support is required to recover the controller upon detection of PCI errors. Add support for the PCI error recovery callback handlers in mpi3mr driver. Co-developed-by: Sathya Prakash Signed-off-by: Sathya Prakash Co-developed-by: Ranjan Kumar Signed-off-by: Ranjan Kumar Signed-off-by: Sumit Saxena Link: https://lore.kernel.org/r/20240627101735.18286-2-sumit.saxena@broadcom.com Signed-off-by: Martin K. Petersen commit 41972df1a56bd926a14d9670936f5278cf351968 Author: Justin Tee Date: Fri Jun 28 10:20:11 2024 -0700 scsi: lpfc: Update lpfc version to 14.4.0.3 Update lpfc version to 14.4.0.3. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 8bc7c617642db6d8d20ee671fb6c4513017e7a7e Author: Justin Tee Date: Fri Jun 28 10:20:10 2024 -0700 scsi: lpfc: Revise lpfc_prep_embed_io routine with proper endian macro usages On big endian architectures, it is possible to run into a memory out of bounds pointer dereference when FCP targets are zoned. In lpfc_prep_embed_io, the memcpy(ptr, fcp_cmnd, sgl->sge_len) is referencing a little endian formatted sgl->sge_len value. So, the memcpy can cause big endian systems to crash. Redefine the *sgl ptr as a struct sli4_sge_le to make it clear that we are referring to a little endian formatted data structure. And, update the routine with proper le32_to_cpu macro usages. Fixes: af20bb73ac25 ("scsi: lpfc: Add support for 32 byte CDBs") Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit f65f31ac120bd2c308bf16b18e5ee74445c06446 Author: Justin Tee Date: Fri Jun 28 10:20:09 2024 -0700 scsi: lpfc: Fix incorrect request len mbox field when setting trunking via sysfs When setting trunk modes through sysfs, the SLI_CONFIG mailbox command's command payload length is incorrectly hardcoded to 12 bytes. SLI_CONFIG's payload length field should be specified large enough to encompass both the submailbox command header and the submailbox request itself. Thus, replace the hardcoded 12 bytes with a clearer calculation by way of sizeof(struct lpfc_mbx_set_trunk_mode) - sizeof(struct lpfc_sli4_cfg_mhdr). Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit ede596b1434b57c0b3fd5c02b326efe5c54f6e48 Author: Justin Tee Date: Fri Jun 28 10:20:08 2024 -0700 scsi: lpfc: Handle mailbox timeouts in lpfc_get_sfp_info The MBX_TIMEOUT return code is not handled in lpfc_get_sfp_info and the routine unconditionally frees submitted mailbox commands regardless of return status. The issue is that for MBX_TIMEOUT cases, when firmware returns SFP information at a later time, that same mailbox memory region references previously freed memory in its cmpl routine. Fix by adding checks for the MBX_TIMEOUT return code. During mailbox resource cleanup, check the mbox flag to make sure that the wait did not timeout. If the MBOX_WAKE flag is not set, then do not free the resources because it will be freed when firmware completes the mailbox at a later time in its cmpl routine. Also, increase the timeout from 30 to 60 seconds to accommodate boot scripts requiring longer timeouts. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 15e21dc6d6b7d7feb6b0262422b45da5e3c4b34f Author: Justin Tee Date: Fri Jun 28 10:20:07 2024 -0700 scsi: lpfc: Fix handling of fully recovered fabric node in dev_loss callbk In rare cases when a fabric node is recovered after a link bounce and before dev_loss_tmo callbk is reached, the driver may leave the fabric node in an inconsistent state with the NLP_IN_DEV_LOSS flag perpetually set. In lpfc_dev_loss_tmo_callbk, a check is added for a recovered fabric node. If the node is recovered, then don't queue the lpfc_dev_loss_tmo_handler work. In lpfc_dev_loss_tmo_handler, the path taken for the recovered fabric nodes is updated to clear the NLP_IN_DEV_LOSS flag. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit aeaf117cc7d28b994652491c87b929d853519d20 Author: Justin Tee Date: Fri Jun 28 10:20:06 2024 -0700 scsi: lpfc: Relax PRLI issue conditions after GID_FT response If previously in REG_LOGIN_ISSUE state, then remove the requirement that PLOGI must have been received from the remote port before issuing a PRLI. After GID_FT completes, it does not matter whether the driver itself sent a PLOGI or received one. The fact that we're in REG_LOGIN_ISSUE state simply means that the next state should be issuing the PRLI to continue discovery of the remote port. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 9609385dd91b26751019b22ca9bfa4bec7602ae1 Author: Justin Tee Date: Fri Jun 28 10:20:05 2024 -0700 scsi: lpfc: Allow DEVICE_RECOVERY mode after RSCN receipt if in PRLI_ISSUE state Certain vendor specific targets initially register with the fabric as an initiator function first and then re-register as a target function afterwards. The timing of the target function re-registration can cause a race condition such that the driver is stuck assuming the remote port as an initiator function and never discovers the target's hosted LUNs. Expand the nlp_state qualifier to also include NLP_STE_PRLI_ISSUE because the state means that PRLI was issued but we have not quite reached MAPPED_NODE state yet. If we received an RSCN in the PRLI_ISSUE state, then we should restart discovery again by going into DEVICE_RECOVERY. Fixes: dded1dc31aa4 ("scsi: lpfc: Modify when a node should be put in device recovery mode during RSCN") Cc: # v6.6+ Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit e999ef15423b35473c0d94ff3dd2011a0f7ddb04 Author: Justin Tee Date: Fri Jun 28 10:20:04 2024 -0700 scsi: lpfc: Cancel ELS WQE instead of issuing abort when SLI port is inactive During SLI port errata events, there should be no expectation that submitted outstanding WQEs will return back CQEs. In these situations, the driver should not rely on receiving CQEs from the SLI port to signal WQE resource clean up. Put an sli_flag LPFC_SLI_ACTIVE check in lpfc_els_flush_cmd() when walking the txcmplq. The sli_flag check helps determine whether to issue an abort or driver based cancel on outstanding WQEs. If !LPFC_SLI_ACTIVE, then there's no point to issue anything to the SLI port. Instead, let the driver based cancel logic clean up the submitted WQE resources. Also, enhance some abort log messages that help with future debugging. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20240628172011.25921-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 76a20140ef768133697c04dc19bf7e81706905c7 Author: Terrence Adams Date: Thu Jun 27 15:59:24 2024 +0000 scsi: pm8001: Update log level when reading config table Reading the main config table occurs as a part of initialization in pm80xx_chip_init(). Because of this it makes more sense to have it be a part of the INIT logging. Signed-off-by: Terrence Adams Link: https://lore.kernel.org/r/20240627155924.2361370-3-tadamsjr@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit e4f949ef1516c0d74745ee54a0f4882c1f6c7aea Author: Igor Pylypiv Date: Thu Jun 27 15:59:23 2024 +0000 scsi: pm80xx: Set phy->enable_completion only when we wait for it pm8001_phy_control() populates the enable_completion pointer with a stack address, sends a PHY_LINK_RESET / PHY_HARD_RESET, waits 300 ms, and returns. The problem arises when a phy control response comes late. After 300 ms the pm8001_phy_control() function returns and the passed enable_completion stack address is no longer valid. Late phy control response invokes complete() on a dangling enable_completion pointer which leads to a kernel crash. Signed-off-by: Igor Pylypiv Signed-off-by: Terrence Adams Link: https://lore.kernel.org/r/20240627155924.2361370-2-tadamsjr@google.com Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 7cbff570dbe8907e23bba06f6414899a0fbb2fcc Author: Kyoungrul Kim Date: Thu Jun 27 17:51:04 2024 +0900 scsi: ufs: core: Remove SCSI host only if added If host tries to remove ufshcd driver from a UFS device it would cause a kernel panic if ufshcd_async_scan fails during ufshcd_probe_hba before adding a SCSI host with scsi_add_host and MCQ is enabled since SCSI host has been defered after MCQ configuration introduced by commit 0cab4023ec7b ("scsi: ufs: core: Defer adding host to SCSI if MCQ is supported"). To guarantee that SCSI host is removed only if it has been added, set the scsi_host_added flag to true after adding a SCSI host and check whether it is set or not before removing it. Signed-off-by: Kyoungrul Kim Signed-off-by: Minwoo Im Link: https://lore.kernel.org/r/20240627085104epcms2p5897a3870ea5c6416aa44f94df6c543d7@epcms2p5 Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ed7dac86f1406d73aed21d0cd1563922031a2fd8 Author: Ram Prakash Gupta Date: Thu Jun 27 14:07:56 2024 +0530 scsi: ufs: qcom: Enable suspending clk scaling on no request Enable suspending clk scaling on no request for Qualcomm SoC. Signed-off-by: Ram Prakash Gupta Link: https://lore.kernel.org/r/20240627083756.25340-3-quic_rampraka@quicinc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 50183ac2cfb54e027dd36fb22ea1bd1e91e3a08b Author: Ram Prakash Gupta Date: Thu Jun 27 14:07:55 2024 +0530 scsi: ufs: core: Suspend clk scaling on no request Currently UFS clk scaling is getting suspended only when the clks are scaled down. When high load is generated, a huge amount of latency is added due to scaling up the clk and completing the request post that. Suspending the scaling in its existing state when high load is generated improves the random performance KPI by 28%. So suspending the scaling when there are no requests. And the clk would be put in low scaled state when the actual request load is low. Make this change optional by having the check enabled using vops since for some devices suspending without bringing the clk in low scaled state might have impact on power consumption of the SoC. Signed-off-by: Ram Prakash Gupta Link: https://lore.kernel.org/r/20240627083756.25340-2-quic_rampraka@quicinc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit de24085328c09e5a6dd8a8d95ad65876f097e9c1 Author: Tomas Henzl Date: Thu Jun 27 09:48:27 2024 +0200 scsi: mpi3mr: Correct a test in mpi3mr_sas_port_add() The test for a possible shift overflow is not correct. Fix it by replacing the '>' with a '>='. Signed-off-by: Tomas Henzl Link: https://lore.kernel.org/r/20240627074827.13672-1-thenzl@redhat.com Suggested-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 3f7e469987f85a16d968ae056c886ecb6207305f Author: Ranjan Kumar Date: Wed Jun 26 15:56:46 2024 +0530 scsi: mpi3mr: Update driver version to 8.9.1.0.50 Update driver version to 8.9.1.0.50 Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20240626102646.14298-5-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 78b506984ebeaefaf63172059422fc606dc23e68 Author: Ranjan Kumar Date: Wed Jun 26 15:56:45 2024 +0530 scsi: mpi3mr: Add ioctl support for HDB Add interface for applications to manage the host diagnostic buffers and update the automatic diag buffer capture triggers. Co-developed-by: Sathya Prakash Signed-off-by: Sathya Prakash Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20240626102646.14298-4-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit d8d08d1638ce1c237ce9c3f14649a3a4cf1b1749 Author: Ranjan Kumar Date: Wed Jun 26 15:56:44 2024 +0530 scsi: mpi3mr: Trigger support Add functions to process automatic diag triggers. If a condition defined in the triggers is met, the driver will call appropriate controller functions to save the diagnostic information. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405151955.BiAWI1SY-lkp@intel.com/ Co-developed-by: Sathya Prakash Signed-off-by: Sathya Prakash Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20240626102646.14298-3-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit fc4444941140c80088102b39eb130d2a7a048e58 Author: Ranjan Kumar Date: Wed Jun 26 15:56:43 2024 +0530 scsi: mpi3mr: HDB allocation and posting for hardware and firmware buffers To be able to debug controller problems it is beneficial to allocate and configure system/host memory buffers which can be used to capture hardware and firmware diagnostic information. Add functions required to allocate and post firmware and hardware diagnostic buffers to the controller and to set up automatic diagnostic capture triggers. Captures will be triggered under the following circumstances: 1. Firmware is in FAULT state. 2. Admin commands time out. 3. Controller reset caused due to I/O timeout Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405151758.7xrJz6rp-lkp@intel.com/ Co-developed-by: Sathya Prakash Signed-off-by: Sathya Prakash Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20240626102646.14298-2-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit bdee2f1dcd84dcd76d9557cf55e8f3662c6506eb Author: Adrian Hunter Date: Tue Jun 18 10:31:58 2024 +0300 scsi: ufs: ufs-pci: Add support for Intel Panther Lake Add PCI ID to support Intel Panther Lake, same as MTL. Signed-off-by: Adrian Hunter Link: https://lore.kernel.org/r/20240618073158.38504-1-adrian.hunter@intel.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4d66ecc6e5a5df965b43edace2d41d19ed15a2ea Author: Jeff Johnson Date: Tue Jun 25 09:53:45 2024 -0700 scsi: ufs: qcom: Add missing MODULE_DESCRIPTION() macro With ARCH=arm64, make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/ufs/host/ufs-qcom.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson Link: https://lore.kernel.org/r/20240625-md-drivers-ufs-host-v2-1-59a56974b05a@quicinc.com Signed-off-by: Martin K. Petersen commit 5e0bf3e8aec2cbc51123f84b29aaacbd91fc56fa Author: Huai-Yuan Liu Date: Fri Jun 21 16:25:45 2024 +0800 scsi: lpfc: Fix a possible null pointer dereference In function lpfc_xcvr_data_show, the memory allocation with kmalloc might fail, thereby making rdp_context a null pointer. In the following context and functions that use this pointer, there are dereferencing operations, leading to null pointer dereference. To fix this issue, a null pointer check should be added. If it is null, use scnprintf to notify the user and return len. Fixes: 479b0917e447 ("scsi: lpfc: Create a sysfs entry called lpfc_xcvr_data for transceiver info") Signed-off-by: Huai-Yuan Liu Link: https://lore.kernel.org/r/20240621082545.449170-1-qq810974084@gmail.com Reviewed-by: Justin Tee Signed-off-by: Martin K. Petersen commit 14d38356ec335b97a04c00719d7b6e73b136d291 Author: Bart Van Assche Date: Wed Jun 12 10:15:21 2024 -0700 scsi: core: Fix an incorrect comment The comment that scsi_static_device_list would go away was added more than 18 years ago. Today, that list is still there and a large number of additional entries have been added. This shows that this comment is incorrect. Hence fix that comment. Cc: Christoph Hellwig Cc: Avri Altman Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240612171522.2677600-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 95f8bf932b46cd5c17c681d67be9234551234eac Author: Jeff Johnson Date: Mon Jun 10 09:16:15 2024 -0700 scsi: Add missing MODULE_DESCRIPTION() macros On x86, make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/scsi_common.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/advansys.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/BusLogic.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/aha1740.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/isci/isci.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/elx/efct.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/atp870u.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/ppa.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/scsi/imm.o Add all missing invocations of the MODULE_DESCRIPTION() macro. This updates all files which have a MODULE_LICENSE() but which do not have a MODULE_DESCRIPTION(), even ones which did not produce the x86 allmodconfig warnings. Acked-by: Finn Thain Signed-off-by: Jeff Johnson Link: https://lore.kernel.org/r/20240610-md-drivers-scsi-v3-1-055da78d66b2@quicinc.com Signed-off-by: Martin K. Petersen commit daf613331c9388dec1b8c56565583afcdf87a053 Author: Bart Van Assche Date: Mon Jun 3 10:23:11 2024 -0700 scsi: powertec: Declare local function static Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240603172311.1587589-5-bvanassche@acm.org Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 1dc98be418149feb79779af45abe0fe6243243e9 Author: Bart Van Assche Date: Mon Jun 3 10:23:10 2024 -0700 scsi: eesox: Declare local function static Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240603172311.1587589-4-bvanassche@acm.org Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 1414045725a00f40d52ffb4c866d6efeab02c37a Author: Bart Van Assche Date: Mon Jun 3 10:23:09 2024 -0700 scsi: cumana: Declare local function static Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240603172311.1587589-3-bvanassche@acm.org Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit f5a954bbf2f4309a222f56162f2cd576b7b27f48 Author: Bart Van Assche Date: Mon Jun 3 10:23:08 2024 -0700 scsi: acornscsi: Declare local functions static Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240603172311.1587589-2-bvanassche@acm.org Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit a420a8ed0a92488a04b34dfc262101c87940c800 Author: Minwoo Im Date: Sat Jun 1 06:22:44 2024 +0900 scsi: ufs: mcq: Prevent no I/O queue case for MCQ If hba_maxq equals poll_queues, which means there are no I/O queues (HCTX_TYPE_DEFAULT, HCTX_TYPE_READ), the very first hw queue will be allocated as HCTX_TYPE_POLL and it will be used as the dev_cmd_queue. In this case, device commands such as QUERY cannot be properly handled. This patch prevents the initialization of MCQ when the number of I/O queues is not set and only the number of POLL queues is set. Signed-off-by: Minwoo Im Link: https://lore.kernel.org/r/20240531212244.1593535-3-minwoo.im@samsung.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 175d1825ca4d2288fee734ada0955a1e36dd50e6 Author: Minwoo Im Date: Sat Jun 1 06:22:43 2024 +0900 scsi: ufs: pci: Add support MCQ for QEMU-based UFS Recently, ufs-mcq feature has been introduced to QEMU hw/ufs device [1]. This patch adds MCQ support for upstream QEMU UFS PCI controller. This patch provides mandatory vops callbacks to make UFS controller work properly on MCQ mode. Operation and Runtime Config register stride is fixed to 48bytes which is implemented by qemu. [1] https://lore.kernel.org/qemu-devel/cover.1716876237.git.jeuk20.kim@samsung.com/ Signed-off-by: Minwoo Im Link: https://lore.kernel.org/r/20240531212244.1593535-2-minwoo.im@samsung.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e8a1d87b7983b461d1d625e2973cdaadc0bd8ff5 Author: Minwoo Im Date: Mon May 20 07:14:57 2024 +0900 scsi: ufs: mcq: Convert MCQ_CFG_n to an inline function Inline functions are preferred over macros. Convert the MCQ_CFG_n macro to an inline function. Signed-off-by: Minwoo Im Link: https://lore.kernel.org/r/20240519221457.772346-3-minwoo.im@samsung.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2fc39848952dfb91a9233563cc1444669b8e79c3 Author: Minwoo Im Date: Mon May 20 07:14:56 2024 +0900 scsi: ufs: mcq: Fix missing argument 'hba' in MCQ_OPR_OFFSET_n The MCQ_OPR_OFFSET_n macro takes 'hba' in the caller context without receiving 'hba' instance as an argument. To prevent potential bugs in future use cases, add an argument 'hba'. Fixes: 2468da61ea09 ("scsi: ufs: core: mcq: Configure operation and runtime interface") Cc: Asutosh Das Signed-off-by: Minwoo Im Link: https://lore.kernel.org/r/20240519221457.772346-2-minwoo.im@samsung.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 600edc6620a4380b9f6027f293dac09eb0f22048 Author: Avri Altman Date: Thu May 30 17:25:09 2024 +0300 scsi: ufs: sysfs: Make max_number_of_rtt read-write Given the importance of the RTT parameter, we want to be able to configure it via sysfs. This is because UFS users should be discouraged from change UFS device parameters without the UFSHCI driver being aware of these changes. Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20240530142510.734-4-avri.altman@wdc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e75ff63300c5e8fac31649f438ebad6af88e0032 Author: Avri Altman Date: Thu May 30 17:25:08 2024 +0300 scsi: ufs: core: Maximum RTT supported by the host driver Allow platform vendors to take precedence having their own max rtt support. This makes sense because the host controller's nortt characteristic may vary among vendors. while at it, set this value for Mediatek, as requested by Peter - https://lore.kernel.org/all/0a57d6bab739d6a10584f2baba115d00dfc9c94c.camel@mediatek.com/ Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20240530142510.734-3-avri.altman@wdc.com Reviewed-by: Peter Wang Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9ec54934ce857065e38523a2010e20182e76f515 Author: Avri Altman Date: Thu May 30 17:25:07 2024 +0300 scsi: ufs: core: Allow RTT negotiation The rtt-upiu packets precede any data-out upiu packets, thus synchronizing the data input to the device: this mostly applies to write operations, but there are other operations that requires rtt as well. There are several rules binding this rtt - data-out dialog, specifically There can be at most outstanding bMaxNumOfRTT such packets. This might have an effect on write performance (sequential write in particular), as each data-out upiu must wait for its rtt sibling. UFSHCI expects bMaxNumOfRTT to be min(bDeviceRTTCap, NORTT). However, as of today, there does not appears to be no-one who sets it: not the host controller nor the driver. It wasn't an issue up to now: bMaxNumOfRTT is set to 2 after manufacturing, and wasn't limiting the write performance. UFS4.0, and specifically gear 5 changes this, and requires the device to be more attentive. This doesn't come free - the device has to allocate more resources to that end, but the sequential write performance improvement is significant. Early measurements shows 25% gain when moving from rtt 2 to 9. Therefore, set bMaxNumOfRTT to be min(bDeviceRTTCap, NORTT) as UFSHCI expects. Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20240530142510.734-2-avri.altman@wdc.com Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 96281dfa266d333522c004205acc5ff1e9e3a337 Author: Dr. David Alan Gilbert Date: Tue May 28 22:56:40 2024 +0100 scsi: qla2xxx: Remove unused struct 'scsi_dif_tuple' 'scsi_dif_tuple' is unused since commit 8cb2049c7448 ("[SCSI] qla2xxx: T10 DIF - Handle uninitalized sectors."). Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240528215640.91771-1-linux@treblig.org Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 41b757425203a73ba5aa401cf00feeccc1555f0c Author: John Garry Date: Fri May 24 08:48:29 2024 +0000 scsi: bsg: Pass dev to blk_mq_alloc_queue() When calling bsg_setup_queue() -> blk_mq_alloc_queue(), we don't pass the dev as the queuedata, but rather manually set it afterwards. Just pass dev to blk_mq_alloc_queue() to have automatically set. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20240524084829.2132555-3-john.g.garry@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit e7c09df178f740b74a077bbc16ed0bd872ad0581 Author: John Garry Date: Fri May 24 08:48:28 2024 +0000 scsi: core: Pass sdev to blk_mq_alloc_queue() When calling scsi_alloc_sdev() -> blk_mq_alloc_queue(), we don't pass the sdev as the queuedata, but rather manually set it afterwards. Just pass to blk_mq_alloc_queue() to have automatically set. Signed-off-by: John Garry Link: https://lore.kernel.org/r/20240524084829.2132555-2-john.g.garry@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen