Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch '5.20/scsi-queue' into 6.0/scsi-fixes

Include commits that weren't submitted during the 6.0 merge window.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+32 -41
+2 -6
drivers/scsi/megaraid/megaraid_sas_base.c
··· 7153 7153 switch (instance->adapter_type) { 7154 7154 case MFI_SERIES: 7155 7155 if (megasas_alloc_mfi_ctrl_mem(instance)) 7156 - goto fail; 7156 + return -ENOMEM; 7157 7157 break; 7158 7158 case AERO_SERIES: 7159 7159 case VENTURA_SERIES: 7160 7160 case THUNDERBOLT_SERIES: 7161 7161 case INVADER_SERIES: 7162 7162 if (megasas_alloc_fusion_context(instance)) 7163 - goto fail; 7163 + return -ENOMEM; 7164 7164 break; 7165 7165 } 7166 7166 7167 7167 return 0; 7168 - fail: 7169 - kfree(instance->reply_map); 7170 - instance->reply_map = NULL; 7171 - return -ENOMEM; 7172 7168 } 7173 7169 7174 7170 /*
-1
drivers/scsi/megaraid/megaraid_sas_fusion.c
··· 5310 5310 if (!fusion->log_to_span) { 5311 5311 dev_err(&instance->pdev->dev, "Failed from %s %d\n", 5312 5312 __func__, __LINE__); 5313 - kfree(instance->ctrl_context); 5314 5313 return -ENOMEM; 5315 5314 } 5316 5315 }
+2 -8
drivers/scsi/qla2xxx/qla_target.c
··· 6935 6935 6936 6936 if (ha->flags.msix_enabled) { 6937 6937 if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) { 6938 - if (IS_QLA2071(ha)) { 6939 - /* 4 ports Baker: Enable Interrupt Handshake */ 6940 - icb->msix_atio = 0; 6941 - icb->firmware_options_2 |= cpu_to_le32(BIT_26); 6942 - } else { 6943 - icb->msix_atio = cpu_to_le16(msix->entry); 6944 - icb->firmware_options_2 &= cpu_to_le32(~BIT_26); 6945 - } 6938 + icb->msix_atio = cpu_to_le16(msix->entry); 6939 + icb->firmware_options_2 &= cpu_to_le32(~BIT_26); 6946 6940 ql_dbg(ql_dbg_init, vha, 0xf072, 6947 6941 "Registering ICB vector 0x%x for atio que.\n", 6948 6942 msix->entry);
+25 -19
drivers/scsi/scsi_lib.c
··· 111 111 } 112 112 } 113 113 114 - static void scsi_mq_requeue_cmd(struct scsi_cmnd *cmd) 114 + static void scsi_mq_requeue_cmd(struct scsi_cmnd *cmd, unsigned long msecs) 115 115 { 116 116 struct request *rq = scsi_cmd_to_rq(cmd); 117 117 ··· 121 121 } else { 122 122 WARN_ON_ONCE(true); 123 123 } 124 - blk_mq_requeue_request(rq, true); 124 + 125 + if (msecs) { 126 + blk_mq_requeue_request(rq, false); 127 + blk_mq_delay_kick_requeue_list(rq->q, msecs); 128 + } else 129 + blk_mq_requeue_request(rq, true); 125 130 } 126 131 127 132 /** ··· 656 651 return bytes; 657 652 } 658 653 659 - /* Helper for scsi_io_completion() when "reprep" action required. */ 660 - static void scsi_io_completion_reprep(struct scsi_cmnd *cmd, 661 - struct request_queue *q) 662 - { 663 - /* A new command will be prepared and issued. */ 664 - scsi_mq_requeue_cmd(cmd); 665 - } 666 - 667 654 static bool scsi_cmd_runtime_exceeced(struct scsi_cmnd *cmd) 668 655 { 669 656 struct request *req = scsi_cmd_to_rq(cmd); ··· 673 676 return false; 674 677 } 675 678 679 + /* 680 + * When ALUA transition state is returned, reprep the cmd to 681 + * use the ALUA handler's transition timeout. Delay the reprep 682 + * 1 sec to avoid aggressive retries of the target in that 683 + * state. 684 + */ 685 + #define ALUA_TRANSITION_REPREP_DELAY 1000 686 + 676 687 /* Helper for scsi_io_completion() when special action required. */ 677 688 static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result) 678 689 { 679 - struct request_queue *q = cmd->device->request_queue; 680 690 struct request *req = scsi_cmd_to_rq(cmd); 681 691 int level = 0; 682 - enum {ACTION_FAIL, ACTION_REPREP, ACTION_RETRY, 683 - ACTION_DELAYED_RETRY} action; 692 + enum {ACTION_FAIL, ACTION_REPREP, ACTION_DELAYED_REPREP, 693 + ACTION_RETRY, ACTION_DELAYED_RETRY} action; 684 694 struct scsi_sense_hdr sshdr; 685 695 bool sense_valid; 686 696 bool sense_current = true; /* false implies "deferred sense" */ ··· 776 772 action = ACTION_DELAYED_RETRY; 777 773 break; 778 774 case 0x0a: /* ALUA state transition */ 779 - blk_stat = BLK_STS_TRANSPORT; 780 - fallthrough; 775 + action = ACTION_DELAYED_REPREP; 776 + break; 781 777 default: 782 778 action = ACTION_FAIL; 783 779 break; ··· 836 832 return; 837 833 fallthrough; 838 834 case ACTION_REPREP: 839 - scsi_io_completion_reprep(cmd, q); 835 + scsi_mq_requeue_cmd(cmd, 0); 836 + break; 837 + case ACTION_DELAYED_REPREP: 838 + scsi_mq_requeue_cmd(cmd, ALUA_TRANSITION_REPREP_DELAY); 840 839 break; 841 840 case ACTION_RETRY: 842 841 /* Retry the same command immediately */ ··· 933 926 * command block will be released and the queue function will be goosed. If we 934 927 * are not done then we have to figure out what to do next: 935 928 * 936 - * a) We can call scsi_io_completion_reprep(). The request will be 929 + * a) We can call scsi_mq_requeue_cmd(). The request will be 937 930 * unprepared and put back on the queue. Then a new command will 938 931 * be created for it. This should be used if we made forward 939 932 * progress, or if we want to switch from READ(10) to READ(6) for ··· 949 942 void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) 950 943 { 951 944 int result = cmd->result; 952 - struct request_queue *q = cmd->device->request_queue; 953 945 struct request *req = scsi_cmd_to_rq(cmd); 954 946 blk_status_t blk_stat = BLK_STS_OK; 955 947 ··· 985 979 * request just queue the command up again. 986 980 */ 987 981 if (likely(result == 0)) 988 - scsi_io_completion_reprep(cmd, q); 982 + scsi_mq_requeue_cmd(cmd, 0); 989 983 else 990 984 scsi_io_completion_action(cmd, result); 991 985 }
+1 -1
drivers/scsi/storvsc_drv.c
··· 2012 2012 */ 2013 2013 host_dev->handle_error_wq = 2014 2014 alloc_ordered_workqueue("storvsc_error_wq_%d", 2015 - WQ_MEM_RECLAIM, 2015 + 0, 2016 2016 host->host_no); 2017 2017 if (!host_dev->handle_error_wq) { 2018 2018 ret = -ENOMEM;
+1 -1
drivers/ufs/host/ufs-exynos.c
··· 1711 1711 .pa_dbg_option_suite = 0x2E820183, 1712 1712 }; 1713 1713 1714 - struct exynos_ufs_drv_data fsd_ufs_drvs = { 1714 + static const struct exynos_ufs_drv_data fsd_ufs_drvs = { 1715 1715 .uic_attr = &fsd_uic_attr, 1716 1716 .quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN | 1717 1717 UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR |
+1 -5
include/ufs/ufshci.h
··· 135 135 136 136 #define UFSHCD_UIC_MASK (UIC_COMMAND_COMPL | UFSHCD_UIC_PWR_MASK) 137 137 138 - #define UFSHCD_ERROR_MASK (UIC_ERROR |\ 139 - DEVICE_FATAL_ERROR |\ 140 - CONTROLLER_FATAL_ERROR |\ 141 - SYSTEM_BUS_FATAL_ERROR |\ 142 - CRYPTO_ENGINE_FATAL_ERROR) 138 + #define UFSHCD_ERROR_MASK (UIC_ERROR | INT_FATAL_ERRORS) 143 139 144 140 #define INT_FATAL_ERRORS (DEVICE_FATAL_ERROR |\ 145 141 CONTROLLER_FATAL_ERROR |\