From: Bean Huo <huobean@gmail.com>
To: alim.akhtar@samsung.com, avri.altman@wdc.com,
asutoshd@codeaurora.org, jejb@linux.ibm.com,
martin.petersen@oracle.com, stanley.chu@mediatek.com,
beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com,
cang@codeaurora.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [REF PATCH] scsi: ufs: fix lrbp pointer incorrect initialization issue
Date: Sun, 8 Mar 2020 01:16:27 +0100 [thread overview]
Message-ID: <20200308001627.19108-1-beanhuo@micron.com> (raw)
The paramter cmd of ufshcd_init_cmd_priv() didn't take correct
tag value, this results in all pointers of lrbp points to first
the lrbp.
As this is just observed, this patch is for referecen so others
who want to use latest UFS driver can avoid this issue.
Fixes: 34656dda81ac ("scsi: ufs: Let the SCSI core allocate per-command UFS data")
---
drivers/scsi/ufs/ufshcd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index e987fa3a77c7..3ccf431e21b8 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2471,6 +2471,8 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
BUG();
}
+ ufshcd_init_lrb(hba, lrbp, tag);
+
WARN_ON_ONCE(!ufshcd_is_scsi(cmd->request));
if (!down_read_trylock(&hba->clk_scaling_lock))
@@ -2713,6 +2715,8 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
hba->dev_cmd.complete = &wait;
+ ufshcd_init_lrb(hba, lrbp, tag);
+
ufshcd_add_query_upiu_trace(hba, tag, "query_send");
/* Make sure descriptors are ready before ringing the doorbell */
wmb();
@@ -5900,6 +5904,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
init_completion(&wait);
lrbp = ufshcd_req_to_lrb(req);
+ ufshcd_init_lrb(hba, lrbp, tag);
lrbp->sense_bufflen = 0;
lrbp->sense_buffer = NULL;
lrbp->task_tag = tag;
--
2.17.1
reply other threads:[~2020-03-08 0:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200308001627.19108-1-beanhuo@micron.com \
--to=huobean@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stanley.chu@mediatek.com \
--cc=tomas.winkler@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®