Message ID | 20250403211937.2225615-10-bvanassche@acm.org |
---|---|
State | New |
Headers | show |
Series | Optimize the hot path in the UFS driver | expand |
> Change the 'task_tag' argument into an LRB pointer. This patch prepares for the > removal of the hba->lrb[] array. > > Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Avri Altman <avri.altman@sandisk.com> > --- > drivers/ufs/core/ufshcd.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index > f87526443d8d..883551274330 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -2292,14 +2292,13 @@ static void ufshcd_update_monitor(struct ufs_hba > *hba, const struct ufshcd_lrb * > /** > * ufshcd_send_command - Send SCSI or device management commands > * @hba: per adapter instance > - * @task_tag: Task tag of the command > + * @lrbp: Local reference block of SCSI command > * @hwq: pointer to hardware queue instance > */ > -static inline > -void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag, > - struct ufs_hw_queue *hwq) > +static inline void ufshcd_send_command(struct ufs_hba *hba, > + struct ufshcd_lrb *lrbp, > + struct ufs_hw_queue *hwq) > { > - struct ufshcd_lrb *lrbp = &hba->lrb[task_tag]; > unsigned long flags; > > lrbp->issue_time_stamp = ktime_get(); > @@ -3029,7 +3028,7 @@ static int ufshcd_queuecommand(struct Scsi_Host > *host, struct scsi_cmnd *cmd) > if (hba->mcq_enabled) > hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd)); > > - ufshcd_send_command(hba, tag, hwq); > + ufshcd_send_command(hba, lrbp, hwq); > > out: > if (ufs_trigger_eh(hba)) { > @@ -3263,7 +3262,7 @@ static int ufshcd_issue_dev_cmd(struct ufs_hba *hba, > struct ufshcd_lrb *lrbp, > int err; > > ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp- > >ucd_req_ptr); > - ufshcd_send_command(hba, tag, hba->dev_cmd_queue); > + ufshcd_send_command(hba, lrbp, hba->dev_cmd_queue); > err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout); > > ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : > UFS_QUERY_COMP,
On Thu, 2025-04-03 at 14:17 -0700, Bart Van Assche wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > Change the 'task_tag' argument into an LRB pointer. This patch > prepares > for the removal of the hba->lrb[] array. > > Signed-off-by: Bart Van Assche <bvanassche@acm.org> > --- Reviewed-by: Peter Wang <peter.wang@mediatek.com>
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index f87526443d8d..883551274330 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -2292,14 +2292,13 @@ static void ufshcd_update_monitor(struct ufs_hba *hba, const struct ufshcd_lrb * /** * ufshcd_send_command - Send SCSI or device management commands * @hba: per adapter instance - * @task_tag: Task tag of the command + * @lrbp: Local reference block of SCSI command * @hwq: pointer to hardware queue instance */ -static inline -void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag, - struct ufs_hw_queue *hwq) +static inline void ufshcd_send_command(struct ufs_hba *hba, + struct ufshcd_lrb *lrbp, + struct ufs_hw_queue *hwq) { - struct ufshcd_lrb *lrbp = &hba->lrb[task_tag]; unsigned long flags; lrbp->issue_time_stamp = ktime_get(); @@ -3029,7 +3028,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) if (hba->mcq_enabled) hwq = ufshcd_mcq_req_to_hwq(hba, scsi_cmd_to_rq(cmd)); - ufshcd_send_command(hba, tag, hwq); + ufshcd_send_command(hba, lrbp, hwq); out: if (ufs_trigger_eh(hba)) { @@ -3263,7 +3262,7 @@ static int ufshcd_issue_dev_cmd(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, int err; ufshcd_add_query_upiu_trace(hba, UFS_QUERY_SEND, lrbp->ucd_req_ptr); - ufshcd_send_command(hba, tag, hba->dev_cmd_queue); + ufshcd_send_command(hba, lrbp, hba->dev_cmd_queue); err = ufshcd_wait_for_dev_cmd(hba, lrbp, timeout); ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP,
Change the 'task_tag' argument into an LRB pointer. This patch prepares for the removal of the hba->lrb[] array. Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/ufs/core/ufshcd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)