Commit 3f2c1002 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: ufs: Use scsi_cmd_to_rq() instead of scsi_cmnd.request

Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Link: https://lore.kernel.org/r/20210809230355.8186-48-bvanassche@acm.orgReviewed-by: default avatarDaejun Park <daejun7.park@samsung.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 77ff7756
...@@ -365,6 +365,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, ...@@ -365,6 +365,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
u32 intr, doorbell; u32 intr, doorbell;
struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct ufshcd_lrb *lrbp = &hba->lrb[tag];
struct scsi_cmnd *cmd = lrbp->cmd; struct scsi_cmnd *cmd = lrbp->cmd;
struct request *rq = scsi_cmd_to_rq(cmd);
int transfer_len = -1; int transfer_len = -1;
if (!cmd) if (!cmd)
...@@ -390,7 +391,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, ...@@ -390,7 +391,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
/* /*
* The number of Bytes to be unmapped beginning with the lba. * The number of Bytes to be unmapped beginning with the lba.
*/ */
transfer_len = blk_rq_bytes(cmd->request); transfer_len = blk_rq_bytes(rq);
} }
intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS); intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
...@@ -2054,7 +2055,7 @@ static void ufshcd_update_monitor(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) ...@@ -2054,7 +2055,7 @@ static void ufshcd_update_monitor(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
spin_lock_irqsave(hba->host->host_lock, flags); spin_lock_irqsave(hba->host->host_lock, flags);
if (dir >= 0 && hba->monitor.nr_queued[dir] > 0) { if (dir >= 0 && hba->monitor.nr_queued[dir] > 0) {
struct request *req = lrbp->cmd->request; struct request *req = scsi_cmd_to_rq(lrbp->cmd);
struct ufs_hba_monitor *m = &hba->monitor; struct ufs_hba_monitor *m = &hba->monitor;
ktime_t now, inc, lat; ktime_t now, inc, lat;
...@@ -2675,7 +2676,7 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i) ...@@ -2675,7 +2676,7 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
{ {
struct ufs_hba *hba = shost_priv(host); struct ufs_hba *hba = shost_priv(host);
int tag = cmd->request->tag; int tag = scsi_cmd_to_rq(cmd)->tag;
struct ufshcd_lrb *lrbp; struct ufshcd_lrb *lrbp;
int err = 0; int err = 0;
...@@ -2734,7 +2735,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) ...@@ -2734,7 +2735,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
lrbp->lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun); lrbp->lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed(hba) ? true : false; lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed(hba) ? true : false;
ufshcd_prepare_lrbp_crypto(cmd->request, lrbp); ufshcd_prepare_lrbp_crypto(scsi_cmd_to_rq(cmd), lrbp);
lrbp->req_abort_skip = false; lrbp->req_abort_skip = false;
...@@ -6993,7 +6994,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) ...@@ -6993,7 +6994,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
{ {
struct Scsi_Host *host = cmd->device->host; struct Scsi_Host *host = cmd->device->host;
struct ufs_hba *hba = shost_priv(host); struct ufs_hba *hba = shost_priv(host);
int tag = cmd->request->tag; int tag = scsi_cmd_to_rq(cmd)->tag;
struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct ufshcd_lrb *lrbp = &hba->lrb[tag];
unsigned long flags; unsigned long flags;
int err = FAILED; int err = FAILED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment