commit cae668130c07f6873718b6f5b415d22e1008f2c9 Author: Yihang Li Date: Tue Oct 8 10:18:22 2024 +0800 scsi: hisi_sas: Add latest_dump for the debugfs dump Before that, after the user triggers the dump, the latest dump information can be viewed in the directory with the maximum number in the dump directory. After this series patch, the driver creates all debugfs directories and files during initialization. Therefore, users cannot know the directory where the latest dump information is stored. So, add latest_dump file to notify users where the latest dump information is stored. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-14-liyihang9@huawei.com Reviewed-by: Xingui Yang Signed-off-by: Martin K. Petersen commit 9f564f15f88490b484e02442dc4c4b11640ea172 Author: Yihang Li Date: Tue Oct 8 10:18:21 2024 +0800 scsi: hisi_sas: Create all dump files during debugfs initialization For the current debugfs of hisi_sas, after user triggers dump, the driver allocate memory space to save the register information and create debugfs files to display the saved information. In this process, the debugfs files created after each dump. Therefore, when the dump is triggered while the driver is unbind, the following hang occurs: [67840.853907] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000a0 [67840.862947] Mem abort info: [67840.865855] ESR = 0x0000000096000004 [67840.869713] EC = 0x25: DABT (current EL), IL = 32 bits [67840.875125] SET = 0, FnV = 0 [67840.878291] EA = 0, S1PTW = 0 [67840.881545] FSC = 0x04: level 0 translation fault [67840.886528] Data abort info: [67840.889524] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [67840.895117] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [67840.900284] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [67840.905709] user pgtable: 4k pages, 48-bit VAs, pgdp=0000002803a1f000 [67840.912263] [00000000000000a0] pgd=0000000000000000, p4d=0000000000000000 [67840.919177] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [67840.996435] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [67841.003628] pc : down_write+0x30/0x98 [67841.007546] lr : start_creating.part.0+0x60/0x198 [67841.012495] sp : ffff8000b979ba20 [67841.016046] x29: ffff8000b979ba20 x28: 0000000000000010 x27: 0000000000024b40 [67841.023412] x26: 0000000000000012 x25: ffff20202b355ae8 x24: ffff20202b35a8c8 [67841.030779] x23: ffffa36877928208 x22: ffffa368b4972240 x21: ffff8000b979bb18 [67841.038147] x20: ffff00281dc1e3c0 x19: fffffffffffffffe x18: 0000000000000020 [67841.045515] x17: 0000000000000000 x16: ffffa368b128a530 x15: ffffffffffffffff [67841.052888] x14: ffff8000b979bc18 x13: ffffffffffffffff x12: ffff8000b979bb18 [67841.060263] x11: 0000000000000000 x10: 0000000000000000 x9 : ffffa368b1289b18 [67841.067640] x8 : 0000000000000012 x7 : 0000000000000000 x6 : 00000000000003a9 [67841.075014] x5 : 0000000000000000 x4 : ffff002818c5cb00 x3 : 0000000000000001 [67841.082388] x2 : 0000000000000000 x1 : ffff002818c5cb00 x0 : 00000000000000a0 [67841.089759] Call trace: [67841.092456] down_write+0x30/0x98 [67841.096017] start_creating.part.0+0x60/0x198 [67841.100613] debugfs_create_dir+0x48/0x1f8 [67841.104950] debugfs_create_files_v3_hw+0x88/0x348 [hisi_sas_v3_hw] [67841.111447] debugfs_snapshot_regs_v3_hw+0x708/0x798 [hisi_sas_v3_hw] [67841.118111] debugfs_trigger_dump_v3_hw_write+0x9c/0x120 [hisi_sas_v3_hw] [67841.125115] full_proxy_write+0x68/0xc8 [67841.129175] vfs_write+0xd8/0x3f0 [67841.132708] ksys_write+0x70/0x108 [67841.136317] __arm64_sys_write+0x24/0x38 [67841.140440] invoke_syscall+0x50/0x128 [67841.144385] el0_svc_common.constprop.0+0xc8/0xf0 [67841.149273] do_el0_svc+0x24/0x38 [67841.152773] el0_svc+0x38/0xd8 [67841.156009] el0t_64_sync_handler+0xc0/0xc8 [67841.160361] el0t_64_sync+0x1a4/0x1a8 [67841.164189] Code: b9000882 d2800002 d2800023 f9800011 (c85ffc05) [67841.170443] ---[ end trace 0000000000000000 ]--- To fix this issue, create all directories and files during debugfs initialization. In this way, the driver only needs to allocate memory space to save information each time the user triggers dumping. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-13-liyihang9@huawei.com Reviewed-by: Xingui Yang Signed-off-by: Martin K. Petersen commit 90f17e3431d9c643558c3c343407ee37783d5e43 Author: Xingui Yang Date: Tue Oct 8 10:18:20 2024 +0800 scsi: hisi_sas: Update v3 hw STP_LINK_TIMER setting At present, it is found that some SATA HDD disks may continue to return the HOLD primitive for more than 500ms when they are busy writing data, which is more likely to trigger an STP link timeout exception. Now Modify STP link timer from 500ms to the maximum value of 1.048575s. Signed-off-by: Xingui Yang Link: https://lore.kernel.org/r/20241008021822.2617339-12-liyihang9@huawei.com Reviewed-by: Yihang Li Signed-off-by: Martin K. Petersen commit 3c62791322e42d1afd65acfdb5b3a371bde21ede Author: Xingui Yang Date: Tue Oct 8 10:18:19 2024 +0800 scsi: hisi_sas: Add time interval between two H2D FIS following soft reset spec Spec says at least 5us between two H2D FIS when do soft reset, but be generous and sleep for about 1ms. Signed-off-by: Xingui Yang Link: https://lore.kernel.org/r/20241008021822.2617339-11-liyihang9@huawei.com Reviewed-by: Yihang Li Signed-off-by: Martin K. Petersen commit 90b24856b311e7e2f4f1629fb315ee50a4914aa5 Author: Xingui Yang Date: Tue Oct 8 10:18:18 2024 +0800 scsi: hisi_sas: Update disk locked timeout to 7 seconds The SATA disk will be locked after the disk sends the DMA Setup frame until all data frame transmission is completed. The CFG_ICT_TIMER_STEP_TRSH register is used for sata disk to configure the step size of the timer which records the time when the disk is locked. The unit is 1us and the default step size is 150ms. If the disk is locked for more than 7 timer steps, the io to be sent to the disk will end abnormally. The current timeout is only about 1 second, it is easy to trigger IO abnormal end when the SATA hard disk returns data slowly. Adjust the timeout to 7 seconds based on ERC time of most disks. Signed-off-by: Xingui Yang Link: https://lore.kernel.org/r/20241008021822.2617339-10-liyihang9@huawei.com Reviewed-by: Xiang Chen Reviewed-by: Yihang Li Signed-off-by: Martin K. Petersen commit a220bffebabe7227b4dbb8f811bc64ecf25e017e Author: Yihang Li Date: Tue Oct 8 10:18:17 2024 +0800 scsi: hisi_sas: Default enable interrupt coalescing In the current interrupt reporting mode, each CQ entry reports an interrupt. However, when there are a large number of I/O hardware completion interrupts, the following issue may occur: [ 4682.678657][ C129] irq 134: nobody cared (try booting with the "irqpoll" option) [ 4682.708455][ C129] Call trace: [ 4682.711589][ C129] dump_backtrace+0x0/0x1e4 [ 4682.715934][ C129] show_stack+0x20/0x2c [ 4682.719933][ C129] dump_stack+0xd8/0x140 [ 4682.724017][ C129] __report_bad_irq+0x54/0x180 [ 4682.728625][ C129] note_interrupt+0x1ec/0x2f0 [ 4682.733143][ C129] handle_irq_event+0x118/0x1ac [ 4682.737834][ C129] handle_fasteoi_irq+0xc8/0x200 [ 4682.742613][ C129] __handle_domain_irq+0x84/0xf0 [ 4682.747391][ C129] gic_handle_irq+0x88/0x2c0 [ 4682.751822][ C129] el1_irq+0xbc/0x140 [ 4682.755648][ C129] _find_next_bit.constprop.0+0x20/0x94 [ 4682.761036][ C129] cpumask_next+0x24/0x30 [ 4682.765208][ C129] gic_ipi_send_mask+0x48/0x170 [ 4682.769900][ C129] __ipi_send_mask+0x34/0x110 [ 4682.775720][ C129] smp_cross_call+0x3c/0xcc [ 4682.780064][ C129] arch_send_call_function_single_ipi+0x38/0x44 [ 4682.786146][ C129] send_call_function_single_ipi+0xd0/0xe0 [ 4682.791794][ C129] generic_exec_single+0xb4/0x170 [ 4682.796659][ C129] smp_call_function_single_async+0x2c/0x40 [ 4682.802395][ C129] blk_mq_complete_request_remote.part.0+0xec/0x100 [ 4682.808822][ C129] blk_mq_complete_request+0x30/0x70 [ 4682.813950][ C129] scsi_mq_done+0x48/0xac [ 4682.818128][ C129] sas_scsi_task_done+0xb0/0x150 [libsas] [ 4682.823692][ C129] slot_complete_v3_hw+0x230/0x710 [hisi_sas_v3_hw] [ 4682.830120][ C129] cq_thread_v3_hw+0xbc/0x190 [hisi_sas_v3_hw] [ 4682.836114][ C129] irq_thread_fn+0x34/0xa4 [ 4682.840371][ C129] irq_thread+0xc4/0x130 [ 4682.844455][ C129] kthread+0x108/0x13c [ 4682.848365][ C129] ret_from_fork+0x10/0x18 [ 4682.852621][ C129] handlers: [ 4682.855577][ C129] [<00000000949e52bf>] cq_interrupt_v3_hw [hisi_sas_v3_hw] threaded [<000000005d8e3b68>] cq_thread_v3_hw [hisi_sas_v3_hw] [ 4682.868084][ C129] Disabling IRQ #134 When the IRQ management layer processes each hardware interrupt, if the return value of the interrupt handler is IRQ_WAKE_THREAD, it will wake up the handler thread for this interrupt action and set IRQTF_RUNTHREAD flag, wait for the interrupt handling thread to clear the IRQTF_RUNTHREAD flag after execution. Later in note_interrupt(), use irq_count to count hardware interrupts and irqs_unhandled to count interrupts for which no thread handler is responsible. When irq_count reaches 100000 and irqs_unhandled reaches 99000, irq will be disabled. In the performance test scenario, I/O completion hardware interrupts are continuously and quickly generated. As a result, the interrupt processing thread is cyclically called in irq_thread() and does not exit, this affects the response of the interrupt thread to the hardware interrupt and causes irqs_unhandled to grow to 99000. Finally, the irq is disabled. Therefore, default enable interrupt coalescing to reduce the generation of hardware interrupts, this helps interrupt processing threads to stop calling in irq_thread(). For interrupt coalescing, according to the actual performance test, set the count of CQ entries to 10 and the interrupt coalescing timeout period to 10us based on the actual performance test. Before and after interrupt coalescing is enabled, the 4K read/write performance is improved by about 3%, and the 256K read/write performance is basically the same. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-9-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 2233c4a0b948211743659b24c13d6bd059fa75fc Author: Yihang Li Date: Tue Oct 8 10:18:16 2024 +0800 scsi: hisi_sas: Add cond_resched() for no forced preemption model For no forced preemption model kernel, in the scenario where the expander is connected to 12 high performance SAS SSDs, the following call trace may occur: [ 214.409199][ C240] watchdog: BUG: soft lockup - CPU#240 stuck for 22s! [irq/149-hisi_sa:3211] [ 214.568533][ C240] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 214.575224][ C240] pc : fput_many+0x8c/0xdc [ 214.579480][ C240] lr : fput+0x1c/0xf0 [ 214.583302][ C240] sp : ffff80002de2b900 [ 214.587298][ C240] x29: ffff80002de2b900 x28: ffff1082aa412000 [ 214.593291][ C240] x27: ffff3062a0348c08 x26: ffff80003a9f6000 [ 214.599284][ C240] x25: ffff1062bbac5c40 x24: 0000000000001000 [ 214.605277][ C240] x23: 000000000000000a x22: 0000000000000001 [ 214.611270][ C240] x21: 0000000000001000 x20: 0000000000000000 [ 214.617262][ C240] x19: ffff3062a41ae580 x18: 0000000000010000 [ 214.623255][ C240] x17: 0000000000000001 x16: ffffdb3a6efe5fc0 [ 214.629248][ C240] x15: ffffffffffffffff x14: 0000000003ffffff [ 214.635241][ C240] x13: 000000000000ffff x12: 000000000000029c [ 214.641234][ C240] x11: 0000000000000006 x10: ffff80003a9f7fd0 [ 214.647226][ C240] x9 : ffffdb3a6f0482fc x8 : 0000000000000001 [ 214.653219][ C240] x7 : 0000000000000002 x6 : 0000000000000080 [ 214.659212][ C240] x5 : ffff55480ee9b000 x4 : fffffde7f94c6554 [ 214.665205][ C240] x3 : 0000000000000002 x2 : 0000000000000020 [ 214.671198][ C240] x1 : 0000000000000021 x0 : ffff3062a41ae5b8 [ 214.677191][ C240] Call trace: [ 214.680320][ C240] fput_many+0x8c/0xdc [ 214.684230][ C240] fput+0x1c/0xf0 [ 214.687707][ C240] aio_complete_rw+0xd8/0x1fc [ 214.692225][ C240] blkdev_bio_end_io+0x98/0x140 [ 214.696917][ C240] bio_endio+0x160/0x1bc [ 214.701001][ C240] blk_update_request+0x1c8/0x3bc [ 214.705867][ C240] scsi_end_request+0x3c/0x1f0 [ 214.710471][ C240] scsi_io_completion+0x7c/0x1a0 [ 214.715249][ C240] scsi_finish_command+0x104/0x140 [ 214.720200][ C240] scsi_softirq_done+0x90/0x180 [ 214.724892][ C240] blk_mq_complete_request+0x5c/0x70 [ 214.730016][ C240] scsi_mq_done+0x48/0xac [ 214.734194][ C240] sas_scsi_task_done+0xbc/0x16c [libsas] [ 214.739758][ C240] slot_complete_v3_hw+0x260/0x760 [hisi_sas_v3_hw] [ 214.746185][ C240] cq_thread_v3_hw+0xbc/0x190 [hisi_sas_v3_hw] [ 214.752179][ C240] irq_thread_fn+0x34/0xa4 [ 214.756435][ C240] irq_thread+0xc4/0x130 [ 214.760520][ C240] kthread+0x108/0x13c [ 214.764430][ C240] ret_from_fork+0x10/0x18 This is because in the hisi_sas driver, both the hardware interrupt handler and the interrupt thread are executed on the same CPU. In the performance test scenario, function irq_wait_for_interrupt() will always return 0 if lots of interrupts occurs and the CPU will be continuously consumed. As a result, the CPU cannot run the watchdog thread. When the watchdog time exceeds the specified time, call trace occurs. To fix it, add cond_resched() to execute the watchdog thread. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-8-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 4ca4ce000610d51c741ad81bffc79434421a0101 Author: Yihang Li Date: Tue Oct 8 10:18:15 2024 +0800 scsi: hisi_sas: Check usage count only when the runtime PM status is RPM_SUSPENDING Users can suspend the machine with 'echo disk > /sys/power/state', but the suspend will fail because the SAS controller cannot be suspended: [root@localhost ~]# echo freeze > /sys/power/state -bash: echo: write error: Device or resource busy [15104.142955] PM: suspend entry (s2idle) ... [15104.283465] hisi_sas_v3_hw 0000:32:04.0: entering suspend state [15104.283480] hisi_sas_v3_hw 0000:30:04.0: entering suspend state [15104.283500] hisi_sas_v3_hw 0000:32:04.0: PM suspend: host status cannot be suspended [15104.283508] hisi_sas_v3_hw 0000:30:04.0: PM suspend: host status cannot be suspended [15104.283516] hisi_sas_v3_hw 0000:32:04.0: PM: pci_pm_suspend(): suspend_v3_hw+0x0/0x210 [hisi_sas_v3_hw] returns -16 [15104.283527] hisi_sas_v3_hw 0000:32:04.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x1c0 returns -16 [15104.283524] hisi_sas_v3_hw 0000:30:04.0: PM: pci_pm_suspend(): suspend_v3_hw+0x0/0x210 [hisi_sas_v3_hw] returns -16 [15104.283533] hisi_sas_v3_hw 0000:32:04.0: PM: failed to suspend async: error -16 [15104.283536] hisi_sas_v3_hw 0000:30:04.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x1c0 returns -16 [15104.283542] hisi_sas_v3_hw 0000:30:04.0: PM: failed to suspend async: error -16 The problem is that when the ->runtime_suspend() callback suspend_v3_hw() is executing, the current runtime PM status is RPM_ACTIVE and the usage count of the controller is not 0, so return immediately. To fix it, Check the device usage count only when the runtime PM status is RPM_SUSPENDING. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-7-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 64359afb7068e9fd1b3ffcf7b0fefb63d1a2ccdf Author: Yihang Li Date: Tue Oct 8 10:18:14 2024 +0800 scsi: hisi_sas: Reset PHY again if phyup timeout In commit 89954f024c3a ("scsi: hisi_sas: Ensure all enabled PHYs up during controller reset"), we enable PHYs in parallel through async operations and wait for PHYs come up. However, for some directly attached SATA disks, the PHY not come up after a timeout period and the hardware is not ready. At this time, we should get the latest PHY hardware state, if the new PHY state is not ready but the old PHY state is ready, call work HISI_PHYE_LINK_RESET to give it another chance to phyup. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-6-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 08a07dc71d7fc6f58c35c4fc0bcede2811c5aa4c Author: Yihang Li Date: Tue Oct 8 10:18:13 2024 +0800 scsi: hisi_sas: Enable all PHYs that are not disabled by user during controller reset For the controller reset operation(such as FLR or clear nexus ha in SCSI EH), we will disable all PHYs and then enable PHY based on the hisi_hba->phy_state obtained in hisi_sas_controller_reset_prepare(). If the device is removed before controller reset or the PHY is not attached to any device in directly attached scenario, the corresponding bit of phy_state is not set. After controller reset done, the PHY is disabled. The device cannot be identified even if user reconnect the disk. Therefore, for PHYs that are not disabled by user, hisi_sas_phy_enable() needs to be executed even if the corresponding bit of phy_state is not set. Fixes: 89954f024c3a ("scsi: hisi_sas: Ensure all enabled PHYs up during controller reset") Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-5-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 2c335fa7e69c06d8932ae8bc0ec7145de2973cf5 Author: Yihang Li Date: Tue Oct 8 10:18:12 2024 +0800 scsi: hisi_sas: Add firmware information check For security purposes, after information is obtained through the FW, check information to ensure data correctness. - In v1 and v2 hw, the maximum number of PHYs is 9, while in v3 it is 8. - In v2 and v3 hw, the maximum number of hardware queues is 16, while in v1 it is 32. Also add some debug logs for failure. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-4-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 436a97c5d2882c09f44d3255ac47f641860faeea Author: Yihang Li Date: Tue Oct 8 10:18:11 2024 +0800 scsi: hisi_sas: Create trigger_dump at the end of the debugfs initialization In the current debugfs initialization process, the interface trigger_dump is created first, and then the dump directory is created to store the register dump information. The issue is that after the trigger_dump interface is created, users can access the interface to trigger dump and call debugfs_create_files_v3_hw(). In debugfs_create_files_v3_hw(), if .debugfs_dump_dentry is NULL, the file for storing dump information is created under /sys/kernel/debug, and the memory and information cannot be released after the driver is uninstalled. Therefore, the creation of the trigger_dump interface is placed at the end of debugfs initialization. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-3-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit e6702e3919328b24757872cbf7f02c51894624d7 Author: Yihang Li Date: Tue Oct 8 10:18:10 2024 +0800 scsi: hisi_sas: Adjust priority of registering and exiting debugfs for security To be safe, we should register debugfs at the last stage of driver initialization and then unregister debugfs at the first stage of driver uninstallation. Signed-off-by: Yihang Li Link: https://lore.kernel.org/r/20241008021822.2617339-2-liyihang9@huawei.com Reviewed-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 8d7cfe95217cae5ce8e0f6e35eef43a11dd33c48 Author: Dr. David Alan Gilbert Date: Sun Sep 15 13:56:33 2024 +0100 scsi: bfa: Remove unused misc code Some more unused functions that didn't group elsewhere. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240915125633.25036-6-linux@treblig.org Signed-off-by: Martin K. Petersen commit 372dcc01616e41e06016044c330caed7117689cf Author: Dr. David Alan Gilbert Date: Sun Sep 15 13:56:32 2024 +0100 scsi: bfa: Remove unused bfa_fcs code These functions aren't called anywhere, remove them. Build tested only. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240915125633.25036-5-linux@treblig.org Signed-off-by: Martin K. Petersen commit b74448006a67debcd5299c9ab16b2e8ca748bee6 Author: Dr. David Alan Gilbert Date: Sun Sep 15 13:56:31 2024 +0100 scsi: bfa: Remove unused bfa_ioc code These functions aren't called anywhere, remove them. Build tested only. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240915125633.25036-4-linux@treblig.org Signed-off-by: Martin K. Petersen commit 0604cf11cd56179fa86baeb030d8862489d341e1 Author: Dr. David Alan Gilbert Date: Sun Sep 15 13:56:30 2024 +0100 scsi: bfa: Remove unused bfa_svc code These functions aren't called anywhere, remove them. Build tested only. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240915125633.25036-3-linux@treblig.org Signed-off-by: Martin K. Petersen commit f3845d7d7145e325cf6512d2b7e805acd08ea291 Author: Dr. David Alan Gilbert Date: Sun Sep 15 13:56:29 2024 +0100 scsi: bfa: Remove unused bfa_core code bfa_get_pciids and bfa_cfg_get_min aren't called anywhere; remove them together with the bfa_pciid_s used by bfa_get_pciids. (Build tested, I don't have the card) Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240915125633.25036-2-linux@treblig.org Signed-off-by: Martin K. Petersen commit 94c4c5d78b0f7537354b2f1c0fd6e9dc18fe0699 Author: Manish Pandey Date: Tue Sep 3 18:45:46 2024 +0530 scsi: ufs: ufs-qcom: Add fixup_dev_quirks vops Add fixup_dev_quirk vops in QCOM UFS platforms and provide an initial vendor-specific device quirk table to add UFS device specific quirks which are enabled only for specified UFS devices. - Add DELAY_BEFORE_LPM quirk for Skhynix UFS devices to introduce a delay before VCC is powered off in QCOM platforms. - Add DELAY_AFTER_LPM quirk for Toshiba UFS devices to introduce a delay after the VCC power rail is turned off in QCOM platforms. - Move UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE quirk from ufs_qcom_apply_dev_quirks to ufs_qcom_dev_fixups. Signed-off-by: Manish Pandey Link: https://lore.kernel.org/r/20240903131546.1141-1-quic_mapa@quicinc.com Reviewed-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit 43abe48d95fee8816f79e085ea9c86e4f65607e7 Author: Avri Altman Date: Sat Sep 21 09:23:06 2024 +0300 scsi: ufs: core: Zero utp_upiu_req at the beginning of each command This patch introduces a previously missing step: zeroing the 'utp_upiu_req' structure at the beginning of each upiu transaction. This ensures that the upiu request fields are properly initialized, preventing potential issues caused by residual data from previous commands. While at it, re-use some of the common initializations for query and command upiu. Reviewed-by: Bart Van Assche Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20240921062306.56019-1-avri.altman@wdc.com Signed-off-by: Martin K. Petersen commit 71ef4e6b05ae0a1b6bd8ba864815b01e041dfd10 Author: Avri Altman Date: Thu Sep 19 14:24:42 2024 +0300 scsi: ufs: core: Do not open code read_poll_timeout ufshcd_wait_for_register() practically does just that - replace with read_poll_timeout. Signed-off-by: Avri Altman Link: https://lore.kernel.org/r/20240919112442.48491-1-avri.altman@wdc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 09822c231ae69e4ebc686ebe8b8cad02bcafea54 Author: Bart Van Assche Date: Mon Sep 30 13:13:47 2024 -0700 scsi: mptfusion: Remove #ifndef __GENKSYMS__ / #endif Except for preventing build errors, there shouldn't be any conditionals in kernel drivers on __GENKSYMS__. Hence remove an #ifndef __GENKSYMS__ / #endif pair from the MPT Fusion driver. Cc: Sathya Prakash Cc: Sreekanth Reddy Cc: Suganath Prabu Subramani Cc: MPT-FusionLinux.pdl@broadcom.com Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240930201347.1837690-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 0b1e535598d576e0727b2028a4e4e69f3e46596a Author: Dr. David Alan Gilbert Date: Fri Sep 13 18:01:16 2024 +0100 scsi: aic7xxx: Remove unused aic7770_find_device() 'aic7770_find_device()' has been unused since 2005's commit dedd83108105 ("[SCSI] aic7xxx: remove Linux 2.4 ifdefs") Remove it and the associated constant. (Whether anyone still has one of these cards in use is another question, I've just build tested this). Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240913170116.250996-1-linux@treblig.org Signed-off-by: Martin K. Petersen commit 5a66581a1af50b45bd4ced096201dfaac4d1ca83 Author: Dr. David Alan Gilbert Date: Fri Sep 20 21:23:04 2024 +0100 scsi: aacraid: Remove unused aac_check_health() aac_check_health() has been unused since commit 9473ddb2b037 ("scsi: aacraid: Use correct function to get ctrl health") Remove it. Signed-off-by: Dr. David Alan Gilbert Link: https://lore.kernel.org/r/20240920202304.333108-1-linux@treblig.org Signed-off-by: Martin K. Petersen commit aa948b39ddc703ca6a0d0e1b1ab593767d67363c Author: Liu Jing Date: Sat Sep 21 18:45:37 2024 +0800 scsi: bfa: Fix cacography in bfi.h file Signed-off-by: Liu Jing Link: https://lore.kernel.org/r/20240921104537.14843-1-liujing@cmss.chinamobile.com Signed-off-by: Martin K. Petersen commit ab19e3154cc12fdf6c39b6e0a2ed518e45d9f876 Author: Liao Chen Date: Sat Sep 21 06:29:56 2024 +0000 scsi: qedf: Remove dead code If container_of() is used correctly, its result is never NULL. Remove the code that depends on container_of() returning a NULL pointer. Signed-off-by: Liao Chen Link: https://lore.kernel.org/r/20240921062956.2027563-1-liaochen4@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b1e8c53749adb795bfb0bf4e2f7836e26684bb90 Author: Bart Van Assche Date: Thu Sep 12 15:30:05 2024 -0700 scsi: ufs: core: Always initialize the UIC done completion Simplify __ufshcd_send_uic_cmd() by always initializing the uic_cmd::done completion. This is fine since the time required to initialize a completion is small compared to the time required to process an UIC command. Reviewed-by: Peter Wang Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240912223019.3510966-5-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit fcd8b0450a9acbf3f0e88d749a72ef932df97663 Author: Bart Van Assche Date: Thu Sep 12 15:30:04 2024 -0700 scsi: ufs: core: Make ufshcd_uic_cmd_compl() easier to analyze In ufshcd_uic_cmd_compl(), there is code that dereferences 'cmd' with and without checking the 'cmd' pointer. This confuses static source code analyzers like Coverity and sparse. Since none of the code in ufshcd_uic_cmd_compl() can do anything useful if 'cmd' is NULL, move the 'cmd' test near the start of this function. Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240912223019.3510966-4-bvanassche@acm.org Reviewed-by: Peter Wang Reviewed-by: Bao D. Nguyen Signed-off-by: Martin K. Petersen commit e31931d646d3bc2223d9a275bac9cdc4963c5bc1 Author: Bart Van Assche Date: Thu Sep 12 15:30:03 2024 -0700 scsi: ufs: core: Make ufshcd_uic_cmd_compl() easier to read Introduce a local variable for the expression hba->active_uic_cmd. Remove superfluous parentheses. No functionality has been changed. Reviewed-by: Bean Huo Reviewed-by: Peter Wang Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240912223019.3510966-3-bvanassche@acm.org Reviewed-by: Bao D. Nguyen Signed-off-by: Martin K. Petersen commit 22fbabe82cea7af4127f089b7f3553cd75571d9a Author: Bart Van Assche Date: Thu Sep 12 15:30:02 2024 -0700 scsi: ufs: core: Improve the struct ufs_hba documentation Make the role of the structure members related to UIC command processing more clear. Reviewed-by: Peter Wang Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20240912223019.3510966-2-bvanassche@acm.org Reviewed-by: Bao D. Nguyen Signed-off-by: Martin K. Petersen commit c602a04b27ec80ada4b288967a09f213d5e05722 Author: Xin Liu Date: Wed Sep 11 15:06:36 2024 +0800 scsi: ufs: ufs: qcom: dt-bindings: Document the QCS8300 UFS Controller Document the Universal Flash Storage(UFS) Controller on the Qualcomm QCS8300 Platform. Signed-off-by: Xin Liu Signed-off-by: Jingyi Wang Link: https://lore.kernel.org/r/20240911-qcs8300_ufs_binding-v2-1-68bb66d48730@quicinc.com Reviewed-by: Krzysztof Kozlowski Acked-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen