summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge patch series "Returning FIS on success for CDL"Martin K. Petersen2023-08-256-18/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Igor Pylypiv <ipylypiv@google.com> says: This patch series plumbs libata's request for a result taskfile (ATA_QCFLAG_RESULT_TF) through libsas to pm80xx LLDD. Other libsas LLDDs can start using the newly added return_fis_on_success as well, if needed. For Command Duration Limits policy 0xD (command completes without an error) libata needs FIS in order to detect the ATA_SENSE bit and read the Sense Data for Successful NCQ Commands log (0Fh). pm80xx HBAs do not return FIS on success by default, hence, the driver is updated to set the RETFIS bit (Return FIS on good completion) when requested by libsas. Link: https://lore.kernel.org/r/20230819213040.1101044-1-ipylypiv@google.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: pm80xx: Set RETFIS when requested by libsasIgor Pylypiv2023-08-214-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | By default PM80xx HBAs return FIS only when a drive reports an error. The RETFIS bit forces the controller to populate FIS even when a drive reports no error. Signed-off-by: Igor Pylypiv <ipylypiv@google.com> Link: https://lore.kernel.org/r/20230819213040.1101044-3-ipylypiv@google.com Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * scsi: libsas: Add return_fis_on_success to sas_ata_taskIgor Pylypiv2023-08-212-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Set return_fis_on_success when libata requests result taskfile. For Command Duration Limits policy 0xD (command completes without an error) libata needs FIS in order to detect the ATA_SENSE bit and read the Sense Data for Successful NCQ Commands log (0Fh). Signed-off-by: Igor Pylypiv <ipylypiv@google.com> Link: https://lore.kernel.org/r/20230819213040.1101044-2-ipylypiv@google.com Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: target: Fix write perf due to unneeded throttlingMike Christie2023-08-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The write back throttling (WBT) code checks if REQ_SYNC | REQ_IDLE is set to determine if a write is O_DIRECT vs buffered. If the bits are not set then it assumes it's a buffered write and will throttle LIO if we hit certain metrics. LIO itself is not using the buffer cache and is doing direct I/O, so this has us set the direct bits so we are not throttled. When the initiator application is doing direct I/O this can greatly improve performance. It depends on the backend device but we have seen where the WBT code is throttling writes to only 20K IOPs with 4K I/Os when the device can support 100K+. Signed-off-by: Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230817192902.346791-1-michael.christie@oracle.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: lpfc: Do not abuse UUID APIs and LPFC_COMPRESS_VMID_SIZEAndy Shevchenko2023-08-212-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The lpfc_vmid_host_uuid is not defined as uuid_t and its usage is not the same as for uuid_t operations (like exporting or importing). Hence replace call to uuid_is_null() by respective memchr_inv() without abusing casting. With that, replace LPFC_COMPRESS_VMID_SIZE with plain number and respective sizeof() to make code robust to changes in the future, if any. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230818155452.875781-1-andriy.shevchenko@linux.intel.com Reviewed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: pm8001: Remove unused declarationsYue Haibing2023-08-211-2/+0
| | | | | | | | | | | | | | | | | | | | | | Commit 4fcf812ca392 ("[SCSI] libsas: export sas_alloc_task()") removed these implementations but not the declarations. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20230818124700.49724-1-yuehaibing@huawei.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: fcoe: Fix potential deadlock on &fip->ctlr_lockChengfeng Ye2023-08-211-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a long call chain that &fip->ctlr_lock is acquired by isr fnic_isr_msix_wq_copy() under hard IRQ context. Thus other process context code acquiring the lock should disable IRQ, otherwise deadlock could happen if the IRQ preempts the execution while the lock is held in process context on the same CPU. [ISR] fnic_isr_msix_wq_copy() -> fnic_wq_copy_cmpl_handler() -> fnic_fcpio_cmpl_handler() -> fnic_fcpio_flogi_reg_cmpl_handler() -> fnic_flush_tx() -> fnic_send_frame() -> fcoe_ctlr_els_send() -> spin_lock_bh(&fip->ctlr_lock) [Process Context] 1. fcoe_ctlr_timer_work() -> fcoe_ctlr_flogi_send() -> spin_lock_bh(&fip->ctlr_lock) 2. fcoe_ctlr_recv_work() -> fcoe_ctlr_recv_handler() -> fcoe_ctlr_recv_els() -> fcoe_ctlr_announce() -> spin_lock_bh(&fip->ctlr_lock) 3. fcoe_ctlr_recv_work() -> fcoe_ctlr_recv_handler() -> fcoe_ctlr_recv_els() -> fcoe_ctlr_flogi_retry() -> spin_lock_bh(&fip->ctlr_lock) 4. -> fcoe_xmit() -> fcoe_ctlr_els_send() -> spin_lock_bh(&fip->ctlr_lock) spin_lock_bh() is not enough since fnic_isr_msix_wq_copy() is a hardirq. These flaws were found by an experimental static analysis tool I am developing for irq-related deadlock. The patch fix the potential deadlocks by spin_lock_irqsave() to disable hard irq. Fixes: 794d98e77f59 ("[SCSI] libfcoe: retry rejected FLOGI to another FCF if possible") Signed-off-by: Chengfeng Ye <dg573847474@gmail.com> Link: https://lore.kernel.org/r/20230817074708.7509-1-dg573847474@gmail.com Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: elx: sli4: Remove code duplicationRajeshwar R Shinde2023-08-211-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the function sli_xmit_bls_rsp64_wqe(), the 'if' and 'else' conditions evaluates the same expression and give the same output. Also, params->s_id shall not be equal to U32_MAX. Remove the unused code. This fixes coccinelle warning such as: drivers/scsi/elx/libefc_sli/sli4.c:2320:2-4: WARNING: possible condition with no effect (if == else) Signed-off-by: Rajeshwar R Shinde <coolrrsh@gmail.com> Link: https://lore.kernel.org/r/20230817114301.17601-1-coolrrsh@gmail.com Reviewed-by: Ram Vegesna <ram.vegesna@broadcom.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: bfa: Replace one-element array with flexible-array member in struct ↵Gustavo A. R. Silva2023-08-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fc_rscn_pl_s One-element and zero-length arrays are deprecated. So, replace one-element array in struct fc_rscn_pl_s with flexible-array member. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/339 Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org> Link: https://lore.kernel.org/r/ZN0VTpDBOSVHGayb@work Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qla2xxx: Remove unused declarationsYue Haibing2023-08-211-10/+0
| | | | | | | | | | | | | | | | These declarations are not used anymore, remove them. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20230816130842.16684-1-yuehaibing@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: pmcraid: Use pci_dev_id() to simplify the codeZheng Zengkai2023-08-211-2/+1
| | | | | | | | | | | | | | | | | | | | PCI core API pci_dev_id() can be used to get the BDF number for a PCI device. We don't need to compose it manually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> Link: https://lore.kernel.org/r/20230811111310.32364-1-zhengzengkai@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: megaraid: Use pci_dev_id() to simplify the codeJialin Zhang2023-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | PCI core API pci_dev_id() can be used to get the BDF number for a PCI device. We don't need to compose it manually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> Link: https://lore.kernel.org/r/20230815025419.3523236-4-zhangjialin11@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: megaraid_sas: Use pci_dev_id() to simplify the codeJialin Zhang2023-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | PCI core API pci_dev_id() can be used to get the BDF number for a PCI device. We don't need to compose it manually. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> Link: https://lore.kernel.org/r/20230815025419.3523236-3-zhangjialin11@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: mvumi: Use pci_dev_id() to simplify the codeJialin Zhang2023-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | PCI core API pci_dev_id() can be used to get the BDF number for a PCI device. We don't need to compose it mannally. Use pci_dev_id() to simplify the code a little bit. Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> Link: https://lore.kernel.org/r/20230815025419.3523236-2-zhangjialin11@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ufs: host: Convert to dev_err_probe() in ufshcd_pltfrm_init()Brian Masney2023-08-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert ufshcd_pltfrm_init() over to use dev_err_probe() to avoid the following log message on bootup due to an -EPROBE_DEFER return code: ufshcd-qcom 1d84000.ufs: Initialization failed While this line is changed, let's also go ahead and add the error code to the message as well. Signed-off-by: Brian Masney <bmasney@redhat.com> Link: https://lore.kernel.org/r/20230814184352.200531-3-bmasney@redhat.com Reviewed-by: "Bao D. Nguyen" <quic_nguyenb@quicinc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ufs: core: Convert to dev_err_probe() in ufshcd_variant_hba_init()Brian Masney2023-08-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert ufshcd_variant_hba_init() over to use dev_err_probe() to avoid log messages like the following on bootup: ufshcd-qcom 1d84000.ufs: ufshcd_variant_hba_init: variant qcom init failed err -517 Signed-off-by: Brian Masney <bmasney@redhat.com> Link: https://lore.kernel.org/r/20230814184352.200531-2-bmasney@redhat.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: core: Use 32-bit hostnum in scsi_host_lookup()Tony Battersby2023-08-212-3/+3
| | | | | | | | | | | | | | | | | | | | | | Change scsi_host_lookup() hostnum argument type from unsigned short to unsigned int to match the type used everywhere else. Fixes: 6d49f63b415c ("[SCSI] Make host_no an unsigned int") Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Link: https://lore.kernel.org/r/a02497e7-c12b-ef15-47fc-3f0a0b00ffce@cybernetics.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: isci: Return result of sas_register_ha()Artem Chernyshev2023-08-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | To properly manage possible failure of sas_register_ha() in isci_register_sas_ha(), return its result instead of zero Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Link: https://lore.kernel.org/r/20230813202336.240874-1-artem.chernyshev@red-soft.ru Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: gvp11: Remove unused gvp11_setup() functionArnd Bergmann2023-08-211-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This function has no declaration, which causes a warning: drivers/scsi/gvp11.c:53:6: error: no previous prototype for 'gvp11_setup' [-Werror=missing-prototypes] Since there is also no caller, just remove the function. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230810141947.1236730-12-arnd@kernel.org Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> # RISC-V Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: qlogicpti: Mark qlogicpti_info() staticArnd Bergmann2023-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The qlogicpti_info() function is only used in this file and should be static to avoid a warning: drivers/scsi/qlogicpti.c:846:13: error: no previous prototype for 'qlogicpti_info' [-Werror=missing-prototypes] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230810141947.1236730-8-arnd@kernel.org Reviewed-by: Jack Wang <jinpu.wang@ionos.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com> # RISC-V Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ppa: Add a module parameter for the transfer modeAlex Henrie2023-08-213-45/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have an Iomega Z100P2 zip drive, but it does not work with my StarTech PEX1P2 AX99100 PCIe parallel port, which evidently does not support 16-bit or 32-bit EPP. Currently the only way to tell the PPA driver to use 8-bit EPP is to write 'mode=3' to /proc/scsi/ppa/*, but the driver doesn't actually distinguish between the three EPP modes and still tries to use 16-bit or 32-bit EPP. And even if writing to that file did make the driver use 8-bit EPP, it still wouldn't do me any good because by the time that file exists, the drive has already failed to initialize. Add a new parameter /sys/module/ppa/mode to set the transfer mode before initializing the drive. This parameter replaces the use of CONFIG_SCSI_IZIP_EPP16 in the PPA driver. At the same time, default to 8-bit EPP. 16-bit and 32-bit EPP are not necessary for the drive to function, nor are they part of the IEEE 1284 standard, so the driver should not assume that they are available. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Link: https://lore.kernel.org/r/20230807155856.362864-2-alexhenrie24@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ppa: Fix compilation with PPA_DEBUG=1Alex Henrie2023-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | Fix a regression introduced in February 2003 in Linux 2.5.61 by a patch from Alan Cox titled "fix ppa for new scsi".[1] Link: https://lore.kernel.org/lkml/E18jn1B-0005gQ-00@the-village.bc.nu/ Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Link: https://lore.kernel.org/r/20230807155856.362864-1-alexhenrie24@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: arcmsr: Add __init and __exit for arcmsr_module_{init,exit}()Xiang Yang2023-08-211-2/+2
| | | | | | | | | | | | | | | | Add __init and __exit for arcmsr_module_{init,exit}(). Signed-off-by: Xiang Yang <xiangyang3@huawei.com> Link: https://lore.kernel.org/r/20230804022913.1917023-1-xiangyang3@huawei.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: core: Remove unused extern declarationsYue Haibing2023-08-211-2/+0
| | | | | | | | | | | | | | | | | | | | These functions have never been implemented since the beginning of git history. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20230809142107.42756-1-yuehaibing@huawei.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: libsas: Remove unused declarationsYue Haibing2023-08-212-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 042ebd293b86 ("scsi: libsas: kill useless ha_event and do some cleanup") removed sas_hae_reset() but not its declaration. Commit 2908d778ab3e ("[SCSI] aic94xx: new driver") declared but never implemented other functions. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20230809132249.37948-1-yuehaibing@huawei.com Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ufs: ufs-pci: Add support for QEMUJeuk Kim2023-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To ensure that the PCI based QEMU UFS device properly works with Linux, register the device ID (0x0013) and vendor ID (0x1b36) of QEMU UFS device. QEMU UFS will enable testing of the UFS driver inside a virtual machine on systems without UFS host controller. It can also be used to preemptively implement and test new features before the real device is created. The new QEMU UFS device can be found at: https://lore.kernel.org/qemu-devel/20230727155239.GA979354@fedora Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com> Link: https://lore.kernel.org/r/20230807013726epcms2p1c604cb8e98680aebebb7cc5ab2d580f5@epcms2p1 Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | Merge patch series "mpi3mr: Few Enhancements and minor fixes"Martin K. Petersen2023-08-086-43/+177
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Ranjan Kumar <ranjan.kumar@broadcom.com> says: Few Enhancements and minor fixes of mpi3mr driver. Link: https://lore.kernel.org/r/20230804104248.118924-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: mpi3mr: Update driver version to 8.5.0.0.0Ranjan Kumar2023-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Update driver version to 8.5.0.0.0 Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20230804104248.118924-7-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: mpi3mr: Enhance handling of devices removed after controller resetRanjan Kumar2023-08-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark all of the devices that are exposed to the OS prior to a controller reset and not detected by the controller after the reset as removed devices and the I/Os to those devices are unblocked (and returned with DID_NO_CONNECT) prior to removing the devices one after the other. Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20230804104248.118924-6-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: mpi3mr: WRITE SAME implementationRanjan Kumar2023-08-082-24/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance driver to divert the WRITE SAME commands that are issued with UNMAP=1 and NDOB=1 and with the transfer length greater than the max WRITE SAME length specified by the firmware for the particular drive to the controller firmware. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202307280034.DXU5pTVV-lkp@intel.com/ Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20230804104248.118924-5-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: mpi3mr: Add support for more than 1MB I/ORanjan Kumar2023-08-083-11/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance the driver to get the maximum data length per I/O request from IOC Facts data and report that to the upper layers. If the IOC facts data is not reported then a default I/O size of 1MB is reported to the OS. Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20230804104248.118924-4-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: mpi3mr: Update MPI Headers to version 3.00.28Ranjan Kumar2023-08-083-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Updated MPI Headers to version 3.00.28. Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20230804104248.118924-3-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: mpi3mr: Invoke soft reset upon TSU or event ack time outRanjan Kumar2023-08-081-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a timestamp update or an event acknowledgment command times out, the driver invokes the soft reset handler to recover the controller while holding a mutex lock. The soft reset handler also tries to acquire the same mutex to send initialization commands to the controller which leads to a deadlock scenario. To resolve the issue the driver will check thestatus and if this indicates the controller is operational, the driver will issue a diagnostic fault reset and exit out of the command processing function. If the controller is already faulted or asynchronously reset, then the driver will just exit the command processing function. Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20230804104248.118924-2-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: lpfc: Modify when a node should be put in device recovery mode during RSCNJustin Tee2023-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Only nodes whose state is at least past a PLOGI issue and strictly less than a PRLI issue should be put into device recovery mode upon RSCN receipt. Previously, the allowance of LOGO and PRLI completion states did not make sense because those nodes should be allowed to flow through and marked as NPort dissappeared as is normally done. A follow up RSCN GID_FT would recover those nodes in such cases. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20230804195546.157839-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ufs: qcom: Make struct ufs_qcom_bw_table static constManivannan Sadhasivam2023-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ufs_qcom_bw_table is not modified anywhere. So make it static const so that it can be placed in read-only memory. Reported-by: Bart Van Assche <bvanassche@acm.org> Closes: https://lore.kernel.org/linux-scsi/43cd0057-c6d8-bc92-08f4-d767336d2cfe@acm.org/ Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/20230802040154.10652-1-manivannan.sadhasivam@linaro.org Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ufs: core: Fix the build for gcc 9 and beforeBart Van Assche2023-08-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc compilers before version 10 cannot do constant-folding for sub-byte bitfields. This makes the compiler layout tests fail. Hence skip the layout checks for gcc 9 and before. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Naresh Kamboju <naresh.kamboju@linaro.org> Cc: Nathan Chancellor <nathan@kernel.org> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Closes: https://lore.kernel.org/linux-scsi/CA+G9fYur8UJoUyTLJFVEJPh-15TJ7kbdD2q8xVz8a3fLjkxxVw@mail.gmail.com/ Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230801232204.1481902-1-bvanassche@acm.org Tested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ufs: ufs-qcom: Check host controller stateNitin Rawat2023-08-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 52a518019ca1 ("scsi: ufs: core: Fix missing clk change notification on host reset") added UFS clock scaling notification to ufshcd_host_reset_and_restore(). This invokes hibern8 enter and exit on Qualcomm platform which fails because controller is in reset state. Fix this by checking the Host controller state before sending hibern8 command. __ufshcd_wl_resume() ufshcd_reset_and_restore() ufshcd_host_reset_and_restore() ufshcd_scale_clks() ufshcd_vops_clk_scale_notify() ufs_qcom_clk_scale_notify() ufshcd_uic_hibern8_enter() Fixes: 52a518019ca1 ("scsi: ufs: core: Fix missing clk change notification on host reset") Co-developed-by: Manish Pandey <quic_mapa@quicinc.com> Signed-off-by: Manish Pandey <quic_mapa@quicinc.com> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com> Link: https://lore.kernel.org/r/20230726134140.7180-3-quic_nitirawa@quicinc.com Acked-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | scsi: ufs: core: Export ufshcd_is_hba_active()Nitin Rawat2023-08-082-1/+3
| | | | | | | | | | | | | | | | | | | | Export ufshcd_is_hba_active() to allow driver modules to check the state of the host controller. Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com> Link: https://lore.kernel.org/r/20230726134140.7180-2-quic_nitirawa@quicinc.com Acked-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* | Merge patch series "Multiple cleanup patches for the UFS driver"Martin K. Petersen2023-07-3118-398/+460
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bart Van Assche <bvanassche@acm.org> says: Hi Martin, This patch includes the following changes, none of which should change the functionality of the UFS host controller driver: - Improve the kernel-doc headers further. - Fix multiple W=2 compiler warnings. - Simplify ufshcd_abort_all(). - Simplify the code for creating and parsing UFS Transport Protocol (UTP) headers. Please consider this patch series for the next merge window. Thanks, Bart. Link: https://lore.kernel.org/r/20230727194457.3152309-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Simplify response header parsingBart Van Assche2023-07-313-108/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the code that parses UTP transfer request headers easier to read by using u8 instead of __be32 where appropriate. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-13-bvanassche@acm.org Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Simplify transfer request header initializationBart Van Assche2023-07-315-58/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the code that initializes UTP transfer request headers easier to read by using bitfields instead of __le32 where appropriate. Cc: "Bao D. Nguyen" <quic_nguyenb@quicinc.com> Cc: Eric Biggers <ebiggers@google.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Bean Huo <beanhuo@micron.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-12-bvanassche@acm.org Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Remove a member variableBart Van Assche2023-07-313-25/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the 'response' member variable because no code reads its value. Additionally, move the ufs_query_req and ufs_query_res data structure definitions into include/ufs/ufshcd.h because these data structures are related to the UFS host controller driver. Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-11-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Simplify ufshcd_abort_all()Bart Van Assche2023-07-311-26/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the MCQ and legacy code paths. This patch reworks code introduced by commit ab248643d3d6 ("scsi: ufs: core: Add error handling for MCQ mode"). Cc: "Bao D. Nguyen" <quic_nguyenb@quicinc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-10-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Remove a local variable from ufshcd_abort_all()Bart Van Assche2023-07-311-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | No functionality is changed. This patch prepares for unifying the MCQ and legacy code paths in this function. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-9-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Improve type safetyBart Van Assche2023-07-314-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Assign names to the enumeration types for UPIU types. Use these enumeration types where appropriate. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-8-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Simplify zero-initializationBart Van Assche2023-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use { } instead of { { 0 }, } to zero-initialize data structures on the stack. This patch fixes two W=2 warnings. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-7-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Minimize #include directivesBart Van Assche2023-07-313-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only #include those header files that are needed. Note: include/ufs/ufshcd.h needs <scsi/scsi_host.h> because of SG_ALL. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-6-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Rename a function argumentBart Van Assche2023-07-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch suppresses the following W=2 warning: drivers/ufs/core/ufs-hwmon.c:130:49: warning: declaration of ‘_data’ shadows a global declaration [-Wshadow] Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-5-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Fix kernel-doc headersBart Van Assche2023-07-313-33/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the remaining kernel-doc warnings that are reported when building with W=2. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-4-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| * | scsi: ufs: Document all return valuesBart Van Assche2023-07-314-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes multiple W=2 kernel-doc warnings. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230727194457.3152309-3-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>