Revert "KMI: BACKPORT: FROMGIT: scsi: ufs: Optimize host lock on transfer requests send/compl paths"

This patch avoids KMI, so later should be reverted to sync with upstream in
next KMI update.

Bug: 192095860
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: If861ecde381f23b5d5f18005063ec55356673fdb
This commit is contained in:
Jaegeuk Kim
2021-06-25 23:22:54 -07:00
parent 46575badbb
commit 850f11aa85
2 changed files with 6 additions and 11 deletions

View File

@@ -2665,7 +2665,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
(hba->clk_gating.state != CLKS_ON)); (hba->clk_gating.state != CLKS_ON));
lrbp = &hba->lrb[tag]; lrbp = &hba->lrb[tag];
if (unlikely(lrbp->in_use)) { if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
if (hba->pm_op_in_progress) if (hba->pm_op_in_progress)
set_host_byte(cmd, DID_BAD_TARGET); set_host_byte(cmd, DID_BAD_TARGET);
else else
@@ -2925,7 +2925,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
init_completion(&wait); init_completion(&wait);
lrbp = &hba->lrb[tag]; lrbp = &hba->lrb[tag];
if (unlikely(lrbp->in_use)) { if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
err = -EBUSY; err = -EBUSY;
goto out; goto out;
} }
@@ -5134,8 +5134,9 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
bool update_scaling = false; bool update_scaling = false;
for_each_set_bit(index, &completed_reqs, hba->nutrs) { for_each_set_bit(index, &completed_reqs, hba->nutrs) {
if (!test_and_clear_bit(index, &hba->outstanding_reqs))
continue;
lrbp = &hba->lrb[index]; lrbp = &hba->lrb[index];
lrbp->in_use = false;
lrbp->compl_time_stamp = ktime_get(); lrbp->compl_time_stamp = ktime_get();
cmd = lrbp->cmd; cmd = lrbp->cmd;
if (cmd) { if (cmd) {
@@ -5167,9 +5168,6 @@ static void __ufshcd_transfer_req_compl(struct ufs_hba *hba,
hba->clk_scaling.active_reqs--; hba->clk_scaling.active_reqs--;
} }
/* clear corresponding bits of completed commands */
hba->outstanding_reqs ^= completed_reqs;
ufshcd_clk_scaling_update_busy(hba); ufshcd_clk_scaling_update_busy(hba);
} }
@@ -6603,11 +6601,11 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag)); WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag));
init_completion(&wait); init_completion(&wait);
lrbp = &hba->lrb[tag]; if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
if (unlikely(lrbp->in_use)) {
err = -EBUSY; err = -EBUSY;
goto out; goto out;
} }
lrbp = &hba->lrb[tag];
WARN_ON(lrbp->cmd); WARN_ON(lrbp->cmd);
lrbp->cmd = NULL; lrbp->cmd = NULL;
@@ -6976,7 +6974,6 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
if (lrbp->cmd) { if (lrbp->cmd) {
__ufshcd_transfer_req_compl(hba, (1UL << tag)); __ufshcd_transfer_req_compl(hba, (1UL << tag));
__set_bit(tag, &hba->outstanding_reqs); __set_bit(tag, &hba->outstanding_reqs);
lrbp->in_use = true;
hba->force_reset = true; hba->force_reset = true;
ufshcd_schedule_eh_work(hba); ufshcd_schedule_eh_work(hba);
} }

View File

@@ -188,7 +188,6 @@ struct ufs_pm_lvl_states {
* @crypto_key_slot: the key slot to use for inline crypto (-1 if none) * @crypto_key_slot: the key slot to use for inline crypto (-1 if none)
* @data_unit_num: the data unit number for the first block for inline crypto * @data_unit_num: the data unit number for the first block for inline crypto
* @req_abort_skip: skip request abort task flag * @req_abort_skip: skip request abort task flag
* @in_use: indicates that this lrb is still in use
*/ */
struct ufshcd_lrb { struct ufshcd_lrb {
struct utp_transfer_req_desc *utr_descriptor_ptr; struct utp_transfer_req_desc *utr_descriptor_ptr;
@@ -218,7 +217,6 @@ struct ufshcd_lrb {
#endif #endif
bool req_abort_skip; bool req_abort_skip;
bool in_use;
}; };
/** /**