Skip to content

Commit 2788360

Browse files
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 <[email protected]>
2 parents 568035b + d957e7f commit 2788360

File tree

7 files changed

+32
-41
lines changed

7 files changed

+32
-41
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7153,22 +7153,18 @@ static int megasas_alloc_ctrl_mem(struct megasas_instance *instance)
71537153
switch (instance->adapter_type) {
71547154
case MFI_SERIES:
71557155
if (megasas_alloc_mfi_ctrl_mem(instance))
7156-
goto fail;
7156+
return -ENOMEM;
71577157
break;
71587158
case AERO_SERIES:
71597159
case VENTURA_SERIES:
71607160
case THUNDERBOLT_SERIES:
71617161
case INVADER_SERIES:
71627162
if (megasas_alloc_fusion_context(instance))
7163-
goto fail;
7163+
return -ENOMEM;
71647164
break;
71657165
}
71667166

71677167
return 0;
7168-
fail:
7169-
kfree(instance->reply_map);
7170-
instance->reply_map = NULL;
7171-
return -ENOMEM;
71727168
}
71737169

71747170
/*

drivers/scsi/megaraid/megaraid_sas_fusion.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5310,7 +5310,6 @@ megasas_alloc_fusion_context(struct megasas_instance *instance)
53105310
if (!fusion->log_to_span) {
53115311
dev_err(&instance->pdev->dev, "Failed from %s %d\n",
53125312
__func__, __LINE__);
5313-
kfree(instance->ctrl_context);
53145313
return -ENOMEM;
53155314
}
53165315
}

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6935,14 +6935,8 @@ qlt_24xx_config_rings(struct scsi_qla_host *vha)
69356935

69366936
if (ha->flags.msix_enabled) {
69376937
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);
69466940
ql_dbg(ql_dbg_init, vha, 0xf072,
69476941
"Registering ICB vector 0x%x for atio que.\n",
69486942
msix->entry);

drivers/scsi/scsi_lib.c

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ scsi_set_blocked(struct scsi_cmnd *cmd, int reason)
111111
}
112112
}
113113

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)
115115
{
116116
struct request *rq = scsi_cmd_to_rq(cmd);
117117

@@ -121,7 +121,12 @@ static void scsi_mq_requeue_cmd(struct scsi_cmnd *cmd)
121121
} else {
122122
WARN_ON_ONCE(true);
123123
}
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);
125130
}
126131

127132
/**
@@ -651,14 +656,6 @@ static unsigned int scsi_rq_err_bytes(const struct request *rq)
651656
return bytes;
652657
}
653658

654-
/* Helper for scsi_io_completion() when "reprep" action required. */
655-
static void scsi_io_completion_reprep(struct scsi_cmnd *cmd,
656-
struct request_queue *q)
657-
{
658-
/* A new command will be prepared and issued. */
659-
scsi_mq_requeue_cmd(cmd);
660-
}
661-
662659
static bool scsi_cmd_runtime_exceeced(struct scsi_cmnd *cmd)
663660
{
664661
struct request *req = scsi_cmd_to_rq(cmd);
@@ -676,14 +673,21 @@ static bool scsi_cmd_runtime_exceeced(struct scsi_cmnd *cmd)
676673
return false;
677674
}
678675

