All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kiwoong Kim" <kwmad.kim@samsung.com>
To: "'Stanley Chu'" <chu.stanley@gapp.nthu.edu.tw>
Cc: <linux-scsi@vger.kernel.org>,
	"'Alim Akhtar'" <alim.akhtar@samsung.com>,
	"'Avri Altman'" <avri.altman@wdc.com>,
	"'James E.J. Bottomley'" <jejb@linux.ibm.com>,
	"'Martin K. Petersen'" <martin.petersen@oracle.com>,
	"'Bean Huo \(beanhuo\)'" <beanhuo@micron.com>,
	"'Asutosh Das'" <asutoshd@codeaurora.org>, <cang@codeaurora.org>,
	<bvanassche@acm.org>
Subject: RE: [RFC PATCH v1 1/2] ufs: introduce callbacks to get command information
Date: Mon, 29 Jun 2020 16:01:28 +0900	[thread overview]
Message-ID: <003b01d64de3$1cdd7a00$56986e00$@samsung.com> (raw)
In-Reply-To: <CAOBeenZ41xLfDDjfTUxaRmu4WJfzV+dXNSt3nCi_Oiu-Fi-oBA@mail.gmail.com>

> Hi Kiwoong,
> 
> Kiwoong Kim <kwmad.kim@samsung.com> 於 2020年6月26日 週五 下午7:42寫道:
> >
> > > Hi Kiwoong,
> > >
> > > Kiwoong Kim <kwmad.kim@samsung.com> 於 2020年6月20日 週六 下午3:00寫道:
> > > >
> > > > Some SoC specific might need command history for various reasons,
> such
> > > > as stacking command contexts in system memory to check for debugging
> > > > in the future or scaling some DVFS knobs to boost IO throughput.
> > > >
> > > > What you would do with the information could be variant per SoC
> > > > vendor.
> > > >
> > > > Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
> > > > ---
> > > >  drivers/scsi/ufs/ufshcd.c | 4 ++++
> > > >  drivers/scsi/ufs/ufshcd.h | 8 ++++++++
> > > >  2 files changed, 12 insertions(+)
> > > >
> > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> > > > index 52abe82..0eae3ce 100644
> > > > --- a/drivers/scsi/ufs/ufshcd.c
> > > > +++ b/drivers/scsi/ufs/ufshcd.c
> > > > @@ -2545,6 +2545,8 @@ static int ufshcd_queuecommand(struct
> Scsi_Host
> > > *host, struct scsi_cmnd *cmd)
> > > >         /* issue command to the controller */
> > > >         spin_lock_irqsave(hba->host->host_lock, flags);
> > > >         ufshcd_vops_setup_xfer_req(hba, tag, true);
> > > > +       if (cmd)
> > > > +               ufshcd_vops_cmd_log(hba, cmd, 1);
> > > >         ufshcd_send_command(hba, tag);
> > > >  out_unlock:
> > > >         spin_unlock_irqrestore(hba->host->host_lock, flags); @@
> > > > -4890,6 +4892,8 @@ static void __ufshcd_transfer_req_compl(struct
> > > ufs_hba *hba,
> > > >                         /* Mark completed command as NULL in LRB */
> > > >                         lrbp->cmd = NULL;
> > > >                         lrbp->compl_time_stamp = ktime_get();
> > > > +                       ufshcd_vops_cmd_log(hba, cmd, 2);
> > > > +
> > > >                         /* Do not touch lrbp after scsi done */
> > > >                         cmd->scsi_done(cmd);
> > > >                         __ufshcd_release(hba);
> > >
> > > If your cmd_log vop callbacks are only existed in
> "ufshcd_queuecommand"
> > > and "ufshcd_transfer_req_compl", perhaps you could re-use
> > > "ufshcd_vops_setup_xfer_req()" and an added "ufshcd_vops_compl_req()"
> > > instead of a brand new "ufshcd_vops_cmd_log()" ?
> > >
> > > Thanks,
> > > Stanley Chu
> >
> > Currently, ufshcd_vops_setup_xfer_req doesn't get scsi_cmnd variable.
> 
> You could get scsi_cmnd by hba->lrb[tag].cmd if is_scsi_cmd is true in
> your ufshcd_vops_setup_xfer_req vendor implementation.
> 
> > Actually, when introduced this callback first, I was willing to make it
> do that
> > but someone gave me another idea. Then do you agree to change argument
> set of the function?
> >
> > And I can't find ufshcd_vops_compl_req in 5.9/scsi-queue. Could you let
> me know where to find?
> >
> 
> Sorry to not describing clearly. What I mean is that you could "add"
> ufshcd_vops_compl_xfer_req vop callback in your patch.
> 
> Thanks,
> Stanley Chu

Got it and I'll refer to what you said.
Thanks.
Kiwoong Kim




  reply	other threads:[~2020-06-29 21:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200620070044epcas2p269e3c266c86c65dd0e894d8188036a30@epcas2p2.samsung.com>
2020-06-20  6:53 ` [RFC PATCH v1 1/2] ufs: introduce callbacks to get command information Kiwoong Kim
     [not found]   ` <CGME20200620070047epcas2p37229d52d479df9f64ee4fc14f469acf9@epcas2p3.samsung.com>
2020-06-20  6:53     ` [RFC PATCH v1 2/2] exynos-ufs: support command history Kiwoong Kim
2020-06-20 15:26       ` kernel test robot
2020-06-20 19:08       ` kernel test robot
2020-06-24  3:10       ` Bart Van Assche
2020-06-29  8:49         ` Kiwoong Kim
2020-06-29 10:08         ` Kiwoong Kim
2020-06-20 16:33   ` [RFC PATCH v1 1/2] ufs: introduce callbacks to get command information Bart Van Assche
2020-06-23  2:28     ` Kiwoong Kim
2020-06-24  2:53       ` Bart Van Assche
2020-06-22 11:35   ` Dan Carpenter
2020-06-22 11:35     ` Dan Carpenter
2020-06-25 14:05   ` Stanley Chu
2020-06-26 11:42     ` Kiwoong Kim
2020-06-26 12:29       ` Stanley Chu
2020-06-29  7:01         ` Kiwoong Kim [this message]
2020-06-29  7:11         ` Kiwoong Kim
2020-06-20 19:48 kernel test robot

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='003b01d64de3$1cdd7a00$56986e00$@samsung.com' \
    --to=kwmad.kim@samsung.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=chu.stanley@gapp.nthu.edu.tw \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.