676+
/*
677+
* When ALUA transition state is returned, reprep the cmd to
678+
* use the ALUA handler's transition timeout. Delay the reprep
679+
* 1 sec to avoid aggressive retries of the target in that
680+
* state.
681+
*/
682+
#define ALUA_TRANSITION_REPREP_DELAY 1000
683+
679684
/* Helper for scsi_io_completion() when special action required. */
680685
static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
681686
{
682-
struct request_queue *q = cmd->device->request_queue;
683687
struct request *req = scsi_cmd_to_rq(cmd);
684688
int level = 0;
685-
enum {ACTION_FAIL, ACTION_REPREP, ACTION_RETRY,
686-
ACTION_DELAYED_RETRY} action;
689+
enum {ACTION_FAIL, ACTION_REPREP, ACTION_DELAYED_REPREP,
690+
ACTION_RETRY, ACTION_DELAYED_RETRY} action;
687691
struct scsi_sense_hdr sshdr;
688692
bool sense_valid;
689693
bool sense_current = true; /* false implies "deferred sense" */
@@ -772,8 +776,8 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
772776
action = ACTION_DELAYED_RETRY;
773777
break;
774778
case 0x0a: /* ALUA state transition */
775-
blk_stat = BLK_STS_TRANSPORT;
776-
fallthrough;
779+
action = ACTION_DELAYED_REPREP;
780+
break;
777781
default:
778782
action = ACTION_FAIL;
779783
break;
@@ -832,7 +836,10 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
832836
return;
833837
fallthrough;
834838
case ACTION_REPREP:
835-
scsi_io_completion_reprep(cmd, q);
839+
scsi_mq_requeue_cmd(cmd, 0);
840+
break;
841+
case ACTION_DELAYED_REPREP:
842+
scsi_mq_requeue_cmd(cmd, ALUA_TRANSITION_REPREP_DELAY);
836843
break;
837844
case ACTION_RETRY:
838845
/* Retry the same command immediately */
@@ -926,7 +933,7 @@ static int scsi_io_completion_nz_result(struct scsi_cmnd *cmd, int result,
926933
* command block will be released and the queue function will be goosed. If we
927934
* are not done then we have to figure out what to do next:
928935
*
929-
* a) We can call scsi_io_completion_reprep(). The request will be
936+
* a) We can call scsi_mq_requeue_cmd(). The request will be
930937
* unprepared and put back on the queue. Then a new command will
931938
* be created for it. This should be used if we made forward
932939
* progress, or if we want to switch from READ(10) to READ(6) for
@@ -942,7 +949,6 @@ static int scsi_io_completion_nz_result(struct scsi_cmnd *cmd, int result,
942949
void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
943950
{
944951
int result = cmd->result;
945-
struct request_queue *q = cmd->device->request_queue;
946952
struct request *req = scsi_cmd_to_rq(cmd);
947953
blk_status_t blk_stat = BLK_STS_OK;
948954

@@ -979,7 +985,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
979985
* request just queue the command up again.
980986
*/
981987
if (likely(result == 0))
982-
scsi_io_completion_reprep(cmd, q);
988+
scsi_mq_requeue_cmd(cmd, 0);
983989
else
984990
scsi_io_completion_action(cmd, result);
985991
}

drivers/scsi/storvsc_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ static int storvsc_probe(struct hv_device *device,
20122012
*/
20132013
host_dev->handle_error_wq =
20142014
alloc_ordered_workqueue("storvsc_error_wq_%d",
2015-
WQ_MEM_RECLAIM,
2015+
0,
20162016
host->host_no);
20172017
if (!host_dev->handle_error_wq) {
20182018
ret = -ENOMEM;

drivers/ufs/host/ufs-exynos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ static struct exynos_ufs_uic_attr fsd_uic_attr = {
17111711
.pa_dbg_option_suite = 0x2E820183,
17121712
};
17131713

1714-
struct exynos_ufs_drv_data fsd_ufs_drvs = {
1714+
static const struct exynos_ufs_drv_data fsd_ufs_drvs = {
17151715
.uic_attr = &fsd_uic_attr,
17161716
.quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN |
17171717
UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR |

include/ufs/ufshci.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@ static inline u32 ufshci_version(u32 major, u32 minor)
135135

136136
#define UFSHCD_UIC_MASK (UIC_COMMAND_COMPL | UFSHCD_UIC_PWR_MASK)
137137

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)
143139

144140
#define INT_FATAL_ERRORS (DEVICE_FATAL_ERROR |\
145141
CONTROLLER_FATAL_ERROR |\

0 commit comments

Comments
 (0)